zerogterm 0.9.2-alpha.1 → 1.0.0

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.
@@ -1,149 +0,0 @@
1
- (function(){const C=document.createElement("link").relList;if(C&&C.supports&&C.supports("modulepreload"))return;for(const N of document.querySelectorAll('link[rel="modulepreload"]'))A(N);new MutationObserver(N=>{for(const G of N)if(G.type==="childList")for(const P of G.addedNodes)P.tagName==="LINK"&&P.rel==="modulepreload"&&A(P)}).observe(document,{childList:!0,subtree:!0});function E(N){const G={};return N.integrity&&(G.integrity=N.integrity),N.referrerPolicy&&(G.referrerPolicy=N.referrerPolicy),N.crossOrigin==="use-credentials"?G.credentials="include":N.crossOrigin==="anonymous"?G.credentials="omit":G.credentials="same-origin",G}function A(N){if(N.ep)return;N.ep=!0;const G=E(N);fetch(N.href,G)}})();function jg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Su={exports:{}},$o={};var $_;function Ng(){if($_)return $o;$_=1;var n=Symbol.for("react.transitional.element"),C=Symbol.for("react.fragment");function E(A,N,G){var P=null;if(G!==void 0&&(P=""+G),N.key!==void 0&&(P=""+N.key),"key"in N){G={};for(var r in N)r!=="key"&&(G[r]=N[r])}else G=N;return N=G.ref,{$$typeof:n,type:A,key:P,ref:N!==void 0?N:null,props:G}}return $o.Fragment=C,$o.jsx=E,$o.jsxs=E,$o}var F_;function Hg(){return F_||(F_=1,Su.exports=Ng()),Su.exports}var c=Hg(),bu={exports:{}},Fe={};var W_;function zg(){if(W_)return Fe;W_=1;var n=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),P=Symbol.for("react.context"),r=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),l=Symbol.for("react.activity"),S=Symbol.iterator;function x(B){return B===null||typeof B!="object"?null:(B=S&&B[S]||B["@@iterator"],typeof B=="function"?B:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,a={};function u(B,F,te){this.props=B,this.context=F,this.refs=a,this.updater=te||R}u.prototype.isReactComponent={},u.prototype.setState=function(B,F){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,F,"setState")},u.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function f(){}f.prototype=u.prototype;function h(B,F,te){this.props=B,this.context=F,this.refs=a,this.updater=te||R}var b=h.prototype=new f;b.constructor=h,m(b,u.prototype),b.isPureReactComponent=!0;var M=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},y=Object.prototype.hasOwnProperty;function L(B,F,te){var ie=te.ref;return{$$typeof:n,type:B,key:F,ref:ie!==void 0?ie:null,props:te}}function O(B,F){return L(B.type,F,B.props)}function U(B){return typeof B=="object"&&B!==null&&B.$$typeof===n}function H(B){var F={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(te){return F[te]})}var z=/\/+/g;function Y(B,F){return typeof B=="object"&&B!==null&&B.key!=null?H(""+B.key):F.toString(36)}function ne(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(w,w):(B.status="pending",B.then(function(F){B.status==="pending"&&(B.status="fulfilled",B.value=F)},function(F){B.status==="pending"&&(B.status="rejected",B.reason=F)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function V(B,F,te,ie,he){var ge=typeof B;(ge==="undefined"||ge==="boolean")&&(B=null);var J=!1;if(B===null)J=!0;else switch(ge){case"bigint":case"string":case"number":J=!0;break;case"object":switch(B.$$typeof){case n:case C:J=!0;break;case p:return J=B._init,V(J(B._payload),F,te,ie,he)}}if(J)return he=he(B),J=ie===""?"."+Y(B,0):ie,M(he)?(te="",J!=null&&(te=J.replace(z,"$&/")+"/"),V(he,F,te,"",function(_e){return _e})):he!=null&&(U(he)&&(he=O(he,te+(he.key==null||B&&B.key===he.key?"":(""+he.key).replace(z,"$&/")+"/")+J)),F.push(he)),1;J=0;var q=ie===""?".":ie+":";if(M(B))for(var re=0;re<B.length;re++)ie=B[re],ge=q+Y(ie,re),J+=V(ie,F,te,ge,he);else if(re=x(B),typeof re=="function")for(B=re.call(B),re=0;!(ie=B.next()).done;)ie=ie.value,ge=q+Y(ie,re++),J+=V(ie,F,te,ge,he);else if(ge==="object"){if(typeof B.then=="function")return V(ne(B),F,te,ie,he);throw F=String(B),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return J}function X(B,F,te){if(B==null)return B;var ie=[],he=0;return V(B,ie,"","",function(ge){return F.call(te,ge,he++)}),ie}function I(B){if(B._status===-1){var F=B._result;F=F(),F.then(function(te){(B._status===0||B._status===-1)&&(B._status=1,B._result=te)},function(te){(B._status===0||B._status===-1)&&(B._status=2,B._result=te)}),B._status===-1&&(B._status=0,B._result=F)}if(B._status===1)return B._result.default;throw B._result}var j=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},W={map:X,forEach:function(B,F,te){X(B,function(){F.apply(this,arguments)},te)},count:function(B){var F=0;return X(B,function(){F++}),F},toArray:function(B){return X(B,function(F){return F})||[]},only:function(B){if(!U(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Fe.Activity=l,Fe.Children=W,Fe.Component=u,Fe.Fragment=E,Fe.Profiler=N,Fe.PureComponent=h,Fe.StrictMode=A,Fe.Suspense=d,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(B){return T.H.useMemoCache(B)}},Fe.cache=function(B){return function(){return B.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(B,F,te){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var ie=m({},B.props),he=B.key;if(F!=null)for(ge in F.key!==void 0&&(he=""+F.key),F)!y.call(F,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&F.ref===void 0||(ie[ge]=F[ge]);var ge=arguments.length-2;if(ge===1)ie.children=te;else if(1<ge){for(var J=Array(ge),q=0;q<ge;q++)J[q]=arguments[q+2];ie.children=J}return L(B.type,he,ie)},Fe.createContext=function(B){return B={$$typeof:P,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:G,_context:B},B},Fe.createElement=function(B,F,te){var ie,he={},ge=null;if(F!=null)for(ie in F.key!==void 0&&(ge=""+F.key),F)y.call(F,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(he[ie]=F[ie]);var J=arguments.length-2;if(J===1)he.children=te;else if(1<J){for(var q=Array(J),re=0;re<J;re++)q[re]=arguments[re+2];he.children=q}if(B&&B.defaultProps)for(ie in J=B.defaultProps,J)he[ie]===void 0&&(he[ie]=J[ie]);return L(B,ge,he)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(B){return{$$typeof:r,render:B}},Fe.isValidElement=U,Fe.lazy=function(B){return{$$typeof:p,_payload:{_status:-1,_result:B},_init:I}},Fe.memo=function(B,F){return{$$typeof:g,type:B,compare:F===void 0?null:F}},Fe.startTransition=function(B){var F=T.T,te={};T.T=te;try{var ie=B(),he=T.S;he!==null&&he(te,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(w,j)}catch(ge){j(ge)}finally{F!==null&&te.types!==null&&(F.types=te.types),T.T=F}},Fe.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},Fe.use=function(B){return T.H.use(B)},Fe.useActionState=function(B,F,te){return T.H.useActionState(B,F,te)},Fe.useCallback=function(B,F){return T.H.useCallback(B,F)},Fe.useContext=function(B){return T.H.useContext(B)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(B,F){return T.H.useDeferredValue(B,F)},Fe.useEffect=function(B,F){return T.H.useEffect(B,F)},Fe.useEffectEvent=function(B){return T.H.useEffectEvent(B)},Fe.useId=function(){return T.H.useId()},Fe.useImperativeHandle=function(B,F,te){return T.H.useImperativeHandle(B,F,te)},Fe.useInsertionEffect=function(B,F){return T.H.useInsertionEffect(B,F)},Fe.useLayoutEffect=function(B,F){return T.H.useLayoutEffect(B,F)},Fe.useMemo=function(B,F){return T.H.useMemo(B,F)},Fe.useOptimistic=function(B,F){return T.H.useOptimistic(B,F)},Fe.useReducer=function(B,F,te){return T.H.useReducer(B,F,te)},Fe.useRef=function(B){return T.H.useRef(B)},Fe.useState=function(B){return T.H.useState(B)},Fe.useSyncExternalStore=function(B,F,te){return T.H.useSyncExternalStore(B,F,te)},Fe.useTransition=function(){return T.H.useTransition()},Fe.version="19.2.8",Fe}var q_;function Pu(){return q_||(q_=1,bu.exports=zg()),bu.exports}var Z=Pu();const An=jg(Z);var yu={exports:{}},Fo={},Cu={exports:{}},wu={};var G_;function Ug(){return G_||(G_=1,(function(n){function C(V,X){var I=V.length;V.push(X);e:for(;0<I;){var j=I-1>>>1,W=V[j];if(0<N(W,X))V[j]=X,V[I]=W,I=j;else break e}}function E(V){return V.length===0?null:V[0]}function A(V){if(V.length===0)return null;var X=V[0],I=V.pop();if(I!==X){V[0]=I;e:for(var j=0,W=V.length,B=W>>>1;j<B;){var F=2*(j+1)-1,te=V[F],ie=F+1,he=V[ie];if(0>N(te,I))ie<W&&0>N(he,te)?(V[j]=he,V[ie]=I,j=ie):(V[j]=te,V[F]=I,j=F);else if(ie<W&&0>N(he,I))V[j]=he,V[ie]=I,j=ie;else break e}}return X}function N(V,X){var I=V.sortIndex-X.sortIndex;return I!==0?I:V.id-X.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var G=performance;n.unstable_now=function(){return G.now()}}else{var P=Date,r=P.now();n.unstable_now=function(){return P.now()-r}}var d=[],g=[],p=1,l=null,S=3,x=!1,R=!1,m=!1,a=!1,u=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;function b(V){for(var X=E(g);X!==null;){if(X.callback===null)A(g);else if(X.startTime<=V)A(g),X.sortIndex=X.expirationTime,C(d,X);else break;X=E(g)}}function M(V){if(m=!1,b(V),!R)if(E(d)!==null)R=!0,w||(w=!0,H());else{var X=E(g);X!==null&&ne(M,X.startTime-V)}}var w=!1,T=-1,y=5,L=-1;function O(){return a?!0:!(n.unstable_now()-L<y)}function U(){if(a=!1,w){var V=n.unstable_now();L=V;var X=!0;try{e:{R=!1,m&&(m=!1,f(T),T=-1),x=!0;var I=S;try{t:{for(b(V),l=E(d);l!==null&&!(l.expirationTime>V&&O());){var j=l.callback;if(typeof j=="function"){l.callback=null,S=l.priorityLevel;var W=j(l.expirationTime<=V);if(V=n.unstable_now(),typeof W=="function"){l.callback=W,b(V),X=!0;break t}l===E(d)&&A(d),b(V)}else A(d);l=E(d)}if(l!==null)X=!0;else{var B=E(g);B!==null&&ne(M,B.startTime-V),X=!1}}break e}finally{l=null,S=I,x=!1}X=void 0}}finally{X?H():w=!1}}}var H;if(typeof h=="function")H=function(){h(U)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,Y=z.port2;z.port1.onmessage=U,H=function(){Y.postMessage(null)}}else H=function(){u(U,0)};function ne(V,X){T=u(function(){V(n.unstable_now())},X)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(V){V.callback=null},n.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):y=0<V?Math.floor(1e3/V):5},n.unstable_getCurrentPriorityLevel=function(){return S},n.unstable_next=function(V){switch(S){case 1:case 2:case 3:var X=3;break;default:X=S}var I=S;S=X;try{return V()}finally{S=I}},n.unstable_requestPaint=function(){a=!0},n.unstable_runWithPriority=function(V,X){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var I=S;S=V;try{return X()}finally{S=I}},n.unstable_scheduleCallback=function(V,X,I){var j=n.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?j+I:j):I=j,V){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=I+W,V={id:p++,callback:X,priorityLevel:V,startTime:I,expirationTime:W,sortIndex:-1},I>j?(V.sortIndex=I,C(g,V),E(d)===null&&V===E(g)&&(m?(f(T),T=-1):m=!0,ne(M,I-j))):(V.sortIndex=W,C(d,V),R||x||(R=!0,w||(w=!0,H()))),V},n.unstable_shouldYield=O,n.unstable_wrapCallback=function(V){var X=S;return function(){var I=S;S=X;try{return V.apply(this,arguments)}finally{S=I}}}})(wu)),wu}var K_;function Ig(){return K_||(K_=1,Cu.exports=Ug()),Cu.exports}var xu={exports:{}},ii={};var V_;function Pg(){if(V_)return ii;V_=1;var n=Pu();function C(d){var g="https://react.dev/errors/"+d;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)g+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function E(){}var A={d:{f:E,r:function(){throw Error(C(522))},D:E,C:E,L:E,m:E,X:E,S:E,M:E},p:0,findDOMNode:null},N=Symbol.for("react.portal");function G(d,g,p){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:N,key:l==null?null:""+l,children:d,containerInfo:g,implementation:p}}var P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function r(d,g){if(d==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return ii.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,ii.createPortal=function(d,g){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(C(299));return G(d,g,null,p)},ii.flushSync=function(d){var g=P.T,p=A.p;try{if(P.T=null,A.p=2,d)return d()}finally{P.T=g,A.p=p,A.d.f()}},ii.preconnect=function(d,g){typeof d=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,A.d.C(d,g))},ii.prefetchDNS=function(d){typeof d=="string"&&A.d.D(d)},ii.preinit=function(d,g){if(typeof d=="string"&&g&&typeof g.as=="string"){var p=g.as,l=r(p,g.crossOrigin),S=typeof g.integrity=="string"?g.integrity:void 0,x=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;p==="style"?A.d.S(d,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:l,integrity:S,fetchPriority:x}):p==="script"&&A.d.X(d,{crossOrigin:l,integrity:S,fetchPriority:x,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},ii.preinitModule=function(d,g){if(typeof d=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var p=r(g.as,g.crossOrigin);A.d.M(d,{crossOrigin:p,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&A.d.M(d)},ii.preload=function(d,g){if(typeof d=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var p=g.as,l=r(p,g.crossOrigin);A.d.L(d,p,{crossOrigin:l,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},ii.preloadModule=function(d,g){if(typeof d=="string")if(g){var p=r(g.as,g.crossOrigin);A.d.m(d,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:p,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else A.d.m(d)},ii.requestFormReset=function(d){A.d.r(d)},ii.unstable_batchedUpdates=function(d,g){return d(g)},ii.useFormState=function(d,g,p){return P.H.useFormState(d,g,p)},ii.useFormStatus=function(){return P.H.useHostTransitionStatus()},ii.version="19.2.8",ii}var Y_;function $p(){if(Y_)return xu.exports;Y_=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(C){console.error(C)}}return n(),xu.exports=Pg(),xu.exports}var X_;function $g(){if(X_)return Fo;X_=1;var n=Ig(),C=Pu(),E=$p();function A(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 N(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function G(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 P(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 r(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 d(e){if(G(e)!==e)throw Error(A(188))}function g(e){var t=e.alternate;if(!t){if(t=G(e),t===null)throw Error(A(188));return t!==e?null:e}for(var i=e,s=t;;){var o=i.return;if(o===null)break;var _=o.alternate;if(_===null){if(s=o.return,s!==null){i=s;continue}break}if(o.child===_.child){for(_=o.child;_;){if(_===i)return d(o),e;if(_===s)return d(o),t;_=_.sibling}throw Error(A(188))}if(i.return!==s.return)i=o,s=_;else{for(var D=!1,$=o.child;$;){if($===i){D=!0,i=o,s=_;break}if($===s){D=!0,s=o,i=_;break}$=$.sibling}if(!D){for($=_.child;$;){if($===i){D=!0,i=_,s=o;break}if($===s){D=!0,s=_,i=o;break}$=$.sibling}if(!D)throw Error(A(189))}}if(i.alternate!==s)throw Error(A(190))}if(i.tag!==3)throw Error(A(188));return i.stateNode.current===i?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var l=Object.assign,S=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),h=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function H(e){return e===null||typeof e!="object"?null:(e=U&&e[U]||e["@@iterator"],typeof e=="function"?e:null)}var z=Symbol.for("react.client.reference");function Y(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case m:return"Fragment";case u:return"Profiler";case a:return"StrictMode";case M:return"Suspense";case w:return"SuspenseList";case L:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case R:return"Portal";case h:return e.displayName||"Context";case f:return(e._context.displayName||"Context")+".Consumer";case b:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case T:return t=e.displayName||null,t!==null?t:Y(e.type)||"Memo";case y:t=e._payload,e=e._init;try{return Y(e(t))}catch{}}return null}var ne=Array.isArray,V=C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=E.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},j=[],W=-1;function B(e){return{current:e}}function F(e){0>W||(e.current=j[W],j[W]=null,W--)}function te(e,t){W++,j[W]=e.current,e.current=t}var ie=B(null),he=B(null),ge=B(null),J=B(null);function q(e,t){switch(te(ge,t),te(he,e),te(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?u_(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=u_(t),e=d_(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}F(ie),te(ie,e)}function re(){F(ie),F(he),F(ge)}function _e(e){e.memoizedState!==null&&te(J,e);var t=ie.current,i=d_(t,e.type);t!==i&&(te(he,e),te(ie,i))}function Ce(e){he.current===e&&(F(ie),F(he)),J.current===e&&(F(J),zo._currentValue=I)}var we,Be;function Re(e){if(we===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);we=t&&t[1]||"",Be=-1<i.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+we+e+Be}var Ge=!1;function tt(e,t){if(!e||Ge)return"";Ge=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(fe){var ce=fe}Reflect.construct(e,[],Se)}else{try{Se.call()}catch(fe){ce=fe}e.call(Se.prototype)}}else{try{throw Error()}catch(fe){ce=fe}(Se=e())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(fe){if(fe&&ce&&typeof fe.stack=="string")return[fe.stack,ce.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=s.DetermineComponentFrameRoot(),D=_[0],$=_[1];if(D&&$){var ee=D.split(`
4
- `),le=$.split(`
5
- `);for(o=s=0;s<ee.length&&!ee[s].includes("DetermineComponentFrameRoot");)s++;for(;o<le.length&&!le[o].includes("DetermineComponentFrameRoot");)o++;if(s===ee.length||o===le.length)for(s=ee.length-1,o=le.length-1;1<=s&&0<=o&&ee[s]!==le[o];)o--;for(;1<=s&&0<=o;s--,o--)if(ee[s]!==le[o]){if(s!==1||o!==1)do if(s--,o--,0>o||ee[s]!==le[o]){var pe=`
6
- `+ee[s].replace(" at new "," at ");return e.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",e.displayName)),pe}while(1<=s&&0<=o);break}}}finally{Ge=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Re(i):""}function De(e,t){switch(e.tag){case 26:case 27:case 5:return Re(e.type);case 16:return Re("Lazy");case 13:return e.child!==t&&t!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return tt(e.type,!1);case 11:return tt(e.type.render,!1);case 1:return tt(e.type,!0);case 31:return Re("Activity");default:return""}}function Tt(e){try{var t="",i=null;do t+=De(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
7
- Error generating stack: `+s.message+`
8
- `+s.stack}}var Mt=Object.prototype.hasOwnProperty,We=n.unstable_scheduleCallback,Ue=n.unstable_cancelCallback,de=n.unstable_shouldYield,ue=n.unstable_requestPaint,be=n.unstable_now,Le=n.unstable_getCurrentPriorityLevel,Pe=n.unstable_ImmediatePriority,lt=n.unstable_UserBlockingPriority,dt=n.unstable_NormalPriority,vt=n.unstable_LowPriority,ke=n.unstable_IdlePriority,Ie=n.log,je=n.unstable_setDisableYieldValue,Wt=null,wt=null;function Ot(e){if(typeof Ie=="function"&&je(e),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(Wt,e)}catch{}}var $e=Math.clz32?Math.clz32:di,St=Math.log,Gr=Math.LN2;function di(e){return e>>>=0,e===0?32:31-(St(e)/Gr|0)|0}var Ei=256,Ai=262144,ws=4194304;function ri(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 Kr(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var o=0,_=e.suspendedLanes,D=e.pingedLanes;e=e.warmLanes;var $=s&134217727;return $!==0?(s=$&~_,s!==0?o=ri(s):(D&=$,D!==0?o=ri(D):i||(i=$&~e,i!==0&&(o=ri(i))))):($=s&~_,$!==0?o=ri($):D!==0?o=ri(D):i||(i=s&~e,i!==0&&(o=ri(i)))),o===0?0:t!==0&&t!==o&&(t&_)===0&&(_=o&-o,i=t&-t,_>=i||_===32&&(i&4194048)!==0)?t:o}function tr(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ir(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 Da(){var e=ws;return ws<<=1,(ws&62914560)===0&&(ws=4194304),e}function Ln(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Vr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Vo(e,t,i,s,o,_){var D=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 $=e.entanglements,ee=e.expirationTimes,le=e.hiddenUpdates;for(i=D&~i;0<i;){var pe=31-$e(i),Se=1<<pe;$[pe]=0,ee[pe]=-1;var ce=le[pe];if(ce!==null)for(le[pe]=null,pe=0;pe<ce.length;pe++){var fe=ce[pe];fe!==null&&(fe.lane&=-536870913)}i&=~Se}s!==0&&ka(e,s,0),_!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=_&~(D&~t))}function ka(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-$e(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function Tn(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-$e(i),o=1<<s;o&t|e[s]&t&&(e[s]|=t),i&=~o}}function Mn(e,t){var i=t&-t;return i=(i&42)!==0?1:sr(i),(i&(e.suspendedLanes|t))!==0?0:i}function sr(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 Dn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function kn(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:j_(e.type))}function On(e,t){var i=X.p;try{return X.p=e,t()}finally{X.p=i}}var Xi=Math.random().toString(36).slice(2),qe="__reactFiber$"+Xi,at="__reactProps$"+Xi,rr="__reactContainer$"+Xi,hs="__reactEvents$"+Xi,jc="__reactListeners$"+Xi,Yo="__reactHandles$"+Xi,Xo="__reactResources$"+Xi,nr="__reactMarker$"+Xi;function fi(e){delete e[qe],delete e[at],delete e[hs],delete e[jc],delete e[Yo]}function Ri(e){var t=e[qe];if(t)return t;for(var i=e.parentNode;i;){if(t=i[rr]||i[qe]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=S_(e);e!==null;){if(i=e[qe])return i;e=S_(e)}return t}e=i,i=e.parentNode}return null}function ni(e){if(e=e[qe]||e[rr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ar(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(A(33))}function Li(e){var t=e[Xo];return t||(t=e[Xo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function At(e){e[nr]=!0}var us=new Set,or={};function _i(e,t){ai(e,t),ai(e+"Capture",t)}function ai(e,t){for(or[e]=t,e=0;e<t.length;e++)us.add(t[e])}var lr=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]*$"),cr={},Yr={};function ds(e){return Mt.call(Yr,e)?!0:Mt.call(cr,e)?!1:lr.test(e)?Yr[e]=!0:(cr[e]=!0,!1)}function xs(e,t,i){if(ds(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 Es(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 Zi(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 Bt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xr(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Bn(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 o=s.get,_=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(D){i=""+D,_.call(this,D)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(D){i=""+D},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function jn(e){if(!e._valueTracker){var t=Xr(e)?"checked":"value";e._valueTracker=Bn(e,t,""+e[t])}}function As(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=Xr(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function Zr(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 Zo=/[\n"\\]/g;function Zt(e){return e.replace(Zo,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Oa(e,t,i,s,o,_,D,$){e.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?e.type=D:e.removeAttribute("type"),t!=null?D==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Bt(t)):e.value!==""+Bt(t)&&(e.value=""+Bt(t)):D!=="submit"&&D!=="reset"||e.removeAttribute("value"),t!=null?Hn(e,D,Bt(t)):i!=null?Hn(e,D,Bt(i)):s!=null&&e.removeAttribute("value"),o==null&&_!=null&&(e.defaultChecked=!!_),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?e.name=""+Bt($):e.removeAttribute("name")}function Nn(e,t,i,s,o,_,D,$){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.type=_),t!=null||i!=null){if(!(_!=="submit"&&_!=="reset"||t!=null)){jn(e);return}i=i!=null?""+Bt(i):"",t=t!=null?""+Bt(t):i,$||t===e.value||(e.value=t),e.defaultValue=t}s=s??o,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=$?e.checked:!!s,e.defaultChecked=!!s,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(e.name=D),jn(e)}function Hn(e,t,i){t==="number"&&Zr(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Qi(e,t,i,s){if(e=e.options,t){t={};for(var o=0;o<i.length;o++)t["$"+i[o]]=!0;for(i=0;i<e.length;i++)o=t.hasOwnProperty("$"+e[i].value),e[i].selected!==o&&(e[i].selected=o),o&&s&&(e[i].defaultSelected=!0)}else{for(i=""+Bt(i),t=null,o=0;o<e.length;o++){if(e[o].value===i){e[o].selected=!0,s&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ti(e,t,i){if(t!=null&&(t=""+Bt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Bt(i):""}function Ba(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(A(92));if(ne(s)){if(1<s.length)throw Error(A(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=Bt(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),jn(e)}function Rs(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var ja=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 Nc(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||ja.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function Na(e,t,i){if(t!=null&&typeof t!="object")throw Error(A(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 o in t)s=t[o],t.hasOwnProperty(o)&&i[o]!==s&&Nc(e,o,s)}else for(var _ in t)t.hasOwnProperty(_)&&Nc(e,_,t[_])}function Qr(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 Hc=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"]]),zn=/^[\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 Un(e){return zn.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function pi(){}var Ha=null;function za(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ji=null,fs=null;function Qo(e){var t=ni(e);if(t&&(e=t.stateNode)){var i=e[at]||null;e:switch(e=t.stateNode,t.type){case"input":if(Oa(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="'+Zt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var o=s[at]||null;if(!o)throw Error(A(90));Oa(s,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&As(s)}break e;case"textarea":Ti(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Qi(e,!!i.multiple,t,!1)}}}var Ls=!1;function Ua(e,t,i){if(Ls)return e(t,i);Ls=!0;try{var s=e(t);return s}finally{if(Ls=!1,(Ji!==null||fs!==null)&&(Jl(),Ji&&(t=Ji,e=fs,fs=Ji=null,Qo(t),e)))for(t=0;t<e.length;t++)Qo(e[t])}}function Ts(e,t){var i=e.stateNode;if(i===null)return null;var s=i[at]||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(A(231,t,typeof i));return i}var Ii=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),In=!1;if(Ii)try{var hr={};Object.defineProperty(hr,"passive",{get:function(){In=!0}}),window.addEventListener("test",hr,hr),window.removeEventListener("test",hr,hr)}catch{In=!1}var Mi=null,Ia=null,Jr=null;function Pa(){if(Jr)return Jr;var e,t=Ia,i=t.length,s,o="value"in Mi?Mi.value:Mi.textContent,_=o.length;for(e=0;e<i&&t[e]===o[e];e++);var D=i-e;for(s=1;s<=D&&t[i-s]===o[_-s];s++);return Jr=o.slice(e,1<s?1-s:void 0)}function en(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 tn(){return!0}function Pt(){return!1}function Qt(e){function t(i,s,o,_,D){this._reactName=i,this._targetInst=o,this.type=s,this.nativeEvent=_,this.target=D,this.currentTarget=null;for(var $ in e)e.hasOwnProperty($)&&(i=e[$],this[$]=i?i(_):_[$]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?tn:Pt,this.isPropagationStopped=Pt,this}return l(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=tn)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=tn)},persist:function(){},isPersistent:tn}),t}var Ms={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pn=Qt(Ms),sn=l({},Ms,{view:0,detail:0}),zc=Qt(sn),$a,Fa,rn,oi=l({},sn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_s,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!==rn&&(rn&&e.type==="mousemove"?($a=e.screenX-rn.screenX,Fa=e.screenY-rn.screenY):Fa=$a=0,rn=e),$a)},movementY:function(e){return"movementY"in e?e.movementY:Fa}}),Wa=Qt(oi),Uc=l({},oi,{dataTransfer:0}),ct=Qt(Uc),Pi=l({},sn,{relatedTarget:0}),bt=Qt(Pi),mi=l({},Ms,{animationName:0,elapsedTime:0,pseudoElement:0}),Jo=Qt(mi),rt=l({},Ms,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Jt=Qt(rt),Ds=l({},Ms,{data:0}),nn=Qt(Ds),ur={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ks={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"},yt={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function el(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=yt[e])?!!t[e]:!1}function _s(){return el}var tl=l({},sn,{key:function(e){if(e.key){var t=ur[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=en(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ks[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_s,charCode:function(e){return e.type==="keypress"?en(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?en(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),il=Qt(tl),qa=l({},oi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sl=Qt(qa),$n=l({},sn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_s}),rl=Qt($n),Ga=l({},Ms,{propertyName:0,elapsedTime:0,pseudoElement:0}),nl=Qt(Ga),Ka=l({},oi,{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}),es=Qt(Ka),Ic=l({},Ms,{newState:0,oldState:0}),qt=Qt(Ic),Pc=[9,13,27,32],Va=Ii&&"CompositionEvent"in window,an=null;Ii&&"documentMode"in document&&(an=document.documentMode);var $c=Ii&&"TextEvent"in window&&!an,al=Ii&&(!Va||an&&8<an&&11>=an),ol=" ",Ya=!1;function ll(e,t){switch(e){case"keyup":return Pc.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cl(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var dr=!1;function Xa(e,t){switch(e){case"compositionend":return cl(t);case"keypress":return t.which!==32?null:(Ya=!0,ol);case"textInput":return e=t.data,e===ol&&Ya?null:e;default:return null}}function ps(e,t){if(dr)return e==="compositionend"||!Va&&ll(e,t)?(e=Pa(),Jr=Ia=Mi=null,dr=!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 al&&t.locale!=="ko"?null:t.data;default:return null}}var hl={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 Za(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!hl[e.type]:t==="textarea"}function $i(e,t,i,s){Ji?fs?fs.push(s):fs=[s]:Ji=s,t=ac(t,"onChange"),0<t.length&&(i=new Pn("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var Di=null,on=null;function Fc(e){n_(e,0)}function fr(e){var t=ar(e);if(As(t))return e}function ul(e,t){if(e==="change")return t}var dl=!1;if(Ii){var Fn;if(Ii){var Qa="oninput"in document;if(!Qa){var fl=document.createElement("div");fl.setAttribute("oninput","return;"),Qa=typeof fl.oninput=="function"}Fn=Qa}else Fn=!1;dl=Fn&&(!document.documentMode||9<document.documentMode)}function _l(){Di&&(Di.detachEvent("onpropertychange",Wn),on=Di=null)}function Wn(e){if(e.propertyName==="value"&&fr(on)){var t=[];$i(t,on,e,za(e)),Ua(Fc,t)}}function Wc(e,t,i){e==="focusin"?(_l(),Di=t,on=i,Di.attachEvent("onpropertychange",Wn)):e==="focusout"&&_l()}function qc(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return fr(on)}function Gc(e,t){if(e==="click")return fr(t)}function qn(e,t){if(e==="input"||e==="change")return fr(t)}function pl(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var li=typeof Object.is=="function"?Object.is:pl;function _r(e,t){if(li(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 o=i[s];if(!Mt.call(t,o)||!li(e[o],t[o]))return!1}return!0}function ml(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gl(e,t){var i=ml(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=ml(i)}}function vl(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vl(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sl(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Zr(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=Zr(e.document)}return t}function Gn(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 Ja=Ii&&"documentMode"in document&&11>=document.documentMode,Os=null,eo=null,ln=null,Kn=!1;function Vn(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Kn||Os==null||Os!==Zr(s)||(s=Os,"selectionStart"in s&&Gn(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}),ln&&_r(ln,s)||(ln=s,s=ac(eo,"onSelect"),0<s.length&&(t=new Pn("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=Os)))}function Bs(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var js={animationend:Bs("Animation","AnimationEnd"),animationiteration:Bs("Animation","AnimationIteration"),animationstart:Bs("Animation","AnimationStart"),transitionrun:Bs("Transition","TransitionRun"),transitionstart:Bs("Transition","TransitionStart"),transitioncancel:Bs("Transition","TransitionCancel"),transitionend:Bs("Transition","TransitionEnd")},Yn={},to={};Ii&&(to=document.createElement("div").style,"AnimationEvent"in window||(delete js.animationend.animation,delete js.animationiteration.animation,delete js.animationstart.animation),"TransitionEvent"in window||delete js.transitionend.transition);function Ns(e){if(Yn[e])return Yn[e];if(!js[e])return e;var t=js[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in to)return Yn[e]=t[i];return e}var bl=Ns("animationend"),yl=Ns("animationiteration"),Xn=Ns("animationstart"),Hs=Ns("transitionrun"),Kc=Ns("transitionstart"),io=Ns("transitioncancel"),Zn=Ns("transitionend"),so=new Map,ro="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(" ");ro.push("scrollEnd");function gi(e,t){so.set(e,t),_i(t,[e])}var zs=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)},vi=[],pr=0,no=0;function Qn(){for(var e=pr,t=no=pr=0;t<e;){var i=vi[t];vi[t++]=null;var s=vi[t];vi[t++]=null;var o=vi[t];vi[t++]=null;var _=vi[t];if(vi[t++]=null,s!==null&&o!==null){var D=s.pending;D===null?o.next=o:(o.next=D.next,D.next=o),s.pending=o}_!==0&&Cl(i,o,_)}}function mr(e,t,i,s){vi[pr++]=e,vi[pr++]=t,vi[pr++]=i,vi[pr++]=s,no|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function ao(e,t,i,s){return mr(e,t,i,s),gr(e)}function Us(e,t){return mr(e,null,null,t),gr(e)}function Cl(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var o=!1,_=e.return;_!==null;)_.childLanes|=i,s=_.alternate,s!==null&&(s.childLanes|=i),_.tag===22&&(e=_.stateNode,e===null||e._visibility&1||(o=!0)),e=_,_=_.return;return e.tag===3?(_=e.stateNode,o&&t!==null&&(o=31-$e(i),e=_.hiddenUpdates,s=e[o],s===null?e[o]=[t]:s.push(t),t.lane=i|536870912),_):null}function gr(e){if(50<Do)throw Do=0,Fh=null,Error(A(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Is={};function wl(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 ci(e,t,i,s){return new wl(e,t,i,s)}function Jn(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ei(e,t){var i=e.alternate;return i===null?(i=ci(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 cn(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 ea(e,t,i,s,o,_){var D=0;if(s=e,typeof e=="function")Jn(e)&&(D=1);else if(typeof e=="string")D=wg(e,i,ie.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case L:return e=ci(31,i,t,o),e.elementType=L,e.lanes=_,e;case m:return Ps(i.children,o,_,t);case a:D=8,o|=24;break;case u:return e=ci(12,i,t,o|2),e.elementType=u,e.lanes=_,e;case M:return e=ci(13,i,t,o),e.elementType=M,e.lanes=_,e;case w:return e=ci(19,i,t,o),e.elementType=w,e.lanes=_,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case h:D=10;break e;case f:D=9;break e;case b:D=11;break e;case T:D=14;break e;case y:D=16,s=null;break e}D=29,i=Error(A(130,e===null?"null":typeof e,"")),s=null}return t=ci(D,i,t,o),t.elementType=e,t.type=s,t.lanes=_,t}function Ps(e,t,i,s){return e=ci(7,e,s,t),e.lanes=i,e}function oo(e,t,i){return e=ci(6,e,null,t),e.lanes=i,e}function lo(e){var t=ci(18,null,null,0);return t.stateNode=e,t}function ta(e,t,i){return t=ci(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ms=new WeakMap;function jt(e,t){if(typeof e=="object"&&e!==null){var i=ms.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Tt(t)},ms.set(e,t),t)}return{value:e,source:t,stack:Tt(t)}}var $s=[],vr=0,hn=null,Sr=0,hi=[],Vt=0,ts=null,Fi=1,Wi="";function qi(e,t){$s[vr++]=Sr,$s[vr++]=hn,hn=e,Sr=t}function co(e,t,i){hi[Vt++]=Fi,hi[Vt++]=Wi,hi[Vt++]=ts,ts=e;var s=Fi;e=Wi;var o=32-$e(s)-1;s&=~(1<<o),i+=1;var _=32-$e(t)+o;if(30<_){var D=o-o%5;_=(s&(1<<D)-1).toString(32),s>>=D,o-=D,Fi=1<<32-$e(t)+o|i<<o|s,Wi=_+e}else Fi=1<<_|i<<o|s,Wi=e}function ia(e){e.return!==null&&(qi(e,1),co(e,1,0))}function ho(e){for(;e===hn;)hn=$s[--vr],$s[vr]=null,Sr=$s[--vr],$s[vr]=null;for(;e===ts;)ts=hi[--Vt],hi[Vt]=null,Wi=hi[--Vt],hi[Vt]=null,Fi=hi[--Vt],hi[Vt]=null}function xl(e,t){hi[Vt++]=Fi,hi[Vt++]=Wi,hi[Vt++]=ts,Fi=t.id,Wi=t.overflow,ts=e}var $t=null,mt=null,Ye=!1,gs=null,Gt=!1,sa=Error(A(519));function vs(e){var t=Error(A(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw un(jt(t,e)),sa}function El(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[qe]=e,t[at]=s,i){case"dialog":Ze("cancel",t),Ze("close",t);break;case"iframe":case"object":case"embed":Ze("load",t);break;case"video":case"audio":for(i=0;i<Oo.length;i++)Ze(Oo[i],t);break;case"source":Ze("error",t);break;case"img":case"image":case"link":Ze("error",t),Ze("load",t);break;case"details":Ze("toggle",t);break;case"input":Ze("invalid",t),Nn(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Ze("invalid",t);break;case"textarea":Ze("invalid",t),Ba(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||c_(t.textContent,i)?(s.popover!=null&&(Ze("beforetoggle",t),Ze("toggle",t)),s.onScroll!=null&&Ze("scroll",t),s.onScrollEnd!=null&&Ze("scrollend",t),s.onClick!=null&&(t.onclick=pi),t=!0):t=!1,t||vs(e,!0)}function Al(e){for($t=e.return;$t;)switch($t.tag){case 5:case 31:case 13:Gt=!1;return;case 27:case 3:Gt=!0;return;default:$t=$t.return}}function br(e){if(e!==$t)return!1;if(!Ye)return Al(e),Ye=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||ru(e.type,e.memoizedProps)),i=!i),i&&mt&&vs(e),Al(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(A(317));mt=v_(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(A(317));mt=v_(e)}else t===27?(t=mt,Nr(e.type)?(e=cu,cu=null,mt=e):mt=t):mt=$t?Vi(e.stateNode.nextSibling):null;return!0}function is(){mt=$t=null,Ye=!1}function ra(){var e=gs;return e!==null&&(Ci===null?Ci=e:Ci.push.apply(Ci,e),gs=null),e}function un(e){gs===null?gs=[e]:gs.push(e)}var uo=B(null),Fs=null,ss=null;function Ss(e,t,i){te(uo,t._currentValue),t._currentValue=i}function rs(e){e._currentValue=uo.current,F(uo)}function fo(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 na(e,t,i,s){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var _=o.dependencies;if(_!==null){var D=o.child;_=_.firstContext;e:for(;_!==null;){var $=_;_=o;for(var ee=0;ee<t.length;ee++)if($.context===t[ee]){_.lanes|=i,$=_.alternate,$!==null&&($.lanes|=i),fo(_.return,i,e),s||(D=null);break e}_=$.next}}else if(o.tag===18){if(D=o.return,D===null)throw Error(A(341));D.lanes|=i,_=D.alternate,_!==null&&(_.lanes|=i),fo(D,i,e),D=null}else D=o.child;if(D!==null)D.return=o;else for(D=o;D!==null;){if(D===e){D=null;break}if(o=D.sibling,o!==null){o.return=D.return,D=o;break}D=D.return}o=D}}function yr(e,t,i,s){e=null;for(var o=t,_=!1;o!==null;){if(!_){if((o.flags&524288)!==0)_=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var D=o.alternate;if(D===null)throw Error(A(387));if(D=D.memoizedProps,D!==null){var $=o.type;li(o.pendingProps.value,D.value)||(e!==null?e.push($):e=[$])}}else if(o===J.current){if(D=o.alternate,D===null)throw Error(A(387));D.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(zo):e=[zo])}o=o.return}e!==null&&na(t,e,i,s),t.flags|=262144}function aa(e){for(e=e.firstContext;e!==null;){if(!li(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function v(e){Fs=e,ss=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function k(e){return Q(Fs,e)}function K(e,t){return Fs===null&&v(e),Q(e,t)}function Q(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},ss===null){if(e===null)throw Error(A(308));ss=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ss=ss.next=t;return i}var me=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()})}},ye=n.unstable_scheduleCallback,Ae=n.unstable_NormalPriority,xe={$$typeof:h,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function et(){return{controller:new me,data:new Map,refCount:0}}function ot(e){e.refCount--,e.refCount===0&&ye(Ae,function(){e.controller.abort()})}var ti=null,Nt=0,Gi=0,Ht=null;function oa(e,t){if(ti===null){var i=ti=[];Nt=0,Gi=Yh(),Ht={status:"pending",value:void 0,then:function(s){i.push(s)}}}return Nt++,t.then(Cr,Cr),t}function Cr(){if(--Nt===0&&ti!==null){Ht!==null&&(Ht.status="fulfilled");var e=ti;ti=null,Gi=0,Ht=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function la(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(o){i.push(o)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var o=0;o<i.length;o++)(0,i[o])(t)},function(o){for(s.status="rejected",s.reason=o,o=0;o<i.length;o++)(0,i[o])(void 0)}),s}var Rl=V.S;V.S=function(e,t){Of=be(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&oa(e,t),Rl!==null&&Rl(e,t)};var wr=B(null);function ki(){var e=wr.current;return e!==null?e:gt.pooledCache}function ca(e,t){t===null?te(wr,wr.current):te(wr,t.pool)}function ha(){var e=ki();return e===null?null:{parent:xe._currentValue,pool:e}}var ns=Error(A(460)),Vc=Error(A(474)),Ll=Error(A(542)),Tl={then:function(){}};function Zu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Qu(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(pi,pi),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ed(e),e;default:if(typeof t.status=="string")t.then(pi,pi);else{if(e=gt,e!==null&&100<e.shellSuspendCounter)throw Error(A(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=s}},function(s){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ed(e),e}throw fn=t,ns}}function dn(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(fn=i,ns):i}}var fn=null;function Ju(){if(fn===null)throw Error(A(459));var e=fn;return fn=null,e}function ed(e){if(e===ns||e===Ll)throw Error(A(483))}var ua=null,_o=0;function Ml(e){var t=_o;return _o+=1,ua===null&&(ua=[]),Qu(ua,e,t)}function po(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Dl(e,t){throw t.$$typeof===S?Error(A(525)):(e=Object.prototype.toString.call(t),Error(A(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function td(e){function t(ae,se){if(e){var oe=ae.deletions;oe===null?(ae.deletions=[se],ae.flags|=16):oe.push(se)}}function i(ae,se){if(!e)return null;for(;se!==null;)t(ae,se),se=se.sibling;return null}function s(ae){for(var se=new Map;ae!==null;)ae.key!==null?se.set(ae.key,ae):se.set(ae.index,ae),ae=ae.sibling;return se}function o(ae,se){return ae=ei(ae,se),ae.index=0,ae.sibling=null,ae}function _(ae,se,oe){return ae.index=oe,e?(oe=ae.alternate,oe!==null?(oe=oe.index,oe<se?(ae.flags|=67108866,se):oe):(ae.flags|=67108866,se)):(ae.flags|=1048576,se)}function D(ae){return e&&ae.alternate===null&&(ae.flags|=67108866),ae}function $(ae,se,oe,ve){return se===null||se.tag!==6?(se=oo(oe,ae.mode,ve),se.return=ae,se):(se=o(se,oe),se.return=ae,se)}function ee(ae,se,oe,ve){var Ne=oe.type;return Ne===m?pe(ae,se,oe.props.children,ve,oe.key):se!==null&&(se.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===y&&dn(Ne)===se.type)?(se=o(se,oe.props),po(se,oe),se.return=ae,se):(se=ea(oe.type,oe.key,oe.props,null,ae.mode,ve),po(se,oe),se.return=ae,se)}function le(ae,se,oe,ve){return se===null||se.tag!==4||se.stateNode.containerInfo!==oe.containerInfo||se.stateNode.implementation!==oe.implementation?(se=ta(oe,ae.mode,ve),se.return=ae,se):(se=o(se,oe.children||[]),se.return=ae,se)}function pe(ae,se,oe,ve,Ne){return se===null||se.tag!==7?(se=Ps(oe,ae.mode,ve,Ne),se.return=ae,se):(se=o(se,oe),se.return=ae,se)}function Se(ae,se,oe){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return se=oo(""+se,ae.mode,oe),se.return=ae,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case x:return oe=ea(se.type,se.key,se.props,null,ae.mode,oe),po(oe,se),oe.return=ae,oe;case R:return se=ta(se,ae.mode,oe),se.return=ae,se;case y:return se=dn(se),Se(ae,se,oe)}if(ne(se)||H(se))return se=Ps(se,ae.mode,oe,null),se.return=ae,se;if(typeof se.then=="function")return Se(ae,Ml(se),oe);if(se.$$typeof===h)return Se(ae,K(ae,se),oe);Dl(ae,se)}return null}function ce(ae,se,oe,ve){var Ne=se!==null?se.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Ne!==null?null:$(ae,se,""+oe,ve);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:return oe.key===Ne?ee(ae,se,oe,ve):null;case R:return oe.key===Ne?le(ae,se,oe,ve):null;case y:return oe=dn(oe),ce(ae,se,oe,ve)}if(ne(oe)||H(oe))return Ne!==null?null:pe(ae,se,oe,ve,null);if(typeof oe.then=="function")return ce(ae,se,Ml(oe),ve);if(oe.$$typeof===h)return ce(ae,se,K(ae,oe),ve);Dl(ae,oe)}return null}function fe(ae,se,oe,ve,Ne){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return ae=ae.get(oe)||null,$(se,ae,""+ve,Ne);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case x:return ae=ae.get(ve.key===null?oe:ve.key)||null,ee(se,ae,ve,Ne);case R:return ae=ae.get(ve.key===null?oe:ve.key)||null,le(se,ae,ve,Ne);case y:return ve=dn(ve),fe(ae,se,oe,ve,Ne)}if(ne(ve)||H(ve))return ae=ae.get(oe)||null,pe(se,ae,ve,Ne,null);if(typeof ve.then=="function")return fe(ae,se,oe,Ml(ve),Ne);if(ve.$$typeof===h)return fe(ae,se,oe,K(se,ve),Ne);Dl(se,ve)}return null}function Te(ae,se,oe,ve){for(var Ne=null,it=null,Me=se,Ve=se=0,Je=null;Me!==null&&Ve<oe.length;Ve++){Me.index>Ve?(Je=Me,Me=null):Je=Me.sibling;var st=ce(ae,Me,oe[Ve],ve);if(st===null){Me===null&&(Me=Je);break}e&&Me&&st.alternate===null&&t(ae,Me),se=_(st,se,Ve),it===null?Ne=st:it.sibling=st,it=st,Me=Je}if(Ve===oe.length)return i(ae,Me),Ye&&qi(ae,Ve),Ne;if(Me===null){for(;Ve<oe.length;Ve++)Me=Se(ae,oe[Ve],ve),Me!==null&&(se=_(Me,se,Ve),it===null?Ne=Me:it.sibling=Me,it=Me);return Ye&&qi(ae,Ve),Ne}for(Me=s(Me);Ve<oe.length;Ve++)Je=fe(Me,ae,Ve,oe[Ve],ve),Je!==null&&(e&&Je.alternate!==null&&Me.delete(Je.key===null?Ve:Je.key),se=_(Je,se,Ve),it===null?Ne=Je:it.sibling=Je,it=Je);return e&&Me.forEach(function(Pr){return t(ae,Pr)}),Ye&&qi(ae,Ve),Ne}function He(ae,se,oe,ve){if(oe==null)throw Error(A(151));for(var Ne=null,it=null,Me=se,Ve=se=0,Je=null,st=oe.next();Me!==null&&!st.done;Ve++,st=oe.next()){Me.index>Ve?(Je=Me,Me=null):Je=Me.sibling;var Pr=ce(ae,Me,st.value,ve);if(Pr===null){Me===null&&(Me=Je);break}e&&Me&&Pr.alternate===null&&t(ae,Me),se=_(Pr,se,Ve),it===null?Ne=Pr:it.sibling=Pr,it=Pr,Me=Je}if(st.done)return i(ae,Me),Ye&&qi(ae,Ve),Ne;if(Me===null){for(;!st.done;Ve++,st=oe.next())st=Se(ae,st.value,ve),st!==null&&(se=_(st,se,Ve),it===null?Ne=st:it.sibling=st,it=st);return Ye&&qi(ae,Ve),Ne}for(Me=s(Me);!st.done;Ve++,st=oe.next())st=fe(Me,ae,Ve,st.value,ve),st!==null&&(e&&st.alternate!==null&&Me.delete(st.key===null?Ve:st.key),se=_(st,se,Ve),it===null?Ne=st:it.sibling=st,it=st);return e&&Me.forEach(function(Bg){return t(ae,Bg)}),Ye&&qi(ae,Ve),Ne}function pt(ae,se,oe,ve){if(typeof oe=="object"&&oe!==null&&oe.type===m&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:e:{for(var Ne=oe.key;se!==null;){if(se.key===Ne){if(Ne=oe.type,Ne===m){if(se.tag===7){i(ae,se.sibling),ve=o(se,oe.props.children),ve.return=ae,ae=ve;break e}}else if(se.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===y&&dn(Ne)===se.type){i(ae,se.sibling),ve=o(se,oe.props),po(ve,oe),ve.return=ae,ae=ve;break e}i(ae,se);break}else t(ae,se);se=se.sibling}oe.type===m?(ve=Ps(oe.props.children,ae.mode,ve,oe.key),ve.return=ae,ae=ve):(ve=ea(oe.type,oe.key,oe.props,null,ae.mode,ve),po(ve,oe),ve.return=ae,ae=ve)}return D(ae);case R:e:{for(Ne=oe.key;se!==null;){if(se.key===Ne)if(se.tag===4&&se.stateNode.containerInfo===oe.containerInfo&&se.stateNode.implementation===oe.implementation){i(ae,se.sibling),ve=o(se,oe.children||[]),ve.return=ae,ae=ve;break e}else{i(ae,se);break}else t(ae,se);se=se.sibling}ve=ta(oe,ae.mode,ve),ve.return=ae,ae=ve}return D(ae);case y:return oe=dn(oe),pt(ae,se,oe,ve)}if(ne(oe))return Te(ae,se,oe,ve);if(H(oe)){if(Ne=H(oe),typeof Ne!="function")throw Error(A(150));return oe=Ne.call(oe),He(ae,se,oe,ve)}if(typeof oe.then=="function")return pt(ae,se,Ml(oe),ve);if(oe.$$typeof===h)return pt(ae,se,K(ae,oe),ve);Dl(ae,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,se!==null&&se.tag===6?(i(ae,se.sibling),ve=o(se,oe),ve.return=ae,ae=ve):(i(ae,se),ve=oo(oe,ae.mode,ve),ve.return=ae,ae=ve),D(ae)):i(ae,se)}return function(ae,se,oe,ve){try{_o=0;var Ne=pt(ae,se,oe,ve);return ua=null,Ne}catch(Me){if(Me===ns||Me===Ll)throw Me;var it=ci(29,Me,null,ae.mode);return it.lanes=ve,it.return=ae,it}}}var _n=td(!0),id=td(!1),xr=!1;function Yc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xc(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 Er(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ar(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(nt&2)!==0){var o=s.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),s.pending=t,t=gr(e),Cl(e,null,i),t}return mr(e,s,t,i),gr(e)}function mo(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,Tn(e,i)}}function Zc(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var o=null,_=null;if(i=i.firstBaseUpdate,i!==null){do{var D={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};_===null?o=_=D:_=_.next=D,i=i.next}while(i!==null);_===null?o=_=t:_=_.next=t}else o=_=t;i={baseState:s.baseState,firstBaseUpdate:o,lastBaseUpdate:_,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 Qc=!1;function go(){if(Qc){var e=Ht;if(e!==null)throw e}}function vo(e,t,i,s){Qc=!1;var o=e.updateQueue;xr=!1;var _=o.firstBaseUpdate,D=o.lastBaseUpdate,$=o.shared.pending;if($!==null){o.shared.pending=null;var ee=$,le=ee.next;ee.next=null,D===null?_=le:D.next=le,D=ee;var pe=e.alternate;pe!==null&&(pe=pe.updateQueue,$=pe.lastBaseUpdate,$!==D&&($===null?pe.firstBaseUpdate=le:$.next=le,pe.lastBaseUpdate=ee))}if(_!==null){var Se=o.baseState;D=0,pe=le=ee=null,$=_;do{var ce=$.lane&-536870913,fe=ce!==$.lane;if(fe?(Qe&ce)===ce:(s&ce)===ce){ce!==0&&ce===Gi&&(Qc=!0),pe!==null&&(pe=pe.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var Te=e,He=$;ce=t;var pt=i;switch(He.tag){case 1:if(Te=He.payload,typeof Te=="function"){Se=Te.call(pt,Se,ce);break e}Se=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=He.payload,ce=typeof Te=="function"?Te.call(pt,Se,ce):Te,ce==null)break e;Se=l({},Se,ce);break e;case 2:xr=!0}}ce=$.callback,ce!==null&&(e.flags|=64,fe&&(e.flags|=8192),fe=o.callbacks,fe===null?o.callbacks=[ce]:fe.push(ce))}else fe={lane:ce,tag:$.tag,payload:$.payload,callback:$.callback,next:null},pe===null?(le=pe=fe,ee=Se):pe=pe.next=fe,D|=ce;if($=$.next,$===null){if($=o.shared.pending,$===null)break;fe=$,$=fe.next,fe.next=null,o.lastBaseUpdate=fe,o.shared.pending=null}}while(!0);pe===null&&(ee=Se),o.baseState=ee,o.firstBaseUpdate=le,o.lastBaseUpdate=pe,_===null&&(o.shared.lanes=0),Dr|=D,e.lanes=D,e.memoizedState=Se}}function sd(e,t){if(typeof e!="function")throw Error(A(191,e));e.call(t)}function rd(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)sd(i[e],t)}var da=B(null),kl=B(0);function nd(e,t){e=Qs,te(kl,e),te(da,t),Qs=e|t.baseLanes}function Jc(){te(kl,Qs),te(da,da.current)}function eh(){Qs=kl.current,F(da),F(kl)}var Oi=B(null),Ki=null;function Rr(e){var t=e.alternate;te(Dt,Dt.current&1),te(Oi,e),Ki===null&&(t===null||da.current!==null||t.memoizedState!==null)&&(Ki=e)}function th(e){te(Dt,Dt.current),te(Oi,e),Ki===null&&(Ki=e)}function ad(e){e.tag===22?(te(Dt,Dt.current),te(Oi,e),Ki===null&&(Ki=e)):Lr()}function Lr(){te(Dt,Dt.current),te(Oi,Oi.current)}function Bi(e){F(Oi),Ki===e&&(Ki=null),F(Dt)}var Dt=B(0);function Ol(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||ou(i)||lu(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 Ws=0,Ke=null,ft=null,zt=null,Bl=!1,fa=!1,pn=!1,jl=0,So=0,_a=null,xm=0;function Rt(){throw Error(A(321))}function ih(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!li(e[i],t[i]))return!1;return!0}function sh(e,t,i,s,o,_){return Ws=_,Ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,V.H=e===null||e.memoizedState===null?Fd:vh,pn=!1,_=i(s,o),pn=!1,fa&&(_=ld(t,i,s,o)),od(e),_}function od(e){V.H=Co;var t=ft!==null&&ft.next!==null;if(Ws=0,zt=ft=Ke=null,Bl=!1,So=0,_a=null,t)throw Error(A(300));e===null||Ut||(e=e.dependencies,e!==null&&aa(e)&&(Ut=!0))}function ld(e,t,i,s){Ke=e;var o=0;do{if(fa&&(_a=null),So=0,fa=!1,25<=o)throw Error(A(301));if(o+=1,zt=ft=null,e.updateQueue!=null){var _=e.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}V.H=Wd,_=t(i,s)}while(fa);return _}function Em(){var e=V.H,t=e.useState()[0];return t=typeof t.then=="function"?bo(t):t,e=e.useState()[0],(ft!==null?ft.memoizedState:null)!==e&&(Ke.flags|=1024),t}function rh(){var e=jl!==0;return jl=0,e}function nh(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function ah(e){if(Bl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Bl=!1}Ws=0,zt=ft=Ke=null,fa=!1,So=jl=0,_a=null}function ui(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zt===null?Ke.memoizedState=zt=e:zt=zt.next=e,zt}function kt(){if(ft===null){var e=Ke.alternate;e=e!==null?e.memoizedState:null}else e=ft.next;var t=zt===null?Ke.memoizedState:zt.next;if(t!==null)zt=t,ft=e;else{if(e===null)throw Ke.alternate===null?Error(A(467)):Error(A(310));ft=e,e={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},zt===null?Ke.memoizedState=zt=e:zt=zt.next=e}return zt}function Nl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bo(e){var t=So;return So+=1,_a===null&&(_a=[]),e=Qu(_a,e,t),t=Ke,(zt===null?t.memoizedState:zt.next)===null&&(t=t.alternate,V.H=t===null||t.memoizedState===null?Fd:vh),e}function Hl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return bo(e);if(e.$$typeof===h)return k(e)}throw Error(A(438,String(e)))}function oh(e){var t=null,i=Ke.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=Ke.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Nl(),Ke.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]=O;return t.index++,i}function qs(e,t){return typeof t=="function"?t(e):t}function zl(e){var t=kt();return lh(t,ft,e)}function lh(e,t,i){var s=e.queue;if(s===null)throw Error(A(311));s.lastRenderedReducer=i;var o=e.baseQueue,_=s.pending;if(_!==null){if(o!==null){var D=o.next;o.next=_.next,_.next=D}t.baseQueue=o=_,s.pending=null}if(_=e.baseState,o===null)e.memoizedState=_;else{t=o.next;var $=D=null,ee=null,le=t,pe=!1;do{var Se=le.lane&-536870913;if(Se!==le.lane?(Qe&Se)===Se:(Ws&Se)===Se){var ce=le.revertLane;if(ce===0)ee!==null&&(ee=ee.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),Se===Gi&&(pe=!0);else if((Ws&ce)===ce){le=le.next,ce===Gi&&(pe=!0);continue}else Se={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},ee===null?($=ee=Se,D=_):ee=ee.next=Se,Ke.lanes|=ce,Dr|=ce;Se=le.action,pn&&i(_,Se),_=le.hasEagerState?le.eagerState:i(_,Se)}else ce={lane:Se,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},ee===null?($=ee=ce,D=_):ee=ee.next=ce,Ke.lanes|=Se,Dr|=Se;le=le.next}while(le!==null&&le!==t);if(ee===null?D=_:ee.next=$,!li(_,e.memoizedState)&&(Ut=!0,pe&&(i=Ht,i!==null)))throw i;e.memoizedState=_,e.baseState=D,e.baseQueue=ee,s.lastRenderedState=_}return o===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function ch(e){var t=kt(),i=t.queue;if(i===null)throw Error(A(311));i.lastRenderedReducer=e;var s=i.dispatch,o=i.pending,_=t.memoizedState;if(o!==null){i.pending=null;var D=o=o.next;do _=e(_,D.action),D=D.next;while(D!==o);li(_,t.memoizedState)||(Ut=!0),t.memoizedState=_,t.baseQueue===null&&(t.baseState=_),i.lastRenderedState=_}return[_,s]}function cd(e,t,i){var s=Ke,o=kt(),_=Ye;if(_){if(i===void 0)throw Error(A(407));i=i()}else i=t();var D=!li((ft||o).memoizedState,i);if(D&&(o.memoizedState=i,Ut=!0),o=o.queue,dh(dd.bind(null,s,o,e),[e]),o.getSnapshot!==t||D||zt!==null&&zt.memoizedState.tag&1){if(s.flags|=2048,pa(9,{destroy:void 0},ud.bind(null,s,o,i,t),null),gt===null)throw Error(A(349));_||(Ws&127)!==0||hd(s,t,i)}return i}function hd(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ke.updateQueue,t===null?(t=Nl(),Ke.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function ud(e,t,i,s){t.value=i,t.getSnapshot=s,fd(t)&&_d(e)}function dd(e,t,i){return i(function(){fd(t)&&_d(e)})}function fd(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!li(e,i)}catch{return!0}}function _d(e){var t=Us(e,2);t!==null&&wi(t,e,2)}function hh(e){var t=ui();if(typeof e=="function"){var i=e;if(e=i(),pn){Ot(!0);try{i()}finally{Ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qs,lastRenderedState:e},t}function pd(e,t,i,s){return e.baseState=i,lh(e,ft,typeof s=="function"?s:qs)}function Am(e,t,i,s,o){if(Pl(e))throw Error(A(485));if(e=t.action,e!==null){var _={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){_.listeners.push(D)}};V.T!==null?i(!0):_.isTransition=!1,s(_),i=t.pending,i===null?(_.next=t.pending=_,md(t,_)):(_.next=i.next,t.pending=i.next=_)}}function md(e,t){var i=t.action,s=t.payload,o=e.state;if(t.isTransition){var _=V.T,D={};V.T=D;try{var $=i(o,s),ee=V.S;ee!==null&&ee(D,$),gd(e,t,$)}catch(le){uh(e,t,le)}finally{_!==null&&D.types!==null&&(_.types=D.types),V.T=_}}else try{_=i(o,s),gd(e,t,_)}catch(le){uh(e,t,le)}}function gd(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){vd(e,t,s)},function(s){return uh(e,t,s)}):vd(e,t,i)}function vd(e,t,i){t.status="fulfilled",t.value=i,Sd(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,md(e,i)))}function uh(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,Sd(t),t=t.next;while(t!==s)}e.action=null}function Sd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function bd(e,t){return t}function yd(e,t){if(Ye){var i=gt.formState;if(i!==null){e:{var s=Ke;if(Ye){if(mt){t:{for(var o=mt,_=Gt;o.nodeType!==8;){if(!_){o=null;break t}if(o=Vi(o.nextSibling),o===null){o=null;break t}}_=o.data,o=_==="F!"||_==="F"?o:null}if(o){mt=Vi(o.nextSibling),s=o.data==="F!";break e}}vs(s)}s=!1}s&&(t=i[0])}}return i=ui(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bd,lastRenderedState:t},i.queue=s,i=Id.bind(null,Ke,s),s.dispatch=i,s=hh(!1),_=gh.bind(null,Ke,!1,s.queue),s=ui(),o={state:t,dispatch:null,action:e,pending:null},s.queue=o,i=Am.bind(null,Ke,o,_,i),o.dispatch=i,s.memoizedState=e,[t,i,!1]}function Cd(e){var t=kt();return wd(t,ft,e)}function wd(e,t,i){if(t=lh(e,t,bd)[0],e=zl(qs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=bo(t)}catch(D){throw D===ns?Ll:D}else s=t;t=kt();var o=t.queue,_=o.dispatch;return i!==t.memoizedState&&(Ke.flags|=2048,pa(9,{destroy:void 0},Rm.bind(null,o,i),null)),[s,_,e]}function Rm(e,t){e.action=t}function xd(e){var t=kt(),i=ft;if(i!==null)return wd(t,i,e);kt(),t=t.memoizedState,i=kt();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function pa(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=Ke.updateQueue,t===null&&(t=Nl(),Ke.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 Ed(){return kt().memoizedState}function Ul(e,t,i,s){var o=ui();Ke.flags|=e,o.memoizedState=pa(1|t,{destroy:void 0},i,s===void 0?null:s)}function Il(e,t,i,s){var o=kt();s=s===void 0?null:s;var _=o.memoizedState.inst;ft!==null&&s!==null&&ih(s,ft.memoizedState.deps)?o.memoizedState=pa(t,_,i,s):(Ke.flags|=e,o.memoizedState=pa(1|t,_,i,s))}function Ad(e,t){Ul(8390656,8,e,t)}function dh(e,t){Il(2048,8,e,t)}function Lm(e){Ke.flags|=4;var t=Ke.updateQueue;if(t===null)t=Nl(),Ke.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Rd(e){var t=kt().memoizedState;return Lm({ref:t,nextImpl:e}),function(){if((nt&2)!==0)throw Error(A(440));return t.impl.apply(void 0,arguments)}}function Ld(e,t){return Il(4,2,e,t)}function Td(e,t){return Il(4,4,e,t)}function Md(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 Dd(e,t,i){i=i!=null?i.concat([e]):null,Il(4,4,Md.bind(null,t,e),i)}function fh(){}function kd(e,t){var i=kt();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&ih(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function Od(e,t){var i=kt();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&ih(t,s[1]))return s[0];if(s=e(),pn){Ot(!0);try{e()}finally{Ot(!1)}}return i.memoizedState=[s,t],s}function _h(e,t,i){return i===void 0||(Ws&1073741824)!==0&&(Qe&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=jf(),Ke.lanes|=e,Dr|=e,i)}function Bd(e,t,i,s){return li(i,t)?i:da.current!==null?(e=_h(e,i,s),li(e,t)||(Ut=!0),e):(Ws&42)===0||(Ws&1073741824)!==0&&(Qe&261930)===0?(Ut=!0,e.memoizedState=i):(e=jf(),Ke.lanes|=e,Dr|=e,t)}function jd(e,t,i,s,o){var _=X.p;X.p=_!==0&&8>_?_:8;var D=V.T,$={};V.T=$,gh(e,!1,t,i);try{var ee=o(),le=V.S;if(le!==null&&le($,ee),ee!==null&&typeof ee=="object"&&typeof ee.then=="function"){var pe=la(ee,s);yo(e,t,pe,Hi(e))}else yo(e,t,s,Hi(e))}catch(Se){yo(e,t,{then:function(){},status:"rejected",reason:Se},Hi())}finally{X.p=_,D!==null&&$.types!==null&&(D.types=$.types),V.T=D}}function Tm(){}function ph(e,t,i,s){if(e.tag!==5)throw Error(A(476));var o=Nd(e).queue;jd(e,o,t,I,i===null?Tm:function(){return Hd(e),i(s)})}function Nd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qs,lastRenderedState:I},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qs,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Hd(e){var t=Nd(e);t.next===null&&(t=e.alternate.memoizedState),yo(e,t.next.queue,{},Hi())}function mh(){return k(zo)}function zd(){return kt().memoizedState}function Ud(){return kt().memoizedState}function Mm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Hi();e=Er(i);var s=Ar(t,e,i);s!==null&&(wi(s,t,i),mo(s,t,i)),t={cache:et()},e.payload=t;return}t=t.return}}function Dm(e,t,i){var s=Hi();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Pl(e)?Pd(t,i):(i=ao(e,t,i,s),i!==null&&(wi(i,e,s),$d(i,t,s)))}function Id(e,t,i){var s=Hi();yo(e,t,i,s)}function yo(e,t,i,s){var o={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Pl(e))Pd(t,o);else{var _=e.alternate;if(e.lanes===0&&(_===null||_.lanes===0)&&(_=t.lastRenderedReducer,_!==null))try{var D=t.lastRenderedState,$=_(D,i);if(o.hasEagerState=!0,o.eagerState=$,li($,D))return mr(e,t,o,0),gt===null&&Qn(),!1}catch{}if(i=ao(e,t,o,s),i!==null)return wi(i,e,s),$d(i,t,s),!0}return!1}function gh(e,t,i,s){if(s={lane:2,revertLane:Yh(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Pl(e)){if(t)throw Error(A(479))}else t=ao(e,i,s,2),t!==null&&wi(t,e,2)}function Pl(e){var t=e.alternate;return e===Ke||t!==null&&t===Ke}function Pd(e,t){fa=Bl=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function $d(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,Tn(e,i)}}var Co={readContext:k,use:Hl,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useLayoutEffect:Rt,useInsertionEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useSyncExternalStore:Rt,useId:Rt,useHostTransitionStatus:Rt,useFormState:Rt,useActionState:Rt,useOptimistic:Rt,useMemoCache:Rt,useCacheRefresh:Rt};Co.useEffectEvent=Rt;var Fd={readContext:k,use:Hl,useCallback:function(e,t){return ui().memoizedState=[e,t===void 0?null:t],e},useContext:k,useEffect:Ad,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Ul(4194308,4,Md.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Ul(4194308,4,e,t)},useInsertionEffect:function(e,t){Ul(4,2,e,t)},useMemo:function(e,t){var i=ui();t=t===void 0?null:t;var s=e();if(pn){Ot(!0);try{e()}finally{Ot(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=ui();if(i!==void 0){var o=i(t);if(pn){Ot(!0);try{i(t)}finally{Ot(!1)}}}else o=t;return s.memoizedState=s.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},s.queue=e,e=e.dispatch=Dm.bind(null,Ke,e),[s.memoizedState,e]},useRef:function(e){var t=ui();return e={current:e},t.memoizedState=e},useState:function(e){e=hh(e);var t=e.queue,i=Id.bind(null,Ke,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:fh,useDeferredValue:function(e,t){var i=ui();return _h(i,e,t)},useTransition:function(){var e=hh(!1);return e=jd.bind(null,Ke,e.queue,!0,!1),ui().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=Ke,o=ui();if(Ye){if(i===void 0)throw Error(A(407));i=i()}else{if(i=t(),gt===null)throw Error(A(349));(Qe&127)!==0||hd(s,t,i)}o.memoizedState=i;var _={value:i,getSnapshot:t};return o.queue=_,Ad(dd.bind(null,s,_,e),[e]),s.flags|=2048,pa(9,{destroy:void 0},ud.bind(null,s,_,i,t),null),i},useId:function(){var e=ui(),t=gt.identifierPrefix;if(Ye){var i=Wi,s=Fi;i=(s&~(1<<32-$e(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=jl++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=xm++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:mh,useFormState:yd,useActionState:yd,useOptimistic:function(e){var t=ui();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=gh.bind(null,Ke,!0,i),i.dispatch=t,[e,t]},useMemoCache:oh,useCacheRefresh:function(){return ui().memoizedState=Mm.bind(null,Ke)},useEffectEvent:function(e){var t=ui(),i={impl:e};return t.memoizedState=i,function(){if((nt&2)!==0)throw Error(A(440));return i.impl.apply(void 0,arguments)}}},vh={readContext:k,use:Hl,useCallback:kd,useContext:k,useEffect:dh,useImperativeHandle:Dd,useInsertionEffect:Ld,useLayoutEffect:Td,useMemo:Od,useReducer:zl,useRef:Ed,useState:function(){return zl(qs)},useDebugValue:fh,useDeferredValue:function(e,t){var i=kt();return Bd(i,ft.memoizedState,e,t)},useTransition:function(){var e=zl(qs)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:bo(e),t]},useSyncExternalStore:cd,useId:zd,useHostTransitionStatus:mh,useFormState:Cd,useActionState:Cd,useOptimistic:function(e,t){var i=kt();return pd(i,ft,e,t)},useMemoCache:oh,useCacheRefresh:Ud};vh.useEffectEvent=Rd;var Wd={readContext:k,use:Hl,useCallback:kd,useContext:k,useEffect:dh,useImperativeHandle:Dd,useInsertionEffect:Ld,useLayoutEffect:Td,useMemo:Od,useReducer:ch,useRef:Ed,useState:function(){return ch(qs)},useDebugValue:fh,useDeferredValue:function(e,t){var i=kt();return ft===null?_h(i,e,t):Bd(i,ft.memoizedState,e,t)},useTransition:function(){var e=ch(qs)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:bo(e),t]},useSyncExternalStore:cd,useId:zd,useHostTransitionStatus:mh,useFormState:xd,useActionState:xd,useOptimistic:function(e,t){var i=kt();return ft!==null?pd(i,ft,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:oh,useCacheRefresh:Ud};Wd.useEffectEvent=Rd;function Sh(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:l({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var bh={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=Hi(),o=Er(s);o.payload=t,i!=null&&(o.callback=i),t=Ar(e,o,s),t!==null&&(wi(t,e,s),mo(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=Hi(),o=Er(s);o.tag=1,o.payload=t,i!=null&&(o.callback=i),t=Ar(e,o,s),t!==null&&(wi(t,e,s),mo(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Hi(),s=Er(i);s.tag=2,t!=null&&(s.callback=t),t=Ar(e,s,i),t!==null&&(wi(t,e,i),mo(t,e,i))}};function qd(e,t,i,s,o,_,D){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,_,D):t.prototype&&t.prototype.isPureReactComponent?!_r(i,s)||!_r(o,_):!0}function Gd(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&&bh.enqueueReplaceState(t,t.state,null)}function mn(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=l({},i));for(var o in e)i[o]===void 0&&(i[o]=e[o])}return i}function Kd(e){zs(e)}function Vd(e){console.error(e)}function Yd(e){zs(e)}function $l(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Xd(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function yh(e,t,i){return i=Er(i),i.tag=3,i.payload={element:null},i.callback=function(){$l(e,t)},i}function Zd(e){return e=Er(e),e.tag=3,e}function Qd(e,t,i,s){var o=i.type.getDerivedStateFromError;if(typeof o=="function"){var _=s.value;e.payload=function(){return o(_)},e.callback=function(){Xd(t,i,s)}}var D=i.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(e.callback=function(){Xd(t,i,s),typeof o!="function"&&(kr===null?kr=new Set([this]):kr.add(this));var $=s.stack;this.componentDidCatch(s.value,{componentStack:$!==null?$:""})})}function km(e,t,i,s,o){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&yr(t,i,o,!0),i=Oi.current,i!==null){switch(i.tag){case 31:case 13:return Ki===null?ec():i.alternate===null&&Lt===0&&(Lt=3),i.flags&=-257,i.flags|=65536,i.lanes=o,s===Tl?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),Gh(e,s,o)),!1;case 22:return i.flags|=65536,s===Tl?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)),Gh(e,s,o)),!1}throw Error(A(435,i.tag))}return Gh(e,s,o),ec(),!1}if(Ye)return t=Oi.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,s!==sa&&(e=Error(A(422),{cause:s}),un(jt(e,i)))):(s!==sa&&(t=Error(A(423),{cause:s}),un(jt(t,i))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,s=jt(s,i),o=yh(e.stateNode,s,o),Zc(e,o),Lt!==4&&(Lt=2)),!1;var _=Error(A(520),{cause:s});if(_=jt(_,i),Mo===null?Mo=[_]:Mo.push(_),Lt!==4&&(Lt=2),t===null)return!0;s=jt(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=o&-o,i.lanes|=e,e=yh(i.stateNode,s,e),Zc(i,e),!1;case 1:if(t=i.type,_=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(kr===null||!kr.has(_))))return i.flags|=65536,o&=-o,i.lanes|=o,o=Zd(o),Qd(o,e,i,s),Zc(i,o),!1}i=i.return}while(i!==null);return!1}var Ch=Error(A(461)),Ut=!1;function Yt(e,t,i,s){t.child=e===null?id(t,null,i,s):_n(t,e.child,i,s)}function Jd(e,t,i,s,o){i=i.render;var _=t.ref;if("ref"in s){var D={};for(var $ in s)$!=="ref"&&(D[$]=s[$])}else D=s;return v(t),s=sh(e,t,i,D,_,o),$=rh(),e!==null&&!Ut?(nh(e,t,o),Gs(e,t,o)):(Ye&&$&&ia(t),t.flags|=1,Yt(e,t,s,o),t.child)}function ef(e,t,i,s,o){if(e===null){var _=i.type;return typeof _=="function"&&!Jn(_)&&_.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=_,tf(e,t,_,s,o)):(e=ea(i.type,null,s,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(_=e.child,!Mh(e,o)){var D=_.memoizedProps;if(i=i.compare,i=i!==null?i:_r,i(D,s)&&e.ref===t.ref)return Gs(e,t,o)}return t.flags|=1,e=ei(_,s),e.ref=t.ref,e.return=t,t.child=e}function tf(e,t,i,s,o){if(e!==null){var _=e.memoizedProps;if(_r(_,s)&&e.ref===t.ref)if(Ut=!1,t.pendingProps=s=_,Mh(e,o))(e.flags&131072)!==0&&(Ut=!0);else return t.lanes=e.lanes,Gs(e,t,o)}return wh(e,t,i,s,o)}function sf(e,t,i,s){var o=s.children,_=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(_=_!==null?_.baseLanes|i:i,e!==null){for(s=t.child=e.child,o=0;s!==null;)o=o|s.lanes|s.childLanes,s=s.sibling;s=o&~_}else s=0,t.child=null;return rf(e,t,_,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ca(t,_!==null?_.cachePool:null),_!==null?nd(t,_):Jc(),ad(t);else return s=t.lanes=536870912,rf(e,t,_!==null?_.baseLanes|i:i,i,s)}else _!==null?(ca(t,_.cachePool),nd(t,_),Lr(),t.memoizedState=null):(e!==null&&ca(t,null),Jc(),Lr());return Yt(e,t,o,i),t.child}function wo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function rf(e,t,i,s,o){var _=ki();return _=_===null?null:{parent:xe._currentValue,pool:_},t.memoizedState={baseLanes:i,cachePool:_},e!==null&&ca(t,null),Jc(),ad(t),e!==null&&yr(e,t,s,!0),t.childLanes=o,null}function Fl(e,t){return t=ql({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function nf(e,t,i){return _n(t,e.child,null,i),e=Fl(t,t.pendingProps),e.flags|=2,Bi(t),t.memoizedState=null,e}function Om(e,t,i){var s=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ye){if(s.mode==="hidden")return e=Fl(t,s),t.lanes=536870912,wo(null,e);if(th(t),(e=mt)?(e=g_(e,Gt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ts!==null?{id:Fi,overflow:Wi}:null,retryLane:536870912,hydrationErrors:null},i=lo(e),i.return=t,t.child=i,$t=t,mt=null)):e=null,e===null)throw vs(t);return t.lanes=536870912,null}return Fl(t,s)}var _=e.memoizedState;if(_!==null){var D=_.dehydrated;if(th(t),o)if(t.flags&256)t.flags&=-257,t=nf(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(A(558));else if(Ut||yr(e,t,i,!1),o=(i&e.childLanes)!==0,Ut||o){if(s=gt,s!==null&&(D=Mn(s,i),D!==0&&D!==_.retryLane))throw _.retryLane=D,Us(e,D),wi(s,e,D),Ch;ec(),t=nf(e,t,i)}else e=_.treeContext,mt=Vi(D.nextSibling),$t=t,Ye=!0,gs=null,Gt=!1,e!==null&&xl(t,e),t=Fl(t,s),t.flags|=4096;return t}return e=ei(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Wl(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(A(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function wh(e,t,i,s,o){return v(t),i=sh(e,t,i,s,void 0,o),s=rh(),e!==null&&!Ut?(nh(e,t,o),Gs(e,t,o)):(Ye&&s&&ia(t),t.flags|=1,Yt(e,t,i,o),t.child)}function af(e,t,i,s,o,_){return v(t),t.updateQueue=null,i=ld(t,s,i,o),od(e),s=rh(),e!==null&&!Ut?(nh(e,t,_),Gs(e,t,_)):(Ye&&s&&ia(t),t.flags|=1,Yt(e,t,i,_),t.child)}function of(e,t,i,s,o){if(v(t),t.stateNode===null){var _=Is,D=i.contextType;typeof D=="object"&&D!==null&&(_=k(D)),_=new i(s,_),t.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=bh,t.stateNode=_,_._reactInternals=t,_=t.stateNode,_.props=s,_.state=t.memoizedState,_.refs={},Yc(t),D=i.contextType,_.context=typeof D=="object"&&D!==null?k(D):Is,_.state=t.memoizedState,D=i.getDerivedStateFromProps,typeof D=="function"&&(Sh(t,i,D,s),_.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(D=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),D!==_.state&&bh.enqueueReplaceState(_,_.state,null),vo(t,s,_,o),go(),_.state=t.memoizedState),typeof _.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){_=t.stateNode;var $=t.memoizedProps,ee=mn(i,$);_.props=ee;var le=_.context,pe=i.contextType;D=Is,typeof pe=="object"&&pe!==null&&(D=k(pe));var Se=i.getDerivedStateFromProps;pe=typeof Se=="function"||typeof _.getSnapshotBeforeUpdate=="function",$=t.pendingProps!==$,pe||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||($||le!==D)&&Gd(t,_,s,D),xr=!1;var ce=t.memoizedState;_.state=ce,vo(t,s,_,o),go(),le=t.memoizedState,$||ce!==le||xr?(typeof Se=="function"&&(Sh(t,i,Se,s),le=t.memoizedState),(ee=xr||qd(t,i,ee,s,ce,le,D))?(pe||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(t.flags|=4194308)):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=le),_.props=s,_.state=le,_.context=D,s=ee):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{_=t.stateNode,Xc(e,t),D=t.memoizedProps,pe=mn(i,D),_.props=pe,Se=t.pendingProps,ce=_.context,le=i.contextType,ee=Is,typeof le=="object"&&le!==null&&(ee=k(le)),$=i.getDerivedStateFromProps,(le=typeof $=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(D!==Se||ce!==ee)&&Gd(t,_,s,ee),xr=!1,ce=t.memoizedState,_.state=ce,vo(t,s,_,o),go();var fe=t.memoizedState;D!==Se||ce!==fe||xr||e!==null&&e.dependencies!==null&&aa(e.dependencies)?(typeof $=="function"&&(Sh(t,i,$,s),fe=t.memoizedState),(pe=xr||qd(t,i,pe,s,ce,fe,ee)||e!==null&&e.dependencies!==null&&aa(e.dependencies))?(le||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(s,fe,ee),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(s,fe,ee)),typeof _.componentDidUpdate=="function"&&(t.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof _.componentDidUpdate!="function"||D===e.memoizedProps&&ce===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&ce===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=fe),_.props=s,_.state=fe,_.context=ee,s=pe):(typeof _.componentDidUpdate!="function"||D===e.memoizedProps&&ce===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&ce===e.memoizedState||(t.flags|=1024),s=!1)}return _=s,Wl(e,t),s=(t.flags&128)!==0,_||s?(_=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:_.render(),t.flags|=1,e!==null&&s?(t.child=_n(t,e.child,null,o),t.child=_n(t,null,i,o)):Yt(e,t,i,o),t.memoizedState=_.state,e=t.child):e=Gs(e,t,o),e}function lf(e,t,i,s){return is(),t.flags|=256,Yt(e,t,i,s),t.child}var xh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Eh(e){return{baseLanes:e,cachePool:ha()}}function Ah(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Ni),e}function cf(e,t,i){var s=t.pendingProps,o=!1,_=(t.flags&128)!==0,D;if((D=_)||(D=e!==null&&e.memoizedState===null?!1:(Dt.current&2)!==0),D&&(o=!0,t.flags&=-129),D=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ye){if(o?Rr(t):Lr(),(e=mt)?(e=g_(e,Gt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ts!==null?{id:Fi,overflow:Wi}:null,retryLane:536870912,hydrationErrors:null},i=lo(e),i.return=t,t.child=i,$t=t,mt=null)):e=null,e===null)throw vs(t);return lu(e)?t.lanes=32:t.lanes=536870912,null}var $=s.children;return s=s.fallback,o?(Lr(),o=t.mode,$=ql({mode:"hidden",children:$},o),s=Ps(s,o,i,null),$.return=t,s.return=t,$.sibling=s,t.child=$,s=t.child,s.memoizedState=Eh(i),s.childLanes=Ah(e,D,i),t.memoizedState=xh,wo(null,s)):(Rr(t),Rh(t,$))}var ee=e.memoizedState;if(ee!==null&&($=ee.dehydrated,$!==null)){if(_)t.flags&256?(Rr(t),t.flags&=-257,t=Lh(e,t,i)):t.memoizedState!==null?(Lr(),t.child=e.child,t.flags|=128,t=null):(Lr(),$=s.fallback,o=t.mode,s=ql({mode:"visible",children:s.children},o),$=Ps($,o,i,null),$.flags|=2,s.return=t,$.return=t,s.sibling=$,t.child=s,_n(t,e.child,null,i),s=t.child,s.memoizedState=Eh(i),s.childLanes=Ah(e,D,i),t.memoizedState=xh,t=wo(null,s));else if(Rr(t),lu($)){if(D=$.nextSibling&&$.nextSibling.dataset,D)var le=D.dgst;D=le,s=Error(A(419)),s.stack="",s.digest=D,un({value:s,source:null,stack:null}),t=Lh(e,t,i)}else if(Ut||yr(e,t,i,!1),D=(i&e.childLanes)!==0,Ut||D){if(D=gt,D!==null&&(s=Mn(D,i),s!==0&&s!==ee.retryLane))throw ee.retryLane=s,Us(e,s),wi(D,e,s),Ch;ou($)||ec(),t=Lh(e,t,i)}else ou($)?(t.flags|=192,t.child=e.child,t=null):(e=ee.treeContext,mt=Vi($.nextSibling),$t=t,Ye=!0,gs=null,Gt=!1,e!==null&&xl(t,e),t=Rh(t,s.children),t.flags|=4096);return t}return o?(Lr(),$=s.fallback,o=t.mode,ee=e.child,le=ee.sibling,s=ei(ee,{mode:"hidden",children:s.children}),s.subtreeFlags=ee.subtreeFlags&65011712,le!==null?$=ei(le,$):($=Ps($,o,i,null),$.flags|=2),$.return=t,s.return=t,s.sibling=$,t.child=s,wo(null,s),s=t.child,$=e.child.memoizedState,$===null?$=Eh(i):(o=$.cachePool,o!==null?(ee=xe._currentValue,o=o.parent!==ee?{parent:ee,pool:ee}:o):o=ha(),$={baseLanes:$.baseLanes|i,cachePool:o}),s.memoizedState=$,s.childLanes=Ah(e,D,i),t.memoizedState=xh,wo(e.child,s)):(Rr(t),i=e.child,e=i.sibling,i=ei(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(D=t.deletions,D===null?(t.deletions=[e],t.flags|=16):D.push(e)),t.child=i,t.memoizedState=null,i)}function Rh(e,t){return t=ql({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ql(e,t){return e=ci(22,e,null,t),e.lanes=0,e}function Lh(e,t,i){return _n(t,e.child,null,i),e=Rh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function hf(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),fo(e.return,t,i)}function Th(e,t,i,s,o,_){var D=e.memoizedState;D===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:o,treeForkCount:_}:(D.isBackwards=t,D.rendering=null,D.renderingStartTime=0,D.last=s,D.tail=i,D.tailMode=o,D.treeForkCount=_)}function uf(e,t,i){var s=t.pendingProps,o=s.revealOrder,_=s.tail;s=s.children;var D=Dt.current,$=(D&2)!==0;if($?(D=D&1|2,t.flags|=128):D&=1,te(Dt,D),Yt(e,t,s,i),s=Ye?Sr:0,!$&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&hf(e,i,t);else if(e.tag===19)hf(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(o){case"forwards":for(i=t.child,o=null;i!==null;)e=i.alternate,e!==null&&Ol(e)===null&&(o=i),i=i.sibling;i=o,i===null?(o=t.child,t.child=null):(o=i.sibling,i.sibling=null),Th(t,!1,o,i,_,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Ol(e)===null){t.child=o;break}e=o.sibling,o.sibling=i,i=o,o=e}Th(t,!0,i,null,_,s);break;case"together":Th(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Gs(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Dr|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(yr(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(A(153));if(t.child!==null){for(e=t.child,i=ei(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=ei(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Mh(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&aa(e)))}function Bm(e,t,i){switch(t.tag){case 3:q(t,t.stateNode.containerInfo),Ss(t,xe,e.memoizedState.cache),is();break;case 27:case 5:_e(t);break;case 4:q(t,t.stateNode.containerInfo);break;case 10:Ss(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,th(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Rr(t),t.flags|=128,null):(i&t.child.childLanes)!==0?cf(e,t,i):(Rr(t),e=Gs(e,t,i),e!==null?e.sibling:null);Rr(t);break;case 19:var o=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(yr(e,t,i,!1),s=(i&t.childLanes)!==0),o){if(s)return uf(e,t,i);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),te(Dt,Dt.current),s)break;return null;case 22:return t.lanes=0,sf(e,t,i,t.pendingProps);case 24:Ss(t,xe,e.memoizedState.cache)}return Gs(e,t,i)}function df(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ut=!0;else{if(!Mh(e,i)&&(t.flags&128)===0)return Ut=!1,Bm(e,t,i);Ut=(e.flags&131072)!==0}else Ut=!1,Ye&&(t.flags&1048576)!==0&&co(t,Sr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=dn(t.elementType),t.type=e,typeof e=="function")Jn(e)?(s=mn(e,s),t.tag=1,t=of(null,t,e,s,i)):(t.tag=0,t=wh(null,t,e,s,i));else{if(e!=null){var o=e.$$typeof;if(o===b){t.tag=11,t=Jd(null,t,e,s,i);break e}else if(o===T){t.tag=14,t=ef(null,t,e,s,i);break e}}throw t=Y(e)||e,Error(A(306,t,""))}}return t;case 0:return wh(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,o=mn(s,t.pendingProps),of(e,t,s,o,i);case 3:e:{if(q(t,t.stateNode.containerInfo),e===null)throw Error(A(387));s=t.pendingProps;var _=t.memoizedState;o=_.element,Xc(e,t),vo(t,s,null,i);var D=t.memoizedState;if(s=D.cache,Ss(t,xe,s),s!==_.cache&&na(t,[xe],i,!0),go(),s=D.element,_.isDehydrated)if(_={element:s,isDehydrated:!1,cache:D.cache},t.updateQueue.baseState=_,t.memoizedState=_,t.flags&256){t=lf(e,t,s,i);break e}else if(s!==o){o=jt(Error(A(424)),t),un(o),t=lf(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,mt=Vi(e.firstChild),$t=t,Ye=!0,gs=null,Gt=!0,i=id(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(is(),s===o){t=Gs(e,t,i);break e}Yt(e,t,s,i)}t=t.child}return t;case 26:return Wl(e,t),e===null?(i=w_(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ye||(i=t.type,e=t.pendingProps,s=oc(ge.current).createElement(i),s[qe]=t,s[at]=e,Xt(s,i,e),At(s),t.stateNode=s):t.memoizedState=w_(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _e(t),e===null&&Ye&&(s=t.stateNode=b_(t.type,t.pendingProps,ge.current),$t=t,Gt=!0,o=mt,Nr(t.type)?(cu=o,mt=Vi(s.firstChild)):mt=o),Yt(e,t,t.pendingProps.children,i),Wl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ye&&((o=s=mt)&&(s=hg(s,t.type,t.pendingProps,Gt),s!==null?(t.stateNode=s,$t=t,mt=Vi(s.firstChild),Gt=!1,o=!0):o=!1),o||vs(t)),_e(t),o=t.type,_=t.pendingProps,D=e!==null?e.memoizedProps:null,s=_.children,ru(o,_)?s=null:D!==null&&ru(o,D)&&(t.flags|=32),t.memoizedState!==null&&(o=sh(e,t,Em,null,null,i),zo._currentValue=o),Wl(e,t),Yt(e,t,s,i),t.child;case 6:return e===null&&Ye&&((e=i=mt)&&(i=ug(i,t.pendingProps,Gt),i!==null?(t.stateNode=i,$t=t,mt=null,e=!0):e=!1),e||vs(t)),null;case 13:return cf(e,t,i);case 4:return q(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=_n(t,null,s,i):Yt(e,t,s,i),t.child;case 11:return Jd(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,Ss(t,t.type,s.value),Yt(e,t,s.children,i),t.child;case 9:return o=t.type._context,s=t.pendingProps.children,v(t),o=k(o),s=s(o),t.flags|=1,Yt(e,t,s,i),t.child;case 14:return ef(e,t,t.type,t.pendingProps,i);case 15:return tf(e,t,t.type,t.pendingProps,i);case 19:return uf(e,t,i);case 31:return Om(e,t,i);case 22:return sf(e,t,i,t.pendingProps);case 24:return v(t),s=k(xe),e===null?(o=ki(),o===null&&(o=gt,_=et(),o.pooledCache=_,_.refCount++,_!==null&&(o.pooledCacheLanes|=i),o=_),t.memoizedState={parent:s,cache:o},Yc(t),Ss(t,xe,o)):((e.lanes&i)!==0&&(Xc(e,t),vo(t,null,null,i),go()),o=e.memoizedState,_=t.memoizedState,o.parent!==s?(o={parent:s,cache:s},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),Ss(t,xe,s)):(s=_.cache,Ss(t,xe,s),s!==o.cache&&na(t,[xe],i,!0))),Yt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(A(156,t.tag))}function Ks(e){e.flags|=4}function Dh(e,t,i,s,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(Uf())e.flags|=8192;else throw fn=Tl,Vc}else e.flags&=-16777217}function ff(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!L_(t))if(Uf())e.flags|=8192;else throw fn=Tl,Vc}function Gl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Da():536870912,e.lanes|=t,Sa|=t)}function xo(e,t){if(!Ye)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 Ct(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var o=e.child;o!==null;)i|=o.lanes|o.childLanes,s|=o.subtreeFlags&65011712,s|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)i|=o.lanes|o.childLanes,s|=o.subtreeFlags,s|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function jm(e,t,i){var s=t.pendingProps;switch(ho(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ct(t),null;case 1:return Ct(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),rs(xe),re(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(br(t)?Ks(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ra())),Ct(t),null;case 26:var o=t.type,_=t.memoizedState;return e===null?(Ks(t),_!==null?(Ct(t),ff(t,_)):(Ct(t),Dh(t,o,null,s,i))):_?_!==e.memoizedState?(Ks(t),Ct(t),ff(t,_)):(Ct(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Ks(t),Ct(t),Dh(t,o,e,s,i)),null;case 27:if(Ce(t),i=ge.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ks(t);else{if(!s){if(t.stateNode===null)throw Error(A(166));return Ct(t),null}e=ie.current,br(t)?El(t):(e=b_(o,s,i),t.stateNode=e,Ks(t))}return Ct(t),null;case 5:if(Ce(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ks(t);else{if(!s){if(t.stateNode===null)throw Error(A(166));return Ct(t),null}if(_=ie.current,br(t))El(t);else{var D=oc(ge.current);switch(_){case 1:_=D.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:_=D.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":_=D.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":_=D.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":_=D.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof s.is=="string"?D.createElement("select",{is:s.is}):D.createElement("select"),s.multiple?_.multiple=!0:s.size&&(_.size=s.size);break;default:_=typeof s.is=="string"?D.createElement(o,{is:s.is}):D.createElement(o)}}_[qe]=t,_[at]=s;e:for(D=t.child;D!==null;){if(D.tag===5||D.tag===6)_.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===t)break e;for(;D.sibling===null;){if(D.return===null||D.return===t)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}t.stateNode=_;e:switch(Xt(_,o,s),o){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Ks(t)}}return Ct(t),Dh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Ks(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(A(166));if(e=ge.current,br(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,o=$t,o!==null)switch(o.tag){case 27:case 5:s=o.memoizedProps}e[qe]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||c_(e.nodeValue,i)),e||vs(t,!0)}else e=oc(e).createTextNode(s),e[qe]=t,t.stateNode=e}return Ct(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=br(t),i!==null){if(e===null){if(!s)throw Error(A(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(A(557));e[qe]=t}else is(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ct(t),e=!1}else i=ra(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Bi(t),t):(Bi(t),null);if((t.flags&128)!==0)throw Error(A(558))}return Ct(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=br(t),s!==null&&s.dehydrated!==null){if(e===null){if(!o)throw Error(A(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(A(317));o[qe]=t}else is(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ct(t),o=!1}else o=ra(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Bi(t),t):(Bi(t),null)}return Bi(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,o=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(o=s.alternate.memoizedState.cachePool.pool),_=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(_=s.memoizedState.cachePool.pool),_!==o&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Gl(t,t.updateQueue),Ct(t),null);case 4:return re(),e===null&&Jh(t.stateNode.containerInfo),Ct(t),null;case 10:return rs(t.type),Ct(t),null;case 19:if(F(Dt),s=t.memoizedState,s===null)return Ct(t),null;if(o=(t.flags&128)!==0,_=s.rendering,_===null)if(o)xo(s,!1);else{if(Lt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(_=Ol(e),_!==null){for(t.flags|=128,xo(s,!1),e=_.updateQueue,t.updateQueue=e,Gl(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)cn(i,e),i=i.sibling;return te(Dt,Dt.current&1|2),Ye&&qi(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&be()>Zl&&(t.flags|=128,o=!0,xo(s,!1),t.lanes=4194304)}else{if(!o)if(e=Ol(_),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Gl(t,e),xo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!_.alternate&&!Ye)return Ct(t),null}else 2*be()-s.renderingStartTime>Zl&&i!==536870912&&(t.flags|=128,o=!0,xo(s,!1),t.lanes=4194304);s.isBackwards?(_.sibling=t.child,t.child=_):(e=s.last,e!==null?e.sibling=_:t.child=_,s.last=_)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=be(),e.sibling=null,i=Dt.current,te(Dt,o?i&1|2:i&1),Ye&&qi(t,s.treeForkCount),e):(Ct(t),null);case 22:case 23:return Bi(t),eh(),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&&(Ct(t),t.subtreeFlags&6&&(t.flags|=8192)):Ct(t),i=t.updateQueue,i!==null&&Gl(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&&F(wr),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),rs(xe),Ct(t),null;case 25:return null;case 30:return null}throw Error(A(156,t.tag))}function Nm(e,t){switch(ho(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return rs(xe),re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ce(t),null;case 31:if(t.memoizedState!==null){if(Bi(t),t.alternate===null)throw Error(A(340));is()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Bi(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(A(340));is()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(Dt),null;case 4:return re(),null;case 10:return rs(t.type),null;case 22:case 23:return Bi(t),eh(),e!==null&&F(wr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return rs(xe),null;case 25:return null;default:return null}}function _f(e,t){switch(ho(t),t.tag){case 3:rs(xe),re();break;case 26:case 27:case 5:Ce(t);break;case 4:re();break;case 31:t.memoizedState!==null&&Bi(t);break;case 13:Bi(t);break;case 19:F(Dt);break;case 10:rs(t.type);break;case 22:case 23:Bi(t),eh(),e!==null&&F(wr);break;case 24:rs(xe)}}function Eo(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var o=s.next;i=o;do{if((i.tag&e)===e){s=void 0;var _=i.create,D=i.inst;s=_(),D.destroy=s}i=i.next}while(i!==o)}}catch($){ut(t,t.return,$)}}function Tr(e,t,i){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var _=o.next;s=_;do{if((s.tag&e)===e){var D=s.inst,$=D.destroy;if($!==void 0){D.destroy=void 0,o=t;var ee=i,le=$;try{le()}catch(pe){ut(o,ee,pe)}}}s=s.next}while(s!==_)}}catch(pe){ut(t,t.return,pe)}}function pf(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{rd(t,i)}catch(s){ut(e,e.return,s)}}}function mf(e,t,i){i.props=mn(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){ut(e,t,s)}}function Ao(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(o){ut(e,t,o)}}function bs(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(o){ut(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(o){ut(e,t,o)}else i.current=null}function gf(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(o){ut(e,e.return,o)}}function kh(e,t,i){try{var s=e.stateNode;rg(s,e.type,i,t),s[at]=t}catch(o){ut(e,e.return,o)}}function vf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Nr(e.type)||e.tag===4}function Oh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vf(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&&Nr(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 Bh(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=pi));else if(s!==4&&(s===27&&Nr(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Bh(e,t,i),e=e.sibling;e!==null;)Bh(e,t,i),e=e.sibling}function Kl(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&&Nr(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Kl(e,t,i),e=e.sibling;e!==null;)Kl(e,t,i),e=e.sibling}function Sf(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);Xt(t,s,i),t[qe]=e,t[at]=i}catch(_){ut(e,e.return,_)}}var Vs=!1,It=!1,jh=!1,bf=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function Hm(e,t){if(e=e.containerInfo,iu=_c,e=Sl(e),Gn(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 o=s.anchorOffset,_=s.focusNode;s=s.focusOffset;try{i.nodeType,_.nodeType}catch{i=null;break e}var D=0,$=-1,ee=-1,le=0,pe=0,Se=e,ce=null;t:for(;;){for(var fe;Se!==i||o!==0&&Se.nodeType!==3||($=D+o),Se!==_||s!==0&&Se.nodeType!==3||(ee=D+s),Se.nodeType===3&&(D+=Se.nodeValue.length),(fe=Se.firstChild)!==null;)ce=Se,Se=fe;for(;;){if(Se===e)break t;if(ce===i&&++le===o&&($=D),ce===_&&++pe===s&&(ee=D),(fe=Se.nextSibling)!==null)break;Se=ce,ce=Se.parentNode}Se=fe}i=$===-1||ee===-1?null:{start:$,end:ee}}else i=null}i=i||{start:0,end:0}}else i=null;for(su={focusedElem:e,selectionRange:i},_c=!1,Kt=t;Kt!==null;)if(t=Kt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Kt=e;else for(;Kt!==null;){switch(t=Kt,_=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++)o=e[i],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&_!==null){e=void 0,i=t,o=_.memoizedProps,_=_.memoizedState,s=i.stateNode;try{var Te=mn(i.type,o);e=s.getSnapshotBeforeUpdate(Te,_),s.__reactInternalSnapshotBeforeUpdate=e}catch(He){ut(i,i.return,He)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)au(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":au(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(A(163))}if(e=t.sibling,e!==null){e.return=t.return,Kt=e;break}Kt=t.return}}function yf(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:Xs(e,i),s&4&&Eo(5,i);break;case 1:if(Xs(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(D){ut(i,i.return,D)}else{var o=mn(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(D){ut(i,i.return,D)}}s&64&&pf(i),s&512&&Ao(i,i.return);break;case 3:if(Xs(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{rd(e,t)}catch(D){ut(i,i.return,D)}}break;case 27:t===null&&s&4&&Sf(i);case 26:case 5:Xs(e,i),t===null&&s&4&&gf(i),s&512&&Ao(i,i.return);break;case 12:Xs(e,i);break;case 31:Xs(e,i),s&4&&xf(e,i);break;case 13:Xs(e,i),s&4&&Ef(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Gm.bind(null,i),dg(e,i))));break;case 22:if(s=i.memoizedState!==null||Vs,!s){t=t!==null&&t.memoizedState!==null||It,o=Vs;var _=It;Vs=s,(It=t)&&!_?Zs(e,i,(i.subtreeFlags&8772)!==0):Xs(e,i),Vs=o,It=_}break;case 30:break;default:Xs(e,i)}}function Cf(e){var t=e.alternate;t!==null&&(e.alternate=null,Cf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&fi(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 xt=null,Si=!1;function Ys(e,t,i){for(i=i.child;i!==null;)wf(e,t,i),i=i.sibling}function wf(e,t,i){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(Wt,i)}catch{}switch(i.tag){case 26:It||bs(i,t),Ys(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:It||bs(i,t);var s=xt,o=Si;Nr(i.type)&&(xt=i.stateNode,Si=!1),Ys(e,t,i),jo(i.stateNode),xt=s,Si=o;break;case 5:It||bs(i,t);case 6:if(s=xt,o=Si,xt=null,Ys(e,t,i),xt=s,Si=o,xt!==null)if(Si)try{(xt.nodeType===9?xt.body:xt.nodeName==="HTML"?xt.ownerDocument.body:xt).removeChild(i.stateNode)}catch(_){ut(i,t,_)}else try{xt.removeChild(i.stateNode)}catch(_){ut(i,t,_)}break;case 18:xt!==null&&(Si?(e=xt,p_(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Ra(e)):p_(xt,i.stateNode));break;case 4:s=xt,o=Si,xt=i.stateNode.containerInfo,Si=!0,Ys(e,t,i),xt=s,Si=o;break;case 0:case 11:case 14:case 15:Tr(2,i,t),It||Tr(4,i,t),Ys(e,t,i);break;case 1:It||(bs(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&mf(i,t,s)),Ys(e,t,i);break;case 21:Ys(e,t,i);break;case 22:It=(s=It)||i.memoizedState!==null,Ys(e,t,i),It=s;break;default:Ys(e,t,i)}}function xf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ra(e)}catch(i){ut(t,t.return,i)}}}function Ef(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ra(e)}catch(i){ut(t,t.return,i)}}function zm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new bf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new bf),t;default:throw Error(A(435,e.tag))}}function Vl(e,t){var i=zm(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var o=Km.bind(null,e,s);s.then(o,o)}})}function bi(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var o=i[s],_=e,D=t,$=D;e:for(;$!==null;){switch($.tag){case 27:if(Nr($.type)){xt=$.stateNode,Si=!1;break e}break;case 5:xt=$.stateNode,Si=!1;break e;case 3:case 4:xt=$.stateNode.containerInfo,Si=!0;break e}$=$.return}if(xt===null)throw Error(A(160));wf(_,D,o),xt=null,Si=!1,_=o.alternate,_!==null&&(_.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Af(t,e),t=t.sibling}var as=null;function Af(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:bi(t,e),yi(e),s&4&&(Tr(3,e,e.return),Eo(3,e),Tr(5,e,e.return));break;case 1:bi(t,e),yi(e),s&512&&(It||i===null||bs(i,i.return)),s&64&&Vs&&(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 o=as;if(bi(t,e),yi(e),s&512&&(It||i===null||bs(i,i.return)),s&4){var _=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,o=o.ownerDocument||o;t:switch(s){case"title":_=o.getElementsByTagName("title")[0],(!_||_[nr]||_[qe]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=o.createElement(s),o.head.insertBefore(_,o.querySelector("head > title"))),Xt(_,s,i),_[qe]=e,At(_),s=_;break e;case"link":var D=A_("link","href",o).get(s+(i.href||""));if(D){for(var $=0;$<D.length;$++)if(_=D[$],_.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&_.getAttribute("rel")===(i.rel==null?null:i.rel)&&_.getAttribute("title")===(i.title==null?null:i.title)&&_.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){D.splice($,1);break t}}_=o.createElement(s),Xt(_,s,i),o.head.appendChild(_);break;case"meta":if(D=A_("meta","content",o).get(s+(i.content||""))){for($=0;$<D.length;$++)if(_=D[$],_.getAttribute("content")===(i.content==null?null:""+i.content)&&_.getAttribute("name")===(i.name==null?null:i.name)&&_.getAttribute("property")===(i.property==null?null:i.property)&&_.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&_.getAttribute("charset")===(i.charSet==null?null:i.charSet)){D.splice($,1);break t}}_=o.createElement(s),Xt(_,s,i),o.head.appendChild(_);break;default:throw Error(A(468,s))}_[qe]=e,At(_),s=_}e.stateNode=s}else R_(o,e.type,e.stateNode);else e.stateNode=E_(o,s,e.memoizedProps);else _!==s?(_===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):_.count--,s===null?R_(o,e.type,e.stateNode):E_(o,s,e.memoizedProps)):s===null&&e.stateNode!==null&&kh(e,e.memoizedProps,i.memoizedProps)}break;case 27:bi(t,e),yi(e),s&512&&(It||i===null||bs(i,i.return)),i!==null&&s&4&&kh(e,e.memoizedProps,i.memoizedProps);break;case 5:if(bi(t,e),yi(e),s&512&&(It||i===null||bs(i,i.return)),e.flags&32){o=e.stateNode;try{Rs(o,"")}catch(Te){ut(e,e.return,Te)}}s&4&&e.stateNode!=null&&(o=e.memoizedProps,kh(e,o,i!==null?i.memoizedProps:o)),s&1024&&(jh=!0);break;case 6:if(bi(t,e),yi(e),s&4){if(e.stateNode===null)throw Error(A(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(Te){ut(e,e.return,Te)}}break;case 3:if(hc=null,o=as,as=lc(t.containerInfo),bi(t,e),as=o,yi(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{Ra(t.containerInfo)}catch(Te){ut(e,e.return,Te)}jh&&(jh=!1,Rf(e));break;case 4:s=as,as=lc(e.stateNode.containerInfo),bi(t,e),yi(e),as=s;break;case 12:bi(t,e),yi(e);break;case 31:bi(t,e),yi(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Vl(e,s)));break;case 13:bi(t,e),yi(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Xl=be()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Vl(e,s)));break;case 22:o=e.memoizedState!==null;var ee=i!==null&&i.memoizedState!==null,le=Vs,pe=It;if(Vs=le||o,It=pe||ee,bi(t,e),It=pe,Vs=le,yi(e),s&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(i===null||ee||Vs||It||gn(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){ee=i=t;try{if(_=ee.stateNode,o)D=_.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{$=ee.stateNode;var Se=ee.memoizedProps.style,ce=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;$.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(Te){ut(ee,ee.return,Te)}}}else if(t.tag===6){if(i===null){ee=t;try{ee.stateNode.nodeValue=o?"":ee.memoizedProps}catch(Te){ut(ee,ee.return,Te)}}}else if(t.tag===18){if(i===null){ee=t;try{var fe=ee.stateNode;o?m_(fe,!0):m_(ee.stateNode,!1)}catch(Te){ut(ee,ee.return,Te)}}}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,Vl(e,i))));break;case 19:bi(t,e),yi(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Vl(e,s)));break;case 30:break;case 21:break;default:bi(t,e),yi(e)}}function yi(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(vf(s)){i=s;break}s=s.return}if(i==null)throw Error(A(160));switch(i.tag){case 27:var o=i.stateNode,_=Oh(e);Kl(e,_,o);break;case 5:var D=i.stateNode;i.flags&32&&(Rs(D,""),i.flags&=-33);var $=Oh(e);Kl(e,$,D);break;case 3:case 4:var ee=i.stateNode.containerInfo,le=Oh(e);Bh(e,le,ee);break;default:throw Error(A(161))}}catch(pe){ut(e,e.return,pe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Rf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Rf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Xs(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)yf(e,t.alternate,t),t=t.sibling}function gn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Tr(4,t,t.return),gn(t);break;case 1:bs(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&mf(t,t.return,i),gn(t);break;case 27:jo(t.stateNode);case 26:case 5:bs(t,t.return),gn(t);break;case 22:t.memoizedState===null&&gn(t);break;case 30:gn(t);break;default:gn(t)}e=e.sibling}}function Zs(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,o=e,_=t,D=_.flags;switch(_.tag){case 0:case 11:case 15:Zs(o,_,i),Eo(4,_);break;case 1:if(Zs(o,_,i),s=_,o=s.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(le){ut(s,s.return,le)}if(s=_,o=s.updateQueue,o!==null){var $=s.stateNode;try{var ee=o.shared.hiddenCallbacks;if(ee!==null)for(o.shared.hiddenCallbacks=null,o=0;o<ee.length;o++)sd(ee[o],$)}catch(le){ut(s,s.return,le)}}i&&D&64&&pf(_),Ao(_,_.return);break;case 27:Sf(_);case 26:case 5:Zs(o,_,i),i&&s===null&&D&4&&gf(_),Ao(_,_.return);break;case 12:Zs(o,_,i);break;case 31:Zs(o,_,i),i&&D&4&&xf(o,_);break;case 13:Zs(o,_,i),i&&D&4&&Ef(o,_);break;case 22:_.memoizedState===null&&Zs(o,_,i),Ao(_,_.return);break;case 30:break;default:Zs(o,_,i)}t=t.sibling}}function Nh(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&&ot(i))}function Hh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ot(e))}function os(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Lf(e,t,i,s),t=t.sibling}function Lf(e,t,i,s){var o=t.flags;switch(t.tag){case 0:case 11:case 15:os(e,t,i,s),o&2048&&Eo(9,t);break;case 1:os(e,t,i,s);break;case 3:os(e,t,i,s),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ot(e)));break;case 12:if(o&2048){os(e,t,i,s),e=t.stateNode;try{var _=t.memoizedProps,D=_.id,$=_.onPostCommit;typeof $=="function"&&$(D,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(ee){ut(t,t.return,ee)}}else os(e,t,i,s);break;case 31:os(e,t,i,s);break;case 13:os(e,t,i,s);break;case 23:break;case 22:_=t.stateNode,D=t.alternate,t.memoizedState!==null?_._visibility&2?os(e,t,i,s):Ro(e,t):_._visibility&2?os(e,t,i,s):(_._visibility|=2,ma(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),o&2048&&Nh(D,t);break;case 24:os(e,t,i,s),o&2048&&Hh(t.alternate,t);break;default:os(e,t,i,s)}}function ma(e,t,i,s,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var _=e,D=t,$=i,ee=s,le=D.flags;switch(D.tag){case 0:case 11:case 15:ma(_,D,$,ee,o),Eo(8,D);break;case 23:break;case 22:var pe=D.stateNode;D.memoizedState!==null?pe._visibility&2?ma(_,D,$,ee,o):Ro(_,D):(pe._visibility|=2,ma(_,D,$,ee,o)),o&&le&2048&&Nh(D.alternate,D);break;case 24:ma(_,D,$,ee,o),o&&le&2048&&Hh(D.alternate,D);break;default:ma(_,D,$,ee,o)}t=t.sibling}}function Ro(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,o=s.flags;switch(s.tag){case 22:Ro(i,s),o&2048&&Nh(s.alternate,s);break;case 24:Ro(i,s),o&2048&&Hh(s.alternate,s);break;default:Ro(i,s)}t=t.sibling}}var Lo=8192;function ga(e,t,i){if(e.subtreeFlags&Lo)for(e=e.child;e!==null;)Tf(e,t,i),e=e.sibling}function Tf(e,t,i){switch(e.tag){case 26:ga(e,t,i),e.flags&Lo&&e.memoizedState!==null&&xg(i,as,e.memoizedState,e.memoizedProps);break;case 5:ga(e,t,i);break;case 3:case 4:var s=as;as=lc(e.stateNode.containerInfo),ga(e,t,i),as=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Lo,Lo=16777216,ga(e,t,i),Lo=s):ga(e,t,i));break;default:ga(e,t,i)}}function Mf(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 To(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];Kt=s,kf(s,e)}Mf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Df(e),e=e.sibling}function Df(e){switch(e.tag){case 0:case 11:case 15:To(e),e.flags&2048&&Tr(9,e,e.return);break;case 3:To(e);break;case 12:To(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yl(e)):To(e);break;default:To(e)}}function Yl(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];Kt=s,kf(s,e)}Mf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Tr(8,t,t.return),Yl(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Yl(t));break;default:Yl(t)}e=e.sibling}}function kf(e,t){for(;Kt!==null;){var i=Kt;switch(i.tag){case 0:case 11:case 15:Tr(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:ot(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,Kt=s;else e:for(i=e;Kt!==null;){s=Kt;var o=s.sibling,_=s.return;if(Cf(s),s===i){Kt=null;break e}if(o!==null){o.return=_,Kt=o;break e}Kt=_}}}var Um={getCacheForType:function(e){var t=k(xe),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return k(xe).controller.signal}},Im=typeof WeakMap=="function"?WeakMap:Map,nt=0,gt=null,Xe=null,Qe=0,ht=0,ji=null,Mr=!1,va=!1,zh=!1,Qs=0,Lt=0,Dr=0,vn=0,Uh=0,Ni=0,Sa=0,Mo=null,Ci=null,Ih=!1,Xl=0,Of=0,Zl=1/0,Ql=null,kr=null,Ft=0,Or=null,ba=null,Js=0,Ph=0,$h=null,Bf=null,Do=0,Fh=null;function Hi(){return(nt&2)!==0&&Qe!==0?Qe&-Qe:V.T!==null?Yh():kn()}function jf(){if(Ni===0)if((Qe&536870912)===0||Ye){var e=Ai;Ai<<=1,(Ai&3932160)===0&&(Ai=262144),Ni=e}else Ni=536870912;return e=Oi.current,e!==null&&(e.flags|=32),Ni}function wi(e,t,i){(e===gt&&(ht===2||ht===9)||e.cancelPendingCommit!==null)&&(ya(e,0),Br(e,Qe,Ni,!1)),Vr(e,i),((nt&2)===0||e!==gt)&&(e===gt&&((nt&2)===0&&(vn|=i),Lt===4&&Br(e,Qe,Ni,!1)),ys(e))}function Nf(e,t,i){if((nt&6)!==0)throw Error(A(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||tr(e,t),o=s?Fm(e,t):qh(e,t,!0),_=s;do{if(o===0){va&&!s&&Br(e,t,0,!1);break}else{if(i=e.current.alternate,_&&!Pm(i)){o=qh(e,t,!1),_=!1;continue}if(o===2){if(_=t,e.errorRecoveryDisabledLanes&_)var D=0;else D=e.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){t=D;e:{var $=e;o=Mo;var ee=$.current.memoizedState.isDehydrated;if(ee&&(ya($,D).flags|=256),D=qh($,D,!1),D!==2){if(zh&&!ee){$.errorRecoveryDisabledLanes|=_,vn|=_,o=4;break e}_=Ci,Ci=o,_!==null&&(Ci===null?Ci=_:Ci.push.apply(Ci,_))}o=D}if(_=!1,o!==2)continue}}if(o===1){ya(e,0),Br(e,t,0,!0);break}e:{switch(s=e,_=o,_){case 0:case 1:throw Error(A(345));case 4:if((t&4194048)!==t)break;case 6:Br(s,t,Ni,!Mr);break e;case 2:Ci=null;break;case 3:case 5:break;default:throw Error(A(329))}if((t&62914560)===t&&(o=Xl+300-be(),10<o)){if(Br(s,t,Ni,!Mr),Kr(s,0,!0)!==0)break e;Js=t,s.timeoutHandle=f_(Hf.bind(null,s,i,Ci,Ql,Ih,t,Ni,vn,Sa,Mr,_,"Throttled",-0,0),o);break e}Hf(s,i,Ci,Ql,Ih,t,Ni,vn,Sa,Mr,_,null,-0,0)}}break}while(!0);ys(e)}function Hf(e,t,i,s,o,_,D,$,ee,le,pe,Se,ce,fe){if(e.timeoutHandle=-1,Se=t.subtreeFlags,Se&8192||(Se&16785408)===16785408){Se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pi},Tf(t,_,Se);var Te=(_&62914560)===_?Xl-be():(_&4194048)===_?Of-be():0;if(Te=Eg(Se,Te),Te!==null){Js=_,e.cancelPendingCommit=Te(qf.bind(null,e,t,_,i,s,o,D,$,ee,pe,Se,null,ce,fe)),Br(e,_,D,!le);return}}qf(e,t,_,i,s,o,D,$,ee)}function Pm(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 o=i[s],_=o.getSnapshot;o=o.value;try{if(!li(_(),o))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 Br(e,t,i,s){t&=~Uh,t&=~vn,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var o=t;0<o;){var _=31-$e(o),D=1<<_;s[_]=-1,o&=~D}i!==0&&ka(e,i,t)}function Jl(){return(nt&6)===0?(ko(0),!1):!0}function Wh(){if(Xe!==null){if(ht===0)var e=Xe.return;else e=Xe,ss=Fs=null,ah(e),ua=null,_o=0,e=Xe;for(;e!==null;)_f(e.alternate,e),e=e.return;Xe=null}}function ya(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,og(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Js=0,Wh(),gt=e,Xe=i=ei(e.current,null),Qe=t,ht=0,ji=null,Mr=!1,va=tr(e,t),zh=!1,Sa=Ni=Uh=vn=Dr=Lt=0,Ci=Mo=null,Ih=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var o=31-$e(s),_=1<<o;t|=e[o],s&=~_}return Qs=t,Qn(),i}function zf(e,t){Ke=null,V.H=Co,t===ns||t===Ll?(t=Ju(),ht=3):t===Vc?(t=Ju(),ht=4):ht=t===Ch?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ji=t,Xe===null&&(Lt=1,$l(e,jt(t,e.current)))}function Uf(){var e=Oi.current;return e===null?!0:(Qe&4194048)===Qe?Ki===null:(Qe&62914560)===Qe||(Qe&536870912)!==0?e===Ki:!1}function If(){var e=V.H;return V.H=Co,e===null?Co:e}function Pf(){var e=V.A;return V.A=Um,e}function ec(){Lt=4,Mr||(Qe&4194048)!==Qe&&Oi.current!==null||(va=!0),(Dr&134217727)===0&&(vn&134217727)===0||gt===null||Br(gt,Qe,Ni,!1)}function qh(e,t,i){var s=nt;nt|=2;var o=If(),_=Pf();(gt!==e||Qe!==t)&&(Ql=null,ya(e,t)),t=!1;var D=Lt;e:do try{if(ht!==0&&Xe!==null){var $=Xe,ee=ji;switch(ht){case 8:Wh(),D=6;break e;case 3:case 2:case 9:case 6:Oi.current===null&&(t=!0);var le=ht;if(ht=0,ji=null,Ca(e,$,ee,le),i&&va){D=0;break e}break;default:le=ht,ht=0,ji=null,Ca(e,$,ee,le)}}$m(),D=Lt;break}catch(pe){zf(e,pe)}while(!0);return t&&e.shellSuspendCounter++,ss=Fs=null,nt=s,V.H=o,V.A=_,Xe===null&&(gt=null,Qe=0,Qn()),D}function $m(){for(;Xe!==null;)$f(Xe)}function Fm(e,t){var i=nt;nt|=2;var s=If(),o=Pf();gt!==e||Qe!==t?(Ql=null,Zl=be()+500,ya(e,t)):va=tr(e,t);e:do try{if(ht!==0&&Xe!==null){t=Xe;var _=ji;t:switch(ht){case 1:ht=0,ji=null,Ca(e,t,_,1);break;case 2:case 9:if(Zu(_)){ht=0,ji=null,Ff(t);break}t=function(){ht!==2&&ht!==9||gt!==e||(ht=7),ys(e)},_.then(t,t);break e;case 3:ht=7;break e;case 4:ht=5;break e;case 7:Zu(_)?(ht=0,ji=null,Ff(t)):(ht=0,ji=null,Ca(e,t,_,7));break;case 5:var D=null;switch(Xe.tag){case 26:D=Xe.memoizedState;case 5:case 27:var $=Xe;if(D?L_(D):$.stateNode.complete){ht=0,ji=null;var ee=$.sibling;if(ee!==null)Xe=ee;else{var le=$.return;le!==null?(Xe=le,tc(le)):Xe=null}break t}}ht=0,ji=null,Ca(e,t,_,5);break;case 6:ht=0,ji=null,Ca(e,t,_,6);break;case 8:Wh(),Lt=6;break e;default:throw Error(A(462))}}Wm();break}catch(pe){zf(e,pe)}while(!0);return ss=Fs=null,V.H=s,V.A=o,nt=i,Xe!==null?0:(gt=null,Qe=0,Qn(),Lt)}function Wm(){for(;Xe!==null&&!de();)$f(Xe)}function $f(e){var t=df(e.alternate,e,Qs);e.memoizedProps=e.pendingProps,t===null?tc(e):Xe=t}function Ff(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=af(i,t,t.pendingProps,t.type,void 0,Qe);break;case 11:t=af(i,t,t.pendingProps,t.type.render,t.ref,Qe);break;case 5:ah(t);default:_f(i,t),t=Xe=cn(t,Qs),t=df(i,t,Qs)}e.memoizedProps=e.pendingProps,t===null?tc(e):Xe=t}function Ca(e,t,i,s){ss=Fs=null,ah(t),ua=null,_o=0;var o=t.return;try{if(km(e,o,t,i,Qe)){Lt=1,$l(e,jt(i,e.current)),Xe=null;return}}catch(_){if(o!==null)throw Xe=o,_;Lt=1,$l(e,jt(i,e.current)),Xe=null;return}t.flags&32768?(Ye||s===1?e=!0:va||(Qe&536870912)!==0?e=!1:(Mr=e=!0,(s===2||s===9||s===3||s===6)&&(s=Oi.current,s!==null&&s.tag===13&&(s.flags|=16384))),Wf(t,e)):tc(t)}function tc(e){var t=e;do{if((t.flags&32768)!==0){Wf(t,Mr);return}e=t.return;var i=jm(t.alternate,t,Qs);if(i!==null){Xe=i;return}if(t=t.sibling,t!==null){Xe=t;return}Xe=t=e}while(t!==null);Lt===0&&(Lt=5)}function Wf(e,t){do{var i=Nm(e.alternate,e);if(i!==null){i.flags&=32767,Xe=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Xe=e;return}Xe=e=i}while(e!==null);Lt=6,Xe=null}function qf(e,t,i,s,o,_,D,$,ee){e.cancelPendingCommit=null;do ic();while(Ft!==0);if((nt&6)!==0)throw Error(A(327));if(t!==null){if(t===e.current)throw Error(A(177));if(_=t.lanes|t.childLanes,_|=no,Vo(e,i,_,D,$,ee),e===gt&&(Xe=gt=null,Qe=0),ba=t,Or=e,Js=i,Ph=_,$h=o,Bf=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Vm(dt,function(){return Xf(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=V.T,V.T=null,o=X.p,X.p=2,D=nt,nt|=4;try{Hm(e,t,i)}finally{nt=D,X.p=o,V.T=s}}Ft=1,Gf(),Kf(),Vf()}}function Gf(){if(Ft===1){Ft=0;var e=Or,t=ba,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=V.T,V.T=null;var s=X.p;X.p=2;var o=nt;nt|=4;try{Af(t,e);var _=su,D=Sl(e.containerInfo),$=_.focusedElem,ee=_.selectionRange;if(D!==$&&$&&$.ownerDocument&&vl($.ownerDocument.documentElement,$)){if(ee!==null&&Gn($)){var le=ee.start,pe=ee.end;if(pe===void 0&&(pe=le),"selectionStart"in $)$.selectionStart=le,$.selectionEnd=Math.min(pe,$.value.length);else{var Se=$.ownerDocument||document,ce=Se&&Se.defaultView||window;if(ce.getSelection){var fe=ce.getSelection(),Te=$.textContent.length,He=Math.min(ee.start,Te),pt=ee.end===void 0?He:Math.min(ee.end,Te);!fe.extend&&He>pt&&(D=pt,pt=He,He=D);var ae=gl($,He),se=gl($,pt);if(ae&&se&&(fe.rangeCount!==1||fe.anchorNode!==ae.node||fe.anchorOffset!==ae.offset||fe.focusNode!==se.node||fe.focusOffset!==se.offset)){var oe=Se.createRange();oe.setStart(ae.node,ae.offset),fe.removeAllRanges(),He>pt?(fe.addRange(oe),fe.extend(se.node,se.offset)):(oe.setEnd(se.node,se.offset),fe.addRange(oe))}}}}for(Se=[],fe=$;fe=fe.parentNode;)fe.nodeType===1&&Se.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof $.focus=="function"&&$.focus(),$=0;$<Se.length;$++){var ve=Se[$];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}_c=!!iu,su=iu=null}finally{nt=o,X.p=s,V.T=i}}e.current=t,Ft=2}}function Kf(){if(Ft===2){Ft=0;var e=Or,t=ba,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=V.T,V.T=null;var s=X.p;X.p=2;var o=nt;nt|=4;try{yf(e,t.alternate,t)}finally{nt=o,X.p=s,V.T=i}}Ft=3}}function Vf(){if(Ft===4||Ft===3){Ft=0,ue();var e=Or,t=ba,i=Js,s=Bf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ft=5:(Ft=0,ba=Or=null,Yf(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(kr=null),Dn(i),t=t.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(Wt,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=V.T,o=X.p,X.p=2,V.T=null;try{for(var _=e.onRecoverableError,D=0;D<s.length;D++){var $=s[D];_($.value,{componentStack:$.stack})}}finally{V.T=t,X.p=o}}(Js&3)!==0&&ic(),ys(e),o=e.pendingLanes,(i&261930)!==0&&(o&42)!==0?e===Fh?Do++:(Do=0,Fh=e):Do=0,ko(0)}}function Yf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ot(t)))}function ic(){return Gf(),Kf(),Vf(),Xf()}function Xf(){if(Ft!==5)return!1;var e=Or,t=Ph;Ph=0;var i=Dn(Js),s=V.T,o=X.p;try{X.p=32>i?32:i,V.T=null,i=$h,$h=null;var _=Or,D=Js;if(Ft=0,ba=Or=null,Js=0,(nt&6)!==0)throw Error(A(331));var $=nt;if(nt|=4,Df(_.current),Lf(_,_.current,D,i),nt=$,ko(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(Wt,_)}catch{}return!0}finally{X.p=o,V.T=s,Yf(e,t)}}function Zf(e,t,i){t=jt(i,t),t=yh(e.stateNode,t,2),e=Ar(e,t,2),e!==null&&(Vr(e,2),ys(e))}function ut(e,t,i){if(e.tag===3)Zf(e,e,i);else for(;t!==null;){if(t.tag===3){Zf(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(kr===null||!kr.has(s))){e=jt(i,e),i=Zd(2),s=Ar(t,i,2),s!==null&&(Qd(i,s,t,e),Vr(s,2),ys(s));break}}t=t.return}}function Gh(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new Im;var o=new Set;s.set(t,o)}else o=s.get(t),o===void 0&&(o=new Set,s.set(t,o));o.has(i)||(zh=!0,o.add(i),e=qm.bind(null,e,t,i),t.then(e,e))}function qm(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,gt===e&&(Qe&i)===i&&(Lt===4||Lt===3&&(Qe&62914560)===Qe&&300>be()-Xl?(nt&2)===0&&ya(e,0):Uh|=i,Sa===Qe&&(Sa=0)),ys(e)}function Qf(e,t){t===0&&(t=Da()),e=Us(e,t),e!==null&&(Vr(e,t),ys(e))}function Gm(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Qf(e,i)}function Km(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,o=e.memoizedState;o!==null&&(i=o.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(A(314))}s!==null&&s.delete(t),Qf(e,i)}function Vm(e,t){return We(e,t)}var sc=null,wa=null,Kh=!1,rc=!1,Vh=!1,jr=0;function ys(e){e!==wa&&e.next===null&&(wa===null?sc=wa=e:wa=wa.next=e),rc=!0,Kh||(Kh=!0,Xm())}function ko(e,t){if(!Vh&&rc){Vh=!0;do for(var i=!1,s=sc;s!==null;){if(e!==0){var o=s.pendingLanes;if(o===0)var _=0;else{var D=s.suspendedLanes,$=s.pingedLanes;_=(1<<31-$e(42|e)+1)-1,_&=o&~(D&~$),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(i=!0,i_(s,_))}else _=Qe,_=Kr(s,s===gt?_:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(_&3)===0||tr(s,_)||(i=!0,i_(s,_));s=s.next}while(i);Vh=!1}}function Ym(){Jf()}function Jf(){rc=Kh=!1;var e=0;jr!==0&&ag()&&(e=jr);for(var t=be(),i=null,s=sc;s!==null;){var o=s.next,_=e_(s,t);_===0?(s.next=null,i===null?sc=o:i.next=o,o===null&&(wa=i)):(i=s,(e!==0||(_&3)!==0)&&(rc=!0)),s=o}Ft!==0&&Ft!==5||ko(e),jr!==0&&(jr=0)}function e_(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,o=e.expirationTimes,_=e.pendingLanes&-62914561;0<_;){var D=31-$e(_),$=1<<D,ee=o[D];ee===-1?(($&i)===0||($&s)!==0)&&(o[D]=ir($,t)):ee<=t&&(e.expiredLanes|=$),_&=~$}if(t=gt,i=Qe,i=Kr(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(ht===2||ht===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Ue(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||tr(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&Ue(s),Dn(i)){case 2:case 8:i=lt;break;case 32:i=dt;break;case 268435456:i=ke;break;default:i=dt}return s=t_.bind(null,e),i=We(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&Ue(s),e.callbackPriority=2,e.callbackNode=null,2}function t_(e,t){if(Ft!==0&&Ft!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(ic()&&e.callbackNode!==i)return null;var s=Qe;return s=Kr(e,e===gt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Nf(e,s,t),e_(e,be()),e.callbackNode!=null&&e.callbackNode===i?t_.bind(null,e):null)}function i_(e,t){if(ic())return null;Nf(e,t,!0)}function Xm(){lg(function(){(nt&6)!==0?We(Pe,Ym):Jf()})}function Yh(){if(jr===0){var e=Gi;e===0&&(e=Ei,Ei<<=1,(Ei&261888)===0&&(Ei=256)),jr=e}return jr}function s_(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Un(""+e)}function r_(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 Zm(e,t,i,s,o){if(t==="submit"&&i&&i.stateNode===o){var _=s_((o[at]||null).action),D=s.submitter;D&&(t=(t=D[at]||null)?s_(t.formAction):D.getAttribute("formAction"),t!==null&&(_=t,D=null));var $=new Pn("action","action",null,s,o);e.push({event:$,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(jr!==0){var ee=D?r_(o,D):new FormData(o);ph(i,{pending:!0,data:ee,method:o.method,action:_},null,ee)}}else typeof _=="function"&&($.preventDefault(),ee=D?r_(o,D):new FormData(o),ph(i,{pending:!0,data:ee,method:o.method,action:_},_,ee))},currentTarget:o}]})}}for(var Xh=0;Xh<ro.length;Xh++){var Zh=ro[Xh],Qm=Zh.toLowerCase(),Jm=Zh[0].toUpperCase()+Zh.slice(1);gi(Qm,"on"+Jm)}gi(bl,"onAnimationEnd"),gi(yl,"onAnimationIteration"),gi(Xn,"onAnimationStart"),gi("dblclick","onDoubleClick"),gi("focusin","onFocus"),gi("focusout","onBlur"),gi(Hs,"onTransitionRun"),gi(Kc,"onTransitionStart"),gi(io,"onTransitionCancel"),gi(Zn,"onTransitionEnd"),ai("onMouseEnter",["mouseout","mouseover"]),ai("onMouseLeave",["mouseout","mouseover"]),ai("onPointerEnter",["pointerout","pointerover"]),ai("onPointerLeave",["pointerout","pointerover"]),_i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_i("onBeforeInput",["compositionend","keypress","textInput","paste"]),_i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oo="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(" "),eg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Oo));function n_(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],o=s.event;s=s.listeners;e:{var _=void 0;if(t)for(var D=s.length-1;0<=D;D--){var $=s[D],ee=$.instance,le=$.currentTarget;if($=$.listener,ee!==_&&o.isPropagationStopped())break e;_=$,o.currentTarget=le;try{_(o)}catch(pe){zs(pe)}o.currentTarget=null,_=ee}else for(D=0;D<s.length;D++){if($=s[D],ee=$.instance,le=$.currentTarget,$=$.listener,ee!==_&&o.isPropagationStopped())break e;_=$,o.currentTarget=le;try{_(o)}catch(pe){zs(pe)}o.currentTarget=null,_=ee}}}}function Ze(e,t){var i=t[hs];i===void 0&&(i=t[hs]=new Set);var s=e+"__bubble";i.has(s)||(a_(t,e,2,!1),i.add(s))}function Qh(e,t,i){var s=0;t&&(s|=4),a_(i,e,s,t)}var nc="_reactListening"+Math.random().toString(36).slice(2);function Jh(e){if(!e[nc]){e[nc]=!0,us.forEach(function(i){i!=="selectionchange"&&(eg.has(i)||Qh(i,!1,e),Qh(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[nc]||(t[nc]=!0,Qh("selectionchange",!1,t))}}function a_(e,t,i,s){switch(j_(t)){case 2:var o=Lg;break;case 8:o=Tg;break;default:o=_u}i=o.bind(null,t,i,e),o=void 0,!In||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),s?o!==void 0?e.addEventListener(t,i,{capture:!0,passive:o}):e.addEventListener(t,i,!0):o!==void 0?e.addEventListener(t,i,{passive:o}):e.addEventListener(t,i,!1)}function eu(e,t,i,s,o){var _=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var D=s.tag;if(D===3||D===4){var $=s.stateNode.containerInfo;if($===o)break;if(D===4)for(D=s.return;D!==null;){var ee=D.tag;if((ee===3||ee===4)&&D.stateNode.containerInfo===o)return;D=D.return}for(;$!==null;){if(D=Ri($),D===null)return;if(ee=D.tag,ee===5||ee===6||ee===26||ee===27){s=_=D;continue e}$=$.parentNode}}s=s.return}Ua(function(){var le=_,pe=za(i),Se=[];e:{var ce=so.get(e);if(ce!==void 0){var fe=Pn,Te=e;switch(e){case"keypress":if(en(i)===0)break e;case"keydown":case"keyup":fe=il;break;case"focusin":Te="focus",fe=bt;break;case"focusout":Te="blur",fe=bt;break;case"beforeblur":case"afterblur":fe=bt;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":fe=Wa;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=ct;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=rl;break;case bl:case yl:case Xn:fe=Jo;break;case Zn:fe=nl;break;case"scroll":case"scrollend":fe=zc;break;case"wheel":fe=es;break;case"copy":case"cut":case"paste":fe=Jt;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=sl;break;case"toggle":case"beforetoggle":fe=qt}var He=(t&4)!==0,pt=!He&&(e==="scroll"||e==="scrollend"),ae=He?ce!==null?ce+"Capture":null:ce;He=[];for(var se=le,oe;se!==null;){var ve=se;if(oe=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||oe===null||ae===null||(ve=Ts(se,ae),ve!=null&&He.push(Bo(se,ve,oe))),pt)break;se=se.return}0<He.length&&(ce=new fe(ce,Te,null,i,pe),Se.push({event:ce,listeners:He}))}}if((t&7)===0){e:{if(ce=e==="mouseover"||e==="pointerover",fe=e==="mouseout"||e==="pointerout",ce&&i!==Ha&&(Te=i.relatedTarget||i.fromElement)&&(Ri(Te)||Te[rr]))break e;if((fe||ce)&&(ce=pe.window===pe?pe:(ce=pe.ownerDocument)?ce.defaultView||ce.parentWindow:window,fe?(Te=i.relatedTarget||i.toElement,fe=le,Te=Te?Ri(Te):null,Te!==null&&(pt=G(Te),He=Te.tag,Te!==pt||He!==5&&He!==27&&He!==6)&&(Te=null)):(fe=null,Te=le),fe!==Te)){if(He=Wa,ve="onMouseLeave",ae="onMouseEnter",se="mouse",(e==="pointerout"||e==="pointerover")&&(He=sl,ve="onPointerLeave",ae="onPointerEnter",se="pointer"),pt=fe==null?ce:ar(fe),oe=Te==null?ce:ar(Te),ce=new He(ve,se+"leave",fe,i,pe),ce.target=pt,ce.relatedTarget=oe,ve=null,Ri(pe)===le&&(He=new He(ae,se+"enter",Te,i,pe),He.target=oe,He.relatedTarget=pt,ve=He),pt=ve,fe&&Te)t:{for(He=tg,ae=fe,se=Te,oe=0,ve=ae;ve;ve=He(ve))oe++;ve=0;for(var Ne=se;Ne;Ne=He(Ne))ve++;for(;0<oe-ve;)ae=He(ae),oe--;for(;0<ve-oe;)se=He(se),ve--;for(;oe--;){if(ae===se||se!==null&&ae===se.alternate){He=ae;break t}ae=He(ae),se=He(se)}He=null}else He=null;fe!==null&&o_(Se,ce,fe,He,!1),Te!==null&&pt!==null&&o_(Se,pt,Te,He,!0)}}e:{if(ce=le?ar(le):window,fe=ce.nodeName&&ce.nodeName.toLowerCase(),fe==="select"||fe==="input"&&ce.type==="file")var it=ul;else if(Za(ce))if(dl)it=qn;else{it=qc;var Me=Wc}else fe=ce.nodeName,!fe||fe.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?le&&Qr(le.elementType)&&(it=ul):it=Gc;if(it&&(it=it(e,le))){$i(Se,it,i,pe);break e}Me&&Me(e,ce,le),e==="focusout"&&le&&ce.type==="number"&&le.memoizedProps.value!=null&&Hn(ce,"number",ce.value)}switch(Me=le?ar(le):window,e){case"focusin":(Za(Me)||Me.contentEditable==="true")&&(Os=Me,eo=le,ln=null);break;case"focusout":ln=eo=Os=null;break;case"mousedown":Kn=!0;break;case"contextmenu":case"mouseup":case"dragend":Kn=!1,Vn(Se,i,pe);break;case"selectionchange":if(Ja)break;case"keydown":case"keyup":Vn(Se,i,pe)}var Ve;if(Va)e:{switch(e){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else dr?ll(e,i)&&(Je="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Je="onCompositionStart");Je&&(al&&i.locale!=="ko"&&(dr||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&dr&&(Ve=Pa()):(Mi=pe,Ia="value"in Mi?Mi.value:Mi.textContent,dr=!0)),Me=ac(le,Je),0<Me.length&&(Je=new nn(Je,e,null,i,pe),Se.push({event:Je,listeners:Me}),Ve?Je.data=Ve:(Ve=cl(i),Ve!==null&&(Je.data=Ve)))),(Ve=$c?Xa(e,i):ps(e,i))&&(Je=ac(le,"onBeforeInput"),0<Je.length&&(Me=new nn("onBeforeInput","beforeinput",null,i,pe),Se.push({event:Me,listeners:Je}),Me.data=Ve)),Zm(Se,e,le,i,pe)}n_(Se,t)})}function Bo(e,t,i){return{instance:e,listener:t,currentTarget:i}}function ac(e,t){for(var i=t+"Capture",s=[];e!==null;){var o=e,_=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||_===null||(o=Ts(e,i),o!=null&&s.unshift(Bo(e,o,_)),o=Ts(e,t),o!=null&&s.push(Bo(e,o,_))),e.tag===3)return s;e=e.return}return[]}function tg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function o_(e,t,i,s,o){for(var _=t._reactName,D=[];i!==null&&i!==s;){var $=i,ee=$.alternate,le=$.stateNode;if($=$.tag,ee!==null&&ee===s)break;$!==5&&$!==26&&$!==27||le===null||(ee=le,o?(le=Ts(i,_),le!=null&&D.unshift(Bo(i,le,ee))):o||(le=Ts(i,_),le!=null&&D.push(Bo(i,le,ee)))),i=i.return}D.length!==0&&e.push({event:t,listeners:D})}var ig=/\r\n?/g,sg=/\u0000|\uFFFD/g;function l_(e){return(typeof e=="string"?e:""+e).replace(ig,`
9
- `).replace(sg,"")}function c_(e,t){return t=l_(t),l_(e)===t}function _t(e,t,i,s,o,_){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Rs(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Rs(e,""+s);break;case"className":Es(e,"class",s);break;case"tabIndex":Es(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Es(e,i,s);break;case"style":Na(e,s,_);break;case"data":if(t!=="object"){Es(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=Un(""+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 _=="function"&&(i==="formAction"?(t!=="input"&&_t(e,t,"name",o.name,o,null),_t(e,t,"formEncType",o.formEncType,o,null),_t(e,t,"formMethod",o.formMethod,o,null),_t(e,t,"formTarget",o.formTarget,o,null)):(_t(e,t,"encType",o.encType,o,null),_t(e,t,"method",o.method,o,null),_t(e,t,"target",o.target,o,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=Un(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=pi);break;case"onScroll":s!=null&&Ze("scroll",e);break;case"onScrollEnd":s!=null&&Ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(A(61));if(i=s.__html,i!=null){if(o.children!=null)throw Error(A(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=Un(""+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":Ze("beforetoggle",e),Ze("toggle",e),xs(e,"popover",s);break;case"xlinkActuate":Zi(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Zi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Zi(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Zi(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Zi(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Zi(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Zi(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Zi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Zi(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":xs(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=Hc.get(i)||i,xs(e,i,s))}}function tu(e,t,i,s,o,_){switch(i){case"style":Na(e,s,_);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(A(61));if(i=s.__html,i!=null){if(o.children!=null)throw Error(A(60));e.innerHTML=i}}break;case"children":typeof s=="string"?Rs(e,s):(typeof s=="number"||typeof s=="bigint")&&Rs(e,""+s);break;case"onScroll":s!=null&&Ze("scroll",e);break;case"onScrollEnd":s!=null&&Ze("scrollend",e);break;case"onClick":s!=null&&(e.onclick=pi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!or.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(o=i.endsWith("Capture"),t=i.slice(2,o?i.length-7:void 0),_=e[at]||null,_=_!=null?_[i]:null,typeof _=="function"&&e.removeEventListener(t,_,o),typeof s=="function")){typeof _!="function"&&_!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,o);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):xs(e,i,s)}}}function Xt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",e),Ze("load",e);var s=!1,o=!1,_;for(_ in i)if(i.hasOwnProperty(_)){var D=i[_];if(D!=null)switch(_){case"src":s=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(A(137,t));default:_t(e,t,_,D,i,null)}}o&&_t(e,t,"srcSet",i.srcSet,i,null),s&&_t(e,t,"src",i.src,i,null);return;case"input":Ze("invalid",e);var $=_=D=o=null,ee=null,le=null;for(s in i)if(i.hasOwnProperty(s)){var pe=i[s];if(pe!=null)switch(s){case"name":o=pe;break;case"type":D=pe;break;case"checked":ee=pe;break;case"defaultChecked":le=pe;break;case"value":_=pe;break;case"defaultValue":$=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(A(137,t));break;default:_t(e,t,s,pe,i,null)}}Nn(e,_,$,ee,le,D,o,!1);return;case"select":Ze("invalid",e),s=D=_=null;for(o in i)if(i.hasOwnProperty(o)&&($=i[o],$!=null))switch(o){case"value":_=$;break;case"defaultValue":D=$;break;case"multiple":s=$;default:_t(e,t,o,$,i,null)}t=_,i=D,e.multiple=!!s,t!=null?Qi(e,!!s,t,!1):i!=null&&Qi(e,!!s,i,!0);return;case"textarea":Ze("invalid",e),_=o=s=null;for(D in i)if(i.hasOwnProperty(D)&&($=i[D],$!=null))switch(D){case"value":s=$;break;case"defaultValue":o=$;break;case"children":_=$;break;case"dangerouslySetInnerHTML":if($!=null)throw Error(A(91));break;default:_t(e,t,D,$,i,null)}Ba(e,s,o,_);return;case"option":for(ee in i)i.hasOwnProperty(ee)&&(s=i[ee],s!=null)&&(ee==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":_t(e,t,ee,s,i,null));return;case"dialog":Ze("beforetoggle",e),Ze("toggle",e),Ze("cancel",e),Ze("close",e);break;case"iframe":case"object":Ze("load",e);break;case"video":case"audio":for(s=0;s<Oo.length;s++)Ze(Oo[s],e);break;case"image":Ze("error",e),Ze("load",e);break;case"details":Ze("toggle",e);break;case"embed":case"source":case"link":Ze("error",e),Ze("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(le in i)if(i.hasOwnProperty(le)&&(s=i[le],s!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(A(137,t));default:_t(e,t,le,s,i,null)}return;default:if(Qr(t)){for(pe in i)i.hasOwnProperty(pe)&&(s=i[pe],s!==void 0&&tu(e,t,pe,s,i,void 0));return}}for($ in i)i.hasOwnProperty($)&&(s=i[$],s!=null&&_t(e,t,$,s,i,null))}function rg(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 o=null,_=null,D=null,$=null,ee=null,le=null,pe=null;for(fe in i){var Se=i[fe];if(i.hasOwnProperty(fe)&&Se!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":ee=Se;default:s.hasOwnProperty(fe)||_t(e,t,fe,null,s,Se)}}for(var ce in s){var fe=s[ce];if(Se=i[ce],s.hasOwnProperty(ce)&&(fe!=null||Se!=null))switch(ce){case"type":_=fe;break;case"name":o=fe;break;case"checked":le=fe;break;case"defaultChecked":pe=fe;break;case"value":D=fe;break;case"defaultValue":$=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(A(137,t));break;default:fe!==Se&&_t(e,t,ce,fe,s,Se)}}Oa(e,D,$,ee,le,pe,_,o);return;case"select":fe=D=$=ce=null;for(_ in i)if(ee=i[_],i.hasOwnProperty(_)&&ee!=null)switch(_){case"value":break;case"multiple":fe=ee;default:s.hasOwnProperty(_)||_t(e,t,_,null,s,ee)}for(o in s)if(_=s[o],ee=i[o],s.hasOwnProperty(o)&&(_!=null||ee!=null))switch(o){case"value":ce=_;break;case"defaultValue":$=_;break;case"multiple":D=_;default:_!==ee&&_t(e,t,o,_,s,ee)}t=$,i=D,s=fe,ce!=null?Qi(e,!!i,ce,!1):!!s!=!!i&&(t!=null?Qi(e,!!i,t,!0):Qi(e,!!i,i?[]:"",!1));return;case"textarea":fe=ce=null;for($ in i)if(o=i[$],i.hasOwnProperty($)&&o!=null&&!s.hasOwnProperty($))switch($){case"value":break;case"children":break;default:_t(e,t,$,null,s,o)}for(D in s)if(o=s[D],_=i[D],s.hasOwnProperty(D)&&(o!=null||_!=null))switch(D){case"value":ce=o;break;case"defaultValue":fe=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(A(91));break;default:o!==_&&_t(e,t,D,o,s,_)}Ti(e,ce,fe);return;case"option":for(var Te in i)ce=i[Te],i.hasOwnProperty(Te)&&ce!=null&&!s.hasOwnProperty(Te)&&(Te==="selected"?e.selected=!1:_t(e,t,Te,null,s,ce));for(ee in s)ce=s[ee],fe=i[ee],s.hasOwnProperty(ee)&&ce!==fe&&(ce!=null||fe!=null)&&(ee==="selected"?e.selected=ce&&typeof ce!="function"&&typeof ce!="symbol":_t(e,t,ee,ce,s,fe));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 He in i)ce=i[He],i.hasOwnProperty(He)&&ce!=null&&!s.hasOwnProperty(He)&&_t(e,t,He,null,s,ce);for(le in s)if(ce=s[le],fe=i[le],s.hasOwnProperty(le)&&ce!==fe&&(ce!=null||fe!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(A(137,t));break;default:_t(e,t,le,ce,s,fe)}return;default:if(Qr(t)){for(var pt in i)ce=i[pt],i.hasOwnProperty(pt)&&ce!==void 0&&!s.hasOwnProperty(pt)&&tu(e,t,pt,void 0,s,ce);for(pe in s)ce=s[pe],fe=i[pe],!s.hasOwnProperty(pe)||ce===fe||ce===void 0&&fe===void 0||tu(e,t,pe,ce,s,fe);return}}for(var ae in i)ce=i[ae],i.hasOwnProperty(ae)&&ce!=null&&!s.hasOwnProperty(ae)&&_t(e,t,ae,null,s,ce);for(Se in s)ce=s[Se],fe=i[Se],!s.hasOwnProperty(Se)||ce===fe||ce==null&&fe==null||_t(e,t,Se,ce,s,fe)}function h_(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ng(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var o=i[s],_=o.transferSize,D=o.initiatorType,$=o.duration;if(_&&$&&h_(D)){for(D=0,$=o.responseEnd,s+=1;s<i.length;s++){var ee=i[s],le=ee.startTime;if(le>$)break;var pe=ee.transferSize,Se=ee.initiatorType;pe&&h_(Se)&&(ee=ee.responseEnd,D+=pe*(ee<$?1:($-le)/(ee-le)))}if(--s,t+=8*(_+D)/(o.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 iu=null,su=null;function oc(e){return e.nodeType===9?e:e.ownerDocument}function u_(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 d_(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 ru(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 nu=null;function ag(){var e=window.event;return e&&e.type==="popstate"?e===nu?!1:(nu=e,!0):(nu=null,!1)}var f_=typeof setTimeout=="function"?setTimeout:void 0,og=typeof clearTimeout=="function"?clearTimeout:void 0,__=typeof Promise=="function"?Promise:void 0,lg=typeof queueMicrotask=="function"?queueMicrotask:typeof __<"u"?function(e){return __.resolve(null).then(e).catch(cg)}:f_;function cg(e){setTimeout(function(){throw e})}function Nr(e){return e==="head"}function p_(e,t){var i=t,s=0;do{var o=i.nextSibling;if(e.removeChild(i),o&&o.nodeType===8)if(i=o.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(o),Ra(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")jo(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,jo(i);for(var _=i.firstChild;_;){var D=_.nextSibling,$=_.nodeName;_[nr]||$==="SCRIPT"||$==="STYLE"||$==="LINK"&&_.rel.toLowerCase()==="stylesheet"||i.removeChild(_),_=D}}else i==="body"&&jo(e.ownerDocument.body);i=o}while(i);Ra(t)}function m_(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 au(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":au(i),fi(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function hg(e,t,i,s){for(;e.nodeType===1;){var o=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[nr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(_=e.getAttribute("rel"),_==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(_!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(_=e.getAttribute("src"),(_!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&_&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var _=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===_)return e}else return e;if(e=Vi(e.nextSibling),e===null)break}return null}function ug(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Vi(e.nextSibling),e===null))return null;return e}function g_(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Vi(e.nextSibling),e===null))return null;return e}function ou(e){return e.data==="$?"||e.data==="$~"}function lu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function dg(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 Vi(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 cu=null;function v_(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Vi(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function S_(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 b_(e,t,i){switch(t=oc(i),e){case"html":if(e=t.documentElement,!e)throw Error(A(452));return e;case"head":if(e=t.head,!e)throw Error(A(453));return e;case"body":if(e=t.body,!e)throw Error(A(454));return e;default:throw Error(A(451))}}function jo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);fi(e)}var Yi=new Map,y_=new Set;function lc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var er=X.d;X.d={f:fg,r:_g,D:pg,C:mg,L:gg,m:vg,X:bg,S:Sg,M:yg};function fg(){var e=er.f(),t=Jl();return e||t}function _g(e){var t=ni(e);t!==null&&t.tag===5&&t.type==="form"?Hd(t):er.r(e)}var xa=typeof document>"u"?null:document;function C_(e,t,i){var s=xa;if(s&&typeof t=="string"&&t){var o=Zt(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof i=="string"&&(o+='[crossorigin="'+i+'"]'),y_.has(o)||(y_.add(o),e={rel:e,crossOrigin:i,href:t},s.querySelector(o)===null&&(t=s.createElement("link"),Xt(t,"link",e),At(t),s.head.appendChild(t)))}}function pg(e){er.D(e),C_("dns-prefetch",e,null)}function mg(e,t){er.C(e,t),C_("preconnect",e,t)}function gg(e,t,i){er.L(e,t,i);var s=xa;if(s&&e&&t){var o='link[rel="preload"][as="'+Zt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(o+='[imagesrcset="'+Zt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(o+='[imagesizes="'+Zt(i.imageSizes)+'"]')):o+='[href="'+Zt(e)+'"]';var _=o;switch(t){case"style":_=Ea(e);break;case"script":_=Aa(e)}Yi.has(_)||(e=l({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Yi.set(_,e),s.querySelector(o)!==null||t==="style"&&s.querySelector(No(_))||t==="script"&&s.querySelector(Ho(_))||(t=s.createElement("link"),Xt(t,"link",e),At(t),s.head.appendChild(t)))}}function vg(e,t){er.m(e,t);var i=xa;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Zt(s)+'"][href="'+Zt(e)+'"]',_=o;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Aa(e)}if(!Yi.has(_)&&(e=l({rel:"modulepreload",href:e},t),Yi.set(_,e),i.querySelector(o)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Ho(_)))return}s=i.createElement("link"),Xt(s,"link",e),At(s),i.head.appendChild(s)}}}function Sg(e,t,i){er.S(e,t,i);var s=xa;if(s&&e){var o=Li(s).hoistableStyles,_=Ea(e);t=t||"default";var D=o.get(_);if(!D){var $={loading:0,preload:null};if(D=s.querySelector(No(_)))$.loading=5;else{e=l({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Yi.get(_))&&hu(e,i);var ee=D=s.createElement("link");At(ee),Xt(ee,"link",e),ee._p=new Promise(function(le,pe){ee.onload=le,ee.onerror=pe}),ee.addEventListener("load",function(){$.loading|=1}),ee.addEventListener("error",function(){$.loading|=2}),$.loading|=4,cc(D,t,s)}D={type:"stylesheet",instance:D,count:1,state:$},o.set(_,D)}}}function bg(e,t){er.X(e,t);var i=xa;if(i&&e){var s=Li(i).hoistableScripts,o=Aa(e),_=s.get(o);_||(_=i.querySelector(Ho(o)),_||(e=l({src:e,async:!0},t),(t=Yi.get(o))&&uu(e,t),_=i.createElement("script"),At(_),Xt(_,"link",e),i.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},s.set(o,_))}}function yg(e,t){er.M(e,t);var i=xa;if(i&&e){var s=Li(i).hoistableScripts,o=Aa(e),_=s.get(o);_||(_=i.querySelector(Ho(o)),_||(e=l({src:e,async:!0,type:"module"},t),(t=Yi.get(o))&&uu(e,t),_=i.createElement("script"),At(_),Xt(_,"link",e),i.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},s.set(o,_))}}function w_(e,t,i,s){var o=(o=ge.current)?lc(o):null;if(!o)throw Error(A(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Ea(i.href),i=Li(o).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=Ea(i.href);var _=Li(o).hoistableStyles,D=_.get(e);if(D||(o=o.ownerDocument||o,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(e,D),(_=o.querySelector(No(e)))&&!_._p&&(D.instance=_,D.state.loading=5),Yi.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},Yi.set(e,i),_||Cg(o,e,i,D.state))),t&&s===null)throw Error(A(528,""));return D}if(t&&s!==null)throw Error(A(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Aa(i),i=Li(o).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(A(444,e))}}function Ea(e){return'href="'+Zt(e)+'"'}function No(e){return'link[rel="stylesheet"]['+e+"]"}function x_(e){return l({},e,{"data-precedence":e.precedence,precedence:null})}function Cg(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}),Xt(t,"link",i),At(t),e.head.appendChild(t))}function Aa(e){return'[src="'+Zt(e)+'"]'}function Ho(e){return"script[async]"+e}function E_(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Zt(i.href)+'"]');if(s)return t.instance=s,At(s),s;var o=l({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),At(s),Xt(s,"style",o),cc(s,i.precedence,e),t.instance=s;case"stylesheet":o=Ea(i.href);var _=e.querySelector(No(o));if(_)return t.state.loading|=4,t.instance=_,At(_),_;s=x_(i),(o=Yi.get(o))&&hu(s,o),_=(e.ownerDocument||e).createElement("link"),At(_);var D=_;return D._p=new Promise(function($,ee){D.onload=$,D.onerror=ee}),Xt(_,"link",s),t.state.loading|=4,cc(_,i.precedence,e),t.instance=_;case"script":return _=Aa(i.src),(o=e.querySelector(Ho(_)))?(t.instance=o,At(o),o):(s=i,(o=Yi.get(_))&&(s=l({},i),uu(s,o)),e=e.ownerDocument||e,o=e.createElement("script"),At(o),Xt(o,"link",s),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(A(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,cc(s,i.precedence,e));return t.instance}function cc(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=s.length?s[s.length-1]:null,_=o,D=0;D<s.length;D++){var $=s[D];if($.dataset.precedence===t)_=$;else if(_!==o)break}_?_.parentNode.insertBefore(e,_.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function hu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function uu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var hc=null;function A_(e,t,i){if(hc===null){var s=new Map,o=hc=new Map;o.set(i,s)}else o=hc,s=o.get(i),s||(s=new Map,o.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),o=0;o<i.length;o++){var _=i[o];if(!(_[nr]||_[qe]||e==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var D=_.getAttribute(t)||"";D=e+D;var $=s.get(D);$?$.push(_):s.set(D,[_])}}return s}function R_(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function wg(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 L_(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function xg(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 o=Ea(s.href),_=t.querySelector(No(o));if(_){t=_._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=uc.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=_,At(_);return}_=t.ownerDocument||t,s=x_(s),(o=Yi.get(o))&&hu(s,o),_=_.createElement("link"),At(_);var D=_;D._p=new Promise(function($,ee){D.onload=$,D.onerror=ee}),Xt(_,"link",s),i.instance=_}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=uc.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var du=0;function Eg(e,t){return e.stylesheets&&e.count===0&&fc(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&fc(e,e.stylesheets),e.unsuspend){var _=e.unsuspend;e.unsuspend=null,_()}},6e4+t);0<e.imgBytes&&du===0&&(du=62500*ng());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fc(e,e.stylesheets),e.unsuspend)){var _=e.unsuspend;e.unsuspend=null,_()}},(e.imgBytes>du?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(o)}}:null}function uc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var dc=null;function fc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,dc=new Map,t.forEach(Ag,e),dc=null,uc.call(e))}function Ag(e,t){if(!(t.state.loading&4)){var i=dc.get(e);if(i)var s=i.get(null);else{i=new Map,dc.set(e,i);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<o.length;_++){var D=o[_];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(i.set(D.dataset.precedence,D),s=D)}s&&i.set(null,s)}o=t.instance,D=o.getAttribute("data-precedence"),_=i.get(D)||s,_===s&&i.set(null,o),i.set(D,o),this.count++,s=uc.bind(this),o.addEventListener("load",s),o.addEventListener("error",s),_?_.parentNode.insertBefore(o,_.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var zo={$$typeof:h,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function Rg(e,t,i,s,o,_,D,$,ee){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=Ln(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ln(0),this.hiddenUpdates=Ln(null),this.identifierPrefix=s,this.onUncaughtError=o,this.onCaughtError=_,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ee,this.incompleteTransitions=new Map}function T_(e,t,i,s,o,_,D,$,ee,le,pe,Se){return e=new Rg(e,t,i,D,ee,le,pe,Se,$),t=1,_===!0&&(t|=24),_=ci(3,null,null,t),e.current=_,_.stateNode=e,t=et(),t.refCount++,e.pooledCache=t,t.refCount++,_.memoizedState={element:s,isDehydrated:i,cache:t},Yc(_),e}function M_(e){return e?(e=Is,e):Is}function D_(e,t,i,s,o,_){o=M_(o),s.context===null?s.context=o:s.pendingContext=o,s=Er(t),s.payload={element:i},_=_===void 0?null:_,_!==null&&(s.callback=_),i=Ar(e,s,t),i!==null&&(wi(i,e,t),mo(i,e,t))}function k_(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function fu(e,t){k_(e,t),(e=e.alternate)&&k_(e,t)}function O_(e){if(e.tag===13||e.tag===31){var t=Us(e,67108864);t!==null&&wi(t,e,67108864),fu(e,67108864)}}function B_(e){if(e.tag===13||e.tag===31){var t=Hi();t=sr(t);var i=Us(e,t);i!==null&&wi(i,e,t),fu(e,t)}}var _c=!0;function Lg(e,t,i,s){var o=V.T;V.T=null;var _=X.p;try{X.p=2,_u(e,t,i,s)}finally{X.p=_,V.T=o}}function Tg(e,t,i,s){var o=V.T;V.T=null;var _=X.p;try{X.p=8,_u(e,t,i,s)}finally{X.p=_,V.T=o}}function _u(e,t,i,s){if(_c){var o=pu(s);if(o===null)eu(e,t,s,pc,i),N_(e,s);else if(Dg(o,e,t,i,s))s.stopPropagation();else if(N_(e,s),t&4&&-1<Mg.indexOf(e)){for(;o!==null;){var _=ni(o);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var D=ri(_.pendingLanes);if(D!==0){var $=_;for($.pendingLanes|=2,$.entangledLanes|=2;D;){var ee=1<<31-$e(D);$.entanglements[1]|=ee,D&=~ee}ys(_),(nt&6)===0&&(Zl=be()+500,ko(0))}}break;case 31:case 13:$=Us(_,2),$!==null&&wi($,_,2),Jl(),fu(_,2)}if(_=pu(s),_===null&&eu(e,t,s,pc,i),_===o)break;o=_}o!==null&&s.stopPropagation()}else eu(e,t,s,null,i)}}function pu(e){return e=za(e),mu(e)}var pc=null;function mu(e){if(pc=null,e=Ri(e),e!==null){var t=G(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=P(t),e!==null)return e;e=null}else if(i===31){if(e=r(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 pc=e,null}function j_(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(Le()){case Pe:return 2;case lt:return 8;case dt:case vt:return 32;case ke:return 268435456;default:return 32}default:return 32}}var gu=!1,Hr=null,zr=null,Ur=null,Uo=new Map,Io=new Map,Ir=[],Mg="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 N_(e,t){switch(e){case"focusin":case"focusout":Hr=null;break;case"dragenter":case"dragleave":zr=null;break;case"mouseover":case"mouseout":Ur=null;break;case"pointerover":case"pointerout":Uo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Io.delete(t.pointerId)}}function Po(e,t,i,s,o,_){return e===null||e.nativeEvent!==_?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:_,targetContainers:[o]},t!==null&&(t=ni(t),t!==null&&O_(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Dg(e,t,i,s,o){switch(t){case"focusin":return Hr=Po(Hr,e,t,i,s,o),!0;case"dragenter":return zr=Po(zr,e,t,i,s,o),!0;case"mouseover":return Ur=Po(Ur,e,t,i,s,o),!0;case"pointerover":var _=o.pointerId;return Uo.set(_,Po(Uo.get(_)||null,e,t,i,s,o)),!0;case"gotpointercapture":return _=o.pointerId,Io.set(_,Po(Io.get(_)||null,e,t,i,s,o)),!0}return!1}function H_(e){var t=Ri(e.target);if(t!==null){var i=G(t);if(i!==null){if(t=i.tag,t===13){if(t=P(i),t!==null){e.blockedOn=t,On(e.priority,function(){B_(i)});return}}else if(t===31){if(t=r(i),t!==null){e.blockedOn=t,On(e.priority,function(){B_(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 mc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=pu(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);Ha=s,i.target.dispatchEvent(s),Ha=null}else return t=ni(i),t!==null&&O_(t),e.blockedOn=i,!1;t.shift()}return!0}function z_(e,t,i){mc(e)&&i.delete(t)}function kg(){gu=!1,Hr!==null&&mc(Hr)&&(Hr=null),zr!==null&&mc(zr)&&(zr=null),Ur!==null&&mc(Ur)&&(Ur=null),Uo.forEach(z_),Io.forEach(z_)}function gc(e,t){e.blockedOn===t&&(e.blockedOn=null,gu||(gu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,kg)))}var vc=null;function U_(e){vc!==e&&(vc=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){vc===e&&(vc=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],o=e[t+2];if(typeof s!="function"){if(mu(s||i)===null)continue;break}var _=ni(i);_!==null&&(e.splice(t,3),t-=3,ph(_,{pending:!0,data:o,method:i.method,action:s},s,o))}}))}function Ra(e){function t(ee){return gc(ee,e)}Hr!==null&&gc(Hr,e),zr!==null&&gc(zr,e),Ur!==null&&gc(Ur,e),Uo.forEach(t),Io.forEach(t);for(var i=0;i<Ir.length;i++){var s=Ir[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Ir.length&&(i=Ir[0],i.blockedOn===null);)H_(i),i.blockedOn===null&&Ir.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var o=i[s],_=i[s+1],D=o[at]||null;if(typeof _=="function")D||U_(i);else if(D){var $=null;if(_&&_.hasAttribute("formAction")){if(o=_,D=_[at]||null)$=D.formAction;else if(mu(o)!==null)continue}else $=D.action;typeof $=="function"?i[s+1]=$:(i.splice(s,3),s-=3),U_(i)}}}function I_(){function e(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(D){return o=D})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,o=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),o!==null&&(o(),o=null)}}}function vu(e){this._internalRoot=e}Sc.prototype.render=vu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(A(409));var i=t.current,s=Hi();D_(i,s,e,t,null,null)},Sc.prototype.unmount=vu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;D_(e.current,2,null,e,null,null),Jl(),t[rr]=null}};function Sc(e){this._internalRoot=e}Sc.prototype.unstable_scheduleHydration=function(e){if(e){var t=kn();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ir.length&&t!==0&&t<Ir[i].priority;i++);Ir.splice(i,0,e),i===0&&H_(e)}};var P_=C.version;if(P_!=="19.2.8")throw Error(A(527,P_,"19.2.8"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(A(188)):(e=Object.keys(e).join(","),Error(A(268,e)));return e=g(t),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var Og={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bc.isDisabled&&bc.supportsFiber)try{Wt=bc.inject(Og),wt=bc}catch{}}return Fo.createRoot=function(e,t){if(!N(e))throw Error(A(299));var i=!1,s="",o=Kd,_=Vd,D=Yd;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(_=t.onCaughtError),t.onRecoverableError!==void 0&&(D=t.onRecoverableError)),t=T_(e,1,!1,null,null,i,s,null,o,_,D,I_),e[rr]=t.current,Jh(e),new vu(t)},Fo.hydrateRoot=function(e,t,i){if(!N(e))throw Error(A(299));var s=!1,o="",_=Kd,D=Vd,$=Yd,ee=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(o=i.identifierPrefix),i.onUncaughtError!==void 0&&(_=i.onUncaughtError),i.onCaughtError!==void 0&&(D=i.onCaughtError),i.onRecoverableError!==void 0&&($=i.onRecoverableError),i.formState!==void 0&&(ee=i.formState)),t=T_(e,1,!0,t,i??null,s,o,ee,_,D,$,I_),t.context=M_(null),i=t.current,s=Hi(),s=sr(s),o=Er(s),o.callback=null,Ar(i,o,s),i=s,t.current.lanes=i,Vr(t,i),ys(t),e[rr]=t.current,Jh(e),new Sc(t)},Fo.version="19.2.8",Fo}var Z_;function Fg(){if(Z_)return yu.exports;Z_=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(C){console.error(C)}}return n(),yu.exports=$g(),yu.exports}var Wg=Fg(),Eu={exports:{}},Q_;function qg(){return Q_||(Q_=1,(function(n,C){(function(E,A){n.exports=A()})(globalThis,(()=>(()=>{var E={4567:function(P,r,d){var g=this&&this.__decorate||function(f,h,b,M){var w,T=arguments.length,y=T<3?h:M===null?M=Object.getOwnPropertyDescriptor(h,b):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,h,b,M);else for(var L=f.length-1;L>=0;L--)(w=f[L])&&(y=(T<3?w(y):T>3?w(h,b,y):w(h,b))||y);return T>3&&y&&Object.defineProperty(h,b,y),y},p=this&&this.__param||function(f,h){return function(b,M){h(b,M,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const l=d(9042),S=d(9924),x=d(844),R=d(4725),m=d(2585),a=d(3656);let u=r.AccessibilityManager=class extends x.Disposable{constructor(f,h,b,M){super(),this._terminal=f,this._coreBrowserService=b,this._renderService=M,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let w=0;w<this._terminal.rows;w++)this._rowElements[w]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[w]);if(this._topBoundaryFocusListener=w=>this._handleBoundaryFocus(w,0),this._bottomBoundaryFocusListener=w=>this._handleBoundaryFocus(w,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=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new S.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((w=>this._handleResize(w.rows)))),this.register(this._terminal.onRender((w=>this._refreshRows(w.start,w.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((w=>this._handleChar(w)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
10
- `)))),this.register(this._terminal.onA11yTab((w=>this._handleTab(w)))),this.register(this._terminal.onKey((w=>this._handleKey(w.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,a.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(f){for(let h=0;h<f;h++)this._handleChar(" ")}_handleChar(f){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==f&&(this._charsToAnnounce+=f):this._charsToAnnounce+=f,f===`
11
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=l.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(f){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(f)||this._charsToConsume.push(f)}_refreshRows(f,h){this._liveRegionDebouncer.refresh(f,h,this._terminal.rows)}_renderRows(f,h){const b=this._terminal.buffer,M=b.lines.length.toString();for(let w=f;w<=h;w++){const T=b.lines.get(b.ydisp+w),y=[],L=T?.translateToString(!0,void 0,void 0,y)||"",O=(b.ydisp+w+1).toString(),U=this._rowElements[w];U&&(L.length===0?(U.innerText=" ",this._rowColumns.set(U,[0,1])):(U.textContent=L,this._rowColumns.set(U,y)),U.setAttribute("aria-posinset",O),U.setAttribute("aria-setsize",M))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(f,h){const b=f.target,M=this._rowElements[h===0?1:this._rowElements.length-2];if(b.getAttribute("aria-posinset")===(h===0?"1":`${this._terminal.buffer.lines.length}`)||f.relatedTarget!==M)return;let w,T;if(h===0?(w=b,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(w=this._rowElements.shift(),T=b,this._rowContainer.removeChild(w)),w.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),h===0){const y=this._createAccessibilityTreeNode();this._rowElements.unshift(y),this._rowContainer.insertAdjacentElement("afterbegin",y)}else{const y=this._createAccessibilityTreeNode();this._rowElements.push(y),this._rowContainer.appendChild(y)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(h===0?-1:1),this._rowElements[h===0?1:this._rowElements.length-2].focus(),f.preventDefault(),f.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const f=document.getSelection();if(!f)return;if(f.isCollapsed)return void(this._rowContainer.contains(f.anchorNode)&&this._terminal.clearSelection());if(!f.anchorNode||!f.focusNode)return void console.error("anchorNode and/or focusNode are null");let h={node:f.anchorNode,offset:f.anchorOffset},b={node:f.focusNode,offset:f.focusOffset};if((h.node.compareDocumentPosition(b.node)&Node.DOCUMENT_POSITION_PRECEDING||h.node===b.node&&h.offset>b.offset)&&([h,b]=[b,h]),h.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(h={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(h.node))return;const M=this._rowElements.slice(-1)[0];if(b.node.compareDocumentPosition(M)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(b={node:M,offset:M.textContent?.length??0}),!this._rowContainer.contains(b.node))return;const w=({node:L,offset:O})=>{const U=L instanceof Text?L.parentNode:L;let H=parseInt(U?.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const z=this._rowColumns.get(U);if(!z)return console.warn("columns is null. Race condition?"),null;let Y=O<z.length?z[O]:z.slice(-1)[0]+1;return Y>=this._terminal.cols&&(++H,Y=0),{row:H,column:Y}},T=w(h),y=w(b);if(T&&y){if(T.row>y.row||T.row===y.row&&T.column>=y.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(y.row-T.row)*this._terminal.cols-T.column+y.column)}}_handleResize(f){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let h=this._rowContainer.children.length;h<this._terminal.rows;h++)this._rowElements[h]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[h]);for(;this._rowElements.length>f;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const f=this._coreBrowserService.mainDocument.createElement("div");return f.setAttribute("role","listitem"),f.tabIndex=-1,this._refreshRowDimensions(f),f}_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 f=0;f<this._terminal.rows;f++)this._refreshRowDimensions(this._rowElements[f])}}_refreshRowDimensions(f){f.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=u=g([p(1,m.IInstantiationService),p(2,R.ICoreBrowserService),p(3,R.IRenderService)],u)},3614:(P,r)=>{function d(S){return S.replace(/\r?\n/g,"\r")}function g(S,x){return x?"\x1B[200~"+S+"\x1B[201~":S}function p(S,x,R,m){S=g(S=d(S),R.decPrivateModes.bracketedPasteMode&&m.rawOptions.ignoreBracketedPasteMode!==!0),R.triggerDataEvent(S,!0),x.value=""}function l(S,x,R){const m=R.getBoundingClientRect(),a=S.clientX-m.left-10,u=S.clientY-m.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${a}px`,x.style.top=`${u}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=d,r.bracketTextForPaste=g,r.copyHandler=function(S,x){S.clipboardData&&S.clipboardData.setData("text/plain",x.selectionText),S.preventDefault()},r.handlePasteEvent=function(S,x,R,m){S.stopPropagation(),S.clipboardData&&p(S.clipboardData.getData("text/plain"),x,R,m)},r.paste=p,r.moveTextAreaUnderMouseCursor=l,r.rightClickHandler=function(S,x,R,m,a){l(S,x,R),a&&m.rightClickSelect(S),x.value=m.selectionText,x.select()}},7239:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const g=d(1505);r.ColorContrastCache=class{constructor(){this._color=new g.TwoKeyMap,this._css=new g.TwoKeyMap}setCss(p,l,S){this._css.set(p,l,S)}getCss(p,l){return this._css.get(p,l)}setColor(p,l,S){this._color.set(p,l,S)}getColor(p,l){return this._color.get(p,l)}clear(){this._color.clear(),this._css.clear()}}},3656:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(d,g,p,l){d.addEventListener(g,p,l);let S=!1;return{dispose:()=>{S||(S=!0,d.removeEventListener(g,p,l))}}}},3551:function(P,r,d){var g=this&&this.__decorate||function(u,f,h,b){var M,w=arguments.length,T=w<3?f:b===null?b=Object.getOwnPropertyDescriptor(f,h):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(u,f,h,b);else for(var y=u.length-1;y>=0;y--)(M=u[y])&&(T=(w<3?M(T):w>3?M(f,h,T):M(f,h))||T);return w>3&&T&&Object.defineProperty(f,h,T),T},p=this&&this.__param||function(u,f){return function(h,b){f(h,b,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;const l=d(3656),S=d(8460),x=d(844),R=d(2585),m=d(4725);let a=r.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(u,f,h,b,M){super(),this._element=u,this._mouseService=f,this._renderService=h,this._bufferService=b,this._linkProviderService=M,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new S.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new S.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,l.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,l.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(u){this._lastMouseEvent=u;const f=this._positionFromMouseEvent(u,this._element,this._mouseService);if(!f)return;this._isMouseOut=!1;const h=u.composedPath();for(let b=0;b<h.length;b++){const M=h[b];if(M.classList.contains("xterm"))break;if(M.classList.contains("xterm-hover"))return}this._lastBufferCell&&f.x===this._lastBufferCell.x&&f.y===this._lastBufferCell.y||(this._handleHover(f),this._lastBufferCell=f)}_handleHover(u){if(this._activeLine!==u.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(u,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,u)||(this._clearCurrentLink(),this._askForLink(u,!0))}_askForLink(u,f){this._activeProviderReplies&&f||(this._activeProviderReplies?.forEach((b=>{b?.forEach((M=>{M.link.dispose&&M.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=u.y);let h=!1;for(const[b,M]of this._linkProviderService.linkProviders.entries())f?this._activeProviderReplies?.get(b)&&(h=this._checkLinkProviderResult(b,u,h)):M.provideLinks(u.y,(w=>{if(this._isMouseOut)return;const T=w?.map((y=>({link:y})));this._activeProviderReplies?.set(b,T),h=this._checkLinkProviderResult(b,u,h),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(u.y,this._activeProviderReplies)}))}_removeIntersectingLinks(u,f){const h=new Set;for(let b=0;b<f.size;b++){const M=f.get(b);if(M)for(let w=0;w<M.length;w++){const T=M[w],y=T.link.range.start.y<u?0:T.link.range.start.x,L=T.link.range.end.y>u?this._bufferService.cols:T.link.range.end.x;for(let O=y;O<=L;O++){if(h.has(O)){M.splice(w--,1);break}h.add(O)}}}}_checkLinkProviderResult(u,f,h){if(!this._activeProviderReplies)return h;const b=this._activeProviderReplies.get(u);let M=!1;for(let w=0;w<u;w++)this._activeProviderReplies.has(w)&&!this._activeProviderReplies.get(w)||(M=!0);if(!M&&b){const w=b.find((T=>this._linkAtPosition(T.link,f)));w&&(h=!0,this._handleNewLink(w))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!h)for(let w=0;w<this._activeProviderReplies.size;w++){const T=this._activeProviderReplies.get(w)?.find((y=>this._linkAtPosition(y.link,f)));if(T){h=!0,this._handleNewLink(T);break}}return h}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(u){if(!this._currentLink)return;const f=this._positionFromMouseEvent(u,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(u,this._currentLink.link.text)}_clearCurrentLink(u,f){this._currentLink&&this._lastMouseEvent&&(!u||!f||this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(u){if(!this._lastMouseEvent)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(u.link,f)&&(this._currentLink=u,this._currentLink.state={decorations:{underline:u.link.decorations===void 0||u.link.decorations.underline,pointerCursor:u.link.decorations===void 0||u.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,u.link,this._lastMouseEvent),u.link.decorations={},Object.defineProperties(u.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:h=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==h&&(this._currentLink.state.decorations.pointerCursor=h,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",h))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:h=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==h&&(this._currentLink.state.decorations.underline=h,this._currentLink.state.isHovered&&this._fireUnderlineEvent(u.link,h))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((h=>{if(!this._currentLink)return;const b=h.start===0?0:h.start+1+this._bufferService.buffer.ydisp,M=this._bufferService.buffer.ydisp+1+h.end;if(this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=M&&(this._clearCurrentLink(b,M),this._lastMouseEvent)){const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._askForLink(w,!1)}}))))}_linkHover(u,f,h){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!0),this._currentLink.state.decorations.pointerCursor&&u.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(h,f.text)}_fireUnderlineEvent(u,f){const h=u.range,b=this._bufferService.buffer.ydisp,M=this._createLinkUnderlineEvent(h.start.x-1,h.start.y-b-1,h.end.x,h.end.y-b-1,void 0);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(M)}_linkLeave(u,f,h){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!1),this._currentLink.state.decorations.pointerCursor&&u.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(h,f.text)}_linkAtPosition(u,f){const h=u.range.start.y*this._bufferService.cols+u.range.start.x,b=u.range.end.y*this._bufferService.cols+u.range.end.x,M=f.y*this._bufferService.cols+f.x;return h<=M&&M<=b}_positionFromMouseEvent(u,f,h){const b=h.getCoords(u,f,this._bufferService.cols,this._bufferService.rows);if(b)return{x:b[0],y:b[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(u,f,h,b,M){return{x1:u,y1:f,x2:h,y2:b,cols:this._bufferService.cols,fg:M}}};r.Linkifier=a=g([p(1,m.IMouseService),p(2,m.IRenderService),p(3,R.IBufferService),p(4,m.ILinkProviderService)],a)},9042:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(P,r,d){var g=this&&this.__decorate||function(m,a,u,f){var h,b=arguments.length,M=b<3?a:f===null?f=Object.getOwnPropertyDescriptor(a,u):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(m,a,u,f);else for(var w=m.length-1;w>=0;w--)(h=m[w])&&(M=(b<3?h(M):b>3?h(a,u,M):h(a,u))||M);return b>3&&M&&Object.defineProperty(a,u,M),M},p=this&&this.__param||function(m,a){return function(u,f){a(u,f,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const l=d(511),S=d(2585);let x=r.OscLinkProvider=class{constructor(m,a,u){this._bufferService=m,this._optionsService=a,this._oscLinkService=u}provideLinks(m,a){const u=this._bufferService.buffer.lines.get(m-1);if(!u)return void a(void 0);const f=[],h=this._optionsService.rawOptions.linkHandler,b=new l.CellData,M=u.getTrimmedLength();let w=-1,T=-1,y=!1;for(let L=0;L<M;L++)if(T!==-1||u.hasContent(L)){if(u.loadCell(L,b),b.hasExtendedAttrs()&&b.extended.urlId){if(T===-1){T=L,w=b.extended.urlId;continue}y=b.extended.urlId!==w}else T!==-1&&(y=!0);if(y||T!==-1&&L===M-1){const O=this._oscLinkService.getLinkData(w)?.uri;if(O){const U={start:{x:T+1,y:m},end:{x:L+(y||L!==M-1?0:1),y:m}};let H=!1;if(!h?.allowNonHttpProtocols)try{const z=new URL(O);["http:","https:"].includes(z.protocol)||(H=!0)}catch{H=!0}H||f.push({text:O,range:U,activate:(z,Y)=>h?h.activate(z,Y,U):R(0,Y),hover:(z,Y)=>h?.hover?.(z,Y,U),leave:(z,Y)=>h?.leave?.(z,Y,U)})}y=!1,b.hasExtendedAttrs()&&b.extended.urlId?(T=L,w=b.extended.urlId):(T=-1,w=-1)}}a(f)}};function R(m,a){if(confirm(`Do you want to navigate to ${a}?
12
-
13
- WARNING: This link could potentially be dangerous`)){const u=window.open();if(u){try{u.opener=null}catch{}u.location.href=a}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=x=g([p(0,S.IBufferService),p(1,S.IOptionsService),p(2,S.IOscLinkService)],x)},6193:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(d,g){this._renderCallback=d,this._coreBrowserService=g,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(d){return this._refreshCallbacks.push(d),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(d,g,p){this._rowCount=p,d=d!==void 0?d:0,g=g!==void 0?g:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,d):d,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,g):g,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.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 d=Math.max(this._rowStart,0),g=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(d,g),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const d of this._refreshCallbacks)d(0);this._refreshCallbacks=[]}}},3236:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const g=d(3614),p=d(3656),l=d(3551),S=d(9042),x=d(3730),R=d(1680),m=d(3107),a=d(5744),u=d(2950),f=d(1296),h=d(428),b=d(4269),M=d(5114),w=d(8934),T=d(3230),y=d(9312),L=d(4725),O=d(6731),U=d(8055),H=d(8969),z=d(8460),Y=d(844),ne=d(6114),V=d(8437),X=d(2584),I=d(7399),j=d(5941),W=d(9074),B=d(2585),F=d(5435),te=d(4567),ie=d(779);class he extends H.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(J={}){super(J),this.browser=ne,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Y.MutableDisposable),this._onCursorMove=this.register(new z.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new z.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new z.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new z.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new z.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new z.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new z.EventEmitter),this._onBlur=this.register(new z.EventEmitter),this._onA11yCharEmitter=this.register(new z.EventEmitter),this._onA11yTabEmitter=this.register(new z.EventEmitter),this._onWillOpen=this.register(new z.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(W.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ie.LinkProviderService),this._instantiationService.setService(L.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((q,re)=>this.refresh(q,re)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((q=>this._reportWindowsOptions(q)))),this.register(this._inputHandler.onColor((q=>this._handleColorEvent(q)))),this.register((0,z.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,z.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,z.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,z.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((q=>this._afterResize(q.cols,q.rows)))),this.register((0,Y.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(J){if(this._themeService)for(const q of J){let re,_e="";switch(q.index){case 256:re="foreground",_e="10";break;case 257:re="background",_e="11";break;case 258:re="cursor",_e="12";break;default:re="ansi",_e="4;"+q.index}switch(q.type){case 0:const Ce=U.color.toColorRGB(re==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[re]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${_e};${(0,j.toRgbString)(Ce)}${X.C1_ESCAPED.ST}`);break;case 1:if(re==="ansi")this._themeService.modifyColors((we=>we.ansi[q.index]=U.channels.toColor(...q.color)));else{const we=re;this._themeService.modifyColors((Be=>Be[we]=U.channels.toColor(...q.color)))}break;case 2:this._themeService.restoreColor(q.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(J){J?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(te.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(J){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.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 J=this.buffer.ybase+this.buffer.y,q=this.buffer.lines.get(J);if(!q)return;const re=Math.min(this.buffer.x,this.cols-1),_e=this._renderService.dimensions.css.cell.height,Ce=q.getWidth(re),we=this._renderService.dimensions.css.cell.width*Ce,Be=this.buffer.y*this._renderService.dimensions.css.cell.height,Re=re*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Re+"px",this.textarea.style.top=Be+"px",this.textarea.style.width=we+"px",this.textarea.style.height=_e+"px",this.textarea.style.lineHeight=_e+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(q=>{this.hasSelection()&&(0,g.copyHandler)(q,this._selectionService)})));const J=q=>(0,g.handlePasteEvent)(q,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",J)),this.register((0,p.addDisposableDomListener)(this.element,"paste",J)),ne.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(q=>{q.button===2&&(0,g.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(q=>{(0,g.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ne.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(q=>{q.button===1&&(0,g.moveTextAreaUnderMouseCursor)(q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(J=>this._keyUp(J)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(J=>this._keyDown(J)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(J=>this._keyPress(J)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(J=>this._compositionHelper.compositionupdate(J)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(J=>this._inputEvent(J)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(J){if(!J)throw new Error("Terminal requires a parent element.");if(J.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=J.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),J.appendChild(this.element);const q=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),q.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",(re=>this.updateCursorStyle(re)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),q.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",S.promptLabel),ne.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.register(this._instantiationService.createInstance(M.CoreBrowserService,this.textarea,J.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(L.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(re=>this._handleTextAreaFocus(re)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(h.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(L.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(L.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(b.CharacterJoinerService),this._instantiationService.setService(L.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(L.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((re=>this._onRender.fire(re)))),this.onResize((re=>this._renderService.resize(re.cols,re.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(u.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(w.MouseService),this._instantiationService.setService(L.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(l.Linkifier,this.screenElement)),this.element.appendChild(q);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(R.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((re=>this.scrollLines(re.amount,re.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(y.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(L.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((re=>this.scrollLines(re.amount,re.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((re=>this._renderService.handleSelectionChanged(re.start,re.end,re.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((re=>{this.textarea.value=re,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((re=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(m.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(re=>this._selectionService.handleMouseDown(re)))),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(te.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(re=>this._handleScreenReaderModeOptionChange(re)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(a.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(re=>{!this._overviewRulerRenderer&&re&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(a.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const J=this,q=this.element;function re(we){const Be=J._mouseService.getMouseReportCoords(we,J.screenElement);if(!Be)return!1;let Re,Ge;switch(we.overrideType||we.type){case"mousemove":Ge=32,we.buttons===void 0?(Re=3,we.button!==void 0&&(Re=we.button<3?we.button:3)):Re=1&we.buttons?0:4&we.buttons?1:2&we.buttons?2:3;break;case"mouseup":Ge=0,Re=we.button<3?we.button:3;break;case"mousedown":Ge=1,Re=we.button<3?we.button:3;break;case"wheel":if(J._customWheelEventHandler&&J._customWheelEventHandler(we)===!1||J.viewport.getLinesScrolled(we)===0)return!1;Ge=we.deltaY<0?0:1,Re=4;break;default:return!1}return!(Ge===void 0||Re===void 0||Re>4)&&J.coreMouseService.triggerMouseEvent({col:Be.col,row:Be.row,x:Be.x,y:Be.y,button:Re,action:Ge,ctrl:we.ctrlKey,alt:we.altKey,shift:we.shiftKey})}const _e={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Ce={mouseup:we=>(re(we),we.buttons||(this._document.removeEventListener("mouseup",_e.mouseup),_e.mousedrag&&this._document.removeEventListener("mousemove",_e.mousedrag)),this.cancel(we)),wheel:we=>(re(we),this.cancel(we,!0)),mousedrag:we=>{we.buttons&&re(we)},mousemove:we=>{we.buttons||re(we)}};this.register(this.coreMouseService.onProtocolChange((we=>{we?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(we)),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&we?_e.mousemove||(q.addEventListener("mousemove",Ce.mousemove),_e.mousemove=Ce.mousemove):(q.removeEventListener("mousemove",_e.mousemove),_e.mousemove=null),16&we?_e.wheel||(q.addEventListener("wheel",Ce.wheel,{passive:!1}),_e.wheel=Ce.wheel):(q.removeEventListener("wheel",_e.wheel),_e.wheel=null),2&we?_e.mouseup||(_e.mouseup=Ce.mouseup):(this._document.removeEventListener("mouseup",_e.mouseup),_e.mouseup=null),4&we?_e.mousedrag||(_e.mousedrag=Ce.mousedrag):(this._document.removeEventListener("mousemove",_e.mousedrag),_e.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(q,"mousedown",(we=>{if(we.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(we))return re(we),_e.mouseup&&this._document.addEventListener("mouseup",_e.mouseup),_e.mousedrag&&this._document.addEventListener("mousemove",_e.mousedrag),this.cancel(we)}))),this.register((0,p.addDisposableDomListener)(q,"wheel",(we=>{if(!_e.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(we)===!1)return!1;if(!this.buffer.hasScrollback){const Be=this.viewport.getLinesScrolled(we);if(Be===0)return;const Re=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(we.deltaY<0?"A":"B");let Ge="";for(let tt=0;tt<Math.abs(Be);tt++)Ge+=Re;return this.coreService.triggerDataEvent(Ge,!0),this.cancel(we,!0)}return this.viewport.handleWheel(we)?this.cancel(we):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(q,"touchstart",(we=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(we),this.cancel(we)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(q,"touchmove",(we=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(we)?void 0:this.cancel(we)}),{passive:!1}))}refresh(J,q){this._renderService?.refreshRows(J,q)}updateCursorStyle(J){this._selectionService?.shouldColumnSelect(J)?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(J,q,re=0){re===1?(super.scrollLines(J,q,re),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(J)}paste(J){(0,g.paste)(J,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(J){this._customKeyEventHandler=J}attachCustomWheelEventHandler(J){this._customWheelEventHandler=J}registerLinkProvider(J){return this._linkProviderService.registerLinkProvider(J)}registerCharacterJoiner(J){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const q=this._characterJoinerService.register(J);return this.refresh(0,this.rows-1),q}deregisterCharacterJoiner(J){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(J)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(J){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+J)}registerDecoration(J){return this._decorationService.registerDecoration(J)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(J,q,re){this._selectionService.setSelection(J,q,re)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(J,q){this._selectionService?.selectLines(J,q)}_keyDown(J){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1)return!1;const q=this.browser.isMac&&this.options.macOptionIsMeta&&J.altKey;if(!q&&!this._compositionHelper.keydown(J))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;q||J.key!=="Dead"&&J.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const re=(0,I.evaluateKeyboardEvent)(J,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(J),re.type===3||re.type===2){const _e=this.rows-1;return this.scrollLines(re.type===2?-_e:_e),this.cancel(J,!0)}return re.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,J)||(re.cancel&&this.cancel(J,!0),!re.key||!!(J.key&&!J.ctrlKey&&!J.altKey&&!J.metaKey&&J.key.length===1&&J.key.charCodeAt(0)>=65&&J.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(re.key!==X.C0.ETX&&re.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:re.key,domEvent:J}),this._showCursor(),this.coreService.triggerDataEvent(re.key,!0),!this.optionsService.rawOptions.screenReaderMode||J.altKey||J.ctrlKey?this.cancel(J,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(J,q){const re=J.isMac&&!this.options.macOptionIsMeta&&q.altKey&&!q.ctrlKey&&!q.metaKey||J.isWindows&&q.altKey&&q.ctrlKey&&!q.metaKey||J.isWindows&&q.getModifierState("AltGraph");return q.type==="keypress"?re:re&&(!q.keyCode||q.keyCode>47)}_keyUp(J){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1||((function(q){return q.keyCode===16||q.keyCode===17||q.keyCode===18})(J)||this.focus(),this.updateCursorStyle(J),this._keyPressHandled=!1)}_keyPress(J){let q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1)return!1;if(this.cancel(J),J.charCode)q=J.charCode;else if(J.which===null||J.which===void 0)q=J.keyCode;else{if(J.which===0||J.charCode===0)return!1;q=J.which}return!(!q||(J.altKey||J.ctrlKey||J.metaKey)&&!this._isThirdLevelShift(this.browser,J)||(q=String.fromCharCode(q),this._onKey.fire({key:q,domEvent:J}),this._showCursor(),this.coreService.triggerDataEvent(q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(J){if(J.data&&J.inputType==="insertText"&&(!J.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const q=J.data;return this.coreService.triggerDataEvent(q,!0),this.cancel(J),!0}return!1}resize(J,q){J!==this.cols||q!==this.rows?super.resize(J,q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(J,q){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){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 J=1;J<this.rows;J++)this.buffer.lines.push(this.buffer.getBlankLine(V.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const J=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=J,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(X.C0.ESC+"[I"):this.coreService.triggerDataEvent(X.C0.ESC+"[O")}_reportWindowsOptions(J){if(this._renderService)switch(J){case F.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const q=this._renderService.dimensions.css.canvas.width.toFixed(0),re=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[4;${re};${q}t`);break;case F.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const _e=this._renderService.dimensions.css.cell.width.toFixed(0),Ce=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[6;${Ce};${_e}t`)}}cancel(J,q){if(this.options.cancelEvents||q)return J.preventDefault(),J.stopPropagation(),!1}}r.Terminal=he},9924:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(d,g=1e3){this._renderCallback=d,this._debounceThresholdMS=g,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(d,g,p){this._rowCount=p,d=d!==void 0?d:0,g=g!==void 0?g:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,d):d,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,g):g;const l=Date.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){const S=l-this._lastRefreshMs,x=this._debounceThresholdMS-S;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const d=Math.max(this._rowStart,0),g=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(d,g)}}},1680:function(P,r,d){var g=this&&this.__decorate||function(u,f,h,b){var M,w=arguments.length,T=w<3?f:b===null?b=Object.getOwnPropertyDescriptor(f,h):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(u,f,h,b);else for(var y=u.length-1;y>=0;y--)(M=u[y])&&(T=(w<3?M(T):w>3?M(f,h,T):M(f,h))||T);return w>3&&T&&Object.defineProperty(f,h,T),T},p=this&&this.__param||function(u,f){return function(h,b){f(h,b,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const l=d(3656),S=d(4725),x=d(8460),R=d(844),m=d(2585);let a=r.Viewport=class extends R.Disposable{constructor(u,f,h,b,M,w,T,y){super(),this._viewportElement=u,this._scrollArea=f,this._bufferService=h,this._optionsService=b,this._charSizeService=M,this._renderService=w,this._coreBrowserService=T,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 x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((L=>this._renderDimensions=L))),this._handleThemeChange(y.colors),this.register(y.onChangeColors((L=>this._handleThemeChange(L)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(u){this._viewportElement.style.backgroundColor=u.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(u){if(u)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._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const f=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==f&&(this._lastRecordedBufferHeight=f,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const u=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==u&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=u),this._refreshAnimationFrame=null}syncScrollArea(u=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(u);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(u)}_handleScroll(u){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 f=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const u=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(u*(this._smoothScrollState.target-this._smoothScrollState.origin)),u<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(u,f){const h=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&h<this._lastRecordedBufferHeight)||(u.cancelable&&u.preventDefault(),!1)}handleWheel(u){const f=this._getPixelsScrolled(u);return f!==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+f:this._smoothScrollState.target+=f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=f,this._bubbleScroll(u,f))}scrollLines(u){if(u!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const f=u*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:u,suppressScrollEvent:!1})}_getPixelsScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let f=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_LINE?f*=this._currentRowHeight:u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._currentRowHeight*this._bufferService.rows),f}getBufferElements(u,f){let h,b="";const M=[],w=f??this._bufferService.buffer.lines.length,T=this._bufferService.buffer.lines;for(let y=u;y<w;y++){const L=T.get(y);if(!L)continue;const O=T.get(y+1)?.isWrapped;if(b+=L.translateToString(!O),!O||y===T.length-1){const U=document.createElement("div");U.textContent=b,M.push(U),b.length>0&&(h=U),b=""}}return{bufferElements:M,cursorElement:h}}getLinesScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let f=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(f/=this._currentRowHeight+0,this._wheelPartialScroll+=f,f=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(u,f){const h=this._optionsService.rawOptions.fastScrollModifier;return h==="alt"&&f.altKey||h==="ctrl"&&f.ctrlKey||h==="shift"&&f.shiftKey?u*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:u*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(u){this._lastTouchY=u.touches[0].pageY}handleTouchMove(u){const f=this._lastTouchY-u.touches[0].pageY;return this._lastTouchY=u.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(u,f))}};r.Viewport=a=g([p(2,m.IBufferService),p(3,m.IOptionsService),p(4,S.ICharSizeService),p(5,S.IRenderService),p(6,S.ICoreBrowserService),p(7,S.IThemeService)],a)},3107:function(P,r,d){var g=this&&this.__decorate||function(m,a,u,f){var h,b=arguments.length,M=b<3?a:f===null?f=Object.getOwnPropertyDescriptor(a,u):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(m,a,u,f);else for(var w=m.length-1;w>=0;w--)(h=m[w])&&(M=(b<3?h(M):b>3?h(a,u,M):h(a,u))||M);return b>3&&M&&Object.defineProperty(a,u,M),M},p=this&&this.__param||function(m,a){return function(u,f){a(u,f,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const l=d(4725),S=d(844),x=d(2585);let R=r.BufferDecorationRenderer=class extends S.Disposable{constructor(m,a,u,f,h){super(),this._screenElement=m,this._bufferService=a,this._coreBrowserService=u,this._decorationService=f,this._renderService=h,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(this._coreBrowserService.onDprChange((()=>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((b=>this._removeDecoration(b)))),this.register((0,S.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 m of this._decorationService.decorations)this._renderDecoration(m);this._dimensionsChanged=!1}_renderDecoration(m){this._refreshStyle(m),this._dimensionsChanged&&this._refreshXPosition(m)}_createElement(m){const a=this._coreBrowserService.mainDocument.createElement("div");a.classList.add("xterm-decoration"),a.classList.toggle("xterm-decoration-top-layer",m?.options?.layer==="top"),a.style.width=`${Math.round((m.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,a.style.height=(m.options.height||1)*this._renderService.dimensions.css.cell.height+"px",a.style.top=(m.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 u=m.options.x??0;return u&&u>this._bufferService.cols&&(a.style.display="none"),this._refreshXPosition(m,a),a}_refreshStyle(m){const a=m.marker.line-this._bufferService.buffers.active.ydisp;if(a<0||a>=this._bufferService.rows)m.element&&(m.element.style.display="none",m.onRenderEmitter.fire(m.element));else{let u=this._decorationElements.get(m);u||(u=this._createElement(m),m.element=u,this._decorationElements.set(m,u),this._container.appendChild(u),m.onDispose((()=>{this._decorationElements.delete(m),u.remove()}))),u.style.top=a*this._renderService.dimensions.css.cell.height+"px",u.style.display=this._altBufferIsActive?"none":"block",m.onRenderEmitter.fire(u)}}_refreshXPosition(m,a=m.element){if(!a)return;const u=m.options.x??0;(m.options.anchor||"left")==="right"?a.style.right=u?u*this._renderService.dimensions.css.cell.width+"px":"":a.style.left=u?u*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(m){this._decorationElements.get(m)?.remove(),this._decorationElements.delete(m),m.dispose()}};r.BufferDecorationRenderer=R=g([p(1,x.IBufferService),p(2,l.ICoreBrowserService),p(3,x.IDecorationService),p(4,l.IRenderService)],R)},5871:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.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(d){if(d.options.overviewRulerOptions){for(const g of this._zones)if(g.color===d.options.overviewRulerOptions.color&&g.position===d.options.overviewRulerOptions.position){if(this._lineIntersectsZone(g,d.marker.line))return;if(this._lineAdjacentToZone(g,d.marker.line,d.options.overviewRulerOptions.position))return void this._addLineToZone(g,d.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=d.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=d.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=d.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=d.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:d.options.overviewRulerOptions.color,position:d.options.overviewRulerOptions.position,startBufferLine:d.marker.line,endBufferLine:d.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(d){this._linePadding=d}_lineIntersectsZone(d,g){return g>=d.startBufferLine&&g<=d.endBufferLine}_lineAdjacentToZone(d,g,p){return g>=d.startBufferLine-this._linePadding[p||"full"]&&g<=d.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(d,g){d.startBufferLine=Math.min(d.startBufferLine,g),d.endBufferLine=Math.max(d.endBufferLine,g)}}},5744:function(P,r,d){var g=this&&this.__decorate||function(h,b,M,w){var T,y=arguments.length,L=y<3?b:w===null?w=Object.getOwnPropertyDescriptor(b,M):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(h,b,M,w);else for(var O=h.length-1;O>=0;O--)(T=h[O])&&(L=(y<3?T(L):y>3?T(b,M,L):T(b,M))||L);return y>3&&L&&Object.defineProperty(b,M,L),L},p=this&&this.__param||function(h,b){return function(M,w){b(M,w,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const l=d(5871),S=d(4725),x=d(844),R=d(2585),m={full:0,left:0,center:0,right:0},a={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0};let f=r.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(h,b,M,w,T,y,L){super(),this._viewportElement=h,this._screenElement=b,this._bufferService=M,this._decorationService=w,this._renderService=T,this._optionsService=y,this._coreBrowserService=L,this._colorZoneStore=new l.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const O=this._canvas.getContext("2d");if(!O)throw new Error("Ctx cannot be null");this._ctx=O,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)((()=>{this._canvas?.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(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const h=Math.floor(this._canvas.width/3),b=Math.ceil(this._canvas.width/3);a.full=this._canvas.width,a.left=h,a.center=b,a.right=h,this._refreshDrawHeightConstants(),u.full=0,u.left=0,u.center=a.left,u.right=a.left+a.center}_refreshDrawHeightConstants(){m.full=Math.round(2*this._coreBrowserService.dpr);const h=this._canvas.height/this._bufferService.buffer.lines.length,b=Math.round(Math.max(Math.min(h,12),6)*this._coreBrowserService.dpr);m.left=b,m.center=b,m.right=b}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.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._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.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 b of this._decorationService.decorations)this._colorZoneStore.addDecoration(b);this._ctx.lineWidth=1;const h=this._colorZoneStore.zones;for(const b of h)b.position!=="full"&&this._renderColorZone(b);for(const b of h)b.position==="full"&&this._renderColorZone(b);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(h){this._ctx.fillStyle=h.color,this._ctx.fillRect(u[h.position||"full"],Math.round((this._canvas.height-1)*(h.startBufferLine/this._bufferService.buffers.active.lines.length)-m[h.position||"full"]/2),a[h.position||"full"],Math.round((this._canvas.height-1)*((h.endBufferLine-h.startBufferLine)/this._bufferService.buffers.active.lines.length)+m[h.position||"full"]))}_queueRefresh(h,b){this._shouldUpdateDimensions=h||this._shouldUpdateDimensions,this._shouldUpdateAnchor=b||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};r.OverviewRulerRenderer=f=g([p(2,R.IBufferService),p(3,R.IDecorationService),p(4,S.IRenderService),p(5,R.IOptionsService),p(6,S.ICoreBrowserService)],f)},2950:function(P,r,d){var g=this&&this.__decorate||function(m,a,u,f){var h,b=arguments.length,M=b<3?a:f===null?f=Object.getOwnPropertyDescriptor(a,u):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(m,a,u,f);else for(var w=m.length-1;w>=0;w--)(h=m[w])&&(M=(b<3?h(M):b>3?h(a,u,M):h(a,u))||M);return b>3&&M&&Object.defineProperty(a,u,M),M},p=this&&this.__param||function(m,a){return function(u,f){a(u,f,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const l=d(4725),S=d(2585),x=d(2584);let R=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(m,a,u,f,h,b){this._textarea=m,this._compositionView=a,this._bufferService=u,this._optionsService=f,this._coreService=h,this._renderService=b,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(m){this._compositionView.textContent=m.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(m){if(this._isComposing||this._isSendingComposition){if(m.keyCode===229||m.keyCode===16||m.keyCode===17||m.keyCode===18)return!1;this._finalizeComposition(!1)}return m.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(m){if(this._compositionView.classList.remove("active"),this._isComposing=!1,m){const a={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let u;this._isSendingComposition=!1,a.start+=this._dataAlreadySent.length,u=this._isComposing?this._textarea.value.substring(a.start,a.end):this._textarea.value.substring(a.start),u.length>0&&this._coreService.triggerDataEvent(u,!0)}}),0)}else{this._isSendingComposition=!1;const a=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(a,!0)}}_handleAnyTextareaChanges(){const m=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const a=this._textarea.value,u=a.replace(m,"");this._dataAlreadySent=u,a.length>m.length?this._coreService.triggerDataEvent(u,!0):a.length<m.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):a.length===m.length&&a!==m&&this._coreService.triggerDataEvent(a,!0)}}),0)}updateCompositionElements(m){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const a=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),u=this._renderService.dimensions.css.cell.height,f=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,h=a*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=h+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=u+"px",this._compositionView.style.lineHeight=u+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const b=this._compositionView.getBoundingClientRect();this._textarea.style.left=h+"px",this._textarea.style.top=f+"px",this._textarea.style.width=Math.max(b.width,1)+"px",this._textarea.style.height=Math.max(b.height,1)+"px",this._textarea.style.lineHeight=b.height+"px"}m||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};r.CompositionHelper=R=g([p(2,S.IBufferService),p(3,S.IOptionsService),p(4,S.ICoreService),p(5,l.IRenderService)],R)},9806:(P,r)=>{function d(g,p,l){const S=l.getBoundingClientRect(),x=g.getComputedStyle(l),R=parseInt(x.getPropertyValue("padding-left")),m=parseInt(x.getPropertyValue("padding-top"));return[p.clientX-S.left-R,p.clientY-S.top-m]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=d,r.getCoords=function(g,p,l,S,x,R,m,a,u){if(!R)return;const f=d(g,p,l);return f?(f[0]=Math.ceil((f[0]+(u?m/2:0))/m),f[1]=Math.ceil(f[1]/a),f[0]=Math.min(Math.max(f[0],1),S+(u?1:0)),f[1]=Math.min(Math.max(f[1],1),x),f):void 0}},9504:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const g=d(2584);function p(a,u,f,h){const b=a-l(a,f),M=u-l(u,f),w=Math.abs(b-M)-(function(T,y,L){let O=0;const U=T-l(T,L),H=y-l(y,L);for(let z=0;z<Math.abs(U-H);z++){const Y=S(T,y)==="A"?-1:1;L.buffer.lines.get(U+Y*z)?.isWrapped&&O++}return O})(a,u,f);return m(w,R(S(a,u),h))}function l(a,u){let f=0,h=u.buffer.lines.get(a),b=h?.isWrapped;for(;b&&a>=0&&a<u.rows;)f++,h=u.buffer.lines.get(--a),b=h?.isWrapped;return f}function S(a,u){return a>u?"A":"B"}function x(a,u,f,h,b,M){let w=a,T=u,y="";for(;w!==f||T!==h;)w+=b?1:-1,b&&w>M.cols-1?(y+=M.buffer.translateBufferLineToString(T,!1,a,w),w=0,a=0,T++):!b&&w<0&&(y+=M.buffer.translateBufferLineToString(T,!1,0,a+1),w=M.cols-1,a=w,T--);return y+M.buffer.translateBufferLineToString(T,!1,a,w)}function R(a,u){const f=u?"O":"[";return g.C0.ESC+f+a}function m(a,u){a=Math.floor(a);let f="";for(let h=0;h<a;h++)f+=u;return f}r.moveToCellSequence=function(a,u,f,h){const b=f.buffer.x,M=f.buffer.y;if(!f.buffer.hasScrollback)return(function(y,L,O,U,H,z){return p(L,U,H,z).length===0?"":m(x(y,L,y,L-l(L,H),!1,H).length,R("D",z))})(b,M,0,u,f,h)+p(M,u,f,h)+(function(y,L,O,U,H,z){let Y;Y=p(L,U,H,z).length>0?U-l(U,H):L;const ne=U,V=(function(X,I,j,W,B,F){let te;return te=p(j,W,B,F).length>0?W-l(W,B):I,X<j&&te<=W||X>=j&&te<W?"C":"D"})(y,L,O,U,H,z);return m(x(y,Y,O,ne,V==="C",H).length,R(V,z))})(b,M,a,u,f,h);let w;if(M===u)return w=b>a?"D":"C",m(Math.abs(b-a),R(w,h));w=M>u?"D":"C";const T=Math.abs(M-u);return m((function(y,L){return L.cols-y})(M>u?a:b,f)+(T-1)*f.cols+1+((M>u?b:a)-1),R(w,h))}},1296:function(P,r,d){var g=this&&this.__decorate||function(z,Y,ne,V){var X,I=arguments.length,j=I<3?Y:V===null?V=Object.getOwnPropertyDescriptor(Y,ne):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(z,Y,ne,V);else for(var W=z.length-1;W>=0;W--)(X=z[W])&&(j=(I<3?X(j):I>3?X(Y,ne,j):X(Y,ne))||j);return I>3&&j&&Object.defineProperty(Y,ne,j),j},p=this&&this.__param||function(z,Y){return function(ne,V){Y(ne,V,z)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const l=d(3787),S=d(2550),x=d(2223),R=d(6171),m=d(6052),a=d(4725),u=d(8055),f=d(8460),h=d(844),b=d(2585),M="xterm-dom-renderer-owner-",w="xterm-rows",T="xterm-fg-",y="xterm-bg-",L="xterm-focus",O="xterm-selection";let U=1,H=r.DomRenderer=class extends h.Disposable{constructor(z,Y,ne,V,X,I,j,W,B,F,te,ie,he){super(),this._terminal=z,this._document=Y,this._element=ne,this._screenElement=V,this._viewportElement=X,this._helperContainer=I,this._linkifier2=j,this._charSizeService=B,this._optionsService=F,this._bufferService=te,this._coreBrowserService=ie,this._themeService=he,this._terminalClass=U++,this._rowElements=[],this._selectionRenderModel=(0,m.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(w),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,R.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ge=>this._injectCss(ge)))),this._injectCss(this._themeService.colors),this._rowFactory=W.createInstance(l.DomRendererRowFactory,document),this._element.classList.add(M+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ge=>this._handleLinkHover(ge)))),this.register(this._linkifier2.onHideLinkUnderline((ge=>this._handleLinkLeave(ge)))),this.register((0,h.toDisposable)((()=>{this._element.classList.remove(M+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new S.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const z=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*z,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*z),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/z),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/z),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 ne of this._rowElements)ne.style.width=`${this.dimensions.css.canvas.width}px`,ne.style.height=`${this.dimensions.css.cell.height}px`,ne.style.lineHeight=`${this.dimensions.css.cell.height}px`,ne.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Y=`${this._terminalSelector} .${w} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Y,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(z){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Y=`${this._terminalSelector} .${w} { color: ${z.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Y+=`${this._terminalSelector} .${w} .xterm-dim { color: ${u.color.multiplyOpacity(z.foreground,.5).css};}`,Y+=`${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;}`;const ne=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;Y+=`@keyframes ${ne} { 50% { border-bottom-style: hidden; }}`,Y+=`@keyframes ${V} { 50% { box-shadow: none; }}`,Y+=`@keyframes ${X} { 0% { background-color: ${z.cursor.css}; color: ${z.cursorAccent.css}; } 50% { background-color: inherit; color: ${z.cursor.css}; }}`,Y+=`${this._terminalSelector} .${w}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${ne} 1s step-end infinite;}${this._terminalSelector} .${w}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${w}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-block { background-color: ${z.cursor.css}; color: ${z.cursorAccent.css};}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${z.cursor.css} !important; color: ${z.cursorAccent.css} !important;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${z.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${z.cursor.css} inset;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${z.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Y+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${z.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${z.selectionInactiveBackgroundOpaque.css};}`;for(const[I,j]of z.ansi.entries())Y+=`${this._terminalSelector} .${T}${I} { color: ${j.css}; }${this._terminalSelector} .${T}${I}.xterm-dim { color: ${u.color.multiplyOpacity(j,.5).css}; }${this._terminalSelector} .${y}${I} { background-color: ${j.css}; }`;Y+=`${this._terminalSelector} .${T}${x.INVERTED_DEFAULT_COLOR} { color: ${u.color.opaque(z.background).css}; }${this._terminalSelector} .${T}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${u.color.multiplyOpacity(u.color.opaque(z.background),.5).css}; }${this._terminalSelector} .${y}${x.INVERTED_DEFAULT_COLOR} { background-color: ${z.foreground.css}; }`,this._themeStyleElement.textContent=Y}_setDefaultSpacing(){const z=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${z}px`,this._rowFactory.defaultSpacing=z}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(z,Y){for(let ne=this._rowElements.length;ne<=Y;ne++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>Y;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(z,Y){this._refreshRowElements(z,Y),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(L),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(L),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(z,Y,ne){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(z,Y,ne),this.renderRows(0,this._bufferService.rows-1),!z||!Y)return;this._selectionRenderModel.update(this._terminal,z,Y,ne);const V=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,I=this._selectionRenderModel.viewportCappedStartRow,j=this._selectionRenderModel.viewportCappedEndRow;if(I>=this._bufferService.rows||j<0)return;const W=this._document.createDocumentFragment();if(ne){const B=z[0]>Y[0];W.appendChild(this._createSelectionElement(I,B?Y[0]:z[0],B?z[0]:Y[0],j-I+1))}else{const B=V===I?z[0]:0,F=I===X?Y[0]:this._bufferService.cols;W.appendChild(this._createSelectionElement(I,B,F));const te=j-I-1;if(W.appendChild(this._createSelectionElement(I+1,0,this._bufferService.cols,te)),I!==j){const ie=X===j?Y[0]:this._bufferService.cols;W.appendChild(this._createSelectionElement(j,0,ie))}}this._selectionContainer.appendChild(W)}_createSelectionElement(z,Y,ne,V=1){const X=this._document.createElement("div"),I=Y*this.dimensions.css.cell.width;let j=this.dimensions.css.cell.width*(ne-Y);return I+j>this.dimensions.css.canvas.width&&(j=this.dimensions.css.canvas.width-I),X.style.height=V*this.dimensions.css.cell.height+"px",X.style.top=z*this.dimensions.css.cell.height+"px",X.style.left=`${I}px`,X.style.width=`${j}px`,X}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 z of this._rowElements)z.replaceChildren()}renderRows(z,Y){const ne=this._bufferService.buffer,V=ne.ybase+ne.y,X=Math.min(ne.x,this._bufferService.cols-1),I=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,W=this._optionsService.rawOptions.cursorInactiveStyle;for(let B=z;B<=Y;B++){const F=B+ne.ydisp,te=this._rowElements[B],ie=ne.lines.get(F);if(!te||!ie)break;te.replaceChildren(...this._rowFactory.createRow(ie,F,F===V,j,W,X,I,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${M}${this._terminalClass}`}_handleLinkHover(z){this._setCellUnderline(z.x1,z.x2,z.y1,z.y2,z.cols,!0)}_handleLinkLeave(z){this._setCellUnderline(z.x1,z.x2,z.y1,z.y2,z.cols,!1)}_setCellUnderline(z,Y,ne,V,X,I){ne<0&&(z=0),V<0&&(Y=0);const j=this._bufferService.rows-1;ne=Math.max(Math.min(ne,j),0),V=Math.max(Math.min(V,j),0),X=Math.min(X,this._bufferService.cols);const W=this._bufferService.buffer,B=W.ybase+W.y,F=Math.min(W.x,X-1),te=this._optionsService.rawOptions.cursorBlink,ie=this._optionsService.rawOptions.cursorStyle,he=this._optionsService.rawOptions.cursorInactiveStyle;for(let ge=ne;ge<=V;++ge){const J=ge+W.ydisp,q=this._rowElements[ge],re=W.lines.get(J);if(!q||!re)break;q.replaceChildren(...this._rowFactory.createRow(re,J,J===B,ie,he,F,te,this.dimensions.css.cell.width,this._widthCache,I?ge===ne?z:0:-1,I?(ge===V?Y:X)-1:-1))}}};r.DomRenderer=H=g([p(7,b.IInstantiationService),p(8,a.ICharSizeService),p(9,b.IOptionsService),p(10,b.IBufferService),p(11,a.ICoreBrowserService),p(12,a.IThemeService)],H)},3787:function(P,r,d){var g=this&&this.__decorate||function(w,T,y,L){var O,U=arguments.length,H=U<3?T:L===null?L=Object.getOwnPropertyDescriptor(T,y):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(w,T,y,L);else for(var z=w.length-1;z>=0;z--)(O=w[z])&&(H=(U<3?O(H):U>3?O(T,y,H):O(T,y))||H);return U>3&&H&&Object.defineProperty(T,y,H),H},p=this&&this.__param||function(w,T){return function(y,L){T(y,L,w)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const l=d(2223),S=d(643),x=d(511),R=d(2585),m=d(8055),a=d(4725),u=d(4269),f=d(6171),h=d(3734);let b=r.DomRendererRowFactory=class{constructor(w,T,y,L,O,U,H){this._document=w,this._characterJoinerService=T,this._optionsService=y,this._coreBrowserService=L,this._coreService=O,this._decorationService=U,this._themeService=H,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(w,T,y){this._selectionStart=w,this._selectionEnd=T,this._columnSelectMode=y}createRow(w,T,y,L,O,U,H,z,Y,ne,V){const X=[],I=this._characterJoinerService.getJoinedCharacters(T),j=this._themeService.colors;let W,B=w.getNoBgTrimmedLength();y&&B<U+1&&(B=U+1);let F=0,te="",ie=0,he=0,ge=0,J=!1,q=0,re=!1,_e=0;const Ce=[],we=ne!==-1&&V!==-1;for(let Be=0;Be<B;Be++){w.loadCell(Be,this._workCell);let Re=this._workCell.getWidth();if(Re===0)continue;let Ge=!1,tt=Be,De=this._workCell;if(I.length>0&&Be===I[0][0]){Ge=!0;const je=I.shift();De=new u.JoinedCellData(this._workCell,w.translateToString(!0,je[0],je[1]),je[1]-je[0]),tt=je[1]-1,Re=De.getWidth()}const Tt=this._isCellInSelection(Be,T),Mt=y&&Be===U,We=we&&Be>=ne&&Be<=V;let Ue=!1;this._decorationService.forEachDecorationAtCell(Be,T,void 0,(je=>{Ue=!0}));let de=De.getChars()||S.WHITESPACE_CELL_CHAR;if(de===" "&&(De.isUnderline()||De.isOverline())&&(de=" "),_e=Re*z-Y.get(de,De.isBold(),De.isItalic()),W){if(F&&(Tt&&re||!Tt&&!re&&De.bg===ie)&&(Tt&&re&&j.selectionForeground||De.fg===he)&&De.extended.ext===ge&&We===J&&_e===q&&!Mt&&!Ge&&!Ue){De.isInvisible()?te+=S.WHITESPACE_CELL_CHAR:te+=de,F++;continue}F&&(W.textContent=te),W=this._document.createElement("span"),F=0,te=""}else W=this._document.createElement("span");if(ie=De.bg,he=De.fg,ge=De.extended.ext,J=We,q=_e,re=Tt,Ge&&U>=Be&&U<=tt&&(U=Be),!this._coreService.isCursorHidden&&Mt&&this._coreService.isCursorInitialized){if(Ce.push("xterm-cursor"),this._coreBrowserService.isFocused)H&&Ce.push("xterm-cursor-blink"),Ce.push(L==="bar"?"xterm-cursor-bar":L==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":Ce.push("xterm-cursor-outline");break;case"block":Ce.push("xterm-cursor-block");break;case"bar":Ce.push("xterm-cursor-bar");break;case"underline":Ce.push("xterm-cursor-underline")}}if(De.isBold()&&Ce.push("xterm-bold"),De.isItalic()&&Ce.push("xterm-italic"),De.isDim()&&Ce.push("xterm-dim"),te=De.isInvisible()?S.WHITESPACE_CELL_CHAR:De.getChars()||S.WHITESPACE_CELL_CHAR,De.isUnderline()&&(Ce.push(`xterm-underline-${De.extended.underlineStyle}`),te===" "&&(te=" "),!De.isUnderlineColorDefault()))if(De.isUnderlineColorRGB())W.style.textDecorationColor=`rgb(${h.AttributeData.toColorRGB(De.getUnderlineColor()).join(",")})`;else{let je=De.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&De.isBold()&&je<8&&(je+=8),W.style.textDecorationColor=j.ansi[je].css}De.isOverline()&&(Ce.push("xterm-overline"),te===" "&&(te=" ")),De.isStrikethrough()&&Ce.push("xterm-strikethrough"),We&&(W.style.textDecoration="underline");let ue=De.getFgColor(),be=De.getFgColorMode(),Le=De.getBgColor(),Pe=De.getBgColorMode();const lt=!!De.isInverse();if(lt){const je=ue;ue=Le,Le=je;const Wt=be;be=Pe,Pe=Wt}let dt,vt,ke,Ie=!1;switch(this._decorationService.forEachDecorationAtCell(Be,T,void 0,(je=>{je.options.layer!=="top"&&Ie||(je.backgroundColorRGB&&(Pe=50331648,Le=je.backgroundColorRGB.rgba>>8&16777215,dt=je.backgroundColorRGB),je.foregroundColorRGB&&(be=50331648,ue=je.foregroundColorRGB.rgba>>8&16777215,vt=je.foregroundColorRGB),Ie=je.options.layer==="top")})),!Ie&&Tt&&(dt=this._coreBrowserService.isFocused?j.selectionBackgroundOpaque:j.selectionInactiveBackgroundOpaque,Le=dt.rgba>>8&16777215,Pe=50331648,Ie=!0,j.selectionForeground&&(be=50331648,ue=j.selectionForeground.rgba>>8&16777215,vt=j.selectionForeground)),Ie&&Ce.push("xterm-decoration-top"),Pe){case 16777216:case 33554432:ke=j.ansi[Le],Ce.push(`xterm-bg-${Le}`);break;case 50331648:ke=m.channels.toColor(Le>>16,Le>>8&255,255&Le),this._addStyle(W,`background-color:#${M((Le>>>0).toString(16),"0",6)}`);break;default:lt?(ke=j.foreground,Ce.push(`xterm-bg-${l.INVERTED_DEFAULT_COLOR}`)):ke=j.background}switch(dt||De.isDim()&&(dt=m.color.multiplyOpacity(ke,.5)),be){case 16777216:case 33554432:De.isBold()&&ue<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ue+=8),this._applyMinimumContrast(W,ke,j.ansi[ue],De,dt,void 0)||Ce.push(`xterm-fg-${ue}`);break;case 50331648:const je=m.channels.toColor(ue>>16&255,ue>>8&255,255&ue);this._applyMinimumContrast(W,ke,je,De,dt,vt)||this._addStyle(W,`color:#${M(ue.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(W,ke,j.foreground,De,dt,vt)||lt&&Ce.push(`xterm-fg-${l.INVERTED_DEFAULT_COLOR}`)}Ce.length&&(W.className=Ce.join(" "),Ce.length=0),Mt||Ge||Ue?W.textContent=te:F++,_e!==this.defaultSpacing&&(W.style.letterSpacing=`${_e}px`),X.push(W),Be=tt}return W&&F&&(W.textContent=te),X}_applyMinimumContrast(w,T,y,L,O,U){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(L.getCode()))return!1;const H=this._getContrastCache(L);let z;if(O||U||(z=H.getColor(T.rgba,y.rgba)),z===void 0){const Y=this._optionsService.rawOptions.minimumContrastRatio/(L.isDim()?2:1);z=m.color.ensureContrastRatio(O||T,U||y,Y),H.setColor((O||T).rgba,(U||y).rgba,z??null)}return!!z&&(this._addStyle(w,`color:${z.css}`),!0)}_getContrastCache(w){return w.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(w,T){w.setAttribute("style",`${w.getAttribute("style")||""}${T};`)}_isCellInSelection(w,T){const y=this._selectionStart,L=this._selectionEnd;return!(!y||!L)&&(this._columnSelectMode?y[0]<=L[0]?w>=y[0]&&T>=y[1]&&w<L[0]&&T<=L[1]:w<y[0]&&T>=y[1]&&w>=L[0]&&T<=L[1]:T>y[1]&&T<L[1]||y[1]===L[1]&&T===y[1]&&w>=y[0]&&w<L[0]||y[1]<L[1]&&T===L[1]&&w<L[0]||y[1]<L[1]&&T===y[1]&&w>=y[0])}};function M(w,T,y){for(;w.length<y;)w=T+w;return w}r.DomRendererRowFactory=b=g([p(1,a.ICharacterJoinerService),p(2,R.IOptionsService),p(3,a.ICoreBrowserService),p(4,R.ICoreService),p(5,R.IDecorationService),p(6,a.IThemeService)],b)},2550:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(d,g){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=d.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const p=d.createElement("span");p.classList.add("xterm-char-measure-element");const l=d.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";const S=d.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontStyle="italic";const x=d.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[p,l,S,x],this._container.appendChild(p),this._container.appendChild(l),this._container.appendChild(S),this._container.appendChild(x),g.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(d,g,p,l){d===this._font&&g===this._fontSize&&p===this._weight&&l===this._weightBold||(this._font=d,this._fontSize=g,this._weight=p,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(d,g,p){let l=0;if(!g&&!p&&d.length===1&&(l=d.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];const R=this._measure(d,0);return R>0&&(this._flat[l]=R),R}let S=d;g&&(S+="B"),p&&(S+="I");let x=this._holey.get(S);if(x===void 0){let R=0;g&&(R|=1),p&&(R|=2),x=this._measure(d,R),x>0&&this._holey.set(S,x)}return x}_measure(d,g){const p=this._measureElements[g];return p.textContent=d.repeat(32),p.offsetWidth/32}}},2223:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const g=d(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=g.isFirefox||g.isLegacyEdge?"bottom":"ideographic"},6171:(P,r)=>{function d(p){return 57508<=p&&p<=57558}function g(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(r,"__esModule",{value:!0}),r.computeNextVariantOffset=r.createRenderDimensions=r.treatGlyphAsBackgroundColor=r.allowRescaling=r.isEmoji=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},r.isPowerlineGlyph=d,r.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},r.isEmoji=g,r.allowRescaling=function(p,l,S,x){return l===1&&S>Math.ceil(1.5*x)&&p!==void 0&&p>255&&!g(p)&&!d(p)&&!(function(R){return 57344<=R&&R<=63743})(p)},r.treatGlyphAsBackgroundColor=function(p){return d(p)||(function(l){return 9472<=l&&l<=9631})(p)},r.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}}}},r.computeNextVariantOffset=function(p,l,S=0){return(p-(2*Math.round(l)-S))%(2*Math.round(l))}},6052:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class d{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(p,l,S,x=!1){if(this.selectionStart=l,this.selectionEnd=S,!l||!S||l[0]===S[0]&&l[1]===S[1])return void this.clear();const R=p.buffers.active.ydisp,m=l[1]-R,a=S[1]-R,u=Math.max(m,0),f=Math.min(a,p.rows-1);u>=p.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=m,this.viewportEndRow=a,this.viewportCappedStartRow=u,this.viewportCappedEndRow=f,this.startCol=l[0],this.endCol=S[0])}isCellSelected(p,l,S){return!!this.hasSelection&&(S-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&S>=this.viewportCappedStartRow&&l<this.endCol&&S<=this.viewportCappedEndRow:l<this.startCol&&S>=this.viewportCappedStartRow&&l>=this.endCol&&S<=this.viewportCappedEndRow:S>this.viewportStartRow&&S<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&S===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportStartRow&&l>=this.startCol)}}r.createSelectionRenderModel=function(){return new d}},456:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(d){this._bufferService=d,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 d=this.selectionStart[0]+this.selectionStartLength;return d>this._bufferService.cols?d%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)-1]:[d%this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)]:[d,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const d=this.selectionStart[0]+this.selectionStartLength;return d>this._bufferService.cols?[d%this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)]:[Math.max(d,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const d=this.selectionStart,g=this.selectionEnd;return!(!d||!g)&&(d[1]>g[1]||d[1]===g[1]&&d[0]>g[0])}handleTrim(d){return this.selectionStart&&(this.selectionStart[1]-=d),this.selectionEnd&&(this.selectionEnd[1]-=d),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(P,r,d){var g=this&&this.__decorate||function(f,h,b,M){var w,T=arguments.length,y=T<3?h:M===null?M=Object.getOwnPropertyDescriptor(h,b):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,h,b,M);else for(var L=f.length-1;L>=0;L--)(w=f[L])&&(y=(T<3?w(y):T>3?w(h,b,y):w(h,b))||y);return T>3&&y&&Object.defineProperty(h,b,y),y},p=this&&this.__param||function(f,h){return function(b,M){h(b,M,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const l=d(2585),S=d(8460),x=d(844);let R=r.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(f,h,b){super(),this._optionsService=b,this.width=0,this.height=0,this._onCharSizeChange=this.register(new S.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new u(this._optionsService))}catch{this._measureStrategy=this.register(new a(f,h,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const f=this._measureStrategy.measure();f.width===this.width&&f.height===this.height||(this.width=f.width,this.height=f.height,this._onCharSizeChange.fire())}};r.CharSizeService=R=g([p(2,l.IOptionsService)],R);class m extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(h,b){h!==void 0&&h>0&&b!==void 0&&b>0&&(this._result.width=h,this._result.height=b)}}class a extends m{constructor(h,b,M){super(),this._document=h,this._parentElement=b,this._optionsService=M,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(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class u extends m{constructor(h){super(),this._optionsService=h,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const b=this._ctx.measureText("W");if(!("width"in b&&"fontBoundingBoxAscent"in b&&"fontBoundingBoxDescent"in b))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const h=this._ctx.measureText("W");return this._validateAndSet(h.width,h.fontBoundingBoxAscent+h.fontBoundingBoxDescent),this._result}}},4269:function(P,r,d){var g=this&&this.__decorate||function(u,f,h,b){var M,w=arguments.length,T=w<3?f:b===null?b=Object.getOwnPropertyDescriptor(f,h):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(u,f,h,b);else for(var y=u.length-1;y>=0;y--)(M=u[y])&&(T=(w<3?M(T):w>3?M(f,h,T):M(f,h))||T);return w>3&&T&&Object.defineProperty(f,h,T),T},p=this&&this.__param||function(u,f){return function(h,b){f(h,b,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const l=d(3734),S=d(643),x=d(511),R=d(2585);class m extends l.AttributeData{constructor(f,h,b){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=h,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(f){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=m;let a=r.CharacterJoinerService=class Fp{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(f){const h={id:this._nextCharacterJoinerId++,handler:f};return this._characterJoiners.push(h),h.id}deregister(f){for(let h=0;h<this._characterJoiners.length;h++)if(this._characterJoiners[h].id===f)return this._characterJoiners.splice(h,1),!0;return!1}getJoinedCharacters(f){if(this._characterJoiners.length===0)return[];const h=this._bufferService.buffer.lines.get(f);if(!h||h.length===0)return[];const b=[],M=h.translateToString(!0);let w=0,T=0,y=0,L=h.getFg(0),O=h.getBg(0);for(let U=0;U<h.getTrimmedLength();U++)if(h.loadCell(U,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==L||this._workCell.bg!==O){if(U-w>1){const H=this._getJoinedRanges(M,y,T,h,w);for(let z=0;z<H.length;z++)b.push(H[z])}w=U,y=T,L=this._workCell.fg,O=this._workCell.bg}T+=this._workCell.getChars().length||S.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-w>1){const U=this._getJoinedRanges(M,y,T,h,w);for(let H=0;H<U.length;H++)b.push(U[H])}return b}_getJoinedRanges(f,h,b,M,w){const T=f.substring(h,b);let y=[];try{y=this._characterJoiners[0].handler(T)}catch(L){console.error(L)}for(let L=1;L<this._characterJoiners.length;L++)try{const O=this._characterJoiners[L].handler(T);for(let U=0;U<O.length;U++)Fp._mergeRanges(y,O[U])}catch(O){console.error(O)}return this._stringRangesToCellRanges(y,M,w),y}_stringRangesToCellRanges(f,h,b){let M=0,w=!1,T=0,y=f[M];if(y){for(let L=b;L<this._bufferService.cols;L++){const O=h.getWidth(L),U=h.getString(L).length||S.WHITESPACE_CELL_CHAR.length;if(O!==0){if(!w&&y[0]<=T&&(y[0]=L,w=!0),y[1]<=T){if(y[1]=L,y=f[++M],!y)break;y[0]<=T?(y[0]=L,w=!0):w=!1}T+=U}}y&&(y[1]=this._bufferService.cols)}}static _mergeRanges(f,h){let b=!1;for(let M=0;M<f.length;M++){const w=f[M];if(b){if(h[1]<=w[0])return f[M-1][1]=h[1],f;if(h[1]<=w[1])return f[M-1][1]=Math.max(h[1],w[1]),f.splice(M,1),f;f.splice(M,1),M--}else{if(h[1]<=w[0])return f.splice(M,0,h),f;if(h[1]<=w[1])return w[0]=Math.min(h[0],w[0]),f;h[0]<w[1]&&(w[0]=Math.min(h[0],w[0]),b=!0)}}return b?f[f.length-1][1]=h[1]:f.push(h),f}};r.CharacterJoinerService=a=g([p(0,R.IBufferService)],a)},5114:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0;const g=d(844),p=d(8460),l=d(3656);class S extends g.Disposable{constructor(m,a,u){super(),this._textarea=m,this._window=a,this.mainDocument=u,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((f=>this._screenDprMonitor.setWindow(f)))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(m){this._window!==m&&(this._window=m,this._onWindowChange.fire(this._window))}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}}r.CoreBrowserService=S;class x extends g.Disposable{constructor(m){super(),this._parentWindow=m,this._windowResizeListener=this.register(new g.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,g.toDisposable)((()=>this.clearListener())))}setWindow(m){this._parentWindow=m,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,l.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkProviderService=void 0;const g=d(844);class p extends g.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,g.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(S){return this.linkProviders.push(S),{dispose:()=>{const x=this.linkProviders.indexOf(S);x!==-1&&this.linkProviders.splice(x,1)}}}}r.LinkProviderService=p},8934:function(P,r,d){var g=this&&this.__decorate||function(R,m,a,u){var f,h=arguments.length,b=h<3?m:u===null?u=Object.getOwnPropertyDescriptor(m,a):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(R,m,a,u);else for(var M=R.length-1;M>=0;M--)(f=R[M])&&(b=(h<3?f(b):h>3?f(m,a,b):f(m,a))||b);return h>3&&b&&Object.defineProperty(m,a,b),b},p=this&&this.__param||function(R,m){return function(a,u){m(a,u,R)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const l=d(4725),S=d(9806);let x=r.MouseService=class{constructor(R,m){this._renderService=R,this._charSizeService=m}getCoords(R,m,a,u,f){return(0,S.getCoords)(window,R,m,a,u,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(R,m){const a=(0,S.getCoordsRelativeToElement)(window,R,m);if(this._charSizeService.hasValidSize)return a[0]=Math.min(Math.max(a[0],0),this._renderService.dimensions.css.canvas.width-1),a[1]=Math.min(Math.max(a[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(a[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(a[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(a[0]),y:Math.floor(a[1])}}};r.MouseService=x=g([p(0,l.IRenderService),p(1,l.ICharSizeService)],x)},3230:function(P,r,d){var g=this&&this.__decorate||function(f,h,b,M){var w,T=arguments.length,y=T<3?h:M===null?M=Object.getOwnPropertyDescriptor(h,b):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,h,b,M);else for(var L=f.length-1;L>=0;L--)(w=f[L])&&(y=(T<3?w(y):T>3?w(h,b,y):w(h,b))||y);return T>3&&y&&Object.defineProperty(h,b,y),y},p=this&&this.__param||function(f,h){return function(b,M){h(b,M,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const l=d(6193),S=d(4725),x=d(8460),R=d(844),m=d(7226),a=d(2585);let u=r.RenderService=class extends R.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(f,h,b,M,w,T,y,L){super(),this._rowCount=f,this._charSizeService=M,this._renderer=this.register(new R.MutableDisposable),this._pausedResizeTask=new m.DebouncedIdleTask,this._observerDisposable=this.register(new R.MutableDisposable),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 x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer(((O,U)=>this._renderRows(O,U)),y),this.register(this._renderDebouncer),this.register(y.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(b.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(w.onDecorationRegistered((()=>this._fullRefresh()))),this.register(w.onDecorationRemoved((()=>this._fullRefresh()))),this.register(b.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()}))),this.register(b.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(L.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(y.window,h),this.register(y.onWindowChange((O=>this._registerIntersectionObserver(O,h))))}_registerIntersectionObserver(f,h){if("IntersectionObserver"in f){const b=new f.IntersectionObserver((M=>this._handleIntersectionChange(M[M.length-1])),{threshold:0});b.observe(h),this._observerDisposable.value=(0,R.toDisposable)((()=>b.disconnect()))}}_handleIntersectionChange(f){this._isPaused=f.isIntersecting===void 0?f.intersectionRatio===0:!f.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(f,h,b=!1){this._isPaused?this._needsFullRefresh=!0:(b||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(f,h,this._rowCount))}_renderRows(f,h){this._renderer.value&&(f=Math.min(f,this._rowCount-1),h=Math.min(h,this._rowCount-1),this._renderer.value.renderRows(f,h),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:f,end:h}),this._onRender.fire({start:f,end:h}),this._isNextRenderRedrawOnly=!0)}resize(f,h){this._rowCount=h,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(f){this._renderer.value=f,this._renderer.value&&(this._renderer.value.onRequestRedraw((h=>this.refreshRows(h.start,h.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(f){return this._renderDebouncer.addRefreshCallback(f)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(f,h){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(f,h))):this._renderer.value.handleResize(f,h),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(f,h,b){this._selectionState.start=f,this._selectionState.end=h,this._selectionState.columnSelectMode=b,this._renderer.value?.handleSelectionChanged(f,h,b)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};r.RenderService=u=g([p(2,a.IOptionsService),p(3,S.ICharSizeService),p(4,a.IDecorationService),p(5,a.IBufferService),p(6,S.ICoreBrowserService),p(7,S.IThemeService)],u)},9312:function(P,r,d){var g=this&&this.__decorate||function(y,L,O,U){var H,z=arguments.length,Y=z<3?L:U===null?U=Object.getOwnPropertyDescriptor(L,O):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(y,L,O,U);else for(var ne=y.length-1;ne>=0;ne--)(H=y[ne])&&(Y=(z<3?H(Y):z>3?H(L,O,Y):H(L,O))||Y);return z>3&&Y&&Object.defineProperty(L,O,Y),Y},p=this&&this.__param||function(y,L){return function(O,U){L(O,U,y)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const l=d(9806),S=d(9504),x=d(456),R=d(4725),m=d(8460),a=d(844),u=d(6114),f=d(4841),h=d(511),b=d(2585),M=" ",w=new RegExp(M,"g");let T=r.SelectionService=class extends a.Disposable{constructor(y,L,O,U,H,z,Y,ne,V){super(),this._element=y,this._screenElement=L,this._linkifier=O,this._bufferService=U,this._coreService=H,this._mouseService=z,this._optionsService=Y,this._renderService=ne,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new h.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new m.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new m.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new m.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,a.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 y=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!y||!L||y[0]===L[0]&&y[1]===L[1])}get selectionText(){const y=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;if(!y||!L)return"";const O=this._bufferService.buffer,U=[];if(this._activeSelectionMode===3){if(y[0]===L[0])return"";const H=y[0]<L[0]?y[0]:L[0],z=y[0]<L[0]?L[0]:y[0];for(let Y=y[1];Y<=L[1];Y++){const ne=O.translateBufferLineToString(Y,!0,H,z);U.push(ne)}}else{const H=y[1]===L[1]?L[0]:void 0;U.push(O.translateBufferLineToString(y[1],!0,y[0],H));for(let z=y[1]+1;z<=L[1]-1;z++){const Y=O.lines.get(z),ne=O.translateBufferLineToString(z,!0);Y?.isWrapped?U[U.length-1]+=ne:U.push(ne)}if(y[1]!==L[1]){const z=O.lines.get(L[1]),Y=O.translateBufferLineToString(L[1],!0,0,L[0]);z&&z.isWrapped?U[U.length-1]+=Y:U.push(Y)}}return U.map((H=>H.replace(w," "))).join(u.isWindows?`\r
14
- `:`
15
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(y){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),u.isLinux&&y&&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(y){const L=this._getMouseBufferCoords(y),O=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!!(O&&U&&L)&&this._areCoordsInSelection(L,O,U)}isCellInSelection(y,L){const O=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!(!O||!U)&&this._areCoordsInSelection([y,L],O,U)}_areCoordsInSelection(y,L,O){return y[1]>L[1]&&y[1]<O[1]||L[1]===O[1]&&y[1]===L[1]&&y[0]>=L[0]&&y[0]<O[0]||L[1]<O[1]&&y[1]===O[1]&&y[0]<O[0]||L[1]<O[1]&&y[1]===L[1]&&y[0]>=L[0]}_selectWordAtCursor(y,L){const O=this._linkifier.currentLink?.link?.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const U=this._getMouseBufferCoords(y);return!!U&&(this._selectWordAt(U,L),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(y,L){this._model.clearSelection(),y=Math.max(y,0),L=Math.min(L,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,y],this._model.selectionEnd=[this._bufferService.cols,L],this.refresh(),this._onSelectionChange.fire()}_handleTrim(y){this._model.handleTrim(y)&&this.refresh()}_getMouseBufferCoords(y){const L=this._mouseService.getCoords(y,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(L)return L[0]--,L[1]--,L[1]+=this._bufferService.buffer.ydisp,L}_getMouseEventScrollAmount(y){let L=(0,l.getCoordsRelativeToElement)(this._coreBrowserService.window,y,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return L>=0&&L<=O?0:(L>O&&(L-=O),L=Math.min(Math.max(L,-50),50),L/=50,L/Math.abs(L)+Math.round(14*L))}shouldForceSelection(y){return u.isMac?y.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:y.shiftKey}handleMouseDown(y){if(this._mouseDownTimeStamp=y.timeStamp,(y.button!==2||!this.hasSelection)&&y.button===0){if(!this._enabled){if(!this.shouldForceSelection(y))return;y.stopPropagation()}y.preventDefault(),this._dragScrollAmount=0,this._enabled&&y.shiftKey?this._handleIncrementalClick(y):y.detail===1?this._handleSingleClick(y):y.detail===2?this._handleDoubleClick(y):y.detail===3&&this._handleTripleClick(y),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(y){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(y))}_handleSingleClick(y){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(y)?3:0,this._model.selectionStart=this._getMouseBufferCoords(y),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const L=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);L&&L.length!==this._model.selectionStart[0]&&L.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(y){this._selectWordAtCursor(y,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(y){const L=this._getMouseBufferCoords(y);L&&(this._activeSelectionMode=2,this._selectLineAt(L[1]))}shouldColumnSelect(y){return y.altKey&&!(u.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(y){if(y.stopImmediatePropagation(),!this._model.selectionStart)return;const L=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(y),!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(y),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]<O.lines.length){const U=O.lines.get(this._model.selectionEnd[1]);U&&U.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}L&&L[0]===this._model.selectionEnd[0]&&L[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 y=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(y.ydisp+this._bufferService.rows,y.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=y.ydisp),this.refresh()}}_handleMouseUp(y){const L=y.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&L<500&&y.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(y,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const U=(0,S.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(U,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const y=this._model.finalSelectionStart,L=this._model.finalSelectionEnd,O=!(!y||!L||y[0]===L[0]&&y[1]===L[1]);O?y&&L&&(this._oldSelectionStart&&this._oldSelectionEnd&&y[0]===this._oldSelectionStart[0]&&y[1]===this._oldSelectionStart[1]&&L[0]===this._oldSelectionEnd[0]&&L[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(y,L,O)):this._oldHasSelection&&this._fireOnSelectionChange(y,L,O)}_fireOnSelectionChange(y,L,O){this._oldSelectionStart=y,this._oldSelectionEnd=L,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(y){this.clearSelection(),this._trimListener.dispose(),this._trimListener=y.activeBuffer.lines.onTrim((L=>this._handleTrim(L)))}_convertViewportColToCharacterIndex(y,L){let O=L;for(let U=0;L>=U;U++){const H=y.loadCell(U,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:H>1&&L!==U&&(O+=H-1)}return O}setSelection(y,L,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[y,L],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(y){this._isClickInSelection(y)||(this._selectWordAtCursor(y,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(y,L,O=!0,U=!0){if(y[0]>=this._bufferService.cols)return;const H=this._bufferService.buffer,z=H.lines.get(y[1]);if(!z)return;const Y=H.translateBufferLineToString(y[1],!1);let ne=this._convertViewportColToCharacterIndex(z,y[0]),V=ne;const X=y[0]-ne;let I=0,j=0,W=0,B=0;if(Y.charAt(ne)===" "){for(;ne>0&&Y.charAt(ne-1)===" ";)ne--;for(;V<Y.length&&Y.charAt(V+1)===" ";)V++}else{let ie=y[0],he=y[0];z.getWidth(ie)===0&&(I++,ie--),z.getWidth(he)===2&&(j++,he++);const ge=z.getString(he).length;for(ge>1&&(B+=ge-1,V+=ge-1);ie>0&&ne>0&&!this._isCharWordSeparator(z.loadCell(ie-1,this._workCell));){z.loadCell(ie-1,this._workCell);const J=this._workCell.getChars().length;this._workCell.getWidth()===0?(I++,ie--):J>1&&(W+=J-1,ne-=J-1),ne--,ie--}for(;he<z.length&&V+1<Y.length&&!this._isCharWordSeparator(z.loadCell(he+1,this._workCell));){z.loadCell(he+1,this._workCell);const J=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,he++):J>1&&(B+=J-1,V+=J-1),V++,he++}}V++;let F=ne+X-I+W,te=Math.min(this._bufferService.cols,V-ne+I+j-W-B);if(L||Y.slice(ne,V).trim()!==""){if(O&&F===0&&z.getCodePoint(0)!==32){const ie=H.lines.get(y[1]-1);if(ie&&z.isWrapped&&ie.getCodePoint(this._bufferService.cols-1)!==32){const he=this._getWordAt([this._bufferService.cols-1,y[1]-1],!1,!0,!1);if(he){const ge=this._bufferService.cols-he.start;F-=ge,te+=ge}}}if(U&&F+te===this._bufferService.cols&&z.getCodePoint(this._bufferService.cols-1)!==32){const ie=H.lines.get(y[1]+1);if(ie?.isWrapped&&ie.getCodePoint(0)!==32){const he=this._getWordAt([0,y[1]+1],!1,!1,!0);he&&(te+=he.length)}}return{start:F,length:te}}}_selectWordAt(y,L){const O=this._getWordAt(y,L);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,y[1]--;this._model.selectionStart=[O.start,y[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(y){const L=this._getWordAt(y,!0);if(L){let O=y[1];for(;L.start<0;)L.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;L.start+L.length>this._bufferService.cols;)L.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?L.start:L.start+L.length,O]}}_isCharWordSeparator(y){return y.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(y.getChars())>=0}_selectLineAt(y){const L=this._bufferService.buffer.getWrappedRangeForLine(y),O={start:{x:0,y:L.first},end:{x:this._bufferService.cols-1,y:L.last}};this._model.selectionStart=[0,L.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(O,this._bufferService.cols)}};r.SelectionService=T=g([p(3,b.IBufferService),p(4,b.ICoreService),p(5,R.IMouseService),p(6,b.IOptionsService),p(7,R.IRenderService),p(8,R.ICoreBrowserService)],T)},4725:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ILinkProviderService=r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const g=d(8343);r.ICharSizeService=(0,g.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,g.createDecorator)("CoreBrowserService"),r.IMouseService=(0,g.createDecorator)("MouseService"),r.IRenderService=(0,g.createDecorator)("RenderService"),r.ISelectionService=(0,g.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,g.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,g.createDecorator)("ThemeService"),r.ILinkProviderService=(0,g.createDecorator)("LinkProviderService")},6731:function(P,r,d){var g=this&&this.__decorate||function(T,y,L,O){var U,H=arguments.length,z=H<3?y:O===null?O=Object.getOwnPropertyDescriptor(y,L):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(T,y,L,O);else for(var Y=T.length-1;Y>=0;Y--)(U=T[Y])&&(z=(H<3?U(z):H>3?U(y,L,z):U(y,L))||z);return H>3&&z&&Object.defineProperty(y,L,z),z},p=this&&this.__param||function(T,y){return function(L,O){y(L,O,T)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const l=d(7239),S=d(8055),x=d(8460),R=d(844),m=d(2585),a=S.css.toColor("#ffffff"),u=S.css.toColor("#000000"),f=S.css.toColor("#ffffff"),h=S.css.toColor("#000000"),b={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[S.css.toColor("#2e3436"),S.css.toColor("#cc0000"),S.css.toColor("#4e9a06"),S.css.toColor("#c4a000"),S.css.toColor("#3465a4"),S.css.toColor("#75507b"),S.css.toColor("#06989a"),S.css.toColor("#d3d7cf"),S.css.toColor("#555753"),S.css.toColor("#ef2929"),S.css.toColor("#8ae234"),S.css.toColor("#fce94f"),S.css.toColor("#729fcf"),S.css.toColor("#ad7fa8"),S.css.toColor("#34e2e2"),S.css.toColor("#eeeeec")],y=[0,95,135,175,215,255];for(let L=0;L<216;L++){const O=y[L/36%6|0],U=y[L/6%6|0],H=y[L%6];T.push({css:S.channels.toCss(O,U,H),rgba:S.channels.toRgba(O,U,H)})}for(let L=0;L<24;L++){const O=8+10*L;T.push({css:S.channels.toCss(O,O,O),rgba:S.channels.toRgba(O,O,O)})}return T})());let M=r.ThemeService=class extends R.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new l.ColorContrastCache,this._halfContrastCache=new l.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:a,background:u,cursor:f,cursorAccent:h,selectionForeground:void 0,selectionBackgroundTransparent:b,selectionBackgroundOpaque:S.color.blend(u,b),selectionInactiveBackgroundTransparent:b,selectionInactiveBackgroundOpaque:S.color.blend(u,b),ansi:r.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(T={}){const y=this._colors;if(y.foreground=w(T.foreground,a),y.background=w(T.background,u),y.cursor=w(T.cursor,f),y.cursorAccent=w(T.cursorAccent,h),y.selectionBackgroundTransparent=w(T.selectionBackground,b),y.selectionBackgroundOpaque=S.color.blend(y.background,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundTransparent=w(T.selectionInactiveBackground,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundOpaque=S.color.blend(y.background,y.selectionInactiveBackgroundTransparent),y.selectionForeground=T.selectionForeground?w(T.selectionForeground,S.NULL_COLOR):void 0,y.selectionForeground===S.NULL_COLOR&&(y.selectionForeground=void 0),S.color.isOpaque(y.selectionBackgroundTransparent)&&(y.selectionBackgroundTransparent=S.color.opacity(y.selectionBackgroundTransparent,.3)),S.color.isOpaque(y.selectionInactiveBackgroundTransparent)&&(y.selectionInactiveBackgroundTransparent=S.color.opacity(y.selectionInactiveBackgroundTransparent,.3)),y.ansi=r.DEFAULT_ANSI_COLORS.slice(),y.ansi[0]=w(T.black,r.DEFAULT_ANSI_COLORS[0]),y.ansi[1]=w(T.red,r.DEFAULT_ANSI_COLORS[1]),y.ansi[2]=w(T.green,r.DEFAULT_ANSI_COLORS[2]),y.ansi[3]=w(T.yellow,r.DEFAULT_ANSI_COLORS[3]),y.ansi[4]=w(T.blue,r.DEFAULT_ANSI_COLORS[4]),y.ansi[5]=w(T.magenta,r.DEFAULT_ANSI_COLORS[5]),y.ansi[6]=w(T.cyan,r.DEFAULT_ANSI_COLORS[6]),y.ansi[7]=w(T.white,r.DEFAULT_ANSI_COLORS[7]),y.ansi[8]=w(T.brightBlack,r.DEFAULT_ANSI_COLORS[8]),y.ansi[9]=w(T.brightRed,r.DEFAULT_ANSI_COLORS[9]),y.ansi[10]=w(T.brightGreen,r.DEFAULT_ANSI_COLORS[10]),y.ansi[11]=w(T.brightYellow,r.DEFAULT_ANSI_COLORS[11]),y.ansi[12]=w(T.brightBlue,r.DEFAULT_ANSI_COLORS[12]),y.ansi[13]=w(T.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),y.ansi[14]=w(T.brightCyan,r.DEFAULT_ANSI_COLORS[14]),y.ansi[15]=w(T.brightWhite,r.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const L=Math.min(y.ansi.length-16,T.extendedAnsi.length);for(let O=0;O<L;O++)y.ansi[O+16]=w(T.extendedAnsi[O],r.DEFAULT_ANSI_COLORS[O+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(T){this._restoreColor(T),this._onChangeColors.fire(this.colors)}_restoreColor(T){if(T!==void 0)switch(T){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[T]=this._restoreColors.ansi[T]}else for(let y=0;y<this._restoreColors.ansi.length;++y)this._colors.ansi[y]=this._restoreColors.ansi[y]}modifyColors(T){T(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 w(T,y){if(T!==void 0)try{return S.css.toColor(T)}catch{}return y}r.ThemeService=M=g([p(0,m.IOptionsService)],M)},6349:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const g=d(8460),p=d(844);class l extends p.Disposable{constructor(x){super(),this._maxLength=x,this.onDeleteEmitter=this.register(new g.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new g.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new g.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(x){if(this._maxLength===x)return;const R=new Array(x);for(let m=0;m<Math.min(x,this.length);m++)R[m]=this._array[this._getCyclicIndex(m)];this._array=R,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let R=this._length;R<x;R++)this._array[R]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,R){this._array[this._getCyclicIndex(x)]=R}push(x){this._array[this._getCyclicIndex(this._length)]=x,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(x,R,...m){if(R){for(let a=x;a<this._length-R;a++)this._array[this._getCyclicIndex(a)]=this._array[this._getCyclicIndex(a+R)];this._length-=R,this.onDeleteEmitter.fire({index:x,amount:R})}for(let a=this._length-1;a>=x;a--)this._array[this._getCyclicIndex(a+m.length)]=this._array[this._getCyclicIndex(a)];for(let a=0;a<m.length;a++)this._array[this._getCyclicIndex(x+a)]=m[a];if(m.length&&this.onInsertEmitter.fire({index:x,amount:m.length}),this._length+m.length>this._maxLength){const a=this._length+m.length-this._maxLength;this._startIndex+=a,this._length=this._maxLength,this.onTrimEmitter.fire(a)}else this._length+=m.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,R,m){if(!(R<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+m<0)throw new Error("Cannot shift elements in list beyond index 0");if(m>0){for(let u=R-1;u>=0;u--)this.set(x+u+m,this.get(x+u));const a=x+R+m-this._length;if(a>0)for(this._length+=a;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let a=0;a<R;a++)this.set(x+a+m,this.get(x+a))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}r.CircularList=l},1439:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function d(g,p=5){if(typeof g!="object")return g;const l=Array.isArray(g)?[]:{};for(const S in g)l[S]=p<=1?g[S]:g[S]&&d(g[S],p-1);return l}},8055:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;let d=0,g=0,p=0,l=0;var S,x,R,m,a;function u(h){const b=h.toString(16);return b.length<2?"0"+b:b}function f(h,b){return h<b?(b+.05)/(h+.05):(h+.05)/(b+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(h){h.toCss=function(b,M,w,T){return T!==void 0?`#${u(b)}${u(M)}${u(w)}${u(T)}`:`#${u(b)}${u(M)}${u(w)}`},h.toRgba=function(b,M,w,T=255){return(b<<24|M<<16|w<<8|T)>>>0},h.toColor=function(b,M,w,T){return{css:h.toCss(b,M,w,T),rgba:h.toRgba(b,M,w,T)}}})(S||(r.channels=S={})),(function(h){function b(M,w){return l=Math.round(255*w),[d,g,p]=a.toChannels(M.rgba),{css:S.toCss(d,g,p,l),rgba:S.toRgba(d,g,p,l)}}h.blend=function(M,w){if(l=(255&w.rgba)/255,l===1)return{css:w.css,rgba:w.rgba};const T=w.rgba>>24&255,y=w.rgba>>16&255,L=w.rgba>>8&255,O=M.rgba>>24&255,U=M.rgba>>16&255,H=M.rgba>>8&255;return d=O+Math.round((T-O)*l),g=U+Math.round((y-U)*l),p=H+Math.round((L-H)*l),{css:S.toCss(d,g,p),rgba:S.toRgba(d,g,p)}},h.isOpaque=function(M){return(255&M.rgba)==255},h.ensureContrastRatio=function(M,w,T){const y=a.ensureContrastRatio(M.rgba,w.rgba,T);if(y)return S.toColor(y>>24&255,y>>16&255,y>>8&255)},h.opaque=function(M){const w=(255|M.rgba)>>>0;return[d,g,p]=a.toChannels(w),{css:S.toCss(d,g,p),rgba:w}},h.opacity=b,h.multiplyOpacity=function(M,w){return l=255&M.rgba,b(M,l*w/255)},h.toColorRGB=function(M){return[M.rgba>>24&255,M.rgba>>16&255,M.rgba>>8&255]}})(x||(r.color=x={})),(function(h){let b,M;try{const w=document.createElement("canvas");w.width=1,w.height=1;const T=w.getContext("2d",{willReadFrequently:!0});T&&(b=T,b.globalCompositeOperation="copy",M=b.createLinearGradient(0,0,1,1))}catch{}h.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return d=parseInt(w.slice(1,2).repeat(2),16),g=parseInt(w.slice(2,3).repeat(2),16),p=parseInt(w.slice(3,4).repeat(2),16),S.toColor(d,g,p);case 5:return d=parseInt(w.slice(1,2).repeat(2),16),g=parseInt(w.slice(2,3).repeat(2),16),p=parseInt(w.slice(3,4).repeat(2),16),l=parseInt(w.slice(4,5).repeat(2),16),S.toColor(d,g,p,l);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const T=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return d=parseInt(T[1]),g=parseInt(T[2]),p=parseInt(T[3]),l=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),S.toColor(d,g,p,l);if(!b||!M)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=M,b.fillStyle=w,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[d,g,p,l]=b.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(d,g,p,l),css:w}}})(R||(r.css=R={})),(function(h){function b(M,w,T){const y=M/255,L=w/255,O=T/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}h.relativeLuminance=function(M){return b(M>>16&255,M>>8&255,255&M)},h.relativeLuminance2=b})(m||(r.rgb=m={})),(function(h){function b(w,T,y){const L=w>>24&255,O=w>>16&255,U=w>>8&255;let H=T>>24&255,z=T>>16&255,Y=T>>8&255,ne=f(m.relativeLuminance2(H,z,Y),m.relativeLuminance2(L,O,U));for(;ne<y&&(H>0||z>0||Y>0);)H-=Math.max(0,Math.ceil(.1*H)),z-=Math.max(0,Math.ceil(.1*z)),Y-=Math.max(0,Math.ceil(.1*Y)),ne=f(m.relativeLuminance2(H,z,Y),m.relativeLuminance2(L,O,U));return(H<<24|z<<16|Y<<8|255)>>>0}function M(w,T,y){const L=w>>24&255,O=w>>16&255,U=w>>8&255;let H=T>>24&255,z=T>>16&255,Y=T>>8&255,ne=f(m.relativeLuminance2(H,z,Y),m.relativeLuminance2(L,O,U));for(;ne<y&&(H<255||z<255||Y<255);)H=Math.min(255,H+Math.ceil(.1*(255-H))),z=Math.min(255,z+Math.ceil(.1*(255-z))),Y=Math.min(255,Y+Math.ceil(.1*(255-Y))),ne=f(m.relativeLuminance2(H,z,Y),m.relativeLuminance2(L,O,U));return(H<<24|z<<16|Y<<8|255)>>>0}h.blend=function(w,T){if(l=(255&T)/255,l===1)return T;const y=T>>24&255,L=T>>16&255,O=T>>8&255,U=w>>24&255,H=w>>16&255,z=w>>8&255;return d=U+Math.round((y-U)*l),g=H+Math.round((L-H)*l),p=z+Math.round((O-z)*l),S.toRgba(d,g,p)},h.ensureContrastRatio=function(w,T,y){const L=m.relativeLuminance(w>>8),O=m.relativeLuminance(T>>8);if(f(L,O)<y){if(O<L){const z=b(w,T,y),Y=f(L,m.relativeLuminance(z>>8));if(Y<y){const ne=M(w,T,y);return Y>f(L,m.relativeLuminance(ne>>8))?z:ne}return z}const U=M(w,T,y),H=f(L,m.relativeLuminance(U>>8));if(H<y){const z=b(w,T,y);return H>f(L,m.relativeLuminance(z>>8))?U:z}return U}},h.reduceLuminance=b,h.increaseLuminance=M,h.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]}})(a||(r.rgba=a={})),r.toPaddedHex=u,r.contrastRatio=f},8969:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const g=d(844),p=d(2585),l=d(4348),S=d(7866),x=d(744),R=d(7302),m=d(6975),a=d(8460),u=d(1753),f=d(1480),h=d(7994),b=d(9282),M=d(5435),w=d(5981),T=d(2660);let y=!1;class L extends g.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new a.EventEmitter),this._onScroll.event((U=>{this._onScrollApi?.fire(U.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(U){for(const H in U)this.optionsService.options[H]=U[H]}constructor(U){super(),this._windowsWrappingHeuristics=this.register(new g.MutableDisposable),this._onBinary=this.register(new a.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new a.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new a.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new a.EventEmitter),this._instantiationService=new l.InstantiationService,this.optionsService=this.register(new R.OptionsService(U)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(S.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(m.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(u.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(h.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new M.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,a.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,a.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,a.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,a.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((H=>{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((H=>{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 w.WriteBuffer(((H,z)=>this._inputHandler.parse(H,z)))),this.register((0,a.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(U,H){this._writeBuffer.write(U,H)}writeSync(U,H){this._logService.logLevel<=p.LogLevelEnum.WARN&&!y&&(this._logService.warn("writeSync is unreliable and will be removed soon."),y=!0),this._writeBuffer.writeSync(U,H)}input(U,H=!0){this.coreService.triggerDataEvent(U,H)}resize(U,H){isNaN(U)||isNaN(H)||(U=Math.max(U,x.MINIMUM_COLS),H=Math.max(H,x.MINIMUM_ROWS),this._bufferService.resize(U,H))}scroll(U,H=!1){this._bufferService.scroll(U,H)}scrollLines(U,H,z){this._bufferService.scrollLines(U,H,z)}scrollPages(U){this.scrollLines(U*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(U){const H=U-this._bufferService.buffer.ydisp;H!==0&&this.scrollLines(H)}registerEscHandler(U,H){return this._inputHandler.registerEscHandler(U,H)}registerDcsHandler(U,H){return this._inputHandler.registerDcsHandler(U,H)}registerCsiHandler(U,H){return this._inputHandler.registerCsiHandler(U,H)}registerOscHandler(U,H){return this._inputHandler.registerOscHandler(U,H)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let U=!1;const H=this.optionsService.rawOptions.windowsPty;H&&H.buildNumber!==void 0&&H.buildNumber!==void 0?U=H.backend==="conpty"&&H.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(U=!0),U?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const U=[];U.push(this.onLineFeed(b.updateWindowsModeWrappedState.bind(null,this._bufferService))),U.push(this.registerCsiHandler({final:"H"},(()=>((0,b.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,g.toDisposable)((()=>{for(const H of U)H.dispose()}))}}}r.CoreTerminal=L},8460:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=d=>(this._listeners.push(d),{dispose:()=>{if(!this._disposed){for(let g=0;g<this._listeners.length;g++)if(this._listeners[g]===d)return void this._listeners.splice(g,1)}}})),this._event}fire(d,g){const p=[];for(let l=0;l<this._listeners.length;l++)p.push(this._listeners[l]);for(let l=0;l<p.length;l++)p[l].call(void 0,d,g)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(d,g){return d((p=>g.fire(p)))},r.runAndSubscribe=function(d,g){return g(void 0),d((p=>g(p)))}},5435:function(P,r,d){var g=this&&this.__decorate||function(I,j,W,B){var F,te=arguments.length,ie=te<3?j:B===null?B=Object.getOwnPropertyDescriptor(j,W):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ie=Reflect.decorate(I,j,W,B);else for(var he=I.length-1;he>=0;he--)(F=I[he])&&(ie=(te<3?F(ie):te>3?F(j,W,ie):F(j,W))||ie);return te>3&&ie&&Object.defineProperty(j,W,ie),ie},p=this&&this.__param||function(I,j){return function(W,B){j(W,B,I)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const l=d(2584),S=d(7116),x=d(2015),R=d(844),m=d(482),a=d(8437),u=d(8460),f=d(643),h=d(511),b=d(3734),M=d(2585),w=d(1480),T=d(6242),y=d(6351),L=d(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},U=131072;function H(I,j){if(I>24)return j.setWinLines||!1;switch(I){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var z;(function(I){I[I.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",I[I.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(z||(r.WindowsOptionsReportType=z={}));let Y=0;class ne extends R.Disposable{getAttrData(){return this._curAttrData}constructor(j,W,B,F,te,ie,he,ge,J=new x.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=W,this._coreService=B,this._logService=F,this._optionsService=te,this._oscLinkService=ie,this._coreMouseService=he,this._unicodeService=ge,this._parser=J,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new m.StringToUtf32,this._utf8Decoder=new m.Utf8ToUtf32,this._workCell=new h.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new u.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new u.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new u.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new u.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new u.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new u.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new u.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new u.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new u.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new u.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new u.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 V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((q=>this._activeBuffer=q.activeBuffer))),this._parser.setCsiHandlerFallback(((q,re)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:re.toArray()})})),this._parser.setEscHandlerFallback((q=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(q)})})),this._parser.setExecuteHandlerFallback((q=>{this._logService.debug("Unknown EXECUTE code: ",{code:q})})),this._parser.setOscHandlerFallback(((q,re,_e)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:re,data:_e})})),this._parser.setDcsHandlerFallback(((q,re,_e)=>{re==="HOOK"&&(_e=_e.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:re,payload:_e})})),this._parser.setPrintHandler(((q,re,_e)=>this.print(q,re,_e))),this._parser.registerCsiHandler({final:"@"},(q=>this.insertChars(q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(q=>this.scrollLeft(q))),this._parser.registerCsiHandler({final:"A"},(q=>this.cursorUp(q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(q=>this.scrollRight(q))),this._parser.registerCsiHandler({final:"B"},(q=>this.cursorDown(q))),this._parser.registerCsiHandler({final:"C"},(q=>this.cursorForward(q))),this._parser.registerCsiHandler({final:"D"},(q=>this.cursorBackward(q))),this._parser.registerCsiHandler({final:"E"},(q=>this.cursorNextLine(q))),this._parser.registerCsiHandler({final:"F"},(q=>this.cursorPrecedingLine(q))),this._parser.registerCsiHandler({final:"G"},(q=>this.cursorCharAbsolute(q))),this._parser.registerCsiHandler({final:"H"},(q=>this.cursorPosition(q))),this._parser.registerCsiHandler({final:"I"},(q=>this.cursorForwardTab(q))),this._parser.registerCsiHandler({final:"J"},(q=>this.eraseInDisplay(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(q=>this.eraseInDisplay(q,!0))),this._parser.registerCsiHandler({final:"K"},(q=>this.eraseInLine(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(q=>this.eraseInLine(q,!0))),this._parser.registerCsiHandler({final:"L"},(q=>this.insertLines(q))),this._parser.registerCsiHandler({final:"M"},(q=>this.deleteLines(q))),this._parser.registerCsiHandler({final:"P"},(q=>this.deleteChars(q))),this._parser.registerCsiHandler({final:"S"},(q=>this.scrollUp(q))),this._parser.registerCsiHandler({final:"T"},(q=>this.scrollDown(q))),this._parser.registerCsiHandler({final:"X"},(q=>this.eraseChars(q))),this._parser.registerCsiHandler({final:"Z"},(q=>this.cursorBackwardTab(q))),this._parser.registerCsiHandler({final:"`"},(q=>this.charPosAbsolute(q))),this._parser.registerCsiHandler({final:"a"},(q=>this.hPositionRelative(q))),this._parser.registerCsiHandler({final:"b"},(q=>this.repeatPrecedingCharacter(q))),this._parser.registerCsiHandler({final:"c"},(q=>this.sendDeviceAttributesPrimary(q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(q=>this.sendDeviceAttributesSecondary(q))),this._parser.registerCsiHandler({final:"d"},(q=>this.linePosAbsolute(q))),this._parser.registerCsiHandler({final:"e"},(q=>this.vPositionRelative(q))),this._parser.registerCsiHandler({final:"f"},(q=>this.hVPosition(q))),this._parser.registerCsiHandler({final:"g"},(q=>this.tabClear(q))),this._parser.registerCsiHandler({final:"h"},(q=>this.setMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(q=>this.setModePrivate(q))),this._parser.registerCsiHandler({final:"l"},(q=>this.resetMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(q=>this.resetModePrivate(q))),this._parser.registerCsiHandler({final:"m"},(q=>this.charAttributes(q))),this._parser.registerCsiHandler({final:"n"},(q=>this.deviceStatus(q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(q=>this.deviceStatusPrivate(q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(q=>this.softReset(q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(q=>this.setCursorStyle(q))),this._parser.registerCsiHandler({final:"r"},(q=>this.setScrollRegion(q))),this._parser.registerCsiHandler({final:"s"},(q=>this.saveCursor(q))),this._parser.registerCsiHandler({final:"t"},(q=>this.windowOptions(q))),this._parser.registerCsiHandler({final:"u"},(q=>this.restoreCursor(q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(q=>this.insertColumns(q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(q=>this.deleteColumns(q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(q=>this.selectProtected(q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(q=>this.requestMode(q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(q=>this.requestMode(q,!1))),this._parser.setExecuteHandler(l.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(l.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(l.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(l.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(l.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(l.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(l.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(l.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(l.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((q=>(this.setTitle(q),this.setIconName(q),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((q=>this.setIconName(q)))),this._parser.registerOscHandler(2,new T.OscHandler((q=>this.setTitle(q)))),this._parser.registerOscHandler(4,new T.OscHandler((q=>this.setOrReportIndexedColor(q)))),this._parser.registerOscHandler(8,new T.OscHandler((q=>this.setHyperlink(q)))),this._parser.registerOscHandler(10,new T.OscHandler((q=>this.setOrReportFgColor(q)))),this._parser.registerOscHandler(11,new T.OscHandler((q=>this.setOrReportBgColor(q)))),this._parser.registerOscHandler(12,new T.OscHandler((q=>this.setOrReportCursorColor(q)))),this._parser.registerOscHandler(104,new T.OscHandler((q=>this.restoreIndexedColor(q)))),this._parser.registerOscHandler(110,new T.OscHandler((q=>this.restoreFgColor(q)))),this._parser.registerOscHandler(111,new T.OscHandler((q=>this.restoreBgColor(q)))),this._parser.registerOscHandler(112,new T.OscHandler((q=>this.restoreCursorColor(q)))),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 q in S.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:q},(()=>this.selectCharset("("+q))),this._parser.registerEscHandler({intermediates:")",final:q},(()=>this.selectCharset(")"+q))),this._parser.registerEscHandler({intermediates:"*",final:q},(()=>this.selectCharset("*"+q))),this._parser.registerEscHandler({intermediates:"+",final:q},(()=>this.selectCharset("+"+q))),this._parser.registerEscHandler({intermediates:"-",final:q},(()=>this.selectCharset("-"+q))),this._parser.registerEscHandler({intermediates:".",final:q},(()=>this.selectCharset("."+q))),this._parser.registerEscHandler({intermediates:"/",final:q},(()=>this.selectCharset("/"+q)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((q=>(this._logService.error("Parsing error: ",q),q))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new y.DcsHandler(((q,re)=>this.requestStatusString(q,re))))}_preserveStack(j,W,B,F){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=W,this._parseStack.decodedLength=B,this._parseStack.position=F}_logSlowResolvingAsync(j){this._logService.logLevel<=M.LogLevelEnum.WARN&&Promise.race([j,new Promise(((W,B)=>setTimeout((()=>B("#SLOW_TIMEOUT")),5e3)))]).catch((W=>{if(W!=="#SLOW_TIMEOUT")throw W;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,W){let B,F=this._activeBuffer.x,te=this._activeBuffer.y,ie=0;const he=this._parseStack.paused;if(he){if(B=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,W))return this._logSlowResolvingAsync(B),B;F=this._parseStack.cursorStartX,te=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>U&&(ie=this._parseStack.position+U)}if(this._logService.logLevel<=M.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,(q=>String.fromCharCode(q))).join("")}"`),typeof j=="string"?j.split("").map((q=>q.charCodeAt(0))):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<U&&(this._parseBuffer=new Uint32Array(Math.min(j.length,U))),he||this._dirtyRowTracker.clearRange(),j.length>U)for(let q=ie;q<j.length;q+=U){const re=q+U<j.length?q+U:j.length,_e=typeof j=="string"?this._stringDecoder.decode(j.substring(q,re),this._parseBuffer):this._utf8Decoder.decode(j.subarray(q,re),this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,_e))return this._preserveStack(F,te,_e,q),this._logSlowResolvingAsync(B),B}else if(!he){const q=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,q))return this._preserveStack(F,te,q,0),this._logSlowResolvingAsync(B),B}this._activeBuffer.x===F&&this._activeBuffer.y===te||this._onCursorMove.fire();const ge=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),J=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);J<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(J,this._bufferService.rows-1),Math.min(ge,this._bufferService.rows-1))}print(j,W,B){let F,te;const ie=this._charsetService.charset,he=this._optionsService.rawOptions.screenReaderMode,ge=this._bufferService.cols,J=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,re=this._curAttrData;let _e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&B-W>0&&_e.getWidth(this._activeBuffer.x-1)===2&&_e.setCellFromCodepoint(this._activeBuffer.x-1,0,1,re);let Ce=this._parser.precedingJoinState;for(let we=W;we<B;++we){if(F=j[we],F<127&&ie){const tt=ie[String.fromCharCode(F)];tt&&(F=tt.charCodeAt(0))}const Be=this._unicodeService.charProperties(F,Ce);te=w.UnicodeService.extractWidth(Be);const Re=w.UnicodeService.extractShouldJoin(Be),Ge=Re?w.UnicodeService.extractWidth(Ce):0;if(Ce=Be,he&&this._onA11yChar.fire((0,m.stringFromCodePoint)(F)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+te-Ge>ge){if(J){const tt=_e;let De=this._activeBuffer.x-Ge;for(this._activeBuffer.x=Ge,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),_e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ge>0&&_e instanceof a.BufferLine&&_e.copyCellsFrom(tt,De,0,Ge,!1);De<ge;)tt.setCellFromCodepoint(De++,0,1,re)}else if(this._activeBuffer.x=ge-1,te===2)continue}if(Re&&this._activeBuffer.x){const tt=_e.getWidth(this._activeBuffer.x-1)?1:2;_e.addCodepointToCell(this._activeBuffer.x-tt,F,te);for(let De=te-Ge;--De>=0;)_e.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}else if(q&&(_e.insertCells(this._activeBuffer.x,te-Ge,this._activeBuffer.getNullCell(re)),_e.getWidth(ge-1)===2&&_e.setCellFromCodepoint(ge-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,re)),_e.setCellFromCodepoint(this._activeBuffer.x++,F,te,re),te>0)for(;--te;)_e.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}this._parser.precedingJoinState=Ce,this._activeBuffer.x<ge&&B-W>0&&_e.getWidth(this._activeBuffer.x)===0&&!_e.hasContent(this._activeBuffer.x)&&_e.setCellFromCodepoint(this._activeBuffer.x,0,1,re),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(j,W){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,W):this._parser.registerCsiHandler(j,(B=>!H(B.params[0],this._optionsService.rawOptions.windowOptions)||W(B)))}registerDcsHandler(j,W){return this._parser.registerDcsHandler(j,new y.DcsHandler(W))}registerEscHandler(j,W){return this._parser.registerEscHandler(j,W)}registerOscHandler(j,W){return this._parser.registerOscHandler(j,new T.OscHandler(W))}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(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);j.hasWidth(this._activeBuffer.x)&&!j.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,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(j,W){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+W):(this._activeBuffer.x=j,this._activeBuffer.y=W),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,W){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+W)}cursorUp(j){const W=this._activeBuffer.y-this._activeBuffer.scrollTop;return W>=0?this._moveCursor(0,-Math.min(W,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const W=this._activeBuffer.scrollBottom-this._activeBuffer.y;return W>=0?this._moveCursor(0,Math.min(W,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const W=j.params[0];return W===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:W===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let W=j.params[0]||1;for(;W--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let W=j.params[0]||1;for(;W--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const W=j.params[0];return W===1&&(this._curAttrData.bg|=536870912),W!==2&&W!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,W,B,F=!1,te=!1){const ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);ie.replaceCells(W,B,this._activeBuffer.getNullCell(this._eraseAttrData()),te),F&&(ie.isWrapped=!1)}_resetBufferLine(j,W=!1){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);B&&(B.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),W),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),B.isWrapped=!1)}eraseInDisplay(j,W=!1){let B;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,W);B<this._bufferService.rows;B++)this._resetBufferLine(B,W);this._dirtyRowTracker.markDirty(B);break;case 1:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B,0,this._activeBuffer.x+1,!0,W),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(B+1).isWrapped=!1);B--;)this._resetBufferLine(B,W);this._dirtyRowTracker.markDirty(0);break;case 2:for(B=this._bufferService.rows,this._dirtyRowTracker.markDirty(B-1);B--;)this._resetBufferLine(B,W);this._dirtyRowTracker.markDirty(0);break;case 3:const F=this._activeBuffer.lines.length-this._bufferService.rows;F>0&&(this._activeBuffer.lines.trimStart(F),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-F,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-F,0),this._onScroll.fire(0))}return!0}eraseInLine(j,W=!1){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,W);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,W);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,W)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let W=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y,F=this._bufferService.rows-1-this._activeBuffer.scrollBottom,te=this._bufferService.rows-1+this._activeBuffer.ybase-F+1;for(;W--;)this._activeBuffer.lines.splice(te-1,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(j){this._restrictCursor();let W=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y;let F;for(F=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-F;W--;)this._activeBuffer.lines.splice(B,1),this._activeBuffer.lines.splice(F,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(j){this._restrictCursor();const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return W&&(W.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return W&&(W.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let W=j.params[0]||1;for(;W--;)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(j){let W=j.params[0]||1;for(;W--;)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(a.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=j.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);F.deleteCells(0,W,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=j.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);F.insertCells(0,W,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=j.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);F.insertCells(this._activeBuffer.x,W,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=j.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);F.deleteCells(this._activeBuffer.x,W,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return W&&(W.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){const W=this._parser.precedingJoinState;if(!W)return!0;const B=j.params[0]||1,F=w.UnicodeService.extractWidth(W),te=this._activeBuffer.x-F,ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(te),he=new Uint32Array(ie.length*B);let ge=0;for(let q=0;q<ie.length;){const re=ie.codePointAt(q)||0;he[ge++]=re,q+=re>65535?2:1}let J=ge;for(let q=1;q<B;++q)he.copyWithin(J,0,ge),J+=ge;return this.print(he,0,J),!0}sendDeviceAttributesPrimary(j){return j.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(l.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(l.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(l.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(l.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(l.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let W=0;W<j.length;W++)switch(j.params[W]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let W=0;W<j.length;W++)switch(j.params[W]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,S.DEFAULT_CHARSET),this._charsetService.setgCharset(1,S.DEFAULT_CHARSET),this._charsetService.setgCharset(2,S.DEFAULT_CHARSET),this._charsetService.setgCharset(3,S.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(j){for(let W=0;W<j.length;W++)switch(j.params[W]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let W=0;W<j.length;W++)switch(j.params[W]){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(),j.params[W]===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(j,W){const B=this._coreService.decPrivateModes,{activeProtocol:F,activeEncoding:te}=this._coreMouseService,ie=this._coreService,{buffers:he,cols:ge}=this._bufferService,{active:J,alt:q}=he,re=this._optionsService.rawOptions,_e=Re=>Re?1:2,Ce=j.params[0];return we=Ce,Be=W?Ce===2?4:Ce===4?_e(ie.modes.insertMode):Ce===12?3:Ce===20?_e(re.convertEol):0:Ce===1?_e(B.applicationCursorKeys):Ce===3?re.windowOptions.setWinLines?ge===80?2:ge===132?1:0:0:Ce===6?_e(B.origin):Ce===7?_e(B.wraparound):Ce===8?3:Ce===9?_e(F==="X10"):Ce===12?_e(re.cursorBlink):Ce===25?_e(!ie.isCursorHidden):Ce===45?_e(B.reverseWraparound):Ce===66?_e(B.applicationKeypad):Ce===67?4:Ce===1e3?_e(F==="VT200"):Ce===1002?_e(F==="DRAG"):Ce===1003?_e(F==="ANY"):Ce===1004?_e(B.sendFocus):Ce===1005?4:Ce===1006?_e(te==="SGR"):Ce===1015?4:Ce===1016?_e(te==="SGR_PIXELS"):Ce===1048?1:Ce===47||Ce===1047||Ce===1049?_e(J===q):Ce===2004?_e(B.bracketedPasteMode):0,ie.triggerDataEvent(`${l.C0.ESC}[${W?"":"?"}${we};${Be}$y`),!0;var we,Be}_updateAttrColor(j,W,B,F,te){return W===2?(j|=50331648,j&=-16777216,j|=b.AttributeData.fromColorRGB([B,F,te])):W===5&&(j&=-50331904,j|=33554432|255&B),j}_extractColor(j,W,B){const F=[0,0,-1,0,0,0];let te=0,ie=0;do{if(F[ie+te]=j.params[W+ie],j.hasSubParams(W+ie)){const he=j.getSubParams(W+ie);let ge=0;do F[1]===5&&(te=1),F[ie+ge+1+te]=he[ge];while(++ge<he.length&&ge+ie+1+te<F.length);break}if(F[1]===5&&ie+te>=2||F[1]===2&&ie+te>=5)break;F[1]&&(te=1)}while(++ie+W<j.length&&ie+te<F.length);for(let he=2;he<F.length;++he)F[he]===-1&&(F[he]=0);switch(F[0]){case 38:B.fg=this._updateAttrColor(B.fg,F[1],F[3],F[4],F[5]);break;case 48:B.bg=this._updateAttrColor(B.bg,F[1],F[3],F[4],F[5]);break;case 58:B.extended=B.extended.clone(),B.extended.underlineColor=this._updateAttrColor(B.extended.underlineColor,F[1],F[3],F[4],F[5])}return ie}_processUnderline(j,W){W.extended=W.extended.clone(),(!~j||j>5)&&(j=1),W.extended.underlineStyle=j,W.fg|=268435456,j===0&&(W.fg&=-268435457),W.updateExtended()}_processSGR0(j){j.fg=a.DEFAULT_ATTR_DATA.fg,j.bg=a.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const W=j.length;let B;const F=this._curAttrData;for(let te=0;te<W;te++)B=j.params[te],B>=30&&B<=37?(F.fg&=-50331904,F.fg|=16777216|B-30):B>=40&&B<=47?(F.bg&=-50331904,F.bg|=16777216|B-40):B>=90&&B<=97?(F.fg&=-50331904,F.fg|=16777224|B-90):B>=100&&B<=107?(F.bg&=-50331904,F.bg|=16777224|B-100):B===0?this._processSGR0(F):B===1?F.fg|=134217728:B===3?F.bg|=67108864:B===4?(F.fg|=268435456,this._processUnderline(j.hasSubParams(te)?j.getSubParams(te)[0]:1,F)):B===5?F.fg|=536870912:B===7?F.fg|=67108864:B===8?F.fg|=1073741824:B===9?F.fg|=2147483648:B===2?F.bg|=134217728:B===21?this._processUnderline(2,F):B===22?(F.fg&=-134217729,F.bg&=-134217729):B===23?F.bg&=-67108865:B===24?(F.fg&=-268435457,this._processUnderline(0,F)):B===25?F.fg&=-536870913:B===27?F.fg&=-67108865:B===28?F.fg&=-1073741825:B===29?F.fg&=2147483647:B===39?(F.fg&=-67108864,F.fg|=16777215&a.DEFAULT_ATTR_DATA.fg):B===49?(F.bg&=-67108864,F.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):B===38||B===48||B===58?te+=this._extractColor(j,te,F):B===53?F.bg|=1073741824:B===55?F.bg&=-1073741825:B===59?(F.extended=F.extended.clone(),F.extended.underlineColor=-1,F.updateExtended()):B===100?(F.fg&=-67108864,F.fg|=16777215&a.DEFAULT_ATTR_DATA.fg,F.bg&=-67108864,F.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",B);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${l.C0.ESC}[0n`);break;case 6:const W=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[${W};${B}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const W=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[?${W};${B}R`)}return!0}softReset(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=a.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(j){const W=j.params[0]||1;switch(W){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 B=W%2==1;return this._optionsService.options.cursorBlink=B,!0}setScrollRegion(j){const W=j.params[0]||1;let B;return(j.length<2||(B=j.params[1])>this._bufferService.rows||B===0)&&(B=this._bufferService.rows),B>W&&(this._activeBuffer.scrollTop=W-1,this._activeBuffer.scrollBottom=B-1,this._setCursor(0,0)),!0}windowOptions(j){if(!H(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const W=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:W!==2&&this._onRequestWindowsOptionsReport.fire(z.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(z.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${l.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:W!==0&&W!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),W!==0&&W!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:W!==0&&W!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),W!==0&&W!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(j){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(j){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(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const W=[],B=j.split(";");for(;B.length>1;){const F=B.shift(),te=B.shift();if(/^\d+$/.exec(F)){const ie=parseInt(F);if(X(ie))if(te==="?")W.push({type:0,index:ie});else{const he=(0,L.parseColor)(te);he&&W.push({type:1,index:ie,color:he})}}}return W.length&&this._onColor.fire(W),!0}setHyperlink(j){const W=j.split(";");return!(W.length<2)&&(W[1]?this._createHyperlink(W[0],W[1]):!W[0]&&this._finishHyperlink())}_createHyperlink(j,W){this._getCurrentLinkId()&&this._finishHyperlink();const B=j.split(":");let F;const te=B.findIndex((ie=>ie.startsWith("id=")));return te!==-1&&(F=B[te].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:F,uri:W}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,W){const B=j.split(";");for(let F=0;F<B.length&&!(W>=this._specialColors.length);++F,++W)if(B[F]==="?")this._onColor.fire([{type:0,index:this._specialColors[W]}]);else{const te=(0,L.parseColor)(B[F]);te&&this._onColor.fire([{type:1,index:this._specialColors[W],color:te}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const W=[],B=j.split(";");for(let F=0;F<B.length;++F)if(/^\d+$/.exec(B[F])){const te=parseInt(B[F]);X(te)&&W.push({type:2,index:te})}return W.length&&this._onColor.fire(W),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){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,S.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset(O[j[0]],S.CHARSETS[j[1]]||S.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 j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,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=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new h.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let W=0;W<this._bufferService.rows;++W){const B=this._activeBuffer.ybase+this._activeBuffer.y+W,F=this._activeBuffer.lines.get(B);F&&(F.fill(j),F.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,W){const B=this._bufferService.buffer,F=this._optionsService.rawOptions;return(te=>(this._coreService.triggerDataEvent(`${l.C0.ESC}${te}${l.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${B.scrollTop+1};${B.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[F.cursorStyle]-(F.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,W){this._dirtyRowTracker.markRangeDirty(j,W)}}r.InputHandler=ne;let V=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,j){I>j&&(Y=I,I=j,j=Y),I<this.start&&(this.start=I),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(I){return 0<=I&&I<256}V=g([p(0,M.IBufferService)],V)},844:(P,r)=>{function d(g){for(const p of g)p.dispose();g.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const g of this._disposables)g.dispose();this._disposables.length=0}register(g){return this._disposables.push(g),g}unregister(g){const p=this._disposables.indexOf(g);p!==-1&&this._disposables.splice(p,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(g){this._isDisposed||g===this._value||(this._value?.dispose(),this._value=g)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},r.toDisposable=function(g){return{dispose:g}},r.disposeArray=d,r.getDisposeArrayDisposable=function(g){return{dispose:()=>d(g)}}},1505:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class d{constructor(){this._data={}}set(p,l,S){this._data[p]||(this._data[p]={}),this._data[p][l]=S}get(p,l){return this._data[p]?this._data[p][l]:void 0}clear(){this._data={}}}r.TwoKeyMap=d,r.FourKeyMap=class{constructor(){this._data=new d}set(g,p,l,S,x){this._data.get(g,p)||this._data.set(g,p,new d),this._data.get(g,p).set(l,S,x)}get(g,p,l,S){return this._data.get(g,p)?.get(l,S)}clear(){this._data.clear()}}},6114:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof process<"u"&&"title"in process;const d=r.isNode?"node":navigator.userAgent,g=r.isNode?"node":navigator.platform;r.isFirefox=d.includes("Firefox"),r.isLegacyEdge=d.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(d),r.getSafariVersion=function(){if(!r.isSafari)return 0;const p=d.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(g),r.isIpad=g==="iPad",r.isIphone=g==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(g),r.isLinux=g.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(d)},6106:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let d=0;r.SortedList=class{constructor(g){this._getKey=g,this._array=[]}clear(){this._array.length=0}insert(g){this._array.length!==0?(d=this._search(this._getKey(g)),this._array.splice(d,0,g)):this._array.push(g)}delete(g){if(this._array.length===0)return!1;const p=this._getKey(g);if(p===void 0||(d=this._search(p),d===-1)||this._getKey(this._array[d])!==p)return!1;do if(this._array[d]===g)return this._array.splice(d,1),!0;while(++d<this._array.length&&this._getKey(this._array[d])===p);return!1}*getKeyIterator(g){if(this._array.length!==0&&(d=this._search(g),!(d<0||d>=this._array.length)&&this._getKey(this._array[d])===g))do yield this._array[d];while(++d<this._array.length&&this._getKey(this._array[d])===g)}forEachByKey(g,p){if(this._array.length!==0&&(d=this._search(g),!(d<0||d>=this._array.length)&&this._getKey(this._array[d])===g))do p(this._array[d]);while(++d<this._array.length&&this._getKey(this._array[d])===g)}values(){return[...this._array].values()}_search(g){let p=0,l=this._array.length-1;for(;l>=p;){let S=p+l>>1;const x=this._getKey(this._array[S]);if(x>g)l=S-1;else{if(!(x<g)){for(;S>0&&this._getKey(this._array[S-1])===g;)S--;return S}p=S+1}}return p}}},7226:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const g=d(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),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(x){this._idleCallback=void 0;let R=0,m=0,a=x.timeRemaining(),u=0;for(;this._i<this._tasks.length;){if(R=Date.now(),this._tasks[this._i]()||this._i++,R=Math.max(1,Date.now()-R),m=Math.max(R,m),u=x.timeRemaining(),1.5*m>u)return a-R<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-R))}ms`),void this._start();a=u}this.clear()}}class l extends p{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const R=Date.now()+x;return{timeRemaining:()=>Math.max(0,R-Date.now())}}}r.PriorityTaskQueue=l,r.IdleTaskQueue=!g.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(S){return requestIdleCallback(S)}_cancelCallback(S){cancelIdleCallback(S)}}:l,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(S){this._queue.clear(),this._queue.enqueue(S)}flush(){this._queue.flush()}}},9282:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const g=d(643);r.updateWindowsModeWrappedState=function(p){const l=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),S=l?.get(p.cols-1),x=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);x&&S&&(x.isWrapped=S[g.CHAR_DATA_CODE_INDEX]!==g.NULL_CELL_CODE&&S[g.CHAR_DATA_CODE_INDEX]!==g.WHITESPACE_CELL_CODE)}},3734:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class d{constructor(){this.fg=0,this.bg=0,this.extended=new g}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new d;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}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}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}r.AttributeData=d;class g{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,S=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=S}clone(){return new g(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=g},9092:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const g=d(6349),p=d(7226),l=d(3734),S=d(8437),x=d(4634),R=d(511),m=d(643),a=d(4863),u=d(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(f,h,b){this._hasScrollback=f,this._optionsService=h,this._bufferService=b,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=S.DEFAULT_ATTR_DATA.clone(),this.savedCharset=u.DEFAULT_CHARSET,this.markers=[],this._nullCell=R.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]),this._whitespaceCell=R.CellData.fromCharData([0,m.WHITESPACE_CELL_CHAR,m.WHITESPACE_CELL_WIDTH,m.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new g.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(f){return f?(this._nullCell.fg=f.fg,this._nullCell.bg=f.bg,this._nullCell.extended=f.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new l.ExtendedAttrs),this._nullCell}getWhitespaceCell(f){return f?(this._whitespaceCell.fg=f.fg,this._whitespaceCell.bg=f.bg,this._whitespaceCell.extended=f.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new l.ExtendedAttrs),this._whitespaceCell}getBlankLine(f,h){return new S.BufferLine(this._bufferService.cols,this.getNullCell(f),h)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const f=this.ybase+this.y-this.ydisp;return f>=0&&f<this._rows}_getCorrectBufferLength(f){if(!this._hasScrollback)return f;const h=f+this._optionsService.rawOptions.scrollback;return h>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:h}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=S.DEFAULT_ATTR_DATA);let h=this._rows;for(;h--;)this.lines.push(this.getBlankLine(f))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new g.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(f,h){const b=this.getNullCell(S.DEFAULT_ATTR_DATA);let M=0;const w=this._getCorrectBufferLength(h);if(w>this.lines.maxLength&&(this.lines.maxLength=w),this.lines.length>0){if(this._cols<f)for(let y=0;y<this.lines.length;y++)M+=+this.lines.get(y).resize(f,b);let T=0;if(this._rows<h)for(let y=this._rows;y<h;y++)this.lines.length<h+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new S.BufferLine(f,b)):this.ybase>0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new S.BufferLine(f,b)));else for(let y=this._rows;y>h;y--)this.lines.length>h+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(w<this.lines.maxLength){const y=this.lines.length-w;y>0&&(this.lines.trimStart(y),this.ybase=Math.max(this.ybase-y,0),this.ydisp=Math.max(this.ydisp-y,0),this.savedY=Math.max(this.savedY-y,0)),this.lines.maxLength=w}this.x=Math.min(this.x,f-1),this.y=Math.min(this.y,h-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,f-1),this.scrollTop=0}if(this.scrollBottom=h-1,this._isReflowEnabled&&(this._reflow(f,h),this._cols>f))for(let T=0;T<this.lines.length;T++)M+=+this.lines.get(T).resize(f,b);this._cols=f,this._rows=h,this._memoryCleanupQueue.clear(),M>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let f=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,f=!1);let h=0;for(;this._memoryCleanupPosition<this.lines.length;)if(h+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),h>100)return!0;return f}get _isReflowEnabled(){const f=this._optionsService.rawOptions.windowsPty;return f&&f.buildNumber?this._hasScrollback&&f.backend==="conpty"&&f.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(f,h){this._cols!==f&&(f>this._cols?this._reflowLarger(f,h):this._reflowSmaller(f,h))}_reflowLarger(f,h){const b=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(S.DEFAULT_ATTR_DATA));if(b.length>0){const M=(0,x.reflowLargerCreateNewLayout)(this.lines,b);(0,x.reflowLargerApplyNewLayout)(this.lines,M.layout),this._reflowLargerAdjustViewport(f,h,M.countRemoved)}}_reflowLargerAdjustViewport(f,h,b){const M=this.getNullCell(S.DEFAULT_ATTR_DATA);let w=b;for(;w-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<h&&this.lines.push(new S.BufferLine(f,M))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-b,0)}_reflowSmaller(f,h){const b=this.getNullCell(S.DEFAULT_ATTR_DATA),M=[];let w=0;for(let T=this.lines.length-1;T>=0;T--){let y=this.lines.get(T);if(!y||!y.isWrapped&&y.getTrimmedLength()<=f)continue;const L=[y];for(;y.isWrapped&&T>0;)y=this.lines.get(--T),L.unshift(y);const O=this.ybase+this.y;if(O>=T&&O<T+L.length)continue;const U=L[L.length-1].getTrimmedLength(),H=(0,x.reflowSmallerGetNewLineLengths)(L,this._cols,f),z=H.length-L.length;let Y;Y=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+z):Math.max(0,this.lines.length-this.lines.maxLength+z);const ne=[];for(let B=0;B<z;B++){const F=this.getBlankLine(S.DEFAULT_ATTR_DATA,!0);ne.push(F)}ne.length>0&&(M.push({start:T+L.length+w,newLines:ne}),w+=ne.length),L.push(...ne);let V=H.length-1,X=H[V];X===0&&(V--,X=H[V]);let I=L.length-z-1,j=U;for(;I>=0;){const B=Math.min(j,X);if(L[V]===void 0)break;if(L[V].copyCellsFrom(L[I],j-B,X-B,B,!0),X-=B,X===0&&(V--,X=H[V]),j-=B,j===0){I--;const F=Math.max(I,0);j=(0,x.getWrappedLineTrimmedLength)(L,F,this._cols)}}for(let B=0;B<L.length;B++)H[B]<f&&L[B].setCell(H[B],b);let W=z-Y;for(;W-- >0;)this.ybase===0?this.y<h-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+w)-h&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+z,this.ybase+h-1)}if(M.length>0){const T=[],y=[];for(let V=0;V<this.lines.length;V++)y.push(this.lines.get(V));const L=this.lines.length;let O=L-1,U=0,H=M[U];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+w);let z=0;for(let V=Math.min(this.lines.maxLength-1,L+w-1);V>=0;V--)if(H&&H.start>O+z){for(let X=H.newLines.length-1;X>=0;X--)this.lines.set(V--,H.newLines[X]);V++,T.push({index:O+1,amount:H.newLines.length}),z+=H.newLines.length,H=M[++U]}else this.lines.set(V,y[O--]);let Y=0;for(let V=T.length-1;V>=0;V--)T[V].index+=Y,this.lines.onInsertEmitter.fire(T[V]),Y+=T[V].amount;const ne=Math.max(0,L+w-this.lines.maxLength);ne>0&&this.lines.onTrimEmitter.fire(ne)}}translateBufferLineToString(f,h,b=0,M){const w=this.lines.get(f);return w?w.translateToString(h,b,M):""}getWrappedRangeForLine(f){let h=f,b=f;for(;h>0&&this.lines.get(h).isWrapped;)h--;for(;b+1<this.lines.length&&this.lines.get(b+1).isWrapped;)b++;return{first:h,last:b}}setupTabStops(f){for(f!=null?this.tabs[f]||(f=this.prevStop(f)):(this.tabs={},f=0);f<this._cols;f+=this._optionsService.rawOptions.tabStopWidth)this.tabs[f]=!0}prevStop(f){for(f==null&&(f=this.x);!this.tabs[--f]&&f>0;);return f>=this._cols?this._cols-1:f<0?0:f}nextStop(f){for(f==null&&(f=this.x);!this.tabs[++f]&&f<this._cols;);return f>=this._cols?this._cols-1:f<0?0:f}clearMarkers(f){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].line===f&&(this.markers[h].dispose(),this.markers.splice(h--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].dispose(),this.markers.splice(f--,1);this._isClearing=!1}addMarker(f){const h=new a.Marker(f);return this.markers.push(h),h.register(this.lines.onTrim((b=>{h.line-=b,h.line<0&&h.dispose()}))),h.register(this.lines.onInsert((b=>{h.line>=b.index&&(h.line+=b.amount)}))),h.register(this.lines.onDelete((b=>{h.line>=b.index&&h.line<b.index+b.amount&&h.dispose(),h.line>b.index&&(h.line-=b.amount)}))),h.register(h.onDispose((()=>this._removeMarker(h)))),h}_removeMarker(f){this._isClearing||this.markers.splice(this.markers.indexOf(f),1)}}},8437:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const g=d(3734),p=d(511),l=d(643),S=d(482);r.DEFAULT_ATTR_DATA=Object.freeze(new g.AttributeData);let x=0;class R{constructor(a,u,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*a);const h=u||p.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]);for(let b=0;b<a;++b)this.setCell(b,h);this.length=a}get(a){const u=this._data[3*a+0],f=2097151&u;return[this._data[3*a+1],2097152&u?this._combined[a]:f?(0,S.stringFromCodePoint)(f):"",u>>22,2097152&u?this._combined[a].charCodeAt(this._combined[a].length-1):f]}set(a,u){this._data[3*a+1]=u[l.CHAR_DATA_ATTR_INDEX],u[l.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[a]=u[1],this._data[3*a+0]=2097152|a|u[l.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*a+0]=u[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[l.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(a){return this._data[3*a+0]>>22}hasWidth(a){return 12582912&this._data[3*a+0]}getFg(a){return this._data[3*a+1]}getBg(a){return this._data[3*a+2]}hasContent(a){return 4194303&this._data[3*a+0]}getCodePoint(a){const u=this._data[3*a+0];return 2097152&u?this._combined[a].charCodeAt(this._combined[a].length-1):2097151&u}isCombined(a){return 2097152&this._data[3*a+0]}getString(a){const u=this._data[3*a+0];return 2097152&u?this._combined[a]:2097151&u?(0,S.stringFromCodePoint)(2097151&u):""}isProtected(a){return 536870912&this._data[3*a+2]}loadCell(a,u){return x=3*a,u.content=this._data[x+0],u.fg=this._data[x+1],u.bg=this._data[x+2],2097152&u.content&&(u.combinedData=this._combined[a]),268435456&u.bg&&(u.extended=this._extendedAttrs[a]),u}setCell(a,u){2097152&u.content&&(this._combined[a]=u.combinedData),268435456&u.bg&&(this._extendedAttrs[a]=u.extended),this._data[3*a+0]=u.content,this._data[3*a+1]=u.fg,this._data[3*a+2]=u.bg}setCellFromCodepoint(a,u,f,h){268435456&h.bg&&(this._extendedAttrs[a]=h.extended),this._data[3*a+0]=u|f<<22,this._data[3*a+1]=h.fg,this._data[3*a+2]=h.bg}addCodepointToCell(a,u,f){let h=this._data[3*a+0];2097152&h?this._combined[a]+=(0,S.stringFromCodePoint)(u):2097151&h?(this._combined[a]=(0,S.stringFromCodePoint)(2097151&h)+(0,S.stringFromCodePoint)(u),h&=-2097152,h|=2097152):h=u|4194304,f&&(h&=-12582913,h|=f<<22),this._data[3*a+0]=h}insertCells(a,u,f){if((a%=this.length)&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a-1,0,1,f),u<this.length-a){const h=new p.CellData;for(let b=this.length-a-u-1;b>=0;--b)this.setCell(a+u+b,this.loadCell(a+b,h));for(let b=0;b<u;++b)this.setCell(a+b,f)}else for(let h=a;h<this.length;++h)this.setCell(h,f);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,f)}deleteCells(a,u,f){if(a%=this.length,u<this.length-a){const h=new p.CellData;for(let b=0;b<this.length-a-u;++b)this.setCell(a+b,this.loadCell(a+u+b,h));for(let b=this.length-u;b<this.length;++b)this.setCell(b,f)}else for(let h=a;h<this.length;++h)this.setCell(h,f);a&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a-1,0,1,f),this.getWidth(a)!==0||this.hasContent(a)||this.setCellFromCodepoint(a,0,1,f)}replaceCells(a,u,f,h=!1){if(h)for(a&&this.getWidth(a-1)===2&&!this.isProtected(a-1)&&this.setCellFromCodepoint(a-1,0,1,f),u<this.length&&this.getWidth(u-1)===2&&!this.isProtected(u)&&this.setCellFromCodepoint(u,0,1,f);a<u&&a<this.length;)this.isProtected(a)||this.setCell(a,f),a++;else for(a&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a-1,0,1,f),u<this.length&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u,0,1,f);a<u&&a<this.length;)this.setCell(a++,f)}resize(a,u){if(a===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const f=3*a;if(a>this.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const h=new Uint32Array(f);h.set(this._data),this._data=h}for(let h=this.length;h<a;++h)this.setCell(h,u)}else{this._data=this._data.subarray(0,f);const h=Object.keys(this._combined);for(let M=0;M<h.length;M++){const w=parseInt(h[M],10);w>=a&&delete this._combined[w]}const b=Object.keys(this._extendedAttrs);for(let M=0;M<b.length;M++){const w=parseInt(b[M],10);w>=a&&delete this._extendedAttrs[w]}}return this.length=a,4*f*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const a=new Uint32Array(this._data.length);return a.set(this._data),this._data=a,1}return 0}fill(a,u=!1){if(u)for(let f=0;f<this.length;++f)this.isProtected(f)||this.setCell(f,a);else{this._combined={},this._extendedAttrs={};for(let f=0;f<this.length;++f)this.setCell(f,a)}}copyFrom(a){this.length!==a.length?this._data=new Uint32Array(a._data):this._data.set(a._data),this.length=a.length,this._combined={};for(const u in a._combined)this._combined[u]=a._combined[u];this._extendedAttrs={};for(const u in a._extendedAttrs)this._extendedAttrs[u]=a._extendedAttrs[u];this.isWrapped=a.isWrapped}clone(){const a=new R(0);a._data=new Uint32Array(this._data),a.length=this.length;for(const u in this._combined)a._combined[u]=this._combined[u];for(const u in this._extendedAttrs)a._extendedAttrs[u]=this._extendedAttrs[u];return a.isWrapped=this.isWrapped,a}getTrimmedLength(){for(let a=this.length-1;a>=0;--a)if(4194303&this._data[3*a+0])return a+(this._data[3*a+0]>>22);return 0}getNoBgTrimmedLength(){for(let a=this.length-1;a>=0;--a)if(4194303&this._data[3*a+0]||50331648&this._data[3*a+2])return a+(this._data[3*a+0]>>22);return 0}copyCellsFrom(a,u,f,h,b){const M=a._data;if(b)for(let T=h-1;T>=0;T--){for(let y=0;y<3;y++)this._data[3*(f+T)+y]=M[3*(u+T)+y];268435456&M[3*(u+T)+2]&&(this._extendedAttrs[f+T]=a._extendedAttrs[u+T])}else for(let T=0;T<h;T++){for(let y=0;y<3;y++)this._data[3*(f+T)+y]=M[3*(u+T)+y];268435456&M[3*(u+T)+2]&&(this._extendedAttrs[f+T]=a._extendedAttrs[u+T])}const w=Object.keys(a._combined);for(let T=0;T<w.length;T++){const y=parseInt(w[T],10);y>=u&&(this._combined[y-u+f]=a._combined[y])}}translateToString(a,u,f,h){u=u??0,f=f??this.length,a&&(f=Math.min(f,this.getTrimmedLength())),h&&(h.length=0);let b="";for(;u<f;){const M=this._data[3*u+0],w=2097151&M,T=2097152&M?this._combined[u]:w?(0,S.stringFromCodePoint)(w):l.WHITESPACE_CELL_CHAR;if(b+=T,h)for(let y=0;y<T.length;++y)h.push(u);u+=M>>22||1}return h&&h.push(u),b}}r.BufferLine=R},4841:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(d,g){if(d.start.y>d.end.y)throw new Error(`Buffer range end (${d.end.x}, ${d.end.y}) cannot be before start (${d.start.x}, ${d.start.y})`);return g*(d.end.y-d.start.y)+(d.end.x-d.start.x+1)}},4634:(P,r)=>{function d(g,p,l){if(p===g.length-1)return g[p].getTrimmedLength();const S=!g[p].hasContent(l-1)&&g[p].getWidth(l-1)===1,x=g[p+1].getWidth(0)===2;return S&&x?l-1:l}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(g,p,l,S,x){const R=[];for(let m=0;m<g.length-1;m++){let a=m,u=g.get(++a);if(!u.isWrapped)continue;const f=[g.get(m)];for(;a<g.length&&u.isWrapped;)f.push(u),u=g.get(++a);if(S>=m&&S<a){m+=f.length-1;continue}let h=0,b=d(f,h,p),M=1,w=0;for(;M<f.length;){const y=d(f,M,p),L=y-w,O=l-b,U=Math.min(L,O);f[h].copyCellsFrom(f[M],w,b,U,!1),b+=U,b===l&&(h++,b=0),w+=U,w===y&&(M++,w=0),b===0&&h!==0&&f[h-1].getWidth(l-1)===2&&(f[h].copyCellsFrom(f[h-1],l-1,b++,1,!1),f[h-1].setCell(l-1,x))}f[h].replaceCells(b,l,x);let T=0;for(let y=f.length-1;y>0&&(y>h||f[y].getTrimmedLength()===0);y--)T++;T>0&&(R.push(m+f.length-T),R.push(T)),m+=f.length-1}return R},r.reflowLargerCreateNewLayout=function(g,p){const l=[];let S=0,x=p[S],R=0;for(let m=0;m<g.length;m++)if(x===m){const a=p[++S];g.onDeleteEmitter.fire({index:m-R,amount:a}),m+=a-1,R+=a,x=p[++S]}else l.push(m);return{layout:l,countRemoved:R}},r.reflowLargerApplyNewLayout=function(g,p){const l=[];for(let S=0;S<p.length;S++)l.push(g.get(p[S]));for(let S=0;S<l.length;S++)g.set(S,l[S]);g.length=p.length},r.reflowSmallerGetNewLineLengths=function(g,p,l){const S=[],x=g.map(((u,f)=>d(g,f,p))).reduce(((u,f)=>u+f));let R=0,m=0,a=0;for(;a<x;){if(x-a<l){S.push(x-a);break}R+=l;const u=d(g,m,p);R>u&&(R-=u,m++);const f=g[m].getWidth(R-1)===2;f&&R--;const h=f?l-1:l;S.push(h),a+=h}return S},r.getWrappedLineTrimmedLength=d},5295:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const g=d(8460),p=d(844),l=d(9092);class S extends p.Disposable{constructor(R,m){super(),this._optionsService=R,this._bufferService=m,this._onBufferActivate=this.register(new g.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 l.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new l.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(R){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(R),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(R,m){this._normal.resize(R,m),this._alt.resize(R,m),this.setupTabStops(R)}setupTabStops(R){this._normal.setupTabStops(R),this._alt.setupTabStops(R)}}r.BufferSet=S},511:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const g=d(482),p=d(643),l=d(3734);class S extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(R){const m=new S;return m.setFromCharData(R),m}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,g.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(R){this.fg=R[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let m=!1;if(R[p.CHAR_DATA_CHAR_INDEX].length>2)m=!0;else if(R[p.CHAR_DATA_CHAR_INDEX].length===2){const a=R[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=a&&a<=56319){const u=R[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=u&&u<=57343?this.content=1024*(a-55296)+u-56320+65536|R[p.CHAR_DATA_WIDTH_INDEX]<<22:m=!0}else m=!0}else this.content=R[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|R[p.CHAR_DATA_WIDTH_INDEX]<<22;m&&(this.combinedData=R[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|R[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=S},643:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const g=d(8460),p=d(844);class l{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=l._nextId++,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}r.Marker=l,l._nextId=1},7116:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.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:"≥","{":"π","|":"≠","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(P,r)=>{var d,g,p;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,(function(l){l.NUL="\0",l.SOH="",l.STX="",l.ETX="",l.EOT="",l.ENQ="",l.ACK="",l.BEL="\x07",l.BS="\b",l.HT=" ",l.LF=`
16
- `,l.VT="\v",l.FF="\f",l.CR="\r",l.SO="",l.SI="",l.DLE="",l.DC1="",l.DC2="",l.DC3="",l.DC4="",l.NAK="",l.SYN="",l.ETB="",l.CAN="",l.EM="",l.SUB="",l.ESC="\x1B",l.FS="",l.GS="",l.RS="",l.US="",l.SP=" ",l.DEL=""})(d||(r.C0=d={})),(function(l){l.PAD="€",l.HOP="",l.BPH="‚",l.NBH="ƒ",l.IND="„",l.NEL="…",l.SSA="†",l.ESA="‡",l.HTS="ˆ",l.HTJ="‰",l.VTS="Š",l.PLD="‹",l.PLU="Œ",l.RI="",l.SS2="Ž",l.SS3="",l.DCS="",l.PU1="‘",l.PU2="’",l.STS="“",l.CCH="”",l.MW="•",l.SPA="–",l.EPA="—",l.SOS="˜",l.SGCI="™",l.SCI="š",l.CSI="›",l.ST="œ",l.OSC="",l.PM="ž",l.APC="Ÿ"})(g||(r.C1=g={})),(function(l){l.ST=`${d.ESC}\\`})(p||(r.C1_ESCAPED=p={}))},7399:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const g=d(2584),p={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:["'",'"']};r.evaluateKeyboardEvent=function(l,S,x,R){const m={type:0,cancel:!1,key:void 0},a=(l.shiftKey?1:0)|(l.altKey?2:0)|(l.ctrlKey?4:0)|(l.metaKey?8:0);switch(l.keyCode){case 0:l.key==="UIKeyInputUpArrow"?m.key=S?g.C0.ESC+"OA":g.C0.ESC+"[A":l.key==="UIKeyInputLeftArrow"?m.key=S?g.C0.ESC+"OD":g.C0.ESC+"[D":l.key==="UIKeyInputRightArrow"?m.key=S?g.C0.ESC+"OC":g.C0.ESC+"[C":l.key==="UIKeyInputDownArrow"&&(m.key=S?g.C0.ESC+"OB":g.C0.ESC+"[B");break;case 8:m.key=l.ctrlKey?"\b":g.C0.DEL,l.altKey&&(m.key=g.C0.ESC+m.key);break;case 9:if(l.shiftKey){m.key=g.C0.ESC+"[Z";break}m.key=g.C0.HT,m.cancel=!0;break;case 13:m.key=l.altKey?g.C0.ESC+g.C0.CR:g.C0.CR,m.cancel=!0;break;case 27:m.key=g.C0.ESC,l.altKey&&(m.key=g.C0.ESC+g.C0.ESC),m.cancel=!0;break;case 37:if(l.metaKey)break;a?(m.key=g.C0.ESC+"[1;"+(a+1)+"D",m.key===g.C0.ESC+"[1;3D"&&(m.key=g.C0.ESC+(x?"b":"[1;5D"))):m.key=S?g.C0.ESC+"OD":g.C0.ESC+"[D";break;case 39:if(l.metaKey)break;a?(m.key=g.C0.ESC+"[1;"+(a+1)+"C",m.key===g.C0.ESC+"[1;3C"&&(m.key=g.C0.ESC+(x?"f":"[1;5C"))):m.key=S?g.C0.ESC+"OC":g.C0.ESC+"[C";break;case 38:if(l.metaKey)break;a?(m.key=g.C0.ESC+"[1;"+(a+1)+"A",x||m.key!==g.C0.ESC+"[1;3A"||(m.key=g.C0.ESC+"[1;5A")):m.key=S?g.C0.ESC+"OA":g.C0.ESC+"[A";break;case 40:if(l.metaKey)break;a?(m.key=g.C0.ESC+"[1;"+(a+1)+"B",x||m.key!==g.C0.ESC+"[1;3B"||(m.key=g.C0.ESC+"[1;5B")):m.key=S?g.C0.ESC+"OB":g.C0.ESC+"[B";break;case 45:l.shiftKey||l.ctrlKey||(m.key=g.C0.ESC+"[2~");break;case 46:m.key=a?g.C0.ESC+"[3;"+(a+1)+"~":g.C0.ESC+"[3~";break;case 36:m.key=a?g.C0.ESC+"[1;"+(a+1)+"H":S?g.C0.ESC+"OH":g.C0.ESC+"[H";break;case 35:m.key=a?g.C0.ESC+"[1;"+(a+1)+"F":S?g.C0.ESC+"OF":g.C0.ESC+"[F";break;case 33:l.shiftKey?m.type=2:l.ctrlKey?m.key=g.C0.ESC+"[5;"+(a+1)+"~":m.key=g.C0.ESC+"[5~";break;case 34:l.shiftKey?m.type=3:l.ctrlKey?m.key=g.C0.ESC+"[6;"+(a+1)+"~":m.key=g.C0.ESC+"[6~";break;case 112:m.key=a?g.C0.ESC+"[1;"+(a+1)+"P":g.C0.ESC+"OP";break;case 113:m.key=a?g.C0.ESC+"[1;"+(a+1)+"Q":g.C0.ESC+"OQ";break;case 114:m.key=a?g.C0.ESC+"[1;"+(a+1)+"R":g.C0.ESC+"OR";break;case 115:m.key=a?g.C0.ESC+"[1;"+(a+1)+"S":g.C0.ESC+"OS";break;case 116:m.key=a?g.C0.ESC+"[15;"+(a+1)+"~":g.C0.ESC+"[15~";break;case 117:m.key=a?g.C0.ESC+"[17;"+(a+1)+"~":g.C0.ESC+"[17~";break;case 118:m.key=a?g.C0.ESC+"[18;"+(a+1)+"~":g.C0.ESC+"[18~";break;case 119:m.key=a?g.C0.ESC+"[19;"+(a+1)+"~":g.C0.ESC+"[19~";break;case 120:m.key=a?g.C0.ESC+"[20;"+(a+1)+"~":g.C0.ESC+"[20~";break;case 121:m.key=a?g.C0.ESC+"[21;"+(a+1)+"~":g.C0.ESC+"[21~";break;case 122:m.key=a?g.C0.ESC+"[23;"+(a+1)+"~":g.C0.ESC+"[23~";break;case 123:m.key=a?g.C0.ESC+"[24;"+(a+1)+"~":g.C0.ESC+"[24~";break;default:if(!l.ctrlKey||l.shiftKey||l.altKey||l.metaKey)if(x&&!R||!l.altKey||l.metaKey)!x||l.altKey||l.ctrlKey||l.shiftKey||!l.metaKey?l.key&&!l.ctrlKey&&!l.altKey&&!l.metaKey&&l.keyCode>=48&&l.key.length===1?m.key=l.key:l.key&&l.ctrlKey&&(l.key==="_"&&(m.key=g.C0.US),l.key==="@"&&(m.key=g.C0.NUL)):l.keyCode===65&&(m.type=1);else{const u=p[l.keyCode],f=u?.[l.shiftKey?1:0];if(f)m.key=g.C0.ESC+f;else if(l.keyCode>=65&&l.keyCode<=90){const h=l.ctrlKey?l.keyCode-64:l.keyCode+32;let b=String.fromCharCode(h);l.shiftKey&&(b=b.toUpperCase()),m.key=g.C0.ESC+b}else if(l.keyCode===32)m.key=g.C0.ESC+(l.ctrlKey?g.C0.NUL:" ");else if(l.key==="Dead"&&l.code.startsWith("Key")){let h=l.code.slice(3,4);l.shiftKey||(h=h.toLowerCase()),m.key=g.C0.ESC+h,m.cancel=!0}}else l.keyCode>=65&&l.keyCode<=90?m.key=String.fromCharCode(l.keyCode-64):l.keyCode===32?m.key=g.C0.NUL:l.keyCode>=51&&l.keyCode<=55?m.key=String.fromCharCode(l.keyCode-51+27):l.keyCode===56?m.key=g.C0.DEL:l.keyCode===219?m.key=g.C0.ESC:l.keyCode===220?m.key=g.C0.FS:l.keyCode===221&&(m.key=g.C0.GS)}return m}},482:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(d){return d>65535?(d-=65536,String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):String.fromCharCode(d)},r.utf32ToString=function(d,g=0,p=d.length){let l="";for(let S=g;S<p;++S){let x=d[S];x>65535?(x-=65536,l+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):l+=String.fromCharCode(x)}return l},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(d,g){const p=d.length;if(!p)return 0;let l=0,S=0;if(this._interim){const x=d.charCodeAt(S++);56320<=x&&x<=57343?g[l++]=1024*(this._interim-55296)+x-56320+65536:(g[l++]=this._interim,g[l++]=x),this._interim=0}for(let x=S;x<p;++x){const R=d.charCodeAt(x);if(55296<=R&&R<=56319){if(++x>=p)return this._interim=R,l;const m=d.charCodeAt(x);56320<=m&&m<=57343?g[l++]=1024*(R-55296)+m-56320+65536:(g[l++]=R,g[l++]=m)}else R!==65279&&(g[l++]=R)}return l}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(d,g){const p=d.length;if(!p)return 0;let l,S,x,R,m=0,a=0,u=0;if(this.interim[0]){let b=!1,M=this.interim[0];M&=(224&M)==192?31:(240&M)==224?15:7;let w,T=0;for(;(w=63&this.interim[++T])&&T<4;)M<<=6,M|=w;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=y-T;for(;u<L;){if(u>=p)return 0;if(w=d[u++],(192&w)!=128){u--,b=!0;break}this.interim[T++]=w,M<<=6,M|=63&w}b||(y===2?M<128?u--:g[m++]=M:y===3?M<2048||M>=55296&&M<=57343||M===65279||(g[m++]=M):M<65536||M>1114111||(g[m++]=M)),this.interim.fill(0)}const f=p-4;let h=u;for(;h<p;){for(;!(!(h<f)||128&(l=d[h])||128&(S=d[h+1])||128&(x=d[h+2])||128&(R=d[h+3]));)g[m++]=l,g[m++]=S,g[m++]=x,g[m++]=R,h+=4;if(l=d[h++],l<128)g[m++]=l;else if((224&l)==192){if(h>=p)return this.interim[0]=l,m;if(S=d[h++],(192&S)!=128){h--;continue}if(a=(31&l)<<6|63&S,a<128){h--;continue}g[m++]=a}else if((240&l)==224){if(h>=p)return this.interim[0]=l,m;if(S=d[h++],(192&S)!=128){h--;continue}if(h>=p)return this.interim[0]=l,this.interim[1]=S,m;if(x=d[h++],(192&x)!=128){h--;continue}if(a=(15&l)<<12|(63&S)<<6|63&x,a<2048||a>=55296&&a<=57343||a===65279)continue;g[m++]=a}else if((248&l)==240){if(h>=p)return this.interim[0]=l,m;if(S=d[h++],(192&S)!=128){h--;continue}if(h>=p)return this.interim[0]=l,this.interim[1]=S,m;if(x=d[h++],(192&x)!=128){h--;continue}if(h>=p)return this.interim[0]=l,this.interim[1]=S,this.interim[2]=x,m;if(R=d[h++],(192&R)!=128){h--;continue}if(a=(7&l)<<18|(63&S)<<12|(63&x)<<6|63&R,a<65536||a>1114111)continue;g[m++]=a}}return m}}},225:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const g=d(1480),p=[[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]],l=[[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 S;r.UnicodeV6=class{constructor(){if(this.version="6",!S){S=new Uint8Array(65536),S.fill(1),S[0]=0,S.fill(0,1,32),S.fill(0,127,160),S.fill(2,4352,4448),S[9001]=2,S[9002]=2,S.fill(2,11904,42192),S[12351]=1,S.fill(2,44032,55204),S.fill(2,63744,64256),S.fill(2,65040,65050),S.fill(2,65072,65136),S.fill(2,65280,65377),S.fill(2,65504,65511);for(let x=0;x<p.length;++x)S.fill(0,p[x][0],p[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?S[x]:(function(R,m){let a,u=0,f=m.length-1;if(R<m[0][0]||R>m[f][1])return!1;for(;f>=u;)if(a=u+f>>1,R>m[a][1])u=a+1;else{if(!(R<m[a][0]))return!0;f=a-1}return!1})(x,l)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,R){let m=this.wcwidth(x),a=m===0&&R!==0;if(a){const u=g.UnicodeService.extractWidth(R);u===0?a=!1:u>m&&(m=u)}return g.UnicodeService.createPropertyValue(0,m,a)}}},5981:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const g=d(8460),p=d(844);class l extends p.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new g.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,R){if(R!==void 0&&this._syncCalls>R)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let m;for(this._isSyncWriting=!0;m=this._writeBuffer.shift();){this._action(m);const a=this._callbacks.shift();a&&a()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,R){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+=x.length,this._writeBuffer.push(x),this._callbacks.push(R),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(R)}_innerWrite(x=0,R=!0){const m=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const a=this._writeBuffer[this._bufferOffset],u=this._action(a,R);if(u){const h=b=>Date.now()-m>=12?setTimeout((()=>this._innerWrite(0,b))):this._innerWrite(m,b);return void u.catch((b=>(queueMicrotask((()=>{throw b})),Promise.resolve(!1)))).then(h)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=a.length,Date.now()-m>=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()}}r.WriteBuffer=l},5941:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const d=/^([\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})$/,g=/^[\da-f]+$/;function p(l,S){const x=l.toString(16),R=x.length<2?"0"+x:x;switch(S){case 4:return x[0];case 8:return R;case 12:return(R+R).slice(0,3);default:return R+R}}r.parseColor=function(l){if(!l)return;let S=l.toLowerCase();if(S.indexOf("rgb:")===0){S=S.slice(4);const x=d.exec(S);if(x){const R=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/R*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/R*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/R*255)]}}else if(S.indexOf("#")===0&&(S=S.slice(1),g.exec(S)&&[3,6,9,12].includes(S.length))){const x=S.length/3,R=[0,0,0];for(let m=0;m<3;++m){const a=parseInt(S.slice(x*m,x*m+x),16);R[m]=x===1?a<<4:x===2?a:x===3?a>>4:a>>8}return R}},r.toRgbString=function(l,S=16){const[x,R,m]=l;return`rgb:${p(x,S)}/${p(R,S)}/${p(m,S)}`}},5770:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const g=d(482),p=d(8742),l=d(5770),S=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=S,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=S}registerHandler(R,m){this._handlers[R]===void 0&&(this._handlers[R]=[]);const a=this._handlers[R];return a.push(m),{dispose:()=>{const u=a.indexOf(m);u!==-1&&a.splice(u,1)}}}clearHandler(R){this._handlers[R]&&delete this._handlers[R]}setHandlerFallback(R){this._handlerFb=R}reset(){if(this._active.length)for(let R=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;R>=0;--R)this._active[R].unhook(!1);this._stack.paused=!1,this._active=S,this._ident=0}hook(R,m){if(this.reset(),this._ident=R,this._active=this._handlers[R]||S,this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].hook(m);else this._handlerFb(this._ident,"HOOK",m)}put(R,m,a){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(R,m,a);else this._handlerFb(this._ident,"PUT",(0,g.utf32ToString)(R,m,a))}unhook(R,m=!0){if(this._active.length){let a=!1,u=this._active.length-1,f=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,a=m,f=this._stack.fallThrough,this._stack.paused=!1),!f&&a===!1){for(;u>=0&&(a=this._active[u].unhook(R),a!==!0);u--)if(a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,a;u--}for(;u>=0;u--)if(a=this._active[u].unhook(!1),a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,a}else this._handlerFb(this._ident,"UNHOOK",R);this._active=S,this._ident=0}};const x=new p.Params;x.addParam(0),r.DcsHandler=class{constructor(R){this._handler=R,this._data="",this._params=x,this._hitLimit=!1}hook(R){this._params=R.length>1||R.params[0]?R.clone():x,this._data="",this._hitLimit=!1}put(R,m,a){this._hitLimit||(this._data+=(0,g.utf32ToString)(R,m,a),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(R){let m=!1;if(this._hitLimit)m=!1;else if(R&&(m=this._handler(this._data,this._params),m instanceof Promise))return m.then((a=>(this._params=x,this._data="",this._hitLimit=!1,a)));return this._params=x,this._data="",this._hitLimit=!1,m}}},2015:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const g=d(844),p=d(8742),l=d(6242),S=d(6351);class x{constructor(u){this.table=new Uint8Array(u)}setDefault(u,f){this.table.fill(u<<4|f)}add(u,f,h,b){this.table[f<<8|u]=h<<4|b}addMany(u,f,h,b){for(let M=0;M<u.length;M++)this.table[f<<8|u[M]]=h<<4|b}}r.TransitionTable=x;const R=160;r.VT500_TRANSITION_TABLE=(function(){const a=new x(4095),u=Array.apply(null,Array(256)).map(((T,y)=>y)),f=(T,y)=>u.slice(T,y),h=f(32,127),b=f(0,24);b.push(25),b.push.apply(b,f(28,32));const M=f(0,14);let w;for(w in a.setDefault(1,0),a.addMany(h,0,2,0),M)a.addMany([24,26,153,154],w,3,0),a.addMany(f(128,144),w,3,0),a.addMany(f(144,152),w,3,0),a.add(156,w,0,0),a.add(27,w,11,1),a.add(157,w,4,8),a.addMany([152,158,159],w,0,7),a.add(155,w,11,3),a.add(144,w,11,9);return a.addMany(b,0,3,0),a.addMany(b,1,3,1),a.add(127,1,0,1),a.addMany(b,8,0,8),a.addMany(b,3,3,3),a.add(127,3,0,3),a.addMany(b,4,3,4),a.add(127,4,0,4),a.addMany(b,6,3,6),a.addMany(b,5,3,5),a.add(127,5,0,5),a.addMany(b,2,3,2),a.add(127,2,0,2),a.add(93,1,4,8),a.addMany(h,8,5,8),a.add(127,8,5,8),a.addMany([156,27,24,26,7],8,6,0),a.addMany(f(28,32),8,0,8),a.addMany([88,94,95],1,0,7),a.addMany(h,7,0,7),a.addMany(b,7,0,7),a.add(156,7,0,0),a.add(127,7,0,7),a.add(91,1,11,3),a.addMany(f(64,127),3,7,0),a.addMany(f(48,60),3,8,4),a.addMany([60,61,62,63],3,9,4),a.addMany(f(48,60),4,8,4),a.addMany(f(64,127),4,7,0),a.addMany([60,61,62,63],4,0,6),a.addMany(f(32,64),6,0,6),a.add(127,6,0,6),a.addMany(f(64,127),6,0,0),a.addMany(f(32,48),3,9,5),a.addMany(f(32,48),5,9,5),a.addMany(f(48,64),5,0,6),a.addMany(f(64,127),5,7,0),a.addMany(f(32,48),4,9,5),a.addMany(f(32,48),1,9,2),a.addMany(f(32,48),2,9,2),a.addMany(f(48,127),2,10,0),a.addMany(f(48,80),1,10,0),a.addMany(f(81,88),1,10,0),a.addMany([89,90,92],1,10,0),a.addMany(f(96,127),1,10,0),a.add(80,1,11,9),a.addMany(b,9,0,9),a.add(127,9,0,9),a.addMany(f(28,32),9,0,9),a.addMany(f(32,48),9,9,12),a.addMany(f(48,60),9,8,10),a.addMany([60,61,62,63],9,9,10),a.addMany(b,11,0,11),a.addMany(f(32,128),11,0,11),a.addMany(f(28,32),11,0,11),a.addMany(b,10,0,10),a.add(127,10,0,10),a.addMany(f(28,32),10,0,10),a.addMany(f(48,60),10,8,10),a.addMany([60,61,62,63],10,0,11),a.addMany(f(32,48),10,9,12),a.addMany(b,12,0,12),a.add(127,12,0,12),a.addMany(f(28,32),12,0,12),a.addMany(f(32,48),12,9,12),a.addMany(f(48,64),12,0,11),a.addMany(f(64,127),12,12,13),a.addMany(f(64,127),10,12,13),a.addMany(f(64,127),9,12,13),a.addMany(b,13,13,13),a.addMany(h,13,13,13),a.add(127,13,0,13),a.addMany([27,156,24,26],13,14,0),a.add(R,0,2,0),a.add(R,8,5,8),a.add(R,6,0,6),a.add(R,11,0,11),a.add(R,13,13,13),a})();class m extends g.Disposable{constructor(u=r.VT500_TRANSITION_TABLE){super(),this._transitions=u,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(f,h,b)=>{},this._executeHandlerFb=f=>{},this._csiHandlerFb=(f,h)=>{},this._escHandlerFb=f=>{},this._errorHandlerFb=f=>f,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,g.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new l.OscParser),this._dcsParser=this.register(new S.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(u,f=[64,126]){let h=0;if(u.prefix){if(u.prefix.length>1)throw new Error("only one byte as prefix supported");if(h=u.prefix.charCodeAt(0),h&&60>h||h>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(u.intermediates){if(u.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let M=0;M<u.intermediates.length;++M){const w=u.intermediates.charCodeAt(M);if(32>w||w>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");h<<=8,h|=w}}if(u.final.length!==1)throw new Error("final must be a single byte");const b=u.final.charCodeAt(0);if(f[0]>b||b>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return h<<=8,h|=b,h}identToString(u){const f=[];for(;u;)f.push(String.fromCharCode(255&u)),u>>=8;return f.reverse().join("")}setPrintHandler(u){this._printHandler=u}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(u,f){const h=this._identifier(u,[48,126]);this._escHandlers[h]===void 0&&(this._escHandlers[h]=[]);const b=this._escHandlers[h];return b.push(f),{dispose:()=>{const M=b.indexOf(f);M!==-1&&b.splice(M,1)}}}clearEscHandler(u){this._escHandlers[this._identifier(u,[48,126])]&&delete this._escHandlers[this._identifier(u,[48,126])]}setEscHandlerFallback(u){this._escHandlerFb=u}setExecuteHandler(u,f){this._executeHandlers[u.charCodeAt(0)]=f}clearExecuteHandler(u){this._executeHandlers[u.charCodeAt(0)]&&delete this._executeHandlers[u.charCodeAt(0)]}setExecuteHandlerFallback(u){this._executeHandlerFb=u}registerCsiHandler(u,f){const h=this._identifier(u);this._csiHandlers[h]===void 0&&(this._csiHandlers[h]=[]);const b=this._csiHandlers[h];return b.push(f),{dispose:()=>{const M=b.indexOf(f);M!==-1&&b.splice(M,1)}}}clearCsiHandler(u){this._csiHandlers[this._identifier(u)]&&delete this._csiHandlers[this._identifier(u)]}setCsiHandlerFallback(u){this._csiHandlerFb=u}registerDcsHandler(u,f){return this._dcsParser.registerHandler(this._identifier(u),f)}clearDcsHandler(u){this._dcsParser.clearHandler(this._identifier(u))}setDcsHandlerFallback(u){this._dcsParser.setHandlerFallback(u)}registerOscHandler(u,f){return this._oscParser.registerHandler(u,f)}clearOscHandler(u){this._oscParser.clearHandler(u)}setOscHandlerFallback(u){this._oscParser.setHandlerFallback(u)}setErrorHandler(u){this._errorHandler=u}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.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(u,f,h,b,M){this._parseStack.state=u,this._parseStack.handlers=f,this._parseStack.handlerPos=h,this._parseStack.transition=b,this._parseStack.chunkPos=M}parse(u,f,h){let b,M=0,w=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(h===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const y=this._parseStack.handlers;let L=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(h===!1&&L>-1){for(;L>=0&&(b=y[L](this._params),b!==!0);L--)if(b instanceof Promise)return this._parseStack.handlerPos=L,b}this._parseStack.handlers=[];break;case 4:if(h===!1&&L>-1){for(;L>=0&&(b=y[L](),b!==!0);L--)if(b instanceof Promise)return this._parseStack.handlerPos=L,b}this._parseStack.handlers=[];break;case 6:if(M=u[this._parseStack.chunkPos],b=this._dcsParser.unhook(M!==24&&M!==26,h),b)return b;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(M=u[this._parseStack.chunkPos],b=this._oscParser.end(M!==24&&M!==26,h),b)return b;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let y=T;y<f;++y){switch(M=u[y],w=this._transitions.table[this.currentState<<8|(M<160?M:R)],w>>4){case 2:for(let z=y+1;;++z){if(z>=f||(M=u[z])<32||M>126&&M<R){this._printHandler(u,y,z),y=z-1;break}if(++z>=f||(M=u[z])<32||M>126&&M<R){this._printHandler(u,y,z),y=z-1;break}if(++z>=f||(M=u[z])<32||M>126&&M<R){this._printHandler(u,y,z),y=z-1;break}if(++z>=f||(M=u[z])<32||M>126&&M<R){this._printHandler(u,y,z),y=z-1;break}}break;case 3:this._executeHandlers[M]?this._executeHandlers[M]():this._executeHandlerFb(M),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:y,code:M,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const L=this._csiHandlers[this._collect<<8|M];let O=L?L.length-1:-1;for(;O>=0&&(b=L[O](this._params),b!==!0);O--)if(b instanceof Promise)return this._preserveStack(3,L,O,w,y),b;O<0&&this._csiHandlerFb(this._collect<<8|M,this._params),this.precedingJoinState=0;break;case 8:do switch(M){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(M-48)}while(++y<f&&(M=u[y])>47&&M<60);y--;break;case 9:this._collect<<=8,this._collect|=M;break;case 10:const U=this._escHandlers[this._collect<<8|M];let H=U?U.length-1:-1;for(;H>=0&&(b=U[H](),b!==!0);H--)if(b instanceof Promise)return this._preserveStack(4,U,H,w,y),b;H<0&&this._escHandlerFb(this._collect<<8|M),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|M,this._params);break;case 13:for(let z=y+1;;++z)if(z>=f||(M=u[z])===24||M===26||M===27||M>127&&M<R){this._dcsParser.put(u,y,z),y=z-1;break}break;case 14:if(b=this._dcsParser.unhook(M!==24&&M!==26),b)return this._preserveStack(6,[],0,w,y),b;M===27&&(w|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let z=y+1;;z++)if(z>=f||(M=u[z])<32||M>127&&M<R){this._oscParser.put(u,y,z),y=z-1;break}break;case 6:if(b=this._oscParser.end(M!==24&&M!==26),b)return this._preserveStack(5,[],0,w,y),b;M===27&&(w|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&w}}}r.EscapeSequenceParser=m},6242:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const g=d(5770),p=d(482),l=[];r.OscParser=class{constructor(){this._state=0,this._active=l,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(S,x){this._handlers[S]===void 0&&(this._handlers[S]=[]);const R=this._handlers[S];return R.push(x),{dispose:()=>{const m=R.indexOf(x);m!==-1&&R.splice(m,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}reset(){if(this._state===2)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].end(!1);this._stack.paused=!1,this._active=l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||l,this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].start();else this._handlerFb(this._id,"START")}_put(S,x,R){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(S,x,R);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(S,x,R))}start(){this.reset(),this._state=1}put(S,x,R){if(this._state!==3){if(this._state===1)for(;x<R;){const m=S[x++];if(m===59){this._state=2,this._start();break}if(m<48||57<m)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+m-48}this._state===2&&R-x>0&&this._put(S,x,R)}}end(S,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let R=!1,m=this._active.length-1,a=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,R=x,a=this._stack.fallThrough,this._stack.paused=!1),!a&&R===!1){for(;m>=0&&(R=this._active[m].end(S),R!==!0);m--)if(R instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,R;m--}for(;m>=0;m--)if(R=this._active[m].end(!1),R instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,R}else this._handlerFb(this._id,"END",S);this._active=l,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(S){this._handler=S,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(S,x,R){this._hitLimit||(this._data+=(0,p.utf32ToString)(S,x,R),this._data.length>g.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(S){let x=!1;if(this._hitLimit)x=!1;else if(S&&(x=this._handler(this._data),x instanceof Promise))return x.then((R=>(this._data="",this._hitLimit=!1,R)));return this._data="",this._hitLimit=!1,x}}},8742:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const d=2147483647;class g{static fromArray(l){const S=new g;if(!l.length)return S;for(let x=Array.isArray(l[0])?1:0;x<l.length;++x){const R=l[x];if(Array.isArray(R))for(let m=0;m<R.length;++m)S.addSubParam(R[m]);else S.addParam(R)}return S}constructor(l=32,S=32){if(this.maxLength=l,this.maxSubParamsLength=S,S>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(l),this.length=0,this._subParams=new Int32Array(S),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(l),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const l=new g(this.maxLength,this.maxSubParamsLength);return l.params.set(this.params),l.length=this.length,l._subParams.set(this._subParams),l._subParamsLength=this._subParamsLength,l._subParamsIdx.set(this._subParamsIdx),l._rejectDigits=this._rejectDigits,l._rejectSubDigits=this._rejectSubDigits,l._digitIsSub=this._digitIsSub,l}toArray(){const l=[];for(let S=0;S<this.length;++S){l.push(this.params[S]);const x=this._subParamsIdx[S]>>8,R=255&this._subParamsIdx[S];R-x>0&&l.push(Array.prototype.slice.call(this._subParams,x,R))}return l}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(l){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=l>d?d:l}}addSubParam(l){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=l>d?d:l,this._subParamsIdx[this.length-1]++}}hasSubParams(l){return(255&this._subParamsIdx[l])-(this._subParamsIdx[l]>>8)>0}getSubParams(l){const S=this._subParamsIdx[l]>>8,x=255&this._subParamsIdx[l];return x-S>0?this._subParams.subarray(S,x):null}getSubParamsAll(){const l={};for(let S=0;S<this.length;++S){const x=this._subParamsIdx[S]>>8,R=255&this._subParamsIdx[S];R-x>0&&(l[S]=this._subParams.slice(x,R))}return l}addDigit(l){let S;if(this._rejectDigits||!(S=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,R=x[S-1];x[S-1]=~R?Math.min(10*R+l,d):l}}r.Params=g},5741:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let d=this._addons.length-1;d>=0;d--)this._addons[d].instance.dispose()}loadAddon(d,g){const p={instance:g,dispose:g.dispose,isDisposed:!1};this._addons.push(p),g.dispose=()=>this._wrappedAddonDispose(p),g.activate(d)}_wrappedAddonDispose(d){if(d.isDisposed)return;let g=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===d){g=p;break}if(g===-1)throw new Error("Could not dispose an addon that has not been loaded");d.isDisposed=!0,d.dispose.apply(d.instance),this._addons.splice(g,1)}}},8771:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const g=d(3785),p=d(511);r.BufferApiView=class{constructor(l,S){this._buffer=l,this.type=S}init(l){return this._buffer=l,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(l){const S=this._buffer.lines.get(l);if(S)return new g.BufferLineApiView(S)}getNullCell(){return new p.CellData}}},3785:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const g=d(511);r.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,l){if(!(p<0||p>=this._line.length))return l?(this._line.loadCell(p,l),l):this._line.loadCell(p,new g.CellData)}translateToString(p,l,S){return this._line.translateToString(p,l,S)}}},8285:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const g=d(8771),p=d(8460),l=d(844);class S extends l.Disposable{constructor(R){super(),this._core=R,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new g.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new g.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)}}r.BufferNamespaceApi=S},7975:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(d){this._core=d}registerCsiHandler(d,g){return this._core.registerCsiHandler(d,(p=>g(p.toArray())))}addCsiHandler(d,g){return this.registerCsiHandler(d,g)}registerDcsHandler(d,g){return this._core.registerDcsHandler(d,((p,l)=>g(p,l.toArray())))}addDcsHandler(d,g){return this.registerDcsHandler(d,g)}registerEscHandler(d,g){return this._core.registerEscHandler(d,g)}addEscHandler(d,g){return this.registerEscHandler(d,g)}registerOscHandler(d,g){return this._core.registerOscHandler(d,g)}addOscHandler(d,g){return this.registerOscHandler(d,g)}}},7090:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(d){this._core=d}register(d){this._core.unicodeService.register(d)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(d){this._core.unicodeService.activeVersion=d}}},744:function(P,r,d){var g=this&&this.__decorate||function(a,u,f,h){var b,M=arguments.length,w=M<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,f):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(a,u,f,h);else for(var T=a.length-1;T>=0;T--)(b=a[T])&&(w=(M<3?b(w):M>3?b(u,f,w):b(u,f))||w);return M>3&&w&&Object.defineProperty(u,f,w),w},p=this&&this.__param||function(a,u){return function(f,h){u(f,h,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const l=d(8460),S=d(844),x=d(5295),R=d(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let m=r.BufferService=class extends S.Disposable{get buffer(){return this.buffers.active}constructor(a){super(),this.isUserScrolling=!1,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(a.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(a.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(a,this))}resize(a,u){this.cols=a,this.rows=u,this.buffers.resize(a,u),this._onResize.fire({cols:a,rows:u})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(a,u=!1){const f=this.buffer;let h;h=this._cachedBlankLine,h&&h.length===this.cols&&h.getFg(0)===a.fg&&h.getBg(0)===a.bg||(h=f.getBlankLine(a,u),this._cachedBlankLine=h),h.isWrapped=u;const b=f.ybase+f.scrollTop,M=f.ybase+f.scrollBottom;if(f.scrollTop===0){const w=f.lines.isFull;M===f.lines.length-1?w?f.lines.recycle().copyFrom(h):f.lines.push(h.clone()):f.lines.splice(M+1,0,h.clone()),w?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const w=M-b+1;f.lines.shiftElements(b+1,w-1,-1),f.lines.set(M,h.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(a,u,f){const h=this.buffer;if(a<0){if(h.ydisp===0)return;this.isUserScrolling=!0}else a+h.ydisp>=h.ybase&&(this.isUserScrolling=!1);const b=h.ydisp;h.ydisp=Math.max(Math.min(h.ydisp+a,h.ybase),0),b!==h.ydisp&&(u||this._onScroll.fire(h.ydisp))}};r.BufferService=m=g([p(0,R.IOptionsService)],m)},7994:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(d){this.glevel=d,this.charset=this._charsets[d]}setgCharset(d,g){this._charsets[d]=g,this.glevel===d&&(this.charset=g)}}},1753:function(P,r,d){var g=this&&this.__decorate||function(h,b,M,w){var T,y=arguments.length,L=y<3?b:w===null?w=Object.getOwnPropertyDescriptor(b,M):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(h,b,M,w);else for(var O=h.length-1;O>=0;O--)(T=h[O])&&(L=(y<3?T(L):y>3?T(b,M,L):T(b,M))||L);return y>3&&L&&Object.defineProperty(b,M,L),L},p=this&&this.__param||function(h,b){return function(M,w){b(M,w,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const l=d(2585),S=d(8460),x=d(844),R={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:h=>h.button!==4&&h.action===1&&(h.ctrl=!1,h.alt=!1,h.shift=!1,!0)},VT200:{events:19,restrict:h=>h.action!==32},DRAG:{events:23,restrict:h=>h.action!==32||h.button!==3},ANY:{events:31,restrict:h=>!0}};function m(h,b){let M=(h.ctrl?16:0)|(h.shift?4:0)|(h.alt?8:0);return h.button===4?(M|=64,M|=h.action):(M|=3&h.button,4&h.button&&(M|=64),8&h.button&&(M|=128),h.action===32?M|=32:h.action!==0||b||(M|=3)),M}const a=String.fromCharCode,u={DEFAULT:h=>{const b=[m(h,!1)+32,h.col+32,h.row+32];return b[0]>255||b[1]>255||b[2]>255?"":`\x1B[M${a(b[0])}${a(b[1])}${a(b[2])}`},SGR:h=>{const b=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${m(h,!0)};${h.col};${h.row}${b}`},SGR_PIXELS:h=>{const b=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${m(h,!0)};${h.x};${h.y}${b}`}};let f=r.CoreMouseService=class extends x.Disposable{constructor(h,b){super(),this._bufferService=h,this._coreService=b,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new S.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const M of Object.keys(R))this.addProtocol(M,R[M]);for(const M of Object.keys(u))this.addEncoding(M,u[M]);this.reset()}addProtocol(h,b){this._protocols[h]=b}addEncoding(h,b){this._encodings[h]=b}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(h){if(!this._protocols[h])throw new Error(`unknown protocol "${h}"`);this._activeProtocol=h,this._onProtocolChange.fire(this._protocols[h].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(h){if(!this._encodings[h])throw new Error(`unknown encoding "${h}"`);this._activeEncoding=h}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(h){if(h.col<0||h.col>=this._bufferService.cols||h.row<0||h.row>=this._bufferService.rows||h.button===4&&h.action===32||h.button===3&&h.action!==32||h.button!==4&&(h.action===2||h.action===3)||(h.col++,h.row++,h.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,h,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(h))return!1;const b=this._encodings[this._activeEncoding](h);return b&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(b):this._coreService.triggerDataEvent(b,!0)),this._lastEvent=h,!0}explainEvents(h){return{down:!!(1&h),up:!!(2&h),drag:!!(4&h),move:!!(8&h),wheel:!!(16&h)}}_equalEvents(h,b,M){if(M){if(h.x!==b.x||h.y!==b.y)return!1}else if(h.col!==b.col||h.row!==b.row)return!1;return h.button===b.button&&h.action===b.action&&h.ctrl===b.ctrl&&h.alt===b.alt&&h.shift===b.shift}};r.CoreMouseService=f=g([p(0,l.IBufferService),p(1,l.ICoreService)],f)},6975:function(P,r,d){var g=this&&this.__decorate||function(f,h,b,M){var w,T=arguments.length,y=T<3?h:M===null?M=Object.getOwnPropertyDescriptor(h,b):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,h,b,M);else for(var L=f.length-1;L>=0;L--)(w=f[L])&&(y=(T<3?w(y):T>3?w(h,b,y):w(h,b))||y);return T>3&&y&&Object.defineProperty(h,b,y),y},p=this&&this.__param||function(f,h){return function(b,M){h(b,M,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const l=d(1439),S=d(8460),x=d(844),R=d(2585),m=Object.freeze({insertMode:!1}),a=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let u=r.CoreService=class extends x.Disposable{constructor(f,h,b){super(),this._bufferService=f,this._logService=h,this._optionsService=b,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new S.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new S.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new S.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new S.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,l.clone)(m),this.decPrivateModes=(0,l.clone)(a)}reset(){this.modes=(0,l.clone)(m),this.decPrivateModes=(0,l.clone)(a)}triggerDataEvent(f,h=!1){if(this._optionsService.rawOptions.disableStdin)return;const b=this._bufferService.buffer;h&&this._optionsService.rawOptions.scrollOnUserInput&&b.ybase!==b.ydisp&&this._onRequestScrollToBottom.fire(),h&&this._onUserInput.fire(),this._logService.debug(`sending data "${f}"`,(()=>f.split("").map((M=>M.charCodeAt(0))))),this._onData.fire(f)}triggerBinaryEvent(f){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${f}"`,(()=>f.split("").map((h=>h.charCodeAt(0))))),this._onBinary.fire(f))}};r.CoreService=u=g([p(0,R.IBufferService),p(1,R.ILogService),p(2,R.IOptionsService)],u)},9074:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const g=d(8055),p=d(8460),l=d(844),S=d(6106);let x=0,R=0;class m extends l.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new S.SortedList((f=>f?.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,l.toDisposable)((()=>this.reset())))}registerDecoration(f){if(f.marker.isDisposed)return;const h=new a(f);if(h){const b=h.marker.onDispose((()=>h.dispose()));h.onDispose((()=>{h&&(this._decorations.delete(h)&&this._onDecorationRemoved.fire(h),b.dispose())})),this._decorations.insert(h),this._onDecorationRegistered.fire(h)}return h}reset(){for(const f of this._decorations.values())f.dispose();this._decorations.clear()}*getDecorationsAtCell(f,h,b){let M=0,w=0;for(const T of this._decorations.getKeyIterator(h))M=T.options.x??0,w=M+(T.options.width??1),f>=M&&f<w&&(!b||(T.options.layer??"bottom")===b)&&(yield T)}forEachDecorationAtCell(f,h,b,M){this._decorations.forEachByKey(h,(w=>{x=w.options.x??0,R=x+(w.options.width??1),f>=x&&f<R&&(!b||(w.options.layer??"bottom")===b)&&M(w)}))}}r.DecorationService=m;class a extends l.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=g.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=g.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(f){super(),this.options=f,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=f.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const g=d(2585),p=d(8343);class l{constructor(...x){this._entries=new Map;for(const[R,m]of x)this.set(R,m)}set(x,R){const m=this._entries.get(x);return this._entries.set(x,R),m}forEach(x){for(const[R,m]of this._entries.entries())x(R,m)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}r.ServiceCollection=l,r.InstantiationService=class{constructor(){this._services=new l,this._services.set(g.IInstantiationService,this)}setService(S,x){this._services.set(S,x)}getService(S){return this._services.get(S)}createInstance(S,...x){const R=(0,p.getServiceDependencies)(S).sort(((u,f)=>u.index-f.index)),m=[];for(const u of R){const f=this._services.get(u.id);if(!f)throw new Error(`[createInstance] ${S.name} depends on UNKNOWN service ${u.id}.`);m.push(f)}const a=R.length>0?R[0].index:x.length;if(x.length!==a)throw new Error(`[createInstance] First service dependency of ${S.name} at position ${a+1} conflicts with ${x.length} static arguments`);return new S(...x,...m)}}},7866:function(P,r,d){var g=this&&this.__decorate||function(a,u,f,h){var b,M=arguments.length,w=M<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,f):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(a,u,f,h);else for(var T=a.length-1;T>=0;T--)(b=a[T])&&(w=(M<3?b(w):M>3?b(u,f,w):b(u,f))||w);return M>3&&w&&Object.defineProperty(u,f,w),w},p=this&&this.__param||function(a,u){return function(f,h){u(f,h,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const l=d(844),S=d(2585),x={trace:S.LogLevelEnum.TRACE,debug:S.LogLevelEnum.DEBUG,info:S.LogLevelEnum.INFO,warn:S.LogLevelEnum.WARN,error:S.LogLevelEnum.ERROR,off:S.LogLevelEnum.OFF};let R,m=r.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(a){super(),this._optionsService=a,this._logLevel=S.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),R=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(a){for(let u=0;u<a.length;u++)typeof a[u]=="function"&&(a[u]=a[u]())}_log(a,u,f){this._evalLazyOptionalParams(f),a.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+u,...f)}trace(a,...u){this._logLevel<=S.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,a,u)}debug(a,...u){this._logLevel<=S.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,a,u)}info(a,...u){this._logLevel<=S.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,a,u)}warn(a,...u){this._logLevel<=S.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,a,u)}error(a,...u){this._logLevel<=S.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,a,u)}};r.LogService=m=g([p(0,S.IOptionsService)],m),r.setTraceLogger=function(a){R=a},r.traceCall=function(a,u,f){if(typeof f.value!="function")throw new Error("not supported");const h=f.value;f.value=function(...b){if(R.logLevel!==S.LogLevelEnum.TRACE)return h.apply(this,b);R.trace(`GlyphRenderer#${h.name}(${b.map((w=>JSON.stringify(w))).join(", ")})`);const M=h.apply(this,b);return R.trace(`GlyphRenderer#${h.name} return`,M),M}}},7302:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const g=d(8460),p=d(844),l=d(6114);r.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,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:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:l.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const S=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends p.Disposable{constructor(m){super(),this._onOptionChange=this.register(new g.EventEmitter),this.onOptionChange=this._onOptionChange.event;const a={...r.DEFAULT_OPTIONS};for(const u in m)if(u in a)try{const f=m[u];a[u]=this._sanitizeAndValidateOption(u,f)}catch(f){console.error(f)}this.rawOptions=a,this.options={...a},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(m,a){return this.onOptionChange((u=>{u===m&&a(this.rawOptions[m])}))}onMultipleOptionChange(m,a){return this.onOptionChange((u=>{m.indexOf(u)!==-1&&a()}))}_setupOptions(){const m=u=>{if(!(u in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);return this.rawOptions[u]},a=(u,f)=>{if(!(u in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);f=this._sanitizeAndValidateOption(u,f),this.rawOptions[u]!==f&&(this.rawOptions[u]=f,this._onOptionChange.fire(u))};for(const u in this.rawOptions){const f={get:m.bind(this,u),set:a.bind(this,u)};Object.defineProperty(this.options,u,f)}}_sanitizeAndValidateOption(m,a){switch(m){case"cursorStyle":if(a||(a=r.DEFAULT_OPTIONS[m]),!(function(u){return u==="block"||u==="underline"||u==="bar"})(a))throw new Error(`"${a}" is not a valid value for ${m}`);break;case"wordSeparator":a||(a=r.DEFAULT_OPTIONS[m]);break;case"fontWeight":case"fontWeightBold":if(typeof a=="number"&&1<=a&&a<=1e3)break;a=S.includes(a)?a:r.DEFAULT_OPTIONS[m];break;case"cursorWidth":a=Math.floor(a);case"lineHeight":case"tabStopWidth":if(a<1)throw new Error(`${m} cannot be less than 1, value: ${a}`);break;case"minimumContrastRatio":a=Math.max(1,Math.min(21,Math.round(10*a)/10));break;case"scrollback":if((a=Math.min(a,4294967295))<0)throw new Error(`${m} cannot be less than 0, value: ${a}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(a<=0)throw new Error(`${m} cannot be less than or equal to 0, value: ${a}`);break;case"rows":case"cols":if(!a&&a!==0)throw new Error(`${m} must be numeric, value: ${a}`);break;case"windowsPty":a=a??{}}return a}}r.OptionsService=x},2660:function(P,r,d){var g=this&&this.__decorate||function(x,R,m,a){var u,f=arguments.length,h=f<3?R:a===null?a=Object.getOwnPropertyDescriptor(R,m):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(x,R,m,a);else for(var b=x.length-1;b>=0;b--)(u=x[b])&&(h=(f<3?u(h):f>3?u(R,m,h):u(R,m))||h);return f>3&&h&&Object.defineProperty(R,m,h),h},p=this&&this.__param||function(x,R){return function(m,a){R(m,a,x)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const l=d(2585);let S=r.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const R=this._bufferService.buffer;if(x.id===void 0){const b=R.addMarker(R.ybase+R.y),M={data:x,id:this._nextId++,lines:[b]};return b.onDispose((()=>this._removeMarkerFromLink(M,b))),this._dataByLinkId.set(M.id,M),M.id}const m=x,a=this._getEntryIdKey(m),u=this._entriesWithId.get(a);if(u)return this.addLineToLink(u.id,R.ybase+R.y),u.id;const f=R.addMarker(R.ybase+R.y),h={id:this._nextId++,key:this._getEntryIdKey(m),data:m,lines:[f]};return f.onDispose((()=>this._removeMarkerFromLink(h,f))),this._entriesWithId.set(h.key,h),this._dataByLinkId.set(h.id,h),h.id}addLineToLink(x,R){const m=this._dataByLinkId.get(x);if(m&&m.lines.every((a=>a.line!==R))){const a=this._bufferService.buffer.addMarker(R);m.lines.push(a),a.onDispose((()=>this._removeMarkerFromLink(m,a)))}}getLinkData(x){return this._dataByLinkId.get(x)?.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,R){const m=x.lines.indexOf(R);m!==-1&&(x.lines.splice(m,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};r.OscLinkService=S=g([p(0,l.IBufferService)],S)},8343:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const d="di$target",g="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(p){return p[g]||[]},r.createDecorator=function(p){if(r.serviceRegistry.has(p))return r.serviceRegistry.get(p);const l=function(S,x,R){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,a,u){a[d]===a?a[g].push({id:m,index:u}):(a[g]=[{id:m,index:u}],a[d]=a)})(l,S,R)};return l.toString=()=>p,r.serviceRegistry.set(p,l),l}},2585:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const g=d(8343);var p;r.IBufferService=(0,g.createDecorator)("BufferService"),r.ICoreMouseService=(0,g.createDecorator)("CoreMouseService"),r.ICoreService=(0,g.createDecorator)("CoreService"),r.ICharsetService=(0,g.createDecorator)("CharsetService"),r.IInstantiationService=(0,g.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(p||(r.LogLevelEnum=p={})),r.ILogService=(0,g.createDecorator)("LogService"),r.IOptionsService=(0,g.createDecorator)("OptionsService"),r.IOscLinkService=(0,g.createDecorator)("OscLinkService"),r.IUnicodeService=(0,g.createDecorator)("UnicodeService"),r.IDecorationService=(0,g.createDecorator)("DecorationService")},1480:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const g=d(8460),p=d(225);class l{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,R,m=!1){return(16777215&x)<<3|(3&R)<<1|(m?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new g.EventEmitter,this.onChange=this._onChange.event;const x=new p.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let R=0,m=0;const a=x.length;for(let u=0;u<a;++u){let f=x.charCodeAt(u);if(55296<=f&&f<=56319){if(++u>=a)return R+this.wcwidth(f);const M=x.charCodeAt(u);56320<=M&&M<=57343?f=1024*(f-55296)+M-56320+65536:R+=this.wcwidth(M)}const h=this.charProperties(f,m);let b=l.extractWidth(h);l.extractShouldJoin(h)&&(b-=l.extractWidth(m)),R+=b,m=h}return R}charProperties(x,R){return this._activeProvider.charProperties(x,R)}}r.UnicodeService=l}},A={};function N(P){var r=A[P];if(r!==void 0)return r.exports;var d=A[P]={exports:{}};return E[P].call(d.exports,d,d.exports,N),d.exports}var G={};return(()=>{var P=G;Object.defineProperty(P,"__esModule",{value:!0}),P.Terminal=void 0;const r=N(9042),d=N(3236),g=N(844),p=N(5741),l=N(8285),S=N(7975),x=N(7090),R=["cols","rows"];class m extends g.Disposable{constructor(u){super(),this._core=this.register(new d.Terminal(u)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const f=b=>this._core.options[b],h=(b,M)=>{this._checkReadonlyOptions(b),this._core.options[b]=M};for(const b in this._core.options){const M={get:f.bind(this,b),set:h.bind(this,b)};Object.defineProperty(this._publicOptions,b,M)}}_checkReadonlyOptions(u){if(R.includes(u))throw new Error(`Option "${u}" 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 S.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.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 l.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const u=this._core.coreService.decPrivateModes;let f="none";switch(this._core.coreMouseService.activeProtocol){case"X10":f="x10";break;case"VT200":f="vt200";break;case"DRAG":f="drag";break;case"ANY":f="any"}return{applicationCursorKeysMode:u.applicationCursorKeys,applicationKeypadMode:u.applicationKeypad,bracketedPasteMode:u.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:u.origin,reverseWraparoundMode:u.reverseWraparound,sendFocusMode:u.sendFocus,wraparoundMode:u.wraparound}}get options(){return this._publicOptions}set options(u){for(const f in u)this._publicOptions[f]=u[f]}blur(){this._core.blur()}focus(){this._core.focus()}input(u,f=!0){this._core.input(u,f)}resize(u,f){this._verifyIntegers(u,f),this._core.resize(u,f)}open(u){this._core.open(u)}attachCustomKeyEventHandler(u){this._core.attachCustomKeyEventHandler(u)}attachCustomWheelEventHandler(u){this._core.attachCustomWheelEventHandler(u)}registerLinkProvider(u){return this._core.registerLinkProvider(u)}registerCharacterJoiner(u){return this._checkProposedApi(),this._core.registerCharacterJoiner(u)}deregisterCharacterJoiner(u){this._checkProposedApi(),this._core.deregisterCharacterJoiner(u)}registerMarker(u=0){return this._verifyIntegers(u),this._core.registerMarker(u)}registerDecoration(u){return this._checkProposedApi(),this._verifyPositiveIntegers(u.x??0,u.width??0,u.height??0),this._core.registerDecoration(u)}hasSelection(){return this._core.hasSelection()}select(u,f,h){this._verifyIntegers(u,f,h),this._core.select(u,f,h)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(u,f){this._verifyIntegers(u,f),this._core.selectLines(u,f)}dispose(){super.dispose()}scrollLines(u){this._verifyIntegers(u),this._core.scrollLines(u)}scrollPages(u){this._verifyIntegers(u),this._core.scrollPages(u)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(u){this._verifyIntegers(u),this._core.scrollToLine(u)}clear(){this._core.clear()}write(u,f){this._core.write(u,f)}writeln(u,f){this._core.write(u),this._core.write(`\r
17
- `,f)}paste(u){this._core.paste(u)}refresh(u,f){this._verifyIntegers(u,f),this._core.refresh(u,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(u){this._addonManager.loadAddon(this,u)}static get strings(){return r}_verifyIntegers(...u){for(const f of u)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...u){for(const f of u)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}P.Terminal=m})(),G})()))})(Eu)),Eu.exports}var Gg=qg(),Au={exports:{}},J_;function Kg(){return J_||(J_=1,(function(n,C){(function(E,A){n.exports=A()})(self,(()=>(()=>{var E={};return(()=>{var A=E;Object.defineProperty(A,"__esModule",{value:!0}),A.FitAddon=void 0,A.FitAddon=class{activate(N){this._terminal=N}dispose(){}fit(){const N=this.proposeDimensions();if(!N||!this._terminal||isNaN(N.cols)||isNaN(N.rows))return;const G=this._terminal._core;this._terminal.rows===N.rows&&this._terminal.cols===N.cols||(G._renderService.clear(),this._terminal.resize(N.cols,N.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const N=this._terminal._core,G=N._renderService.dimensions;if(G.css.cell.width===0||G.css.cell.height===0)return;const P=this._terminal.options.scrollback===0?0:N.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),d=parseInt(r.getPropertyValue("height")),g=Math.max(0,parseInt(r.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),l=d-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),S=g-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-P;return{cols:Math.max(2,Math.floor(S/G.css.cell.width)),rows:Math.max(1,Math.floor(l/G.css.cell.height))}}}})(),E})()))})(Au)),Au.exports}var Vg=Kg(),Ru={exports:{}},ep;function Yg(){return ep||(ep=1,(function(n,C){(function(E,A){n.exports=A()})(self,(()=>(()=>{var E={965:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GlyphRenderer=void 0;const g=d(374),p=d(509),l=d(855),S=d(859),x=d(381),R=11,m=R*Float32Array.BYTES_PER_ELEMENT;let a,u=0,f=0,h=0;class b extends S.Disposable{constructor(w,T,y,L){super(),this._terminal=w,this._gl=T,this._dimensions=y,this._optionsService=L,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const O=this._gl;p.TextureAtlas.maxAtlasPages===void 0&&(p.TextureAtlas.maxAtlasPages=Math.min(32,(0,g.throwIfFalsy)(O.getParameter(O.MAX_TEXTURE_IMAGE_UNITS))),p.TextureAtlas.maxTextureSize=(0,g.throwIfFalsy)(O.getParameter(O.MAX_TEXTURE_SIZE))),this._program=(0,g.throwIfFalsy)((0,x.createProgram)(O,`#version 300 es
18
- layout (location = 0) in vec2 a_unitquad;
19
- layout (location = 1) in vec2 a_cellpos;
20
- layout (location = 2) in vec2 a_offset;
21
- layout (location = 3) in vec2 a_size;
22
- layout (location = 4) in float a_texpage;
23
- layout (location = 5) in vec2 a_texcoord;
24
- layout (location = 6) in vec2 a_texsize;
25
-
26
- uniform mat4 u_projection;
27
- uniform vec2 u_resolution;
28
-
29
- out vec2 v_texcoord;
30
- flat out int v_texpage;
31
-
32
- void main() {
33
- vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
34
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
35
- v_texpage = int(a_texpage);
36
- v_texcoord = a_texcoord + a_unitquad * a_texsize;
37
- }`,(function(V){let X="";for(let I=1;I<V;I++)X+=` else if (v_texpage == ${I}) { outColor = texture(u_texture[${I}], v_texcoord); }`;return`#version 300 es
38
- precision lowp float;
39
-
40
- in vec2 v_texcoord;
41
- flat in int v_texpage;
42
-
43
- uniform sampler2D u_texture[${V}];
44
-
45
- out vec4 outColor;
46
-
47
- void main() {
48
- if (v_texpage == 0) {
49
- outColor = texture(u_texture[0], v_texcoord);
50
- } ${X}
51
- }`})(p.TextureAtlas.maxAtlasPages))),this.register((0,S.toDisposable)((()=>O.deleteProgram(this._program)))),this._projectionLocation=(0,g.throwIfFalsy)(O.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,g.throwIfFalsy)(O.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,g.throwIfFalsy)(O.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=O.createVertexArray(),O.bindVertexArray(this._vertexArrayObject);const U=new Float32Array([0,0,1,0,0,1,1,1]),H=O.createBuffer();this.register((0,S.toDisposable)((()=>O.deleteBuffer(H)))),O.bindBuffer(O.ARRAY_BUFFER,H),O.bufferData(O.ARRAY_BUFFER,U,O.STATIC_DRAW),O.enableVertexAttribArray(0),O.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const z=new Uint8Array([0,1,2,3]),Y=O.createBuffer();this.register((0,S.toDisposable)((()=>O.deleteBuffer(Y)))),O.bindBuffer(O.ELEMENT_ARRAY_BUFFER,Y),O.bufferData(O.ELEMENT_ARRAY_BUFFER,z,O.STATIC_DRAW),this._attributesBuffer=(0,g.throwIfFalsy)(O.createBuffer()),this.register((0,S.toDisposable)((()=>O.deleteBuffer(this._attributesBuffer)))),O.bindBuffer(O.ARRAY_BUFFER,this._attributesBuffer),O.enableVertexAttribArray(2),O.vertexAttribPointer(2,2,O.FLOAT,!1,m,0),O.vertexAttribDivisor(2,1),O.enableVertexAttribArray(3),O.vertexAttribPointer(3,2,O.FLOAT,!1,m,2*Float32Array.BYTES_PER_ELEMENT),O.vertexAttribDivisor(3,1),O.enableVertexAttribArray(4),O.vertexAttribPointer(4,1,O.FLOAT,!1,m,4*Float32Array.BYTES_PER_ELEMENT),O.vertexAttribDivisor(4,1),O.enableVertexAttribArray(5),O.vertexAttribPointer(5,2,O.FLOAT,!1,m,5*Float32Array.BYTES_PER_ELEMENT),O.vertexAttribDivisor(5,1),O.enableVertexAttribArray(6),O.vertexAttribPointer(6,2,O.FLOAT,!1,m,7*Float32Array.BYTES_PER_ELEMENT),O.vertexAttribDivisor(6,1),O.enableVertexAttribArray(1),O.vertexAttribPointer(1,2,O.FLOAT,!1,m,9*Float32Array.BYTES_PER_ELEMENT),O.vertexAttribDivisor(1,1),O.useProgram(this._program);const ne=new Int32Array(p.TextureAtlas.maxAtlasPages);for(let V=0;V<p.TextureAtlas.maxAtlasPages;V++)ne[V]=V;O.uniform1iv(this._textureLocation,ne),O.uniformMatrix4fv(this._projectionLocation,!1,x.PROJECTION_MATRIX),this._atlasTextures=[];for(let V=0;V<p.TextureAtlas.maxAtlasPages;V++){const X=new x.GLTexture((0,g.throwIfFalsy)(O.createTexture()));this.register((0,S.toDisposable)((()=>O.deleteTexture(X.texture)))),O.activeTexture(O.TEXTURE0+V),O.bindTexture(O.TEXTURE_2D,X.texture),O.texParameteri(O.TEXTURE_2D,O.TEXTURE_WRAP_S,O.CLAMP_TO_EDGE),O.texParameteri(O.TEXTURE_2D,O.TEXTURE_WRAP_T,O.CLAMP_TO_EDGE),O.texImage2D(O.TEXTURE_2D,0,O.RGBA,1,1,0,O.RGBA,O.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[V]=X}O.enable(O.BLEND),O.blendFunc(O.SRC_ALPHA,O.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(w,T,y,L,O,U,H,z,Y){this._updateCell(this._vertices.attributes,w,T,y,L,O,U,H,z,Y)}_updateCell(w,T,y,L,O,U,H,z,Y,ne){u=(y*this._terminal.cols+T)*R,L!==l.NULL_CELL_CODE&&L!==void 0?this._atlas&&(a=z&&z.length>1?this._atlas.getRasterizedGlyphCombinedChar(z,O,U,H,!1):this._atlas.getRasterizedGlyph(L,O,U,H,!1),f=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),O!==ne&&a.offset.x>f?(h=a.offset.x-f,w[u]=-(a.offset.x-h)+this._dimensions.device.char.left,w[u+1]=-a.offset.y+this._dimensions.device.char.top,w[u+2]=(a.size.x-h)/this._dimensions.device.canvas.width,w[u+3]=a.size.y/this._dimensions.device.canvas.height,w[u+4]=a.texturePage,w[u+5]=a.texturePositionClipSpace.x+h/this._atlas.pages[a.texturePage].canvas.width,w[u+6]=a.texturePositionClipSpace.y,w[u+7]=a.sizeClipSpace.x-h/this._atlas.pages[a.texturePage].canvas.width,w[u+8]=a.sizeClipSpace.y):(w[u]=-a.offset.x+this._dimensions.device.char.left,w[u+1]=-a.offset.y+this._dimensions.device.char.top,w[u+2]=a.size.x/this._dimensions.device.canvas.width,w[u+3]=a.size.y/this._dimensions.device.canvas.height,w[u+4]=a.texturePage,w[u+5]=a.texturePositionClipSpace.x,w[u+6]=a.texturePositionClipSpace.y,w[u+7]=a.sizeClipSpace.x,w[u+8]=a.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,g.allowRescaling)(L,Y,a.size.x,this._dimensions.device.cell.width)&&(w[u+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):w.fill(0,u,u+R-1-2)}clear(){const w=this._terminal,T=w.cols*w.rows*R;this._vertices.count!==T?this._vertices.attributes=new Float32Array(T):this._vertices.attributes.fill(0);let y=0;for(;y<this._vertices.attributesBuffers.length;y++)this._vertices.count!==T?this._vertices.attributesBuffers[y]=new Float32Array(T):this._vertices.attributesBuffers[y].fill(0);this._vertices.count=T,y=0;for(let L=0;L<w.rows;L++)for(let O=0;O<w.cols;O++)this._vertices.attributes[y+9]=O/w.cols,this._vertices.attributes[y+10]=L/w.rows,y+=R}handleResize(){const w=this._gl;w.useProgram(this._program),w.viewport(0,0,w.canvas.width,w.canvas.height),w.uniform2f(this._resolutionLocation,w.canvas.width,w.canvas.height),this.clear()}render(w){if(!this._atlas)return;const T=this._gl;T.useProgram(this._program),T.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const y=this._vertices.attributesBuffers[this._activeBuffer];let L=0;for(let O=0;O<w.lineLengths.length;O++){const U=O*this._terminal.cols*R,H=this._vertices.attributes.subarray(U,U+w.lineLengths[O]*R);y.set(H,L),L+=H.length}T.bindBuffer(T.ARRAY_BUFFER,this._attributesBuffer),T.bufferData(T.ARRAY_BUFFER,y.subarray(0,L),T.STREAM_DRAW);for(let O=0;O<this._atlas.pages.length;O++)this._atlas.pages[O].version!==this._atlasTextures[O].version&&this._bindAtlasPageTexture(T,this._atlas,O);T.drawElementsInstanced(T.TRIANGLE_STRIP,4,T.UNSIGNED_BYTE,0,L/R)}setAtlas(w){this._atlas=w;for(const T of this._atlasTextures)T.version=-1}_bindAtlasPageTexture(w,T,y){w.activeTexture(w.TEXTURE0+y),w.bindTexture(w.TEXTURE_2D,this._atlasTextures[y].texture),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_S,w.CLAMP_TO_EDGE),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_T,w.CLAMP_TO_EDGE),w.texImage2D(w.TEXTURE_2D,0,w.RGBA,w.RGBA,w.UNSIGNED_BYTE,T.pages[y].canvas),w.generateMipmap(w.TEXTURE_2D),this._atlasTextures[y].version=T.pages[y].version}setDimensions(w){this._dimensions=w}}r.GlyphRenderer=b},742:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RectangleRenderer=void 0;const g=d(374),p=d(859),l=d(310),S=d(381),x=8*Float32Array.BYTES_PER_ELEMENT;class R{constructor(){this.attributes=new Float32Array(160),this.count=0}}let m=0,a=0,u=0,f=0,h=0,b=0,M=0;class w extends p.Disposable{constructor(y,L,O,U){super(),this._terminal=y,this._gl=L,this._dimensions=O,this._themeService=U,this._vertices=new R,this._verticesCursor=new R;const H=this._gl;this._program=(0,g.throwIfFalsy)((0,S.createProgram)(H,`#version 300 es
52
- layout (location = 0) in vec2 a_position;
53
- layout (location = 1) in vec2 a_size;
54
- layout (location = 2) in vec4 a_color;
55
- layout (location = 3) in vec2 a_unitquad;
56
-
57
- uniform mat4 u_projection;
58
-
59
- out vec4 v_color;
60
-
61
- void main() {
62
- vec2 zeroToOne = a_position + (a_unitquad * a_size);
63
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
64
- v_color = a_color;
65
- }`,`#version 300 es
66
- precision lowp float;
67
-
68
- in vec4 v_color;
69
-
70
- out vec4 outColor;
71
-
72
- void main() {
73
- outColor = v_color;
74
- }`)),this.register((0,p.toDisposable)((()=>H.deleteProgram(this._program)))),this._projectionLocation=(0,g.throwIfFalsy)(H.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=H.createVertexArray(),H.bindVertexArray(this._vertexArrayObject);const z=new Float32Array([0,0,1,0,0,1,1,1]),Y=H.createBuffer();this.register((0,p.toDisposable)((()=>H.deleteBuffer(Y)))),H.bindBuffer(H.ARRAY_BUFFER,Y),H.bufferData(H.ARRAY_BUFFER,z,H.STATIC_DRAW),H.enableVertexAttribArray(3),H.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const ne=new Uint8Array([0,1,2,3]),V=H.createBuffer();this.register((0,p.toDisposable)((()=>H.deleteBuffer(V)))),H.bindBuffer(H.ELEMENT_ARRAY_BUFFER,V),H.bufferData(H.ELEMENT_ARRAY_BUFFER,ne,H.STATIC_DRAW),this._attributesBuffer=(0,g.throwIfFalsy)(H.createBuffer()),this.register((0,p.toDisposable)((()=>H.deleteBuffer(this._attributesBuffer)))),H.bindBuffer(H.ARRAY_BUFFER,this._attributesBuffer),H.enableVertexAttribArray(0),H.vertexAttribPointer(0,2,H.FLOAT,!1,x,0),H.vertexAttribDivisor(0,1),H.enableVertexAttribArray(1),H.vertexAttribPointer(1,2,H.FLOAT,!1,x,2*Float32Array.BYTES_PER_ELEMENT),H.vertexAttribDivisor(1,1),H.enableVertexAttribArray(2),H.vertexAttribPointer(2,4,H.FLOAT,!1,x,4*Float32Array.BYTES_PER_ELEMENT),H.vertexAttribDivisor(2,1),this._updateCachedColors(U.colors),this.register(this._themeService.onChangeColors((X=>{this._updateCachedColors(X),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(y){const L=this._gl;L.useProgram(this._program),L.bindVertexArray(this._vertexArrayObject),L.uniformMatrix4fv(this._projectionLocation,!1,S.PROJECTION_MATRIX),L.bindBuffer(L.ARRAY_BUFFER,this._attributesBuffer),L.bufferData(L.ARRAY_BUFFER,y.attributes,L.DYNAMIC_DRAW),L.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,L.UNSIGNED_BYTE,0,y.count)}handleResize(){this._updateViewportRectangle()}setDimensions(y){this._dimensions=y}_updateCachedColors(y){this._bgFloat=this._colorToFloat32Array(y.background),this._cursorFloat=this._colorToFloat32Array(y.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(y){const L=this._terminal,O=this._vertices;let U,H,z,Y,ne,V,X,I,j,W,B,F=1;for(U=0;U<L.rows;U++){for(z=-1,Y=0,ne=0,V=!1,H=0;H<L.cols;H++)X=(U*L.cols+H)*l.RENDER_MODEL_INDICIES_PER_CELL,I=y.cells[X+l.RENDER_MODEL_BG_OFFSET],j=y.cells[X+l.RENDER_MODEL_FG_OFFSET],W=!!(67108864&j),(I!==Y||j!==ne&&(V||W))&&((Y!==0||V&&ne!==0)&&(B=8*F++,this._updateRectangle(O,B,ne,Y,z,H,U)),z=H,Y=I,ne=j,V=W);(Y!==0||V&&ne!==0)&&(B=8*F++,this._updateRectangle(O,B,ne,Y,z,L.cols,U))}O.count=F}updateCursor(y){const L=this._verticesCursor,O=y.cursor;if(!O||O.style==="block")return void(L.count=0);let U,H=0;O.style!=="bar"&&O.style!=="outline"||(U=8*H++,this._addRectangleFloat(L.attributes,U,O.x*this._dimensions.device.cell.width,O.y*this._dimensions.device.cell.height,O.style==="bar"?O.dpr*O.cursorWidth:O.dpr,this._dimensions.device.cell.height,this._cursorFloat)),O.style!=="underline"&&O.style!=="outline"||(U=8*H++,this._addRectangleFloat(L.attributes,U,O.x*this._dimensions.device.cell.width,(O.y+1)*this._dimensions.device.cell.height-O.dpr,O.width*this._dimensions.device.cell.width,O.dpr,this._cursorFloat)),O.style==="outline"&&(U=8*H++,this._addRectangleFloat(L.attributes,U,O.x*this._dimensions.device.cell.width,O.y*this._dimensions.device.cell.height,O.width*this._dimensions.device.cell.width,O.dpr,this._cursorFloat),U=8*H++,this._addRectangleFloat(L.attributes,U,(O.x+O.width)*this._dimensions.device.cell.width-O.dpr,O.y*this._dimensions.device.cell.height,O.dpr,this._dimensions.device.cell.height,this._cursorFloat)),L.count=H}_updateRectangle(y,L,O,U,H,z,Y){if(67108864&O)switch(50331648&O){case 16777216:case 33554432:m=this._themeService.colors.ansi[255&O].rgba;break;case 50331648:m=(16777215&O)<<8;break;default:m=this._themeService.colors.foreground.rgba}else switch(50331648&U){case 16777216:case 33554432:m=this._themeService.colors.ansi[255&U].rgba;break;case 50331648:m=(16777215&U)<<8;break;default:m=this._themeService.colors.background.rgba}y.attributes.length<L+4&&(y.attributes=(0,S.expandFloat32Array)(y.attributes,this._terminal.rows*this._terminal.cols*8)),a=H*this._dimensions.device.cell.width,u=Y*this._dimensions.device.cell.height,f=(m>>24&255)/255,h=(m>>16&255)/255,b=(m>>8&255)/255,M=1,this._addRectangle(y.attributes,L,a,u,(z-H)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,f,h,b,M)}_addRectangle(y,L,O,U,H,z,Y,ne,V,X){y[L]=O/this._dimensions.device.canvas.width,y[L+1]=U/this._dimensions.device.canvas.height,y[L+2]=H/this._dimensions.device.canvas.width,y[L+3]=z/this._dimensions.device.canvas.height,y[L+4]=Y,y[L+5]=ne,y[L+6]=V,y[L+7]=X}_addRectangleFloat(y,L,O,U,H,z,Y){y[L]=O/this._dimensions.device.canvas.width,y[L+1]=U/this._dimensions.device.canvas.height,y[L+2]=H/this._dimensions.device.canvas.width,y[L+3]=z/this._dimensions.device.canvas.height,y[L+4]=Y[0],y[L+5]=Y[1],y[L+6]=Y[2],y[L+7]=Y[3]}_colorToFloat32Array(y){return new Float32Array([(y.rgba>>24&255)/255,(y.rgba>>16&255)/255,(y.rgba>>8&255)/255,(255&y.rgba)/255])}}r.RectangleRenderer=w},310:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderModel=r.COMBINED_CHAR_BIT_MASK=r.RENDER_MODEL_EXT_OFFSET=r.RENDER_MODEL_FG_OFFSET=r.RENDER_MODEL_BG_OFFSET=r.RENDER_MODEL_INDICIES_PER_CELL=void 0;const g=d(296);r.RENDER_MODEL_INDICIES_PER_CELL=4,r.RENDER_MODEL_BG_OFFSET=1,r.RENDER_MODEL_FG_OFFSET=2,r.RENDER_MODEL_EXT_OFFSET=3,r.COMBINED_CHAR_BIT_MASK=2147483648,r.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,g.createSelectionRenderModel)()}resize(p,l){const S=p*l*r.RENDER_MODEL_INDICIES_PER_CELL;S!==this.cells.length&&(this.cells=new Uint32Array(S),this.lineLengths=new Uint32Array(l))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.JoinedCellData=r.WebglRenderer=void 0;const g=d(820),p=d(274),l=d(627),S=d(457),x=d(56),R=d(374),m=d(345),a=d(859),u=d(147),f=d(782),h=d(855),b=d(965),M=d(742),w=d(310),T=d(733);class y extends a.Disposable{constructor(H,z,Y,ne,V,X,I,j,W){super(),this._terminal=H,this._characterJoinerService=z,this._charSizeService=Y,this._coreBrowserService=ne,this._coreService=V,this._decorationService=X,this._optionsService=I,this._themeService=j,this._cursorBlinkStateManager=new a.MutableDisposable,this._charAtlasDisposable=this.register(new a.MutableDisposable),this._observerDisposable=this.register(new a.MutableDisposable),this._model=new w.RenderModel,this._workCell=new f.CellData,this._workCell2=new f.CellData,this._rectangleRenderer=this.register(new a.MutableDisposable),this._glyphRenderer=this.register(new a.MutableDisposable),this._onChangeTextureAtlas=this.register(new m.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new m.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new m.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new m.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new m.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new p.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new T.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,I,this._themeService)],this.dimensions=(0,R.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(I.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const B={antialias:!1,depth:!1,preserveDrawingBuffer:W};if(this._gl=this._canvas.getContext("webgl2",B),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextlost",(F=>{console.log("webglcontextlost event received"),F.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(F)}),3e3)}))),this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextrestored",(F=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,l.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,x.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((F,te)=>this._setCanvasDevicePixelDimensions(F,te))),this.register(this._coreBrowserService.onWindowChange((F=>{this._observerDisposable.value=(0,x.observeDevicePixelDimensions)(this._canvas,F,((te,ie)=>this._setCanvasDevicePixelDimensions(te,ie)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,a.toDisposable)((()=>{for(const F of this._renderLayers)F.dispose();this._canvas.parentElement?.removeChild(this._canvas),(0,l.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(H,z){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const Y of this._renderLayers)Y.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(const H of this._renderLayers)H.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(const H of this._renderLayers)H.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(H,z,Y){for(const ne of this._renderLayers)ne.handleSelectionChanged(this._terminal,H,z,Y);this._model.selection.update(this._core,H,z,Y),this._requestRedrawViewport()}handleCursorMove(){for(const H of this._renderLayers)H.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new M.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new b.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const H=(0,l.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==H&&(this._onChangeTextureAtlas.fire(H.pages[0].canvas),this._charAtlasDisposable.value=(0,a.getDisposeArrayDisposable)([(0,m.forwardEvent)(H.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,m.forwardEvent)(H.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=H,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(H){this._model.clear(),H&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(const H of this._renderLayers)H.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(H){return-1}deregisterCharacterJoiner(H){return!1}renderRows(H,z){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const Y of this._renderLayers)Y.handleGridChanged(this._terminal,H,z);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(H,z),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new S.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(H,z){const Y=this._core;let ne,V,X,I,j,W,B,F,te,ie,he,ge,J,q,re=this._workCell;H=O(H,Y.rows-1,0),z=O(z,Y.rows-1,0);const _e=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,Ce=_e-Y.buffer.ydisp,we=Math.min(this._terminal.buffer.active.cursorX,Y.cols-1);let Be=-1;const Re=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Ge=!1;for(V=H;V<=z;V++)for(X=V+Y.buffer.ydisp,I=Y.buffer.lines.get(X),this._model.lineLengths[V]=0,j=this._characterJoinerService.getJoinedCharacters(X),J=0;J<Y.cols;J++)if(ne=this._cellColorResolver.result.bg,I.loadCell(J,re),J===0&&(ne=this._cellColorResolver.result.bg),W=!1,B=J,j.length>0&&J===j[0][0]&&(W=!0,F=j.shift(),re=new L(re,I.translateToString(!0,F[0],F[1]),F[1]-F[0]),B=F[1]-1),te=re.getChars(),ie=re.getCode(),ge=(V*Y.cols+J)*w.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(re,J,X,this.dimensions.device.cell.width),Re&&X===_e&&(J===we&&(this._model.cursor={x:we,y:Ce,width:re.getWidth(),style:this._coreBrowserService.isFocused?Y.options.cursorStyle||"block":Y.options.cursorInactiveStyle,cursorWidth:Y.options.cursorWidth,dpr:this._devicePixelRatio},Be=we+re.getWidth()-1),J>=we&&J<=Be&&(this._coreBrowserService.isFocused&&(Y.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&Y.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),ie!==h.NULL_CELL_CODE&&(this._model.lineLengths[V]=J+1),(this._model.cells[ge]!==ie||this._model.cells[ge+w.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[ge+w.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[ge+w.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Ge=!0,te.length>1&&(ie|=w.COMBINED_CHAR_BIT_MASK),this._model.cells[ge]=ie,this._model.cells[ge+w.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[ge+w.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[ge+w.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,he=re.getWidth(),this._glyphRenderer.value.updateCell(J,V,ie,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,te,he,ne),W))for(re=this._workCell,J++;J<B;J++)q=(V*Y.cols+J)*w.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(J,V,h.NULL_CELL_CODE,0,0,0,h.NULL_CELL_CHAR,0,0),this._model.cells[q]=h.NULL_CELL_CODE,this._model.cells[q+w.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[q+w.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[q+w.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Ge&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(H,z){this._canvas.width===H&&this._canvas.height===z||(this._canvas.width=H,this._canvas.height=z,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const H=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:H,end:H})}}r.WebglRenderer=y;class L extends u.AttributeData{constructor(H,z,Y){super(),this.content=0,this.combinedData="",this.fg=H.fg,this.bg=H.bg,this.combinedData=z,this._width=Y}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(H){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function O(U,H,z=0){return Math.max(Math.min(U,H),z)}r.JoinedCellData=L},381:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GLTexture=r.expandFloat32Array=r.createShader=r.createProgram=r.PROJECTION_MATRIX=void 0;const g=d(374);function p(l,S,x){const R=(0,g.throwIfFalsy)(l.createShader(S));if(l.shaderSource(R,x),l.compileShader(R),l.getShaderParameter(R,l.COMPILE_STATUS))return R;console.error(l.getShaderInfoLog(R)),l.deleteShader(R)}r.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),r.createProgram=function(l,S,x){const R=(0,g.throwIfFalsy)(l.createProgram());if(l.attachShader(R,(0,g.throwIfFalsy)(p(l,l.VERTEX_SHADER,S))),l.attachShader(R,(0,g.throwIfFalsy)(p(l,l.FRAGMENT_SHADER,x))),l.linkProgram(R),l.getProgramParameter(R,l.LINK_STATUS))return R;console.error(l.getProgramInfoLog(R)),l.deleteProgram(R)},r.createShader=p,r.expandFloat32Array=function(l,S){const x=Math.min(2*l.length,S),R=new Float32Array(x);for(let m=0;m<l.length;m++)R[m]=l[m];return R},r.GLTexture=class{constructor(l){this.texture=l,this.version=-1}}},592:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BaseRenderLayer=void 0;const g=d(627),p=d(237),l=d(374),S=d(859);class x extends S.Disposable{constructor(m,a,u,f,h,b,M,w){super(),this._container=a,this._alpha=h,this._coreBrowserService=b,this._optionsService=M,this._themeService=w,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${u}-layer`),this._canvas.style.zIndex=f.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((T=>{this._refreshCharAtlas(m,T),this.reset(m)}))),this.register((0,S.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,l.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(m){}handleFocus(m){}handleCursorMove(m){}handleGridChanged(m,a,u){}handleSelectionChanged(m,a,u,f=!1){}_setTransparency(m,a){if(a===this._alpha)return;const u=this._canvas;this._alpha=a,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,u),this._refreshCharAtlas(m,this._themeService.colors),this.handleGridChanged(m,0,m.rows-1)}_refreshCharAtlas(m,a){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,g.acquireTextureAtlas)(m,this._optionsService.rawOptions,a,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(m,a){this._deviceCellWidth=a.device.cell.width,this._deviceCellHeight=a.device.cell.height,this._deviceCharWidth=a.device.char.width,this._deviceCharHeight=a.device.char.height,this._deviceCharLeft=a.device.char.left,this._deviceCharTop=a.device.char.top,this._canvas.width=a.device.canvas.width,this._canvas.height=a.device.canvas.height,this._canvas.style.width=`${a.css.canvas.width}px`,this._canvas.style.height=`${a.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(m,this._themeService.colors)}_fillBottomLineAtCells(m,a,u=1){this._ctx.fillRect(m*this._deviceCellWidth,(a+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,u*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(m,a,u,f){this._alpha?this._ctx.clearRect(m*this._deviceCellWidth,a*this._deviceCellHeight,u*this._deviceCellWidth,f*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(m*this._deviceCellWidth,a*this._deviceCellHeight,u*this._deviceCellWidth,f*this._deviceCellHeight))}_fillCharTrueColor(m,a,u,f){this._ctx.font=this._getFont(m,!1,!1),this._ctx.textBaseline=p.TEXT_BASELINE,this._clipCell(u,f,a.getWidth()),this._ctx.fillText(a.getChars(),u*this._deviceCellWidth+this._deviceCharLeft,f*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(m,a,u){this._ctx.beginPath(),this._ctx.rect(m*this._deviceCellWidth,a*this._deviceCellHeight,u*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(m,a,u){return`${u?"italic":""} ${a?m.options.fontWeightBold:m.options.fontWeight} ${m.options.fontSize*this._coreBrowserService.dpr}px ${m.options.fontFamily}`}}r.BaseRenderLayer=x},733:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkRenderLayer=void 0;const g=d(197),p=d(237),l=d(592);class S extends l.BaseRenderLayer{constructor(R,m,a,u,f,h,b){super(a,R,"link",m,!0,f,h,b),this.register(u.onShowLinkUnderline((M=>this._handleShowLinkUnderline(M)))),this.register(u.onHideLinkUnderline((M=>this._handleHideLinkUnderline(M))))}resize(R,m){super.resize(R,m),this._state=void 0}reset(R){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const R=this._state.y2-this._state.y1-1;R>0&&this._clearCells(0,this._state.y1+1,this._state.cols,R),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(R){if(R.fg===p.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:R.fg!==void 0&&(0,g.is256Color)(R.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[R.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,R.y1===R.y2)this._fillBottomLineAtCells(R.x1,R.y1,R.x2-R.x1);else{this._fillBottomLineAtCells(R.x1,R.y1,R.cols-R.x1);for(let m=R.y1+1;m<R.y2;m++)this._fillBottomLineAtCells(0,m,R.cols);this._fillBottomLineAtCells(0,R.y2,R.x2)}this._state=R}_handleHideLinkUnderline(R){this._clearCurrentLink()}}r.LinkRenderLayer=S},820:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(d,g,p,l){d.addEventListener(g,p,l);let S=!1;return{dispose:()=>{S||(S=!0,d.removeEventListener(g,p,l))}}}},274:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellColorResolver=void 0;const g=d(855),p=d(160),l=d(374);let S,x=0,R=0,m=!1,a=!1,u=!1,f=0;r.CellColorResolver=class{constructor(h,b,M,w,T,y){this._terminal=h,this._optionService=b,this._selectionRenderModel=M,this._decorationService=w,this._coreBrowserService=T,this._themeService=y,this.result={fg:0,bg:0,ext:0}}resolve(h,b,M,w){if(this.result.bg=h.bg,this.result.fg=h.fg,this.result.ext=268435456&h.bg?h.extended.ext:0,R=0,x=0,a=!1,m=!1,u=!1,S=this._themeService.colors,f=0,h.getCode()!==g.NULL_CELL_CODE&&h.extended.underlineStyle===4){const T=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));f=b*w%(2*Math.round(T))}if(this._decorationService.forEachDecorationAtCell(b,M,"bottom",(T=>{T.backgroundColorRGB&&(R=T.backgroundColorRGB.rgba>>8&16777215,a=!0),T.foregroundColorRGB&&(x=T.foregroundColorRGB.rgba>>8&16777215,m=!0)})),u=this._selectionRenderModel.isCellSelected(this._terminal,b,M),u){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:R=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:R=(16777215&this.result.fg)<<8|255;break;default:R=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:R=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:R=(16777215&this.result.bg)<<8|255}R=p.rgba.blend(R,4294967040&(this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else R=(this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(a=!0,S.selectionForeground&&(x=S.selectionForeground.rgba>>8&16777215,m=!0),(0,l.treatGlyphAsBackgroundColor)(h.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)x=(this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:x=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:x=(16777215&this.result.fg)<<8|255;break;default:x=this._themeService.colors.foreground.rgba}x=p.rgba.blend(x,4294967040&(this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}m=!0}}this._decorationService.forEachDecorationAtCell(b,M,"top",(T=>{T.backgroundColorRGB&&(R=T.backgroundColorRGB.rgba>>8&16777215,a=!0),T.foregroundColorRGB&&(x=T.foregroundColorRGB.rgba>>8&16777215,m=!0)})),a&&(R=u?-16777216&h.bg&-134217729|R|50331648:-16777216&h.bg|R|50331648),m&&(x=-16777216&h.fg&-67108865|x|50331648),67108864&this.result.fg&&(a&&!m&&(x=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&S.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,m=!0),!a&&m&&(R=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&S.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,a=!0)),S=void 0,this.result.bg=a?R:this.result.bg,this.result.fg=m?x:this.result.fg,this.result.ext&=536870911,this.result.ext|=f<<29&3758096384}}},627:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.removeTerminalFromCache=r.acquireTextureAtlas=void 0;const g=d(509),p=d(197),l=[];r.acquireTextureAtlas=function(S,x,R,m,a,u,f,h){const b=(0,p.generateConfig)(m,a,u,f,x,R,h);for(let T=0;T<l.length;T++){const y=l[T],L=y.ownedBy.indexOf(S);if(L>=0){if((0,p.configEquals)(y.config,b))return y.atlas;y.ownedBy.length===1?(y.atlas.dispose(),l.splice(T,1)):y.ownedBy.splice(L,1);break}}for(let T=0;T<l.length;T++){const y=l[T];if((0,p.configEquals)(y.config,b))return y.ownedBy.push(S),y.atlas}const M=S._core,w={atlas:new g.TextureAtlas(document,b,M.unicodeService),config:b,ownedBy:[S]};return l.push(w),w.atlas},r.removeTerminalFromCache=function(S){for(let x=0;x<l.length;x++){const R=l[x].ownedBy.indexOf(S);if(R!==-1){l[x].ownedBy.length===1?(l[x].atlas.dispose(),l.splice(x,1)):l[x].ownedBy.splice(R,1);break}}}},197:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.is256Color=r.configEquals=r.generateConfig=void 0;const g=d(160);r.generateConfig=function(p,l,S,x,R,m,a){const u={foreground:m.foreground,background:m.background,cursor:g.NULL_COLOR,cursorAccent:g.NULL_COLOR,selectionForeground:g.NULL_COLOR,selectionBackgroundTransparent:g.NULL_COLOR,selectionBackgroundOpaque:g.NULL_COLOR,selectionInactiveBackgroundTransparent:g.NULL_COLOR,selectionInactiveBackgroundOpaque:g.NULL_COLOR,ansi:m.ansi.slice(),contrastCache:m.contrastCache,halfContrastCache:m.halfContrastCache};return{customGlyphs:R.customGlyphs,devicePixelRatio:a,letterSpacing:R.letterSpacing,lineHeight:R.lineHeight,deviceCellWidth:p,deviceCellHeight:l,deviceCharWidth:S,deviceCharHeight:x,fontFamily:R.fontFamily,fontSize:R.fontSize,fontWeight:R.fontWeight,fontWeightBold:R.fontWeightBold,allowTransparency:R.allowTransparency,drawBoldTextInBrightColors:R.drawBoldTextInBrightColors,minimumContrastRatio:R.minimumContrastRatio,colors:u}},r.configEquals=function(p,l){for(let S=0;S<p.colors.ansi.length;S++)if(p.colors.ansi[S].rgba!==l.colors.ansi[S].rgba)return!1;return p.devicePixelRatio===l.devicePixelRatio&&p.customGlyphs===l.customGlyphs&&p.lineHeight===l.lineHeight&&p.letterSpacing===l.letterSpacing&&p.fontFamily===l.fontFamily&&p.fontSize===l.fontSize&&p.fontWeight===l.fontWeight&&p.fontWeightBold===l.fontWeightBold&&p.allowTransparency===l.allowTransparency&&p.deviceCharWidth===l.deviceCharWidth&&p.deviceCharHeight===l.deviceCharHeight&&p.drawBoldTextInBrightColors===l.drawBoldTextInBrightColors&&p.minimumContrastRatio===l.minimumContrastRatio&&p.colors.foreground.rgba===l.colors.foreground.rgba&&p.colors.background.rgba===l.colors.background.rgba},r.is256Color=function(p){return(50331648&p)==16777216||(50331648&p)==33554432}},237:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const g=d(399);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=g.isFirefox||g.isLegacyEdge?"bottom":"ideographic"},457:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CursorBlinkStateManager=void 0,r.CursorBlinkStateManager=class{constructor(d,g){this._renderCallback=d,this._coreBrowserService=g,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(d=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const g=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,g>0)return void this._restartInterval(g)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const g=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(g)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),d)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tryDrawCustomChar=r.powerlineDefinitions=r.boxDrawingDefinitions=r.blockElementDefinitions=void 0;const g=d(374);r.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const p={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};r.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(m,a)=>`M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a}`},"║":{1:(m,a)=>`M${.5-m},0 L${.5-m},1 M${.5+m},0 L${.5+m},1`},"╒":{1:(m,a)=>`M.5,1 L.5,${.5-a} L1,${.5-a} M.5,${.5+a} L1,${.5+a}`},"╓":{1:(m,a)=>`M${.5-m},1 L${.5-m},.5 L1,.5 M${.5+m},.5 L${.5+m},1`},"╔":{1:(m,a)=>`M1,${.5-a} L${.5-m},${.5-a} L${.5-m},1 M1,${.5+a} L${.5+m},${.5+a} L${.5+m},1`},"╕":{1:(m,a)=>`M0,${.5-a} L.5,${.5-a} L.5,1 M0,${.5+a} L.5,${.5+a}`},"╖":{1:(m,a)=>`M${.5+m},1 L${.5+m},.5 L0,.5 M${.5-m},.5 L${.5-m},1`},"╗":{1:(m,a)=>`M0,${.5+a} L${.5-m},${.5+a} L${.5-m},1 M0,${.5-a} L${.5+m},${.5-a} L${.5+m},1`},"╘":{1:(m,a)=>`M.5,0 L.5,${.5+a} L1,${.5+a} M.5,${.5-a} L1,${.5-a}`},"╙":{1:(m,a)=>`M1,.5 L${.5-m},.5 L${.5-m},0 M${.5+m},.5 L${.5+m},0`},"╚":{1:(m,a)=>`M1,${.5-a} L${.5+m},${.5-a} L${.5+m},0 M1,${.5+a} L${.5-m},${.5+a} L${.5-m},0`},"╛":{1:(m,a)=>`M0,${.5+a} L.5,${.5+a} L.5,0 M0,${.5-a} L.5,${.5-a}`},"╜":{1:(m,a)=>`M0,.5 L${.5+m},.5 L${.5+m},0 M${.5-m},.5 L${.5-m},0`},"╝":{1:(m,a)=>`M0,${.5-a} L${.5-m},${.5-a} L${.5-m},0 M0,${.5+a} L${.5+m},${.5+a} L${.5+m},0`},"╞":{1:(m,a)=>`M.5,0 L.5,1 M.5,${.5-a} L1,${.5-a} M.5,${.5+a} L1,${.5+a}`},"╟":{1:(m,a)=>`M${.5-m},0 L${.5-m},1 M${.5+m},0 L${.5+m},1 M${.5+m},.5 L1,.5`},"╠":{1:(m,a)=>`M${.5-m},0 L${.5-m},1 M1,${.5+a} L${.5+m},${.5+a} L${.5+m},1 M1,${.5-a} L${.5+m},${.5-a} L${.5+m},0`},"╡":{1:(m,a)=>`M.5,0 L.5,1 M0,${.5-a} L.5,${.5-a} M0,${.5+a} L.5,${.5+a}`},"╢":{1:(m,a)=>`M0,.5 L${.5-m},.5 M${.5-m},0 L${.5-m},1 M${.5+m},0 L${.5+m},1`},"╣":{1:(m,a)=>`M${.5+m},0 L${.5+m},1 M0,${.5+a} L${.5-m},${.5+a} L${.5-m},1 M0,${.5-a} L${.5-m},${.5-a} L${.5-m},0`},"╤":{1:(m,a)=>`M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a} M.5,${.5+a} L.5,1`},"╥":{1:(m,a)=>`M0,.5 L1,.5 M${.5-m},.5 L${.5-m},1 M${.5+m},.5 L${.5+m},1`},"╦":{1:(m,a)=>`M0,${.5-a} L1,${.5-a} M0,${.5+a} L${.5-m},${.5+a} L${.5-m},1 M1,${.5+a} L${.5+m},${.5+a} L${.5+m},1`},"╧":{1:(m,a)=>`M.5,0 L.5,${.5-a} M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a}`},"╨":{1:(m,a)=>`M0,.5 L1,.5 M${.5-m},.5 L${.5-m},0 M${.5+m},.5 L${.5+m},0`},"╩":{1:(m,a)=>`M0,${.5+a} L1,${.5+a} M0,${.5-a} L${.5-m},${.5-a} L${.5-m},0 M1,${.5-a} L${.5+m},${.5-a} L${.5+m},0`},"╪":{1:(m,a)=>`M.5,0 L.5,1 M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a}`},"╫":{1:(m,a)=>`M0,.5 L1,.5 M${.5-m},0 L${.5-m},1 M${.5+m},0 L${.5+m},1`},"╬":{1:(m,a)=>`M0,${.5+a} L${.5-m},${.5+a} L${.5-m},1 M1,${.5+a} L${.5+m},${.5+a} L${.5+m},1 M0,${.5-a} L${.5-m},${.5-a} L${.5-m},0 M1,${.5-a} L${.5+m},${.5-a} L${.5+m},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(m,a)=>`M.5,1 L.5,${.5+a/.15*.5} C.5,${.5+a/.15*.5},.5,.5,1,.5`},"╮":{1:(m,a)=>`M.5,1 L.5,${.5+a/.15*.5} C.5,${.5+a/.15*.5},.5,.5,0,.5`},"╯":{1:(m,a)=>`M.5,0 L.5,${.5-a/.15*.5} C.5,${.5-a/.15*.5},.5,.5,0,.5`},"╰":{1:(m,a)=>`M.5,0 L.5,${.5-a/.15*.5} C.5,${.5-a/.15*.5},.5,.5,1,.5`}},r.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.tryDrawCustomChar=function(m,a,u,f,h,b,M,w){const T=r.blockElementDefinitions[a];if(T)return(function(U,H,z,Y,ne,V){for(let X=0;X<H.length;X++){const I=H[X],j=ne/8,W=V/8;U.fillRect(z+I.x*j,Y+I.y*W,I.w*j,I.h*W)}})(m,T,u,f,h,b),!0;const y=p[a];if(y)return(function(U,H,z,Y,ne,V){let X=l.get(H);X||(X=new Map,l.set(H,X));const I=U.fillStyle;if(typeof I!="string")throw new Error(`Unexpected fillStyle type "${I}"`);let j=X.get(I);if(!j){const W=H[0].length,B=H.length,F=U.canvas.ownerDocument.createElement("canvas");F.width=W,F.height=B;const te=(0,g.throwIfFalsy)(F.getContext("2d")),ie=new ImageData(W,B);let he,ge,J,q;if(I.startsWith("#"))he=parseInt(I.slice(1,3),16),ge=parseInt(I.slice(3,5),16),J=parseInt(I.slice(5,7),16),q=I.length>7&&parseInt(I.slice(7,9),16)||1;else{if(!I.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${I}" when drawing pattern glyph`);[he,ge,J,q]=I.substring(5,I.length-1).split(",").map((re=>parseFloat(re)))}for(let re=0;re<B;re++)for(let _e=0;_e<W;_e++)ie.data[4*(re*W+_e)]=he,ie.data[4*(re*W+_e)+1]=ge,ie.data[4*(re*W+_e)+2]=J,ie.data[4*(re*W+_e)+3]=H[re][_e]*(255*q);te.putImageData(ie,0,0),j=(0,g.throwIfFalsy)(U.createPattern(F,null)),X.set(I,j)}U.fillStyle=j,U.fillRect(z,Y,ne,V)})(m,y,u,f,h,b),!0;const L=r.boxDrawingDefinitions[a];if(L)return(function(U,H,z,Y,ne,V,X){U.strokeStyle=U.fillStyle;for(const[I,j]of Object.entries(H)){let W;U.beginPath(),U.lineWidth=X*Number.parseInt(I),W=typeof j=="function"?j(.15,.15/V*ne):j;for(const B of W.split(" ")){const F=B[0],te=x[F];if(!te){console.error(`Could not find drawing instructions for "${F}"`);continue}const ie=B.substring(1).split(",");ie[0]&&ie[1]&&te(U,R(ie,ne,V,z,Y,!0,X))}U.stroke(),U.closePath()}})(m,L,u,f,h,b,w),!0;const O=r.powerlineDefinitions[a];return!!O&&((function(U,H,z,Y,ne,V,X,I){const j=new Path2D;j.rect(z,Y,ne,V),U.clip(j),U.beginPath();const W=X/12;U.lineWidth=I*W;for(const B of H.d.split(" ")){const F=B[0],te=x[F];if(!te){console.error(`Could not find drawing instructions for "${F}"`);continue}const ie=B.substring(1).split(",");ie[0]&&ie[1]&&te(U,R(ie,ne,V,z,Y,!1,I,(H.leftPadding??0)*(W/2),(H.rightPadding??0)*(W/2)))}H.type===1?(U.strokeStyle=U.fillStyle,U.stroke()):U.fill(),U.closePath()})(m,O,u,f,h,b,M,w),!0)};const l=new Map;function S(m,a,u=0){return Math.max(Math.min(m,a),u)}const x={C:(m,a)=>m.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]),L:(m,a)=>m.lineTo(a[0],a[1]),M:(m,a)=>m.moveTo(a[0],a[1])};function R(m,a,u,f,h,b,M,w=0,T=0){const y=m.map((L=>parseFloat(L)||parseInt(L)));if(y.length<2)throw new Error("Too few arguments for instruction");for(let L=0;L<y.length;L+=2)y[L]*=a-w*M-T*M,b&&y[L]!==0&&(y[L]=S(Math.round(y[L]+.5)-.5,a,0)),y[L]+=f+w*M;for(let L=1;L<y.length;L+=2)y[L]*=u,b&&y[L]!==0&&(y[L]=S(Math.round(y[L]+.5)-.5,u,0)),y[L]+=h;return y}},56:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.observeDevicePixelDimensions=void 0;const g=d(859);r.observeDevicePixelDimensions=function(p,l,S){let x=new l.ResizeObserver((R=>{const m=R.find((f=>f.target===p));if(!m)return;if(!("devicePixelContentBoxSize"in m))return x?.disconnect(),void(x=void 0);const a=m.devicePixelContentBoxSize[0].inlineSize,u=m.devicePixelContentBoxSize[0].blockSize;a>0&&u>0&&S(a,u)}));try{x.observe(p,{box:["device-pixel-content-box"]})}catch{x.disconnect(),x=void 0}return(0,g.toDisposable)((()=>x?.disconnect()))}},374:(P,r)=>{function d(p){return 57508<=p&&p<=57558}function g(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(r,"__esModule",{value:!0}),r.computeNextVariantOffset=r.createRenderDimensions=r.treatGlyphAsBackgroundColor=r.allowRescaling=r.isEmoji=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},r.isPowerlineGlyph=d,r.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},r.isEmoji=g,r.allowRescaling=function(p,l,S,x){return l===1&&S>Math.ceil(1.5*x)&&p!==void 0&&p>255&&!g(p)&&!d(p)&&!(function(R){return 57344<=R&&R<=63743})(p)},r.treatGlyphAsBackgroundColor=function(p){return d(p)||(function(l){return 9472<=l&&l<=9631})(p)},r.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}}}},r.computeNextVariantOffset=function(p,l,S=0){return(p-(2*Math.round(l)-S))%(2*Math.round(l))}},296:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class d{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(p,l,S,x=!1){if(this.selectionStart=l,this.selectionEnd=S,!l||!S||l[0]===S[0]&&l[1]===S[1])return void this.clear();const R=p.buffers.active.ydisp,m=l[1]-R,a=S[1]-R,u=Math.max(m,0),f=Math.min(a,p.rows-1);u>=p.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=m,this.viewportEndRow=a,this.viewportCappedStartRow=u,this.viewportCappedEndRow=f,this.startCol=l[0],this.endCol=S[0])}isCellSelected(p,l,S){return!!this.hasSelection&&(S-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&S>=this.viewportCappedStartRow&&l<this.endCol&&S<=this.viewportCappedEndRow:l<this.startCol&&S>=this.viewportCappedStartRow&&l>=this.endCol&&S<=this.viewportCappedEndRow:S>this.viewportStartRow&&S<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&S===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportStartRow&&l>=this.startCol)}}r.createSelectionRenderModel=function(){return new d}},509:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TextureAtlas=void 0;const g=d(237),p=d(860),l=d(374),S=d(160),x=d(345),R=d(485),m=d(385),a=d(147),u=d(855),f={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let h;class b{get pages(){return this._pages}constructor(L,O,U){this._document=L,this._config=O,this._unicodeService=U,this._didWarmUp=!1,this._cacheMap=new R.FourKeyMap,this._cacheMapCombined=new R.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new a.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new x.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new x.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=T(L,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,l.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const L of this.pages)L.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const L=new m.IdleTaskQueue;for(let O=33;O<126;O++)L.enqueue((()=>{if(!this._cacheMap.get(O,u.DEFAULT_COLOR,u.DEFAULT_COLOR,u.DEFAULT_EXT)){const U=this._drawToCache(O,u.DEFAULT_COLOR,u.DEFAULT_COLOR,u.DEFAULT_EXT);this._cacheMap.set(O,u.DEFAULT_COLOR,u.DEFAULT_COLOR,u.DEFAULT_EXT,U)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const L of this._pages)L.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(b.maxAtlasPages&&this._pages.length>=Math.max(4,b.maxAtlasPages)){const O=this._pages.filter((X=>2*X.canvas.width<=(b.maxTextureSize||4096))).sort(((X,I)=>I.canvas.width!==X.canvas.width?I.canvas.width-X.canvas.width:I.percentageUsed-X.percentageUsed));let U=-1,H=0;for(let X=0;X<O.length;X++)if(O[X].canvas.width!==H)U=X,H=O[X].canvas.width;else if(X-U==3)break;const z=O.slice(U,U+4),Y=z.map((X=>X.glyphs[0].texturePage)).sort(((X,I)=>X>I?1:-1)),ne=this.pages.length-z.length,V=this._mergePages(z,ne);V.version++;for(let X=Y.length-1;X>=0;X--)this._deletePage(Y[X]);this.pages.push(V),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(V.canvas)}const L=new M(this._document,this._textureSize);return this._pages.push(L),this._activePages.push(L),this._onAddTextureAtlasCanvas.fire(L.canvas),L}_mergePages(L,O){const U=2*L[0].canvas.width,H=new M(this._document,U,L);for(const[z,Y]of L.entries()){const ne=z*Y.canvas.width%U,V=Math.floor(z/2)*Y.canvas.height;H.ctx.drawImage(Y.canvas,ne,V);for(const I of Y.glyphs)I.texturePage=O,I.sizeClipSpace.x=I.size.x/U,I.sizeClipSpace.y=I.size.y/U,I.texturePosition.x+=ne,I.texturePosition.y+=V,I.texturePositionClipSpace.x=I.texturePosition.x/U,I.texturePositionClipSpace.y=I.texturePosition.y/U;this._onRemoveTextureAtlasCanvas.fire(Y.canvas);const X=this._activePages.indexOf(Y);X!==-1&&this._activePages.splice(X,1)}return H}_deletePage(L){this._pages.splice(L,1);for(let O=L;O<this._pages.length;O++){const U=this._pages[O];for(const H of U.glyphs)H.texturePage--;U.version++}}getRasterizedGlyphCombinedChar(L,O,U,H,z){return this._getFromCacheMap(this._cacheMapCombined,L,O,U,H,z)}getRasterizedGlyph(L,O,U,H,z){return this._getFromCacheMap(this._cacheMap,L,O,U,H,z)}_getFromCacheMap(L,O,U,H,z,Y=!1){return h=L.get(O,U,H,z),h||(h=this._drawToCache(O,U,H,z,Y),L.set(O,U,H,z,h)),h}_getColorFromAnsiIndex(L){if(L>=this._config.colors.ansi.length)throw new Error("No color found for idx "+L);return this._config.colors.ansi[L]}_getBackgroundColor(L,O,U,H){if(this._config.allowTransparency)return S.NULL_COLOR;let z;switch(L){case 16777216:case 33554432:z=this._getColorFromAnsiIndex(O);break;case 50331648:const Y=a.AttributeData.toColorRGB(O);z=S.channels.toColor(Y[0],Y[1],Y[2]);break;default:z=U?S.color.opaque(this._config.colors.foreground):this._config.colors.background}return z}_getForegroundColor(L,O,U,H,z,Y,ne,V,X,I){const j=this._getMinimumContrastColor(L,O,U,H,z,Y,ne,X,V,I);if(j)return j;let W;switch(z){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&X&&Y<8&&(Y+=8),W=this._getColorFromAnsiIndex(Y);break;case 50331648:const B=a.AttributeData.toColorRGB(Y);W=S.channels.toColor(B[0],B[1],B[2]);break;default:W=ne?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(W=S.color.opaque(W)),V&&(W=S.color.multiplyOpacity(W,g.DIM_OPACITY)),W}_resolveBackgroundRgba(L,O,U){switch(L){case 16777216:case 33554432:return this._getColorFromAnsiIndex(O).rgba;case 50331648:return O<<8;default:return U?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(L,O,U,H){switch(L){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&H&&O<8&&(O+=8),this._getColorFromAnsiIndex(O).rgba;case 50331648:return O<<8;default:return U?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(L,O,U,H,z,Y,ne,V,X,I){if(this._config.minimumContrastRatio===1||I)return;const j=this._getContrastCache(X),W=j.getColor(L,H);if(W!==void 0)return W||void 0;const B=this._resolveBackgroundRgba(O,U,ne),F=this._resolveForegroundRgba(z,Y,ne,V),te=S.rgba.ensureContrastRatio(B,F,this._config.minimumContrastRatio/(X?2:1));if(!te)return void j.setColor(L,H,null);const ie=S.channels.toColor(te>>24&255,te>>16&255,te>>8&255);return j.setColor(L,H,ie),ie}_getContrastCache(L){return L?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(L,O,U,H,z=!1){const Y=typeof L=="number"?String.fromCharCode(L):L,ne=Math.min(this._config.deviceCellWidth*Math.max(Y.length,2)+4,this._textureSize);this._tmpCanvas.width<ne&&(this._tmpCanvas.width=ne);const V=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<V&&(this._tmpCanvas.height=V),this._tmpCtx.save(),this._workAttributeData.fg=U,this._workAttributeData.bg=O,this._workAttributeData.extended.ext=H,this._workAttributeData.isInvisible())return f;const X=!!this._workAttributeData.isBold(),I=!!this._workAttributeData.isInverse(),j=!!this._workAttributeData.isDim(),W=!!this._workAttributeData.isItalic(),B=!!this._workAttributeData.isUnderline(),F=!!this._workAttributeData.isStrikethrough(),te=!!this._workAttributeData.isOverline();let ie=this._workAttributeData.getFgColor(),he=this._workAttributeData.getFgColorMode(),ge=this._workAttributeData.getBgColor(),J=this._workAttributeData.getBgColorMode();if(I){const ue=ie;ie=ge,ge=ue;const be=he;he=J,J=be}const q=this._getBackgroundColor(J,ge,I,j);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=q.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const re=X?this._config.fontWeightBold:this._config.fontWeight,_e=W?"italic":"";this._tmpCtx.font=`${_e} ${re} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=g.TEXT_BASELINE;const Ce=Y.length===1&&(0,l.isPowerlineGlyph)(Y.charCodeAt(0)),we=Y.length===1&&(0,l.isRestrictedPowerlineGlyph)(Y.charCodeAt(0)),Be=this._getForegroundColor(O,J,ge,U,he,ie,I,j,X,(0,l.treatGlyphAsBackgroundColor)(Y.charCodeAt(0)));this._tmpCtx.fillStyle=Be.css;const Re=we?0:4;let Ge=!1;this._config.customGlyphs!==!1&&(Ge=(0,p.tryDrawCustomChar)(this._tmpCtx,Y,Re,Re,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let tt,De=!Ce;if(tt=typeof L=="number"?this._unicodeService.wcwidth(L):this._unicodeService.getStringCellWidth(L),B){this._tmpCtx.save();const ue=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),be=ue%2==1?.5:0;if(this._tmpCtx.lineWidth=ue,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())De=!1,this._tmpCtx.strokeStyle=`rgb(${a.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{De=!1;let ke=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&ke<8&&(ke+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(ke).css}this._tmpCtx.beginPath();const Le=Re,Pe=Math.ceil(Re+this._config.deviceCharHeight)-be-(z?2*ue:0),lt=Pe+ue,dt=Pe+2*ue;let vt=this._workAttributeData.getUnderlineVariantOffset();for(let ke=0;ke<tt;ke++){this._tmpCtx.save();const Ie=Le+ke*this._config.deviceCellWidth,je=Le+(ke+1)*this._config.deviceCellWidth,Wt=Ie+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Ie,Pe),this._tmpCtx.lineTo(je,Pe),this._tmpCtx.moveTo(Ie,dt),this._tmpCtx.lineTo(je,dt);break;case 3:const wt=ue<=1?dt:Math.ceil(Re+this._config.deviceCharHeight-ue/2)-be,Ot=ue<=1?Pe:Math.ceil(Re+this._config.deviceCharHeight+ue/2)-be,$e=new Path2D;$e.rect(Ie,Pe,this._config.deviceCellWidth,dt-Pe),this._tmpCtx.clip($e),this._tmpCtx.moveTo(Ie-this._config.deviceCellWidth/2,lt),this._tmpCtx.bezierCurveTo(Ie-this._config.deviceCellWidth/2,Ot,Ie,Ot,Ie,lt),this._tmpCtx.bezierCurveTo(Ie,wt,Wt,wt,Wt,lt),this._tmpCtx.bezierCurveTo(Wt,Ot,je,Ot,je,lt),this._tmpCtx.bezierCurveTo(je,wt,je+this._config.deviceCellWidth/2,wt,je+this._config.deviceCellWidth/2,lt);break;case 4:const St=vt===0?0:vt>=ue?2*ue-vt:ue-vt;vt>=ue||St===0?(this._tmpCtx.setLineDash([Math.round(ue),Math.round(ue)]),this._tmpCtx.moveTo(Ie+St,Pe),this._tmpCtx.lineTo(je,Pe)):(this._tmpCtx.setLineDash([Math.round(ue),Math.round(ue)]),this._tmpCtx.moveTo(Ie,Pe),this._tmpCtx.lineTo(Ie+St,Pe),this._tmpCtx.moveTo(Ie+St+ue,Pe),this._tmpCtx.lineTo(je,Pe)),vt=(0,l.computeNextVariantOffset)(je-Ie,ue,vt);break;case 5:const Gr=.6,di=.3,Ei=je-Ie,Ai=Math.floor(Gr*Ei),ws=Math.floor(di*Ei),ri=Ei-Ai-ws;this._tmpCtx.setLineDash([Ai,ws,ri]),this._tmpCtx.moveTo(Ie,Pe),this._tmpCtx.lineTo(je,Pe);break;default:this._tmpCtx.moveTo(Ie,Pe),this._tmpCtx.lineTo(je,Pe)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Ge&&this._config.fontSize>=12&&!this._config.allowTransparency&&Y!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const ke=this._tmpCtx.measureText(Y);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in ke&&ke.actualBoundingBoxDescent>0){this._tmpCtx.save();const Ie=new Path2D;Ie.rect(Le,Pe-Math.ceil(ue/2),this._config.deviceCellWidth*tt,dt-Pe+Math.ceil(ue/2)),this._tmpCtx.clip(Ie),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=q.css,this._tmpCtx.strokeText(Y,Re,Re+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(te){const ue=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),be=ue%2==1?.5:0;this._tmpCtx.lineWidth=ue,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Re,Re+be),this._tmpCtx.lineTo(Re+this._config.deviceCharWidth*tt,Re+be),this._tmpCtx.stroke()}if(Ge||this._tmpCtx.fillText(Y,Re,Re+this._config.deviceCharHeight),Y==="_"&&!this._config.allowTransparency){let ue=w(this._tmpCtx.getImageData(Re,Re,this._config.deviceCellWidth,this._config.deviceCellHeight),q,Be,De);if(ue)for(let be=1;be<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=q.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(Y,Re,Re+this._config.deviceCharHeight-be),ue=w(this._tmpCtx.getImageData(Re,Re,this._config.deviceCellWidth,this._config.deviceCellHeight),q,Be,De),ue);be++);}if(F){const ue=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),be=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=ue,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Re,Re+Math.floor(this._config.deviceCharHeight/2)-be),this._tmpCtx.lineTo(Re+this._config.deviceCharWidth*tt,Re+Math.floor(this._config.deviceCharHeight/2)-be),this._tmpCtx.stroke()}this._tmpCtx.restore();const Tt=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Mt;if(Mt=this._config.allowTransparency?(function(ue){for(let be=0;be<ue.data.length;be+=4)if(ue.data[be+3]>0)return!1;return!0})(Tt):w(Tt,q,Be,De),Mt)return f;const We=this._findGlyphBoundingBox(Tt,this._workBoundingBox,ne,we,Ge,Re);let Ue,de;for(;;){if(this._activePages.length===0){const ue=this._createNewPage();Ue=ue,de=ue.currentRow,de.height=We.size.y;break}Ue=this._activePages[this._activePages.length-1],de=Ue.currentRow;for(const ue of this._activePages)We.size.y<=ue.currentRow.height&&(Ue=ue,de=ue.currentRow);for(let ue=this._activePages.length-1;ue>=0;ue--)for(const be of this._activePages[ue].fixedRows)be.height<=de.height&&We.size.y<=be.height&&(Ue=this._activePages[ue],de=be);if(de.y+We.size.y>=Ue.canvas.height||de.height>We.size.y+2){let ue=!1;if(Ue.currentRow.y+Ue.currentRow.height+We.size.y>=Ue.canvas.height){let be;for(const Le of this._activePages)if(Le.currentRow.y+Le.currentRow.height+We.size.y<Le.canvas.height){be=Le;break}if(be)Ue=be;else if(b.maxAtlasPages&&this._pages.length>=b.maxAtlasPages&&de.y+We.size.y<=Ue.canvas.height&&de.height>=We.size.y&&de.x+We.size.x<=Ue.canvas.width)ue=!0;else{const Le=this._createNewPage();Ue=Le,de=Le.currentRow,de.height=We.size.y,ue=!0}}ue||(Ue.currentRow.height>0&&Ue.fixedRows.push(Ue.currentRow),de={x:0,y:Ue.currentRow.y+Ue.currentRow.height,height:We.size.y},Ue.fixedRows.push(de),Ue.currentRow={x:0,y:de.y+de.height,height:0})}if(de.x+We.size.x<=Ue.canvas.width)break;de===Ue.currentRow?(de.x=0,de.y+=de.height,de.height=0):Ue.fixedRows.splice(Ue.fixedRows.indexOf(de),1)}return We.texturePage=this._pages.indexOf(Ue),We.texturePosition.x=de.x,We.texturePosition.y=de.y,We.texturePositionClipSpace.x=de.x/Ue.canvas.width,We.texturePositionClipSpace.y=de.y/Ue.canvas.height,We.sizeClipSpace.x/=Ue.canvas.width,We.sizeClipSpace.y/=Ue.canvas.height,de.height=Math.max(de.height,We.size.y),de.x+=We.size.x,Ue.ctx.putImageData(Tt,We.texturePosition.x-this._workBoundingBox.left,We.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,We.size.x,We.size.y),Ue.addGlyph(We),Ue.version++,We}_findGlyphBoundingBox(L,O,U,H,z,Y){O.top=0;const ne=H?this._config.deviceCellHeight:this._tmpCanvas.height,V=H?this._config.deviceCellWidth:U;let X=!1;for(let I=0;I<ne;I++){for(let j=0;j<V;j++){const W=I*this._tmpCanvas.width*4+4*j+3;if(L.data[W]!==0){O.top=I,X=!0;break}}if(X)break}O.left=0,X=!1;for(let I=0;I<Y+V;I++){for(let j=0;j<ne;j++){const W=j*this._tmpCanvas.width*4+4*I+3;if(L.data[W]!==0){O.left=I,X=!0;break}}if(X)break}O.right=V,X=!1;for(let I=Y+V-1;I>=Y;I--){for(let j=0;j<ne;j++){const W=j*this._tmpCanvas.width*4+4*I+3;if(L.data[W]!==0){O.right=I,X=!0;break}}if(X)break}O.bottom=ne,X=!1;for(let I=ne-1;I>=0;I--){for(let j=0;j<V;j++){const W=I*this._tmpCanvas.width*4+4*j+3;if(L.data[W]!==0){O.bottom=I,X=!0;break}}if(X)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:O.right-O.left+1,y:O.bottom-O.top+1},sizeClipSpace:{x:O.right-O.left+1,y:O.bottom-O.top+1},offset:{x:-O.left+Y+(H||z?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-O.top+Y+(H||z?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}r.TextureAtlas=b;class M{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(L){this._glyphs.push(L),this._usedPixels+=L.size.x*L.size.y}constructor(L,O,U){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],U)for(const H of U)this._glyphs.push(...H.glyphs),this._usedPixels+=H._usedPixels;this.canvas=T(L,O,O),this.ctx=(0,l.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function w(y,L,O,U){const H=L.rgba>>>24,z=L.rgba>>>16&255,Y=L.rgba>>>8&255,ne=O.rgba>>>24,V=O.rgba>>>16&255,X=O.rgba>>>8&255,I=Math.floor((Math.abs(H-ne)+Math.abs(z-V)+Math.abs(Y-X))/12);let j=!0;for(let W=0;W<y.data.length;W+=4)y.data[W]===H&&y.data[W+1]===z&&y.data[W+2]===Y||U&&Math.abs(y.data[W]-H)+Math.abs(y.data[W+1]-z)+Math.abs(y.data[W+2]-Y)<I?y.data[W+3]=0:j=!1;return j}function T(y,L,O){const U=y.createElement("canvas");return U.width=L,U.height=O,U}},160:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;let d=0,g=0,p=0,l=0;var S,x,R,m,a;function u(h){const b=h.toString(16);return b.length<2?"0"+b:b}function f(h,b){return h<b?(b+.05)/(h+.05):(h+.05)/(b+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(h){h.toCss=function(b,M,w,T){return T!==void 0?`#${u(b)}${u(M)}${u(w)}${u(T)}`:`#${u(b)}${u(M)}${u(w)}`},h.toRgba=function(b,M,w,T=255){return(b<<24|M<<16|w<<8|T)>>>0},h.toColor=function(b,M,w,T){return{css:h.toCss(b,M,w,T),rgba:h.toRgba(b,M,w,T)}}})(S||(r.channels=S={})),(function(h){function b(M,w){return l=Math.round(255*w),[d,g,p]=a.toChannels(M.rgba),{css:S.toCss(d,g,p,l),rgba:S.toRgba(d,g,p,l)}}h.blend=function(M,w){if(l=(255&w.rgba)/255,l===1)return{css:w.css,rgba:w.rgba};const T=w.rgba>>24&255,y=w.rgba>>16&255,L=w.rgba>>8&255,O=M.rgba>>24&255,U=M.rgba>>16&255,H=M.rgba>>8&255;return d=O+Math.round((T-O)*l),g=U+Math.round((y-U)*l),p=H+Math.round((L-H)*l),{css:S.toCss(d,g,p),rgba:S.toRgba(d,g,p)}},h.isOpaque=function(M){return(255&M.rgba)==255},h.ensureContrastRatio=function(M,w,T){const y=a.ensureContrastRatio(M.rgba,w.rgba,T);if(y)return S.toColor(y>>24&255,y>>16&255,y>>8&255)},h.opaque=function(M){const w=(255|M.rgba)>>>0;return[d,g,p]=a.toChannels(w),{css:S.toCss(d,g,p),rgba:w}},h.opacity=b,h.multiplyOpacity=function(M,w){return l=255&M.rgba,b(M,l*w/255)},h.toColorRGB=function(M){return[M.rgba>>24&255,M.rgba>>16&255,M.rgba>>8&255]}})(x||(r.color=x={})),(function(h){let b,M;try{const w=document.createElement("canvas");w.width=1,w.height=1;const T=w.getContext("2d",{willReadFrequently:!0});T&&(b=T,b.globalCompositeOperation="copy",M=b.createLinearGradient(0,0,1,1))}catch{}h.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return d=parseInt(w.slice(1,2).repeat(2),16),g=parseInt(w.slice(2,3).repeat(2),16),p=parseInt(w.slice(3,4).repeat(2),16),S.toColor(d,g,p);case 5:return d=parseInt(w.slice(1,2).repeat(2),16),g=parseInt(w.slice(2,3).repeat(2),16),p=parseInt(w.slice(3,4).repeat(2),16),l=parseInt(w.slice(4,5).repeat(2),16),S.toColor(d,g,p,l);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const T=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return d=parseInt(T[1]),g=parseInt(T[2]),p=parseInt(T[3]),l=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),S.toColor(d,g,p,l);if(!b||!M)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=M,b.fillStyle=w,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[d,g,p,l]=b.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(d,g,p,l),css:w}}})(R||(r.css=R={})),(function(h){function b(M,w,T){const y=M/255,L=w/255,O=T/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}h.relativeLuminance=function(M){return b(M>>16&255,M>>8&255,255&M)},h.relativeLuminance2=b})(m||(r.rgb=m={})),(function(h){function b(w,T,y){const L=w>>24&255,O=w>>16&255,U=w>>8&255;let H=T>>24&255,z=T>>16&255,Y=T>>8&255,ne=f(m.relativeLuminance2(H,z,Y),m.relativeLuminance2(L,O,U));for(;ne<y&&(H>0||z>0||Y>0);)H-=Math.max(0,Math.ceil(.1*H)),z-=Math.max(0,Math.ceil(.1*z)),Y-=Math.max(0,Math.ceil(.1*Y)),ne=f(m.relativeLuminance2(H,z,Y),m.relativeLuminance2(L,O,U));return(H<<24|z<<16|Y<<8|255)>>>0}function M(w,T,y){const L=w>>24&255,O=w>>16&255,U=w>>8&255;let H=T>>24&255,z=T>>16&255,Y=T>>8&255,ne=f(m.relativeLuminance2(H,z,Y),m.relativeLuminance2(L,O,U));for(;ne<y&&(H<255||z<255||Y<255);)H=Math.min(255,H+Math.ceil(.1*(255-H))),z=Math.min(255,z+Math.ceil(.1*(255-z))),Y=Math.min(255,Y+Math.ceil(.1*(255-Y))),ne=f(m.relativeLuminance2(H,z,Y),m.relativeLuminance2(L,O,U));return(H<<24|z<<16|Y<<8|255)>>>0}h.blend=function(w,T){if(l=(255&T)/255,l===1)return T;const y=T>>24&255,L=T>>16&255,O=T>>8&255,U=w>>24&255,H=w>>16&255,z=w>>8&255;return d=U+Math.round((y-U)*l),g=H+Math.round((L-H)*l),p=z+Math.round((O-z)*l),S.toRgba(d,g,p)},h.ensureContrastRatio=function(w,T,y){const L=m.relativeLuminance(w>>8),O=m.relativeLuminance(T>>8);if(f(L,O)<y){if(O<L){const z=b(w,T,y),Y=f(L,m.relativeLuminance(z>>8));if(Y<y){const ne=M(w,T,y);return Y>f(L,m.relativeLuminance(ne>>8))?z:ne}return z}const U=M(w,T,y),H=f(L,m.relativeLuminance(U>>8));if(H<y){const z=b(w,T,y);return H>f(L,m.relativeLuminance(z>>8))?U:z}return U}},h.reduceLuminance=b,h.increaseLuminance=M,h.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]}})(a||(r.rgba=a={})),r.toPaddedHex=u,r.contrastRatio=f},345:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=d=>(this._listeners.push(d),{dispose:()=>{if(!this._disposed){for(let g=0;g<this._listeners.length;g++)if(this._listeners[g]===d)return void this._listeners.splice(g,1)}}})),this._event}fire(d,g){const p=[];for(let l=0;l<this._listeners.length;l++)p.push(this._listeners[l]);for(let l=0;l<p.length;l++)p[l].call(void 0,d,g)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(d,g){return d((p=>g.fire(p)))},r.runAndSubscribe=function(d,g){return g(void 0),d((p=>g(p)))}},859:(P,r)=>{function d(g){for(const p of g)p.dispose();g.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const g of this._disposables)g.dispose();this._disposables.length=0}register(g){return this._disposables.push(g),g}unregister(g){const p=this._disposables.indexOf(g);p!==-1&&this._disposables.splice(p,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(g){this._isDisposed||g===this._value||(this._value?.dispose(),this._value=g)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},r.toDisposable=function(g){return{dispose:g}},r.disposeArray=d,r.getDisposeArrayDisposable=function(g){return{dispose:()=>d(g)}}},485:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class d{constructor(){this._data={}}set(p,l,S){this._data[p]||(this._data[p]={}),this._data[p][l]=S}get(p,l){return this._data[p]?this._data[p][l]:void 0}clear(){this._data={}}}r.TwoKeyMap=d,r.FourKeyMap=class{constructor(){this._data=new d}set(g,p,l,S,x){this._data.get(g,p)||this._data.set(g,p,new d),this._data.get(g,p).set(l,S,x)}get(g,p,l,S){return this._data.get(g,p)?.get(l,S)}clear(){this._data.clear()}}},399:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof process<"u"&&"title"in process;const d=r.isNode?"node":navigator.userAgent,g=r.isNode?"node":navigator.platform;r.isFirefox=d.includes("Firefox"),r.isLegacyEdge=d.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(d),r.getSafariVersion=function(){if(!r.isSafari)return 0;const p=d.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(g),r.isIpad=g==="iPad",r.isIphone=g==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(g),r.isLinux=g.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(d)},385:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const g=d(399);class p{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),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(x){this._idleCallback=void 0;let R=0,m=0,a=x.timeRemaining(),u=0;for(;this._i<this._tasks.length;){if(R=Date.now(),this._tasks[this._i]()||this._i++,R=Math.max(1,Date.now()-R),m=Math.max(R,m),u=x.timeRemaining(),1.5*m>u)return a-R<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-R))}ms`),void this._start();a=u}this.clear()}}class l extends p{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const R=Date.now()+x;return{timeRemaining:()=>Math.max(0,R-Date.now())}}}r.PriorityTaskQueue=l,r.IdleTaskQueue=!g.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(S){return requestIdleCallback(S)}_cancelCallback(S){cancelIdleCallback(S)}}:l,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(S){this._queue.clear(),this._queue.enqueue(S)}flush(){this._queue.flush()}}},147:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class d{constructor(){this.fg=0,this.bg=0,this.extended=new g}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new d;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}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}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}r.AttributeData=d;class g{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,S=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=S}clone(){return new g(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=g},782:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const g=d(133),p=d(855),l=d(147);class S extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(R){const m=new S;return m.setFromCharData(R),m}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,g.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(R){this.fg=R[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let m=!1;if(R[p.CHAR_DATA_CHAR_INDEX].length>2)m=!0;else if(R[p.CHAR_DATA_CHAR_INDEX].length===2){const a=R[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=a&&a<=56319){const u=R[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=u&&u<=57343?this.content=1024*(a-55296)+u-56320+65536|R[p.CHAR_DATA_WIDTH_INDEX]<<22:m=!0}else m=!0}else this.content=R[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|R[p.CHAR_DATA_WIDTH_INDEX]<<22;m&&(this.combinedData=R[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|R[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=S},855:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},133:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(d){return d>65535?(d-=65536,String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):String.fromCharCode(d)},r.utf32ToString=function(d,g=0,p=d.length){let l="";for(let S=g;S<p;++S){let x=d[S];x>65535?(x-=65536,l+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):l+=String.fromCharCode(x)}return l},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(d,g){const p=d.length;if(!p)return 0;let l=0,S=0;if(this._interim){const x=d.charCodeAt(S++);56320<=x&&x<=57343?g[l++]=1024*(this._interim-55296)+x-56320+65536:(g[l++]=this._interim,g[l++]=x),this._interim=0}for(let x=S;x<p;++x){const R=d.charCodeAt(x);if(55296<=R&&R<=56319){if(++x>=p)return this._interim=R,l;const m=d.charCodeAt(x);56320<=m&&m<=57343?g[l++]=1024*(R-55296)+m-56320+65536:(g[l++]=R,g[l++]=m)}else R!==65279&&(g[l++]=R)}return l}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(d,g){const p=d.length;if(!p)return 0;let l,S,x,R,m=0,a=0,u=0;if(this.interim[0]){let b=!1,M=this.interim[0];M&=(224&M)==192?31:(240&M)==224?15:7;let w,T=0;for(;(w=63&this.interim[++T])&&T<4;)M<<=6,M|=w;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=y-T;for(;u<L;){if(u>=p)return 0;if(w=d[u++],(192&w)!=128){u--,b=!0;break}this.interim[T++]=w,M<<=6,M|=63&w}b||(y===2?M<128?u--:g[m++]=M:y===3?M<2048||M>=55296&&M<=57343||M===65279||(g[m++]=M):M<65536||M>1114111||(g[m++]=M)),this.interim.fill(0)}const f=p-4;let h=u;for(;h<p;){for(;!(!(h<f)||128&(l=d[h])||128&(S=d[h+1])||128&(x=d[h+2])||128&(R=d[h+3]));)g[m++]=l,g[m++]=S,g[m++]=x,g[m++]=R,h+=4;if(l=d[h++],l<128)g[m++]=l;else if((224&l)==192){if(h>=p)return this.interim[0]=l,m;if(S=d[h++],(192&S)!=128){h--;continue}if(a=(31&l)<<6|63&S,a<128){h--;continue}g[m++]=a}else if((240&l)==224){if(h>=p)return this.interim[0]=l,m;if(S=d[h++],(192&S)!=128){h--;continue}if(h>=p)return this.interim[0]=l,this.interim[1]=S,m;if(x=d[h++],(192&x)!=128){h--;continue}if(a=(15&l)<<12|(63&S)<<6|63&x,a<2048||a>=55296&&a<=57343||a===65279)continue;g[m++]=a}else if((248&l)==240){if(h>=p)return this.interim[0]=l,m;if(S=d[h++],(192&S)!=128){h--;continue}if(h>=p)return this.interim[0]=l,this.interim[1]=S,m;if(x=d[h++],(192&x)!=128){h--;continue}if(h>=p)return this.interim[0]=l,this.interim[1]=S,this.interim[2]=x,m;if(R=d[h++],(192&R)!=128){h--;continue}if(a=(7&l)<<18|(63&S)<<12|(63&x)<<6|63&R,a<65536||a>1114111)continue;g[m++]=a}}return m}}},776:function(P,r,d){var g=this&&this.__decorate||function(a,u,f,h){var b,M=arguments.length,w=M<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,f):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(a,u,f,h);else for(var T=a.length-1;T>=0;T--)(b=a[T])&&(w=(M<3?b(w):M>3?b(u,f,w):b(u,f))||w);return M>3&&w&&Object.defineProperty(u,f,w),w},p=this&&this.__param||function(a,u){return function(f,h){u(f,h,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const l=d(859),S=d(97),x={trace:S.LogLevelEnum.TRACE,debug:S.LogLevelEnum.DEBUG,info:S.LogLevelEnum.INFO,warn:S.LogLevelEnum.WARN,error:S.LogLevelEnum.ERROR,off:S.LogLevelEnum.OFF};let R,m=r.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(a){super(),this._optionsService=a,this._logLevel=S.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),R=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(a){for(let u=0;u<a.length;u++)typeof a[u]=="function"&&(a[u]=a[u]())}_log(a,u,f){this._evalLazyOptionalParams(f),a.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+u,...f)}trace(a,...u){this._logLevel<=S.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,a,u)}debug(a,...u){this._logLevel<=S.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,a,u)}info(a,...u){this._logLevel<=S.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,a,u)}warn(a,...u){this._logLevel<=S.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,a,u)}error(a,...u){this._logLevel<=S.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,a,u)}};r.LogService=m=g([p(0,S.IOptionsService)],m),r.setTraceLogger=function(a){R=a},r.traceCall=function(a,u,f){if(typeof f.value!="function")throw new Error("not supported");const h=f.value;f.value=function(...b){if(R.logLevel!==S.LogLevelEnum.TRACE)return h.apply(this,b);R.trace(`GlyphRenderer#${h.name}(${b.map((w=>JSON.stringify(w))).join(", ")})`);const M=h.apply(this,b);return R.trace(`GlyphRenderer#${h.name} return`,M),M}}},726:(P,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const d="di$target",g="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(p){return p[g]||[]},r.createDecorator=function(p){if(r.serviceRegistry.has(p))return r.serviceRegistry.get(p);const l=function(S,x,R){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,a,u){a[d]===a?a[g].push({id:m,index:u}):(a[g]=[{id:m,index:u}],a[d]=a)})(l,S,R)};return l.toString=()=>p,r.serviceRegistry.set(p,l),l}},97:(P,r,d)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const g=d(726);var p;r.IBufferService=(0,g.createDecorator)("BufferService"),r.ICoreMouseService=(0,g.createDecorator)("CoreMouseService"),r.ICoreService=(0,g.createDecorator)("CoreService"),r.ICharsetService=(0,g.createDecorator)("CharsetService"),r.IInstantiationService=(0,g.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(p||(r.LogLevelEnum=p={})),r.ILogService=(0,g.createDecorator)("LogService"),r.IOptionsService=(0,g.createDecorator)("OptionsService"),r.IOscLinkService=(0,g.createDecorator)("OscLinkService"),r.IUnicodeService=(0,g.createDecorator)("UnicodeService"),r.IDecorationService=(0,g.createDecorator)("DecorationService")}},A={};function N(P){var r=A[P];if(r!==void 0)return r.exports;var d=A[P]={exports:{}};return E[P].call(d.exports,d,d.exports,N),d.exports}var G={};return(()=>{var P=G;Object.defineProperty(P,"__esModule",{value:!0}),P.WebglAddon=void 0;const r=N(345),d=N(859),g=N(399),p=N(666),l=N(776);class S extends d.Disposable{constructor(R){if(g.isSafari&&(0,g.getSafariVersion)()<16){const m={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",m))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=R,this._onChangeTextureAtlas=this.register(new r.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new r.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new r.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new r.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(R){const m=R._core;if(!R.element)return void this.register(m.onWillOpen((()=>this.activate(R))));this._terminal=R;const a=m.coreService,u=m.optionsService,f=m,h=f._renderService,b=f._characterJoinerService,M=f._charSizeService,w=f._coreBrowserService,T=f._decorationService,y=f._logService,L=f._themeService;(0,l.setTraceLogger)(y),this._renderer=this.register(new p.WebglRenderer(R,b,M,w,a,T,u,L,this._preserveDrawingBuffer)),this.register((0,r.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,r.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,r.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,r.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),h.setRenderer(this._renderer),this.register((0,d.toDisposable)((()=>{const O=this._terminal._core._renderService;O.setRenderer(this._terminal._core._createRenderer()),O.handleResize(R.cols,R.rows)})))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}}P.WebglAddon=S})(),G})()))})(Ru)),Ru.exports}var Xg=Yg();const Ma=16e3,Zg=.004,Qg=["audio/webm;codecs=opus","audio/webm","audio/mp4"];function Wp(n){if(!n.length)return 0;let C=0;for(const E of n)C+=E*E;return Math.sqrt(C/n.length)}function tp(n,C=Zg){return Wp(n)<C}async function Jg(n){const C=new AudioContext;try{const E=await C.decodeAudioData(await n.arrayBuffer()),A=Math.max(1,Math.ceil(E.duration*Ma)),N=new OfflineAudioContext(1,A,Ma),G=N.createBufferSource();return G.buffer=E,G.connect(N.destination),G.start(),(await N.startRendering()).getChannelData(0)}finally{C.close()}}class ip{constructor(){this.stream=null,this.recorder=null,this.chunks=[]}async start(){this.stream=await navigator.mediaDevices.getUserMedia({audio:!0});const C=Qg.find(E=>MediaRecorder.isTypeSupported(E));this.recorder=new MediaRecorder(this.stream,C?{mimeType:C}:void 0),this.chunks=[],this.recorder.ondataavailable=E=>{E.data.size&&this.chunks.push(E.data)},this.recorder.start()}stop(){return new Promise(C=>{const E=this.recorder;if(!E||E.state==="inactive"){this.dispose(),C(null);return}E.onstop=()=>{const A=new Blob(this.chunks,{type:E.mimeType||"audio/webm"});if(this.dispose(),!A.size){C(null);return}Jg(A).then(C,()=>C(null))},E.stop()})}cancel(){const C=this.recorder;C&&C.state!=="inactive"&&(C.onstop=null,C.stop()),this.dispose()}dispose(){this.stream?.getTracks().forEach(C=>C.stop()),this.stream=null,this.recorder=null,this.chunks=[]}}function cs(n){const C=n.replace(/^.*@/,""),E=C.replace(/:\d+$/,"");return E.includes(":")?C:E}const xc="\x1B",sp="\x07",ev=new RegExp(xc+"\\][^"+sp+xc+"]*(?:"+sp+"|"+xc+"\\\\)","g"),tv=new RegExp(xc+"\\[[0-9;?]*[A-Za-z]","g");function rp(n){return/[#$%>]\s*$/.test(n.replace(ev,"").replace(tv,""))}const iv=60,sv=200;function rv(n){if(n.type!=="keydown"||!(n.ctrlKey||n.metaKey)||!n.shiftKey)return null;const C=n.key.toLowerCase();return C==="c"?"copy":C==="v"?"paste":null}function Rc(n){return n instanceof Error?n.message:String(n)}function nv(n,C,E){if(C.mark(),typeof n.terminal.paste=="function"){n.terminal.paste(E);return}n.writeToPty?.(E)}function qp(n=()=>Date.now()){let C=Number.NEGATIVE_INFINITY;return{mark(){C=n()},isDuplicate(){return n()-C<sv}}}function av(n,C){const E=A=>{C.isDuplicate()&&(A.preventDefault(),A.stopPropagation(),A.stopImmediatePropagation?.())};return n.addEventListener("paste",E,!0),()=>n.removeEventListener("paste",E,!0)}function ov(n,C=qp()){return E=>{const A=rv(E);if(!A)return!0;if(E.preventDefault(),E.stopPropagation(),A==="copy"){const N=n.terminal.getSelection();return N&&n.clipboard.copyText(N).catch(G=>{n.onError(Rc(G))}),!1}return n.clipboard.readText().then(N=>{N&&nv(n,C,N)}).catch(N=>{n.onError(Rc(N))}),!1}}const lv=new Set(["c","p","s"]);function cv(n){return n?[...n].some(C=>lv.has(C)):!0}function hv(n){const C=n.replace(/\s+/g,"");if(!/^[A-Za-z0-9+/]*={0,2}$/.test(C))return null;try{const E=atob(C),A=Uint8Array.from(E,N=>N.charCodeAt(0));return new TextDecoder().decode(A)}catch{return null}}function uv(n){const C=n.indexOf(";");if(C===-1||!cv(n.slice(0,C)))return null;const E=n.slice(C+1);return E==="?"||!E?null:hv(E)}function dv(n){const C=n.terminal.parser;if(!C)return()=>{};const E=C.registerOscHandler(52,A=>{const N=uv(A);return N!==null&&n.clipboard.copyText(N).catch(G=>{n.onError(Rc(G))}),!0});return()=>{E&&typeof E.dispose=="function"&&E.dispose()}}function fv(n){const{terminal:C}=n;if(typeof C.onSelectionChange!="function")return()=>{};let E,A=null;const N=C.onSelectionChange(()=>{E&&clearTimeout(E),E=setTimeout(()=>{if(E=void 0,n.isCopyOnSelectEnabled&&!n.isCopyOnSelectEnabled())return;const G=C.getSelection();!G||G===A||(A=G,n.clipboard.copyText(G).catch(P=>{A=null,n.onError(Rc(P))}))},iv)});return()=>{E&&clearTimeout(E),N&&typeof N.dispose=="function"&&N.dispose()}}function _v(n){const C=qp();n.terminal.attachCustomKeyEventHandler(ov(n,C));const E=[dv(n),fv(n),n.pasteEventTarget?av(n.pasteEventTarget,C):()=>{}];return()=>{for(const A of E.reverse())A()}}function pv(n){let C=!1;return{onMouseDown(E){C=E.target===E.currentTarget},onClick(E){const A=C&&E.target===E.currentTarget;C=!1,A&&n()}}}function $r(n){const C=Z.useRef(n);C.current=n;const E=Z.useRef(null);return E.current||(E.current=pv(()=>C.current())),E.current}const mv=250,gv={setTimeout:(n,C)=>setTimeout(n,C),clearTimeout:n=>clearTimeout(n)};function vv(n){const C=n.windowMs??mv,E=n.timers??gv;let A=null,N=null;const G=()=>{A!==null&&(E.clearTimeout(A),A=null)},P=()=>{N!==null&&E.clearTimeout(N),N=E.setTimeout(()=>{N=null},C)};return{onClick(){if(N!==null){P();return}G(),A=E.setTimeout(()=>{A=null,n.onSingleClick()},C)},onDoubleClick(){G(),P(),n.onDoubleClick()},cancel(){G(),N!==null&&(E.clearTimeout(N),N=null)}}}function Gp(n,C){const E=Z.useRef({onSingleClick:n,onDoubleClick:C});E.current={onSingleClick:n,onDoubleClick:C};const A=Z.useRef(null);A.current||(A.current=vv({onSingleClick:()=>E.current.onSingleClick(),onDoubleClick:()=>E.current.onDoubleClick()}));const N=A.current;return Z.useEffect(()=>()=>N.cancel(),[N]),N}function Sv(n,C){if(!n)return;const E=cs(n);if(E)return C.find(A=>cs(A.hostName??"")===E||A.alias===E)}function Kp(n){return n.screenName?n.screenName:n.backend==="screen"?n.name:void 0}function bv(n,C,E){return E.find(A=>A.screenName===n&&A.kind===C)??E.find(A=>A.screenName===n)}function Lu(n,C,E){if(n.id){const G=C.find(P=>P.id===n.id);if(G)return{kind:"attach",sessionId:G.id}}const A=Kp(n);if(A){const G=bv(A,n.kind,C);if(G)return{kind:"attach",sessionId:G.id};if(n.kind==="local")return{kind:"unavailable",reason:`No local screen session named ${A} is running`};const P=Sv(n.host,E);if(P)return{kind:"attach-remote-screen",connection:P,screenName:A,name:n.name};const r=n.sshTarget||n.host;return r?{kind:"create-ssh",target:r,name:n.name,screenCommand:`screen -x ${A}`}:{kind:"unavailable",reason:`No host recorded for ${n.name}`}}if(n.kind==="local")return{kind:"unavailable",reason:`${n.name} was not persistent and did not survive`};const N=n.sshTarget||n.host;return N?{kind:"create-ssh",target:N,name:n.name}:{kind:"unavailable",reason:`No host recorded for ${n.name}`}}const Vp=25,Yp=85,Xp=60;function Tu(n){return n.sessionIds.length+n.pending.length}const yv=4;function Cv(n,C,E){const A=new Map(C.map(N=>[N.id,N]));return n.flatMap(N=>N.sessionIds.map(G=>A.get(G)).filter(G=>G!==void 0).slice(0,yv).map((G,P)=>({session:G,workspaceId:N.id,index:P,dormant:N.id!==E})))}function Ko(n){return{layout:n,lastSplit:n==="stack"?"split-v":n,maximizedSessionId:null}}function np(n,C,E=[]){return{id:`ws-${crypto.randomUUID()}`,name:n,sessionIds:E,pending:[],view:Ko(C)}}function Mu(n){return n<=1?"stack":n===2?"split-v":"grid"}function ap(n,C,E){return n.map(A=>{if(A.id!==C)return A;const N={...A.view,...typeof E=="function"?E(A.view):E};return{...A,view:N}})}function wv(n,C,E){return n.map(A=>A.id!==C?A.sessionIds.includes(E)?{...A,sessionIds:A.sessionIds.filter(N=>N!==E)}:A:A.sessionIds.includes(E)?A:{...A,sessionIds:[...A.sessionIds,E]})}function xv(n,C){return n.map(E=>{if(!E.sessionIds.includes(C))return E;const A=E.sessionIds.filter(N=>N!==C);return{...E,sessionIds:A,view:Fu(E.view,$u({...E,sessionIds:A}))}})}function $u(n){return[...n.sessionIds,...n.pending.map(C=>C.sessionId)]}function Fu(n,C){const E=new Set(C),A=n.activeSessionId&&E.has(n.activeSessionId)?n.activeSessionId:void 0,N=n.focusedSessionId&&E.has(n.focusedSessionId)?n.focusedSessionId:void 0,G=n.maximizedSessionId&&E.has(n.maximizedSessionId)?n.maximizedSessionId:null,P=Av(n.browsers,E),r=Ev(n.visiblePanes,E);return r===n.visiblePanes&&A===n.activeSessionId&&N===n.focusedSessionId&&G===(n.maximizedSessionId??null)&&P===n.browsers?n:{...n,activeSessionId:A,focusedSessionId:N,maximizedSessionId:G,browsers:P,visiblePanes:r}}function Ev(n,C){if(!n)return n;const E=n.filter(A=>C.has(A));return E.length===n.length?n:E.length?E:void 0}function Av(n,C){if(!n)return n;const E=Object.keys(n),A=E.filter(N=>C.has(N));return A.length===E.length?n:Object.fromEntries(A.map(N=>[N,n[N]]))}function Rv(n,C){const E=new Set(C.map(G=>G.id));let A=!1;const N=n.map(G=>{const P=G.sessionIds.filter(d=>E.has(d)),r=Fu(G.view,$u({...G,sessionIds:P}));return P.length===G.sessionIds.length&&r===G.view?G:(A=!0,{...G,sessionIds:P,view:r})});return A?N:n}const Ec="[A-Za-z0-9](?:[A-Za-z0-9_.]|-| ){0,48}",Lv=new RegExp(`^(?:${Ec})$`);function zu(n){return Lv.test(n)}function yc(n){let C=n.length+1;const E=new Set(n.map(A=>A.name.toLowerCase()));for(;E.has(`workspace ${C}`);)C+=1;return`Workspace ${C}`}function op(n,C,E){const A=E.trim();return zu(A)?n.map(N=>N.id===C?{...N,name:A}:N):n}function Tv(n,C,E,A,N=()=>`pending-${crypto.randomUUID()}`){const G=n.findIndex(x=>x.id===C);if(G<0)return{workspaces:n,created:null,copied:0,skipped:0};const P=n[G],r=new Map(E.map(x=>[x.id,x])),d=[...P.sessionIds.map(x=>r.get(x)).filter(x=>x!==void 0).map(Zp),...P.pending],g=d.filter(x=>x.kind==="ssh"),p=g.map(x=>{const{screenName:R,...m}=x;return{...m,sessionId:N()}}),l={id:`ws-${crypto.randomUUID()}`,name:A,sessionIds:[],pending:p,view:{...Ko(P.view.layout),lastSplit:P.view.lastSplit,maximizedSessionId:null}},S=[...n];return S.splice(G+1,0,l),{workspaces:S,created:l,copied:p.length,skipped:d.length-g.length}}function Mv(n,C){const E=C.filter(A=>n.sessionIds.includes(A.id));return E.some(A=>A.status==="connected")?"connected":E.length||n.pending.length?"detached":"empty"}function Dv(n,C,E){const A=n.findIndex(d=>d.id===C),N={workspaces:n,activeWorkspaceId:E,releasedSessionIds:[]};if(A<0||n.length<2)return N;const G=n[A],P=n.filter(d=>d.id!==C),r=E===C?(P[Math.max(0,A-1)]??P[0]).id:E;return{workspaces:P,activeWorkspaceId:r,releasedSessionIds:[...G.sessionIds]}}function lp(n,C,E){return n.map(A=>{if(A.id!==C||!A.pending.some(G=>G.sessionId===E))return A;const N={...A,pending:A.pending.filter(G=>G.sessionId!==E)};return{...N,view:Fu(N.view,$u(N))}})}function kv(n,C){let E=!1;const A=n.map(N=>{if(!N.pending.length)return N;const G=[],P=[...N.sessionIds];let r=N.view,d=!1;for(const g of N.pending){const p=C(g);if(!p){G.push(g);continue}P.includes(p)||P.push(p),r=Ov(r,g.sessionId,p),d=!0}return d?(E=!0,{...N,sessionIds:P,pending:G,view:r}):N});return E?A:n}function Ov(n,C,E){const A=n.visiblePanes?.includes(C)??!1;return n.activeSessionId!==C&&n.focusedSessionId!==C&&n.maximizedSessionId!==C&&!A?n:{...n,...A?{visiblePanes:n.visiblePanes?.map(N=>N===C?E:N)}:{},activeSessionId:n.activeSessionId===C?E:n.activeSessionId,focusedSessionId:n.focusedSessionId===C?E:n.focusedSessionId,maximizedSessionId:n.maximizedSessionId===C?E:n.maximizedSessionId}}const Bv=1,jv=["stack","split-v","split-h","grid"],Nv=["split-v","split-h","grid"];function Hv(n,C,E){const A=new Map(E.map(N=>[N.id,N]));return{version:Bv,activeWorkspaceId:C,workspaces:n.map(N=>({id:N.id,name:N.name,view:{layout:N.view.layout,lastSplit:N.view.lastSplit,activeSessionId:N.view.activeSessionId,focusedSessionId:N.view.focusedSessionId,maximizedSessionId:N.view.maximizedSessionId??null,browsers:N.view.browsers,...N.view.visiblePanes?.length?{visiblePanes:N.view.visiblePanes}:{}},members:[...N.sessionIds.map(G=>A.get(G)).filter(G=>G!==void 0).map(Zp),...N.pending]}))}}function Zp(n){const C={sessionId:n.id,kind:n.kind,name:n.name};return n.host&&(C.host=n.host),n.screenName&&(C.screenName=n.screenName),n.sshTarget&&(C.sshTarget=n.sshTarget),n.backend&&(C.backend=n.backend),C}function cp(n){if(!Array.isArray(n))return;const C=[...new Set(n.filter(E=>typeof E=="string"&&E.length>0))].slice(0,2);return C.length?C:void 0}function zv(n){if(!n||typeof n!="object"||Array.isArray(n))return;const C={};for(const[E,A]of Object.entries(n)){if(!E||!A||typeof A!="object")continue;const N=A;if(typeof N.open!="boolean")continue;const G=typeof N.ratio=="number"&&Number.isFinite(N.ratio)&&N.ratio>=Vp&&N.ratio<=Yp?N.ratio:void 0;C[E]=G===void 0?{open:N.open}:{open:N.open,ratio:G}}return Object.keys(C).length?C:void 0}function Uv(n){return Kp(n)!==void 0}function Iv(n,C){const E=n.workspaces.map(N=>{const G=jv.find(r=>r===N.view?.layout)??C,P=Ko(G);return{id:N.id,name:N.name,sessionIds:[],pending:(N.members??[]).filter(Uv),view:{...P,lastSplit:Nv.find(r=>r===N.view?.lastSplit)??P.lastSplit,activeSessionId:N.view?.activeSessionId,focusedSessionId:N.view?.focusedSessionId,maximizedSessionId:N.view?.maximizedSessionId??null,browsers:zv(N.view?.browsers),...cp(N.view?.visiblePanes)?{visiblePanes:cp(N.view?.visiblePanes)}:{}}}}),A=E.some(N=>N.id===n.activeWorkspaceId)?n.activeWorkspaceId:E[0]?.id;return{workspaces:E,activeWorkspaceId:A}}function Oe({name:n,className:C=""}){const E={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",className:`icon-svg ${C}`.trim(),"aria-hidden":!0};switch(n){case"plus":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M12 5v14M5 12h14"})});case"panel-left":return c.jsxs("svg",{...E,children:[c.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),c.jsx("path",{d:"M9 4v16"})]});case"panel-left-open":return c.jsxs("svg",{...E,children:[c.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),c.jsx("path",{d:"M9 4v16M6 9l2 3-2 3"})]});case"grid":return c.jsxs("svg",{...E,children:[c.jsx("rect",{x:"4",y:"4",width:"7",height:"7",rx:"1"}),c.jsx("rect",{x:"13",y:"4",width:"7",height:"7",rx:"1"}),c.jsx("rect",{x:"4",y:"13",width:"7",height:"7",rx:"1"}),c.jsx("rect",{x:"13",y:"13",width:"7",height:"7",rx:"1"})]});case"sessions":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M4 7h16M4 12h16M4 17h10"})});case"terminal":return c.jsxs("svg",{...E,children:[c.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),c.jsx("path",{d:"M7 9l3 3-3 3M13 15h4"})]});case"ssh":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M7 17l5-5-5-5M12 17h7"})});case"history":return c.jsxs("svg",{...E,children:[c.jsx("path",{d:"M4 12a8 8 0 1 0 2.3-5.7L4 8.5M4 4v4.5h4.5"}),c.jsx("path",{d:"M12 7v5l3 2"})]});case"spark":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8L12 3z"})});case"settings":return c.jsxs("svg",{...E,children:[c.jsx("circle",{cx:"12",cy:"12",r:"3"}),c.jsx("path",{d:"M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9c.3.6.9 1 1.6 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"})]});case"sun":return c.jsxs("svg",{...E,children:[c.jsx("circle",{cx:"12",cy:"12",r:"4"}),c.jsx("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]});case"moon":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M20.5 15.5A8.5 8.5 0 0 1 8.5 3.5 8.5 8.5 0 1 0 20.5 15.5z"})});case"stack":return c.jsx("svg",{...E,children:c.jsx("rect",{x:"5",y:"5",width:"14",height:"14",rx:"1.5"})});case"maximize":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M8 4H4v4M16 4h4v4M4 16v4h4M20 16v4h-4"})});case"restore":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M8 8h12v12H8zM4 16V4h12"})});case"chevron-left":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M15 5l-7 7 7 7"})});case"chevron-right":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M9 5l7 7-7 7"})});case"split-v":return c.jsxs("svg",{...E,children:[c.jsx("rect",{x:"4",y:"5",width:"7",height:"14",rx:"1"}),c.jsx("rect",{x:"13",y:"5",width:"7",height:"14",rx:"1"})]});case"split-h":return c.jsxs("svg",{...E,children:[c.jsx("rect",{x:"4",y:"4",width:"16",height:"7",rx:"1"}),c.jsx("rect",{x:"4",y:"13",width:"16",height:"7",rx:"1"})]});case"x":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M6 6l12 12M18 6L6 18"})});case"stop":return c.jsx("svg",{...E,children:c.jsx("rect",{x:"5",y:"5",width:"14",height:"14",rx:"2"})});case"mic":return c.jsxs("svg",{...E,children:[c.jsx("rect",{x:"9",y:"2.5",width:"6",height:"12",rx:"3"}),c.jsx("path",{d:"M5 11.5a7 7 0 0 0 14 0"}),c.jsx("path",{d:"M12 18.5V21"})]});case"check":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M5 13l4.5 4.5L19 7"})});case"bot":return c.jsxs("svg",{...E,children:[c.jsx("rect",{x:"4",y:"8",width:"16",height:"12",rx:"3"}),c.jsx("path",{d:"M12 8V5M9.5 5h5"}),c.jsx("circle",{cx:"9",cy:"14",r:"1.2",fill:"currentColor",stroke:"none"}),c.jsx("circle",{cx:"15",cy:"14",r:"1.2",fill:"currentColor",stroke:"none"}),c.jsx("path",{d:"M9 17.5h6"})]});case"transfer":return c.jsxs("svg",{...E,children:[c.jsx("path",{d:"M8 20V6M8 6L4.5 9.5M8 6l3.5 3.5"}),c.jsx("path",{d:"M16 4v14M16 18l3.5-3.5M16 18l-3.5-3.5"})]});case"ports":return c.jsxs("svg",{...E,children:[c.jsx("rect",{x:"2.5",y:"8.5",width:"5",height:"7",rx:"1"}),c.jsx("rect",{x:"16.5",y:"8.5",width:"5",height:"7",rx:"1"}),c.jsx("path",{d:"M7.5 12h9M14 9.5l2.5 2.5L14 14.5"})]});case"port-plus":return c.jsxs("svg",{...E,children:[c.jsx("rect",{x:"2.5",y:"8.5",width:"5",height:"7",rx:"1"}),c.jsx("path",{d:"M7.5 12h7"}),c.jsx("path",{d:"M18.5 8v8M14.5 12h8"})]});case"folder":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6h4l2 2.5h7A1.5 1.5 0 0 1 19 10v7.5A1.5 1.5 0 0 1 17.5 19h-13A1.5 1.5 0 0 1 3 17.5z"})});case"file":return c.jsxs("svg",{...E,children:[c.jsx("path",{d:"M6 3.5h7L18 8v12.5H6z"}),c.jsx("path",{d:"M13 3.5V8h5"})]});case"link":return c.jsxs("svg",{...E,children:[c.jsx("path",{d:"M10 13a4 4 0 0 0 5.7 0l2.3-2.3a4 4 0 0 0-5.7-5.7L11 6.3"}),c.jsx("path",{d:"M14 11a4 4 0 0 0-5.7 0L6 13.3a4 4 0 0 0 5.7 5.7L13 17.7"})]});case"folder-plus":return c.jsxs("svg",{...E,children:[c.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6h4l2 2.5h7A1.5 1.5 0 0 1 19 10v7.5A1.5 1.5 0 0 1 17.5 19h-13A1.5 1.5 0 0 1 3 17.5z"}),c.jsx("path",{d:"M11 11v5M8.5 13.5h5"})]});case"trash":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M4.5 7h15M9 7V4.5h6V7M6.5 7l1 13h9l1-13"})});case"pencil":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M4 20h4L20 8l-4-4L4 16z"})});case"refresh":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M20 12a8 8 0 1 1-2.3-5.7L20 8.5M20 4v4.5h-4.5"})});case"arrow-up":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M12 20V4M12 4l-6 6M12 4l6 6"})});case"arrow-down":return c.jsx("svg",{...E,children:c.jsx("path",{d:"M12 4v16M12 20l-6-6M12 20l6-6"})});case"level-up":return c.jsxs("svg",{...E,children:[c.jsx("path",{d:"M5 12l7-7 7 7"}),c.jsx("path",{d:"M12 5v14"})]});case"help":return c.jsxs("svg",{...E,children:[c.jsx("circle",{cx:"12",cy:"12",r:"9"}),c.jsx("path",{d:"M9.4 9a2.7 2.7 0 1 1 3.9 2.4c-.8.5-1.3 1-1.3 1.9v.4"}),c.jsx("path",{d:"M12 17.2h.01"})]});case"copy":return c.jsxs("svg",{...E,children:[c.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),c.jsx("path",{d:"M15 5.5A1.5 1.5 0 0 0 13.5 4H5.5A1.5 1.5 0 0 0 4 5.5v8A1.5 1.5 0 0 0 5.5 15"})]});case"send-right":return c.jsxs("svg",{...E,children:[c.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),c.jsx("path",{d:"M8 12h7"}),c.jsx("path",{d:"M12.5 9l2.5 3-2.5 3"})]});case"info":return c.jsxs("svg",{...E,children:[c.jsx("circle",{cx:"12",cy:"12",r:"9"}),c.jsx("path",{d:"M12 11v5"}),c.jsx("path",{d:"M12 8h.01"})]});default:return c.jsx("span",{className:"icon","aria-hidden":"true",children:"•"})}}function Wu(n){if(!n||n.kind!=="ssh")return null;const C=n.sshTarget||n.host;return C&&C!=="local"?C:null}function Pv(n){return n?Wu(n)?{available:!0,reason:`Transfer files with ${n.host}`}:{available:!1,reason:`${n.name} is a local session — SFTP needs an SSH connection`}:{available:!1,reason:"Open an SSH session to transfer files"}}function Ta(n){return n.kind==="directory"||n.kind==="symlink"}function hp(n,C,E=!1){return n.filter(A=>C.has(A.name)&&(E||A.kind!=="directory"))}function up(n,C,E="file"){return C===0?n:`${n} ${C} ${C===1?E:`${E}s`}`}function dp(n,C,E,A,N){if(A&&N){const P=N.indexOf(A),r=N.indexOf(C);if(P>=0&&r>=0){const d=E?new Set(n):new Set,g=Math.min(P,r),p=Math.max(P,r);for(const l of N.slice(g,p+1))d.add(l);return d}}if(!E)return new Set([C]);const G=new Set(n);return G.has(C)?G.delete(C):G.add(C),G}const Qp=["\\\\wsl.localhost\\","\\\\wsl$\\"];function $v(n){if(!n)return null;if(n.kind==="ssh")return"posix";switch(n.backend){case"powershell":case"pwsh":return"powershell";case"cmd":return"cmd";case"bash":case"zsh":case"fish":case"sh":case"wsl":case"screen":return"posix";default:return null}}function qu(n){return!!(n&&n.kind==="local"&&n.backend==="wsl"&&n.wslDistribution)}function Fv(n,C){const A=C.replace(/\/+$/,"").split("/").filter(Boolean),N=A.length?A.join("\\"):".";return`${Qp[0]}${n}\\${N}`}function Wv(n,C){const E=C.replace(/\//g,"\\");for(const A of Qp){const N=`${A}${n}`;if(!E.toLowerCase().startsWith(N.toLowerCase()))continue;return`/${E.slice(N.length).replace(/^\\+/,"").split("\\").filter(r=>r&&r!==".").join("/")}`}return null}function fp(n){return n?n.kind==="ssh"?"posix":qu(n)?"unc":n.backend===void 0?null:n.host==="local"&&/^[A-Za-z]:/.test(n.cwd??"")?"windows":"posix":null}function _p(n,C){if(!n)return null;const E=Gv(n.cwd,C);return E?qu(n)?E.startsWith("/")?Fv(n.wslDistribution,E):null:E:null}function qv(n,C){const E=_p(n,C);return E||(!n||!C?null:_p({...n,cwd:C},C))}function Du(n,C){return n?qu(n)?Wv(n.wslDistribution,C):C:null}function Gv(n,C){return n?n==="~"?C??null:n.startsWith("~/")?C?`${C.replace(/\/+$/,"")}/${n.slice(2)}`:null:n:null}function Kv(n,C){if(C==="posix"){const r=n.replace(/\/+$/,"");if(!r||r==="")return null;const d=r.lastIndexOf("/");return d<0?null:d===0?"/":r.slice(0,d)}if(C==="windows"){const r=n.replace(/[\\/]+$/,"");if(/^[A-Za-z]:$/.test(r))return null;const d=Math.max(r.lastIndexOf("\\"),r.lastIndexOf("/"));if(d<0)return null;const g=r.slice(0,d);return/^[A-Za-z]:$/.test(g)?`${g}\\`:g}const A=n.replace(/\//g,"\\").replace(/\\+$/,"").match(/^(\\\\[^\\]+\\[^\\]+)(?:\\(.*))?$/);if(!A)return null;const[,N,G=""]=A,P=G.split("\\").filter(r=>r&&r!==".");return P.length?(P.pop(),P.length?`${N}\\${P.join("\\")}`:`${N}\\.`):null}const Vv=new RegExp(`[
75
- \r]`);function Yv(n,C){return C?Vv.test(C)?{refused:"That directory name contains a line break, which cannot be typed safely."}:n==="posix"?{command:`cd '${C.split("'").join(String.raw`'\''`)}'`}:n==="powershell"?{command:`Set-Location -LiteralPath '${C.split("'").join("''")}'`}:C.includes('"')?{refused:"Command Prompt cannot quote a directory name containing a double quote."}:{command:`cd /d "${C}"`}:{refused:"That directory has no path."}}function Xv(n,C,E){return E==="posix"?n==="/"?`/${C}`:`${n.replace(/\/+$/,"")}/${C}`:`${n.replace(/\\\.$/,"").replace(/[\\/]+$/,"")}\\${C}`}function Jp(n){return n.startsWith(".")}function Fr(n,C){return C.startsWith("/")?C:n==="/"?`/${C}`:`${n.replace(/\/+$/,"")}/${C}`}function Zv(n){const C=n.replace(/\/+$/,""),E=C.lastIndexOf("/");return E<=0?"/":C.slice(0,E)}function em(n){return/^[A-Za-z]:/.test(n)||n.startsWith("\\\\")||n.includes("\\")}function La(n,C){const E=em(n)?"\\":"/";return`${n.replace(/[\\/]+$/,"")}${E}${C}`}function Qv(n){const C=em(n),E=n.replace(/[\\/]+$/,""),A=Math.max(E.lastIndexOf("/"),E.lastIndexOf("\\"));if(A<0)return n;if(!C)return A===0?"/":E.slice(0,A);const N=E.slice(0,A);return/^[A-Za-z]:$/.test(N)?`${N}\\`:N||"\\"}function Go(n){const C=n.split(/[\\/]/).filter(Boolean);return C[C.length-1]??n}function Jv(n){if(n.kind==="directory")return"—";const C=["B","KB","MB","GB","TB"];let E=n.size,A=0;for(;E>=1024&&A<C.length-1;)E/=1024,A+=1;return`${A===0?E:E.toFixed(E<10?1:0)} ${C[A]}`}function e0(n){if(!n)return"";const C=n.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/);if(!C)return n;const[,E,A,N,G,P]=C;return`${E}-${A}-${N} ${G}:${P}`}function tm({session:n,path:C,unanchored:E=!1,pathKind:A,shellPath:N,list:G,question:P,onOpen:r,onBrowse:d,onClose:g,onOpenFile:p,openFile:l,defaultShowHidden:S}){const[x,R]=Z.useState({phase:"idle"}),[m,a]=Z.useState(S),u=Z.useCallback(T=>{let y=!1;return R({phase:"loading",path:T??""}),G(T??void 0).then(L=>{y||R({phase:"ready",path:T??L.path,listing:L})}).catch(L=>{y||R({phase:"failed",path:T??"",message:L instanceof Error?L.message:String(L)})}),()=>{y=!0}},[G]);Z.useEffect(()=>{if(!C&&!E){R({phase:"idle"});return}return u(C)},[C,E,u]);const f=x.phase==="ready"?x.listing.path:C,h=f?Kv(f,A):null,b=x.phase==="ready"?x.listing.entries:[],w=[...m?b:b.filter(T=>!Jp(T.name))].sort((T,y)=>{const L=Ta(T)?0:1,O=Ta(y)?0:1;return L===O?T.name.localeCompare(y.name):L-O});return c.jsxs("div",{className:"pane-browser","aria-label":`Directories on ${n.host}`,children:[c.jsxs("div",{className:"pane-browser-head",children:[c.jsx("span",{className:"pane-browser-path",title:f??"",children:N??f??"connecting…"}),c.jsxs("span",{className:"pane-browser-actions",children:[c.jsxs("label",{className:"pane-browser-hidden-toggle",title:"Show files whose name starts with a dot",children:[c.jsx("input",{type:"checkbox",checked:m,onChange:T=>a(T.target.checked)}),"Hidden"]}),c.jsx("button",{type:"button",className:"pane-browser-icon",disabled:x.phase!=="ready"&&x.phase!=="failed",onClick:()=>u(f??C),title:"Refresh","aria-label":"Refresh",children:c.jsx(Oe,{name:"refresh"})}),c.jsx("button",{type:"button",className:"pane-browser-icon",onClick:g,title:"Close the browser","aria-label":"Close the browser",children:c.jsx(Oe,{name:"x"})})]})]}),c.jsx("div",{className:"pane-browser-list",children:P&&x.phase==="loading"?c.jsxs("p",{className:"pane-browser-note pane-browser-asking",children:[P,c.jsx("br",{}),"Answer it in the transfer panel (⇅), then refresh."]}):x.phase==="idle"?c.jsx("p",{className:"pane-browser-note",children:"This pane has not said where it is yet. Run a command, or add shell integration in Settings."}):x.phase==="failed"?c.jsx("p",{className:"pane-browser-note pane-browser-error",children:x.message}):c.jsxs(c.Fragment,{children:[h?c.jsx(pp,{label:"..",icon:"level-up",target:h,navigable:!0,className:"pane-browser-parent",onOpen:r,onBrowse:d},".."):null,w.map(T=>{const y=Xv(f??"",T.name,A);return c.jsx(pp,{label:T.name,icon:Ta(T)?"folder":"file",target:y,navigable:Ta(T),link:T.kind==="symlink",onOpen:r,onBrowse:d,onFile:p,current:l===y},T.name)}),x.phase==="ready"&&!w.length?c.jsx("p",{className:"pane-browser-note",children:b.length&&!m?"Nothing here but hidden files.":"Nothing here."}):null,x.phase==="loading"?c.jsx("p",{className:"pane-browser-note",children:"Listing…"}):null]})}),p?c.jsx("div",{className:"pane-browser-foot",children:c.jsx("small",{children:"Click a file to open it."})}):c.jsxs("div",{className:"pane-browser-foot",children:[c.jsx("small",{children:"Double-click a folder to take the shell there."}),c.jsx("button",{type:"button",className:"pane-browser-send",disabled:!f,onClick:()=>f&&r(f),title:"Take the shell to this directory","aria-label":"Take the shell to this directory",children:c.jsx(Oe,{name:"send-right"})})]})]})}function pp({label:n,icon:C,target:E,navigable:A,link:N,className:G="",onOpen:P,onBrowse:r,onFile:d,current:g=!1}){const p=Gp(()=>A&&r(E),()=>A&&P(E));return!A&&!!d?c.jsxs("button",{type:"button",className:`pane-browser-row pane-browser-file-choice ${g?"pane-browser-current":""} ${G}`.trim(),onClick:()=>d?.(E),title:`${n} — click to open`,"aria-current":g||void 0,children:[c.jsx(Oe,{name:C}),c.jsx("span",{className:"pane-browser-name",children:n}),N?c.jsx("span",{className:"pane-browser-kind",children:"link"}):null]}):c.jsxs("button",{type:"button",className:`pane-browser-row ${A?"":"pane-browser-file"} ${G}`.trim(),disabled:!A,onClick:p.onClick,onDoubleClick:p.onDoubleClick,onKeyDown:S=>{S.key!=="Enter"||!A||(S.preventDefault(),p.cancel(),P(E))},title:A?`${n} — double-click to take the shell there`:n,children:[c.jsx(Oe,{name:C}),c.jsx("span",{className:"pane-browser-name",children:n}),N?c.jsx("span",{className:"pane-browser-kind",children:"link"}):null]})}const qr=[{action:"toggle-help",chord:"Ctrl+Shift+/",description:"this help panel"},{action:"new-terminal",chord:"Ctrl+Shift+T",description:"new local terminal in the current workspace"},{action:"new-workspace",chord:"Ctrl+Shift+N",description:"new workspace"},{action:"toggle-overview",chord:"Ctrl+Shift+O",description:"session overview"},{action:"toggle-layout",chord:"Ctrl+Shift+L",description:"fold to a single pane, or back to the last split"},{action:"toggle-sidebar",chord:"Ctrl+Shift+B",description:"toggle sessions sidebar"},{action:"history-palette",chord:"Ctrl+Shift+R",description:"ranked command history palette"},{action:"ask-ai",chord:"Ctrl+Shift+A",description:"ask the AI endpoint for a command"},{action:"toggle-settings",chord:"Ctrl+Shift+,",description:"settings"}],Gu=[{chord:"Ctrl+Shift+C",description:"copy the terminal selection",reason:"the terminal uses it to copy"},{chord:"Ctrl+Shift+V",description:"paste into the focused terminal",reason:"the terminal uses it to paste"}],t0=[{chord:"Ctrl+Shift+O",owner:"Teams, for its camera toggle while a call is running"},{chord:"Ctrl+Shift+M",owner:"Teams, for mute while a call is running"}],i0=[[/^Key([A-Z])$/,n=>n[1]],[/^Digit([0-9])$/,n=>n[1]],[/^F([1-9]|1[0-2])$/,n=>`F${n[1]}`],[/^Comma$/,()=>","],[/^Period$/,()=>"."],[/^Slash$/,()=>"/"],[/^Semicolon$/,()=>";"],[/^Quote$/,()=>"'"],[/^BracketLeft$/,()=>"["],[/^BracketRight$/,()=>"]"],[/^Minus$/,()=>"-"],[/^Equal$/,()=>"="],[/^Backquote$/,()=>"`"],[/^(Space|Enter|Tab|Backspace|Home|End|PageUp|PageDown|Insert|Delete)$/,n=>n[1]],[/^Arrow(Up|Down|Left|Right)$/,n=>n[1]]];function s0(n){for(const[C,E]of i0){const A=C.exec(n);if(A)return E(A)}return null}function im(n){const C=n.ctrlKey||n.metaKey,E=!!n.altKey;if(!C||!(n.shiftKey||E))return null;const A=s0(n.code);return A?["Ctrl",...E?["Alt"]:[],...n.shiftKey?["Shift"]:[],A].join("+"):null}const r0=/^([A-Z]|[0-9]|F([1-9]|1[0-2])|[,./;'\[\]\-=`]|Space|Enter|Tab|Backspace|Home|End|PageUp|PageDown|Insert|Delete|Up|Down|Left|Right)$/;function sm(n){if(typeof n!="string"||!n||n.length>40)return!1;const C=n.split("+"),E=C.pop();if(!r0.test(E)||C[0]!=="Ctrl")return!1;const A=C.slice(1).join("+");return A==="Shift"||A==="Alt"||A==="Alt+Shift"}const Lc=Object.freeze(Object.fromEntries(qr.map(n=>[n.action,n.chord]))),rm=/^Ctrl\+Shift\+([1-9])$/;function nm(n,C,E={}){if(!sm(n))return"A shortcut needs Ctrl and at least one of Shift or Alt, so a shell keeps Ctrl+C and Ctrl+R for itself.";const A=Gu.find(G=>G.chord===n);if(A)return`${n} is reserved: ${A.reason}.`;if(rm.test(n))return`${n} switches to a workspace by position.`;const N=E[n];if(N&&N!==C){const G=qr.find(P=>P.action===N)?.description??N;return`${n} is already ${G}.`}return null}function Ku(n={}){const C={...Lc},E=[],A=new Map;for(const{action:N}of qr){const G=n?.[N];if(typeof G!="string"||!G||G===C[N])continue;const P=nm(G,N);if(P){E.push({action:N,chord:G,reason:P});continue}A.set(N,G)}for(const[N,G]of A)C[N]=G;for(const{action:N}of[...qr].reverse()){const G=C[N],P=Object.entries(C).find(([d,g])=>d!==N&&g===G);if(!P||!A.has(N))continue;C[N]=Lc[N];const r=qr.find(d=>d.action===P[0])?.description??P[0];E.push({action:N,chord:G,reason:`${G} is already ${r}.`})}return{chords:C,rejected:E}}const kc=Ku();function xi(n,C=kc){return C.chords[n]??Lc[n]}function n0(n,C=kc){return xi(n,C)!==Lc[n]}function a0(n,C=kc){if(n.inTextField)return null;const E=im(n);if(!E)return null;const A=rm.exec(E);if(A)return{action:"switch-workspace",position:Number(A[1])};for(const[N,G]of Object.entries(C.chords))if(G===E)return{action:N};return null}const o0=["help","editor","transfer","settings","voiceReview","overview","suggest","modal","palette","history"];function l0(n){return o0.find(C=>n[C])??null}function c0(n=kc){return[...qr.map(({action:C,description:E})=>({chord:xi(C,n),description:E})),{chord:"Ctrl+Shift+1 … 9",description:"switch to a workspace by position"},...Gu.map(C=>({chord:C.chord,description:C.description})),{chord:"Esc",description:"close whatever is open, or cancel a recording"}]}const h0=40;function am(n){if(typeof n!="string")return null;const C=n.trim();return!C||C.length>h0?null:C.startsWith("v")||C.startsWith("V")?C:`v${C}`}function om(n){const C=am(n);return C?`ZeroG Terminal ${C}`:"ZeroG Terminal"}const u0=n=>[{title:"Workspaces",body:"The boxes beside the wordmark are workspaces, each holding its own panes, layout, focused terminal and maximized pane. Drag them to reorder, which also reorders what Ctrl+Shift+1 to 9 switch to, and right-click one for rename, duplicate, move and close. Duplicating copies the layout and brings each SSH pane across as one to reconnect; a local shell belongs to a process on this machine, so it is not copied. Switching to one restores the arrangement you left. They survive a relaunch: local terminals reattach, and SSH panes come back as ghost rows that reconnect when clicked."},{title:"Panes and layouts",body:"Up to four panes per workspace, as a stack, two splits, or a grid. Drag the dividers to resize, double-click one to even it up, and maximize a pane without losing the others."},{title:"Sessions",body:"Local shells — Bash, PowerShell, Command Prompt, WSL, Git Bash — and SSH hosts. Persistent sessions use screen where it is available, so a crash or a closed lid does not end the work. A WSL pane starts in the distribution’s own home directory."},{title:"The directory browser",body:"The folder button in a pane’s title bar splits that pane and lists where its shell is standing. Single-click to look, double-click to take the shell there, or use the button in the corner to send it to whatever is on screen. It works on SSH panes and local ones, WSL included, and follows a cd you type by hand."},{title:"Shared ports",body:"The Ports view on the rail forwards a port over SSH in either direction, VS Code style. Each tunnel is its own connection, so a host needs no terminal open first, and ports bind to loopback unless you widen them."},{title:"File transfer",body:"The ⇅ button above the panes opens SFTP for the active SSH session: this computer on the left, the host on the right, opening at the directory that shell is in. Upload, download, new folder, rename, delete."},{title:"Command history",body:`${xi("history-palette",n)} ranks the commands you have run by directory, host, recency, frequency and whether they worked. Off until you turn it on in Settings, and it refuses to store anything that looks like a credential.`},{title:"AI suggestions and voice",body:"Ask for a command in plain words and approve it before it runs, using any OpenAI-compatible endpoint you point at in Settings. The microphone in a pane’s title bar types what you say into that terminal without running it."},{title:"The proceed button",body:"The tick in a pane’s title bar sends a phrase you choose — “OK, proceed” by default — for waving an agent on without typing the same reply again."},{title:"The AI button",body:"The bot icon in a pane’s title bar runs a command you choose in Settings — “claude” by default — for launching your preferred AI CLI without typing it yourself."}];function d0({version:n,bindings:C,onClose:E}){const A=t0.filter(N=>Object.values(C.chords).includes(N.chord));return c.jsx("div",{className:"modal-layer",role:"dialog","aria-modal":"true","aria-label":"Help",children:c.jsxs("div",{className:"help-card",children:[c.jsxs("div",{className:"modal-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:"HELP"}),c.jsx("h2",{children:om(n)})]}),c.jsx("button",{type:"button",className:"close-button",onClick:E,children:"Esc"})]}),c.jsxs("div",{className:"help-body",children:[c.jsxs("section",{className:"help-keys","aria-label":"Keyboard shortcuts",children:[c.jsx("h3",{children:"Keyboard"}),c.jsx("table",{children:c.jsx("tbody",{children:c0(C).map(N=>c.jsxs("tr",{children:[c.jsx("th",{scope:"row",children:c.jsx("kbd",{children:N.chord})}),c.jsx("td",{children:N.description})]},N.chord))})}),c.jsxs("p",{className:"help-note",children:[c.jsx(Oe,{name:"info"}),c.jsxs("span",{children:["Only chords with Ctrl and Shift or Alt are claimed, so a shell keeps Ctrl+C, Ctrl+R, Ctrl+L and Ctrl+A for itself. If one of these does nothing, something outside ZeroG has taken it first — Windows uses Ctrl and Shift together to switch keyboard layout when more than one is installed",A.length?", and ":". ",A.map((N,G)=>c.jsxs(An.Fragment,{children:[G>0?"; ":"",c.jsx("kbd",{children:N.chord})," is also ",N.owner]},N.chord)),A.length?". ":"","Any of them can be moved in Settings, and every one has a button that does the same job."]})]})]}),c.jsxs("section",{className:"help-features","aria-label":"Features",children:[c.jsx("h3",{children:"What is here"}),c.jsx("dl",{children:u0(C).map(N=>c.jsxs(An.Fragment,{children:[c.jsx("dt",{children:N.title}),c.jsx("dd",{children:N.body})]},N.title))})]})]}),c.jsx("small",{className:"help-foot",children:"The README covers all of this in more detail, including what is stored on this machine and what is refused."})]})})}const Rn="\x1B",Tc="\x07",f0=new RegExp(Rn+"\\]7;([^"+Tc+Rn+"]*)(?:"+Tc+"|"+Rn+"\\\\)","g"),_0=new RegExp(Rn+"\\][^"+Tc+Rn+"]*(?:"+Tc+"|"+Rn+"\\\\)","g"),p0=new RegExp(Rn+"\\[[0-9;?]*[ -/]*[@-~]","g");function m0(n){const C=n.match(/^file:\/\/[^/]*(\/.*)$/);if(!C)return null;try{const E=decodeURIComponent(C[1]);return E.includes("\0")?null:E}catch{return null}}function g0(n){const E=n.replace(_0,"").replace(p0,"").replace(/\r/g,`
76
- `).split(`
77
- `).filter(P=>P.trim()),A=E[E.length-1];if(!A)return null;const N=A.match(/(?:^|[:\s])(~|~\/[^\s:]*|\/[^\s:]*)\s*[#$%>]\s*$/);return N?N[1].replace(/\/+$/,"")||"/":null}function v0(n){let C=null;for(const A of n.matchAll(f0))C=A[1];if(C){const A=m0(C);if(A)return{path:A,source:"osc7"}}const E=g0(n);return E?{path:E,source:"prompt"}:null}function lm(n){return!n||n==="~"||n==="~/"?{}:n.startsWith("/")?{absolute:n}:n.startsWith("~/")?{homeRelative:n.slice(2)}:{}}const S0=/connection is closed|not connected|no such connection/i;function b0(n,C){const E=new Map,A=new Map,N=new Map;function G(){const p=n();if(!p)throw new Error("The terminal bridge is not available.");return p}async function P(p,l=!1){l&&(A.delete(p.id),N.delete(p.id));const S=A.get(p.id);if(S)return S;const x=N.get(p.id);if(x!==void 0)return x;const R=Wu(p);if(!R)throw new Error(`${p.name} has no SSH host to list.`);const m=G().sftpOpen(R).then(a=>{const u={handle:a.id,home:a.cwd};return A.set(p.id,u),C?.(p.id,a.cwd),u}).finally(()=>{N.delete(p.id)});return N.set(p.id,m),m}function r(p,l){if(!p)return;const S=lm(p);return S.absolute?S.absolute:S.homeRelative?Fr(l,S.homeRelative):l}async function d(p,l){const S=await P(p);try{return await l(S)}catch(x){const R=x instanceof Error?x.message:String(x);if(!S0.test(R))throw x;return await l(await P(p,!0))}}function g(p,l){return d(p,S=>G().sftpList(S.handle,r(l,S.home)))}return{listerFor(p){const l=E.get(p.id);if(l)return l;const S=x=>p.kind==="ssh"?g(p,x):Promise.resolve().then(()=>G().listLocalDirectory(x));return E.set(p.id,S),S},withHandle(p,l){return p.kind!=="ssh"?Promise.reject(new Error(`${p.name} is not an SSH pane.`)):d(p,S=>l(S.handle))},homeFor(p){return A.get(p)?.home},async learnHome(p){if(p.kind!=="ssh")return;const l=A.get(p.id);return l?l.home:(await P(p)).home},forget(p){E.delete(p),A.delete(p),N.delete(p)}}}function y0(n){const C=new Map;for(const E of n){const A=cs(E.target)||E.target,N=C.get(A)??{host:A,forwards:[]};N.forwards.push(E),C.set(A,N)}return[...C.values()]}function C0(n){return n.status==="open"?"connected":n.status==="error"?"error":n.status==="connecting"?"detached":""}function mp(n){const C=`${n.destinationHost||"localhost"}:${n.destinationPort}`;return n.direction==="local"?`${xn(n)} → ${C}`:`${xn(n)} → ${C} here`}function xn(n){if(n.direction==="local")return`${n.bind==="all"?"0.0.0.0":"localhost"}:${n.listenPort}`;const C=cs(n.target)||n.target;return`${n.bind==="all"?`${C} (all)`:C}:${n.listenPort}`}function w0(n){return n.bind==="all"}function x0(n,C){const E=C.find(A=>A.id===n.id||A.listenPort!==n.listenPort||A.direction!==n.direction?!1:n.direction==="local"?!0:cs(A.target)===cs(n.target));return E?n.direction==="local"?`Port ${n.listenPort} is already shared from ${E.target}.`:`Port ${n.listenPort} is already shared to ${E.target}.`:null}function Wo(n,C){const E=n.findIndex(N=>N.id===C.id);if(E<0)return[...n,C];const A=[...n];return A[E]=C,A}function E0(n){return{version:1,forwards:n.map(({status:C,message:E,...A})=>A)}}function A0(n){return n.forwards.map(C=>({...C,status:"idle"}))}function R0({session:n,target:C,api:E,onClose:A,backdrop:N,defaultShowHidden:G}){const[P,r]=Z.useState(null),[d,g]=Z.useState(null),[p,l]=Z.useState(null),[S,x]=Z.useState({local:!0,remote:!0}),[R,m]=Z.useState({local:new Set,remote:new Set}),[a,u]=Z.useState({local:"",remote:""}),[f,h]=Z.useState("Connecting…"),[b,M]=Z.useState({}),[w,T]=Z.useState(null),[y,L]=Z.useState(null),[O,U]=Z.useState(""),[H,z]=Z.useState(null),[Y,ne]=Z.useState(null),[V,X]=Z.useState(null),[I,j]=Z.useState(G),W=Z.useRef({local:null,remote:null}),B=Z.useRef(null),F=Z.useRef(void 0),te=Z.useRef(void 0);F.current=P?.path,te.current=d?.path;const ie=Z.useRef(!0);Z.useEffect(()=>()=>{ie.current=!1},[]);const he=Z.useCallback(de=>{const ue=de instanceof Error?de.message:String(de);return h(ue),ue},[]),ge=Z.useCallback(async de=>{x(ue=>({...ue,local:!0}));try{const ue=await E.listLocalDirectory(de);if(!ie.current)return;r(ue),u(be=>({...be,local:ue.path})),m(be=>({...be,local:new Set})),M(be=>({...be,local:void 0}))}catch(ue){if(!ie.current)return;M(be=>({...be,local:he(ue)}))}finally{ie.current&&x(ue=>({...ue,local:!1}))}},[E,he]),J=Z.useCallback(async de=>{const ue=B.current;if(ue){x(be=>({...be,remote:!0}));try{const be=await E.sftpList(ue,de);if(!ie.current)return;g(be),u(Le=>({...Le,remote:be.path})),m(Le=>({...Le,remote:new Set})),M(Le=>({...Le,remote:void 0}))}catch(be){if(!ie.current)return;M(Le=>({...Le,remote:he(be)}))}finally{ie.current&&x(be=>({...be,remote:!1}))}}},[E,he]);Z.useEffect(()=>E.onSftpEvent?.(de=>{if(!ie.current)return;const ue=B.current;if(de.type==="prompt"){if(ue&&de.prompt.sessionId!==ue)return;B.current=de.prompt.sessionId,L(de.prompt),U("");return}ue&&de.sessionId!==ue||(de.type==="progress"&&T({name:de.name,percent:de.percent,detail:de.detail}),de.type==="status"&&h(de.message),de.type==="closed"&&(B.current=null,l(null),M(be=>({...be,remote:de.message})),h(de.message)))}),[E]),Z.useEffect(()=>{ge();const de=lm(n.cwd);let ue=!1;return(async()=>{try{const be=await E.sftpOpen(C,de.absolute);if(ue||!ie.current)return;B.current=be.id,l(be),L(null),h(`Connected to ${be.target}`),await J(de.homeRelative?Fr(be.cwd,de.homeRelative):void 0)}catch(be){if(ue||!ie.current)return;L(null),x(Le=>({...Le,remote:!1})),M(Le=>({...Le,remote:he(be)}))}})(),()=>{ue=!0}},[]);const q=Z.useCallback(de=>de==="local"?ge(F.current):J(te.current),[ge,J]),re=(de,ue)=>de==="local"?ge(ue):J(ue),_e=Z.useMemo(()=>hp(P?.entries??[],R.local),[P,R.local]),Ce=Z.useMemo(()=>hp(d?.entries??[],R.remote,!0),[d,R.remote]),we=w!==null,Be=async de=>{const ue=B.current;if(!ue||!P||!d)return;const be=de==="upload"?_e:Ce;if(!be.length)return;T({name:be[0].name,percent:0,detail:"starting"});let Le=0;try{for(const Pe of be)h(`${de==="upload"?"Uploading":"Downloading"} ${Pe.name}…`),de==="upload"?await E.sftpUpload(ue,La(P.path,Pe.name),d.path):await E.sftpDownload(ue,Fr(d.path,Pe.name),P.path,Pe.kind),Le+=1;h(`${de==="upload"?"Uploaded":"Downloaded"} ${Le} ${Le===1?"file":"files"}.`)}catch(Pe){const lt=he(Pe);h(`${lt} (${Le} of ${be.length} transferred)`)}finally{ie.current&&(T(null),await q(de==="upload"?"remote":"local"))}},Re=async de=>{if(de.preventDefault(),!H)return;const ue=H.value.trim(),be=H.side;if(ue)try{be==="local"&&P?await E.createLocalDirectory(La(P.path,ue)):be==="remote"&&d&&B.current&&await E.sftpMkdir(B.current,Fr(d.path,ue)),z(null),h(`Created ${ue}`),await q(be)}catch(Le){he(Le)}},Ge=async de=>{if(de.preventDefault(),!Y)return;const ue=Y.value.trim(),{side:be,entry:Le}=Y;if(!ue||ue===Le.name){ne(null);return}try{be==="local"&&P?await E.renameLocalEntry(La(P.path,Le.name),La(P.path,ue)):be==="remote"&&d&&B.current&&await E.sftpRename(B.current,Fr(d.path,Le.name),Fr(d.path,ue)),ne(null),h(`Renamed to ${ue}`),await q(be)}catch(Pe){he(Pe)}},tt=async()=>{if(!V)return;const{side:de,entry:ue}=V;try{de==="local"&&P?await E.removeLocalEntry(La(P.path,ue.name),ue.kind):de==="remote"&&d&&B.current&&await E.sftpRemove(B.current,Fr(d.path,ue.name),ue.kind),X(null),h(`Deleted ${ue.name}`),await q(de)}catch(be){he(be)}},De=async de=>{de.preventDefault();const ue=B.current;if(!ue||!y)return;const be=y.kind==="confirm"?"yes":O;L(null),U(""),h(y.kind==="confirm"?"Accepting host key…":"Authenticating…");try{await E.sftpAnswerPrompt(ue,be)}catch(Le){he(Le)}},Tt=async de=>{const ue=B.current;if(L(null),U(""),h(de==="confirm"?"Host key rejected.":"Cancelled. The transfer connection was closed."),!!ue)try{de==="confirm"?await E.sftpAnswerPrompt(ue,"no"):await E.sftpClose(ue)}catch{}},Mt=(de,ue)=>{if(!Ta(ue))return;const be=de==="local"?P?.path:d?.path;be&&re(de,de==="local"?La(be,ue.name):Fr(be,ue.name))},We=de=>{const ue=de==="local"?R.local:R.remote,be=(de==="local"?P?.entries:d?.entries)??[];return ue.size!==1?null:be.find(Le=>ue.has(Le.name))??null},Ue=de=>{const ue=de==="local"?P:d,be=de==="local"?R.local:R.remote,Le=de==="local"?b.local:b.remote,Pe=de==="local"?S.local:S.remote,lt=We(de),dt=de==="remote"&&!p,vt=ue?I?ue.entries:ue.entries.filter(ke=>!Jp(ke.name)):[];return c.jsxs("section",{className:`sftp-pane sftp-pane-${de}`,children:[c.jsxs("header",{className:"sftp-pane-head",children:[c.jsx("span",{className:"eyebrow",children:de==="local"?"THIS COMPUTER":n.host.toUpperCase()}),c.jsxs("div",{className:"sftp-pane-tools",children:[c.jsx("button",{type:"button",title:"Parent folder","aria-label":`${de} parent folder`,disabled:!ue||Pe,onClick:()=>ue&&void re(de,de==="local"?Qv(ue.path):Zv(ue.path)),children:c.jsx(Oe,{name:"level-up"})}),c.jsx("button",{type:"button",title:"Refresh","aria-label":`Refresh ${de}`,disabled:Pe||dt,onClick:()=>{q(de)},children:c.jsx(Oe,{name:"refresh"})}),c.jsx("button",{type:"button",title:"New folder","aria-label":`New folder on ${de}`,disabled:!ue||dt,onClick:()=>z({side:de,value:""}),children:c.jsx(Oe,{name:"folder-plus"})}),c.jsx("button",{type:"button",title:lt?`Rename ${lt.name}`:"Select one item to rename","aria-label":`Rename on ${de}`,disabled:!lt||dt,onClick:()=>lt&&ne({side:de,entry:lt,value:lt.name}),children:c.jsx(Oe,{name:"pencil"})}),c.jsx("button",{type:"button",className:"sftp-danger",title:lt?`Delete ${lt.name}`:"Select one item to delete","aria-label":`Delete on ${de}`,disabled:!lt||dt,onClick:()=>lt&&X({side:de,entry:lt}),children:c.jsx(Oe,{name:"trash"})})]})]}),c.jsx("form",{className:"sftp-path",onSubmit:ke=>{ke.preventDefault();const Ie=(de==="local"?a.local:a.remote).trim();Ie&&re(de,Ie)},children:c.jsx("input",{value:de==="local"?a.local:a.remote,onChange:ke=>{const Ie=ke.target.value;u(je=>de==="local"?{...je,local:Ie}:{...je,remote:Ie})},spellCheck:!1,"aria-label":`${de} path`,placeholder:de==="local"?"Local folder":"Remote folder",disabled:dt})}),c.jsx("div",{className:"sftp-list",role:"listbox","aria-label":`${de} files`,"aria-busy":Pe,children:Le?c.jsxs("div",{className:"sftp-empty sftp-error",children:[c.jsx("b",{children:de==="local"?"Cannot read this folder":"No remote listing"}),c.jsx("small",{children:Le})]}):Pe&&!ue?c.jsxs("div",{className:"sftp-empty",children:[c.jsx("b",{children:de==="remote"&&!p?"Connecting…":"Loading…"}),c.jsx("small",{children:de==="remote"?`Opening SFTP to ${n.host}`:"Reading the local folder"})]}):ue&&vt.length?vt.map(ke=>c.jsxs("button",{type:"button",role:"option","aria-selected":be.has(ke.name),className:`sftp-row ${be.has(ke.name)?"selected":""} ${ke.kind==="directory"?"is-directory":""}`,onClick:Ie=>{const je=Ie.ctrlKey||Ie.metaKey,Wt=W.current[de],wt=Ie.shiftKey&&Wt?Wt:void 0,Ot=vt.map($e=>$e.name);m($e=>de==="local"?{...$e,local:dp($e.local,ke.name,je,wt,Ot)}:{...$e,remote:dp($e.remote,ke.name,je,wt,Ot)}),Ie.shiftKey||(W.current[de]=ke.name)},onDoubleClick:()=>Mt(de,ke),onKeyDown:Ie=>{Ie.key!=="Enter"||!Ta(ke)||(Ie.preventDefault(),Mt(de,ke))},title:ke.linkTarget?`${ke.name} → ${ke.linkTarget}`:ke.name,children:[c.jsx(Oe,{name:ke.kind==="directory"?"folder":ke.kind==="symlink"?"link":"file"}),c.jsx("span",{className:"sftp-name",children:ke.name}),c.jsx("span",{className:"sftp-size",children:Jv(ke)}),c.jsx("span",{className:"sftp-modified",children:e0(ke.modified)})]},ke.name)):ue&&ue.entries.length?c.jsxs("div",{className:"sftp-empty",children:[c.jsx("b",{children:"Nothing here but hidden files"}),c.jsx("small",{children:'Tick "Show hidden" to see them.'})]}):c.jsxs("div",{className:"sftp-empty",children:[c.jsx("b",{children:"Empty folder"}),c.jsx("small",{children:"Nothing here to transfer."})]})}),c.jsxs("footer",{className:"sftp-pane-foot",children:[de==="local"?c.jsxs("button",{type:"button",className:"primary-button",disabled:!_e.length||!p||we,onClick:()=>{Be("upload")},title:_e.length?`Copy to ${n.host}`:"Select files to upload",children:[c.jsx(Oe,{name:"arrow-up"})," ",up("Upload",_e.length)]}):c.jsxs("button",{type:"button",className:"primary-button",disabled:!Ce.length||!p||we,onClick:()=>{Be("download")},title:Ce.length?"Copy to this computer":"Select files to download",children:[c.jsx(Oe,{name:"arrow-down"})," ",up("Download",Ce.length,"item")]}),c.jsx("span",{className:"sftp-count",children:ue?`${vt.length} items`:""})]})]})};return c.jsx("div",{className:"sftp-layer",role:"presentation",...N,children:c.jsxs("section",{className:"sftp-panel",role:"dialog","aria-label":"Transfer files",children:[c.jsxs("div",{className:"sftp-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:"TRANSFER FILES"}),c.jsxs("h2",{children:[n.name," · ",n.host]})]}),c.jsxs("label",{className:"sftp-hidden-toggle",title:"Show files whose name starts with a dot, on both sides",children:[c.jsx("input",{type:"checkbox",checked:I,onChange:de=>j(de.target.checked)}),"Show hidden"]}),c.jsx("button",{type:"button",className:"close-button",onClick:A,children:"Esc"})]}),c.jsxs("div",{className:"sftp-body",children:[Ue("local"),Ue("remote")]}),y&&c.jsxs("form",{className:"sftp-prompt",onSubmit:De,children:[c.jsx("span",{className:"eyebrow warning-text",children:y.kind==="confirm"?"HOST KEY":"AUTHENTICATION"}),c.jsx("pre",{children:y.text}),y.kind==="confirm"?c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>{Tt("confirm")},children:"Reject"}),c.jsx("button",{type:"submit",className:"primary-button",children:"Accept key"})]}):c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:[y.kind==="passphrase"?"Key passphrase":"Password",c.jsx("input",{autoFocus:!0,type:"password",value:O,onChange:de=>U(de.target.value),autoComplete:"off"})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>{Tt(y.kind)},children:"Cancel"}),c.jsx("button",{type:"submit",className:"primary-button",children:"Send"})]})]})]}),H&&c.jsxs("form",{className:"sftp-inline-form",onSubmit:Re,children:[c.jsxs("label",{children:["New folder in ",H.side==="local"?P?.path:d?.path,c.jsx("input",{autoFocus:!0,value:H.value,onChange:de=>z({...H,value:de.target.value}),required:!0})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>z(null),children:"Cancel"}),c.jsx("button",{type:"submit",className:"primary-button",children:"Create"})]})]}),Y&&c.jsxs("form",{className:"sftp-inline-form",onSubmit:Ge,children:[c.jsxs("label",{children:["Rename ",Y.entry.name,c.jsx("input",{autoFocus:!0,value:Y.value,onChange:de=>ne({...Y,value:de.target.value}),required:!0})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>ne(null),children:"Cancel"}),c.jsx("button",{type:"submit",className:"primary-button",children:"Rename"})]})]}),V&&c.jsxs("div",{className:"sftp-inline-form",children:[c.jsx("span",{className:"eyebrow warning-text",children:"CONFIRM DELETE"}),c.jsxs("p",{children:["Delete ",c.jsx("b",{children:V.entry.name})," from ",V.side==="local"?"this computer":n.host,"?",V.entry.kind==="directory"?" Only an empty folder can be deleted here.":""]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",autoFocus:!0,onClick:()=>X(null),children:"Cancel"}),c.jsx("button",{type:"button",className:"primary-button sftp-danger-button",onClick:()=>{tt()},children:"Delete"})]})]}),c.jsxs("footer",{className:"sftp-foot",children:[w?c.jsxs("div",{className:"sftp-progress",role:"progressbar","aria-valuenow":w.percent,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Transferring ${w.name}`,children:[c.jsx("div",{className:"sftp-progress-fill",style:{width:`${w.percent}%`}}),c.jsxs("span",{children:[Go(w.name)," · ",w.percent,"% · ",w.detail]})]}):c.jsx("span",{className:"sftp-notice",children:f}),c.jsx("span",{className:"sftp-hint",children:"Double-click a folder to open · Ctrl-click to select several · Esc closes"})]})]})})}const gp={q4:96,q8:41,fp16:76,fp32:152},vp={q4:142,q8:77,fp16:146,fp32:291},Sp={q4:299,q8:249,fp16:485,fp32:968},Vu=[{id:"onnx-community/whisper-tiny.en",label:"Whisper tiny · English",family:"tiny",multilingual:!1,downloadMb:gp},{id:"onnx-community/whisper-base.en",label:"Whisper base · English",family:"base",multilingual:!1,downloadMb:vp},{id:"onnx-community/whisper-small.en",label:"Whisper small · English",family:"small",multilingual:!1,downloadMb:Sp},{id:"onnx-community/whisper-tiny",label:"Whisper tiny · multilingual",family:"tiny",multilingual:!0,downloadMb:gp},{id:"onnx-community/whisper-base",label:"Whisper base · multilingual",family:"base",multilingual:!0,downloadMb:vp},{id:"onnx-community/whisper-small",label:"Whisper small · multilingual",family:"small",multilingual:!0,downloadMb:Sp}],L0="onnx-community/whisper-tiny.en",bp=[{value:"q8",label:"q8 · quantized",detail:"Smallest download, fastest on CPU"},{value:"q4",label:"q4",detail:"Smaller weights, some accuracy loss"},{value:"fp16",label:"fp16",detail:"Half precision; needs WebGPU to pay off"},{value:"fp32",label:"fp32 · full",detail:"Most accurate, largest download"}],cm=[{value:"auto",label:"Detect automatically"},{value:"en",label:"English"},{value:"es",label:"Spanish"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"it",label:"Italian"},{value:"pt",label:"Portuguese"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"sv",label:"Swedish"},{value:"da",label:"Danish"},{value:"no",label:"Norwegian"},{value:"fi",label:"Finnish"},{value:"cs",label:"Czech"},{value:"el",label:"Greek"},{value:"tr",label:"Turkish"},{value:"ru",label:"Russian"},{value:"uk",label:"Ukrainian"},{value:"he",label:"Hebrew"},{value:"ar",label:"Arabic"},{value:"hi",label:"Hindi"},{value:"zh",label:"Chinese"},{value:"ja",label:"Japanese"},{value:"ko",label:"Korean"},{value:"id",label:"Indonesian"},{value:"th",label:"Thai"},{value:"vi",label:"Vietnamese"}];function Oc(n){return Vu.find(C=>C.id===n)}function T0(n){return Oc(n)?.multilingual??!1}function M0(n,C){return Oc(n)?.downloadMb[C]??null}function D0(n,C){const E=M0(n,C);return E===null?"Download size unknown":`≈${E} MB download, cached after first use`}const k0={bash:"bash",zsh:"zsh",fish:"fish",sh:"sh",powershell:"Windows PowerShell",pwsh:"PowerShell 7",cmd:"Command Prompt",wsl:"WSL"};function hm(n){return k0[n]??n}const O0=10;function um(){return Array.from({length:O0},()=>({label:"",command:""}))}const dm="zerog-settings",fm="zerog-theme",ze={shortcuts:{},appearance:{theme:"dark",font:"system",fontSize:13,lineHeight:1.2,letterSpacing:0},terminal:{scrollback:1e4,cursorStyle:"block",cursorBlink:!0,copyOnSelect:!0},sessions:{defaultBackend:"bash",defaultWslDistribution:"",defaultLayout:"stack",startSidebarCollapsed:!1,sidebarWidth:238,splitColumnRatio:.5,splitRowRatio:.5,showHiddenFiles:!1},ai:{requireApproval:!0,voiceInsert:"type",proceedPhrase:"OK, proceed",aiCommand:"claude",customButtons:um(),recordCommands:!1,baseUrl:"http://127.0.0.1:11434/v1",model:"",includeOutput:!1,outputChars:2e3},speech:{engine:"builtin",model:L0,precision:"q8",device:"wasm",language:"auto",task:"transcribe",maxUtteranceSeconds:30,silenceThreshold:.004,serverUrl:"http://127.0.0.1:8080/v1/audio/transcriptions",serverModel:"Qwen3-ASR-0.6B"}},Et={fontSize:{min:8,max:32},lineHeight:{min:1,max:2},letterSpacing:{min:-2,max:4},scrollback:{min:200,max:2e5},maxUtteranceSeconds:{min:5,max:120},outputChars:{min:200,max:8e3},silenceThreshold:{min:5e-4,max:.05},sidebarWidth:{min:180,max:520},splitRatio:{min:.15,max:.85}},yp={system:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',jetbrains:'"JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace',cascadia:'"Cascadia Code", "Cascadia Mono", ui-monospace, Consolas, "Liberation Mono", monospace',consolas:'Consolas, "Liberation Mono", ui-monospace, monospace',fira:'"Fira Code", "Fira Mono", ui-monospace, Consolas, "Liberation Mono", monospace',menlo:'Menlo, Monaco, ui-monospace, Consolas, "Liberation Mono", monospace'},B0=[{value:"system",label:"System monospace"},{value:"jetbrains",label:"JetBrains Mono"},{value:"cascadia",label:"Cascadia Code"},{value:"consolas",label:"Consolas"},{value:"fira",label:"Fira Code"},{value:"menlo",label:"Menlo"}];function Uu(n){return yp[n]??yp.system}function j0(n){const C={};for(const{action:E}of qr){const A=n[E];sm(A)&&(C[E]=A)}return C}function Wr(n){return typeof n=="object"&&n!==null}function zi(n,C,E){return typeof n=="string"&&C.includes(n)?n:E}function Sn(n,C){return typeof n=="boolean"?n:C}function Cs(n,C,E){return typeof n!="number"||!Number.isFinite(n)?E:Math.min(C.max,Math.max(C.min,n))}function qo(n,C,E=512){return typeof n!="string"?C:n.slice(0,E)}function Mc(n,C,E=200){return typeof n!="string"?C:Array.from(n.slice(0,E),A=>{const N=A.codePointAt(0)??0;return N<32||N===127?" ":A}).join("")}function Cp(n){return n.proceedPhrase.trim()||ze.ai.proceedPhrase}function ku(n){return n.aiCommand.trim()||ze.ai.aiCommand}function N0(n){const C=Array.isArray(n)?n:[];return um().map((E,A)=>{const N=Wr(C[A])?C[A]:{};return{label:Mc(N.label,E.label,48),command:Mc(N.command,E.command)}})}const wp=["dark","light"],H0=["stack","split-v","split-h","grid"],_m=["bash","zsh","fish","sh","powershell","pwsh","cmd","wsl"],z0=["block","underline","bar"],U0=["system","jetbrains","cascadia","consolas","fira","menlo"],I0=["builtin","server"],P0=["wasm","webgpu"],$0=["q4","q8","fp16","fp32"],F0=["transcribe","translate"],W0=["type","review"];function En(n,C){const E=Wr(n)?n:{},A=Wr(E.appearance)?E.appearance:{},N=Wr(E.terminal)?E.terminal:{},G=Wr(E.sessions)?E.sessions:{},P=Wr(E.ai)?E.ai:{},r=Wr(E.speech)?E.speech:{},d=Wr(E.shortcuts)?E.shortcuts:{},g=zi(C,wp,ze.appearance.theme),p=zi(r.engine,I0,ze.speech.engine),l=zi(r.model,Vu.map(x=>x.id),ze.speech.model),S=p==="server"||Oc(l)?.multilingual?zi(r.language,cm.map(x=>x.value),ze.speech.language):"auto";return{shortcuts:j0(d),appearance:{theme:zi(A.theme,wp,g),font:zi(A.font,U0,ze.appearance.font),fontSize:Math.round(Cs(A.fontSize,Et.fontSize,ze.appearance.fontSize)),lineHeight:Cs(A.lineHeight,Et.lineHeight,ze.appearance.lineHeight),letterSpacing:Cs(A.letterSpacing,Et.letterSpacing,ze.appearance.letterSpacing)},terminal:{scrollback:Math.round(Cs(N.scrollback,Et.scrollback,ze.terminal.scrollback)),cursorStyle:zi(N.cursorStyle,z0,ze.terminal.cursorStyle),cursorBlink:Sn(N.cursorBlink,ze.terminal.cursorBlink),copyOnSelect:Sn(N.copyOnSelect,ze.terminal.copyOnSelect)},sessions:{defaultBackend:zi(G.defaultBackend,_m,ze.sessions.defaultBackend),defaultWslDistribution:qo(G.defaultWslDistribution,ze.sessions.defaultWslDistribution,64),defaultLayout:zi(G.defaultLayout,H0,ze.sessions.defaultLayout),startSidebarCollapsed:Sn(G.startSidebarCollapsed,ze.sessions.startSidebarCollapsed),sidebarWidth:Math.round(Cs(G.sidebarWidth,Et.sidebarWidth,ze.sessions.sidebarWidth)),splitColumnRatio:Cs(G.splitColumnRatio,Et.splitRatio,ze.sessions.splitColumnRatio),splitRowRatio:Cs(G.splitRowRatio,Et.splitRatio,ze.sessions.splitRowRatio),showHiddenFiles:Sn(G.showHiddenFiles,ze.sessions.showHiddenFiles)},ai:{requireApproval:Sn(P.requireApproval,ze.ai.requireApproval),voiceInsert:zi(P.voiceInsert,W0,ze.ai.voiceInsert),proceedPhrase:Mc(P.proceedPhrase,ze.ai.proceedPhrase),aiCommand:Mc(P.aiCommand,ze.ai.aiCommand),customButtons:N0(P.customButtons),recordCommands:Sn(P.recordCommands,ze.ai.recordCommands),baseUrl:qo(P.baseUrl,ze.ai.baseUrl,512),model:qo(P.model,ze.ai.model,200),includeOutput:Sn(P.includeOutput,ze.ai.includeOutput),outputChars:Math.round(Cs(P.outputChars,Et.outputChars,ze.ai.outputChars))},speech:{engine:p,model:l,precision:zi(r.precision,$0,ze.speech.precision),device:zi(r.device,P0,ze.speech.device),language:S,task:zi(r.task,F0,ze.speech.task),maxUtteranceSeconds:Math.round(Cs(r.maxUtteranceSeconds,Et.maxUtteranceSeconds,ze.speech.maxUtteranceSeconds)),silenceThreshold:Cs(r.silenceThreshold,Et.silenceThreshold,ze.speech.silenceThreshold),serverUrl:qo(r.serverUrl,ze.speech.serverUrl,512),serverModel:qo(r.serverModel,ze.speech.serverModel,128)}}}function q0(n){if(!n)return En(void 0);let C=null,E=null;try{C=n.getItem(dm),E=n.getItem(fm)}catch{return En(void 0)}if(!C)return En(void 0,E);try{return En(JSON.parse(C),E)}catch{return En(void 0,E)}}function xp(n,C){if(n)try{n.setItem(dm,JSON.stringify(C)),n.setItem(fm,C.appearance.theme)}catch{}}function Ep(n,C,E){return En({...n,[C]:{...n[C],...E}})}function pm(n,C){if(C.some(A=>A.backend===n))return n;const E=C[0]?.backend;return E&&_m.includes(E)?E:n}function G0(n){const C=n.engine==="builtin",E=Oc(n.model)?.multilingual??!1;return{model:C,precision:C,device:C,language:C?E:!0,task:C&&E,server:!C}}function K0(n,C){return En({...n,[C]:ze[C]})}const V0=new Set(["127.0.0.1","localhost","::1","[::1]"]);function mm(n){try{const C=new URL(n);return C.protocol!=="http:"&&C.protocol!=="https:"||!C.hostname?null:C}catch{return null}}function gm(n){const C=mm(n);return C===null?null:C.hostname.toLowerCase()}function Yu(n){return gm(n)!==null}function Bc(n){const C=gm(n);return C===null?!1:V0.has(C)||C.endsWith(".localhost")}function Y0(n){const C=mm(n);return C===null?!1:C.protocol==="http:"&&!Bc(n)}const X0=12e4,Ap=300;function Cc(n,C,E){for(let A=0;A<E.length;A+=1)n.setUint8(C+A,E.charCodeAt(A))}function Xu(n,C=Ma){const A=n.length*2,N=new ArrayBuffer(44+A),G=new DataView(N);Cc(G,0,"RIFF"),G.setUint32(4,36+A,!0),Cc(G,8,"WAVE"),Cc(G,12,"fmt "),G.setUint32(16,16,!0),G.setUint16(20,1,!0),G.setUint16(22,1,!0),G.setUint32(24,C,!0),G.setUint32(28,C*2,!0),G.setUint16(32,2,!0),G.setUint16(34,16,!0),Cc(G,36,"data"),G.setUint32(40,A,!0);for(let P=0;P<n.length;P+=1){const r=Math.max(-1,Math.min(1,n[P]));G.setInt16(44+P*2,Math.round(r*32767),!0)}return N}function Rp(n){if(typeof n=="string"){const N=n.trim();return N||null}if(typeof n!="object"||n===null)return null;const C=n;if(typeof C.text=="string"&&C.text.trim())return C.text.trim();const E=C.segments;if(Array.isArray(E)){const N=E.map(G=>typeof G=="object"&&G!==null?G.text:null).filter(G=>typeof G=="string").join(" ").trim();if(N)return N}const A=C.choices;if(Array.isArray(A)&&A.length>0){const N=A[0];if(typeof N=="object"&&N!==null){const G=N.message;if(typeof G=="object"&&G!==null){const P=G.content;if(typeof P=="string"&&P.trim())return P.trim()}}}if(typeof C.error=="string")throw new Error(C.error);return null}function Z0(n){const C=Xu(n.audio,n.sampleRate??Ma),E=new FormData;return E.set("file",new Blob([C],{type:"audio/wav"}),"utterance.wav"),E.set("model",n.model),E.set("response_format","json"),n.language&&n.language!=="auto"&&E.set("language",n.language),E}function Q0(n){const C=new Uint8Array(Xu(n.audio,n.sampleRate??Ma));let E="";for(const N of C)E+=String.fromCharCode(N);const A={file:`data:audio/wav;base64,${btoa(E)}`,model:n.model,response_format:"json"};return n.language&&n.language!=="auto"&&(A.language=n.language),JSON.stringify(A)}function J0(n){const C=new Uint8Array(Xu(n.audio,n.sampleRate??Ma));let E="";for(const N of C)E+=String.fromCharCode(N);const A=[{type:"text",text:n.language&&n.language!=="auto"?`Transcribe this ${n.language} audio. Return only the transcript.`:"Transcribe this audio. Return only the transcript."},{type:"input_audio",input_audio:{data:btoa(E),format:"wav"}}];return JSON.stringify({model:n.model,messages:[{role:"user",content:A}],temperature:0,stream:!1})}function eS(n){try{return new URL(n).pathname.replace(/\/+$/,"")==="/v1/chat/completions"}catch{return!1}}function tS(n,C){return n.status===415&&/POST requests must use ['"]application\/json['"]/.test(C)}function Lp(){return typeof AbortSignal<"u"&&typeof AbortSignal.timeout=="function"?AbortSignal.timeout(X0):void 0}async function iS(n,C=fetch){if(!Yu(n.url))throw new Error("Speech server URL must be an http:// or https:// address, e.g. http://10.0.10.46:8888/v1/audio/transcriptions");if(!n.model.trim())throw new Error("Speech server model name is required");const E=n.apiKey?.trim();if(eS(n.url)){const d=await C(n.url,{method:"POST",headers:{...E?{Authorization:`Bearer ${E}`}:{},"Content-Type":"application/json"},body:J0(n),signal:Lp()}),g=await d.text();if(!d.ok){const S=g.slice(0,Ap).trim();throw new Error(`Speech server returned ${d.status}${S?`: ${S}`:""}`)}let p=g;try{p=JSON.parse(g)}catch{}const l=Rp(p);if(l===null)throw new Error("Speech server returned no transcript");return l}const A={method:"POST",headers:E?{Authorization:`Bearer ${E}`}:void 0,body:Z0(n),signal:Lp()};let N=await C(n.url,A),G=await N.text();if(tS(N,G)&&(N=await C(n.url,{...A,headers:{...E?{Authorization:`Bearer ${E}`}:{},"Content-Type":"application/json"},body:Q0(n)}),G=await N.text()),!N.ok){const d=G.slice(0,Ap).trim(),g=!E&&(N.status===401||N.status===403)?" — this server wants an API key":"";throw new Error(`Speech server returned ${N.status}${d?`: ${d}`:""}${g}`)}let P=G;try{P=JSON.parse(G)}catch{}const r=Rp(P);if(r===null)throw new Error("Speech server returned no transcript");return r}const vm=[{id:"bash",label:"bash",file:"~/.bashrc"},{id:"zsh",label:"zsh",file:"~/.zshrc"},{id:"fish",label:"fish",file:"~/.config/fish/config.fish"},{id:"powershell",label:"PowerShell",file:"$PROFILE"}],sS=`# ZeroG shell integration — reports prompt and command marks (OSC 133).
78
- __zerog_at_prompt=1
79
- __zerog_preexec() {
80
- [ -n "\${COMP_LINE-}" ] && return
81
- [ -z "\${__zerog_at_prompt-}" ] && return
82
- __zerog_at_prompt=
83
- printf '\\033]133;C\\007'
84
- }
85
- __zerog_precmd() {
86
- local status=$?
87
- printf '\\033]133;D;%s\\007' "$status"
88
- printf '\\033]7;file://%s%s\\007' "$HOSTNAME" "$PWD"
89
- __zerog_at_prompt=1
90
- printf '\\033]133;A\\007'
91
- }
92
- trap '__zerog_preexec' DEBUG
93
- PROMPT_COMMAND="__zerog_precmd\${PROMPT_COMMAND:+;$PROMPT_COMMAND}"
94
- PS1="\\[\\033]133;A\\007\\]$PS1\\[\\033]133;B\\007\\]"`,rS=`# ZeroG shell integration — reports prompt and command marks (OSC 133).
95
- autoload -Uz add-zsh-hook
96
- __zerog_preexec() { printf '\\033]133;C\\007' }
97
- __zerog_precmd() {
98
- printf '\\033]133;D;%s\\007' "$?"
99
- printf '\\033]7;file://%s%s\\007' "$HOST" "$PWD"
100
- }
101
- add-zsh-hook preexec __zerog_preexec
102
- add-zsh-hook precmd __zerog_precmd
103
- PS1=$'%{\\033]133;A\\007%}'$PS1$'%{\\033]133;B\\007%}'`,nS=`# ZeroG shell integration — reports prompt and command marks (OSC 133).
104
- # Add this at the end of config.fish, after your prompt is defined.
105
- if not functions -q __zerog_inner_prompt
106
- functions --copy fish_prompt __zerog_inner_prompt
107
- end
108
- function fish_prompt
109
- printf '\\033]133;A\\007'
110
- printf '\\033]7;file://%s%s\\007' (hostname) "$PWD"
111
- __zerog_inner_prompt
112
- printf '\\033]133;B\\007'
113
- end
114
- function __zerog_preexec --on-event fish_preexec
115
- printf '\\033]133;C\\007'
116
- end
117
- function __zerog_postexec --on-event fish_postexec
118
- printf '\\033]133;D;%s\\007' $status
119
- end`,aS=`# ZeroG shell integration — reports prompt and command marks (OSC 133).
120
- $global:__zerogPrompt = $function:prompt
121
- function prompt {
122
- $status = if ($?) { 0 } else { 1 }
123
- [Console]::Write("\`e]133;D;$status\`a")
124
- [Console]::Write("\`e]7;file://$env:COMPUTERNAME$($PWD.Path)\`a")
125
- [Console]::Write("\`e]133;A\`a")
126
- $text = & $global:__zerogPrompt
127
- [Console]::Write("\`e]133;B\`a")
128
- return $text
129
- }
130
- try {
131
- Set-PSReadLineKeyHandler -Chord Enter -ScriptBlock {
132
- [Console]::Write("\`e]133;C\`a")
133
- [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()
134
- }
135
- } catch {
136
- # PSReadLine is absent, so the command text cannot be marked. The prompt
137
- # marks and the exit status still report.
138
- }`,oS={bash:sS,zsh:rS,fish:nS,powershell:aS};function lS(n){return oS[n]}function cS(n){return vm.find(C=>C.id===n)?.file??""}const Ou=[{id:"appearance",label:"Appearance",hint:"Theme, font",blurb:"How the workspace and terminal text look."},{id:"shortcuts",label:"Shortcuts",hint:"Keyboard",blurb:"Which keys do what, for when something else on the machine has taken one."},{id:"terminal",label:"Terminal",hint:"Scrollback, cursor",blurb:"Behaviour of every terminal pane."},{id:"sessions",label:"Sessions",hint:"Defaults, layout",blurb:"What new terminals and new windows start as."},{id:"ai",label:"AI & voice",hint:"Approval, insert",blurb:"How AI suggestions and transcripts reach a terminal."},{id:"speech",label:"Speech recognition",hint:"Engine, model",blurb:"Which recogniser runs, and how it is tuned."}];function hS({action:n,description:C,chord:E,moved:A,taken:N,onSet:G,onReset:P}){const[r,d]=An.useState(!1),[g,p]=An.useState(null);return An.useEffect(()=>{if(!r)return;const l=S=>{if(S.preventDefault(),S.stopPropagation(),S.key==="Escape"){d(!1),p(null);return}if(["Control","Shift","Alt","Meta","OS"].includes(S.key))return;const x=im({key:S.key,code:S.code,ctrlKey:S.ctrlKey,metaKey:S.metaKey,shiftKey:S.shiftKey,altKey:S.altKey}),R=x?nm(x,n,N):"A shortcut needs Ctrl and at least one of Shift or Alt, so a shell keeps Ctrl+C and Ctrl+R for itself.";if(!x||R){p(R);return}G(x),p(null),d(!1)};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[r,n,N,G]),c.jsxs("div",{className:g?"shortcut-row invalid":"shortcut-row",children:[c.jsx("span",{className:"shortcut-what",children:C}),c.jsx("button",{type:"button",className:r?"shortcut-chord capturing":"shortcut-chord",onClick:()=>{p(null),d(l=>!l)},"aria-label":r?`Press a new shortcut for ${C}`:`Change the shortcut for ${C}`,children:r?c.jsx("span",{className:"shortcut-prompt",children:"press a chord · Esc"}):c.jsx("kbd",{children:E})}),c.jsx("button",{type:"button",className:"shortcut-reset",onClick:()=>{p(null),d(!1),P()},disabled:!A,title:A?"Back to the shortcut this shipped with":"This is the shortcut it shipped with",children:"Reset"}),g?c.jsx("small",{className:"shortcut-problem",children:g}):null]})}function Ui({label:n,hint:C,children:E}){return c.jsxs("label",{className:"settings-field",children:[c.jsx("span",{className:"settings-field-label",children:n}),E,C?c.jsx("small",{children:C}):null]})}function uS(n){const C="OpenAI-compatible: POST to {base}/chat/completions. Ollama, LM Studio, llama.cpp, vLLM and OpenRouter all serve this.";return Yu(n)?Bc(n)?`On this machine, so nothing leaves it. ${C}`:`Off this machine. ${C}`:`Any http:// or https:// address ending in /v1. ${C}`}function dS(n){const C="OpenAI-compatible: POST multipart audio to /v1/audio/transcriptions.";return Yu(n)?Bc(n)?`On this machine. ${C}`:`Off this machine — recorded audio is sent to this host. ${C}`:`Any http:// or https:// address. ${C}`}function Tp({label:n="Server API key",state:C,url:E,onSave:A,onClear:N}){const[G,P]=Z.useState(""),r=C.status==="saving",d=G.trim(),g=C.encryptionAvailable?Y0(E)?"Sent as a Bearer token. This endpoint is plain http to another host, so the key travels in the clear.":"Sent as a Bearer token. Stored encrypted by this system, never in the settings file.":"This system has no secret store, so a key can only be held until the app closes.";return c.jsxs(Ui,{label:n,hint:g,children:[c.jsxs("div",{className:"settings-key-row",children:[c.jsx("input",{type:"password",value:G,placeholder:C.stored||C.sessionOnly?"•••••••• (a key is set)":"Leave empty if the server needs none",autoComplete:"off",spellCheck:!1,onChange:p=>P(p.target.value),onKeyDown:p=>{p.key!=="Enter"||!d||r||(p.preventDefault(),A(d),P(""))}}),c.jsx("button",{type:"button",disabled:!d||r,onClick:()=>{A(d),P("")},children:r?"Saving…":"Save"}),C.stored||C.sessionOnly?c.jsx("button",{type:"button",disabled:r,onClick:N,children:"Clear"}):null]}),C.error?c.jsx("small",{className:"settings-key-error",children:C.error}):null,!C.error&&C.notice?c.jsx("small",{className:"settings-key-notice",children:C.notice}):null]})}function fS({enabled:n,state:C,bindings:E,onToggle:A,onCopySnippet:N,onClear:G}){const[P,r]=Z.useState("bash"),d=lS(P),g=xi("history-palette",E);return c.jsxs(c.Fragment,{children:[c.jsx(Cn,{label:"Remember commands for the history palette",hint:n?`Commands you run are stored on this machine, with their directory and exit status, so ${g} can rank them. Anything that looks like it carries a secret is refused rather than stored.`:"Off. Nothing about what you type is written anywhere. Turning this on stores commands on this machine so the history palette has something to search.",checked:n,onChange:A}),n?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"settings-note",children:C.panesOpen===0?"No panes open, so nothing is reporting yet.":C.panesReporting===0?`None of your ${C.panesOpen} open pane${C.panesOpen===1?"":"s"} is reporting prompt marks. Add the snippet below to that shell — including on a remote host, where it has to be installed there.`:`${C.panesReporting} of ${C.panesOpen} open pane${C.panesOpen===1?"":"s"} reporting prompt marks. ${C.entries} command${C.entries===1?"":"s"} remembered.`}),c.jsx(Ui,{label:"Shell integration",hint:`Paste this into ${cS(P)} on whichever machine the shell runs on. It emits the standard OSC 133 marks — if you already have shell integration from VS Code, kitty or an oh-my-zsh plugin, you need none of this.`,children:c.jsxs("div",{className:"settings-key-row",children:[c.jsx("select",{value:P,onChange:p=>r(p.target.value),children:vm.map(p=>c.jsx("option",{value:p.id,children:p.label},p.id))}),c.jsx("button",{type:"button",onClick:()=>N(d),children:"Copy snippet"})]})}),c.jsx("pre",{className:"settings-snippet",children:d}),c.jsxs("div",{className:"settings-test",children:[c.jsx("button",{type:"button",onClick:G,children:"Forget all remembered commands"}),c.jsx("small",{className:"settings-hint",children:"Removes the stored history and the file it lives in."})]})]}):null]})}function _S({state:n,onRun:C}){const E=n.status==="testing";return c.jsxs("div",{className:"settings-test",children:[c.jsx("button",{type:"button",className:"primary-button",disabled:E,onClick:C,children:E?"Testing…":"Test connection"}),n.message?c.jsx("small",{className:n.ok?"settings-key-notice":"settings-key-error",children:n.message}):null]})}function ls({label:n,hint:C,value:E,options:A,onChange:N}){return c.jsx(Ui,{label:n,hint:C,children:c.jsx("select",{value:E,onChange:G=>N(G.target.value),children:A.map(G=>c.jsx("option",{value:G.value,children:G.label},G.value))})})}function bn({label:n,hint:C,value:E,min:A,max:N,step:G,format:P,onChange:r}){return c.jsx(Ui,{label:n,hint:C,children:c.jsxs("span",{className:"settings-range",children:[c.jsx("input",{type:"range",min:A,max:N,step:G,value:E,onChange:d=>r(Number(d.target.value)),"aria-label":n}),c.jsx("output",{children:P(E)})]})})}function Cn({label:n,hint:C,checked:E,disabled:A=!1,onChange:N}){return c.jsxs("label",{className:`settings-toggle ${A?"settings-toggle-fixed":""}`,children:[c.jsx("input",{type:"checkbox",checked:E,disabled:A,onChange:G=>N(G.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:n}),C?c.jsx("small",{children:C}):null]})]})}function pS({value:n,onChange:C}){const E=[{id:"builtin",title:"Built-in",detail:"Whisper ONNX in this app, downloaded once and cached. No other software needed."},{id:"server",title:"Server",detail:"Post audio to a transcription server — on this machine, on the LAN, or hosted — the way to use a GGUF model such as Qwen3-ASR through llama.cpp, LM Studio or Unsloth Studio."}];return c.jsx("div",{className:"settings-engines",role:"radiogroup","aria-label":"Speech engine",children:E.map(A=>c.jsxs("button",{type:"button",role:"radio","aria-checked":n===A.id,className:`settings-engine ${n===A.id?"active":""}`,onClick:()=>C(A.id),children:[c.jsx("b",{children:A.title}),c.jsx("small",{children:A.detail})]},A.id))})}function mS({state:n,onRun:C}){const E=n.status!=="idle",A=n.status==="recording"?"Stop and transcribe":n.status==="transcribing"?"Transcribing…":"Test recognition";return c.jsxs("div",{className:"settings-test",children:[c.jsxs("div",{className:"settings-test-head",children:[c.jsxs("div",{children:[c.jsx("b",{children:"Try it"}),c.jsx("small",{children:"Records a phrase and transcribes it here, without typing into a terminal."})]}),c.jsx("button",{type:"button",className:n.status==="recording"?"settings-test-button recording":"settings-test-button",onClick:C,disabled:n.status==="transcribing",children:A})]}),n.message?c.jsx("p",{className:"settings-test-status",children:n.message}):null,n.error?c.jsx("p",{className:"settings-test-error",children:n.error}):null,n.transcript!==null&&n.transcript!==void 0?c.jsx("output",{className:"settings-test-transcript",children:n.transcript||"(nothing transcribed)"}):null,!E&&(n.elapsedMs!=null||n.level!=null)?c.jsxs("p",{className:"settings-test-metrics",children:[n.elapsedMs!=null?`${(n.elapsedMs/1e3).toFixed(1)}s`:null,n.elapsedMs!=null&&n.level!=null?" · ":null,n.level!=null?`level ${n.level.toFixed(4)} RMS`:null]}):null]})}function gS({status:n,info:C,onStart:E,onStop:A,onCopyToken:N}){const G=n.state==="listening"||n.state==="connected";return c.jsxs("section",{className:"settings-group mcp-settings",children:[c.jsxs("div",{className:"settings-group-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:"ZERO G CONTROL"}),c.jsx("h3",{children:"Local MCP connection"})]}),c.jsx("span",{className:`mcp-state-dot ${n.state}`,title:n.state})]}),c.jsx("p",{className:"settings-hint",children:"Allow a local agent such as Hermes to inspect and restore ZeroG workspaces. Terminal command execution is not enabled."}),c.jsx("div",{className:"settings-actions",children:G?c.jsx("button",{type:"button",onClick:A,children:"Disable MCP"}):c.jsx("button",{type:"button",className:"primary-button",onClick:E,children:"Enable MCP"})}),C&&G?c.jsxs(c.Fragment,{children:[c.jsx(Ui,{label:"Endpoint",hint:"Give this URL to the local MCP client.",children:c.jsx("code",{className:"settings-value",children:C.endpoint})}),c.jsx(Ui,{label:"Bearer token",hint:"Held only for this app run. Copy it into the local client configuration.",children:c.jsxs("div",{className:"settings-key-row",children:[c.jsx("code",{className:"settings-value token-value",children:C.token}),c.jsx("button",{type:"button",onClick:N,children:"Copy"})]})})]}):null]})}function vS({settings:n,onChange:C,onReset:E,onClose:A,backdrop:N,backends:G,wslDistributions:P,speechTest:r,onSpeechTest:d,speechKey:g,onSpeechKeySave:p,onSpeechKeyClear:l,commandHistory:S,onCopySnippet:x,onClearCommandHistory:R,aiKey:m,onAiKeySave:a,onAiKeyClear:u,aiModels:f,onAiModelsRefresh:h,aiTest:b,onAiTest:M,mcpStatus:w,mcpInfo:T,onMcpStart:y,onMcpStop:L,onMcpCopyToken:O}){const[U,H]=Z.useState("appearance"),z=Z.useMemo(()=>Ku(n.shortcuts),[n.shortcuts]),Y=Z.useMemo(()=>Object.fromEntries(Object.entries(z.chords).map(([I,j])=>[j,I])),[z]),ne=Ou.find(I=>I.id===U)??Ou[0],V=G0(n.speech),X=G.length?G.map(I=>({value:I.backend,label:I.label})):[{value:n.sessions.defaultBackend,label:n.sessions.defaultBackend}];return c.jsx("div",{className:"modal-layer settings-layer",role:"presentation",...N,children:c.jsxs("section",{className:"settings-card",role:"dialog","aria-modal":"true","aria-label":"Settings",children:[c.jsxs("div",{className:"modal-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:"SETTINGS"}),c.jsx("h2",{children:ne.label})]}),c.jsx("button",{type:"button",className:"close-button",onClick:A,children:"Esc"})]}),c.jsxs("div",{className:"settings-body",children:[c.jsx("nav",{className:"settings-nav","aria-label":"Settings pages",children:Ou.map(I=>c.jsxs("button",{type:"button",className:`settings-nav-item ${I.id===U?"active":""}`,"aria-current":I.id===U,onClick:()=>H(I.id),children:[c.jsx("b",{children:I.label}),c.jsx("small",{children:I.hint})]},I.id))}),c.jsxs("div",{className:"settings-page",children:[c.jsx("p",{className:"settings-blurb",children:ne.blurb}),U==="shortcuts"&&c.jsxs(c.Fragment,{children:[z.rejected.length?c.jsxs("p",{className:"settings-warning",children:[z.rejected.map(I=>I.reason).join(" ")," The default is in use instead."]}):null,c.jsx("div",{className:"shortcut-list",children:qr.map(I=>c.jsx(hS,{action:I.action,description:I.description,chord:xi(I.action,z),moved:n0(I.action,z),taken:Y,onSet:j=>C("shortcuts",{[I.action]:j}),onReset:()=>C("shortcuts",{[I.action]:void 0})},I.action))}),c.jsxs("p",{children:["A shortcut needs Ctrl and at least one of Shift or Alt: a bare Ctrl+key belongs to the shell, which keeps Ctrl+C, Ctrl+R, Ctrl+L and Ctrl+A in every pane. Ctrl+Shift+1 to 9 switch workspaces by position and cannot be moved, and the terminal keeps",Gu.map((I,j)=>c.jsxs(An.Fragment,{children:[j?" and ":" ",c.jsx("kbd",{children:I.chord})]},I.chord)),"."]}),c.jsx("p",{children:"Worth knowing if a chord seems to do nothing: nothing here can outrank the operating system. Windows uses Ctrl and Shift together to switch keyboard layout when more than one is installed, and some applications register chords globally while they are running. Moving ours out of the way is the fix, and Ctrl+Alt is usually clear — though on some layouts it behaves as AltGr, so a chord you would type in a terminal is worth avoiding."})]}),U==="appearance"&&c.jsxs(c.Fragment,{children:[c.jsx(ls,{label:"Theme",value:n.appearance.theme,options:[{value:"dark",label:"Dark"},{value:"light",label:"Light"}],onChange:I=>C("appearance",{theme:I})}),c.jsx(ls,{label:"Terminal font",hint:"Falls back to another monospace face when the font is not installed.",value:n.appearance.font,options:B0,onChange:I=>C("appearance",{font:I})}),c.jsx(bn,{label:"Font size",value:n.appearance.fontSize,min:Et.fontSize.min,max:Et.fontSize.max,step:1,format:I=>`${I} px`,onChange:I=>C("appearance",{fontSize:I})}),c.jsx(bn,{label:"Line height",value:n.appearance.lineHeight,min:Et.lineHeight.min,max:Et.lineHeight.max,step:.05,format:I=>I.toFixed(2),onChange:I=>C("appearance",{lineHeight:I})}),c.jsx(bn,{label:"Letter spacing",value:n.appearance.letterSpacing,min:Et.letterSpacing.min,max:Et.letterSpacing.max,step:.1,format:I=>`${I.toFixed(1)} px`,onChange:I=>C("appearance",{letterSpacing:I})}),c.jsxs("div",{className:"settings-preview",style:{fontFamily:Uu(n.appearance.font),fontSize:`${n.appearance.fontSize}px`,lineHeight:n.appearance.lineHeight,letterSpacing:`${n.appearance.letterSpacing}px`},children:[c.jsx("span",{children:"user@host:~$ git status --short"}),c.jsx("span",{children:" M src/renderer/settings.ts"})]})]}),U==="terminal"&&c.jsxs(c.Fragment,{children:[c.jsx(bn,{label:"Scrollback",hint:"Lines kept per pane. Larger scrollback costs memory in every open pane.",value:n.terminal.scrollback,min:Et.scrollback.min,max:5e4,step:200,format:I=>`${I.toLocaleString()} lines`,onChange:I=>C("terminal",{scrollback:I})}),c.jsx(ls,{label:"Cursor",value:n.terminal.cursorStyle,options:[{value:"block",label:"Block"},{value:"underline",label:"Underline"},{value:"bar",label:"Bar"}],onChange:I=>C("terminal",{cursorStyle:I})}),c.jsx(Cn,{label:"Blink the cursor",checked:n.terminal.cursorBlink,onChange:I=>C("terminal",{cursorBlink:I})}),c.jsx(Cn,{label:"Copy on selection",hint:"Selecting text with the mouse puts it on the clipboard. Ctrl+Shift+C copies regardless.",checked:n.terminal.copyOnSelect,onChange:I=>C("terminal",{copyOnSelect:I})})]}),U==="sessions"&&c.jsxs(c.Fragment,{children:[c.jsx(ls,{label:"Default shell",hint:"Pre-selected when opening a new local terminal.",value:pm(n.sessions.defaultBackend,G),options:X,onChange:I=>C("sessions",{defaultBackend:I})}),c.jsxs(Ui,{label:"Default WSL distribution",hint:"Used when the default shell is WSL.",children:[c.jsx("input",{list:"settings-wsl-distributions",value:n.sessions.defaultWslDistribution,placeholder:"Ubuntu",onChange:I=>C("sessions",{defaultWslDistribution:I.target.value})}),c.jsx("datalist",{id:"settings-wsl-distributions",children:P.map(I=>c.jsx("option",{value:I},I))})]}),c.jsx(ls,{label:"Layout at startup",value:n.sessions.defaultLayout,options:[{value:"stack",label:"Single pane"},{value:"split-v",label:"Split vertically"},{value:"split-h",label:"Split horizontally"},{value:"grid",label:"Grid of four"}],onChange:I=>C("sessions",{defaultLayout:I})}),c.jsx(Cn,{label:"Start with the sidebar collapsed",checked:n.sessions.startSidebarCollapsed,onChange:I=>C("sessions",{startSidebarCollapsed:I})}),c.jsx(Cn,{label:"Show hidden files",hint:"Default for the directory browser and the transfer panel. Files whose name starts with a dot are hidden unless this is on; either panel can also override it just for itself.",checked:n.sessions.showHiddenFiles,onChange:I=>C("sessions",{showHiddenFiles:I})})]}),U==="ai"&&c.jsxs(c.Fragment,{children:[c.jsx(Ui,{label:"Endpoint",hint:uS(n.ai.baseUrl),children:c.jsx("input",{value:n.ai.baseUrl,placeholder:ze.ai.baseUrl,spellCheck:!1,onChange:I=>C("ai",{baseUrl:I.target.value})})}),c.jsx(Ui,{label:"Model",hint:"Any model the endpoint serves. Refresh lists what it reports having.",children:c.jsxs("div",{className:"settings-key-row",children:[c.jsx("input",{value:n.ai.model,list:"ai-models",placeholder:"qwen2.5-coder",spellCheck:!1,onChange:I=>C("ai",{model:I.target.value})}),c.jsx("datalist",{id:"ai-models",children:f.map(I=>c.jsx("option",{value:I},I))}),c.jsx("button",{type:"button",onClick:h,children:"Refresh"})]})}),c.jsx(Tp,{label:"Endpoint API key",state:m,url:n.ai.baseUrl,onSave:a,onClear:u}),c.jsx(_S,{state:b,onRun:M}),c.jsx(gS,{status:w,info:T,onStart:y,onStop:L,onCopyToken:O}),c.jsx(Cn,{label:"Send recent terminal output",hint:n.ai.includeOutput?Bc(n.ai.baseUrl)?"Sent to an endpoint on this machine, so the output does not leave it. Suggestions can read the error you are looking at.":"The output of the focused pane is sent to this endpoint, which is not on this machine. Anything on screen goes with it.":"Off, so only the shell, directory and host are sent. Suggestions cannot see the error you are looking at.",checked:n.ai.includeOutput,onChange:I=>C("ai",{includeOutput:I})}),n.ai.includeOutput?c.jsx(bn,{label:"How much output",hint:"The tail of the pane, on whole lines. Enough for a stack trace is usually enough.",value:n.ai.outputChars,min:Et.outputChars.min,max:Et.outputChars.max,step:200,format:I=>`${I} characters`,onChange:I=>C("ai",{outputChars:I})}):null,c.jsx(Cn,{label:"Ask before running an AI suggestion",hint:n.ai.includeOutput?"Always on while terminal output is being sent: output can come from a remote host, and a command chosen from it must not run unseen.":"Off means a suggested command is sent to the terminal as soon as it arrives.",checked:n.ai.includeOutput||n.ai.requireApproval,disabled:n.ai.includeOutput,onChange:I=>C("ai",{requireApproval:I})}),c.jsx(ls,{label:"Voice transcripts",hint:"Neither option presses Enter for you.",value:n.ai.voiceInsert,options:[{value:"type",label:"Type into the terminal"},{value:"review",label:"Show for review first"}],onChange:I=>C("ai",{voiceInsert:I})}),c.jsx(Ui,{label:"Proceed phrase",hint:"What a pane's tick button sends. Unlike the options above, this one does press Enter — it is for telling an agent already waiting in the pane to carry on.",children:c.jsx("input",{value:n.ai.proceedPhrase,placeholder:ze.ai.proceedPhrase,onChange:I=>C("ai",{proceedPhrase:I.target.value})})}),c.jsx(Ui,{label:"AI command",hint:`What a pane's bot button types and runs, Enter included — your preferred CLI agent, e.g. "claude" or "aider".`,children:c.jsx("input",{value:n.ai.aiCommand,placeholder:ze.ai.aiCommand,onChange:I=>C("ai",{aiCommand:I.target.value})})}),c.jsxs("div",{className:"settings-field",children:[c.jsx("span",{className:"settings-field-label",children:"Custom pane buttons"}),n.ai.customButtons.map((I,j)=>{const W=B=>C("ai",{customButtons:n.ai.customButtons.map((F,te)=>te===j?{...F,...B}:F)});return c.jsxs("div",{className:"custom-button-row",children:[c.jsx("span",{className:"custom-button-slot","aria-hidden":"true",children:j}),c.jsx("input",{value:I.label,placeholder:"Label","aria-label":`Button ${j} label`,onChange:B=>W({label:B.target.value})}),c.jsx("input",{value:I.command,placeholder:"Text to send","aria-label":`Button ${j} text to send`,onChange:B=>W({command:B.target.value})})]},j)}),c.jsx("small",{children:"Each button with text to send appears on every pane's top bar, showing its number, and types that text and presses Enter. A button with no text is not shown. The label is only the tooltip."})]}),c.jsx(fS,{enabled:n.ai.recordCommands,state:S,bindings:z,onToggle:I=>C("ai",{recordCommands:I}),onCopySnippet:x,onClear:R})]}),U==="speech"&&c.jsxs(c.Fragment,{children:[c.jsx(pS,{value:n.speech.engine,onChange:I=>C("speech",{engine:I})}),V.model?c.jsx(ls,{label:"Model",hint:D0(n.speech.model,n.speech.precision),value:n.speech.model,options:Vu.map(I=>({value:I.id,label:I.label})),onChange:I=>C("speech",{model:I})}):null,V.precision?c.jsx(ls,{label:"Precision",hint:bp.find(I=>I.value===n.speech.precision)?.detail,value:n.speech.precision,options:bp.map(I=>({value:I.value,label:I.label})),onChange:I=>C("speech",{precision:I})}):null,V.device?c.jsx(ls,{label:"Compute",hint:"WebGPU is faster where it works; the app falls back to WASM when it does not.",value:n.speech.device,options:[{value:"wasm",label:"CPU (WASM)"},{value:"webgpu",label:"GPU (WebGPU)"}],onChange:I=>C("speech",{device:I})}):null,V.language?c.jsx(ls,{label:"Language",value:n.speech.language,options:cm,onChange:I=>C("speech",{language:I})}):null,V.task?c.jsx(ls,{label:"Task",hint:"Translate produces English text from another language.",value:n.speech.task,options:[{value:"transcribe",label:"Transcribe"},{value:"translate",label:"Translate to English"}],onChange:I=>C("speech",{task:I})}):null,V.server?c.jsxs(c.Fragment,{children:[c.jsx(Ui,{label:"Server URL",hint:dS(n.speech.serverUrl),children:c.jsx("input",{value:n.speech.serverUrl,placeholder:"http://127.0.0.1:8080/v1/audio/transcriptions",onChange:I=>C("speech",{serverUrl:I.target.value})})}),c.jsx(Ui,{label:"Server model",hint:"The model name the server expects, e.g. Qwen3-ASR-0.6B.",children:c.jsx("input",{value:n.speech.serverModel,placeholder:"Qwen3-ASR-0.6B",onChange:I=>C("speech",{serverModel:I.target.value})})}),c.jsx(Tp,{state:g,url:n.speech.serverUrl,onSave:p,onClear:l})]}):null,c.jsx(bn,{label:"Maximum utterance",hint:"Recording stops itself at this length so a stuck microphone cannot queue forever.",value:n.speech.maxUtteranceSeconds,min:Et.maxUtteranceSeconds.min,max:Et.maxUtteranceSeconds.max,step:5,format:I=>`${I} s`,onChange:I=>C("speech",{maxUtteranceSeconds:I})}),c.jsx(bn,{label:"Silence threshold",hint:"Recordings quieter than this are discarded without transcribing. Raise it for a noisy room, lower it for a quiet microphone.",value:n.speech.silenceThreshold,min:Et.silenceThreshold.min,max:Et.silenceThreshold.max,step:5e-4,format:I=>I.toFixed(4),onChange:I=>C("speech",{silenceThreshold:I})}),c.jsx(mS,{state:r,onRun:d})]}),c.jsxs("div",{className:"settings-foot",children:[c.jsx("span",{className:"settings-hint",children:"Changes apply immediately and are remembered."}),c.jsxs("button",{type:"button",onClick:()=>E(U),children:["Reset ",ne.label.toLowerCase()]})]})]})]})]})})}function si(n){return(n instanceof Error?n.message:String(n)).replace(/^Error invoking remote method '[^']*':\s*/,"").replace(/^(?:Error|TypeError):\s*/,"")}var SS=$p();const bS=1024*1024,Mp="This file changed on disk after it was opened.";function Dp(n){const C=(n.match(/\r\n/g)??[]).length,E=(n.match(/\n/g)??[]).length-C;return C>E?"crlf":"lf"}function kp(n){return n.replaceAll(`\r
139
- `,`
140
- `)}function yS(n,C){return C==="crlf"?n.replaceAll(`
141
- `,`\r
142
- `):n}function CS(n,C){return n!==C}function wS(n,C){const E=n.slice(0,Math.max(0,Math.min(C,n.length)));return{line:E.split(`
143
- `).length,column:E.length-(E.lastIndexOf(`
144
- `)+1)+1}}function xS(n,C,E){return{text:`${n.slice(0,C)} ${n.slice(E)}`,caret:C+1}}function ES(n){return new TextEncoder().encode(n).length>bS}function AS({session:n,mode:C,dock:E,onModeChange:A,startPath:N,pathKind:G,shellPathFor:P,list:r,backend:d,unanchored:g,question:p,onClose:l,register:S}){const[x,R]=Z.useState(!0),[m,a]=Z.useState(N),[u,f]=Z.useState(null),[h,b]=Z.useState(""),[M,w]=Z.useState(0),[T,y]=Z.useState(null),[L,O]=Z.useState(null),[U,H]=Z.useState(!1),z=Z.useRef(null),Y=Z.useRef(null),ne=u?CS(u.saved,h):!1,V=Z.useCallback(re=>!ne||window.confirm(`You have unsaved changes to ${Go(u?.path??"")}. ${re}`),[ne,u]),X=Z.useCallback(()=>V("Close the editor and lose them?")?(l(),!0):!1,[V,l]);Z.useEffect(()=>(S(X),()=>S(null)),[S,X]),Z.useLayoutEffect(()=>{Y.current===null||!z.current||(z.current.setSelectionRange(Y.current,Y.current),Y.current=null)},[h]);const I=Z.useCallback(re=>{re!==u?.path&&V("Open another file and lose them?")&&(y("opening"),O(null),H(!1),d.read(re).then(_e=>{const Ce=kp(_e.text);f({path:_e.path,saved:Ce,ending:Dp(_e.text),version:_e.version}),b(Ce),w(0),C==="docked"&&R(!1),requestAnimationFrame(()=>z.current?.focus())}).catch(_e=>O(si(_e))).finally(()=>y(null)))},[d,V,u?.path,C]),j=Z.useCallback((re=!1)=>{if(!(!u||T)){if(ES(h)){O("That is too large for the editor to save.");return}y("saving"),O(null),d.write(u.path,yS(h,u.ending),u.version,re).then(_e=>{f({...u,saved:h,version:_e}),H(!1),O(`Saved ${Go(u.path)}`)}).catch(_e=>{const Ce=si(_e);Ce.includes(Mp)?H(!0):O(Ce)}).finally(()=>y(null))}},[d,T,u,h]),W=()=>{u&&window.confirm(`Discard your changes to ${Go(u.path)} and load what is on disk?`)&&(y("opening"),d.read(u.path).then(re=>{const _e=kp(re.text);f({path:re.path,saved:_e,ending:Dp(re.text),version:re.version}),b(_e),H(!1),O(null)}).catch(re=>O(si(re))).finally(()=>y(null)))},B=wS(h,M),F=u?Go(u.path):null,te=C==="docked",ie=c.jsx("button",{type:"button",className:"primary-button",disabled:!u||!ne||T!==null,onClick:()=>j(),children:T==="saving"?"Saving…":"Save"}),he=ne?c.jsx("span",{className:"editor-dirty",title:"Unsaved changes","aria-label":"Unsaved changes",children:" ●"}):null,ge=c.jsx(tm,{session:n,path:m,unanchored:g,question:p,pathKind:G,shellPath:m?P(m):null,list:r,onOpen:a,onBrowse:a,onClose:te?()=>R(!1):X,onOpenFile:I,openFile:u?.path??null,defaultShowHidden:!0}),J=c.jsxs("div",{className:"editor-main",children:[U?c.jsxs("div",{className:"editor-banner",role:"alert",children:[c.jsxs("span",{children:[Mp," Saving now would replace those changes."]}),c.jsx("button",{type:"button",onClick:()=>j(!0),children:"Overwrite"}),c.jsx("button",{type:"button",onClick:W,children:"Reload from disk"}),c.jsx("button",{type:"button",onClick:()=>H(!1),children:"Keep editing"})]}):null,u?c.jsx("textarea",{ref:z,className:"editor-text",value:h,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off",wrap:"off","aria-label":`Contents of ${F}`,onChange:re=>{b(re.target.value),w(re.target.selectionStart),O(null)},onSelect:re=>w(re.currentTarget.selectionStart),onKeyDown:re=>{if((re.ctrlKey||re.metaKey)&&re.key.toLowerCase()==="s"){re.preventDefault(),ne&&j();return}if(re.key==="Tab"&&!re.shiftKey&&!re.ctrlKey&&!re.metaKey&&!re.altKey){re.preventDefault();const _e=re.currentTarget,Ce=xS(h,_e.selectionStart,_e.selectionEnd);Y.current=Ce.caret,b(Ce.text),w(Ce.caret)}}}):c.jsxs("div",{className:"editor-empty",children:[c.jsx(Oe,{name:"file"}),c.jsx("p",{children:T==="opening"?"Opening…":"Pick a file to edit it. The terminal keeps running."})]})]}),q=c.jsxs("footer",{className:"editor-foot",children:[c.jsx("span",{className:"editor-status",role:"status",children:L??(u?u.path:"")}),u?c.jsxs("span",{className:"editor-position",children:["Ln ",B.line,", Col ",B.column," · ",u.ending==="crlf"?"CRLF":"LF"," · UTF-8"]}):null]});return te?E?SS.createPortal(c.jsxs("section",{className:"editor-docked","aria-label":`Editor for ${n.name}`,children:[c.jsxs("header",{className:"editor-dock-head",children:[c.jsxs("span",{className:"editor-dock-name",title:u?.path??"",children:[F??"Editor",he]}),c.jsxs("span",{className:"editor-dock-actions",children:[ie,c.jsx("button",{type:"button",className:"pane-nav",onClick:()=>R(re=>!re),"aria-pressed":x,title:"Show or hide the file list",children:c.jsx(Oe,{name:"folder"})}),c.jsx("button",{type:"button",className:"pane-nav",onClick:()=>A("overlay"),title:"Pop out over the panes",children:c.jsx(Oe,{name:"maximize"})}),c.jsx("button",{type:"button",className:"pane-nav",onClick:()=>X(),title:"Close the editor","aria-label":"Close the editor",children:c.jsx(Oe,{name:"x"})})]})]}),x||!u?c.jsx("div",{className:"editor-files editor-files-docked",children:ge}):null,J,q]}),E):null:c.jsx("div",{className:"modal-layer editor-layer",role:"presentation",onKeyDown:re=>{re.key==="Escape"&&(re.preventDefault(),re.stopPropagation(),X())},children:c.jsxs("section",{className:"editor-card",role:"dialog","aria-modal":"true","aria-label":`Edit files from ${n.name}`,children:[c.jsxs("header",{className:"editor-head",children:[c.jsxs("div",{className:"editor-title",children:[c.jsxs("span",{className:"eyebrow",children:["Editor · ",n.name]}),c.jsxs("h2",{children:[F??"Choose a file",he]})]}),c.jsxs("div",{className:"editor-actions",children:[ie,c.jsx("button",{type:"button",onClick:()=>A("docked"),title:"Keep the editor beside this terminal instead of over it",children:"Dock"}),c.jsx("button",{type:"button",className:"close-button",onClick:()=>X(),title:"Close the editor",children:"Esc"})]})]}),c.jsxs("div",{className:"editor-body",children:[c.jsx("div",{className:"editor-files",children:ge}),J]}),q]})})}function RS(n){return{async read(C){const E=await n.readLocalFile(C);return{path:E.path,text:E.text,version:E.mtimeMs}},async write(C,E,A,N){if(typeof A!="number")throw new Error("That file was not opened from this machine.");return(await n.writeLocalFile(C,E,A,N)).mtimeMs}}}function LS(n,C){return{async read(E){const A=await C(N=>n.sftpReadFile(N,E));return{path:A.path,text:A.text,version:A.text}},async write(E,A,N,G){if(typeof N!="string")throw new Error("That file was not opened from this host.");return await C(P=>n.sftpWriteFile(P,E,A,N,G)),A}}}const Dc=2;function TS(n,C,E=Dc){const A=new Set(n),N=[];for(const G of C??[]){if(N.length>=E)break;A.has(G)&&!N.includes(G)&&N.push(G)}for(const G of n){if(N.length>=E)break;N.includes(G)||N.push(G)}return N}function MS(n,C=Dc){return n.length>C}function DS(n,C,E,A){const N=C[E];if(N===void 0||!n.includes(N))return[...C];const G=new Set(C.filter((g,p)=>p!==E)),P=n.filter(g=>!G.has(g));if(P.length<2)return[...C];const r=P.indexOf(N),d=P[(r+A+P.length)%P.length];return C.map((g,p)=>p===E?d:g)}function kS(n){const C=[];return n.forEach((E,A)=>{const N=E.command.trim();N&&C.push({slot:A,label:E.label.trim(),command:N})}),C}function OS(n){return n.label||`Button ${n.slot}`}function BS(n){const C=`Send "${n.command}" and press Enter`;return n.label?`${n.label} — ${C}`:C}function Sm(n){return cs(n.trim()).toLowerCase()}function Iu(n,C){const E=Sm(C);if(E)return n.hosts.find(A=>A.host===E)?.label}function jS(n,C,E){const A=Sm(C),N=E.trim();return!A||!N||Iu(n,C)===N&&n.hosts.at(-1)?.host===A?n:{version:n.version,hosts:[...n.hosts.filter(G=>G.host!==A),{host:A,label:N}]}}const NS={version:1,hosts:[]},wn=[{kind:"local",label:"Local terminal",hint:"Shell on this machine"},{kind:"ssh",label:"SSH",hint:"Remote host"}];function Op(n){return n==="local"||n==="ssh"}const HS={workspace:{eyebrow:"WORKSPACE",title:"New workspace",submit:"Create workspace"},rename:{eyebrow:"WORKSPACE",title:"Rename workspace",submit:"Rename"},local:{eyebrow:"NEW SESSION",title:"Start a session",submit:"Open terminal"},ssh:{eyebrow:"NEW SESSION",title:"Start a session",submit:"Connect"},forward:{eyebrow:"SHARED PORT",title:"Share a port",submit:"Share port"}};function Bu(n){return HS[n]}function zS(n,C){const E=wn.findIndex(N=>N.kind===n);if(E===-1)return null;const A=wn.length;switch(C){case"ArrowRight":case"ArrowDown":return wn[(E+1)%A].kind;case"ArrowLeft":case"ArrowUp":return wn[(E-1+A)%A].kind;case"Home":return wn[0].kind;case"End":return wn[A-1].kind;default:return null}}const bm={"split-v":"Vertical split","split-h":"Horizontal split",grid:"Four-pane grid"},US=[{layout:"split-v",icon:"split-v"},{layout:"split-h",icon:"split-h"},{layout:"grid",icon:"grid"}];function ym(n){return n==="split-v"?["column"]:n==="split-h"?["row"]:n==="grid"?["column","row"]:[]}function Cm(n,C){return ym(n).some(E=>{const A=E==="column"?C.columnRatio:C.rowRatio,N=E==="column"?ze.sessions.splitColumnRatio:ze.sessions.splitRowRatio;return Math.abs(A-N)>.005})}function IS(n){const C=ym(n);return{...C.includes("column")?{splitColumnRatio:ze.sessions.splitColumnRatio}:{},...C.includes("row")?{splitRowRatio:ze.sessions.splitRowRatio}:{}}}function wm(n){return n.maximized?{kind:"restore"}:n.layout==="stack"?{kind:"show",layout:n.lastSplit}:n.sessionCount>1?{kind:"maximize"}:{kind:"show",layout:"stack"}}function PS(n,C){return C.layout!==n||C.maximized?{kind:"show",layout:n}:Cm(n,C)?{kind:"reset-splits",ratios:IS(n)}:wm(C)}function $S(n,C){return C.layout!==n||C.maximized?bm[n]:Cm(n,C)?"Reset pane sizes":C.sessionCount>1?"Maximize focused pane":"Single pane"}function FS(n){return n.maximized||n.layout==="stack"?`Back to ${bm[n.lastSplit].toLowerCase()}`:n.sessionCount>1?"Maximize focused pane":"Single pane"}function Bp(n){return typeof n=="object"&&n!==null}class WS{constructor(C){this.options=C,this.worker=null,this.pending=new Map,this.nextId=1}async transcribe(C,E,A){if(E.engine==="server"){const G=this.options.now??(()=>Date.now()),P=G(),r=await this.options.resolveApiKey?.().catch(()=>null)??void 0;return{text:await iS({url:E.serverUrl,model:E.serverModel,language:E.language,audio:C,apiKey:r},this.options.fetchImpl),elapsedMs:G()-P,engine:"server"}}return{...await this.transcribeInWorker(C,E,A),engine:"builtin"}}transcribeInWorker(C,E,A){const N=this.ensureWorker(),G=this.nextId++;return new Promise((P,r)=>{this.pending.set(G,{resolve:P,reject:r,onProgress:A}),N.postMessage({type:"transcribe",id:G,audio:C,config:{model:E.model,precision:E.precision,device:E.device,language:E.language,task:E.task,multilingual:T0(E.model)}},[C.buffer])})}ensureWorker(){if(this.worker)return this.worker;const C=this.options.createWorker();return C.onmessage=E=>this.handleMessage(E.data),C.onerror=E=>{const A=Bp(E)&&typeof E.message=="string"?E.message:"Speech worker failed";this.failAll(new Error(A)),this.worker=null},this.worker=C,C}handleMessage(C){if(!Bp(C)||typeof C.id!="number")return;const E=this.pending.get(C.id);if(E){if(C.type==="loading"){E.onProgress?.({kind:"loading",progress:typeof C.progress=="number"?C.progress:null});return}if(C.type==="notice"){E.onProgress?.({kind:"notice",message:String(C.message)});return}if(C.type==="result"){this.pending.delete(C.id),E.resolve({text:typeof C.text=="string"?C.text:"",elapsedMs:typeof C.elapsedMs=="number"?C.elapsedMs:0});return}C.type==="error"&&(this.pending.delete(C.id),E.reject(new Error(typeof C.message=="string"?C.message:"Transcription failed")))}}failAll(C){for(const E of this.pending.values())E.reject(C);this.pending.clear()}dispose(){this.failAll(new Error("Speech client disposed")),this.worker?.terminate(),this.worker=null}}const qS=5;function GS(n,C,E=qS){return Math.abs(C-n)>=E}function KS(n,C){if(!n.length)return 0;for(let E=0;E<n.length;E+=1){const A=n[E];if(C<A.left+A.width/2)return E}return n.length-1}function jp(n,C,E){if(C===E||C<0||C>=n.length)return n;const A=Math.min(Math.max(E,0),n.length-1);if(A===C)return n;const N=[...n],[G]=N.splice(C,1);return N.splice(A,0,G),N}function ju(n,C){return C?n.findIndex(E=>E.id===C):-1}const VS=6;function YS(n,C,E,A=VS){return{x:Np(n.x,C.width,E.width,A),y:Np(n.y,C.height,E.height,A)}}function Np(n,C,E,A){return n+C+A<=E?Math.max(A,n):n-C-A>=0?n-C:Math.max(A,E-C-A)}function XS({at:n,items:C,label:E,onClose:A}){const N=Z.useRef(null),[G,P]=Z.useState(n);return Z.useLayoutEffect(()=>{const r=N.current?.getBoundingClientRect();r&&P(YS(n,{width:r.width,height:r.height},{width:window.innerWidth,height:window.innerHeight}))},[n,C.length]),Z.useEffect(()=>{const r=p=>{p.key==="Escape"&&(p.preventDefault(),p.stopPropagation(),A())},d=()=>A(),g=p=>{p.target instanceof Node&&N.current?.contains(p.target)||A()};return window.addEventListener("keydown",r,!0),window.addEventListener("pointerdown",g,!0),window.addEventListener("blur",d),window.addEventListener("wheel",d,{passive:!0}),()=>{window.removeEventListener("keydown",r,!0),window.removeEventListener("pointerdown",g,!0),window.removeEventListener("blur",d),window.removeEventListener("wheel",d)}},[A]),c.jsx("div",{className:"context-menu",role:"menu","aria-label":E,ref:N,style:{left:G.x,top:G.y},children:C.map(r=>c.jsxs("button",{type:"button",role:"menuitem",className:`context-menu-item ${r.danger?"danger":""}`.trim(),disabled:r.disabled||!r.onSelect,title:r.hint??"",onClick:()=>{A(),r.onSelect?.()},children:[r.icon?c.jsx(Oe,{name:r.icon}):c.jsx("span",{className:"context-menu-gap"}),c.jsx("span",{children:r.label})]},r.label))})}function ZS(n,C){let E=null,A=null,N=!1;return{handle(G){const P=G.charAt(0);if(N=!0,P==="A")return E=null,!0;if(P==="B")return E=n.cursor(),!0;if(P==="C"){if(!E)return!0;const r=n.read(E,n.cursor()).trim();return E=null,r&&(A={command:r,startedAt:n.now()}),!0}if(P==="D"){const r=A;if(A=null,!r)return!0;const d=QS(G);return C({command:r.command,...d===void 0?{}:{exitCode:d},durationMs:Math.max(0,n.now()-r.startedAt)}),!0}return!0},hasMarks(){return N},atPrompt(){return E!==null&&A===null},reset(){E=null,A=null}}}function QS(n){const C=n.split(";");if(C.length<2)return;const E=C[1].trim();if(!/^\d+$/.test(E))return;const A=Number(E);return A<=255?A:void 0}function JS(n,C,E){if(E.row<C.row||E.row===C.row&&E.col<=C.col)return"";const A=[];for(let N=C.row;N<=E.row;N+=1){const G=n(N)??"",P=N===C.row?C.col:0,r=N===E.row?E.col:G.length;A.push(G.slice(P,r))}return A.join("").replace(/\s+$/,"")}const Hp="TOKEN|KEY|SECRET|PASSWORD|PASSWD|PASSPHRASE|CREDENTIAL|AUTH|APIKEY|ACCESS_KEY|PRIVATE",eb=[{reason:"secret-assignment",pattern:new RegExp(String.raw`(?:^|[\s;&|(])(?:export\s+|set\s+(?:-x\s+)?|env\s+|declare\s+(?:-x\s+)?)?`+String.raw`[A-Za-z0-9_]*(?:${Hp})[A-Za-z0-9_]*\s*=\s*\S`,"i")},{reason:"secret-assignment",pattern:new RegExp(String.raw`(?:${Hp})[A-Za-z0-9_]*\s*=\s*\S`,"i")},{reason:"credential-flag",pattern:new RegExp(String.raw`(?:^|\s)--?(?:pass|password|passwd|passphrase|token|api[-_]?key|secret|auth[-_]?token|credential|bearer)`+String.raw`(?:=|\s+)\S`,"i")},{reason:"credential-flag",pattern:/\bmysql(?:dump|admin)?\b[^\r\n]*\s-p\S/i},{reason:"url-credentials",pattern:/[a-z][a-z0-9+.-]*:\/\/[^\s/@:]+:[^\s/@]+@/i},{reason:"auth-header",pattern:/(?:-H|--header)\s*["']?\s*(?:authorization|proxy-authorization|x-api-key|x-auth-token)\s*:/i},{reason:"basic-auth",pattern:/\b(?:curl|wget|http|https)\b[^\r\n]*\s-u\s*\S+:\S/i},{reason:"known-token",pattern:new RegExp([String.raw`gh[pousr]_[A-Za-z0-9]{16,}`,String.raw`github_pat_[A-Za-z0-9_]{20,}`,String.raw`sk-(?:ant-)?[A-Za-z0-9_-]{16,}`,String.raw`xox[baprs]-[A-Za-z0-9-]{10,}`,String.raw`AKIA[0-9A-Z]{16}`,String.raw`ASIA[0-9A-Z]{16}`,String.raw`AIza[0-9A-Za-z_-]{30,}`,String.raw`glpat-[A-Za-z0-9_-]{16,}`,String.raw`npm_[A-Za-z0-9]{30,}`,String.raw`dop_v1_[a-f0-9]{60,}`,String.raw`eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.`].join("|"))},{reason:"openssl-pass",pattern:/-pass(?:in|out)\s+(?:pass|env|file):/i}],tb=24;function ib(n){return n.length<tb||/[/\\]/.test(n)||!/^[A-Za-z0-9+/=_-]+$/.test(n)||/^[0-9a-f]+$/i.test(n)?!1:/[a-z]/.test(n)&&/[A-Z]/.test(n)&&/[0-9]/.test(n)}function sb(n){const C=n.trim();if(!C)return null;for(const{reason:E,pattern:A}of eb)if(A.test(C))return E;for(const E of C.split(/[\s=:,'"`]+/))if(ib(E))return"high-entropy";return null}const rb=4320*60*1e3,yn={cwd:50,host:12,recency:30,frequency:10,pick:25,failed:-20,match:40};function nb(n,C){if(!C)return[];const E=n.toLowerCase(),A=C.toLowerCase(),N=[];let G=0;for(const P of A){if(P===" ")continue;const r=E.indexOf(P,G);if(r<0)return null;N.push(r),G=r+1}return N}function ab(n,C){if(!C.length)return .5;const E=C[0],N=C[C.length-1]-E+1,G=C.length/N,P=1/(1+E),r=E===0||/\s/.test(n.charAt(E-1))?1:0;return .45*G+.35*P+.2*r}function ob(n,C){const E=C-Date.parse(n);return Number.isFinite(E)?E<=0?1:Math.pow(.5,E/rb):0}function lb(n,C,E){let A=yn.match*ab(n.command,C);return E.cwd&&n.cwd===E.cwd&&(A+=yn.cwd),E.host&&n.host===E.host&&(A+=yn.host),A+=yn.recency*ob(n.lastRun,E.now),A+=yn.frequency*Math.log1p(n.runs),A+=yn.pick*Math.log1p(n.picks),n.exitCode!==void 0&&n.exitCode!==0&&(A+=yn.failed),A}function cb(n,C){const E=new Map;for(const N of n){const G=nb(N.command,C.query);if(G===null)continue;const P={entry:N,score:lb(N,G,C),matched:G},r=E.get(N.command);(!r||P.score>r.score)&&E.set(N.command,P)}const A=[...E.values()].sort((N,G)=>G.score!==N.score?G.score-N.score:G.entry.lastRun.localeCompare(N.entry.lastRun));return C.limit===void 0?A:A.slice(0,C.limit)}function Nu(n){return{phase:"asking",sessionId:n,prompt:""}}function hb(n,C,E){return!E.trim()||C||n.includeOutput?!1:!n.requireApproval}function zp(n){return!!(n.baseUrl.trim()&&n.model.trim())}function ub(n,C){const E=n.replace(/\s+$/,"");if(C<=0)return"";if(E.length<=C)return E;const A=E.slice(-C),N=A.indexOf(`
145
- `);return N>=0&&N<A.length-1?A.slice(N+1):A}const db=150,fb=3e3,Up=400;function Ip(n){return{id:n.sessionId,name:n.name,kind:n.kind,host:n.host,screenName:n.screenName,sshTarget:n.sshTarget,backend:n.backend}}const Ee=()=>window.zerog;function Hu(){try{return window.localStorage}catch{return null}}function wc({session:n,active:C=!1,ghosted:E=!1,onClick:A}){const N=n.kind==="ssh"?`SSH · ${n.host}`:n.backend==="wsl"?`WSL${n.wslDistribution?` · ${n.wslDistribution}`:""} · ${n.cwd}`:n.backend&&n.backend!=="screen"?`${hm(n.backend)} · ${n.cwd}`:n.persistence==="screen"?`screen · ${n.cwd}`:`local · process only · ${n.cwd}`;return c.jsxs("button",{type:"button",className:`session-row ${C?"active":""} ${E?"session-ghosted":""}`,onClick:A,children:[c.jsx("span",{className:`status-dot ${n.status}`}),c.jsxs("span",{className:"session-copy",children:[c.jsx("b",{children:n.name}),c.jsx("small",{children:N})]}),c.jsx("span",{className:"session-state",children:E?"↗":n.status==="connected"?"●":"○"})]})}function _b({member:n,onClick:C}){const E=n.kind==="ssh"?`SSH · ${n.host??n.sshTarget??"saved host"}`:n.screenName?`screen · ${n.screenName}`:"local";return c.jsxs("button",{type:"button",className:"session-row session-ghosted",title:`Reconnect ${n.name}`,onClick:C,children:[c.jsx("span",{className:"status-dot"}),c.jsxs("span",{className:"session-copy",children:[c.jsx("b",{children:n.name}),c.jsxs("small",{children:[E," · not connected"]})]}),c.jsx("span",{className:"session-state",children:"↻"})]})}function pb({connection:n,onConfigure:C,onConnect:E}){const A=Gp(C,E),N=n.hostName?`${n.user??""}${n.user?"@":""}${n.hostName}${n.port?`:${n.port}`:""}`:"Saved SSH connection";return c.jsxs("button",{type:"button",className:"session-row",title:`Double-click to connect ${n.alias} in a new pane`,onClick:A.onClick,onDoubleClick:A.onDoubleClick,children:[c.jsx("span",{className:"status-dot"}),c.jsxs("span",{className:"session-copy",children:[c.jsx("b",{children:n.alias}),c.jsx("small",{children:N})]}),c.jsx("span",{className:"session-state",children:"→"})]})}function mb(n,C=200){if(!n)return"";const E=n.buffer.active,A=E.length,N=Math.max(0,A-C),G=[];for(let P=N;P<A;P+=1)G.push(E.getLine(P)?.translateToString(!0)??"");return G.join(`
146
- `)}const gb=120,vb=1e4,Sb=200;function bb(){if(!(typeof PerformanceObserver>"u"))try{new PerformanceObserver(C=>{for(const E of C.getEntries())E.duration>=Sb&&console.warn(`[zerog] renderer blocked for ${Math.round(E.duration)}ms`)}).observe({entryTypes:["longtask"]})}catch{}}bb();function yb({sessionId:n,focused:C,dormant:E=!1,onStatus:A,appearance:N,terminalSettings:G,registerFocus:P,registerCapture:r,onCommand:d,registerRead:g}){const p=Z.useRef(null),l=Z.useRef(null),S=Z.useRef(A);S.current=A;const x=Z.useRef(N);x.current=N;const R=Z.useRef(G);R.current=G;const m=Z.useRef(null),a=Z.useRef(null),u=Z.useRef({}),f=Z.useRef(d);return f.current=d,Z.useEffect(()=>{if(!p.current)return;const h=p.current,b=new Gg.Terminal({cursorBlink:R.current.cursorBlink,cursorStyle:R.current.cursorStyle,fontFamily:Uu(x.current.font),fontSize:x.current.fontSize,lineHeight:x.current.lineHeight,letterSpacing:x.current.letterSpacing,scrollback:R.current.scrollback,allowProposedApi:!0,theme:Pp(x.current.theme),linkHandler:{activate:(ie,he)=>{const ge=Ee();ge?.openExternal&&(S.current(`Opening ${he}`),ge.openExternal(he).catch(J=>{S.current(J instanceof Error?J.message:String(J))}))},hover:(ie,he)=>S.current(`Link: ${he}`),leave:()=>S.current("Ready")}});u.current={theme:x.current.theme,font:x.current.font,fontSize:x.current.fontSize,lineHeight:x.current.lineHeight,letterSpacing:x.current.letterSpacing,scrollback:R.current.scrollback,cursorStyle:R.current.cursorStyle,cursorBlink:R.current.cursorBlink};const M=new Vg.FitAddon;b.loadAddon(M),b.open(h),l.current=b;const w=Ee();let T=!1,y=0,L=0,O=0,U=!1,H=0;const z=()=>{if(T||!h.isConnected||h.clientWidth<20||h.clientHeight<20)return!1;try{M.fit()}catch{return!1}return b.cols>0&&b.rows>0},Y=()=>{!U||!w||!n||b.cols===L&&b.rows===O||(window.clearTimeout(H),H=window.setTimeout(()=>{T||!n||b.cols===L&&b.rows===O||(L=b.cols,O=b.rows,w.resize(n,L,O))},gb))},ne=()=>{z()&&Y()},V=()=>{cancelAnimationFrame(y),y=requestAnimationFrame(()=>{ne(),y=requestAnimationFrame(ne)})};if(m.current=V,!w)return V(),b.writeln("\x1B[90mZeroG Terminal\x1B[0m"),b.writeln("\x1B[31mPreload API unavailable. Rebuild the app.\x1B[0m"),S.current("Preload API unavailable"),()=>{T=!0,cancelAnimationFrame(y),l.current=null,a.current=null,b.dispose()};const X=w.onData((ie,he)=>{ie===n&&b.write(he)}),I=w.onStatus((ie,he)=>{ie===n&&(S.current(he),V())}),j=b.onData(ie=>{n&&w.write(n,ie)}),W=_v({terminal:b,clipboard:w,onError:ie=>S.current(ie),writeToPty:ie=>{n&&w.write(n,ie)},pasteEventTarget:h,isCopyOnSelectEnabled:()=>R.current.copyOnSelect}),B=ZS({cursor:()=>({row:b.buffer.active.baseY+b.buffer.active.cursorY,col:b.buffer.active.cursorX}),read:(ie,he)=>JS(ge=>b.buffer.active.getLine(ge)?.translateToString(!0),ie,he),now:()=>Date.now()},ie=>{n&&f.current?.(n,ie)}),F=b.parser.registerOscHandler(133,ie=>B.handle(ie));n&&r?.(n,B);const te=new ResizeObserver(()=>V());if(te.observe(h),window.addEventListener("resize",V),document.fonts?.ready?.then(()=>{T||V()}).catch(()=>{}),V(),!n)b.writeln("\x1B[90mZeroG Terminal\x1B[0m"),b.writeln("\x1B[90mSelect a session or create a local/SSH connection.\x1B[0m");else{const ie=z()?{cols:b.cols,rows:b.rows}:void 0;ie&&(L=ie.cols,O=ie.rows),w.attachSession(n,ie).then(he=>{U=!0,he.persistence==="process"?S.current(`${he.host} · ${he.name} · process only (install screen for persistence)`):S.current(`${he.host} · ${he.name}`),V()}).catch(he=>{S.current(he instanceof Error?he.message:String(he))})}return()=>{T=!0,cancelAnimationFrame(y),window.clearTimeout(H),W(),j.dispose(),X(),I(),te.disconnect(),F.dispose(),n&&r?.(n,null),window.removeEventListener("resize",V),m.current=null,l.current=null,a.current=null,b.dispose()}},[n]),Z.useEffect(()=>{const h=l.current;if(!h)return;if(E){const w=window.setTimeout(()=>{const T=a.current;a.current=null,T?.dispose()},vb);return()=>window.clearTimeout(w)}if(a.current)return;let b;try{b=new Xg.WebglAddon}catch(w){console.warn("[zerog] pane fell back to the DOM renderer",w);return}const M=b.onContextLoss(()=>{a.current===b&&(a.current=null),b.dispose()});try{h.loadAddon(b)}catch{b.dispose();return}return a.current=b,()=>M.dispose()},[n,E]),Z.useEffect(()=>{if(E)return;const h=l.current;if(!h)return;m.current?.();const b=requestAnimationFrame(()=>{h.rows>0&&h.refresh(0,h.rows-1)});return()=>cancelAnimationFrame(b)},[E]),Z.useEffect(()=>{const h=l.current;if(!h||E)return;const b=u.current;let M=!1;b.theme!==N.theme&&(b.theme=N.theme,h.options.theme=Pp(N.theme)),b.font!==N.font&&(b.font=N.font,h.options.fontFamily=Uu(N.font),M=!0),b.fontSize!==N.fontSize&&(b.fontSize=N.fontSize,h.options.fontSize=N.fontSize,M=!0),b.lineHeight!==N.lineHeight&&(b.lineHeight=N.lineHeight,h.options.lineHeight=N.lineHeight,M=!0),b.letterSpacing!==N.letterSpacing&&(b.letterSpacing=N.letterSpacing,h.options.letterSpacing=N.letterSpacing,M=!0),b.scrollback!==G.scrollback&&(b.scrollback=G.scrollback,h.options.scrollback=G.scrollback),b.cursorStyle!==G.cursorStyle&&(b.cursorStyle=G.cursorStyle,h.options.cursorStyle=G.cursorStyle),b.cursorBlink!==G.cursorBlink&&(b.cursorBlink=G.cursorBlink,h.options.cursorBlink=G.cursorBlink),M&&m.current?.()},[N,G,E]),Z.useEffect(()=>{C&&l.current?.focus()},[C]),Z.useEffect(()=>{if(!(!n||!P))return P(n,()=>l.current?.focus()),()=>P(n,null)},[n,P]),Z.useEffect(()=>{if(!(!n||!g))return g(n,()=>mb(l.current)),()=>g(n,null)},[n,g]),c.jsx("div",{className:"terminal",ref:p,onMouseDownCapture:h=>h.preventDefault()})}function Cb({open:n,ratio:C,browser:E,dock:A,onRatio:N,children:G}){const P=Z.useRef(null),[r,d]=Z.useState(null),g=r??C,p=l=>Math.min(Yp,Math.max(Vp,Math.round(l)));return c.jsxs("div",{className:n?"pane-body pane-body-split":"pane-body",ref:P,style:n?{gridTemplateColumns:`${g}fr ${100-g}fr`}:void 0,children:[G,n?c.jsxs(c.Fragment,{children:[c.jsx(Ac,{orientation:"vertical",className:"pane-resizer pane-browser-resizer",label:A?"Editor split":"Directory browser split",valuePercent:g,style:{left:`calc((100% - 1px) * ${g/100} + 0.5px)`},onDrag:l=>{const S=P.current?.getBoundingClientRect();!S||S.width<=0||d(p((l.clientX-S.left)/S.width*100))},onCommit:()=>{r!==null&&N(r),d(null)},onNudge:l=>N(p(g+l*2)),onReset:()=>N(Xp)}),A?c.jsx("div",{className:"pane-dock",ref:A}):E]}):null]})}function Ac({orientation:n,className:C,label:E,valuePercent:A,style:N,onDrag:G,onCommit:P,onNudge:r,onReset:d}){const[g,p]=Z.useState(!1),l=n==="vertical"?"ArrowLeft":"ArrowUp",S=n==="vertical"?"ArrowRight":"ArrowDown";return c.jsx("div",{role:"separator","aria-orientation":n,"aria-label":E,"aria-valuenow":Math.round(A),"aria-valuemin":0,"aria-valuemax":100,tabIndex:0,className:`${C} ${g?"dragging":""}`.trim(),style:N,title:`${E} — drag, arrow keys, or double-click to reset`,onPointerDown:x=>{x.button===0&&(x.preventDefault(),x.currentTarget.setPointerCapture(x.pointerId),p(!0))},onPointerMove:x=>{x.currentTarget.hasPointerCapture(x.pointerId)&&G(x)},onPointerUp:x=>{x.currentTarget.hasPointerCapture(x.pointerId)&&(x.currentTarget.releasePointerCapture(x.pointerId),p(!1),P())},onPointerCancel:()=>p(!1),onDoubleClick:d,onKeyDown:x=>{x.key===l?(x.preventDefault(),r(-1)):x.key===S?(x.preventDefault(),r(1)):(x.key==="Enter"||x.key==="Home")&&(x.preventDefault(),d())}})}function wb({index:n,onCreate:C}){return c.jsxs("article",{className:"pane empty-pane",children:[c.jsxs("div",{className:"pane-title",children:[c.jsxs("span",{children:["PANE ",n]}),c.jsx("span",{className:"pane-dim",children:"EMPTY"})]}),c.jsxs("div",{className:"empty-pane-body",children:[c.jsx("span",{className:"empty-glyph",children:"+"}),c.jsx("strong",{children:"Split ready"}),c.jsx("small",{children:"Open another terminal here"}),c.jsx("button",{type:"button",onClick:C,children:"Choose session"})]})]})}function xb(){const[n,C]=Z.useState(()=>q0(Hu())),E=n.appearance.theme,[A,N]=Z.useState([]),[G,P]=Z.useState(()=>[np("Workspace",n.sessions.defaultLayout)]),[r,d]=Z.useState(()=>G[0]?.id??""),[g,p]=Z.useState("Ready"),[l,S]=Z.useState({agents:[],links:[]}),[x,R]=Z.useState(null),[m,a]=Z.useState({state:"disabled",capabilities:[]}),[u,f]=Z.useState([]),[h,b]=Z.useState(null),[M,w]=Z.useState(!1),[T,y]=Z.useState(n.sessions.startSidebarCollapsed),[L,O]=Z.useState("terminals"),[U,H]=Z.useState("sessions"),[z,Y]=Z.useState([]),[ne,V]=Z.useState(!1),[X,I]=Z.useState(null),[j,W]=Z.useState(""),[B,F]=Z.useState("local"),[te,ie]=Z.useState("loopback"),[he,ge]=Z.useState(""),[J,q]=Z.useState(""),[re,_e]=Z.useState(""),[Ce,we]=Z.useState(!1),[Be,Re]=Z.useState(!1),[Ge,tt]=Z.useState(!1),[De,Tt]=Z.useState(!1),[Mt,We]=Z.useState({}),Ue=Z.useRef(new Map),[de,ue]=Z.useState({}),be=Object.keys(Mt).find(v=>Mt[v]==="overlay"),Le=Z.useMemo(()=>Ku(n.shortcuts),[n.shortcuts]),[Pe,lt]=Z.useState(""),[dt,vt]=Z.useState(0),[ke,Ie]=Z.useState([]),[je,Wt]=Z.useState(!0),[wt,Ot]=Z.useState(null),[$e,St]=Z.useState(null),[Gr,di]=Z.useState(!1),[Ei,Ai]=Z.useState("Workspace"),[ws,ri]=Z.useState(!1),[Kr,tr]=Z.useState(""),[ir,Da]=Z.useState(!1),[Ln,Vr]=Z.useState([]),[Vo,ka]=Z.useState("term"),[Tn,Mn]=Z.useState(""),[sr,Dn]=Z.useState(NS),kn=Z.useRef(!1),[On,Xi]=Z.useState(""),[qe,at]=Z.useState(null),[rr,hs]=Z.useState({status:"idle",stored:!1,encryptionAvailable:!0,sessionOnly:!1}),[jc,Yo]=Z.useState([]),[Xo,nr]=Z.useState({status:"idle"}),[fi,Ri]=Z.useState({status:"idle",sessionId:null}),[ni,ar]=Z.useState(null),Li=Z.useRef(null),At=Z.useRef(null),us=Z.useRef(null),or=Z.useRef(void 0),[_i,ai]=Z.useState(!1),[lr,cr]=Z.useState(!1),[Yr,ds]=Z.useState({status:"idle"}),xs=Z.useRef(null),Es=Z.useRef(void 0),[Zi,Bt]=Z.useState({status:"idle",stored:!1,encryptionAvailable:!0,sessionOnly:!1}),Xr=Z.useRef(null),[Bn,jn]=Z.useState([]),[As,Zr]=Z.useState(n.sessions.defaultBackend),[Zo,Zt]=Z.useState(n.sessions.defaultWslDistribution),[Oa,Nn]=Z.useState([]),[Hn,Qi]=Z.useState([]),[Ti,Ba]=Z.useState([]),[Rs,ja]=Z.useState([]),[Nc,Na]=Z.useState(!1),Qr=Z.useRef(new Map),Hc=Z.useCallback((v,k)=>{k?Qr.current.set(v,k):Qr.current.delete(v)},[]),zn=Z.useRef(new Map),Un=Z.useCallback((v,k)=>{k?zn.current.set(v,k):zn.current.delete(v)},[]),pi=Z.useRef(new Map),Ha=Z.useCallback((v,k)=>{k?pi.current.set(v,k):pi.current.delete(v)},[]),[za,Ji]=Z.useState({}),[fs,Qo]=Z.useState({}),Ls=Z.useRef(b0(Ee,(v,k)=>Ii(K=>K[v]===k?K:{...K,[v]:k}))).current,Ua=Ls.listerFor,[Ts,Ii]=Z.useState({}),[In,hr]=Z.useState(null),[Mi,Ia]=Z.useState(null);Z.useEffect(()=>{Ee()?.appVersion?.().then(v=>Ia(am(v))).catch(()=>{})},[]),Z.useEffect(()=>{const v=Ee();return v?.listPaneLinks?.().then(S).catch(()=>{}),v?.onPaneLinks?.(S)},[]),Z.useEffect(()=>{const v=Ee();return v?.mcpStatus?.().then(a).catch(()=>{}),v?.onMcpStatus?.(a)},[]),Z.useEffect(()=>{const v=Ee();return v?.listMcpExecutions?.().then(k=>f(k.filter(K=>"command"in K&&K.state==="pending"))).catch(()=>{}),v?.onMcpExecution?.(k=>{if(!("command"in k)){f(K=>K.filter(Q=>Q.requestId!==k.requestId));return}f(K=>k.state==="pending"?[...K.filter(Q=>Q.requestId!==k.requestId),k]:K.filter(Q=>Q.requestId!==k.requestId))})},[]),Z.useEffect(()=>{const v=Ee();if(v?.onMcpWorkspaceRestored)return v.onMcpWorkspaceRestored(k=>{const K=k.restored.map(Q=>Q.session);N(Q=>{const me=new Map(Q.map(ye=>[ye.id,ye]));for(const ye of K)me.set(ye.id,ye);return[...me.values()]}),P(Q=>{const me=new Set(K.map(xe=>xe.id)),ye=k.restored.map(xe=>xe.member);return Q.find(xe=>xe.id===k.workspaceId)?Q.map(xe=>{if(xe.id!==k.workspaceId)return xe;const et=xe.pending.filter(ot=>!ye.some(ti=>ot.sessionId===ti.sessionId||ot.sshTarget&&ot.sshTarget===ti.sshTarget||ot.name===ti.name&&ot.kind===ti.kind));return{...xe,sessionIds:Array.from(new Set([...xe.sessionIds,...me])),pending:et}}):[...Q,{id:k.workspaceId,name:k.workspaceName??"Restored workspace",sessionIds:Array.from(me),pending:[],view:Ko("grid")}]}),d(k.workspaceId),p(`Restored ${K.length} session${K.length===1?"":"s"}`),v.listSessions().then(N).catch(()=>{})})},[]),Z.useEffect(()=>{const v=Ee();if(v?.onMcpSshSessionCreated)return v.onMcpSshSessionCreated(({session:k})=>{N(K=>[...K.filter(Q=>Q.id!==k.id),k]),P(K=>K.map(Q=>Q.id===r?{...Q,sessionIds:Array.from(new Set([...Q.sessionIds,k.id]))}:Q)),p(`Opened SSH session to ${k.host}`)})},[r]),Z.useEffect(()=>Ee()?.onSftpEvent?.(k=>{k.type==="prompt"?hr(k.prompt.text.trim().split(`
147
- `).pop()??null):hr(null)}),[]);const Jr=Z.useRef(new Set),Pa=Z.useCallback(v=>{Jr.current.has(v.id)||(Jr.current.add(v.id),Ls.learnHome(v).then(k=>{k&&Ii(K=>({...K,[v.id]:k}))}).catch(()=>{}))},[Ls]),en=Z.useRef(new Set),tn=Z.useCallback(v=>{if(en.current.has(v))return;en.current.add(v);const k=Ee();k&&k.wslHome(v).then(K=>{K&&Qo(Q=>({...Q,[v]:K}))}).catch(()=>{})},[]),Pt=Z.useCallback(v=>{v&&(ur(v),requestAnimationFrame(()=>Qr.current.get(v)?.()))},[]),Qt=$r(()=>St(null)),Ms=$r(()=>{Ee()?.cancelAiRequest?.(),at(null)}),Pn=$r(()=>di(!1)),sn=$r(()=>Re(!1)),zc=$r(()=>tt(!1)),$a=$r(()=>ai(!1)),Fa=$r(()=>Gt()),rn=$r(()=>cr(!1)),oi=Z.useCallback((v,k)=>{C(K=>{const Q=Ep(K,v,k);return xp(Hu(),Q),Q})},[]),Wa=Z.useCallback((v,k)=>{C(K=>Ep(K,v,k))},[]),Uc=Z.useCallback(v=>{C(k=>{const K=K0(k,v);return xp(Hu(),K),K})},[]);Z.useEffect(()=>{document.documentElement.dataset.theme=E},[E]);const ct=Z.useMemo(()=>G.find(v=>v.id===r)??G[0]??null,[G,r]),Pi=ct?.view??Ko(n.sessions.defaultLayout),bt=Pi.layout,mi=Pi.focusedSessionId,Jo=Pi.maximizedSessionId??null,rt=Z.useMemo(()=>Pi.activeSessionId?A.find(v=>v.id===Pi.activeSessionId)??null:null,[Pi.activeSessionId,A]),Jt=Z.useCallback((v,k)=>{P(K=>ap(K,k??r,v))},[r]),Ds=Z.useCallback(v=>Jt({activeSessionId:v?.id}),[Jt]),nn=Z.useCallback(v=>Jt(k=>({layout:typeof v=="function"?v(k.layout):v})),[Jt]),ur=Z.useCallback(v=>Jt({focusedSessionId:v}),[Jt]),ks=Z.useCallback(v=>Jt({maximizedSessionId:v}),[Jt]),yt=Z.useMemo(()=>{if(!ct)return A;const v=new Set(ct.sessionIds);return A.filter(k=>v.has(k.id))},[ct,A]),el=ct?.pending??[],_s=Z.useCallback(async()=>{const v=Ee();if(Wt(!0),Ot(null),!v){Ot("Preload API unavailable"),p("Preload API unavailable"),Wt(!1);return}try{const k=await v.listSessions();N(k),p(k.length?`${k.length} session${k.length===1?"":"s"}`:"No sessions")}catch(k){const K=k instanceof Error?k.message:String(k);Ot(K),p(K)}finally{Wt(!1)}},[]);Z.useEffect(()=>{_s()},[_s]),Z.useEffect(()=>{const v=Ee();v&&v.listBackends?.().then(jn).catch(()=>jn([]))},[]),Z.useEffect(()=>{if(As!=="wsl"){Nn([]),Zt("");return}const v=Ee();v&&v.listWslDistributions?.().then(Nn).catch(()=>Nn([]))},[As]),Z.useEffect(()=>{if(!Be){Qi([]);return}const v=Ee();v&&v.listHistory?.().then(Qi).catch(()=>Qi([]))},[Be]),Z.useEffect(()=>{const v=Ee(),k=cs((rt?.kind==="ssh"?rt.host:"")||(mi?A.find(Q=>Q.id===mi)?.host:"")||""),K=k?Ti.filter(Q=>cs(Q.hostName??"")===k||Q.alias===k):[];if(K.length===0){ja([]);return}v?.discoverRemoteScreens&&(Na(!0),Promise.allSettled(K.map(Q=>v.discoverRemoteScreens(Q))).then(Q=>{const me=[];Q.forEach((ye,Ae)=>{ye.status==="fulfilled"&&Array.isArray(ye.value)&&ye.value.forEach(xe=>{me.push({session:xe,connection:K[Ae]})})}),ja(me)}).catch(()=>ja([])).finally(()=>Na(!1)))},[Ti,rt?.host,A,mi]),Z.useEffect(()=>{const v=Ee();v&&v.listKnownConnections?.().then(Ba).catch(()=>Ba([]))},[]),Z.useEffect(()=>{n.ai.recordCommands&&Ee()?.listCommandHistory?.().then(Ie).catch(()=>{})},[n.ai.recordCommands]),Z.useEffect(()=>{const v=Ee();v?.speechApiKeyStatus&&v.speechApiKeyStatus().then(k=>Bt(K=>({...K,stored:k.stored,encryptionAvailable:k.encryptionAvailable}))).catch(()=>{})},[]),Z.useEffect(()=>{const v=Ee();v?.aiApiKeyStatus&&v.aiApiKeyStatus().then(k=>hs(K=>({...K,stored:k.stored,encryptionAvailable:k.encryptionAvailable}))).catch(()=>{})},[]),Z.useEffect(()=>{je||!ir||P(v=>Rv(v,A))},[A,je,ir]),Z.useEffect(()=>{je||We(v=>{const k=Object.keys(v).filter(K=>A.some(Q=>Q.id===K));return k.length===Object.keys(v).length?v:Object.fromEntries(k.map(K=>[K,v[K]]))})},[A,je]),Z.useEffect(()=>{const v=Ee();if(!v?.loadWorkspaces){Da(!0);return}let k=!1;return v.loadWorkspaces().then(K=>{if(k)return;const Q=Iv(K,n.sessions.defaultLayout);Q.workspaces.length&&(P(Q.workspaces),Q.activeWorkspaceId&&d(Q.activeWorkspaceId))}).catch(()=>{}).finally(()=>{k||Da(!0)}),()=>{k=!0}},[]),Z.useEffect(()=>{je||!ir||P(v=>kv(v,k=>{const K=Lu(Ip(k),A,Ti);return K.kind==="attach"?K.sessionId:void 0}))},[A,je,ir,Ti]),Z.useEffect(()=>{const v=Ee();if(v?.onForwardEvent)return v.onForwardEvent(k=>{if(k.type==="status"){Y(K=>Wo(K,k.forward));return}if(k.type==="prompt"){I({forwardId:k.forwardId,kind:k.prompt.kind,text:k.prompt.text});return}Y(K=>K.map(Q=>Q.id===k.forwardId&&Q.status!=="error"?{...Q,status:"idle"}:Q))})},[]),Z.useEffect(()=>{const v=Ee();if(!v?.loadForwards){V(!0);return}let k=!1;return Promise.all([v.loadForwards(),v.listForwards?.()??[]]).then(([K,Q])=>{if(k)return;const me=A0(K);Y(Q.reduce((ye,Ae)=>Wo(ye,Ae),me))}).catch(()=>{}).finally(()=>{k||V(!0)}),()=>{k=!0}},[]),Z.useEffect(()=>{Ee()?.loadHostLabels?.().then(Dn).catch(()=>{})},[]),Z.useEffect(()=>{if(!ne)return;const v=Ee();if(!v?.saveForwards)return;const k=setTimeout(()=>{v.saveForwards(E0(z)).catch(()=>{})},Up);return()=>clearTimeout(k)},[z,ne]),Z.useEffect(()=>{if(!ir||je)return;const v=Ee();if(!v?.saveWorkspaces)return;const k=setTimeout(()=>{v.saveWorkspaces(Hv(G,r,A)).catch(()=>{})},Up);return()=>clearTimeout(k)},[G,r,A,ir,je]),Z.useEffect(()=>{r&&Vr(v=>v.includes(r)?v:[...v,r])},[r]),Z.useEffect(()=>{!rt&&yt.length&&Ds(yt[0])},[rt,yt,Ds]),Z.useEffect(()=>Ee()?.onLinkRefused?.(k=>p(k)),[]);const tl=Z.useRef(new Map);Z.useEffect(()=>{const v=Ee();if(v)return v.onData((k,K)=>{const Q=((tl.current.get(k)??"")+K).slice(-2048);tl.current.set(k,Q);const me=v0(Q);me&&N(ye=>{const Ae=ye.find(xe=>xe.id===k);return!Ae||Ae.cwd===me.path?ye:ye.map(xe=>xe.id===k?{...xe,cwd:me.path}:xe)})})},[]),Z.useEffect(()=>{const v=k=>{if(k.key==="Escape"){if(Hs.current){k.preventDefault(),mr();return}const Q=l0({help:De,editor:!!be,transfer:lr,settings:_i,voiceReview:!!ni,overview:Gr,suggest:!!qe,modal:!!$e,palette:Ge,history:Be});if(!Q)return;k.preventDefault(),Q==="help"&&Tt(!1),Q==="editor"&&be&&Ue.current.get(be)?.(),Q==="transfer"&&cr(!1),Q==="settings"&&ai(!1),Q==="voiceReview"&&Gt(),Q==="overview"&&di(!1),Q==="suggest"&&(Ee()?.cancelAiRequest?.(),at(null)),Q==="modal"&&St(null),Q==="palette"&&tt(!1),Q==="history"&&Re(!1);return}const K=a0({key:k.key,code:k.code,ctrlKey:k.ctrlKey,metaKey:k.metaKey,shiftKey:k.shiftKey,altKey:k.altKey,inTextField:k.target instanceof HTMLInputElement},Le);if(K){if(k.preventDefault(),K.action==="switch-workspace"){const Q=G[K.position-1];Q&&Is(Q.id);return}K.action==="toggle-help"&&Tt(Q=>!Q),K.action==="toggle-overview"&&di(Q=>!Q),K.action==="new-workspace"&&(Ai(yc(G)),St("workspace")),K.action==="new-terminal"&&ei("local"),K.action==="ask-ai"&&_r(),K.action==="toggle-layout"&&Jt(Q=>({maximizedSessionId:null,layout:Q.layout==="stack"?Q.lastSplit:"stack"})),K.action==="toggle-sidebar"&&y(Q=>!Q),K.action==="toggle-settings"&&ai(Q=>!Q),K.action==="history-palette"&&Gc()}};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[Gr,qe,$e,Ge,Be,_i,lr,De,be,ni,fi.status,G,r,ct,yt,A]);const il=Cp(n.ai),qa=ku(n.ai),sl=kS(n.ai.customButtons),$n=Wu(rt),rl=Pv(rt),Ga=bt==="stack"?1:bt==="grid"?4:2,nl=Z.useMemo(()=>new Set([...Ln,r]),[Ln,r]),Ka=Z.useMemo(()=>Cv(G.filter(v=>nl.has(v.id)),A,r),[G,A,r,nl]),es=Z.useMemo(()=>Ka.filter(v=>v.workspaceId===r).map(v=>v.session),[Ka,r]),Ic=Math.max(Ga,es.length),qt=es.some(v=>v.id===Jo)?Jo:null,Pc=es.find(v=>v.id===rt?.id)?.id??es[0]?.id,Va=v=>{const k=Ee();return v.kind==="ssh"?LS(k,K=>Ls.withHandle(v,K)):RS(k)},an=v=>We(k=>({...k,[v.id]:"overlay"})),$c=(v,k)=>We(K=>K[v]?{...K,[v]:k}:K),al=v=>{We(k=>{const{[v]:K,...Q}=k;return Q}),Pt(v)},ol=Z.useCallback((v,k)=>{ue(K=>K[v]===k?K:{...K,[v]:k})},[]),Ya=Z.useRef(new Map),ll=v=>{let k=Ya.current.get(v);return k||(k=K=>ol(v,K),Ya.current.set(v,k)),k},cl=Z.useCallback((v,k)=>{k?Ue.current.set(v,k):Ue.current.delete(v)},[]),dr=bt==="split-v"||bt==="split-h",Xa=es.map(v=>v.id),ps=dr?TS(Xa,Pi.visiblePanes,Dc):null,hl=(v,k)=>bt==="stack"?v.id===Pc:ps?ps.includes(v.id):k<Ga,Za=(v,k)=>{if(!ps)return;const K=DS(Xa,ps,ps.indexOf(v),k);Jt({visiblePanes:K});const Q=es.find(me=>me.id===K[ps.indexOf(v)]);Q&&(Ds(Q),Pt(Q.id))};Z.useEffect(()=>{lr&&!$n&&cr(!1)},[lr,$n]),Z.useEffect(()=>{bt==="stack"||Pi.lastSplit===bt||Jt({lastSplit:bt})},[bt,Pi.lastSplit,Jt]);const $i=async v=>{Ds(v),ur(v.id);const k=es.findIndex(K=>K.id===v.id);qt?ks(v.id):k>=0&&bt!=="stack"&&!hl(v,k)&&nn("grid"),p(v.persistence==="process"?`${v.host} · ${v.name} · process only (install screen for persistence)`:`${v.host} · ${v.name}`),di(!1)},Di=(v,k=r)=>{P(K=>wv(K,k,v.id))},on=async v=>{v.preventDefault();const k=Ei.trim()||yc(G),K=np(k,n.sessions.defaultLayout);P(Q=>[...Q,K]),d(K.id),Ds(null),St(null),p(`Workspace “${k}” ready`)},Fc=async v=>{v.preventDefault();const k=Ee();if(k){if((ct?Tu(ct):yt.length)>=4){p("This workspace supports up to 4 sessions."),St(null);return}w(!0);try{const K=await k.createLocalSession({name:Vo,backend:As,wslDistribution:As==="wsl"?Zo:void 0});N(Q=>[...Q.filter(me=>me.id!==K.id),K]),Di(K),ur(K.id),ks(null),nn(Mu(yt.length+1)),St(null),await $i(K)}catch(K){p(K instanceof Error?K.message:String(K))}finally{w(!1)}}},fr=async(v,k,K)=>{const Q=Ee();if(!Q||M)return null;const me=ct?Tu(ct):yt.length;if(!K?.replacingPane&&me>=4)return p("This workspace supports up to 4 sessions."),St(null),null;w(!0);try{const ye=await Q.createSshSession({name:k||void 0,target:v});return N(Ae=>[...Ae.filter(xe=>xe.id!==ye.id),ye]),Di(ye),ur(ye.id),ks(null),nn(Mu(K?.replacingPane?Math.max(me,1):me+1)),St(null),await $i(ye),ye}catch(ye){return p(ye instanceof Error?ye.message:String(ye)),null}finally{w(!1)}},ul=async v=>{if(v.preventDefault(),!await fr(On,Tn))return;const K=jS(sr,On,Tn);K!==sr&&(Dn(K),Ee()?.saveHostLabels?.(K).catch(()=>{}))},dl=v=>{Xi(v),kn.current||Mn(Iu(sr,v)??"")},Fn=async(v,k)=>{const K=Ee();if(!K)return null;if(v.kind==="unavailable")return p(v.reason),null;if(v.kind==="attach"){const me=A.find(ye=>ye.id===v.sessionId);return me?(Di(me),await $i(me),me):null}if(v.kind==="attach-remote-screen")return _l(v.name,v.screenName,v.connection);const Q=await fr(v.target,v.name,k);return!Q||!v.screenCommand||(await K.attachSession(Q.id),await Wn(K,Q.id),K.write(Q.id,`${v.screenCommand}\r`)),Q},Qa=async v=>{const k=Lu(Ip(v),A,Ti);if(k.kind==="unavailable"){P(Q=>lp(Q,r,v.sessionId)),p(k.reason);return}p(`Reconnecting ${v.name}…`),await Fn(k,{replacingPane:!0})&&P(Q=>lp(Q,r,v.sessionId))},fl=v=>{p(`Connecting to ${v.alias}…`),fr(v.hostName??v.alias,v.alias.slice(0,48))},_l=async(v,k,K)=>{try{const Q=Ee();if(!Q)return null;p(`Attaching to ${v} on ${K.alias}…`);const ye=(await Q.buildRemoteScreenAttach?.(K,k))?.args,Ae=Array.isArray(ye)?ye.indexOf("--"):-1,xe=Ae>0?ye[Ae-1]:K.hostName??K.alias,ot={...await Q.createSshSession({target:xe,name:v}),screenName:k,persistence:"screen",backend:"screen"};N(Nt=>Nt.some(Ht=>Ht.id===ot.id)?Nt.map(Ht=>Ht.id===ot.id?ot:Ht):[...Nt,ot]),Di(ot),await $i(ot),await Q.attachSession(ot.id);const ti=ye&&Ae>0?ye.slice(Ae+1).join(" "):`screen -x ${k}`;return await Wn(Q,ot.id),Q.write(ot.id,`${ti}\r`),await _s(),p(`Connected to ${v} on ${K.alias}`),ot}catch(Q){return p(Q instanceof Error?Q.message:String(Q)),null}},Wn=(v,k)=>new Promise(K=>{let Q=!1,me="",ye,Ae;const xe=()=>{Q||(Q=!0,clearTimeout(ye),clearTimeout(et),Ae?.(),K())},et=setTimeout(xe,fb);Ae=v.onData((ot,ti)=>{if(ot===k){if(me=(me+ti).slice(-512),rp(me)){xe();return}clearTimeout(ye),ye=setTimeout(xe,db)}})}),Wc=Z.useCallback((v,k)=>{if(!n.ai.recordCommands)return;const K=sb(k.command);if(K){p(`Command not remembered — it looks like it carries a credential (${K}).`);return}const Q=Ee();if(!Q?.recordCommand)return;const me=A.find(ye=>ye.id===v);Q.recordCommand({command:k.command,...me?.cwd?{cwd:me.cwd}:{},...me?.host?{host:me.host}:{},...me?.kind?{kind:me.kind}:{},...k.exitCode===void 0?{}:{exitCode:k.exitCode}}).then(ye=>{ye&&Ie(Ae=>[...Ae.filter(xe=>xe.id!==ye.id),ye])}).catch(()=>{})},[n.ai.recordCommands,A]),qc=Z.useMemo(()=>{const v=[...zn.current.values()];return{entries:ke.length,panesReporting:v.filter(k=>k.hasMarks()).length,panesOpen:v.length}},[ke,_i,A]),Gc=()=>{lt(""),vt(0),tt(!0),Ee()?.listCommandHistory?.().then(Ie).catch(()=>{})},qn=Z.useMemo(()=>{if(!Ge)return[];const v=A.find(k=>k.id===(mi??rt?.id));return cb(ke,{query:Pe,...v?.cwd?{cwd:v.cwd}:{},...v?.host?{host:v.host}:{},now:Date.now(),limit:40})},[Ge,ke,Pe,A,mi,rt?.id]),pl=v=>{const k=mi??rt?.id;if(tt(!1),!k){p("No terminal selected for the command");return}Ee()?.write(k,v.entry.command),Ee()?.pickCommand?.(v.entry.id).catch(()=>{}),p(`On the prompt: ${v.entry.command}`),Pt(k)},li=async()=>{await Ee()?.clearCommandHistory?.().catch(()=>{}),Ie([]),p("Remembered commands forgotten.")},_r=()=>{if(!zp(n.ai)){ai(!0),p("Set an AI endpoint and model in Settings first.");return}at(Nu(rt?.id??mi))},ml=async v=>{const k=Ee(),K=qe;if(!k?.requestAiCommand||!K)return;const Q=K.sessionId,me=Q?A.find(xe=>xe.id===Q):void 0,ye=n.ai.includeOutput&&!!Q,Ae=ye&&Q?ub(pi.current.get(Q)?.()??"",n.ai.outputChars):"";at({phase:"thinking",sessionId:Q,prompt:v,usedOutput:ye&&!!Ae});try{const xe=await k.requestAiCommand({baseUrl:n.ai.baseUrl,model:n.ai.model},{prompt:v,...Q?{sessionId:Q}:{},context:{...me?.backend?{shell:hm(me.backend)}:{},...me?.cwd?{cwd:me.cwd}:{},...me?.host?{host:me.host}:{},...me?.kind?{kind:me.kind}:{},...Ae?{output:Ae}:{}}}),et=ye&&!!Ae;if(hb(n.ai,et,xe.command)&&Q){k.write(Q,`${xe.command}\r`),at(null),p(`Ran suggestion: ${xe.command}`);return}at({phase:"reviewing",sessionId:Q,prompt:v,usedOutput:et,suggestion:xe})}catch(xe){at({phase:"failed",sessionId:Q,prompt:v,message:si(xe)})}},gl=()=>{if(qe?.phase!=="reviewing")return;const{sessionId:v,suggestion:k}=qe;at(null),!(!v||!k.command)&&(Ee()?.write(v,`${k.command}\r`),p(`Sent: ${k.command}`),Pt(v))},vl=async()=>{const v=Ee();if(v?.listAiModels)try{Yo(await v.listAiModels(n.ai.baseUrl))}catch(k){Yo([]),p(si(k))}},Sl=async()=>{const v=Ee();if(!v?.testAiEndpoint)return;nr({status:"testing",message:null});const k=await v.testAiEndpoint({baseUrl:n.ai.baseUrl,model:n.ai.model});nr({status:"idle",ok:k.ok,message:k.message})},Gn=Z.useMemo(()=>{const v=new Set;for(const k of A)k.kind==="ssh"&&k.host&&v.add(k.host);for(const k of Ti)v.add(k.hostName??k.alias);return[...v]},[A,Ti]),Ja=()=>{W(v=>v||(rt?.kind==="ssh"?rt.host:Gn[0])||""),we(!1),St("forward")},Os=async v=>{const k=Ee();if(!k?.openForward)return;const K=x0(v,z);if(K){p(K);return}H("ports"),Y(Q=>Wo(Q,{...v,status:"connecting"}));try{const Q=await k.openForward(v);Y(me=>Wo(me,Q)),p(`Sharing ${mp(Q)}`)}catch(Q){const me=si(Q);Y(ye=>Wo(ye,{...v,status:"error",message:me})),p(me)}},eo=async v=>{v.preventDefault();const k=Number(he),K=Number(J||he);if([k,K].some(me=>!Number.isInteger(me)||me<1||me>65535)){p("A port must be a whole number between 1 and 65535.");return}St(null),await Os({id:`forward:${crypto.randomUUID()}`,target:j.trim(),direction:B,bind:te,listenPort:k,destinationPort:K,...re.trim()?{destinationHost:re.trim()}:{}})},ln=async v=>{const k=Ee();Y(K=>K.filter(Q=>Q.id!==v.id)),p(`Stopped sharing ${xn(v)}`);try{await k?.closeForward?.(v.id)}catch{}},Kn=v=>ct?.view.browsers?.[v],Vn=v=>!!Kn(v)?.open,Bs=v=>Kn(v)?.ratio??Xp,js=(v,k)=>{Jt(K=>({browsers:{...K.browsers,[v]:{open:!1,...K.browsers?.[v],...k}}}))},Yn=v=>{const k=!Vn(v);js(v,{open:k}),k||Ji(K=>({...K,[v]:""}))},to=v=>za[v.id]||qv(v,Ns(v)),Ns=v=>v.kind==="ssh"?Ts[v.id]:v.wslDistribution?fs[v.wslDistribution]:void 0,bl=(v,k)=>{const K=Ee();if(!K)return;const Q=$v(v);if(!Q){p(`ZeroG does not know how ${v.name} quotes a path, so it will not type one.`);return}const me=Du(v,k);if(!me){p(`That directory is outside what ${v.name} can reach.`);return}if(!yl(v)){p(`${v.name} is running something, so its directory was left alone.`);return}const ye=Yv(Q,me);if("refused"in ye){p(ye.refused);return}K.write(v.id,ye.command+"\r"),Ji(Ae=>({...Ae,[v.id]:k})),p(`${v.name}: ${ye.command}`),Pt(v.id)},yl=v=>{const k=zn.current.get(v.id);if(k?.hasMarks())return k.atPrompt();const K=pi.current.get(v.id);if(!K)return!1;const Q=K().trimEnd().split(`
148
- `);return rp(Q[Q.length-1]??"")},Xn=Z.useRef(new Map);Z.useEffect(()=>{const v=[];for(const k of A)Xn.current.has(k.id)&&Xn.current.get(k.id)!==k.cwd&&v.push(k.id),Xn.current.set(k.id,k.cwd);v.length&&Ji(k=>{const K={...k};let Q=!1;for(const me of v)K[me]&&(delete K[me],Q=!0);return Q?K:k})},[A]),Z.useEffect(()=>{for(const v of A){if(!Vn(v.id))continue;const k=!v.cwd||v.cwd.startsWith("~");if(v.kind==="ssh"){Ts[v.id]||Pa(v);continue}!v.wslDistribution||!k||fs[v.wslDistribution]||tn(v.wslDistribution)}},[A,ct?.view.browsers,fs,Ts,tn,Pa]);const Hs=Z.useRef(null),[Kc,io]=Z.useState(null),[Zn,so]=Z.useState(null),[ro,gi]=Z.useState(null),zs=Z.useRef(!1),vi=()=>[...document.querySelectorAll(".workspace-tab-slot")].map(v=>{const k=v.getBoundingClientRect();return{id:v.dataset.workspaceId??"",left:k.left,width:k.width}}),pr=(v,k)=>{k.button===0&&(k.target.closest(".workspace-tab-close")||(Hs.current={id:v.id,pointerId:k.pointerId,startX:k.clientX,dragging:!1,original:G},k.currentTarget.setPointerCapture?.(k.pointerId)))},no=v=>{const k=Hs.current;if(!k||k.pointerId!==v.pointerId)return;if(!k.dragging){if(!GS(k.startX,v.clientX))return;k.dragging=!0,zs.current=!0,io(k.id)}const K=vi();if(K.findIndex(ye=>ye.id===k.id)<0)return;const me=KS(K,v.clientX);P(ye=>{const Ae=ju(ye,k.id);return Ae<0?ye:jp(ye,Ae,me)})},Qn=v=>{const k=Hs.current;!k||k.pointerId!==v.pointerId||(v.currentTarget.releasePointerCapture?.(v.pointerId),Hs.current=null,io(null),k.dragging&&window.setTimeout(()=>{zs.current=!1},0))},mr=()=>{const v=Hs.current;v&&(Hs.current=null,io(null),v.dragging&&P(v.original),zs.current=!1)},ao=v=>{const k=ju(G,v.id),K=G.length-1,Q=me=>P(ye=>jp(ye,ju(ye,v.id),me));return[{label:"Rename…",icon:"pencil",onSelect:()=>{gi(v.id),Ai(v.name),St("rename")}},{label:"Duplicate",icon:"copy",hint:"Copies the layout, and each SSH pane as one to reconnect",onSelect:()=>Us(v)},{label:"Move left",icon:"chevron-left",disabled:k<=0,onSelect:()=>Q(k-1)},{label:"Move right",icon:"chevron-right",disabled:k<0||k>=K,onSelect:()=>Q(k+1)},{label:"Close workspace",icon:"x",danger:!0,disabled:G.length<2,hint:G.length<2?"The last workspace cannot be closed":"Its terminals keep running",onSelect:()=>wl(v.id)}]},Us=v=>{const k=yc(G),K=Tv(G,v.id,A,k);if(!K.created)return;P(K.workspaces),d(K.created.id),Ds(null);const Q=[`Workspace “${k}” copies ${v.name}`];K.copied&&Q.push(`${K.copied} SSH ${K.copied===1?"pane":"panes"} to reconnect`),K.skipped&&Q.push(`${K.skipped} local ${K.skipped===1?"pane":"panes"} not copied`),p(Q.join(" · "))},Cl=async v=>{v.preventDefault();const k=ro,K=Ei.trim();if(St(null),gi(null),!k||!zu(K))return;const Q=G.find(me=>me.id===k)?.name;K!==Q&&(P(me=>op(me,k,K)),p(`Workspace “${Q}” is now “${K}”`))},gr=()=>{Ai(yc(G)),St("workspace")},Is=v=>{if(v===r)return;const k=G.find(K=>K.id===v);k&&(ri(!1),d(v),p(`Workspace “${k.name}”`))},wl=v=>{const k=G.find(me=>me.id===v),K=Dv(G,v,r);if(K.workspaces===G)return;ri(!1),P(K.workspaces),d(K.activeWorkspaceId);const Q=K.releasedSessionIds.length;p(Q?`Closed workspace “${k?.name}” · ${Q} session${Q===1?"":"s"} still running`:`Closed workspace “${k?.name}”`)},ci=()=>{ct&&(tr(ct.name),ri(!0))},Jn=()=>{if(ri(!1),!ct)return;const v=Kr.trim();!zu(v)||v===ct.name||(P(k=>op(k,ct.id,v)),p(`Workspace renamed to “${v}”`))},ei=(v,k)=>{ka(Ab(ct?.name??"term",yt)),Zr(pm(n.sessions.defaultBackend,Bn)),Zt(n.sessions.defaultWslDistribution),kn.current=!1,k?.sshTarget!==void 0&&(Xi(k.sshTarget),Mn(Iu(sr,k.sshTarget)??"")),St(v)},cn=()=>ei("local"),ea=()=>z.length?c.jsx("div",{className:"session-list",children:y0(z).map(v=>c.jsxs(An.Fragment,{children:[c.jsx("div",{className:"session-group-label",children:v.host}),v.forwards.map(k=>c.jsxs("div",{className:`session-row forward-row ${k.status==="idle"?"session-ghosted":""}`,children:[c.jsx("span",{className:`status-dot ${C0(k)}`}),c.jsx("button",{type:"button",className:"forward-open",onClick:()=>k.status==="idle"||k.status==="error"?void Os(k):void 0,title:k.status==="idle"||k.status==="error"?`Reconnect ${xn(k)}`:mp(k),children:c.jsxs("span",{className:"session-copy",children:[c.jsx("b",{children:xn(k)}),c.jsxs("small",{children:[k.direction==="local"?"←":"→"," ",k.destinationHost||"localhost",":",k.destinationPort,k.status==="connecting"?" · connecting…":"",k.status==="idle"?" · not connected":"",k.status==="error"?` · ${k.message??"failed"}`:""]})]})}),w0(k)&&c.jsx("span",{className:"forward-badge",title:"Reachable from your network, not just this machine",children:"LAN"}),c.jsx("button",{type:"button",className:"forward-close",onClick:()=>{ln(k)},title:`Stop sharing ${xn(k)}`,"aria-label":`Stop sharing ${xn(k)}`,children:"×"})]},k.id))]},v.host))}):c.jsx("div",{className:"session-list",children:c.jsxs("div",{className:"session-empty",children:[c.jsx("b",{children:"No shared ports"}),c.jsx("small",{children:"Share a port to reach a service on a remote host from this machine, or the other way round."}),c.jsx("button",{type:"button",onClick:Ja,children:"Share a port"})]})}),Ps=()=>{const v=cs((rt?.kind==="ssh"?rt.host:"")||(mi?A.find(Ae=>Ae.id===mi)?.host:"")||""),k=v?Rs.filter(Ae=>cs(Ae.connection.hostName??"")===v||Ae.connection.alias===v).reduce((Ae,xe)=>{const et=xe.connection.hostName||xe.connection.alias;return(Ae[et]=Ae[et]||[]).push(xe),Ae},{}):{},K=A.filter(Ae=>Ae.persistence==="screen"&&!yt.some(xe=>xe.id===Ae.id)),Q=Object.keys(k).length>0,me=K.length>0;if(!Q&&!me)return c.jsxs("div",{className:"session-empty",children:[c.jsx("b",{children:"No screens"}),c.jsx("small",{children:v?"No remote screens found for this host.":"Open a remote session to discover screens, or start a local screen."})]});const ye=[];if(Q)for(const[Ae,xe]of Object.entries(k)){const et=xe,ot=c.jsx("div",{className:"session-group-label",children:Ae},`${Ae}-label`),ti=et.map(({session:Nt})=>{const Gi=et.find(Ht=>Ht.session.id===Nt.id)?.connection;return c.jsx(wc,{session:Nt,ghosted:!0,onClick:async()=>{if(!Gi)return;p(`Attaching ${Nt.name}…`);const Ht=Ee();if(Ht)try{const Cr=(await Ht.buildRemoteScreenAttach?.(Gi,Nt.screenName??Nt.name))?.args,la=Array.isArray(Cr)?Cr.indexOf("--"):-1,Rl=la>0?Cr[la-1]:Gi.hostName??Gi.alias,ki={...await Ht.createSshSession({target:Rl,name:Nt.name}),screenName:Nt.screenName??Nt.name,persistence:"screen",backend:"screen"};N(ha=>ha.some(ns=>ns.id===ki.id)?ha.map(ns=>ns.id===ki.id?ki:ns):[...ha,ki]),Di(ki),await $i(ki),await Ht.attachSession(ki.id);const ca=Cr&&la>0?Cr.slice(la+1).join(" "):`screen -x ${Nt.screenName??Nt.name}`;await Wn(Ht,ki.id),Ht.write(ki.id,`${ca}\r`),await _s(),p(`Connected to ${Nt.name}`)}catch(oa){p(oa instanceof Error?oa.message:String(oa))}}},Nt.id)});ye.push(ot,...ti)}return me&&!Q&&(ye.push(c.jsx("div",{className:"session-group-label",children:"local"},"local-label")),K.forEach(Ae=>{ye.push(c.jsx(wc,{session:Ae,ghosted:!0,onClick:()=>{Di(Ae),$i(Ae),p(`Reconnecting to ${Ae.name}…`)}},Ae.id))})),c.jsx(c.Fragment,{children:ye})},oo=bt==="split-v"?"pane-grid split-v":bt==="split-h"?"pane-grid split-h":bt==="grid"?"pane-grid grid":"pane-grid",lo=!qt&&(bt==="split-v"||bt==="grid"),ta=!qt&&(bt==="split-h"||bt==="grid"),ms=n.sessions.splitColumnRatio,jt=n.sessions.splitRowRatio,$s=Z.useRef(null),vr=qt?void 0:{...lo?{gridTemplateColumns:`${ms}fr ${1-ms}fr`}:{},...ta?{gridTemplateRows:`${jt}fr ${1-jt}fr`}:{}},hn=(v,k)=>{const K=$s.current?.getBoundingClientRect();if(!K)return;const Q=v==="column"?(k.clientX-K.left)/K.width:(k.clientY-K.top)/K.height;Number.isFinite(Q)&&Wa("sessions",v==="column"?{splitColumnRatio:Q}:{splitRowRatio:Q})},Sr=(v,k)=>{const Q=(v==="column"?ms:jt)+k*.02;oi("sessions",v==="column"?{splitColumnRatio:Q}:{splitRowRatio:Q})},hi=v=>{oi("sessions",v==="column"?{splitColumnRatio:ze.sessions.splitColumnRatio}:{splitRowRatio:ze.sessions.splitRowRatio})},Vt={layout:bt,maximized:!!qt,columnRatio:ms,rowRatio:jt,sessionCount:yt.length,lastSplit:Pi.lastSplit},ts=Z.useRef(null),Fi=v=>{const k=ts.current?.getBoundingClientRect();k&&Wa("sessions",{sidebarWidth:Math.round(v.clientX-k.left)})},Wi=v=>{Jt(k=>({focusedSessionId:v,maximizedSessionId:k.maximizedSessionId===v?null:v}))},qi=v=>{if(v.kind==="restore"){ks(null);return}if(v.kind==="show"){ks(null),nn(v.layout);return}if(v.kind==="reset-splits"){oi("sessions",v.ratios);return}const k=mi??rt?.id??yt[0]?.id;k&&ks(k)},co=v=>{if(!qt||yt.length<2)return;const K=(yt.findIndex(me=>me.id===qt)+v+yt.length)%yt.length,Q=yt[K];ur(Q.id),Ds(Q),ks(Q.id)},ia=()=>(At.current??=new WS({createWorker:()=>new Worker(new URL(""+new URL("voice-worker-DoNT0zEM.js",import.meta.url).href,import.meta.url),{type:"module"}),resolveApiKey:async()=>Xr.current??await window.zerog?.readSpeechApiKey()??null}),At.current),ho=async v=>{const k=Ee();if(k?.saveSpeechApiKey){Bt(K=>({...K,status:"saving",error:null,notice:null}));try{const K=await k.saveSpeechApiKey(v);Xr.current=null,Bt({status:"idle",stored:K.stored,encryptionAvailable:K.encryptionAvailable,sessionOnly:!1,notice:K.stored?"Key saved, encrypted by this system.":"Key cleared."})}catch(K){Xr.current=v,Bt(Q=>({...Q,status:"idle",stored:!1,encryptionAvailable:!1,sessionOnly:!0,notice:"Kept for this session only — it could not be stored safely, so it is gone when ZeroG closes.",error:null})),p(K instanceof Error?K.message:String(K))}}},xl=async()=>{const v=Ee();if(Xr.current=null,!v?.clearSpeechApiKey){Bt(k=>({...k,stored:!1,sessionOnly:!1,notice:"Key cleared.",error:null}));return}try{const k=await v.clearSpeechApiKey();Bt(K=>({...K,status:"idle",stored:k.stored,sessionOnly:!1,notice:"Key cleared.",error:null}))}catch(k){Bt(K=>({...K,status:"idle",sessionOnly:!1,error:k instanceof Error?k.message:String(k)}))}},$t=async v=>{const k=Ee();if(k?.saveAiApiKey){hs(K=>({...K,status:"saving",error:null,notice:null}));try{const K=await k.saveAiApiKey(v);hs({status:"idle",stored:K.stored,encryptionAvailable:K.encryptionAvailable,sessionOnly:!1,notice:K.stored?"Key saved, encrypted by this system.":"Key cleared."})}catch(K){hs(Q=>({...Q,status:"idle",error:si(K)}))}}},mt=async()=>{const v=Ee();if(v?.clearAiApiKey)try{const k=await v.clearAiApiKey();hs(K=>({...K,status:"idle",stored:k.stored,notice:"Key cleared.",error:null}))}catch(k){hs(K=>({...K,status:"idle",error:si(k)}))}},Ye=v=>{if(v.kind==="notice"){p(v.message);return}v.progress!==null&&p(`Loading speech model… ${Math.round(v.progress)}%`)},gs=()=>{const v=us.current;window.clearTimeout(or.current),Li.current?.cancel(),Li.current=null,us.current=null,Ri({status:"idle",sessionId:null}),Pt(v)},Gt=()=>{const v=ni?.sessionId;ar(null),Pt(v)},sa=async()=>{const v=Li.current,k=us.current;if(!v||!k)return;window.clearTimeout(or.current),Li.current=null,Ri({status:"transcribing",sessionId:k}),p("Transcribing…");const K=await v.stop();if(!K||tp(K,n.speech.silenceThreshold)){us.current=null,Ri({status:"idle",sessionId:null}),p("Voice: no speech detected — lower the silence threshold in Settings if this is wrong"),Pt(k);return}try{const Q=await ia().transcribe(K,n.speech,Ye);if(us.current=null,Ri({status:"idle",sessionId:null}),!Q.text){p("Voice: nothing transcribed"),Pt(k);return}if(n.ai.voiceInsert==="review"){ar({sessionId:k,text:Q.text}),p(`Voice: review "${Q.text}"`);return}Ee()?.write(k,Q.text),p(`Voice: "${Q.text}"`),Pt(k)}catch(Q){us.current=null,Ri({status:"idle",sessionId:null}),p(`Voice error: ${Q instanceof Error?Q.message:String(Q)}`),Pt(k)}},vs=async v=>{if(fi.status==="listening"&&fi.sessionId===v.id){await sa();return}if(fi.status!=="idle")return;if(Yr.status!=="idle"){p("The speech test in Settings is using the microphone");return}const k=new ip;try{await k.start()}catch(K){p(`Microphone unavailable: ${K instanceof Error?K.message:String(K)}`);return}Li.current=k,us.current=v.id,Ri({status:"listening",sessionId:v.id}),Pt(v.id),window.clearTimeout(or.current),or.current=window.setTimeout(()=>{sa()},n.speech.maxUtteranceSeconds*1e3),p(`Listening on ${v.name}… click the mic again to transcribe, Esc to discard`)},El=v=>{const k=Ee();if(!k)return;const K=Cp(n.ai);k.write(v.id,`${K}\r`),p(`Sent "${K}" to ${v.name}`),Pt(v.id)},Al=v=>{const k=Ee();if(!k)return;const K=ku(n.ai);k.write(v.id,`${K}\r`),p(`Sent "${K}" to ${v.name}`),Pt(v.id)},br=(v,k)=>{const K=Ee();K&&(K.write(v.id,`${k.command}
149
- `),p(`Sent "${k.command}" to ${v.name}`),Pt(v.id))},is=v=>l.agents.find(k=>k.sessionId===v),ra=v=>{const k=l.links.filter(K=>K.a===v||K.b===v);return k.find(K=>K.status!=="broken")??k[0]},un=async v=>{const k=Ee();if(k)try{await k.launchLinkedAgent(v.id,ku(n.ai)),p(`Started a linked agent in ${v.name}`),Pt(v.id)}catch(K){p(si(K))}},uo=async(v,k)=>{R(null);try{await Ee()?.linkPanes(v.id,k.id),p(`Linked ${v.name} with ${k.name}. Prompt either agent; its reply goes to the other.`)}catch(K){p(si(K))}},Fs=(v,k)=>{Ee()?.relayLastReply(v.id,k).then(()=>p("Relayed the last reply")).catch(K=>p(si(K)))},ss=v=>{Ee()?.unlinkPanes(v.id).then(()=>p("Link removed")).catch(k=>p(si(k)))},Ss=v=>{Ee()?.resumePaneLink(v.id).then(()=>p("Link resumed")).catch(k=>p(si(k)))},rs=v=>{const k=is(v.id),K=ra(v.id),Q=!!(K&&K.status!=="broken"),me=v.kind==="local"&&v.backend!=="wsl",ye=l.agents.filter(xe=>xe.sessionId!==v.id&&!xe.linkId);let Ae=me?`Start a linked agent: runs "${qa}" with ZeroG hooks so its replies can be relayed to another pane`:"Linked agents run in local panes only (not SSH or WSL)";return k&&!Q&&(Ae="Link this agent with another linked agent"),Q&&(Ae="This pane is linked"),c.jsxs("span",{className:"pane-link-wrap",children:[c.jsx("button",{type:"button",className:Q?"pane-link active":k?"pane-link ready":"pane-link",onClick:()=>{k?R(x===v.id?null:v.id):un(v)},disabled:Q||!k&&!me,title:Ae,"aria-label":k?`Link ${v.name} with another agent`:`Start a linked agent in ${v.name}`,"aria-haspopup":k?"menu":void 0,"aria-expanded":k?x===v.id:void 0,children:c.jsx(Oe,{name:"link"})}),x===v.id&&k&&!Q&&c.jsxs("div",{className:"pane-link-menu",role:"menu",children:[ye.length===0&&c.jsx("div",{className:"pane-link-empty",children:"Start a linked agent in another pane first."}),ye.map(xe=>{const et=A.find(ot=>ot.id===xe.sessionId);return c.jsxs("button",{type:"button",role:"menuitem",disabled:!et,onClick:()=>et&&void uo(v,et),children:["Link with ",xe.label]},xe.sessionId)})]})]})},fo=v=>{const k=ra(v.id);if(!k)return null;const K=k.a===v.id?k.b:k.a,Q=A.find(xe=>xe.id===K)?.name??"another pane",me=is(v.id)?.needsAttention,ye=k.waitingOn?A.find(xe=>xe.id===k.waitingOn)?.name??"the other pane":null;let Ae=`Linked with ${Q} · ${k.turns}/${k.cap} relays`;return k.status==="active"&&(Ae+=ye?` · waiting for ${ye} to reply`:" · relays start when either agent finishes a reply"),k.status==="paused"&&(Ae=`Link paused: ${k.reason??"stopped"}`),k.status==="broken"&&(Ae=`Link ended: ${k.reason??"stopped"}`),me&&k.status==="active"&&(Ae+=" · waiting for you"),c.jsxs("div",{className:`pane-link-bar ${k.status}`,role:"status",children:[c.jsx(Oe,{name:"link"}),c.jsx("span",{className:"pane-link-text",children:Ae}),k.status!=="broken"&&!k.waitingOn&&is(v.id)?.hasReply&&c.jsx("button",{type:"button",onClick:()=>Fs(k,v.id),title:"Send this agent's most recent reply to the other pane now",children:"Send last reply"}),k.status==="paused"&&c.jsx("button",{type:"button",onClick:()=>Ss(k),children:"Resume"}),c.jsx("button",{type:"button",onClick:()=>ss(k),children:k.status==="broken"?"Dismiss":"Break link"})]})},na=async()=>{const v=xs.current;if(!v)return;window.clearTimeout(Es.current),xs.current=null,ds({status:"transcribing",message:"Transcribing…",transcript:null,error:null});const k=await v.stop();if(!k){ds({status:"idle",error:"Nothing was recorded."});return}const K=Wp(k),Q=tp(k,n.speech.silenceThreshold);try{const me=await ia().transcribe(k,n.speech,ye=>{ds(Ae=>({...Ae,message:ye.kind==="notice"?ye.message:ye.progress!==null?`Loading speech model… ${Math.round(ye.progress)}%`:"Loading speech model…"}))});ds({status:"idle",transcript:me.text,elapsedMs:me.elapsedMs,level:K,message:Q?"Below the silence threshold — a real recording at this level would have been discarded.":me.engine==="server"?"Transcribed by the server.":"Transcribed by the built-in engine.",error:null})}catch(me){ds({status:"idle",level:K,error:me instanceof Error?me.message:String(me)})}},yr=async()=>{if(Yr.status==="recording"){await na();return}if(Yr.status==="transcribing")return;if(fi.status!=="idle"){ds({status:"idle",error:"A terminal pane is recording — stop that first."});return}const v=new ip;try{await v.start()}catch(k){ds({status:"idle",error:`Microphone unavailable: ${k instanceof Error?k.message:String(k)}`});return}xs.current=v,ds({status:"recording",message:"Listening… say a command, then stop.",transcript:null,error:null}),window.clearTimeout(Es.current),Es.current=window.setTimeout(()=>{na()},n.speech.maxUtteranceSeconds*1e3)};Z.useEffect(()=>()=>{window.clearTimeout(or.current),window.clearTimeout(Es.current),Li.current?.cancel(),xs.current?.cancel(),At.current?.dispose()},[]);const aa=async v=>{const k=Ue.current.get(v.id);if(k&&!k())return;fi.sessionId===v.id&&gs(),Ls.forget(v.id);const K=yt.filter(me=>me.id!==v.id);P(me=>{const ye=xv(me,v.id);return ap(ye,r,Ae=>({activeSessionId:Ae.activeSessionId??K[0]?.id,focusedSessionId:Ae.focusedSessionId??K[0]?.id,layout:Mu(K.length)}))});const Q=Ee();if(Q)try{await Q.closeSession(v.id)}catch(me){p(me instanceof Error?me.message:String(me));return}p(v.persistence==="screen"?`Closed ${v.name} · screen session survives`:v.kind==="ssh"?`Closed ${v.name} · SSH connection ended`:`Closed ${v.name} · process ended`),_s()};return c.jsxs("main",{className:`app-shell ${T?"drawer-collapsed":""}`,children:[c.jsxs("header",{className:"window-bar",children:[c.jsxs("div",{className:"window-brand",title:om(Mi),children:[c.jsx("span",{className:"brand-mark",children:"ZG"}),c.jsx("span",{className:"brand-name",children:"ZeroG"}),Mi&&c.jsx("span",{className:"brand-version",children:Mi})]}),c.jsx("div",{className:"workspace-tabs",children:G.map((v,k)=>{const K=G.length>1,Q=Mv(v,A);return c.jsxs("span",{className:`workspace-tab-slot ${K?"closable":""} ${Kc===v.id?"dragging":""}`,"data-workspace-id":v.id,children:[c.jsxs("button",{type:"button",className:`workspace-tab ${v.id===ct?.id?"active":""}`,title:`Switch to ${v.name}${k<9?` (Ctrl+Shift+${k+1})`:""} · drag to reorder`,onPointerDown:me=>pr(v,me),onContextMenu:me=>{me.preventDefault(),mr(),so({id:v.id,at:{x:me.clientX,y:me.clientY}})},onPointerMove:no,onPointerUp:Qn,onPointerCancel:mr,onClick:()=>{zs.current||Is(v.id)},children:[c.jsx("span",{className:`status-dot ${Q==="empty"?"":Q}`}),v.name,c.jsx("span",{className:"tab-meta",children:Tu(v)})]}),K&&c.jsx("button",{type:"button",className:"workspace-tab-close",title:`Close ${v.name} · its terminals keep running`,"aria-label":`Close workspace ${v.name}`,onClick:()=>wl(v.id),children:"×"})]},v.id)})}),c.jsxs("div",{className:"window-actions",children:[m.state==="connected"&&c.jsxs("button",{type:"button",className:"bar-button mcp-stop-button",onClick:()=>{Ee()?.revokeMcpControl?.(),p("AI control revoked · panes remain available manually")},title:"Stop AI control and take over manually","aria-label":"Stop AI control and take over manually",children:[c.jsx(Oe,{name:"stop"}),c.jsx("span",{children:"Take over"})]}),u.length>0&&c.jsx("span",{className:"mcp-pending-count",title:"Commands waiting for explicit approval",children:u.map(v=>c.jsxs("span",{className:"mcp-pending-request",children:[c.jsx("span",{title:v.displayCommand,children:v.displayCommand}),c.jsx("button",{type:"button",className:"bar-button",onClick:()=>{Ee()?.approveMcpExecution?.(v.requestId)},"aria-label":`Approve command ${v.displayCommand}`,children:"Approve"}),c.jsx("button",{type:"button",className:"bar-button",onClick:()=>{Ee()?.rejectMcpExecution?.(v.requestId)},"aria-label":`Reject command ${v.displayCommand}`,children:"Reject"})]},v.requestId))}),c.jsxs("button",{type:"button",className:"bar-button",onClick:()=>di(v=>!v),title:`Session overview (${xi("toggle-overview",Le)})`,children:[c.jsx(Oe,{name:"grid"}),c.jsx("span",{children:"Overview"})]}),c.jsxs("button",{type:"button",className:"bar-button",onClick:gr,title:`New workspace (${xi("new-workspace",Le)})`,children:[c.jsx(Oe,{name:"plus"}),c.jsx("span",{children:"Workspace"})]}),c.jsxs("button",{type:"button",className:"bar-button",onClick:_r,title:zp(n.ai)?`Ask for a command (${xi("ask-ai",Le)})`:"Set an AI endpoint in Settings first",children:[c.jsx(Oe,{name:"spark"}),c.jsx("span",{children:"Suggest"})]}),c.jsx("button",{type:"button",className:"bar-button theme-button",onClick:()=>oi("appearance",{theme:E==="dark"?"light":"dark"}),title:`Switch to ${E==="dark"?"light":"dark"} theme`,"aria-label":`Switch to ${E==="dark"?"light":"dark"} theme`,"aria-pressed":E==="light",children:c.jsx(Oe,{name:E==="dark"?"sun":"moon"})}),c.jsx("button",{type:"button",className:De?"bar-button active":"bar-button",onClick:()=>Tt(v=>!v),title:`Features and keyboard shortcuts (${xi("toggle-help",Le)})`,"aria-label":"Help","aria-pressed":De,children:c.jsx(Oe,{name:"help"})})]})]}),c.jsxs("div",{className:"body-shell",children:[c.jsxs("nav",{className:"rail","aria-label":"Workspace navigation",children:[c.jsx("button",{type:"button",className:"rail-button",title:`${T?"Show":"Hide"} sessions sidebar (${xi("toggle-sidebar",Le)})`,onClick:()=>y(v=>!v),children:c.jsx(Oe,{name:T?"panel-left-open":"panel-left"})}),c.jsx("button",{type:"button",className:`rail-button ${!T&&U==="sessions"?"active":""}`,title:"Sessions",onClick:()=>{H("sessions"),y(!1)},children:c.jsx(Oe,{name:"sessions"})}),c.jsx("button",{type:"button",className:"rail-button",onClick:()=>di(!0),title:"Overview",children:c.jsx(Oe,{name:"grid"})}),c.jsx("button",{type:"button",className:`rail-button ${!T&&U==="ports"?"active":""}`,title:"Shared ports","aria-label":"Shared ports",onClick:()=>{H("ports"),y(!1)},children:c.jsx(Oe,{name:"ports"})}),c.jsx("span",{className:"rail-spacer"}),c.jsx("button",{type:"button",className:"rail-button",onClick:Ja,title:"Share a port over SSH","aria-label":"Share a port",children:c.jsx(Oe,{name:"port-plus"})}),c.jsx("button",{type:"button",className:"rail-button",onClick:cn,title:`New local terminal (${xi("new-terminal",Le)})`,"aria-label":"New local terminal",children:c.jsx(Oe,{name:"terminal"})}),c.jsx("button",{type:"button",className:"rail-button",onClick:()=>ei("ssh"),title:"Connect SSH",children:c.jsx(Oe,{name:"ssh"})}),c.jsx("button",{type:"button",className:`rail-button ${_i?"active":""}`,title:`Settings (${xi("toggle-settings",Le)})`,"aria-label":"Settings","aria-expanded":_i,onClick:()=>ai(v=>!v),children:c.jsx(Oe,{name:"settings"})})]}),!T&&c.jsxs("aside",{className:"session-drawer",ref:ts,style:{width:n.sessions.sidebarWidth},children:[c.jsxs("div",{className:"drawer-head",children:[c.jsxs("div",{className:"drawer-head-name",children:[c.jsx("span",{className:"eyebrow",children:U==="ports"?"SHARED PORTS":"WORKSPACE"}),U==="ports"?c.jsx("h1",{children:"Ports"}):ws&&ct?c.jsx("input",{className:"workspace-rename",autoFocus:!0,"aria-label":"Workspace name",value:Kr,pattern:Ec,onChange:v=>tr(v.target.value),onBlur:Jn,onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),v.stopPropagation(),Jn()),v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),ri(!1))}}):c.jsx("h1",{onDoubleClick:ci,title:ct?"Double-click to rename this workspace":void 0,children:ct?.name??"Sessions"})]}),c.jsxs("div",{className:"drawer-head-actions",children:[c.jsx("button",{type:"button",className:"square-button",onClick:()=>y(!0),title:"Hide sessions sidebar",children:c.jsx(Oe,{name:"panel-left"})}),c.jsx("button",{type:"button",className:"square-button history-button",onClick:()=>Re(v=>!v),title:"Session history","aria-label":"Open session history","aria-expanded":Be,children:c.jsx(Oe,{name:"history"})}),c.jsx("button",{type:"button",className:"square-button",onClick:gr,title:`New workspace (${xi("new-workspace",Le)})`,"aria-label":"New workspace",children:c.jsx(Oe,{name:"plus"})})]})]}),U==="ports"?ea():c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"drawer-tools",role:"tablist","aria-label":"Session inventory",children:["terminals","screens","connections"].map(v=>{const k={terminals:"Terminals",screens:"Screens",connections:"Connections"},K=v==="terminals"?yt.length:v==="screens"?A.filter(Q=>(Q.persistence==="screen"||Q.screenName)&&!yt.some(me=>me.id===Q.id)).length+Rs.length:A.filter(Q=>Q.kind==="ssh").length;return c.jsxs("button",{type:"button",role:"tab","aria-selected":L===v,className:`drawer-tool ${L===v?"active":""}`,onClick:()=>O(v),children:[k[v]," ",c.jsx("span",{children:K})]},v)})}),c.jsx("div",{className:"session-list",role:"tabpanel",children:je?c.jsxs("div",{className:"session-empty",children:[c.jsx("b",{children:"Loading sessions…"}),c.jsx("small",{children:"Checking available terminals and durable sessions."})]}):wt?c.jsxs("div",{className:"session-empty session-error",children:[c.jsx("b",{children:"Session inventory unavailable"}),c.jsx("small",{children:wt}),c.jsx("button",{type:"button",onClick:()=>{_s()},children:"Retry"})]}):L==="terminals"?yt.length||el.length?c.jsxs(c.Fragment,{children:[yt.map(v=>c.jsx(wc,{session:v,active:rt?.id===v.id,onClick:()=>{$i(v)}},v.id)),el.map(v=>c.jsx(_b,{member:v,onClick:()=>{Qa(v)}},v.sessionId))]}):c.jsxs("div",{className:"session-empty",children:[c.jsx("b",{children:"No terminals yet"}),c.jsx("small",{children:"Add a local terminal or SSH connection to this workspace."})]}):L==="screens"?Ps():L==="connections"?Ti.length?Ti.map(v=>c.jsx(pb,{connection:v,onConfigure:()=>ei("ssh",{sshTarget:v.hostName??v.alias}),onConnect:()=>fl(v)},v.alias)):c.jsxs("div",{className:"session-empty",children:[c.jsx("b",{children:"No saved connections"}),c.jsx("small",{children:"Add Host entries to ~/.ssh/config to populate connections."})]}):A.filter(v=>v.kind==="ssh"&&v.scope==="remote"&&v.source==="discovered").length?A.filter(v=>v.kind==="ssh"&&v.scope==="remote"&&v.source==="discovered").map(v=>c.jsx(wc,{session:v,ghosted:!0,onClick:async()=>{p(`Attaching remote screen ${v.name}…`);const k=Ee();if(k)try{const Q=(await k.buildRemoteScreenAttach?.({alias:v.host,hostName:v.host},v.screenName??v.name))?.args?.find(ye=>ye.includes("@")||!ye.startsWith("-"))??v.host,me=await k.createSshSession({target:Q,name:v.name});N(ye=>ye.map(Ae=>Ae.id===v.id?me:Ae)),Di(me),await $i(me)}catch(K){p(K instanceof Error?K.message:String(K))}}},v.id)):c.jsxs("div",{className:"session-empty",children:[c.jsx("b",{children:"No remote screens"}),c.jsx("small",{children:"Remote screen sessions will appear here after discovery."})]})})]}),c.jsxs("div",{className:"drawer-bottom",children:[c.jsxs("button",{type:"button",className:"drawer-action",onClick:Ja,children:[c.jsx(Oe,{name:"port-plus"})," Share port"]}),c.jsxs("button",{type:"button",className:"drawer-action",onClick:cn,children:[c.jsx(Oe,{name:"plus"})," Local terminal ",c.jsx("kbd",{children:"⌘⇧T"})]}),c.jsxs("button",{type:"button",className:"drawer-action",onClick:()=>ei("ssh"),children:[c.jsx(Oe,{name:"ssh"})," Connect SSH"]}),c.jsxs("div",{className:"drawer-status",children:[c.jsx("span",{className:"status-dot connected"}),g]})]})]}),!T&&c.jsx(Ac,{orientation:"vertical",className:"sidebar-resizer",label:"Sidebar width",valuePercent:n.sessions.sidebarWidth/Et.sidebarWidth.max*100,onDrag:Fi,onCommit:()=>oi("sessions",{sidebarWidth:n.sessions.sidebarWidth}),onNudge:v=>oi("sessions",{sidebarWidth:n.sessions.sidebarWidth+v*16}),onReset:()=>oi("sessions",{sidebarWidth:ze.sessions.sidebarWidth})}),c.jsxs("section",{className:"workspace",children:[c.jsxs("div",{className:"workspace-head",children:[c.jsxs("div",{className:"location",children:[T&&c.jsx("button",{type:"button",className:"inline-restore",onClick:()=>y(!1),title:"Show sessions sidebar",children:c.jsx(Oe,{name:"panel-left-open"})}),c.jsx("span",{className:"connection-dot"}),c.jsx("span",{children:rt?.host??"local"}),c.jsx("span",{className:"slash",children:"/"}),c.jsx("span",{children:rt?.cwd??"~"}),c.jsx("span",{className:"slash",children:"/"}),c.jsx("span",{className:"muted-text",children:rt?.name??ct?.name??"no session"})]}),c.jsxs("div",{className:"head-controls",children:[c.jsxs("div",{className:"layout-controls",children:[c.jsx("span",{className:"control-label",children:"SFTP"}),c.jsx("button",{type:"button",className:lr?"layout-button active":"layout-button",onClick:()=>cr(v=>!v),disabled:!rl.available||!Ee()?.sftpOpen,title:rl.reason,"aria-label":"Transfer files over SFTP",children:c.jsx(Oe,{name:"transfer"})})]}),c.jsxs("div",{className:"layout-controls",children:[c.jsx("span",{className:"control-label",children:"LAYOUT"}),c.jsx("button",{type:"button",className:bt==="stack"||qt?"layout-button active":"layout-button",onClick:()=>qi(wm(Vt)),title:`${FS(Vt)} (${xi("toggle-layout",Le)})`,children:c.jsx(Oe,{name:"stack"})}),US.map(({layout:v,icon:k})=>c.jsx("button",{type:"button",className:bt===v&&!qt?"layout-button active":"layout-button",onClick:()=>qi(PS(v,Vt)),title:$S(v,Vt),children:c.jsx(Oe,{name:k})},v))]})]})]}),c.jsxs("div",{className:`${oo} ${qt?"maximized-pane-grid":""}`,ref:$s,style:vr,children:[lo&&c.jsx(Ac,{orientation:"vertical",className:"pane-resizer pane-resizer-column",label:"Pane column split",valuePercent:ms*100,style:{left:`calc((100% - 1px) * ${ms} + 0.5px)`},onDrag:v=>hn("column",v),onCommit:()=>oi("sessions",{splitColumnRatio:ms}),onNudge:v=>Sr("column",v),onReset:()=>hi("column")}),ta&&c.jsx(Ac,{orientation:"horizontal",className:"pane-resizer pane-resizer-row",label:"Pane row split",valuePercent:jt*100,style:{top:`calc((100% - 1px) * ${jt} + 0.5px)`},onDrag:v=>hn("row",v),onCommit:()=>oi("sessions",{splitRowRatio:jt}),onNudge:v=>Sr("row",v),onReset:()=>hi("row")}),Ka.map(({session:v,index:k,dormant:K})=>{const Q=fi.sessionId===v.id&&fi.status!=="idle"?fi.status:null,me=ps?.indexOf(v.id)??-1,ye=fp(v),Ae=!!ye&&Vn(v.id),xe=Ae?to(v):null;return c.jsxs("article",{className:`pane terminal-pane ${K?"dormant-pane":""} ${!K&&mi===v.id?"focused":""} ${!K&&qt===v.id?"maximized-pane":""} ${K||hl(v,k)?"":"overflow-pane"}`,style:me>=0?{order:me}:void 0,onMouseDown:()=>ur(v.id),children:[c.jsxs("div",{className:"pane-title",children:[c.jsxs("span",{children:[c.jsx("span",{className:"pane-live"})," ",v.name]}),c.jsxs("span",{className:"pane-actions",children:[qt&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"pane-nav",onClick:()=>co(-1),title:"Previous session",children:c.jsx(Oe,{name:"chevron-left"})}),c.jsx("button",{type:"button",className:"pane-nav",onClick:()=>co(1),title:"Next session",children:c.jsx(Oe,{name:"chevron-right"})})]}),ps&&!qt&&MS(Xa,Dc)&&!K&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"pane-nav",onClick:()=>Za(v.id,-1),title:"Show the previous pane here","aria-label":`Show the previous pane in place of ${v.name}`,children:c.jsx(Oe,{name:"chevron-left"})}),c.jsx("button",{type:"button",className:"pane-nav",onClick:()=>Za(v.id,1),title:"Show the next pane here","aria-label":`Show the next pane in place of ${v.name}`,children:c.jsx(Oe,{name:"chevron-right"})})]}),M?"connecting…":Q?`${Q}…`:v.kind==="ssh"?"ssh":"bash",c.jsx("button",{type:"button",className:Ae?"pane-browse active":"pane-browse",onClick:()=>Yn(v.id),disabled:!ye||Mt[v.id]==="docked",title:Mt[v.id]==="docked"?"The editor is docked here; close it to browse directories":ye?Ae?"Hide the directory browser":"Browse directories":"ZeroG cannot tell what kind of paths this pane uses","aria-label":`${Ae?"Hide":"Show"} the directory browser for ${v.name}`,"aria-pressed":Ae,children:c.jsx(Oe,{name:"folder"})}),c.jsx("button",{type:"button",className:"pane-proceed",onClick:()=>El(v),title:`Send "${il}" and press Enter`,"aria-label":`Send "${il}" to ${v.name}`,children:c.jsx(Oe,{name:"check"})}),c.jsx("button",{type:"button",className:"pane-ai",onClick:()=>Al(v),title:`Run "${qa}" and press Enter`,"aria-label":`Run "${qa}" in ${v.name}`,children:c.jsx(Oe,{name:"bot"})}),c.jsx("button",{type:"button",className:"pane-edit",onClick:()=>an(v),disabled:!ye,title:ye?v.kind==="ssh"?`Edit a file on ${v.host}`:"Edit a file":"ZeroG cannot tell what kind of paths this pane uses","aria-label":`Edit a file from ${v.name}`,children:c.jsx(Oe,{name:"file"})}),rs(v),sl.map(et=>c.jsx("button",{type:"button",className:"pane-custom",onClick:()=>br(v,et),title:BS(et),"aria-label":`${OS(et)}: send "${et.command}" to ${v.name}`,children:et.slot},et.slot)),c.jsx("button",{type:"button",className:Q?`pane-mic ${Q}`:"pane-mic",onClick:()=>{vs(v)},disabled:fi.status!=="idle"&&!Q,title:Q==="listening"?"Stop and transcribe":Q==="transcribing"?"Transcribing…":"Voice input","aria-label":Q==="listening"?`Stop recording ${v.name}`:`Voice input for ${v.name}`,children:c.jsx(Oe,{name:"mic"})}),c.jsx("button",{type:"button",className:"pane-maximize",onClick:()=>Wi(v.id),title:qt?"Restore pane":"Maximize pane",children:c.jsx(Oe,{name:qt?"restore":"maximize"})}),c.jsx("button",{type:"button",className:"pane-close",onClick:()=>{aa(v)},title:"Close pane","aria-label":`Close ${v.name}`,children:c.jsx(Oe,{name:"x"})})]})]}),fo(v),c.jsx(Cb,{open:Ae||Mt[v.id]==="docked",dock:Mt[v.id]==="docked"?ll(v.id):null,ratio:Bs(v.id),onRatio:et=>js(v.id,{ratio:et}),browser:ye?c.jsx(tm,{session:v,path:xe,unanchored:v.kind==="ssh",pathKind:ye,shellPath:xe?Du(v,xe):null,list:Ua(v),question:v.kind==="ssh"?In:null,onOpen:et=>bl(v,et),onBrowse:et=>Ji(ot=>({...ot,[v.id]:et})),defaultShowHidden:n.sessions.showHiddenFiles,onClose:()=>Yn(v.id)}):null,children:c.jsx(yb,{sessionId:v.id,focused:!K&&mi===v.id,dormant:K,onStatus:p,appearance:n.appearance,terminalSettings:n.terminal,registerFocus:Hc,registerCapture:Un,onCommand:Wc,registerRead:Ha})})]},v.id)}),Array.from({length:Math.max(0,Ic-es.length)},(v,k)=>c.jsx(wb,{index:es.length+k+1,onCreate:cn},`placeholder-${k}`))]}),c.jsxs("footer",{className:"status-bar",children:[c.jsx("span",{children:"ZeroG"}),c.jsx("span",{className:"status-separator"}),c.jsx("span",{children:ct?.name??"Workspace"}),c.jsx("span",{className:"status-separator"}),c.jsx("span",{children:qt?"maximized pane":bt==="stack"?"1 pane":`${Ga} panes`}),c.jsx("span",{className:"status-separator"}),c.jsx("span",{children:"Esc closes overlays · ⌘⇧B sidebar"}),c.jsx("span",{className:"status-spacer"}),c.jsx("span",{children:rt?`${rt.kind==="ssh"?"SSH":rt.persistence==="process"?"PROCESS":"SCREEN"} · ${rt.persistence==="process"?"non-persistent":"persistent"}`:"no connection"})]})]})]}),Zn&&(()=>{const v=G.find(k=>k.id===Zn.id);return v?c.jsx(XS,{at:Zn.at,label:`${v.name} options`,items:ao(v),onClose:()=>so(null)}):null})(),De&&c.jsx(d0,{version:Mi,bindings:Le,onClose:()=>Tt(!1)}),Object.entries(Mt).map(([v,k])=>{const K=A.find(me=>me.id===v),Q=K?fp(K):null;return!K||!Q||!Ee()?null:c.jsx(AS,{session:K,mode:k,dock:de[v]??null,onModeChange:me=>$c(v,me),startPath:to(K),pathKind:Q,shellPathFor:me=>Du(K,me)??me,list:Ua(K),unanchored:K.kind==="ssh",question:K.kind==="ssh"?In:null,backend:Va(K),register:me=>cl(v,me),onClose:()=>al(v)},v)}),Gr&&c.jsx("div",{className:"overview-layer",role:"presentation",...Pn,children:c.jsxs("section",{className:"overview",children:[c.jsxs("div",{className:"overview-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:"WORKSPACE OVERVIEW"}),c.jsx("h2",{children:ct?.name??"Choose a session"})]}),c.jsx("button",{type:"button",className:"close-button",onClick:()=>di(!1),children:"Esc"})]}),c.jsx("div",{className:"thumbnail-grid",children:yt.length?yt.map(v=>c.jsxs("button",{type:"button",className:`thumbnail ${rt?.id===v.id?"active":""}`,onClick:()=>{$i(v)},children:[c.jsxs("div",{className:"thumbnail-preview",children:[c.jsx("span",{className:"thumbnail-line cyan"}),c.jsx("span",{className:"thumbnail-line short"}),c.jsx("span",{className:"thumbnail-line green"}),c.jsx("span",{className:"thumbnail-cursor"})]}),c.jsxs("div",{className:"thumbnail-label",children:[c.jsx("b",{children:v.name}),c.jsxs("small",{children:[v.kind==="ssh"?v.host:"local screen"," · ",v.status]})]})]},v.id)):c.jsxs("div",{className:"overview-empty",children:[c.jsx("span",{children:"▦"}),c.jsx("b",{children:"No terminals in this workspace"}),c.jsx("small",{children:"Create a local terminal or connect over SSH."})]})}),c.jsxs("div",{className:"overview-foot",children:[c.jsx("button",{type:"button",onClick:()=>{di(!1),cn()},children:"+ Local terminal"}),c.jsx("button",{type:"button",onClick:()=>{di(!1),ei("ssh")},children:"Connect SSH"}),c.jsx("button",{type:"button",onClick:()=>{di(!1),gr()},children:"+ Workspace"}),c.jsx("span",{className:"overview-hint",children:"Press Esc to close"})]})]})}),Ge&&c.jsx("div",{className:"palette-layer",role:"presentation",...zc,children:c.jsxs("div",{className:"palette",role:"dialog","aria-label":"Command history",children:[c.jsx("input",{autoFocus:!0,className:"palette-query",value:Pe,placeholder:"Search commands you have run","aria-label":"Search commands you have run",onChange:v=>{lt(v.target.value),vt(0)},onKeyDown:v=>{if(v.key==="ArrowDown")v.preventDefault(),vt(k=>Math.min(k+1,Math.max(0,qn.length-1)));else if(v.key==="ArrowUp")v.preventDefault(),vt(k=>Math.max(0,k-1));else if(v.key==="Enter"){v.preventDefault();const k=qn[dt];k&&pl(k)}}}),n.ai.recordCommands?ke.length?qn.length?c.jsx("div",{className:"palette-list",children:qn.map((v,k)=>c.jsxs("button",{type:"button",className:`palette-row ${k===dt?"active":""}`,onMouseEnter:()=>vt(k),onClick:()=>pl(v),children:[c.jsx("span",{className:"palette-command",children:Eb(v.entry.command,v.matched)}),c.jsxs("span",{className:"palette-meta",children:[v.entry.exitCode!==void 0&&v.entry.exitCode!==0?c.jsx("span",{className:"palette-failed",title:`Exited ${v.entry.exitCode}`,children:"failed"}):null,v.entry.cwd?c.jsx("span",{className:"palette-cwd",children:v.entry.cwd}):null]})]},v.entry.id))}):c.jsxs("div",{className:"palette-empty",children:[c.jsx("b",{children:"No match"}),c.jsxs("small",{children:[ke.length," commands remembered, none matching that."]})]}):c.jsxs("div",{className:"palette-empty",children:[c.jsx("b",{children:"Nothing remembered yet"}),c.jsx("small",{children:"Commands are recorded from panes whose shell reports prompt marks. Settings has a snippet to paste into your shell — and onto a remote host, where it has to be installed there."}),c.jsx("button",{type:"button",onClick:()=>{tt(!1),ai(!0)},children:"Open settings"})]}):c.jsxs("div",{className:"palette-empty",children:[c.jsx("b",{children:"Commands are not being remembered"}),c.jsx("small",{children:"Turn on “Remember commands” in Settings under AI & voice. Nothing about what you type is stored until you do."}),c.jsx("button",{type:"button",onClick:()=>{tt(!1),ai(!0)},children:"Open settings"})]}),c.jsx("small",{className:"palette-note",children:"Enter puts the command on the prompt without running it. ↑↓ to choose, Esc to close."})]})}),Be&&c.jsx("div",{className:"history-layer",role:"presentation",...sn,children:c.jsxs("div",{className:"history-popover",role:"dialog","aria-label":"Session history",children:[c.jsxs("div",{className:"history-head",children:[c.jsx("b",{children:"History"}),c.jsx("button",{type:"button",onClick:()=>Re(!1),"aria-label":"Close history",children:"×"})]}),Hn.length?Hn.slice().sort((v,k)=>k.timestamp.localeCompare(v.timestamp)).map(v=>c.jsxs("button",{type:"button",className:"history-item",onClick:async()=>{Re(!1);const k=Lu(v.session,A,Ti);O(v.session.screenName||v.session.backend==="screen"?"screens":"terminals");const K=await Fn(k);K&&p(`Reconnected ${K.name}`)},children:[c.jsxs("span",{className:"history-main",children:[c.jsx("span",{className:"history-kind",children:v.event.toUpperCase()}),c.jsxs("span",{className:"history-text",children:[c.jsx("b",{children:v.session.name}),c.jsxs("small",{children:[v.session.host," · ",v.available?"available":"unavailable"]})]})]}),c.jsx("button",{type:"button",className:"history-remove","aria-label":"Remove history entry",onClick:k=>{k.stopPropagation(),Ee()?.removeHistory(v.id).then(()=>Qi(K=>K.filter(Q=>Q.id!==v.id))).catch(()=>{})},children:"×"})]},v.id)):c.jsx("p",{className:"history-empty",children:"No history entries yet."}),c.jsx("small",{className:"history-note",children:"Persisted session lifecycle from the main process."})]})}),$e&&c.jsx("div",{className:"modal-layer",role:"presentation",...Qt,children:c.jsxs("form",{className:"modal-card",onSubmit:$e==="workspace"?on:$e==="rename"?Cl:$e==="forward"?eo:$e==="local"?Fc:ul,children:[c.jsxs("div",{className:"modal-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:Bu($e).eyebrow}),c.jsx("h2",{children:Bu($e).title})]}),c.jsx("button",{type:"button",className:"close-button",onClick:()=>St(null),children:"Esc"})]}),Op($e)&&c.jsx("div",{className:"dialog-tabs",role:"tablist","aria-label":"Session type",children:wn.map(v=>c.jsxs("button",{type:"button",id:`session-tab-${v.kind}`,role:"tab","aria-selected":$e===v.kind,"aria-controls":"session-dialog-panel",tabIndex:$e===v.kind?0:-1,disabled:M,className:`dialog-tab ${$e===v.kind?"active":""}`,onClick:()=>St(v.kind),onKeyDown:k=>{const K=zS(v.kind,k.key);K&&(k.preventDefault(),St(K),document.getElementById(`session-tab-${K}`)?.focus())},children:[c.jsx("b",{children:v.label}),c.jsx("small",{children:v.hint})]},v.kind))}),$e==="rename"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"Rename this workspace. Its panes, layout and shortcuts position are unaffected."}),c.jsxs("label",{children:["Workspace name",c.jsx("input",{autoFocus:!0,value:Ei,pattern:Ec,onChange:v=>Ai(v.target.value)})]})]}),$e==="workspace"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"Create a separate workspace for a project or host group. Terminals stay scoped to the active workspace."}),c.jsxs("label",{children:["Workspace name",c.jsx("input",{autoFocus:!0,value:Ei,onChange:v=>Ai(v.target.value),pattern:Ec,required:!0})]})]}),$e==="forward"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"Reach a port on a remote host from this machine, over SSH. The tunnel is its own connection, so the host does not need a terminal open."}),c.jsxs("label",{children:["SSH host",c.jsx("input",{autoFocus:!0,list:"forward-hosts",value:j,onChange:v=>W(v.target.value),placeholder:"user@server",required:!0}),c.jsx("datalist",{id:"forward-hosts",children:Gn.map(v=>c.jsx("option",{value:v},v))})]}),c.jsxs("label",{children:["Port",c.jsx("input",{value:he,onChange:v=>ge(v.target.value),inputMode:"numeric",pattern:"[0-9]{1,5}",placeholder:"3000",required:!0})]}),c.jsx("button",{type:"button",className:"dialog-disclosure",onClick:()=>we(v=>!v),"aria-expanded":Ce,children:Ce?"Fewer options":"More options"}),Ce&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Direction",c.jsxs("select",{value:B,onChange:v=>F(v.target.value),children:[c.jsx("option",{value:"local",children:"Remote port, reachable here"}),c.jsx("option",{value:"remote",children:"Port here, reachable on the remote"})]})]}),c.jsxs("label",{children:["Forward to ",c.jsx("span",{className:"muted-text",children:"optional"}),c.jsx("input",{value:re,onChange:v=>_e(v.target.value),placeholder:"localhost"})]}),c.jsxs("label",{children:["Port on that side ",c.jsx("span",{className:"muted-text",children:"defaults to the same"}),c.jsx("input",{value:J,onChange:v=>q(v.target.value),inputMode:"numeric",pattern:"[0-9]{1,5}",placeholder:he||"3000"})]}),c.jsxs("label",{className:"dialog-check",children:[c.jsx("input",{type:"checkbox",checked:te==="all",onChange:v=>ie(v.target.checked?"all":"loopback")}),"Share on my network, not just this machine"]}),te==="all"&&c.jsxs("p",{className:"dialog-warning",children:["Anything on the network this machine is attached to will be able to reach",B==="local"?" the remote service":" the service running here","."]})]})]}),Op($e)&&c.jsxs("div",{id:"session-dialog-panel",role:"tabpanel","aria-labelledby":`session-tab-${$e}`,children:[$e==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("p",{children:["Start a local session inside “",ct?.name??"this workspace","”."]}),c.jsxs("label",{children:["Terminal name",c.jsx("input",{autoFocus:!0,value:Vo,onChange:v=>ka(v.target.value),pattern:"[A-Za-z0-9](?:[A-Za-z0-9_.]|-){0,48}",required:!0})]}),c.jsxs("label",{children:["Shell backend",c.jsx("select",{value:As,onChange:v=>{const k=v.target.value;Zr(k)},children:Bn.length?Bn.map(v=>c.jsx("option",{value:v.backend,children:v.label},v.backend)):c.jsx("option",{value:"bash",children:"bash"})})]}),As==="wsl"&&c.jsxs("label",{children:["WSL distribution",c.jsx("input",{value:Zo,onChange:v=>Zt(v.target.value),placeholder:"Ubuntu"})]})]}),$e==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("p",{children:["Connect a remote host into “",ct?.name??"this workspace","”."]}),c.jsxs("label",{children:["SSH target",c.jsx("input",{autoFocus:!0,value:On,onChange:v=>dl(v.target.value),placeholder:"user@server:22",required:!0})]}),c.jsxs("label",{children:["Session label ",c.jsx("span",{className:"muted-text",children:"optional"}),c.jsx("input",{value:Tn,onChange:v=>{kn.current=!0,Mn(v.target.value)},placeholder:"server"})]})]})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>St(null),children:"Cancel"}),c.jsx("button",{className:"primary-button",disabled:M,type:"submit",children:M?"Working…":Bu($e).submit})]})]})}),lr&&rt&&$n&&Ee()&&c.jsx(R0,{session:rt,target:$n,api:Ee(),onClose:()=>cr(!1),backdrop:rn,defaultShowHidden:n.sessions.showHiddenFiles},rt.id),_i&&c.jsx(vS,{settings:n,onChange:oi,onReset:Uc,onClose:()=>ai(!1),backdrop:$a,backends:Bn,wslDistributions:Oa,speechTest:Yr,onSpeechTest:()=>{yr()},speechKey:Zi,onSpeechKeySave:v=>{ho(v)},onSpeechKeyClear:()=>{xl()},commandHistory:qc,onCopySnippet:v=>{Ee()?.copyText?.(v).then(()=>p("Shell integration snippet copied.")).catch(()=>{})},onClearCommandHistory:()=>{li()},aiKey:rr,onAiKeySave:v=>{$t(v)},onAiKeyClear:()=>{mt()},aiModels:jc,onAiModelsRefresh:()=>{vl()},aiTest:Xo,onAiTest:()=>{Sl()},mcpStatus:m,mcpInfo:h,onMcpStart:()=>{Ee()?.startMcp?.().then(v=>{b(v),p("MCP enabled")}).catch(v=>p(si(v)))},onMcpStop:()=>{Ee()?.stopMcp?.().then(()=>{b(null),p("MCP disabled")}).catch(v=>p(si(v)))},onMcpCopyToken:()=>{h&&Ee()?.copyText?.(h.token).then(()=>p("MCP bearer token copied."))}}),ni&&c.jsx("div",{className:"modal-layer",role:"presentation",...Fa,children:c.jsxs("div",{className:"modal-card approval-card",children:[c.jsxs("div",{className:"modal-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:"VOICE"}),c.jsx("h2",{children:"Insert transcript?"})]}),c.jsx("button",{type:"button",className:"close-button",onClick:()=>Gt(),children:"Esc"})]}),c.jsx("p",{children:"Review mode is on, so nothing has been typed yet. Inserting does not press Enter."}),c.jsx("code",{children:ni.text}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>Gt(),children:"Discard"}),c.jsx("button",{type:"button",className:"primary-button",onClick:()=>{Ee()?.write(ni.sessionId,ni.text),p(`Voice: "${ni.text}"`),Gt()},children:"Insert"})]})]})}),X&&c.jsx("div",{className:"modal-layer",role:"presentation",children:c.jsxs("form",{className:"modal-card approval-card",onSubmit:v=>{v.preventDefault();const k=new FormData(v.currentTarget).get("answer"),K=Ee();I(null),K?.answerForwardPrompt?.(X.forwardId,String(k??"")).catch(Q=>{p(si(Q))})},children:[c.jsx("div",{className:"modal-head",children:c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:"SHARED PORT"}),c.jsx("h2",{children:X.kind==="confirm"?"Accept this host key?":"The host is asking"})]})}),c.jsx("code",{children:X.text}),c.jsxs("label",{children:[X.kind==="confirm"?"Type yes, no, or the fingerprint":"Answer",c.jsx("input",{autoFocus:!0,name:"answer",type:X.kind==="confirm"?"text":"password",autoComplete:"off"})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>{const v=X.forwardId;I(null),Ee()?.closeForward?.(v).catch(()=>{}),Y(k=>k.map(K=>K.id===v?{...K,status:"idle"}:K))},children:"Cancel"}),c.jsx("button",{className:"primary-button",type:"submit",children:"Send"})]})]})}),qe&&c.jsx("div",{className:"modal-layer",role:"presentation",...Ms,children:c.jsxs("div",{className:"modal-card approval-card",children:[c.jsxs("div",{className:"modal-head",children:[c.jsxs("div",{children:[c.jsx("span",{className:qe.phase==="reviewing"?"eyebrow warning-text":"eyebrow",children:qe.phase==="reviewing"?"APPROVAL REQUIRED":"AI SUGGESTION"}),c.jsx("h2",{children:qe.phase==="asking"?"What would you like to do?":qe.phase==="thinking"?"Asking the model…":qe.phase==="failed"?"No suggestion":"Run this command?"})]}),c.jsx("button",{type:"button",className:"close-button",onClick:()=>{Ee()?.cancelAiRequest?.(),at(null)},children:"Esc"})]}),qe.phase==="asking"&&c.jsxs("form",{onSubmit:v=>{v.preventDefault();const k=String(new FormData(v.currentTarget).get("prompt")??"").trim();k&&ml(k)},children:[c.jsxs("p",{children:[n.ai.model," at ",n.ai.baseUrl,"."," ",n.ai.includeOutput?"The last of this pane’s output is sent with your request.":"Only the shell, directory and host are sent."]}),c.jsxs("label",{children:["Request",c.jsx("input",{autoFocus:!0,name:"prompt",placeholder:"fix that error",autoComplete:"off"})]}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>at(null),children:"Cancel"}),c.jsx("button",{className:"primary-button",type:"submit",children:"Ask"})]})]}),qe.phase==="thinking"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:qe.prompt}),c.jsx("p",{className:"muted-text",children:qe.usedOutput?"Sent with recent output from this pane.":"Sent without terminal output."}),c.jsx("div",{className:"modal-actions",children:c.jsx("button",{type:"button",onClick:()=>{Ee()?.cancelAiRequest?.(),at(null)},children:"Cancel"})})]}),qe.phase==="reviewing"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:qe.suggestion.explanation}),qe.suggestion.command?c.jsx("code",{children:qe.suggestion.command}):null,qe.usedOutput?c.jsx("p",{className:"dialog-warning",children:"This was suggested from output in the pane, which can come from a remote host. Read the command before running it."}):null,c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>at(null),children:"Cancel"}),qe.suggestion.command?c.jsx("button",{type:"button",className:"primary-button",onClick:gl,children:"Run"}):c.jsx("button",{type:"button",onClick:()=>at(Nu(qe.sessionId)),children:"Ask again"})]})]}),qe.phase==="failed"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{children:qe.message}),c.jsxs("div",{className:"modal-actions",children:[c.jsx("button",{type:"button",onClick:()=>at(null),children:"Close"}),c.jsx("button",{type:"button",className:"primary-button",onClick:()=>at(Nu(qe.sessionId)),children:"Try again"})]})]})]})})]})}function Eb(n,C){if(!C.length)return n;const E=new Set(C),A=[];let N="",G=E.has(0);for(let P=0;P<n.length;P+=1){const r=E.has(P);r!==G&&N&&(A.push(G?c.jsx("b",{children:N},P):N),N=""),G=r,N+=n.charAt(P)}return N&&A.push(G?c.jsx("b",{children:N},"tail"):N),A}function Pp(n){return n==="light"?{background:"#f7f9fc",foreground:"#253044",cursor:"#16803c",selectionBackground:"#cbdcf5",green:"#16803c",yellow:"#a15c00",red:"#c53030",blue:"#2459a6",cyan:"#087f8c"}:{background:"#0a0c10",foreground:"#d8dee9",cursor:"#9ece6a",selectionBackground:"#334155",green:"#9ece6a",yellow:"#e0af68",red:"#f7768e",blue:"#7aa2f7",cyan:"#7dcfff"}}function Ab(n,C){const E=n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,24)||"term",A=new Set(C.map(G=>G.name.toLowerCase()));if(!A.has(E))return E;let N=2;for(;A.has(`${E}-${N}`);)N+=1;return`${E}-${N}`}Wg.createRoot(document.getElementById("root")).render(c.jsx(xb,{}));