paneful 0.1.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.
- package/README.md +93 -0
- package/dist/server/browser.js +61 -0
- package/dist/server/index.js +297 -0
- package/dist/server/ipc.js +96 -0
- package/dist/server/project-store.js +80 -0
- package/dist/server/pty-manager.js +75 -0
- package/dist/server/ws-handler.js +103 -0
- package/dist/web/assets/index-9zLlqJdm.js +319 -0
- package/dist/web/assets/index-AkfqQMma.js +319 -0
- package/dist/web/assets/index-B0I50Zha.css +32 -0
- package/dist/web/assets/index-BAI_7nK5.js +319 -0
- package/dist/web/assets/index-BB4t5H5c.js +320 -0
- package/dist/web/assets/index-BMmso-J4.js +319 -0
- package/dist/web/assets/index-COBDvRbb.css +32 -0
- package/dist/web/assets/index-CXt9iydD.js +318 -0
- package/dist/web/assets/index-Cmg2EmLe.css +32 -0
- package/dist/web/assets/index-CwfjFhaX.js +319 -0
- package/dist/web/assets/index-D4OYMkeO.js +319 -0
- package/dist/web/assets/index-DW2crjn_.js +320 -0
- package/dist/web/assets/index-ght3d7Gp.js +319 -0
- package/dist/web/assets/index-pmRkCEqP.js +319 -0
- package/dist/web/icon-192.png +0 -0
- package/dist/web/icon-512.png +0 -0
- package/dist/web/index.html +17 -0
- package/dist/web/manifest.json +21 -0
- package/package.json +60 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const h of n)if(h.type==="childList")for(const g of h.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&i(g)}).observe(document,{childList:!0,subtree:!0});function r(n){const h={};return n.integrity&&(h.integrity=n.integrity),n.referrerPolicy&&(h.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?h.credentials="include":n.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function i(n){if(n.ep)return;n.ep=!0;const h=r(n);fetch(n.href,h)}})();function ic(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var sc={exports:{}},zs={},nc={exports:{}},ee={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Ai=Symbol.for("react.element"),Bh=Symbol.for("react.portal"),Oh=Symbol.for("react.fragment"),Ih=Symbol.for("react.strict_mode"),Nh=Symbol.for("react.profiler"),jh=Symbol.for("react.provider"),Hh=Symbol.for("react.context"),Fh=Symbol.for("react.forward_ref"),zh=Symbol.for("react.suspense"),Wh=Symbol.for("react.memo"),Uh=Symbol.for("react.lazy"),zl=Symbol.iterator;function $h(e){return e===null||typeof e!="object"?null:(e=zl&&e[zl]||e["@@iterator"],typeof e=="function"?e:null)}var oc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},lc=Object.assign,ac={};function jr(e,t,r){this.props=e,this.context=t,this.refs=ac,this.updater=r||oc}jr.prototype.isReactComponent={};jr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};jr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function cc(){}cc.prototype=jr.prototype;function Wo(e,t,r){this.props=e,this.context=t,this.refs=ac,this.updater=r||oc}var Uo=Wo.prototype=new cc;Uo.constructor=Wo;lc(Uo,jr.prototype);Uo.isPureReactComponent=!0;var Wl=Array.isArray,uc=Object.prototype.hasOwnProperty,$o={current:null},hc={key:!0,ref:!0,__self:!0,__source:!0};function dc(e,t,r){var i,n={},h=null,g=null;if(t!=null)for(i in t.ref!==void 0&&(g=t.ref),t.key!==void 0&&(h=""+t.key),t)uc.call(t,i)&&!hc.hasOwnProperty(i)&&(n[i]=t[i]);var o=arguments.length-2;if(o===1)n.children=r;else if(1<o){for(var c=Array(o),f=0;f<o;f++)c[f]=arguments[f+2];n.children=c}if(e&&e.defaultProps)for(i in o=e.defaultProps,o)n[i]===void 0&&(n[i]=o[i]);return{$$typeof:Ai,type:e,key:h,ref:g,props:n,_owner:$o.current}}function Kh(e,t){return{$$typeof:Ai,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ko(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ai}function Vh(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Ul=/\/+/g;function hn(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Vh(""+e.key):t.toString(36)}function is(e,t,r,i,n){var h=typeof e;(h==="undefined"||h==="boolean")&&(e=null);var g=!1;if(e===null)g=!0;else switch(h){case"string":case"number":g=!0;break;case"object":switch(e.$$typeof){case Ai:case Bh:g=!0}}if(g)return g=e,n=n(g),e=i===""?"."+hn(g,0):i,Wl(n)?(r="",e!=null&&(r=e.replace(Ul,"$&/")+"/"),is(n,t,r,"",function(f){return f})):n!=null&&(Ko(n)&&(n=Kh(n,r+(!n.key||g&&g.key===n.key?"":(""+n.key).replace(Ul,"$&/")+"/")+e)),t.push(n)),1;if(g=0,i=i===""?".":i+":",Wl(e))for(var o=0;o<e.length;o++){h=e[o];var c=i+hn(h,o);g+=is(h,t,r,c,n)}else if(c=$h(e),typeof c=="function")for(e=c.call(e),o=0;!(h=e.next()).done;)h=h.value,c=i+hn(h,o++),g+=is(h,t,r,c,n);else if(h==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return g}function Fi(e,t,r){if(e==null)return e;var i=[],n=0;return is(e,i,"","",function(h){return t.call(r,h,n++)}),i}function qh(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ie={current:null},ss={transition:null},Gh={ReactCurrentDispatcher:Ie,ReactCurrentBatchConfig:ss,ReactCurrentOwner:$o};function fc(){throw Error("act(...) is not supported in production builds of React.")}ee.Children={map:Fi,forEach:function(e,t,r){Fi(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Fi(e,function(){t++}),t},toArray:function(e){return Fi(e,function(t){return t})||[]},only:function(e){if(!Ko(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ee.Component=jr;ee.Fragment=Oh;ee.Profiler=Nh;ee.PureComponent=Wo;ee.StrictMode=Ih;ee.Suspense=zh;ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Gh;ee.act=fc;ee.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=lc({},e.props),n=e.key,h=e.ref,g=e._owner;if(t!=null){if(t.ref!==void 0&&(h=t.ref,g=$o.current),t.key!==void 0&&(n=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(c in t)uc.call(t,c)&&!hc.hasOwnProperty(c)&&(i[c]=t[c]===void 0&&o!==void 0?o[c]:t[c])}var c=arguments.length-2;if(c===1)i.children=r;else if(1<c){o=Array(c);for(var f=0;f<c;f++)o[f]=arguments[f+2];i.children=o}return{$$typeof:Ai,type:e.type,key:n,ref:h,props:i,_owner:g}};ee.createContext=function(e){return e={$$typeof:Hh,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:jh,_context:e},e.Consumer=e};ee.createElement=dc;ee.createFactory=function(e){var t=dc.bind(null,e);return t.type=e,t};ee.createRef=function(){return{current:null}};ee.forwardRef=function(e){return{$$typeof:Fh,render:e}};ee.isValidElement=Ko;ee.lazy=function(e){return{$$typeof:Uh,_payload:{_status:-1,_result:e},_init:qh}};ee.memo=function(e,t){return{$$typeof:Wh,type:e,compare:t===void 0?null:t}};ee.startTransition=function(e){var t=ss.transition;ss.transition={};try{e()}finally{ss.transition=t}};ee.unstable_act=fc;ee.useCallback=function(e,t){return Ie.current.useCallback(e,t)};ee.useContext=function(e){return Ie.current.useContext(e)};ee.useDebugValue=function(){};ee.useDeferredValue=function(e){return Ie.current.useDeferredValue(e)};ee.useEffect=function(e,t){return Ie.current.useEffect(e,t)};ee.useId=function(){return Ie.current.useId()};ee.useImperativeHandle=function(e,t,r){return Ie.current.useImperativeHandle(e,t,r)};ee.useInsertionEffect=function(e,t){return Ie.current.useInsertionEffect(e,t)};ee.useLayoutEffect=function(e,t){return Ie.current.useLayoutEffect(e,t)};ee.useMemo=function(e,t){return Ie.current.useMemo(e,t)};ee.useReducer=function(e,t,r){return Ie.current.useReducer(e,t,r)};ee.useRef=function(e){return Ie.current.useRef(e)};ee.useState=function(e){return Ie.current.useState(e)};ee.useSyncExternalStore=function(e,t,r){return Ie.current.useSyncExternalStore(e,t,r)};ee.useTransition=function(){return Ie.current.useTransition()};ee.version="18.3.1";nc.exports=ee;var J=nc.exports;const _c=ic(J);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Xh=J,Qh=Symbol.for("react.element"),Yh=Symbol.for("react.fragment"),Jh=Object.prototype.hasOwnProperty,Zh=Xh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ed={key:!0,ref:!0,__self:!0,__source:!0};function pc(e,t,r){var i,n={},h=null,g=null;r!==void 0&&(h=""+r),t.key!==void 0&&(h=""+t.key),t.ref!==void 0&&(g=t.ref);for(i in t)Jh.call(t,i)&&!ed.hasOwnProperty(i)&&(n[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)n[i]===void 0&&(n[i]=t[i]);return{$$typeof:Qh,type:e,key:h,ref:g,props:n,_owner:Zh.current}}zs.Fragment=Yh;zs.jsx=pc;zs.jsxs=pc;sc.exports=zs;var B=sc.exports,Hn={},vc={exports:{}},Xe={},gc={exports:{}},mc={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(N,k){var D=N.length;N.push(k);e:for(;0<D;){var T=D-1>>>1,M=N[T];if(0<n(M,k))N[T]=k,N[D]=M,D=T;else break e}}function r(N){return N.length===0?null:N[0]}function i(N){if(N.length===0)return null;var k=N[0],D=N.pop();if(D!==k){N[0]=D;e:for(var T=0,M=N.length,W=M>>>1;T<W;){var V=2*(T+1)-1,Q=N[V],Y=V+1,I=N[Y];if(0>n(Q,D))Y<M&&0>n(I,Q)?(N[T]=I,N[Y]=D,T=Y):(N[T]=Q,N[V]=D,T=V);else if(Y<M&&0>n(I,D))N[T]=I,N[Y]=D,T=Y;else break e}}return k}function n(N,k){var D=N.sortIndex-k.sortIndex;return D!==0?D:N.id-k.id}if(typeof performance=="object"&&typeof performance.now=="function"){var h=performance;e.unstable_now=function(){return h.now()}}else{var g=Date,o=g.now();e.unstable_now=function(){return g.now()-o}}var c=[],f=[],m=1,d=null,_=3,S=!1,w=!1,p=!1,u=typeof setTimeout=="function"?setTimeout:null,l=typeof clearTimeout=="function"?clearTimeout:null,s=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function a(N){for(var k=r(f);k!==null;){if(k.callback===null)i(f);else if(k.startTime<=N)i(f),k.sortIndex=k.expirationTime,t(c,k);else break;k=r(f)}}function v(N){if(p=!1,a(N),!w)if(r(c)!==null)w=!0,K(C);else{var k=r(f);k!==null&&H(v,k.startTime-N)}}function C(N,k){w=!1,p&&(p=!1,l(y),y=-1),S=!0;var D=_;try{for(a(k),d=r(c);d!==null&&(!(d.expirationTime>k)||N&&!A());){var T=d.callback;if(typeof T=="function"){d.callback=null,_=d.priorityLevel;var M=T(d.expirationTime<=k);k=e.unstable_now(),typeof M=="function"?d.callback=M:d===r(c)&&i(c),a(k)}else i(c);d=r(c)}if(d!==null)var W=!0;else{var V=r(f);V!==null&&H(v,V.startTime-k),W=!1}return W}finally{d=null,_=D,S=!1}}var x=!1,E=null,y=-1,b=5,R=-1;function A(){return!(e.unstable_now()-R<b)}function O(){if(E!==null){var N=e.unstable_now();R=N;var k=!0;try{k=E(!0,N)}finally{k?P():(x=!1,E=null)}}else x=!1}var P;if(typeof s=="function")P=function(){s(O)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,z=j.port2;j.port1.onmessage=O,P=function(){z.postMessage(null)}}else P=function(){u(O,0)};function K(N){E=N,x||(x=!0,P())}function H(N,k){y=u(function(){N(e.unstable_now())},k)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(N){N.callback=null},e.unstable_continueExecution=function(){w||S||(w=!0,K(C))},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(N){switch(_){case 1:case 2:case 3:var k=3;break;default:k=_}var D=_;_=k;try{return N()}finally{_=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(N,k){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var D=_;_=N;try{return k()}finally{_=D}},e.unstable_scheduleCallback=function(N,k,D){var T=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?T+D:T):D=T,N){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=D+M,N={id:m++,callback:k,priorityLevel:N,startTime:D,expirationTime:M,sortIndex:-1},D>T?(N.sortIndex=D,t(f,N),r(c)===null&&N===r(f)&&(p?(l(y),y=-1):p=!0,H(v,D-T))):(N.sortIndex=M,t(c,N),w||S||(w=!0,K(C))),N},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(N){var k=_;return function(){var D=_;_=k;try{return N.apply(this,arguments)}finally{_=D}}}})(mc);gc.exports=mc;var td=gc.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var rd=J,Ge=td;function $(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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."}var Sc=new Set,_i={};function cr(e,t){Pr(e,t),Pr(e+"Capture",t)}function Pr(e,t){for(_i[e]=t,e=0;e<t.length;e++)Sc.add(t[e])}var xt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fn=Object.prototype.hasOwnProperty,id=/^[: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]*$/,$l={},Kl={};function sd(e){return Fn.call(Kl,e)?!0:Fn.call($l,e)?!1:id.test(e)?Kl[e]=!0:($l[e]=!0,!1)}function nd(e,t,r,i){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function od(e,t,r,i){if(t===null||typeof t>"u"||nd(e,t,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ne(e,t,r,i,n,h,g){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=h,this.removeEmptyString=g}var Re={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Re[e]=new Ne(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Re[t]=new Ne(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Re[e]=new Ne(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Re[e]=new Ne(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Re[e]=new Ne(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Re[e]=new Ne(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Re[e]=new Ne(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Re[e]=new Ne(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Re[e]=new Ne(e,5,!1,e.toLowerCase(),null,!1,!1)});var Vo=/[\-:]([a-z])/g;function qo(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Vo,qo);Re[t]=new Ne(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Vo,qo);Re[t]=new Ne(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Vo,qo);Re[t]=new Ne(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Re[e]=new Ne(e,1,!1,e.toLowerCase(),null,!1,!1)});Re.xlinkHref=new Ne("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Re[e]=new Ne(e,1,!1,e.toLowerCase(),null,!0,!0)});function Go(e,t,r,i){var n=Re.hasOwnProperty(t)?Re[t]:null;(n!==null?n.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(od(t,r,n,i)&&(r=null),i||n===null?sd(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):n.mustUseProperty?e[n.propertyName]=r===null?n.type===3?!1:"":r:(t=n.attributeName,i=n.attributeNamespace,r===null?e.removeAttribute(t):(n=n.type,r=n===3||n===4&&r===!0?"":""+r,i?e.setAttributeNS(i,t,r):e.setAttribute(t,r))))}var Lt=rd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,zi=Symbol.for("react.element"),dr=Symbol.for("react.portal"),fr=Symbol.for("react.fragment"),Xo=Symbol.for("react.strict_mode"),zn=Symbol.for("react.profiler"),yc=Symbol.for("react.provider"),wc=Symbol.for("react.context"),Qo=Symbol.for("react.forward_ref"),Wn=Symbol.for("react.suspense"),Un=Symbol.for("react.suspense_list"),Yo=Symbol.for("react.memo"),Tt=Symbol.for("react.lazy"),Cc=Symbol.for("react.offscreen"),Vl=Symbol.iterator;function Kr(e){return e===null||typeof e!="object"?null:(e=Vl&&e[Vl]||e["@@iterator"],typeof e=="function"?e:null)}var fe=Object.assign,dn;function Zr(e){if(dn===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);dn=t&&t[1]||""}return`
|
|
34
|
+
`+dn+e}var fn=!1;function _n(e,t){if(!e||fn)return"";fn=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(f){var i=f}Reflect.construct(e,[],t)}else{try{t.call()}catch(f){i=f}e.call(t.prototype)}else{try{throw Error()}catch(f){i=f}e()}}catch(f){if(f&&i&&typeof f.stack=="string"){for(var n=f.stack.split(`
|
|
35
|
+
`),h=i.stack.split(`
|
|
36
|
+
`),g=n.length-1,o=h.length-1;1<=g&&0<=o&&n[g]!==h[o];)o--;for(;1<=g&&0<=o;g--,o--)if(n[g]!==h[o]){if(g!==1||o!==1)do if(g--,o--,0>o||n[g]!==h[o]){var c=`
|
|
37
|
+
`+n[g].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=g&&0<=o);break}}}finally{fn=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Zr(e):""}function ld(e){switch(e.tag){case 5:return Zr(e.type);case 16:return Zr("Lazy");case 13:return Zr("Suspense");case 19:return Zr("SuspenseList");case 0:case 2:case 15:return e=_n(e.type,!1),e;case 11:return e=_n(e.type.render,!1),e;case 1:return e=_n(e.type,!0),e;default:return""}}function $n(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case fr:return"Fragment";case dr:return"Portal";case zn:return"Profiler";case Xo:return"StrictMode";case Wn:return"Suspense";case Un:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case wc:return(e.displayName||"Context")+".Consumer";case yc:return(e._context.displayName||"Context")+".Provider";case Qo:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Yo:return t=e.displayName||null,t!==null?t:$n(e.type)||"Memo";case Tt:t=e._payload,e=e._init;try{return $n(e(t))}catch{}}return null}function ad(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return $n(t);case 8:return t===Xo?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Kt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function cd(e){var t=xc(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var n=r.get,h=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(g){i=""+g,h.call(this,g)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(g){i=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wi(e){e._valueTracker||(e._valueTracker=cd(e))}function Ec(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=xc(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function ps(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}}function Kn(e,t){var r=t.checked;return fe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function ql(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=Kt(t.value!=null?t.value:r),e._wrapperState={initialChecked:i,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function kc(e,t){t=t.checked,t!=null&&Go(e,"checked",t,!1)}function Vn(e,t){kc(e,t);var r=Kt(t.value),i=t.type;if(r!=null)i==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?qn(e,t.type,r):t.hasOwnProperty("defaultValue")&&qn(e,t.type,Kt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Gl(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function qn(e,t,r){(t!=="number"||ps(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var ei=Array.isArray;function Er(e,t,r,i){if(e=e.options,t){t={};for(var n=0;n<r.length;n++)t["$"+r[n]]=!0;for(r=0;r<e.length;r++)n=t.hasOwnProperty("$"+e[r].value),e[r].selected!==n&&(e[r].selected=n),n&&i&&(e[r].defaultSelected=!0)}else{for(r=""+Kt(r),t=null,n=0;n<e.length;n++){if(e[n].value===r){e[n].selected=!0,i&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function Gn(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error($(91));return fe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Xl(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error($(92));if(ei(r)){if(1<r.length)throw Error($(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Kt(r)}}function bc(e,t){var r=Kt(t.value),i=Kt(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),i!=null&&(e.defaultValue=""+i)}function Ql(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Lc(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Xn(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Lc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ui,Dc=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,n){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,n)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ui=Ui||document.createElement("div"),Ui.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ui.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function pi(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var si={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ud=["Webkit","ms","Moz","O"];Object.keys(si).forEach(function(e){ud.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),si[t]=si[e]})});function Rc(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||si.hasOwnProperty(e)&&si[e]?(""+t).trim():t+"px"}function Pc(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,n=Rc(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,n):e[r]=n}}var hd=fe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Qn(e,t){if(t){if(hd[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error($(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error($(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error($(61))}if(t.style!=null&&typeof t.style!="object")throw Error($(62))}}function Yn(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Jn=null;function Jo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zn=null,kr=null,br=null;function Yl(e){if(e=Oi(e)){if(typeof Zn!="function")throw Error($(280));var t=e.stateNode;t&&(t=Vs(t),Zn(e.stateNode,e.type,t))}}function Tc(e){kr?br?br.push(e):br=[e]:kr=e}function Ac(){if(kr){var e=kr,t=br;if(br=kr=null,Yl(e),t)for(e=0;e<t.length;e++)Yl(t[e])}}function Mc(e,t){return e(t)}function Bc(){}var pn=!1;function Oc(e,t,r){if(pn)return e(t,r);pn=!0;try{return Mc(e,t,r)}finally{pn=!1,(kr!==null||br!==null)&&(Bc(),Ac())}}function vi(e,t){var r=e.stateNode;if(r===null)return null;var i=Vs(r);if(i===null)return null;r=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error($(231,t,typeof r));return r}var eo=!1;if(xt)try{var Vr={};Object.defineProperty(Vr,"passive",{get:function(){eo=!0}}),window.addEventListener("test",Vr,Vr),window.removeEventListener("test",Vr,Vr)}catch{eo=!1}function dd(e,t,r,i,n,h,g,o,c){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(m){this.onError(m)}}var ni=!1,vs=null,gs=!1,to=null,fd={onError:function(e){ni=!0,vs=e}};function _d(e,t,r,i,n,h,g,o,c){ni=!1,vs=null,dd.apply(fd,arguments)}function pd(e,t,r,i,n,h,g,o,c){if(_d.apply(this,arguments),ni){if(ni){var f=vs;ni=!1,vs=null}else throw Error($(198));gs||(gs=!0,to=f)}}function ur(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Ic(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 Jl(e){if(ur(e)!==e)throw Error($(188))}function vd(e){var t=e.alternate;if(!t){if(t=ur(e),t===null)throw Error($(188));return t!==e?null:e}for(var r=e,i=t;;){var n=r.return;if(n===null)break;var h=n.alternate;if(h===null){if(i=n.return,i!==null){r=i;continue}break}if(n.child===h.child){for(h=n.child;h;){if(h===r)return Jl(n),e;if(h===i)return Jl(n),t;h=h.sibling}throw Error($(188))}if(r.return!==i.return)r=n,i=h;else{for(var g=!1,o=n.child;o;){if(o===r){g=!0,r=n,i=h;break}if(o===i){g=!0,i=n,r=h;break}o=o.sibling}if(!g){for(o=h.child;o;){if(o===r){g=!0,r=h,i=n;break}if(o===i){g=!0,i=h,r=n;break}o=o.sibling}if(!g)throw Error($(189))}}if(r.alternate!==i)throw Error($(190))}if(r.tag!==3)throw Error($(188));return r.stateNode.current===r?e:t}function Nc(e){return e=vd(e),e!==null?jc(e):null}function jc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=jc(e);if(t!==null)return t;e=e.sibling}return null}var Hc=Ge.unstable_scheduleCallback,Zl=Ge.unstable_cancelCallback,gd=Ge.unstable_shouldYield,md=Ge.unstable_requestPaint,me=Ge.unstable_now,Sd=Ge.unstable_getCurrentPriorityLevel,Zo=Ge.unstable_ImmediatePriority,Fc=Ge.unstable_UserBlockingPriority,ms=Ge.unstable_NormalPriority,yd=Ge.unstable_LowPriority,zc=Ge.unstable_IdlePriority,Ws=null,vt=null;function wd(e){if(vt&&typeof vt.onCommitFiberRoot=="function")try{vt.onCommitFiberRoot(Ws,e,void 0,(e.current.flags&128)===128)}catch{}}var ct=Math.clz32?Math.clz32:Ed,Cd=Math.log,xd=Math.LN2;function Ed(e){return e>>>=0,e===0?32:31-(Cd(e)/xd|0)|0}var $i=64,Ki=4194304;function ti(e){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:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ss(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,n=e.suspendedLanes,h=e.pingedLanes,g=r&268435455;if(g!==0){var o=g&~n;o!==0?i=ti(o):(h&=g,h!==0&&(i=ti(h)))}else g=r&~n,g!==0?i=ti(g):h!==0&&(i=ti(h));if(i===0)return 0;if(t!==0&&t!==i&&!(t&n)&&(n=i&-i,h=t&-t,n>=h||n===16&&(h&4194240)!==0))return t;if(i&4&&(i|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)r=31-ct(t),n=1<<r,i|=e[r],t&=~n;return i}function kd(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bd(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,n=e.expirationTimes,h=e.pendingLanes;0<h;){var g=31-ct(h),o=1<<g,c=n[g];c===-1?(!(o&r)||o&i)&&(n[g]=kd(o,t)):c<=t&&(e.expiredLanes|=o),h&=~o}}function ro(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Wc(){var e=$i;return $i<<=1,!($i&4194240)&&($i=64),e}function vn(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Mi(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ct(t),e[t]=r}function Ld(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<r;){var n=31-ct(r),h=1<<n;t[n]=0,i[n]=-1,e[n]=-1,r&=~h}}function el(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-ct(r),n=1<<i;n&t|e[i]&t&&(e[i]|=t),r&=~n}}var se=0;function Uc(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var $c,tl,Kc,Vc,qc,io=!1,Vi=[],Nt=null,jt=null,Ht=null,gi=new Map,mi=new Map,Mt=[],Dd="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 submit".split(" ");function ea(e,t){switch(e){case"focusin":case"focusout":Nt=null;break;case"dragenter":case"dragleave":jt=null;break;case"mouseover":case"mouseout":Ht=null;break;case"pointerover":case"pointerout":gi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":mi.delete(t.pointerId)}}function qr(e,t,r,i,n,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:h,targetContainers:[n]},t!==null&&(t=Oi(t),t!==null&&tl(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function Rd(e,t,r,i,n){switch(t){case"focusin":return Nt=qr(Nt,e,t,r,i,n),!0;case"dragenter":return jt=qr(jt,e,t,r,i,n),!0;case"mouseover":return Ht=qr(Ht,e,t,r,i,n),!0;case"pointerover":var h=n.pointerId;return gi.set(h,qr(gi.get(h)||null,e,t,r,i,n)),!0;case"gotpointercapture":return h=n.pointerId,mi.set(h,qr(mi.get(h)||null,e,t,r,i,n)),!0}return!1}function Gc(e){var t=Jt(e.target);if(t!==null){var r=ur(t);if(r!==null){if(t=r.tag,t===13){if(t=Ic(r),t!==null){e.blockedOn=t,qc(e.priority,function(){Kc(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ns(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=so(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);Jn=i,r.target.dispatchEvent(i),Jn=null}else return t=Oi(r),t!==null&&tl(t),e.blockedOn=r,!1;t.shift()}return!0}function ta(e,t,r){ns(e)&&r.delete(t)}function Pd(){io=!1,Nt!==null&&ns(Nt)&&(Nt=null),jt!==null&&ns(jt)&&(jt=null),Ht!==null&&ns(Ht)&&(Ht=null),gi.forEach(ta),mi.forEach(ta)}function Gr(e,t){e.blockedOn===t&&(e.blockedOn=null,io||(io=!0,Ge.unstable_scheduleCallback(Ge.unstable_NormalPriority,Pd)))}function Si(e){function t(n){return Gr(n,e)}if(0<Vi.length){Gr(Vi[0],e);for(var r=1;r<Vi.length;r++){var i=Vi[r];i.blockedOn===e&&(i.blockedOn=null)}}for(Nt!==null&&Gr(Nt,e),jt!==null&&Gr(jt,e),Ht!==null&&Gr(Ht,e),gi.forEach(t),mi.forEach(t),r=0;r<Mt.length;r++)i=Mt[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<Mt.length&&(r=Mt[0],r.blockedOn===null);)Gc(r),r.blockedOn===null&&Mt.shift()}var Lr=Lt.ReactCurrentBatchConfig,ys=!0;function Td(e,t,r,i){var n=se,h=Lr.transition;Lr.transition=null;try{se=1,rl(e,t,r,i)}finally{se=n,Lr.transition=h}}function Ad(e,t,r,i){var n=se,h=Lr.transition;Lr.transition=null;try{se=4,rl(e,t,r,i)}finally{se=n,Lr.transition=h}}function rl(e,t,r,i){if(ys){var n=so(e,t,r,i);if(n===null)bn(e,t,i,ws,r),ea(e,i);else if(Rd(n,e,t,r,i))i.stopPropagation();else if(ea(e,i),t&4&&-1<Dd.indexOf(e)){for(;n!==null;){var h=Oi(n);if(h!==null&&$c(h),h=so(e,t,r,i),h===null&&bn(e,t,i,ws,r),h===n)break;n=h}n!==null&&i.stopPropagation()}else bn(e,t,i,null,r)}}var ws=null;function so(e,t,r,i){if(ws=null,e=Jo(i),e=Jt(e),e!==null)if(t=ur(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Ic(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ws=e,null}function Xc(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Sd()){case Zo:return 1;case Fc:return 4;case ms:case yd:return 16;case zc:return 536870912;default:return 16}default:return 16}}var Ot=null,il=null,os=null;function Qc(){if(os)return os;var e,t=il,r=t.length,i,n="value"in Ot?Ot.value:Ot.textContent,h=n.length;for(e=0;e<r&&t[e]===n[e];e++);var g=r-e;for(i=1;i<=g&&t[r-i]===n[h-i];i++);return os=n.slice(e,1<i?1-i:void 0)}function ls(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 qi(){return!0}function ra(){return!1}function Qe(e){function t(r,i,n,h,g){this._reactName=r,this._targetInst=n,this.type=i,this.nativeEvent=h,this.target=g,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(r=e[o],this[o]=r?r(h):h[o]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?qi:ra,this.isPropagationStopped=ra,this}return fe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=qi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=qi)},persist:function(){},isPersistent:qi}),t}var Hr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sl=Qe(Hr),Bi=fe({},Hr,{view:0,detail:0}),Md=Qe(Bi),gn,mn,Xr,Us=fe({},Bi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nl,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!==Xr&&(Xr&&e.type==="mousemove"?(gn=e.screenX-Xr.screenX,mn=e.screenY-Xr.screenY):mn=gn=0,Xr=e),gn)},movementY:function(e){return"movementY"in e?e.movementY:mn}}),ia=Qe(Us),Bd=fe({},Us,{dataTransfer:0}),Od=Qe(Bd),Id=fe({},Bi,{relatedTarget:0}),Sn=Qe(Id),Nd=fe({},Hr,{animationName:0,elapsedTime:0,pseudoElement:0}),jd=Qe(Nd),Hd=fe({},Hr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Fd=Qe(Hd),zd=fe({},Hr,{data:0}),sa=Qe(zd),Wd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ud={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"},$d={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kd(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$d[e])?!!t[e]:!1}function nl(){return Kd}var Vd=fe({},Bi,{key:function(e){if(e.key){var t=Wd[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ls(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ud[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nl,charCode:function(e){return e.type==="keypress"?ls(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ls(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qd=Qe(Vd),Gd=fe({},Us,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),na=Qe(Gd),Xd=fe({},Bi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nl}),Qd=Qe(Xd),Yd=fe({},Hr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Jd=Qe(Yd),Zd=fe({},Us,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ef=Qe(Zd),tf=[9,13,27,32],ol=xt&&"CompositionEvent"in window,oi=null;xt&&"documentMode"in document&&(oi=document.documentMode);var rf=xt&&"TextEvent"in window&&!oi,Yc=xt&&(!ol||oi&&8<oi&&11>=oi),oa=" ",la=!1;function Jc(e,t){switch(e){case"keyup":return tf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _r=!1;function sf(e,t){switch(e){case"compositionend":return Zc(t);case"keypress":return t.which!==32?null:(la=!0,oa);case"textInput":return e=t.data,e===oa&&la?null:e;default:return null}}function nf(e,t){if(_r)return e==="compositionend"||!ol&&Jc(e,t)?(e=Qc(),os=il=Ot=null,_r=!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 Yc&&t.locale!=="ko"?null:t.data;default:return null}}var of={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 aa(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!of[e.type]:t==="textarea"}function eu(e,t,r,i){Tc(i),t=Cs(t,"onChange"),0<t.length&&(r=new sl("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var li=null,yi=null;function lf(e){hu(e,0)}function $s(e){var t=gr(e);if(Ec(t))return e}function af(e,t){if(e==="change")return t}var tu=!1;if(xt){var yn;if(xt){var wn="oninput"in document;if(!wn){var ca=document.createElement("div");ca.setAttribute("oninput","return;"),wn=typeof ca.oninput=="function"}yn=wn}else yn=!1;tu=yn&&(!document.documentMode||9<document.documentMode)}function ua(){li&&(li.detachEvent("onpropertychange",ru),yi=li=null)}function ru(e){if(e.propertyName==="value"&&$s(yi)){var t=[];eu(t,yi,e,Jo(e)),Oc(lf,t)}}function cf(e,t,r){e==="focusin"?(ua(),li=t,yi=r,li.attachEvent("onpropertychange",ru)):e==="focusout"&&ua()}function uf(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return $s(yi)}function hf(e,t){if(e==="click")return $s(t)}function df(e,t){if(e==="input"||e==="change")return $s(t)}function ff(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ht=typeof Object.is=="function"?Object.is:ff;function wi(e,t){if(ht(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var n=r[i];if(!Fn.call(t,n)||!ht(e[n],t[n]))return!1}return!0}function ha(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function da(e,t){var r=ha(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ha(r)}}function iu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?iu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function su(){for(var e=window,t=ps();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ps(e.document)}return t}function ll(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")}function _f(e){var t=su(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&iu(r.ownerDocument.documentElement,r)){if(i!==null&&ll(r)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var n=r.textContent.length,h=Math.min(i.start,n);i=i.end===void 0?h:Math.min(i.end,n),!e.extend&&h>i&&(n=i,i=h,h=n),n=da(r,h);var g=da(r,i);n&&g&&(e.rangeCount!==1||e.anchorNode!==n.node||e.anchorOffset!==n.offset||e.focusNode!==g.node||e.focusOffset!==g.offset)&&(t=t.createRange(),t.setStart(n.node,n.offset),e.removeAllRanges(),h>i?(e.addRange(t),e.extend(g.node,g.offset)):(t.setEnd(g.node,g.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var pf=xt&&"documentMode"in document&&11>=document.documentMode,pr=null,no=null,ai=null,oo=!1;function fa(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;oo||pr==null||pr!==ps(i)||(i=pr,"selectionStart"in i&&ll(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ai&&wi(ai,i)||(ai=i,i=Cs(no,"onSelect"),0<i.length&&(t=new sl("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=pr)))}function Gi(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var vr={animationend:Gi("Animation","AnimationEnd"),animationiteration:Gi("Animation","AnimationIteration"),animationstart:Gi("Animation","AnimationStart"),transitionend:Gi("Transition","TransitionEnd")},Cn={},nu={};xt&&(nu=document.createElement("div").style,"AnimationEvent"in window||(delete vr.animationend.animation,delete vr.animationiteration.animation,delete vr.animationstart.animation),"TransitionEvent"in window||delete vr.transitionend.transition);function Ks(e){if(Cn[e])return Cn[e];if(!vr[e])return e;var t=vr[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in nu)return Cn[e]=t[r];return e}var ou=Ks("animationend"),lu=Ks("animationiteration"),au=Ks("animationstart"),cu=Ks("transitionend"),uu=new Map,_a="abort auxClick 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(" ");function qt(e,t){uu.set(e,t),cr(t,[e])}for(var xn=0;xn<_a.length;xn++){var En=_a[xn],vf=En.toLowerCase(),gf=En[0].toUpperCase()+En.slice(1);qt(vf,"on"+gf)}qt(ou,"onAnimationEnd");qt(lu,"onAnimationIteration");qt(au,"onAnimationStart");qt("dblclick","onDoubleClick");qt("focusin","onFocus");qt("focusout","onBlur");qt(cu,"onTransitionEnd");Pr("onMouseEnter",["mouseout","mouseover"]);Pr("onMouseLeave",["mouseout","mouseover"]);Pr("onPointerEnter",["pointerout","pointerover"]);Pr("onPointerLeave",["pointerout","pointerover"]);cr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));cr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));cr("onBeforeInput",["compositionend","keypress","textInput","paste"]);cr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));cr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));cr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ri="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(" "),mf=new Set("cancel close invalid load scroll toggle".split(" ").concat(ri));function pa(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,pd(i,t,void 0,e),e.currentTarget=null}function hu(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],n=i.event;i=i.listeners;e:{var h=void 0;if(t)for(var g=i.length-1;0<=g;g--){var o=i[g],c=o.instance,f=o.currentTarget;if(o=o.listener,c!==h&&n.isPropagationStopped())break e;pa(n,o,f),h=c}else for(g=0;g<i.length;g++){if(o=i[g],c=o.instance,f=o.currentTarget,o=o.listener,c!==h&&n.isPropagationStopped())break e;pa(n,o,f),h=c}}}if(gs)throw e=to,gs=!1,to=null,e}function oe(e,t){var r=t[ho];r===void 0&&(r=t[ho]=new Set);var i=e+"__bubble";r.has(i)||(du(t,e,2,!1),r.add(i))}function kn(e,t,r){var i=0;t&&(i|=4),du(r,e,i,t)}var Xi="_reactListening"+Math.random().toString(36).slice(2);function Ci(e){if(!e[Xi]){e[Xi]=!0,Sc.forEach(function(r){r!=="selectionchange"&&(mf.has(r)||kn(r,!1,e),kn(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xi]||(t[Xi]=!0,kn("selectionchange",!1,t))}}function du(e,t,r,i){switch(Xc(t)){case 1:var n=Td;break;case 4:n=Ad;break;default:n=rl}r=n.bind(null,t,r,e),n=void 0,!eo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),i?n!==void 0?e.addEventListener(t,r,{capture:!0,passive:n}):e.addEventListener(t,r,!0):n!==void 0?e.addEventListener(t,r,{passive:n}):e.addEventListener(t,r,!1)}function bn(e,t,r,i,n){var h=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var g=i.tag;if(g===3||g===4){var o=i.stateNode.containerInfo;if(o===n||o.nodeType===8&&o.parentNode===n)break;if(g===4)for(g=i.return;g!==null;){var c=g.tag;if((c===3||c===4)&&(c=g.stateNode.containerInfo,c===n||c.nodeType===8&&c.parentNode===n))return;g=g.return}for(;o!==null;){if(g=Jt(o),g===null)return;if(c=g.tag,c===5||c===6){i=h=g;continue e}o=o.parentNode}}i=i.return}Oc(function(){var f=h,m=Jo(r),d=[];e:{var _=uu.get(e);if(_!==void 0){var S=sl,w=e;switch(e){case"keypress":if(ls(r)===0)break e;case"keydown":case"keyup":S=qd;break;case"focusin":w="focus",S=Sn;break;case"focusout":w="blur",S=Sn;break;case"beforeblur":case"afterblur":S=Sn;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":S=ia;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":S=Od;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":S=Qd;break;case ou:case lu:case au:S=jd;break;case cu:S=Jd;break;case"scroll":S=Md;break;case"wheel":S=ef;break;case"copy":case"cut":case"paste":S=Fd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":S=na}var p=(t&4)!==0,u=!p&&e==="scroll",l=p?_!==null?_+"Capture":null:_;p=[];for(var s=f,a;s!==null;){a=s;var v=a.stateNode;if(a.tag===5&&v!==null&&(a=v,l!==null&&(v=vi(s,l),v!=null&&p.push(xi(s,v,a)))),u)break;s=s.return}0<p.length&&(_=new S(_,w,null,r,m),d.push({event:_,listeners:p}))}}if(!(t&7)){e:{if(_=e==="mouseover"||e==="pointerover",S=e==="mouseout"||e==="pointerout",_&&r!==Jn&&(w=r.relatedTarget||r.fromElement)&&(Jt(w)||w[Et]))break e;if((S||_)&&(_=m.window===m?m:(_=m.ownerDocument)?_.defaultView||_.parentWindow:window,S?(w=r.relatedTarget||r.toElement,S=f,w=w?Jt(w):null,w!==null&&(u=ur(w),w!==u||w.tag!==5&&w.tag!==6)&&(w=null)):(S=null,w=f),S!==w)){if(p=ia,v="onMouseLeave",l="onMouseEnter",s="mouse",(e==="pointerout"||e==="pointerover")&&(p=na,v="onPointerLeave",l="onPointerEnter",s="pointer"),u=S==null?_:gr(S),a=w==null?_:gr(w),_=new p(v,s+"leave",S,r,m),_.target=u,_.relatedTarget=a,v=null,Jt(m)===f&&(p=new p(l,s+"enter",w,r,m),p.target=a,p.relatedTarget=u,v=p),u=v,S&&w)t:{for(p=S,l=w,s=0,a=p;a;a=hr(a))s++;for(a=0,v=l;v;v=hr(v))a++;for(;0<s-a;)p=hr(p),s--;for(;0<a-s;)l=hr(l),a--;for(;s--;){if(p===l||l!==null&&p===l.alternate)break t;p=hr(p),l=hr(l)}p=null}else p=null;S!==null&&va(d,_,S,p,!1),w!==null&&u!==null&&va(d,u,w,p,!0)}}e:{if(_=f?gr(f):window,S=_.nodeName&&_.nodeName.toLowerCase(),S==="select"||S==="input"&&_.type==="file")var C=af;else if(aa(_))if(tu)C=df;else{C=uf;var x=cf}else(S=_.nodeName)&&S.toLowerCase()==="input"&&(_.type==="checkbox"||_.type==="radio")&&(C=hf);if(C&&(C=C(e,f))){eu(d,C,r,m);break e}x&&x(e,_,f),e==="focusout"&&(x=_._wrapperState)&&x.controlled&&_.type==="number"&&qn(_,"number",_.value)}switch(x=f?gr(f):window,e){case"focusin":(aa(x)||x.contentEditable==="true")&&(pr=x,no=f,ai=null);break;case"focusout":ai=no=pr=null;break;case"mousedown":oo=!0;break;case"contextmenu":case"mouseup":case"dragend":oo=!1,fa(d,r,m);break;case"selectionchange":if(pf)break;case"keydown":case"keyup":fa(d,r,m)}var E;if(ol)e:{switch(e){case"compositionstart":var y="onCompositionStart";break e;case"compositionend":y="onCompositionEnd";break e;case"compositionupdate":y="onCompositionUpdate";break e}y=void 0}else _r?Jc(e,r)&&(y="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(y="onCompositionStart");y&&(Yc&&r.locale!=="ko"&&(_r||y!=="onCompositionStart"?y==="onCompositionEnd"&&_r&&(E=Qc()):(Ot=m,il="value"in Ot?Ot.value:Ot.textContent,_r=!0)),x=Cs(f,y),0<x.length&&(y=new sa(y,e,null,r,m),d.push({event:y,listeners:x}),E?y.data=E:(E=Zc(r),E!==null&&(y.data=E)))),(E=rf?sf(e,r):nf(e,r))&&(f=Cs(f,"onBeforeInput"),0<f.length&&(m=new sa("onBeforeInput","beforeinput",null,r,m),d.push({event:m,listeners:f}),m.data=E))}hu(d,t)})}function xi(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Cs(e,t){for(var r=t+"Capture",i=[];e!==null;){var n=e,h=n.stateNode;n.tag===5&&h!==null&&(n=h,h=vi(e,r),h!=null&&i.unshift(xi(e,h,n)),h=vi(e,t),h!=null&&i.push(xi(e,h,n))),e=e.return}return i}function hr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function va(e,t,r,i,n){for(var h=t._reactName,g=[];r!==null&&r!==i;){var o=r,c=o.alternate,f=o.stateNode;if(c!==null&&c===i)break;o.tag===5&&f!==null&&(o=f,n?(c=vi(r,h),c!=null&&g.unshift(xi(r,c,o))):n||(c=vi(r,h),c!=null&&g.push(xi(r,c,o)))),r=r.return}g.length!==0&&e.push({event:t,listeners:g})}var Sf=/\r\n?/g,yf=/\u0000|\uFFFD/g;function ga(e){return(typeof e=="string"?e:""+e).replace(Sf,`
|
|
38
|
+
`).replace(yf,"")}function Qi(e,t,r){if(t=ga(t),ga(e)!==t&&r)throw Error($(425))}function xs(){}var lo=null,ao=null;function co(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var uo=typeof setTimeout=="function"?setTimeout:void 0,wf=typeof clearTimeout=="function"?clearTimeout:void 0,ma=typeof Promise=="function"?Promise:void 0,Cf=typeof queueMicrotask=="function"?queueMicrotask:typeof ma<"u"?function(e){return ma.resolve(null).then(e).catch(xf)}:uo;function xf(e){setTimeout(function(){throw e})}function Ln(e,t){var r=t,i=0;do{var n=r.nextSibling;if(e.removeChild(r),n&&n.nodeType===8)if(r=n.data,r==="/$"){if(i===0){e.removeChild(n),Si(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=n}while(r);Si(t)}function Ft(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==="$?")break;if(t==="/$")return null}}return e}function Sa(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Fr=Math.random().toString(36).slice(2),pt="__reactFiber$"+Fr,Ei="__reactProps$"+Fr,Et="__reactContainer$"+Fr,ho="__reactEvents$"+Fr,Ef="__reactListeners$"+Fr,kf="__reactHandles$"+Fr;function Jt(e){var t=e[pt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Et]||r[pt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Sa(e);e!==null;){if(r=e[pt])return r;e=Sa(e)}return t}e=r,r=e.parentNode}return null}function Oi(e){return e=e[pt]||e[Et],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function gr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error($(33))}function Vs(e){return e[Ei]||null}var fo=[],mr=-1;function Gt(e){return{current:e}}function le(e){0>mr||(e.current=fo[mr],fo[mr]=null,mr--)}function ne(e,t){mr++,fo[mr]=e.current,e.current=t}var Vt={},Me=Gt(Vt),ze=Gt(!1),sr=Vt;function Tr(e,t){var r=e.type.contextTypes;if(!r)return Vt;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var n={},h;for(h in r)n[h]=t[h];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=n),n}function We(e){return e=e.childContextTypes,e!=null}function Es(){le(ze),le(Me)}function ya(e,t,r){if(Me.current!==Vt)throw Error($(168));ne(Me,t),ne(ze,r)}function fu(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var n in i)if(!(n in t))throw Error($(108,ad(e)||"Unknown",n));return fe({},r,i)}function ks(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vt,sr=Me.current,ne(Me,e),ne(ze,ze.current),!0}function wa(e,t,r){var i=e.stateNode;if(!i)throw Error($(169));r?(e=fu(e,t,sr),i.__reactInternalMemoizedMergedChildContext=e,le(ze),le(Me),ne(Me,e)):le(ze),ne(ze,r)}var St=null,qs=!1,Dn=!1;function _u(e){St===null?St=[e]:St.push(e)}function bf(e){qs=!0,_u(e)}function Xt(){if(!Dn&&St!==null){Dn=!0;var e=0,t=se;try{var r=St;for(se=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}St=null,qs=!1}catch(n){throw St!==null&&(St=St.slice(e+1)),Hc(Zo,Xt),n}finally{se=t,Dn=!1}}return null}var Sr=[],yr=0,bs=null,Ls=0,Ze=[],et=0,nr=null,yt=1,wt="";function Qt(e,t){Sr[yr++]=Ls,Sr[yr++]=bs,bs=e,Ls=t}function pu(e,t,r){Ze[et++]=yt,Ze[et++]=wt,Ze[et++]=nr,nr=e;var i=yt;e=wt;var n=32-ct(i)-1;i&=~(1<<n),r+=1;var h=32-ct(t)+n;if(30<h){var g=n-n%5;h=(i&(1<<g)-1).toString(32),i>>=g,n-=g,yt=1<<32-ct(t)+n|r<<n|i,wt=h+e}else yt=1<<h|r<<n|i,wt=e}function al(e){e.return!==null&&(Qt(e,1),pu(e,1,0))}function cl(e){for(;e===bs;)bs=Sr[--yr],Sr[yr]=null,Ls=Sr[--yr],Sr[yr]=null;for(;e===nr;)nr=Ze[--et],Ze[et]=null,wt=Ze[--et],Ze[et]=null,yt=Ze[--et],Ze[et]=null}var qe=null,Ve=null,ce=!1,at=null;function vu(e,t){var r=tt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Ca(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,qe=e,Ve=Ft(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,qe=e,Ve=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=nr!==null?{id:yt,overflow:wt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=tt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,qe=e,Ve=null,!0):!1;default:return!1}}function _o(e){return(e.mode&1)!==0&&(e.flags&128)===0}function po(e){if(ce){var t=Ve;if(t){var r=t;if(!Ca(e,t)){if(_o(e))throw Error($(418));t=Ft(r.nextSibling);var i=qe;t&&Ca(e,t)?vu(i,r):(e.flags=e.flags&-4097|2,ce=!1,qe=e)}}else{if(_o(e))throw Error($(418));e.flags=e.flags&-4097|2,ce=!1,qe=e}}}function xa(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;qe=e}function Yi(e){if(e!==qe)return!1;if(!ce)return xa(e),ce=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!co(e.type,e.memoizedProps)),t&&(t=Ve)){if(_o(e))throw gu(),Error($(418));for(;t;)vu(e,t),t=Ft(t.nextSibling)}if(xa(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error($(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Ve=Ft(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Ve=null}}else Ve=qe?Ft(e.stateNode.nextSibling):null;return!0}function gu(){for(var e=Ve;e;)e=Ft(e.nextSibling)}function Ar(){Ve=qe=null,ce=!1}function ul(e){at===null?at=[e]:at.push(e)}var Lf=Lt.ReactCurrentBatchConfig;function Qr(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error($(309));var i=r.stateNode}if(!i)throw Error($(147,e));var n=i,h=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===h?t.ref:(t=function(g){var o=n.refs;g===null?delete o[h]:o[h]=g},t._stringRef=h,t)}if(typeof e!="string")throw Error($(284));if(!r._owner)throw Error($(290,e))}return e}function Ji(e,t){throw e=Object.prototype.toString.call(t),Error($(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ea(e){var t=e._init;return t(e._payload)}function mu(e){function t(l,s){if(e){var a=l.deletions;a===null?(l.deletions=[s],l.flags|=16):a.push(s)}}function r(l,s){if(!e)return null;for(;s!==null;)t(l,s),s=s.sibling;return null}function i(l,s){for(l=new Map;s!==null;)s.key!==null?l.set(s.key,s):l.set(s.index,s),s=s.sibling;return l}function n(l,s){return l=$t(l,s),l.index=0,l.sibling=null,l}function h(l,s,a){return l.index=a,e?(a=l.alternate,a!==null?(a=a.index,a<s?(l.flags|=2,s):a):(l.flags|=2,s)):(l.flags|=1048576,s)}function g(l){return e&&l.alternate===null&&(l.flags|=2),l}function o(l,s,a,v){return s===null||s.tag!==6?(s=On(a,l.mode,v),s.return=l,s):(s=n(s,a),s.return=l,s)}function c(l,s,a,v){var C=a.type;return C===fr?m(l,s,a.props.children,v,a.key):s!==null&&(s.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Tt&&Ea(C)===s.type)?(v=n(s,a.props),v.ref=Qr(l,s,a),v.return=l,v):(v=_s(a.type,a.key,a.props,null,l.mode,v),v.ref=Qr(l,s,a),v.return=l,v)}function f(l,s,a,v){return s===null||s.tag!==4||s.stateNode.containerInfo!==a.containerInfo||s.stateNode.implementation!==a.implementation?(s=In(a,l.mode,v),s.return=l,s):(s=n(s,a.children||[]),s.return=l,s)}function m(l,s,a,v,C){return s===null||s.tag!==7?(s=rr(a,l.mode,v,C),s.return=l,s):(s=n(s,a),s.return=l,s)}function d(l,s,a){if(typeof s=="string"&&s!==""||typeof s=="number")return s=On(""+s,l.mode,a),s.return=l,s;if(typeof s=="object"&&s!==null){switch(s.$$typeof){case zi:return a=_s(s.type,s.key,s.props,null,l.mode,a),a.ref=Qr(l,null,s),a.return=l,a;case dr:return s=In(s,l.mode,a),s.return=l,s;case Tt:var v=s._init;return d(l,v(s._payload),a)}if(ei(s)||Kr(s))return s=rr(s,l.mode,a,null),s.return=l,s;Ji(l,s)}return null}function _(l,s,a,v){var C=s!==null?s.key:null;if(typeof a=="string"&&a!==""||typeof a=="number")return C!==null?null:o(l,s,""+a,v);if(typeof a=="object"&&a!==null){switch(a.$$typeof){case zi:return a.key===C?c(l,s,a,v):null;case dr:return a.key===C?f(l,s,a,v):null;case Tt:return C=a._init,_(l,s,C(a._payload),v)}if(ei(a)||Kr(a))return C!==null?null:m(l,s,a,v,null);Ji(l,a)}return null}function S(l,s,a,v,C){if(typeof v=="string"&&v!==""||typeof v=="number")return l=l.get(a)||null,o(s,l,""+v,C);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case zi:return l=l.get(v.key===null?a:v.key)||null,c(s,l,v,C);case dr:return l=l.get(v.key===null?a:v.key)||null,f(s,l,v,C);case Tt:var x=v._init;return S(l,s,a,x(v._payload),C)}if(ei(v)||Kr(v))return l=l.get(a)||null,m(s,l,v,C,null);Ji(s,v)}return null}function w(l,s,a,v){for(var C=null,x=null,E=s,y=s=0,b=null;E!==null&&y<a.length;y++){E.index>y?(b=E,E=null):b=E.sibling;var R=_(l,E,a[y],v);if(R===null){E===null&&(E=b);break}e&&E&&R.alternate===null&&t(l,E),s=h(R,s,y),x===null?C=R:x.sibling=R,x=R,E=b}if(y===a.length)return r(l,E),ce&&Qt(l,y),C;if(E===null){for(;y<a.length;y++)E=d(l,a[y],v),E!==null&&(s=h(E,s,y),x===null?C=E:x.sibling=E,x=E);return ce&&Qt(l,y),C}for(E=i(l,E);y<a.length;y++)b=S(E,l,y,a[y],v),b!==null&&(e&&b.alternate!==null&&E.delete(b.key===null?y:b.key),s=h(b,s,y),x===null?C=b:x.sibling=b,x=b);return e&&E.forEach(function(A){return t(l,A)}),ce&&Qt(l,y),C}function p(l,s,a,v){var C=Kr(a);if(typeof C!="function")throw Error($(150));if(a=C.call(a),a==null)throw Error($(151));for(var x=C=null,E=s,y=s=0,b=null,R=a.next();E!==null&&!R.done;y++,R=a.next()){E.index>y?(b=E,E=null):b=E.sibling;var A=_(l,E,R.value,v);if(A===null){E===null&&(E=b);break}e&&E&&A.alternate===null&&t(l,E),s=h(A,s,y),x===null?C=A:x.sibling=A,x=A,E=b}if(R.done)return r(l,E),ce&&Qt(l,y),C;if(E===null){for(;!R.done;y++,R=a.next())R=d(l,R.value,v),R!==null&&(s=h(R,s,y),x===null?C=R:x.sibling=R,x=R);return ce&&Qt(l,y),C}for(E=i(l,E);!R.done;y++,R=a.next())R=S(E,l,y,R.value,v),R!==null&&(e&&R.alternate!==null&&E.delete(R.key===null?y:R.key),s=h(R,s,y),x===null?C=R:x.sibling=R,x=R);return e&&E.forEach(function(O){return t(l,O)}),ce&&Qt(l,y),C}function u(l,s,a,v){if(typeof a=="object"&&a!==null&&a.type===fr&&a.key===null&&(a=a.props.children),typeof a=="object"&&a!==null){switch(a.$$typeof){case zi:e:{for(var C=a.key,x=s;x!==null;){if(x.key===C){if(C=a.type,C===fr){if(x.tag===7){r(l,x.sibling),s=n(x,a.props.children),s.return=l,l=s;break e}}else if(x.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Tt&&Ea(C)===x.type){r(l,x.sibling),s=n(x,a.props),s.ref=Qr(l,x,a),s.return=l,l=s;break e}r(l,x);break}else t(l,x);x=x.sibling}a.type===fr?(s=rr(a.props.children,l.mode,v,a.key),s.return=l,l=s):(v=_s(a.type,a.key,a.props,null,l.mode,v),v.ref=Qr(l,s,a),v.return=l,l=v)}return g(l);case dr:e:{for(x=a.key;s!==null;){if(s.key===x)if(s.tag===4&&s.stateNode.containerInfo===a.containerInfo&&s.stateNode.implementation===a.implementation){r(l,s.sibling),s=n(s,a.children||[]),s.return=l,l=s;break e}else{r(l,s);break}else t(l,s);s=s.sibling}s=In(a,l.mode,v),s.return=l,l=s}return g(l);case Tt:return x=a._init,u(l,s,x(a._payload),v)}if(ei(a))return w(l,s,a,v);if(Kr(a))return p(l,s,a,v);Ji(l,a)}return typeof a=="string"&&a!==""||typeof a=="number"?(a=""+a,s!==null&&s.tag===6?(r(l,s.sibling),s=n(s,a),s.return=l,l=s):(r(l,s),s=On(a,l.mode,v),s.return=l,l=s),g(l)):r(l,s)}return u}var Mr=mu(!0),Su=mu(!1),Ds=Gt(null),Rs=null,wr=null,hl=null;function dl(){hl=wr=Rs=null}function fl(e){var t=Ds.current;le(Ds),e._currentValue=t}function vo(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function Dr(e,t){Rs=e,hl=wr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Fe=!0),e.firstContext=null)}function it(e){var t=e._currentValue;if(hl!==e)if(e={context:e,memoizedValue:t,next:null},wr===null){if(Rs===null)throw Error($(308));wr=e,Rs.dependencies={lanes:0,firstContext:e}}else wr=wr.next=e;return t}var Zt=null;function _l(e){Zt===null?Zt=[e]:Zt.push(e)}function yu(e,t,r,i){var n=t.interleaved;return n===null?(r.next=r,_l(t)):(r.next=n.next,n.next=r),t.interleaved=r,kt(e,i)}function kt(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var At=!1;function pl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function wu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ct(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function zt(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,re&2){var n=i.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),i.pending=t,kt(e,r)}return n=i.interleaved,n===null?(t.next=t,_l(i)):(t.next=n.next,n.next=t),i.interleaved=t,kt(e,r)}function as(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,el(e,r)}}function ka(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var n=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var g={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};h===null?n=h=g:h=h.next=g,r=r.next}while(r!==null);h===null?n=h=t:h=h.next=t}else n=h=t;r={baseState:i.baseState,firstBaseUpdate:n,lastBaseUpdate:h,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ps(e,t,r,i){var n=e.updateQueue;At=!1;var h=n.firstBaseUpdate,g=n.lastBaseUpdate,o=n.shared.pending;if(o!==null){n.shared.pending=null;var c=o,f=c.next;c.next=null,g===null?h=f:g.next=f,g=c;var m=e.alternate;m!==null&&(m=m.updateQueue,o=m.lastBaseUpdate,o!==g&&(o===null?m.firstBaseUpdate=f:o.next=f,m.lastBaseUpdate=c))}if(h!==null){var d=n.baseState;g=0,m=f=c=null,o=h;do{var _=o.lane,S=o.eventTime;if((i&_)===_){m!==null&&(m=m.next={eventTime:S,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var w=e,p=o;switch(_=t,S=r,p.tag){case 1:if(w=p.payload,typeof w=="function"){d=w.call(S,d,_);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=p.payload,_=typeof w=="function"?w.call(S,d,_):w,_==null)break e;d=fe({},d,_);break e;case 2:At=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,_=n.effects,_===null?n.effects=[o]:_.push(o))}else S={eventTime:S,lane:_,tag:o.tag,payload:o.payload,callback:o.callback,next:null},m===null?(f=m=S,c=d):m=m.next=S,g|=_;if(o=o.next,o===null){if(o=n.shared.pending,o===null)break;_=o,o=_.next,_.next=null,n.lastBaseUpdate=_,n.shared.pending=null}}while(!0);if(m===null&&(c=d),n.baseState=c,n.firstBaseUpdate=f,n.lastBaseUpdate=m,t=n.shared.interleaved,t!==null){n=t;do g|=n.lane,n=n.next;while(n!==t)}else h===null&&(n.shared.lanes=0);lr|=g,e.lanes=g,e.memoizedState=d}}function ba(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],n=i.callback;if(n!==null){if(i.callback=null,i=r,typeof n!="function")throw Error($(191,n));n.call(i)}}}var Ii={},gt=Gt(Ii),ki=Gt(Ii),bi=Gt(Ii);function er(e){if(e===Ii)throw Error($(174));return e}function vl(e,t){switch(ne(bi,t),ne(ki,e),ne(gt,Ii),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Xn(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Xn(t,e)}le(gt),ne(gt,t)}function Br(){le(gt),le(ki),le(bi)}function Cu(e){er(bi.current);var t=er(gt.current),r=Xn(t,e.type);t!==r&&(ne(ki,e),ne(gt,r))}function gl(e){ki.current===e&&(le(gt),le(ki))}var he=Gt(0);function Ts(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 Rn=[];function ml(){for(var e=0;e<Rn.length;e++)Rn[e]._workInProgressVersionPrimary=null;Rn.length=0}var cs=Lt.ReactCurrentDispatcher,Pn=Lt.ReactCurrentBatchConfig,or=0,de=null,Ce=null,Ee=null,As=!1,ci=!1,Li=0,Df=0;function Pe(){throw Error($(321))}function Sl(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!ht(e[r],t[r]))return!1;return!0}function yl(e,t,r,i,n,h){if(or=h,de=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,cs.current=e===null||e.memoizedState===null?Af:Mf,e=r(i,n),ci){h=0;do{if(ci=!1,Li=0,25<=h)throw Error($(301));h+=1,Ee=Ce=null,t.updateQueue=null,cs.current=Bf,e=r(i,n)}while(ci)}if(cs.current=Ms,t=Ce!==null&&Ce.next!==null,or=0,Ee=Ce=de=null,As=!1,t)throw Error($(300));return e}function wl(){var e=Li!==0;return Li=0,e}function _t(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ee===null?de.memoizedState=Ee=e:Ee=Ee.next=e,Ee}function st(){if(Ce===null){var e=de.alternate;e=e!==null?e.memoizedState:null}else e=Ce.next;var t=Ee===null?de.memoizedState:Ee.next;if(t!==null)Ee=t,Ce=e;else{if(e===null)throw Error($(310));Ce=e,e={memoizedState:Ce.memoizedState,baseState:Ce.baseState,baseQueue:Ce.baseQueue,queue:Ce.queue,next:null},Ee===null?de.memoizedState=Ee=e:Ee=Ee.next=e}return Ee}function Di(e,t){return typeof t=="function"?t(e):t}function Tn(e){var t=st(),r=t.queue;if(r===null)throw Error($(311));r.lastRenderedReducer=e;var i=Ce,n=i.baseQueue,h=r.pending;if(h!==null){if(n!==null){var g=n.next;n.next=h.next,h.next=g}i.baseQueue=n=h,r.pending=null}if(n!==null){h=n.next,i=i.baseState;var o=g=null,c=null,f=h;do{var m=f.lane;if((or&m)===m)c!==null&&(c=c.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),i=f.hasEagerState?f.eagerState:e(i,f.action);else{var d={lane:m,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};c===null?(o=c=d,g=i):c=c.next=d,de.lanes|=m,lr|=m}f=f.next}while(f!==null&&f!==h);c===null?g=i:c.next=o,ht(i,t.memoizedState)||(Fe=!0),t.memoizedState=i,t.baseState=g,t.baseQueue=c,r.lastRenderedState=i}if(e=r.interleaved,e!==null){n=e;do h=n.lane,de.lanes|=h,lr|=h,n=n.next;while(n!==e)}else n===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function An(e){var t=st(),r=t.queue;if(r===null)throw Error($(311));r.lastRenderedReducer=e;var i=r.dispatch,n=r.pending,h=t.memoizedState;if(n!==null){r.pending=null;var g=n=n.next;do h=e(h,g.action),g=g.next;while(g!==n);ht(h,t.memoizedState)||(Fe=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),r.lastRenderedState=h}return[h,i]}function xu(){}function Eu(e,t){var r=de,i=st(),n=t(),h=!ht(i.memoizedState,n);if(h&&(i.memoizedState=n,Fe=!0),i=i.queue,Cl(Lu.bind(null,r,i,e),[e]),i.getSnapshot!==t||h||Ee!==null&&Ee.memoizedState.tag&1){if(r.flags|=2048,Ri(9,bu.bind(null,r,i,n,t),void 0,null),ke===null)throw Error($(349));or&30||ku(r,t,n)}return n}function ku(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=de.updateQueue,t===null?(t={lastEffect:null,stores:null},de.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function bu(e,t,r,i){t.value=r,t.getSnapshot=i,Du(t)&&Ru(e)}function Lu(e,t,r){return r(function(){Du(t)&&Ru(e)})}function Du(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!ht(e,r)}catch{return!0}}function Ru(e){var t=kt(e,1);t!==null&&ut(t,e,1,-1)}function La(e){var t=_t();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:e},t.queue=e,e=e.dispatch=Tf.bind(null,de,e),[t.memoizedState,e]}function Ri(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=de.updateQueue,t===null?(t={lastEffect:null,stores:null},de.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function Pu(){return st().memoizedState}function us(e,t,r,i){var n=_t();de.flags|=e,n.memoizedState=Ri(1|t,r,void 0,i===void 0?null:i)}function Gs(e,t,r,i){var n=st();i=i===void 0?null:i;var h=void 0;if(Ce!==null){var g=Ce.memoizedState;if(h=g.destroy,i!==null&&Sl(i,g.deps)){n.memoizedState=Ri(t,r,h,i);return}}de.flags|=e,n.memoizedState=Ri(1|t,r,h,i)}function Da(e,t){return us(8390656,8,e,t)}function Cl(e,t){return Gs(2048,8,e,t)}function Tu(e,t){return Gs(4,2,e,t)}function Au(e,t){return Gs(4,4,e,t)}function Mu(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Bu(e,t,r){return r=r!=null?r.concat([e]):null,Gs(4,4,Mu.bind(null,t,e),r)}function xl(){}function Ou(e,t){var r=st();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Sl(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function Iu(e,t){var r=st();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Sl(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function Nu(e,t,r){return or&21?(ht(r,t)||(r=Wc(),de.lanes|=r,lr|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Fe=!0),e.memoizedState=r)}function Rf(e,t){var r=se;se=r!==0&&4>r?r:4,e(!0);var i=Pn.transition;Pn.transition={};try{e(!1),t()}finally{se=r,Pn.transition=i}}function ju(){return st().memoizedState}function Pf(e,t,r){var i=Ut(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},Hu(e))Fu(t,r);else if(r=yu(e,t,r,i),r!==null){var n=Oe();ut(r,e,i,n),zu(r,t,i)}}function Tf(e,t,r){var i=Ut(e),n={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(Hu(e))Fu(t,n);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var g=t.lastRenderedState,o=h(g,r);if(n.hasEagerState=!0,n.eagerState=o,ht(o,g)){var c=t.interleaved;c===null?(n.next=n,_l(t)):(n.next=c.next,c.next=n),t.interleaved=n;return}}catch{}finally{}r=yu(e,t,n,i),r!==null&&(n=Oe(),ut(r,e,i,n),zu(r,t,i))}}function Hu(e){var t=e.alternate;return e===de||t!==null&&t===de}function Fu(e,t){ci=As=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function zu(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,el(e,r)}}var Ms={readContext:it,useCallback:Pe,useContext:Pe,useEffect:Pe,useImperativeHandle:Pe,useInsertionEffect:Pe,useLayoutEffect:Pe,useMemo:Pe,useReducer:Pe,useRef:Pe,useState:Pe,useDebugValue:Pe,useDeferredValue:Pe,useTransition:Pe,useMutableSource:Pe,useSyncExternalStore:Pe,useId:Pe,unstable_isNewReconciler:!1},Af={readContext:it,useCallback:function(e,t){return _t().memoizedState=[e,t===void 0?null:t],e},useContext:it,useEffect:Da,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,us(4194308,4,Mu.bind(null,t,e),r)},useLayoutEffect:function(e,t){return us(4194308,4,e,t)},useInsertionEffect:function(e,t){return us(4,2,e,t)},useMemo:function(e,t){var r=_t();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=_t();return t=r!==void 0?r(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Pf.bind(null,de,e),[i.memoizedState,e]},useRef:function(e){var t=_t();return e={current:e},t.memoizedState=e},useState:La,useDebugValue:xl,useDeferredValue:function(e){return _t().memoizedState=e},useTransition:function(){var e=La(!1),t=e[0];return e=Rf.bind(null,e[1]),_t().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=de,n=_t();if(ce){if(r===void 0)throw Error($(407));r=r()}else{if(r=t(),ke===null)throw Error($(349));or&30||ku(i,t,r)}n.memoizedState=r;var h={value:r,getSnapshot:t};return n.queue=h,Da(Lu.bind(null,i,h,e),[e]),i.flags|=2048,Ri(9,bu.bind(null,i,h,r,t),void 0,null),r},useId:function(){var e=_t(),t=ke.identifierPrefix;if(ce){var r=wt,i=yt;r=(i&~(1<<32-ct(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=Li++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Df++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Mf={readContext:it,useCallback:Ou,useContext:it,useEffect:Cl,useImperativeHandle:Bu,useInsertionEffect:Tu,useLayoutEffect:Au,useMemo:Iu,useReducer:Tn,useRef:Pu,useState:function(){return Tn(Di)},useDebugValue:xl,useDeferredValue:function(e){var t=st();return Nu(t,Ce.memoizedState,e)},useTransition:function(){var e=Tn(Di)[0],t=st().memoizedState;return[e,t]},useMutableSource:xu,useSyncExternalStore:Eu,useId:ju,unstable_isNewReconciler:!1},Bf={readContext:it,useCallback:Ou,useContext:it,useEffect:Cl,useImperativeHandle:Bu,useInsertionEffect:Tu,useLayoutEffect:Au,useMemo:Iu,useReducer:An,useRef:Pu,useState:function(){return An(Di)},useDebugValue:xl,useDeferredValue:function(e){var t=st();return Ce===null?t.memoizedState=e:Nu(t,Ce.memoizedState,e)},useTransition:function(){var e=An(Di)[0],t=st().memoizedState;return[e,t]},useMutableSource:xu,useSyncExternalStore:Eu,useId:ju,unstable_isNewReconciler:!1};function ot(e,t){if(e&&e.defaultProps){t=fe({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function go(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:fe({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Xs={isMounted:function(e){return(e=e._reactInternals)?ur(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=Oe(),n=Ut(e),h=Ct(i,n);h.payload=t,r!=null&&(h.callback=r),t=zt(e,h,n),t!==null&&(ut(t,e,n,i),as(t,e,n))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=Oe(),n=Ut(e),h=Ct(i,n);h.tag=1,h.payload=t,r!=null&&(h.callback=r),t=zt(e,h,n),t!==null&&(ut(t,e,n,i),as(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Oe(),i=Ut(e),n=Ct(r,i);n.tag=2,t!=null&&(n.callback=t),t=zt(e,n,i),t!==null&&(ut(t,e,i,r),as(t,e,i))}};function Ra(e,t,r,i,n,h,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,h,g):t.prototype&&t.prototype.isPureReactComponent?!wi(r,i)||!wi(n,h):!0}function Wu(e,t,r){var i=!1,n=Vt,h=t.contextType;return typeof h=="object"&&h!==null?h=it(h):(n=We(t)?sr:Me.current,i=t.contextTypes,h=(i=i!=null)?Tr(e,n):Vt),t=new t(r,h),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Xs,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=h),t}function Pa(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&Xs.enqueueReplaceState(t,t.state,null)}function mo(e,t,r,i){var n=e.stateNode;n.props=r,n.state=e.memoizedState,n.refs={},pl(e);var h=t.contextType;typeof h=="object"&&h!==null?n.context=it(h):(h=We(t)?sr:Me.current,n.context=Tr(e,h)),n.state=e.memoizedState,h=t.getDerivedStateFromProps,typeof h=="function"&&(go(e,t,h,r),n.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(t=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),t!==n.state&&Xs.enqueueReplaceState(n,n.state,null),Ps(e,r,n,i),n.state=e.memoizedState),typeof n.componentDidMount=="function"&&(e.flags|=4194308)}function Or(e,t){try{var r="",i=t;do r+=ld(i),i=i.return;while(i);var n=r}catch(h){n=`
|
|
39
|
+
Error generating stack: `+h.message+`
|
|
40
|
+
`+h.stack}return{value:e,source:t,stack:n,digest:null}}function Mn(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function So(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Of=typeof WeakMap=="function"?WeakMap:Map;function Uu(e,t,r){r=Ct(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){Os||(Os=!0,Ro=i),So(e,t)},r}function $u(e,t,r){r=Ct(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var n=t.value;r.payload=function(){return i(n)},r.callback=function(){So(e,t)}}var h=e.stateNode;return h!==null&&typeof h.componentDidCatch=="function"&&(r.callback=function(){So(e,t),typeof i!="function"&&(Wt===null?Wt=new Set([this]):Wt.add(this));var g=t.stack;this.componentDidCatch(t.value,{componentStack:g!==null?g:""})}),r}function Ta(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new Of;var n=new Set;i.set(t,n)}else n=i.get(t),n===void 0&&(n=new Set,i.set(t,n));n.has(r)||(n.add(r),e=Xf.bind(null,e,t,r),t.then(e,e))}function Aa(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ma(e,t,r,i,n){return e.mode&1?(e.flags|=65536,e.lanes=n,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Ct(-1,1),t.tag=2,zt(r,t,1))),r.lanes|=1),e)}var If=Lt.ReactCurrentOwner,Fe=!1;function Be(e,t,r,i){t.child=e===null?Su(t,null,r,i):Mr(t,e.child,r,i)}function Ba(e,t,r,i,n){r=r.render;var h=t.ref;return Dr(t,n),i=yl(e,t,r,i,h,n),r=wl(),e!==null&&!Fe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,bt(e,t,n)):(ce&&r&&al(t),t.flags|=1,Be(e,t,i,n),t.child)}function Oa(e,t,r,i,n){if(e===null){var h=r.type;return typeof h=="function"&&!Tl(h)&&h.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=h,Ku(e,t,h,i,n)):(e=_s(r.type,null,i,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!(e.lanes&n)){var g=h.memoizedProps;if(r=r.compare,r=r!==null?r:wi,r(g,i)&&e.ref===t.ref)return bt(e,t,n)}return t.flags|=1,e=$t(h,i),e.ref=t.ref,e.return=t,t.child=e}function Ku(e,t,r,i,n){if(e!==null){var h=e.memoizedProps;if(wi(h,i)&&e.ref===t.ref)if(Fe=!1,t.pendingProps=i=h,(e.lanes&n)!==0)e.flags&131072&&(Fe=!0);else return t.lanes=e.lanes,bt(e,t,n)}return yo(e,t,r,i,n)}function Vu(e,t,r){var i=t.pendingProps,n=i.children,h=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ne(xr,$e),$e|=r;else{if(!(r&1073741824))return e=h!==null?h.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ne(xr,$e),$e|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=h!==null?h.baseLanes:r,ne(xr,$e),$e|=i}else h!==null?(i=h.baseLanes|r,t.memoizedState=null):i=r,ne(xr,$e),$e|=i;return Be(e,t,n,r),t.child}function qu(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function yo(e,t,r,i,n){var h=We(r)?sr:Me.current;return h=Tr(t,h),Dr(t,n),r=yl(e,t,r,i,h,n),i=wl(),e!==null&&!Fe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,bt(e,t,n)):(ce&&i&&al(t),t.flags|=1,Be(e,t,r,n),t.child)}function Ia(e,t,r,i,n){if(We(r)){var h=!0;ks(t)}else h=!1;if(Dr(t,n),t.stateNode===null)hs(e,t),Wu(t,r,i),mo(t,r,i,n),i=!0;else if(e===null){var g=t.stateNode,o=t.memoizedProps;g.props=o;var c=g.context,f=r.contextType;typeof f=="object"&&f!==null?f=it(f):(f=We(r)?sr:Me.current,f=Tr(t,f));var m=r.getDerivedStateFromProps,d=typeof m=="function"||typeof g.getSnapshotBeforeUpdate=="function";d||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(o!==i||c!==f)&&Pa(t,g,i,f),At=!1;var _=t.memoizedState;g.state=_,Ps(t,i,g,n),c=t.memoizedState,o!==i||_!==c||ze.current||At?(typeof m=="function"&&(go(t,r,m,i),c=t.memoizedState),(o=At||Ra(t,r,o,i,_,c,f))?(d||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(t.flags|=4194308)):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=c),g.props=i,g.state=c,g.context=f,i=o):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{g=t.stateNode,wu(e,t),o=t.memoizedProps,f=t.type===t.elementType?o:ot(t.type,o),g.props=f,d=t.pendingProps,_=g.context,c=r.contextType,typeof c=="object"&&c!==null?c=it(c):(c=We(r)?sr:Me.current,c=Tr(t,c));var S=r.getDerivedStateFromProps;(m=typeof S=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(o!==d||_!==c)&&Pa(t,g,i,c),At=!1,_=t.memoizedState,g.state=_,Ps(t,i,g,n);var w=t.memoizedState;o!==d||_!==w||ze.current||At?(typeof S=="function"&&(go(t,r,S,i),w=t.memoizedState),(f=At||Ra(t,r,f,i,_,w,c)||!1)?(m||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(i,w,c),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(i,w,c)),typeof g.componentDidUpdate=="function"&&(t.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof g.componentDidUpdate!="function"||o===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=w),g.props=i,g.state=w,g.context=c,i=f):(typeof g.componentDidUpdate!="function"||o===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),i=!1)}return wo(e,t,r,i,h,n)}function wo(e,t,r,i,n,h){qu(e,t);var g=(t.flags&128)!==0;if(!i&&!g)return n&&wa(t,r,!1),bt(e,t,h);i=t.stateNode,If.current=t;var o=g&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&g?(t.child=Mr(t,e.child,null,h),t.child=Mr(t,null,o,h)):Be(e,t,o,h),t.memoizedState=i.state,n&&wa(t,r,!0),t.child}function Gu(e){var t=e.stateNode;t.pendingContext?ya(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ya(e,t.context,!1),vl(e,t.containerInfo)}function Na(e,t,r,i,n){return Ar(),ul(n),t.flags|=256,Be(e,t,r,i),t.child}var Co={dehydrated:null,treeContext:null,retryLane:0};function xo(e){return{baseLanes:e,cachePool:null,transitions:null}}function Xu(e,t,r){var i=t.pendingProps,n=he.current,h=!1,g=(t.flags&128)!==0,o;if((o=g)||(o=e!==null&&e.memoizedState===null?!1:(n&2)!==0),o?(h=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(n|=1),ne(he,n&1),e===null)return po(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(g=i.children,e=i.fallback,h?(i=t.mode,h=t.child,g={mode:"hidden",children:g},!(i&1)&&h!==null?(h.childLanes=0,h.pendingProps=g):h=Js(g,i,0,null),e=rr(e,i,r,null),h.return=t,e.return=t,h.sibling=e,t.child=h,t.child.memoizedState=xo(r),t.memoizedState=Co,e):El(t,g));if(n=e.memoizedState,n!==null&&(o=n.dehydrated,o!==null))return Nf(e,t,g,i,o,n,r);if(h){h=i.fallback,g=t.mode,n=e.child,o=n.sibling;var c={mode:"hidden",children:i.children};return!(g&1)&&t.child!==n?(i=t.child,i.childLanes=0,i.pendingProps=c,t.deletions=null):(i=$t(n,c),i.subtreeFlags=n.subtreeFlags&14680064),o!==null?h=$t(o,h):(h=rr(h,g,r,null),h.flags|=2),h.return=t,i.return=t,i.sibling=h,t.child=i,i=h,h=t.child,g=e.child.memoizedState,g=g===null?xo(r):{baseLanes:g.baseLanes|r,cachePool:null,transitions:g.transitions},h.memoizedState=g,h.childLanes=e.childLanes&~r,t.memoizedState=Co,i}return h=e.child,e=h.sibling,i=$t(h,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function El(e,t){return t=Js({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Zi(e,t,r,i){return i!==null&&ul(i),Mr(t,e.child,null,r),e=El(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Nf(e,t,r,i,n,h,g){if(r)return t.flags&256?(t.flags&=-257,i=Mn(Error($(422))),Zi(e,t,g,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(h=i.fallback,n=t.mode,i=Js({mode:"visible",children:i.children},n,0,null),h=rr(h,n,g,null),h.flags|=2,i.return=t,h.return=t,i.sibling=h,t.child=i,t.mode&1&&Mr(t,e.child,null,g),t.child.memoizedState=xo(g),t.memoizedState=Co,h);if(!(t.mode&1))return Zi(e,t,g,null);if(n.data==="$!"){if(i=n.nextSibling&&n.nextSibling.dataset,i)var o=i.dgst;return i=o,h=Error($(419)),i=Mn(h,i,void 0),Zi(e,t,g,i)}if(o=(g&e.childLanes)!==0,Fe||o){if(i=ke,i!==null){switch(g&-g){case 4:n=2;break;case 16:n=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:n=32;break;case 536870912:n=268435456;break;default:n=0}n=n&(i.suspendedLanes|g)?0:n,n!==0&&n!==h.retryLane&&(h.retryLane=n,kt(e,n),ut(i,e,n,-1))}return Pl(),i=Mn(Error($(421))),Zi(e,t,g,i)}return n.data==="$?"?(t.flags|=128,t.child=e.child,t=Qf.bind(null,e),n._reactRetry=t,null):(e=h.treeContext,Ve=Ft(n.nextSibling),qe=t,ce=!0,at=null,e!==null&&(Ze[et++]=yt,Ze[et++]=wt,Ze[et++]=nr,yt=e.id,wt=e.overflow,nr=t),t=El(t,i.children),t.flags|=4096,t)}function ja(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),vo(e.return,t,r)}function Bn(e,t,r,i,n){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:n}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=i,h.tail=r,h.tailMode=n)}function Qu(e,t,r){var i=t.pendingProps,n=i.revealOrder,h=i.tail;if(Be(e,t,i.children,r),i=he.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ja(e,r,t);else if(e.tag===19)ja(e,r,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}i&=1}if(ne(he,i),!(t.mode&1))t.memoizedState=null;else switch(n){case"forwards":for(r=t.child,n=null;r!==null;)e=r.alternate,e!==null&&Ts(e)===null&&(n=r),r=r.sibling;r=n,r===null?(n=t.child,t.child=null):(n=r.sibling,r.sibling=null),Bn(t,!1,n,r,h);break;case"backwards":for(r=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&Ts(e)===null){t.child=n;break}e=n.sibling,n.sibling=r,r=n,n=e}Bn(t,!0,r,null,h);break;case"together":Bn(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function hs(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function bt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),lr|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error($(153));if(t.child!==null){for(e=t.child,r=$t(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=$t(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function jf(e,t,r){switch(t.tag){case 3:Gu(t),Ar();break;case 5:Cu(t);break;case 1:We(t.type)&&ks(t);break;case 4:vl(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,n=t.memoizedProps.value;ne(Ds,i._currentValue),i._currentValue=n;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(ne(he,he.current&1),t.flags|=128,null):r&t.child.childLanes?Xu(e,t,r):(ne(he,he.current&1),e=bt(e,t,r),e!==null?e.sibling:null);ne(he,he.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return Qu(e,t,r);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),ne(he,he.current),i)break;return null;case 22:case 23:return t.lanes=0,Vu(e,t,r)}return bt(e,t,r)}var Yu,Eo,Ju,Zu;Yu=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Eo=function(){};Ju=function(e,t,r,i){var n=e.memoizedProps;if(n!==i){e=t.stateNode,er(gt.current);var h=null;switch(r){case"input":n=Kn(e,n),i=Kn(e,i),h=[];break;case"select":n=fe({},n,{value:void 0}),i=fe({},i,{value:void 0}),h=[];break;case"textarea":n=Gn(e,n),i=Gn(e,i),h=[];break;default:typeof n.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=xs)}Qn(r,i);var g;r=null;for(f in n)if(!i.hasOwnProperty(f)&&n.hasOwnProperty(f)&&n[f]!=null)if(f==="style"){var o=n[f];for(g in o)o.hasOwnProperty(g)&&(r||(r={}),r[g]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(_i.hasOwnProperty(f)?h||(h=[]):(h=h||[]).push(f,null));for(f in i){var c=i[f];if(o=n!=null?n[f]:void 0,i.hasOwnProperty(f)&&c!==o&&(c!=null||o!=null))if(f==="style")if(o){for(g in o)!o.hasOwnProperty(g)||c&&c.hasOwnProperty(g)||(r||(r={}),r[g]="");for(g in c)c.hasOwnProperty(g)&&o[g]!==c[g]&&(r||(r={}),r[g]=c[g])}else r||(h||(h=[]),h.push(f,r)),r=c;else f==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(h=h||[]).push(f,c)):f==="children"?typeof c!="string"&&typeof c!="number"||(h=h||[]).push(f,""+c):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(_i.hasOwnProperty(f)?(c!=null&&f==="onScroll"&&oe("scroll",e),h||o===c||(h=[])):(h=h||[]).push(f,c))}r&&(h=h||[]).push("style",r);var f=h;(t.updateQueue=f)&&(t.flags|=4)}};Zu=function(e,t,r,i){r!==i&&(t.flags|=4)};function Yr(e,t){if(!ce)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Te(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var n=e.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags&14680064,i|=n.flags&14680064,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags,i|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function Hf(e,t,r){var i=t.pendingProps;switch(cl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Te(t),null;case 1:return We(t.type)&&Es(),Te(t),null;case 3:return i=t.stateNode,Br(),le(ze),le(Me),ml(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Yi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,at!==null&&(Ao(at),at=null))),Eo(e,t),Te(t),null;case 5:gl(t);var n=er(bi.current);if(r=t.type,e!==null&&t.stateNode!=null)Ju(e,t,r,i,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error($(166));return Te(t),null}if(e=er(gt.current),Yi(t)){i=t.stateNode,r=t.type;var h=t.memoizedProps;switch(i[pt]=t,i[Ei]=h,e=(t.mode&1)!==0,r){case"dialog":oe("cancel",i),oe("close",i);break;case"iframe":case"object":case"embed":oe("load",i);break;case"video":case"audio":for(n=0;n<ri.length;n++)oe(ri[n],i);break;case"source":oe("error",i);break;case"img":case"image":case"link":oe("error",i),oe("load",i);break;case"details":oe("toggle",i);break;case"input":ql(i,h),oe("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!h.multiple},oe("invalid",i);break;case"textarea":Xl(i,h),oe("invalid",i)}Qn(r,h),n=null;for(var g in h)if(h.hasOwnProperty(g)){var o=h[g];g==="children"?typeof o=="string"?i.textContent!==o&&(h.suppressHydrationWarning!==!0&&Qi(i.textContent,o,e),n=["children",o]):typeof o=="number"&&i.textContent!==""+o&&(h.suppressHydrationWarning!==!0&&Qi(i.textContent,o,e),n=["children",""+o]):_i.hasOwnProperty(g)&&o!=null&&g==="onScroll"&&oe("scroll",i)}switch(r){case"input":Wi(i),Gl(i,h,!0);break;case"textarea":Wi(i),Ql(i);break;case"select":case"option":break;default:typeof h.onClick=="function"&&(i.onclick=xs)}i=n,t.updateQueue=i,i!==null&&(t.flags|=4)}else{g=n.nodeType===9?n:n.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Lc(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=g.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=g.createElement(r,{is:i.is}):(e=g.createElement(r),r==="select"&&(g=e,i.multiple?g.multiple=!0:i.size&&(g.size=i.size))):e=g.createElementNS(e,r),e[pt]=t,e[Ei]=i,Yu(e,t,!1,!1),t.stateNode=e;e:{switch(g=Yn(r,i),r){case"dialog":oe("cancel",e),oe("close",e),n=i;break;case"iframe":case"object":case"embed":oe("load",e),n=i;break;case"video":case"audio":for(n=0;n<ri.length;n++)oe(ri[n],e);n=i;break;case"source":oe("error",e),n=i;break;case"img":case"image":case"link":oe("error",e),oe("load",e),n=i;break;case"details":oe("toggle",e),n=i;break;case"input":ql(e,i),n=Kn(e,i),oe("invalid",e);break;case"option":n=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},n=fe({},i,{value:void 0}),oe("invalid",e);break;case"textarea":Xl(e,i),n=Gn(e,i),oe("invalid",e);break;default:n=i}Qn(r,n),o=n;for(h in o)if(o.hasOwnProperty(h)){var c=o[h];h==="style"?Pc(e,c):h==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Dc(e,c)):h==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&pi(e,c):typeof c=="number"&&pi(e,""+c):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(_i.hasOwnProperty(h)?c!=null&&h==="onScroll"&&oe("scroll",e):c!=null&&Go(e,h,c,g))}switch(r){case"input":Wi(e),Gl(e,i,!1);break;case"textarea":Wi(e),Ql(e);break;case"option":i.value!=null&&e.setAttribute("value",""+Kt(i.value));break;case"select":e.multiple=!!i.multiple,h=i.value,h!=null?Er(e,!!i.multiple,h,!1):i.defaultValue!=null&&Er(e,!!i.multiple,i.defaultValue,!0);break;default:typeof n.onClick=="function"&&(e.onclick=xs)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Te(t),null;case 6:if(e&&t.stateNode!=null)Zu(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error($(166));if(r=er(bi.current),er(gt.current),Yi(t)){if(i=t.stateNode,r=t.memoizedProps,i[pt]=t,(h=i.nodeValue!==r)&&(e=qe,e!==null))switch(e.tag){case 3:Qi(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Qi(i.nodeValue,r,(e.mode&1)!==0)}h&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[pt]=t,t.stateNode=i}return Te(t),null;case 13:if(le(he),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ce&&Ve!==null&&t.mode&1&&!(t.flags&128))gu(),Ar(),t.flags|=98560,h=!1;else if(h=Yi(t),i!==null&&i.dehydrated!==null){if(e===null){if(!h)throw Error($(318));if(h=t.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error($(317));h[pt]=t}else Ar(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Te(t),h=!1}else at!==null&&(Ao(at),at=null),h=!0;if(!h)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||he.current&1?xe===0&&(xe=3):Pl())),t.updateQueue!==null&&(t.flags|=4),Te(t),null);case 4:return Br(),Eo(e,t),e===null&&Ci(t.stateNode.containerInfo),Te(t),null;case 10:return fl(t.type._context),Te(t),null;case 17:return We(t.type)&&Es(),Te(t),null;case 19:if(le(he),h=t.memoizedState,h===null)return Te(t),null;if(i=(t.flags&128)!==0,g=h.rendering,g===null)if(i)Yr(h,!1);else{if(xe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(g=Ts(e),g!==null){for(t.flags|=128,Yr(h,!1),i=g.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)h=r,e=i,h.flags&=14680066,g=h.alternate,g===null?(h.childLanes=0,h.lanes=e,h.child=null,h.subtreeFlags=0,h.memoizedProps=null,h.memoizedState=null,h.updateQueue=null,h.dependencies=null,h.stateNode=null):(h.childLanes=g.childLanes,h.lanes=g.lanes,h.child=g.child,h.subtreeFlags=0,h.deletions=null,h.memoizedProps=g.memoizedProps,h.memoizedState=g.memoizedState,h.updateQueue=g.updateQueue,h.type=g.type,e=g.dependencies,h.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return ne(he,he.current&1|2),t.child}e=e.sibling}h.tail!==null&&me()>Ir&&(t.flags|=128,i=!0,Yr(h,!1),t.lanes=4194304)}else{if(!i)if(e=Ts(g),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Yr(h,!0),h.tail===null&&h.tailMode==="hidden"&&!g.alternate&&!ce)return Te(t),null}else 2*me()-h.renderingStartTime>Ir&&r!==1073741824&&(t.flags|=128,i=!0,Yr(h,!1),t.lanes=4194304);h.isBackwards?(g.sibling=t.child,t.child=g):(r=h.last,r!==null?r.sibling=g:t.child=g,h.last=g)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=me(),t.sibling=null,r=he.current,ne(he,i?r&1|2:r&1),t):(Te(t),null);case 22:case 23:return Rl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?$e&1073741824&&(Te(t),t.subtreeFlags&6&&(t.flags|=8192)):Te(t),null;case 24:return null;case 25:return null}throw Error($(156,t.tag))}function Ff(e,t){switch(cl(t),t.tag){case 1:return We(t.type)&&Es(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Br(),le(ze),le(Me),ml(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return gl(t),null;case 13:if(le(he),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error($(340));Ar()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(he),null;case 4:return Br(),null;case 10:return fl(t.type._context),null;case 22:case 23:return Rl(),null;case 24:return null;default:return null}}var es=!1,Ae=!1,zf=typeof WeakSet=="function"?WeakSet:Set,X=null;function Cr(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){ve(e,t,i)}else r.current=null}function ko(e,t,r){try{r()}catch(i){ve(e,t,i)}}var Ha=!1;function Wf(e,t){if(lo=ys,e=su(),ll(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var n=i.anchorOffset,h=i.focusNode;i=i.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var g=0,o=-1,c=-1,f=0,m=0,d=e,_=null;t:for(;;){for(var S;d!==r||n!==0&&d.nodeType!==3||(o=g+n),d!==h||i!==0&&d.nodeType!==3||(c=g+i),d.nodeType===3&&(g+=d.nodeValue.length),(S=d.firstChild)!==null;)_=d,d=S;for(;;){if(d===e)break t;if(_===r&&++f===n&&(o=g),_===h&&++m===i&&(c=g),(S=d.nextSibling)!==null)break;d=_,_=d.parentNode}d=S}r=o===-1||c===-1?null:{start:o,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(ao={focusedElem:e,selectionRange:r},ys=!1,X=t;X!==null;)if(t=X,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,X=e;else for(;X!==null;){t=X;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var p=w.memoizedProps,u=w.memoizedState,l=t.stateNode,s=l.getSnapshotBeforeUpdate(t.elementType===t.type?p:ot(t.type,p),u);l.__reactInternalSnapshotBeforeUpdate=s}break;case 3:var a=t.stateNode.containerInfo;a.nodeType===1?a.textContent="":a.nodeType===9&&a.documentElement&&a.removeChild(a.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error($(163))}}catch(v){ve(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,X=e;break}X=t.return}return w=Ha,Ha=!1,w}function ui(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var n=i=i.next;do{if((n.tag&e)===e){var h=n.destroy;n.destroy=void 0,h!==void 0&&ko(t,r,h)}n=n.next}while(n!==i)}}function Qs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function bo(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function eh(e){var t=e.alternate;t!==null&&(e.alternate=null,eh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[pt],delete t[Ei],delete t[ho],delete t[Ef],delete t[kf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function th(e){return e.tag===5||e.tag===3||e.tag===4}function Fa(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||th(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.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 Lo(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=xs));else if(i!==4&&(e=e.child,e!==null))for(Lo(e,t,r),e=e.sibling;e!==null;)Lo(e,t,r),e=e.sibling}function Do(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Do(e,t,r),e=e.sibling;e!==null;)Do(e,t,r),e=e.sibling}var be=null,lt=!1;function Pt(e,t,r){for(r=r.child;r!==null;)rh(e,t,r),r=r.sibling}function rh(e,t,r){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(Ws,r)}catch{}switch(r.tag){case 5:Ae||Cr(r,t);case 6:var i=be,n=lt;be=null,Pt(e,t,r),be=i,lt=n,be!==null&&(lt?(e=be,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):be.removeChild(r.stateNode));break;case 18:be!==null&&(lt?(e=be,r=r.stateNode,e.nodeType===8?Ln(e.parentNode,r):e.nodeType===1&&Ln(e,r),Si(e)):Ln(be,r.stateNode));break;case 4:i=be,n=lt,be=r.stateNode.containerInfo,lt=!0,Pt(e,t,r),be=i,lt=n;break;case 0:case 11:case 14:case 15:if(!Ae&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){n=i=i.next;do{var h=n,g=h.destroy;h=h.tag,g!==void 0&&(h&2||h&4)&&ko(r,t,g),n=n.next}while(n!==i)}Pt(e,t,r);break;case 1:if(!Ae&&(Cr(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(o){ve(r,t,o)}Pt(e,t,r);break;case 21:Pt(e,t,r);break;case 22:r.mode&1?(Ae=(i=Ae)||r.memoizedState!==null,Pt(e,t,r),Ae=i):Pt(e,t,r);break;default:Pt(e,t,r)}}function za(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new zf),t.forEach(function(i){var n=Yf.bind(null,e,i);r.has(i)||(r.add(i),i.then(n,n))})}}function nt(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var n=r[i];try{var h=e,g=t,o=g;e:for(;o!==null;){switch(o.tag){case 5:be=o.stateNode,lt=!1;break e;case 3:be=o.stateNode.containerInfo,lt=!0;break e;case 4:be=o.stateNode.containerInfo,lt=!0;break e}o=o.return}if(be===null)throw Error($(160));rh(h,g,n),be=null,lt=!1;var c=n.alternate;c!==null&&(c.return=null),n.return=null}catch(f){ve(n,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ih(t,e),t=t.sibling}function ih(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(nt(t,e),ft(e),i&4){try{ui(3,e,e.return),Qs(3,e)}catch(p){ve(e,e.return,p)}try{ui(5,e,e.return)}catch(p){ve(e,e.return,p)}}break;case 1:nt(t,e),ft(e),i&512&&r!==null&&Cr(r,r.return);break;case 5:if(nt(t,e),ft(e),i&512&&r!==null&&Cr(r,r.return),e.flags&32){var n=e.stateNode;try{pi(n,"")}catch(p){ve(e,e.return,p)}}if(i&4&&(n=e.stateNode,n!=null)){var h=e.memoizedProps,g=r!==null?r.memoizedProps:h,o=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{o==="input"&&h.type==="radio"&&h.name!=null&&kc(n,h),Yn(o,g);var f=Yn(o,h);for(g=0;g<c.length;g+=2){var m=c[g],d=c[g+1];m==="style"?Pc(n,d):m==="dangerouslySetInnerHTML"?Dc(n,d):m==="children"?pi(n,d):Go(n,m,d,f)}switch(o){case"input":Vn(n,h);break;case"textarea":bc(n,h);break;case"select":var _=n._wrapperState.wasMultiple;n._wrapperState.wasMultiple=!!h.multiple;var S=h.value;S!=null?Er(n,!!h.multiple,S,!1):_!==!!h.multiple&&(h.defaultValue!=null?Er(n,!!h.multiple,h.defaultValue,!0):Er(n,!!h.multiple,h.multiple?[]:"",!1))}n[Ei]=h}catch(p){ve(e,e.return,p)}}break;case 6:if(nt(t,e),ft(e),i&4){if(e.stateNode===null)throw Error($(162));n=e.stateNode,h=e.memoizedProps;try{n.nodeValue=h}catch(p){ve(e,e.return,p)}}break;case 3:if(nt(t,e),ft(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Si(t.containerInfo)}catch(p){ve(e,e.return,p)}break;case 4:nt(t,e),ft(e);break;case 13:nt(t,e),ft(e),n=e.child,n.flags&8192&&(h=n.memoizedState!==null,n.stateNode.isHidden=h,!h||n.alternate!==null&&n.alternate.memoizedState!==null||(Ll=me())),i&4&&za(e);break;case 22:if(m=r!==null&&r.memoizedState!==null,e.mode&1?(Ae=(f=Ae)||m,nt(t,e),Ae=f):nt(t,e),ft(e),i&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!m&&e.mode&1)for(X=e,m=e.child;m!==null;){for(d=X=m;X!==null;){switch(_=X,S=_.child,_.tag){case 0:case 11:case 14:case 15:ui(4,_,_.return);break;case 1:Cr(_,_.return);var w=_.stateNode;if(typeof w.componentWillUnmount=="function"){i=_,r=_.return;try{t=i,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(p){ve(i,r,p)}}break;case 5:Cr(_,_.return);break;case 22:if(_.memoizedState!==null){Ua(d);continue}}S!==null?(S.return=_,X=S):Ua(d)}m=m.sibling}e:for(m=null,d=e;;){if(d.tag===5){if(m===null){m=d;try{n=d.stateNode,f?(h=n.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none"):(o=d.stateNode,c=d.memoizedProps.style,g=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=Rc("display",g))}catch(p){ve(e,e.return,p)}}}else if(d.tag===6){if(m===null)try{d.stateNode.nodeValue=f?"":d.memoizedProps}catch(p){ve(e,e.return,p)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;m===d&&(m=null),d=d.return}m===d&&(m=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:nt(t,e),ft(e),i&4&&za(e);break;case 21:break;default:nt(t,e),ft(e)}}function ft(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(th(r)){var i=r;break e}r=r.return}throw Error($(160))}switch(i.tag){case 5:var n=i.stateNode;i.flags&32&&(pi(n,""),i.flags&=-33);var h=Fa(e);Do(e,h,n);break;case 3:case 4:var g=i.stateNode.containerInfo,o=Fa(e);Lo(e,o,g);break;default:throw Error($(161))}}catch(c){ve(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Uf(e,t,r){X=e,sh(e)}function sh(e,t,r){for(var i=(e.mode&1)!==0;X!==null;){var n=X,h=n.child;if(n.tag===22&&i){var g=n.memoizedState!==null||es;if(!g){var o=n.alternate,c=o!==null&&o.memoizedState!==null||Ae;o=es;var f=Ae;if(es=g,(Ae=c)&&!f)for(X=n;X!==null;)g=X,c=g.child,g.tag===22&&g.memoizedState!==null?$a(n):c!==null?(c.return=g,X=c):$a(n);for(;h!==null;)X=h,sh(h),h=h.sibling;X=n,es=o,Ae=f}Wa(e)}else n.subtreeFlags&8772&&h!==null?(h.return=n,X=h):Wa(e)}}function Wa(e){for(;X!==null;){var t=X;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ae||Qs(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Ae)if(r===null)i.componentDidMount();else{var n=t.elementType===t.type?r.memoizedProps:ot(t.type,r.memoizedProps);i.componentDidUpdate(n,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var h=t.updateQueue;h!==null&&ba(t,h,i);break;case 3:var g=t.updateQueue;if(g!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}ba(t,g,r)}break;case 5:var o=t.stateNode;if(r===null&&t.flags&4){r=o;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var f=t.alternate;if(f!==null){var m=f.memoizedState;if(m!==null){var d=m.dehydrated;d!==null&&Si(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error($(163))}Ae||t.flags&512&&bo(t)}catch(_){ve(t,t.return,_)}}if(t===e){X=null;break}if(r=t.sibling,r!==null){r.return=t.return,X=r;break}X=t.return}}function Ua(e){for(;X!==null;){var t=X;if(t===e){X=null;break}var r=t.sibling;if(r!==null){r.return=t.return,X=r;break}X=t.return}}function $a(e){for(;X!==null;){var t=X;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Qs(4,t)}catch(c){ve(t,r,c)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var n=t.return;try{i.componentDidMount()}catch(c){ve(t,n,c)}}var h=t.return;try{bo(t)}catch(c){ve(t,h,c)}break;case 5:var g=t.return;try{bo(t)}catch(c){ve(t,g,c)}}}catch(c){ve(t,t.return,c)}if(t===e){X=null;break}var o=t.sibling;if(o!==null){o.return=t.return,X=o;break}X=t.return}}var $f=Math.ceil,Bs=Lt.ReactCurrentDispatcher,kl=Lt.ReactCurrentOwner,rt=Lt.ReactCurrentBatchConfig,re=0,ke=null,we=null,De=0,$e=0,xr=Gt(0),xe=0,Pi=null,lr=0,Ys=0,bl=0,hi=null,He=null,Ll=0,Ir=1/0,mt=null,Os=!1,Ro=null,Wt=null,ts=!1,It=null,Is=0,di=0,Po=null,ds=-1,fs=0;function Oe(){return re&6?me():ds!==-1?ds:ds=me()}function Ut(e){return e.mode&1?re&2&&De!==0?De&-De:Lf.transition!==null?(fs===0&&(fs=Wc()),fs):(e=se,e!==0||(e=window.event,e=e===void 0?16:Xc(e.type)),e):1}function ut(e,t,r,i){if(50<di)throw di=0,Po=null,Error($(185));Mi(e,r,i),(!(re&2)||e!==ke)&&(e===ke&&(!(re&2)&&(Ys|=r),xe===4&&Bt(e,De)),Ue(e,i),r===1&&re===0&&!(t.mode&1)&&(Ir=me()+500,qs&&Xt()))}function Ue(e,t){var r=e.callbackNode;bd(e,t);var i=Ss(e,e===ke?De:0);if(i===0)r!==null&&Zl(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&Zl(r),t===1)e.tag===0?bf(Ka.bind(null,e)):_u(Ka.bind(null,e)),Cf(function(){!(re&6)&&Xt()}),r=null;else{switch(Uc(i)){case 1:r=Zo;break;case 4:r=Fc;break;case 16:r=ms;break;case 536870912:r=zc;break;default:r=ms}r=dh(r,nh.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function nh(e,t){if(ds=-1,fs=0,re&6)throw Error($(327));var r=e.callbackNode;if(Rr()&&e.callbackNode!==r)return null;var i=Ss(e,e===ke?De:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=Ns(e,i);else{t=i;var n=re;re|=2;var h=lh();(ke!==e||De!==t)&&(mt=null,Ir=me()+500,tr(e,t));do try{qf();break}catch(o){oh(e,o)}while(!0);dl(),Bs.current=h,re=n,we!==null?t=0:(ke=null,De=0,t=xe)}if(t!==0){if(t===2&&(n=ro(e),n!==0&&(i=n,t=To(e,n))),t===1)throw r=Pi,tr(e,0),Bt(e,i),Ue(e,me()),r;if(t===6)Bt(e,i);else{if(n=e.current.alternate,!(i&30)&&!Kf(n)&&(t=Ns(e,i),t===2&&(h=ro(e),h!==0&&(i=h,t=To(e,h))),t===1))throw r=Pi,tr(e,0),Bt(e,i),Ue(e,me()),r;switch(e.finishedWork=n,e.finishedLanes=i,t){case 0:case 1:throw Error($(345));case 2:Yt(e,He,mt);break;case 3:if(Bt(e,i),(i&130023424)===i&&(t=Ll+500-me(),10<t)){if(Ss(e,0)!==0)break;if(n=e.suspendedLanes,(n&i)!==i){Oe(),e.pingedLanes|=e.suspendedLanes&n;break}e.timeoutHandle=uo(Yt.bind(null,e,He,mt),t);break}Yt(e,He,mt);break;case 4:if(Bt(e,i),(i&4194240)===i)break;for(t=e.eventTimes,n=-1;0<i;){var g=31-ct(i);h=1<<g,g=t[g],g>n&&(n=g),i&=~h}if(i=n,i=me()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*$f(i/1960))-i,10<i){e.timeoutHandle=uo(Yt.bind(null,e,He,mt),i);break}Yt(e,He,mt);break;case 5:Yt(e,He,mt);break;default:throw Error($(329))}}}return Ue(e,me()),e.callbackNode===r?nh.bind(null,e):null}function To(e,t){var r=hi;return e.current.memoizedState.isDehydrated&&(tr(e,t).flags|=256),e=Ns(e,t),e!==2&&(t=He,He=r,t!==null&&Ao(t)),e}function Ao(e){He===null?He=e:He.push.apply(He,e)}function Kf(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var n=r[i],h=n.getSnapshot;n=n.value;try{if(!ht(h(),n))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 Bt(e,t){for(t&=~bl,t&=~Ys,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-ct(t),i=1<<r;e[r]=-1,t&=~i}}function Ka(e){if(re&6)throw Error($(327));Rr();var t=Ss(e,0);if(!(t&1))return Ue(e,me()),null;var r=Ns(e,t);if(e.tag!==0&&r===2){var i=ro(e);i!==0&&(t=i,r=To(e,i))}if(r===1)throw r=Pi,tr(e,0),Bt(e,t),Ue(e,me()),r;if(r===6)throw Error($(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Yt(e,He,mt),Ue(e,me()),null}function Dl(e,t){var r=re;re|=1;try{return e(t)}finally{re=r,re===0&&(Ir=me()+500,qs&&Xt())}}function ar(e){It!==null&&It.tag===0&&!(re&6)&&Rr();var t=re;re|=1;var r=rt.transition,i=se;try{if(rt.transition=null,se=1,e)return e()}finally{se=i,rt.transition=r,re=t,!(re&6)&&Xt()}}function Rl(){$e=xr.current,le(xr)}function tr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,wf(r)),we!==null)for(r=we.return;r!==null;){var i=r;switch(cl(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Es();break;case 3:Br(),le(ze),le(Me),ml();break;case 5:gl(i);break;case 4:Br();break;case 13:le(he);break;case 19:le(he);break;case 10:fl(i.type._context);break;case 22:case 23:Rl()}r=r.return}if(ke=e,we=e=$t(e.current,null),De=$e=t,xe=0,Pi=null,bl=Ys=lr=0,He=hi=null,Zt!==null){for(t=0;t<Zt.length;t++)if(r=Zt[t],i=r.interleaved,i!==null){r.interleaved=null;var n=i.next,h=r.pending;if(h!==null){var g=h.next;h.next=n,i.next=g}r.pending=i}Zt=null}return e}function oh(e,t){do{var r=we;try{if(dl(),cs.current=Ms,As){for(var i=de.memoizedState;i!==null;){var n=i.queue;n!==null&&(n.pending=null),i=i.next}As=!1}if(or=0,Ee=Ce=de=null,ci=!1,Li=0,kl.current=null,r===null||r.return===null){xe=1,Pi=t,we=null;break}e:{var h=e,g=r.return,o=r,c=t;if(t=De,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=c,m=o,d=m.tag;if(!(m.mode&1)&&(d===0||d===11||d===15)){var _=m.alternate;_?(m.updateQueue=_.updateQueue,m.memoizedState=_.memoizedState,m.lanes=_.lanes):(m.updateQueue=null,m.memoizedState=null)}var S=Aa(g);if(S!==null){S.flags&=-257,Ma(S,g,o,h,t),S.mode&1&&Ta(h,f,t),t=S,c=f;var w=t.updateQueue;if(w===null){var p=new Set;p.add(c),t.updateQueue=p}else w.add(c);break e}else{if(!(t&1)){Ta(h,f,t),Pl();break e}c=Error($(426))}}else if(ce&&o.mode&1){var u=Aa(g);if(u!==null){!(u.flags&65536)&&(u.flags|=256),Ma(u,g,o,h,t),ul(Or(c,o));break e}}h=c=Or(c,o),xe!==4&&(xe=2),hi===null?hi=[h]:hi.push(h),h=g;do{switch(h.tag){case 3:h.flags|=65536,t&=-t,h.lanes|=t;var l=Uu(h,c,t);ka(h,l);break e;case 1:o=c;var s=h.type,a=h.stateNode;if(!(h.flags&128)&&(typeof s.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(Wt===null||!Wt.has(a)))){h.flags|=65536,t&=-t,h.lanes|=t;var v=$u(h,o,t);ka(h,v);break e}}h=h.return}while(h!==null)}ch(r)}catch(C){t=C,we===r&&r!==null&&(we=r=r.return);continue}break}while(!0)}function lh(){var e=Bs.current;return Bs.current=Ms,e===null?Ms:e}function Pl(){(xe===0||xe===3||xe===2)&&(xe=4),ke===null||!(lr&268435455)&&!(Ys&268435455)||Bt(ke,De)}function Ns(e,t){var r=re;re|=2;var i=lh();(ke!==e||De!==t)&&(mt=null,tr(e,t));do try{Vf();break}catch(n){oh(e,n)}while(!0);if(dl(),re=r,Bs.current=i,we!==null)throw Error($(261));return ke=null,De=0,xe}function Vf(){for(;we!==null;)ah(we)}function qf(){for(;we!==null&&!gd();)ah(we)}function ah(e){var t=hh(e.alternate,e,$e);e.memoizedProps=e.pendingProps,t===null?ch(e):we=t,kl.current=null}function ch(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Ff(r,t),r!==null){r.flags&=32767,we=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{xe=6,we=null;return}}else if(r=Hf(r,t,$e),r!==null){we=r;return}if(t=t.sibling,t!==null){we=t;return}we=t=e}while(t!==null);xe===0&&(xe=5)}function Yt(e,t,r){var i=se,n=rt.transition;try{rt.transition=null,se=1,Gf(e,t,r,i)}finally{rt.transition=n,se=i}return null}function Gf(e,t,r,i){do Rr();while(It!==null);if(re&6)throw Error($(327));r=e.finishedWork;var n=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error($(177));e.callbackNode=null,e.callbackPriority=0;var h=r.lanes|r.childLanes;if(Ld(e,h),e===ke&&(we=ke=null,De=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||ts||(ts=!0,dh(ms,function(){return Rr(),null})),h=(r.flags&15990)!==0,r.subtreeFlags&15990||h){h=rt.transition,rt.transition=null;var g=se;se=1;var o=re;re|=4,kl.current=null,Wf(e,r),ih(r,e),_f(ao),ys=!!lo,ao=lo=null,e.current=r,Uf(r),md(),re=o,se=g,rt.transition=h}else e.current=r;if(ts&&(ts=!1,It=e,Is=n),h=e.pendingLanes,h===0&&(Wt=null),wd(r.stateNode),Ue(e,me()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)n=t[r],i(n.value,{componentStack:n.stack,digest:n.digest});if(Os)throw Os=!1,e=Ro,Ro=null,e;return Is&1&&e.tag!==0&&Rr(),h=e.pendingLanes,h&1?e===Po?di++:(di=0,Po=e):di=0,Xt(),null}function Rr(){if(It!==null){var e=Uc(Is),t=rt.transition,r=se;try{if(rt.transition=null,se=16>e?16:e,It===null)var i=!1;else{if(e=It,It=null,Is=0,re&6)throw Error($(331));var n=re;for(re|=4,X=e.current;X!==null;){var h=X,g=h.child;if(X.flags&16){var o=h.deletions;if(o!==null){for(var c=0;c<o.length;c++){var f=o[c];for(X=f;X!==null;){var m=X;switch(m.tag){case 0:case 11:case 15:ui(8,m,h)}var d=m.child;if(d!==null)d.return=m,X=d;else for(;X!==null;){m=X;var _=m.sibling,S=m.return;if(eh(m),m===f){X=null;break}if(_!==null){_.return=S,X=_;break}X=S}}}var w=h.alternate;if(w!==null){var p=w.child;if(p!==null){w.child=null;do{var u=p.sibling;p.sibling=null,p=u}while(p!==null)}}X=h}}if(h.subtreeFlags&2064&&g!==null)g.return=h,X=g;else e:for(;X!==null;){if(h=X,h.flags&2048)switch(h.tag){case 0:case 11:case 15:ui(9,h,h.return)}var l=h.sibling;if(l!==null){l.return=h.return,X=l;break e}X=h.return}}var s=e.current;for(X=s;X!==null;){g=X;var a=g.child;if(g.subtreeFlags&2064&&a!==null)a.return=g,X=a;else e:for(g=s;X!==null;){if(o=X,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:Qs(9,o)}}catch(C){ve(o,o.return,C)}if(o===g){X=null;break e}var v=o.sibling;if(v!==null){v.return=o.return,X=v;break e}X=o.return}}if(re=n,Xt(),vt&&typeof vt.onPostCommitFiberRoot=="function")try{vt.onPostCommitFiberRoot(Ws,e)}catch{}i=!0}return i}finally{se=r,rt.transition=t}}return!1}function Va(e,t,r){t=Or(r,t),t=Uu(e,t,1),e=zt(e,t,1),t=Oe(),e!==null&&(Mi(e,1,t),Ue(e,t))}function ve(e,t,r){if(e.tag===3)Va(e,e,r);else for(;t!==null;){if(t.tag===3){Va(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Wt===null||!Wt.has(i))){e=Or(r,e),e=$u(t,e,1),t=zt(t,e,1),e=Oe(),t!==null&&(Mi(t,1,e),Ue(t,e));break}}t=t.return}}function Xf(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=Oe(),e.pingedLanes|=e.suspendedLanes&r,ke===e&&(De&r)===r&&(xe===4||xe===3&&(De&130023424)===De&&500>me()-Ll?tr(e,0):bl|=r),Ue(e,t)}function uh(e,t){t===0&&(e.mode&1?(t=Ki,Ki<<=1,!(Ki&130023424)&&(Ki=4194304)):t=1);var r=Oe();e=kt(e,t),e!==null&&(Mi(e,t,r),Ue(e,r))}function Qf(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),uh(e,r)}function Yf(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,n=e.memoizedState;n!==null&&(r=n.retryLane);break;case 19:i=e.stateNode;break;default:throw Error($(314))}i!==null&&i.delete(t),uh(e,r)}var hh;hh=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ze.current)Fe=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Fe=!1,jf(e,t,r);Fe=!!(e.flags&131072)}else Fe=!1,ce&&t.flags&1048576&&pu(t,Ls,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;hs(e,t),e=t.pendingProps;var n=Tr(t,Me.current);Dr(t,r),n=yl(null,t,i,e,n,r);var h=wl();return t.flags|=1,typeof n=="object"&&n!==null&&typeof n.render=="function"&&n.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,We(i)?(h=!0,ks(t)):h=!1,t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,pl(t),n.updater=Xs,t.stateNode=n,n._reactInternals=t,mo(t,i,e,r),t=wo(null,t,i,!0,h,r)):(t.tag=0,ce&&h&&al(t),Be(null,t,n,r),t=t.child),t;case 16:i=t.elementType;e:{switch(hs(e,t),e=t.pendingProps,n=i._init,i=n(i._payload),t.type=i,n=t.tag=Zf(i),e=ot(i,e),n){case 0:t=yo(null,t,i,e,r);break e;case 1:t=Ia(null,t,i,e,r);break e;case 11:t=Ba(null,t,i,e,r);break e;case 14:t=Oa(null,t,i,ot(i.type,e),r);break e}throw Error($(306,i,""))}return t;case 0:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:ot(i,n),yo(e,t,i,n,r);case 1:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:ot(i,n),Ia(e,t,i,n,r);case 3:e:{if(Gu(t),e===null)throw Error($(387));i=t.pendingProps,h=t.memoizedState,n=h.element,wu(e,t),Ps(t,i,null,r);var g=t.memoizedState;if(i=g.element,h.isDehydrated)if(h={element:i,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){n=Or(Error($(423)),t),t=Na(e,t,i,r,n);break e}else if(i!==n){n=Or(Error($(424)),t),t=Na(e,t,i,r,n);break e}else for(Ve=Ft(t.stateNode.containerInfo.firstChild),qe=t,ce=!0,at=null,r=Su(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ar(),i===n){t=bt(e,t,r);break e}Be(e,t,i,r)}t=t.child}return t;case 5:return Cu(t),e===null&&po(t),i=t.type,n=t.pendingProps,h=e!==null?e.memoizedProps:null,g=n.children,co(i,n)?g=null:h!==null&&co(i,h)&&(t.flags|=32),qu(e,t),Be(e,t,g,r),t.child;case 6:return e===null&&po(t),null;case 13:return Xu(e,t,r);case 4:return vl(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Mr(t,null,i,r):Be(e,t,i,r),t.child;case 11:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:ot(i,n),Ba(e,t,i,n,r);case 7:return Be(e,t,t.pendingProps,r),t.child;case 8:return Be(e,t,t.pendingProps.children,r),t.child;case 12:return Be(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,n=t.pendingProps,h=t.memoizedProps,g=n.value,ne(Ds,i._currentValue),i._currentValue=g,h!==null)if(ht(h.value,g)){if(h.children===n.children&&!ze.current){t=bt(e,t,r);break e}}else for(h=t.child,h!==null&&(h.return=t);h!==null;){var o=h.dependencies;if(o!==null){g=h.child;for(var c=o.firstContext;c!==null;){if(c.context===i){if(h.tag===1){c=Ct(-1,r&-r),c.tag=2;var f=h.updateQueue;if(f!==null){f=f.shared;var m=f.pending;m===null?c.next=c:(c.next=m.next,m.next=c),f.pending=c}}h.lanes|=r,c=h.alternate,c!==null&&(c.lanes|=r),vo(h.return,r,t),o.lanes|=r;break}c=c.next}}else if(h.tag===10)g=h.type===t.type?null:h.child;else if(h.tag===18){if(g=h.return,g===null)throw Error($(341));g.lanes|=r,o=g.alternate,o!==null&&(o.lanes|=r),vo(g,r,t),g=h.sibling}else g=h.child;if(g!==null)g.return=h;else for(g=h;g!==null;){if(g===t){g=null;break}if(h=g.sibling,h!==null){h.return=g.return,g=h;break}g=g.return}h=g}Be(e,t,n.children,r),t=t.child}return t;case 9:return n=t.type,i=t.pendingProps.children,Dr(t,r),n=it(n),i=i(n),t.flags|=1,Be(e,t,i,r),t.child;case 14:return i=t.type,n=ot(i,t.pendingProps),n=ot(i.type,n),Oa(e,t,i,n,r);case 15:return Ku(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:ot(i,n),hs(e,t),t.tag=1,We(i)?(e=!0,ks(t)):e=!1,Dr(t,r),Wu(t,i,n),mo(t,i,n,r),wo(null,t,i,!0,e,r);case 19:return Qu(e,t,r);case 22:return Vu(e,t,r)}throw Error($(156,t.tag))};function dh(e,t){return Hc(e,t)}function Jf(e,t,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tt(e,t,r,i){return new Jf(e,t,r,i)}function Tl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zf(e){if(typeof e=="function")return Tl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Qo)return 11;if(e===Yo)return 14}return 2}function $t(e,t){var r=e.alternate;return r===null?(r=tt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function _s(e,t,r,i,n,h){var g=2;if(i=e,typeof e=="function")Tl(e)&&(g=1);else if(typeof e=="string")g=5;else e:switch(e){case fr:return rr(r.children,n,h,t);case Xo:g=8,n|=8;break;case zn:return e=tt(12,r,t,n|2),e.elementType=zn,e.lanes=h,e;case Wn:return e=tt(13,r,t,n),e.elementType=Wn,e.lanes=h,e;case Un:return e=tt(19,r,t,n),e.elementType=Un,e.lanes=h,e;case Cc:return Js(r,n,h,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case yc:g=10;break e;case wc:g=9;break e;case Qo:g=11;break e;case Yo:g=14;break e;case Tt:g=16,i=null;break e}throw Error($(130,e==null?e:typeof e,""))}return t=tt(g,r,t,n),t.elementType=e,t.type=i,t.lanes=h,t}function rr(e,t,r,i){return e=tt(7,e,i,t),e.lanes=r,e}function Js(e,t,r,i){return e=tt(22,e,i,t),e.elementType=Cc,e.lanes=r,e.stateNode={isHidden:!1},e}function On(e,t,r){return e=tt(6,e,null,t),e.lanes=r,e}function In(e,t,r){return t=tt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function e_(e,t,r,i,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vn(0),this.expirationTimes=vn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vn(0),this.identifierPrefix=i,this.onRecoverableError=n,this.mutableSourceEagerHydrationData=null}function Al(e,t,r,i,n,h,g,o,c){return e=new e_(e,t,r,o,c),t===1?(t=1,h===!0&&(t|=8)):t=0,h=tt(3,null,null,t),e.current=h,h.stateNode=e,h.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},pl(h),e}function t_(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:dr,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function fh(e){if(!e)return Vt;e=e._reactInternals;e:{if(ur(e)!==e||e.tag!==1)throw Error($(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(We(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error($(171))}if(e.tag===1){var r=e.type;if(We(r))return fu(e,r,t)}return t}function _h(e,t,r,i,n,h,g,o,c){return e=Al(r,i,!0,e,n,h,g,o,c),e.context=fh(null),r=e.current,i=Oe(),n=Ut(r),h=Ct(i,n),h.callback=t??null,zt(r,h,n),e.current.lanes=n,Mi(e,n,i),Ue(e,i),e}function Zs(e,t,r,i){var n=t.current,h=Oe(),g=Ut(n);return r=fh(r),t.context===null?t.context=r:t.pendingContext=r,t=Ct(h,g),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=zt(n,t,g),e!==null&&(ut(e,n,g,h),as(e,n,g)),g}function js(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function qa(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Ml(e,t){qa(e,t),(e=e.alternate)&&qa(e,t)}function r_(){return null}var ph=typeof reportError=="function"?reportError:function(e){console.error(e)};function Bl(e){this._internalRoot=e}en.prototype.render=Bl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error($(409));Zs(e,t,null,null)};en.prototype.unmount=Bl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ar(function(){Zs(null,e,null,null)}),t[Et]=null}};function en(e){this._internalRoot=e}en.prototype.unstable_scheduleHydration=function(e){if(e){var t=Vc();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Mt.length&&t!==0&&t<Mt[r].priority;r++);Mt.splice(r,0,e),r===0&&Gc(e)}};function Ol(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function tn(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ga(){}function i_(e,t,r,i,n){if(n){if(typeof i=="function"){var h=i;i=function(){var f=js(g);h.call(f)}}var g=_h(t,i,e,0,null,!1,!1,"",Ga);return e._reactRootContainer=g,e[Et]=g.current,Ci(e.nodeType===8?e.parentNode:e),ar(),g}for(;n=e.lastChild;)e.removeChild(n);if(typeof i=="function"){var o=i;i=function(){var f=js(c);o.call(f)}}var c=Al(e,0,!1,null,null,!1,!1,"",Ga);return e._reactRootContainer=c,e[Et]=c.current,Ci(e.nodeType===8?e.parentNode:e),ar(function(){Zs(t,c,r,i)}),c}function rn(e,t,r,i,n){var h=r._reactRootContainer;if(h){var g=h;if(typeof n=="function"){var o=n;n=function(){var c=js(g);o.call(c)}}Zs(t,g,e,n)}else g=i_(r,t,e,n,i);return js(g)}$c=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=ti(t.pendingLanes);r!==0&&(el(t,r|1),Ue(t,me()),!(re&6)&&(Ir=me()+500,Xt()))}break;case 13:ar(function(){var i=kt(e,1);if(i!==null){var n=Oe();ut(i,e,1,n)}}),Ml(e,1)}};tl=function(e){if(e.tag===13){var t=kt(e,134217728);if(t!==null){var r=Oe();ut(t,e,134217728,r)}Ml(e,134217728)}};Kc=function(e){if(e.tag===13){var t=Ut(e),r=kt(e,t);if(r!==null){var i=Oe();ut(r,e,t,i)}Ml(e,t)}};Vc=function(){return se};qc=function(e,t){var r=se;try{return se=e,t()}finally{se=r}};Zn=function(e,t,r){switch(t){case"input":if(Vn(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var n=Vs(i);if(!n)throw Error($(90));Ec(i),Vn(i,n)}}}break;case"textarea":bc(e,r);break;case"select":t=r.value,t!=null&&Er(e,!!r.multiple,t,!1)}};Mc=Dl;Bc=ar;var s_={usingClientEntryPoint:!1,Events:[Oi,gr,Vs,Tc,Ac,Dl]},Jr={findFiberByHostInstance:Jt,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},n_={bundleType:Jr.bundleType,version:Jr.version,rendererPackageName:Jr.rendererPackageName,rendererConfig:Jr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Lt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Nc(e),e===null?null:e.stateNode},findFiberByHostInstance:Jr.findFiberByHostInstance||r_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rs.isDisabled&&rs.supportsFiber)try{Ws=rs.inject(n_),vt=rs}catch{}}Xe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=s_;Xe.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ol(t))throw Error($(200));return t_(e,t,null,r)};Xe.createRoot=function(e,t){if(!Ol(e))throw Error($(299));var r=!1,i="",n=ph;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(n=t.onRecoverableError)),t=Al(e,1,!1,null,null,r,!1,i,n),e[Et]=t.current,Ci(e.nodeType===8?e.parentNode:e),new Bl(t)};Xe.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error($(188)):(e=Object.keys(e).join(","),Error($(268,e)));return e=Nc(t),e=e===null?null:e.stateNode,e};Xe.flushSync=function(e){return ar(e)};Xe.hydrate=function(e,t,r){if(!tn(t))throw Error($(200));return rn(null,e,t,!0,r)};Xe.hydrateRoot=function(e,t,r){if(!Ol(e))throw Error($(405));var i=r!=null&&r.hydratedSources||null,n=!1,h="",g=ph;if(r!=null&&(r.unstable_strictMode===!0&&(n=!0),r.identifierPrefix!==void 0&&(h=r.identifierPrefix),r.onRecoverableError!==void 0&&(g=r.onRecoverableError)),t=_h(t,null,e,1,r??null,n,!1,h,g),e[Et]=t.current,Ci(e),i)for(e=0;e<i.length;e++)r=i[e],n=r._getVersion,n=n(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,n]:t.mutableSourceEagerHydrationData.push(r,n);return new en(t)};Xe.render=function(e,t,r){if(!tn(t))throw Error($(200));return rn(null,e,t,!1,r)};Xe.unmountComponentAtNode=function(e){if(!tn(e))throw Error($(40));return e._reactRootContainer?(ar(function(){rn(null,null,e,!1,function(){e._reactRootContainer=null,e[Et]=null})}),!0):!1};Xe.unstable_batchedUpdates=Dl;Xe.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!tn(r))throw Error($(200));if(e==null||e._reactInternals===void 0)throw Error($(38));return rn(e,t,r,!1,i)};Xe.version="18.3.1-next-f1338f8080-20240426";function vh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vh)}catch(e){console.error(e)}}vh(),vc.exports=Xe;var o_=vc.exports,Xa=o_;Hn.createRoot=Xa.createRoot,Hn.hydrateRoot=Xa.hydrateRoot;const l_={},Qa=e=>{let t;const r=new Set,i=(m,d)=>{const _=typeof m=="function"?m(t):m;if(!Object.is(_,t)){const S=t;t=d??(typeof _!="object"||_===null)?_:Object.assign({},t,_),r.forEach(w=>w(t,S))}},n=()=>t,c={setState:i,getState:n,getInitialState:()=>f,subscribe:m=>(r.add(m),()=>r.delete(m)),destroy:()=>{(l_?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},f=t=e(i,n,c);return c},a_=e=>e?Qa(e):Qa;var gh={exports:{}},mh={},Sh={exports:{}},yh={};/**
|
|
41
|
+
* @license React
|
|
42
|
+
* use-sync-external-store-shim.production.js
|
|
43
|
+
*
|
|
44
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the MIT license found in the
|
|
47
|
+
* LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/var Nr=J;function c_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var u_=typeof Object.is=="function"?Object.is:c_,h_=Nr.useState,d_=Nr.useEffect,f_=Nr.useLayoutEffect,__=Nr.useDebugValue;function p_(e,t){var r=t(),i=h_({inst:{value:r,getSnapshot:t}}),n=i[0].inst,h=i[1];return f_(function(){n.value=r,n.getSnapshot=t,Nn(n)&&h({inst:n})},[e,r,t]),d_(function(){return Nn(n)&&h({inst:n}),e(function(){Nn(n)&&h({inst:n})})},[e]),__(r),r}function Nn(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!u_(e,r)}catch{return!0}}function v_(e,t){return t()}var g_=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?v_:p_;yh.useSyncExternalStore=Nr.useSyncExternalStore!==void 0?Nr.useSyncExternalStore:g_;Sh.exports=yh;var m_=Sh.exports;/**
|
|
49
|
+
* @license React
|
|
50
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/var sn=J,S_=m_;function y_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var w_=typeof Object.is=="function"?Object.is:y_,C_=S_.useSyncExternalStore,x_=sn.useRef,E_=sn.useEffect,k_=sn.useMemo,b_=sn.useDebugValue;mh.useSyncExternalStoreWithSelector=function(e,t,r,i,n){var h=x_(null);if(h.current===null){var g={hasValue:!1,value:null};h.current=g}else g=h.current;h=k_(function(){function c(S){if(!f){if(f=!0,m=S,S=i(S),n!==void 0&&g.hasValue){var w=g.value;if(n(w,S))return d=w}return d=S}if(w=d,w_(m,S))return w;var p=i(S);return n!==void 0&&n(w,p)?(m=S,w):(m=S,d=p)}var f=!1,m,d,_=r===void 0?null:r;return[function(){return c(t())},_===null?void 0:function(){return c(_())}]},[t,r,i,n]);var o=C_(e,h[0],h[1]);return E_(function(){g.hasValue=!0,g.value=o},[o]),b_(o),o};gh.exports=mh;var L_=gh.exports;const D_=ic(L_),wh={},{useDebugValue:R_}=_c,{useSyncExternalStoreWithSelector:P_}=D_;let Ya=!1;const T_=e=>e;function A_(e,t=T_,r){(wh?"production":void 0)!=="production"&&r&&!Ya&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Ya=!0);const i=P_(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return R_(i),i}const Ja=e=>{(wh?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?a_(e):e,r=(i,n)=>A_(t,i,n);return Object.assign(r,t),r},Ni=e=>e?Ja(e):Ja,Le=Ni((e,t)=>({sessions:{},createSession:(r,i)=>e(n=>({sessions:{...n.sessions,[r]:{terminalId:r,projectId:i,terminal:null,title:"Terminal",alive:!0}}})),setTerminalInstance:(r,i)=>e(n=>{const h=n.sessions[r];return h?{sessions:{...n.sessions,[r]:{...h,terminal:i}}}:n}),setTitle:(r,i)=>e(n=>{const h=n.sessions[r];return h?{sessions:{...n.sessions,[r]:{...h,title:i}}}:n}),markDead:r=>e(i=>{const n=i.sessions[r];return n?{sessions:{...i.sessions,[r]:{...n,alive:!1}}}:i}),removeSession:r=>e(i=>{const{[r]:n,...h}=i.sessions;return{sessions:h}}),getSession:r=>t().sessions[r],getProjectSessions:r=>Object.values(t().sessions).filter(i=>i.projectId===r)})),M_={};function B_(e,t){let r;try{r=e()}catch{return}return{getItem:n=>{var h;const g=c=>c===null?null:JSON.parse(c,void 0),o=(h=r.getItem(n))!=null?h:null;return o instanceof Promise?o.then(g):g(o)},setItem:(n,h)=>r.setItem(n,JSON.stringify(h,void 0)),removeItem:n=>r.removeItem(n)}}const Ti=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(i){return Ti(i)(r)},catch(i){return this}}}catch(r){return{then(i){return this},catch(i){return Ti(i)(r)}}}},O_=(e,t)=>(r,i,n)=>{let h={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:u=>u,version:0,merge:(u,l)=>({...l,...u}),...t},g=!1;const o=new Set,c=new Set;let f;try{f=h.getStorage()}catch{}if(!f)return e((...u)=>{console.warn(`[zustand persist middleware] Unable to update item '${h.name}', the given storage is currently unavailable.`),r(...u)},i,n);const m=Ti(h.serialize),d=()=>{const u=h.partialize({...i()});let l;const s=m({state:u,version:h.version}).then(a=>f.setItem(h.name,a)).catch(a=>{l=a});if(l)throw l;return s},_=n.setState;n.setState=(u,l)=>{_(u,l),d()};const S=e((...u)=>{r(...u),d()},i,n);let w;const p=()=>{var u;if(!f)return;g=!1,o.forEach(s=>s(i()));const l=((u=h.onRehydrateStorage)==null?void 0:u.call(h,i()))||void 0;return Ti(f.getItem.bind(f))(h.name).then(s=>{if(s)return h.deserialize(s)}).then(s=>{if(s)if(typeof s.version=="number"&&s.version!==h.version){if(h.migrate)return h.migrate(s.state,s.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return s.state}).then(s=>{var a;return w=h.merge(s,(a=i())!=null?a:S),r(w,!0),d()}).then(()=>{l==null||l(w,void 0),g=!0,c.forEach(s=>s(w))}).catch(s=>{l==null||l(void 0,s)})};return n.persist={setOptions:u=>{h={...h,...u},u.getStorage&&(f=u.getStorage())},clearStorage:()=>{f==null||f.removeItem(h.name)},getOptions:()=>h,rehydrate:()=>p(),hasHydrated:()=>g,onHydrate:u=>(o.add(u),()=>{o.delete(u)}),onFinishHydration:u=>(c.add(u),()=>{c.delete(u)})},p(),w||S},I_=(e,t)=>(r,i,n)=>{let h={storage:B_(()=>localStorage),partialize:p=>p,version:0,merge:(p,u)=>({...u,...p}),...t},g=!1;const o=new Set,c=new Set;let f=h.storage;if(!f)return e((...p)=>{console.warn(`[zustand persist middleware] Unable to update item '${h.name}', the given storage is currently unavailable.`),r(...p)},i,n);const m=()=>{const p=h.partialize({...i()});return f.setItem(h.name,{state:p,version:h.version})},d=n.setState;n.setState=(p,u)=>{d(p,u),m()};const _=e((...p)=>{r(...p),m()},i,n);n.getInitialState=()=>_;let S;const w=()=>{var p,u;if(!f)return;g=!1,o.forEach(s=>{var a;return s((a=i())!=null?a:_)});const l=((u=h.onRehydrateStorage)==null?void 0:u.call(h,(p=i())!=null?p:_))||void 0;return Ti(f.getItem.bind(f))(h.name).then(s=>{if(s)if(typeof s.version=="number"&&s.version!==h.version){if(h.migrate)return[!0,h.migrate(s.state,s.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,s.state];return[!1,void 0]}).then(s=>{var a;const[v,C]=s;if(S=h.merge(C,(a=i())!=null?a:_),r(S,!0),v)return m()}).then(()=>{l==null||l(S,void 0),S=i(),g=!0,c.forEach(s=>s(S))}).catch(s=>{l==null||l(void 0,s)})};return n.persist={setOptions:p=>{h={...h,...p},p.storage&&(f=p.storage)},clearStorage:()=>{f==null||f.removeItem(h.name)},getOptions:()=>h,rehydrate:()=>w(),hasHydrated:()=>g,onHydrate:p=>(o.add(p),()=>{o.delete(p)}),onFinishHydration:p=>(c.add(p),()=>{c.delete(p)})},h.skipHydration||w(),S||_},N_=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((M_?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),O_(e,t)):I_(e,t),Ch=N_,ye=Ni()(Ch((e,t)=>({projects:{},activeProjectId:null,setActiveProject:r=>e({activeProjectId:r}),addProject:r=>e(i=>({projects:{...i.projects,[r.id]:r},activeProjectId:i.activeProjectId??r.id})),removeProject:r=>e(i=>{const{[r]:n,...h}=i.projects,g=i.activeProjectId===r?Object.keys(h)[0]??null:i.activeProjectId;return{projects:h,activeProjectId:g}}),addTerminalToProject:(r,i)=>e(n=>{const h=n.projects[r];return!h||h.terminalIds.includes(i)?n:{projects:{...n.projects,[r]:{...h,terminalIds:[...h.terminalIds,i]}}}}),removeTerminalFromProject:(r,i)=>e(n=>{const h=n.projects[r];return h?{projects:{...n.projects,[r]:{...h,terminalIds:h.terminalIds.filter(g=>g!==i)}}}:n}),clearProjectTerminals:r=>e(i=>{const n=i.projects[r];return n?{projects:{...i.projects,[r]:{...n,terminalIds:[]}}}:i}),getActiveProject:()=>{const{projects:r,activeProjectId:i}=t();return i?r[i]??null:null}}),{name:"paneful-projects",partialize:e=>({projects:e.projects,activeProjectId:e.activeProjectId}),onRehydrateStorage:()=>e=>{if(!e)return;const t={};for(const[r,i]of Object.entries(e.projects))t[r]={...i,terminalIds:[]};e.projects=t}})),j_=.1,H_=.9,F_=16,z_={background:"#0a0a0f",foreground:"#ececf1",cursor:"#ececf1",cursorAccent:"#0a0a0f",selectionBackground:"#5b5bd640",selectionForeground:"#ececf1",black:"#1a1a24",red:"#e5484d",green:"#30a46c",yellow:"#f5d90a",blue:"#5b5bd6",magenta:"#ab4aba",cyan:"#12a594",white:"#ececf1",brightBlack:"#6b6b80",brightRed:"#ff6369",brightGreen:"#3dd68c",brightYellow:"#ffef5c",brightBlue:"#849dff",brightMagenta:"#d19dff",brightCyan:"#0ac5b3",brightWhite:"#ffffff"};function Se(e){return e?e.type==="leaf"?[e.terminalId]:[...Se(e.first),...Se(e.second)]:[]}function Mo(e,t){if(e.type==="leaf")return null;const r=Se(e.first),i=Se(e.second);return r.includes(t)||i.includes(t)?e.direction:Mo(e.first,t)??Mo(e.second,t)}function W_(e,t,r,i){if(!e)return{type:"leaf",terminalId:r};const n=i??(Mo(e,t)==="vertical"?"horizontal":"vertical");return Bo(e,t,r,n)}function Bo(e,t,r,i){return e.type==="leaf"?e.terminalId===t?{type:"split",direction:i,ratio:.5,first:e,second:{type:"leaf",terminalId:r}}:e:{...e,first:Bo(e.first,t,r,i),second:Bo(e.second,t,r,i)}}function Hs(e,t){if(!e)return null;if(e.type==="leaf")return e.terminalId===t?null:e;const r=Se(e.first),i=Se(e.second);if(e.first.type==="leaf"&&e.first.terminalId===t)return e.second;if(e.second.type==="leaf"&&e.second.terminalId===t)return e.first;if(r.includes(t)){const n=Hs(e.first,t);return n?{...e,first:n}:e.second}if(i.includes(t)){const n=Hs(e.second,t);return n?{...e,second:n}:e.first}return e}function Oo(e,t,r){const i=Math.max(j_,Math.min(H_,r));if(t.length===0)return e.type==="split"?{...e,ratio:i}:e;if(e.type==="leaf")return e;const[n,...h]=t;return n===0?{...e,first:Oo(e.first,h,i)}:{...e,second:Oo(e.second,h,i)}}function Io(e,t,r){return e.type==="leaf"?e.terminalId===t?{...e,terminalId:r}:e.terminalId===r?{...e,terminalId:t}:e:{...e,first:Io(e.first,t,r),second:Io(e.second,t,r)}}function U_(e,t,r,i){const n=Hs(e,t);return n?No(n,r,t,i==="left"||i==="right"?"vertical":"horizontal",i==="left"||i==="top"):null}function No(e,t,r,i,n){if(e.type==="leaf"){if(e.terminalId===t){const h={type:"leaf",terminalId:r};return{type:"split",direction:i,ratio:.5,first:n?h:e,second:n?e:h}}return e}return{...e,first:No(e.first,t,r,i,n),second:No(e.second,t,r,i,n)}}const fi=["even-horizontal","even-vertical","main-left","main-top","grid"];function Fs(e,t){if(e.length===0)return null;if(e.length===1)return{type:"leaf",terminalId:e[0]};switch(t){case"even-horizontal":return ir(e,"horizontal");case"even-vertical":return ir(e,"vertical");case"main-left":return Za(e,"vertical");case"main-top":return Za(e,"horizontal");case"grid":return $_(e)}}function ir(e,t){if(e.length===1)return{type:"leaf",terminalId:e[0]};if(e.length===2)return{type:"split",direction:t,ratio:.5,first:{type:"leaf",terminalId:e[0]},second:{type:"leaf",terminalId:e[1]}};const r=1/e.length;return{type:"split",direction:t,ratio:r,first:{type:"leaf",terminalId:e[0]},second:ir(e.slice(1),t)}}function Za(e,t,r){const[i,...n]=e,g=ir(n,t==="vertical"?"horizontal":"vertical");return{type:"split",direction:t,ratio:.6,first:{type:"leaf",terminalId:i},second:g}}function $_(e){if(e.length<=2)return ir(e,"vertical");const t=Math.ceil(e.length/2),r=e.slice(0,t),i=e.slice(t);return{type:"split",direction:"horizontal",ratio:.5,first:ir(r,"vertical"),second:i.length>0?ir(i,"vertical"):{type:"leaf",terminalId:r[r.length-1]}}}function jn(e,t,r){const i=Se(e),n=i.indexOf(t);return n===-1?null:r==="left"||r==="up"?n>0?i[n-1]:null:n<i.length-1?i[n+1]:null}const ie=Ni((e,t)=>({layouts:{},currentPresetIndex:0,getLayout:r=>t().layouts[r]??null,setLayout:(r,i)=>e(n=>({layouts:{...n.layouts,[r]:i}})),addPaneToProject:(r,i,n,h)=>e(g=>{const o=g.layouts[r]??null,c=W_(o,i,n,h);return{layouts:{...g.layouts,[r]:c}}}),removePaneFromProject:(r,i)=>e(n=>{const h=n.layouts[r];if(!h)return n;const g=Hs(h,i);return{layouts:{...n.layouts,[r]:g}}}),resizePaneInProject:(r,i,n)=>e(h=>{const g=h.layouts[r];if(!g)return h;const o=Oo(g,i,n);return{layouts:{...h.layouts,[r]:o}}}),swapPanesInProject:(r,i,n)=>e(h=>{const g=h.layouts[r];if(!g)return h;const o=Io(g,i,n);return{layouts:{...h.layouts,[r]:o}}}),movePaneInProject:(r,i,n,h)=>e(g=>{const o=g.layouts[r];if(!o)return g;const c=U_(o,i,n,h);return{layouts:{...g.layouts,[r]:c}}}),applyPresetToProject:(r,i)=>e(n=>{const h=fi[n.currentPresetIndex],g=Fs(i,h);return{layouts:{...n.layouts,[r]:g}}}),cyclePreset:(r,i)=>e(n=>{const h=(n.currentPresetIndex+1)%fi.length,g=fi[h],o=Fs(i,g);return{currentPresetIndex:h,layouts:{...n.layouts,[r]:o}}}),removeProjectLayout:r=>e(i=>{const{[r]:n,...h}=i.layouts;return{layouts:h}})})),ae=Ni(e=>({focusedTerminalId:null,sidebarOpen:!0,draggingTerminalId:null,dropTarget:null,connectionStatus:"connecting",setFocusedTerminal:t=>e({focusedTerminalId:t}),toggleSidebar:()=>e(t=>({sidebarOpen:!t.sidebarOpen})),setSidebarOpen:t=>e({sidebarOpen:t}),setDragging:t=>e({draggingTerminalId:t}),setDropTarget:t=>e({dropTarget:t}),setConnectionStatus:t=>e({connectionStatus:t})}));var xh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(globalThis,()=>(()=>{var r={4567:function(g,o,c){var f=this&&this.__decorate||function(s,a,v,C){var x,E=arguments.length,y=E<3?a:C===null?C=Object.getOwnPropertyDescriptor(a,v):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,a,v,C);else for(var b=s.length-1;b>=0;b--)(x=s[b])&&(y=(E<3?x(y):E>3?x(a,v,y):x(a,v))||y);return E>3&&y&&Object.defineProperty(a,v,y),y},m=this&&this.__param||function(s,a){return function(v,C){a(v,C,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=c(9042),_=c(9924),S=c(844),w=c(4725),p=c(2585),u=c(3656);let l=o.AccessibilityManager=class extends S.Disposable{constructor(s,a,v,C){super(),this._terminal=s,this._coreBrowserService=v,this._renderService=C,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 x=0;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);if(this._topBoundaryFocusListener=x=>this._handleBoundaryFocus(x,0),this._bottomBoundaryFocusListener=x=>this._handleBoundaryFocus(x,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 _.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(x=>this._handleResize(x.rows))),this.register(this._terminal.onRender(x=>this._refreshRows(x.start,x.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(x=>this._handleChar(x))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
57
|
+
`))),this.register(this._terminal.onA11yTab(x=>this._handleTab(x))),this.register(this._terminal.onKey(x=>this._handleKey(x.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,u.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,S.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(s){for(let a=0;a<s;a++)this._handleChar(" ")}_handleChar(s){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==s&&(this._charsToAnnounce+=s):this._charsToAnnounce+=s,s===`
|
|
58
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(s){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(s)||this._charsToConsume.push(s)}_refreshRows(s,a){this._liveRegionDebouncer.refresh(s,a,this._terminal.rows)}_renderRows(s,a){const v=this._terminal.buffer,C=v.lines.length.toString();for(let x=s;x<=a;x++){const E=v.lines.get(v.ydisp+x),y=[],b=(E==null?void 0:E.translateToString(!0,void 0,void 0,y))||"",R=(v.ydisp+x+1).toString(),A=this._rowElements[x];A&&(b.length===0?(A.innerText=" ",this._rowColumns.set(A,[0,1])):(A.textContent=b,this._rowColumns.set(A,y)),A.setAttribute("aria-posinset",R),A.setAttribute("aria-setsize",C))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(s,a){const v=s.target,C=this._rowElements[a===0?1:this._rowElements.length-2];if(v.getAttribute("aria-posinset")===(a===0?"1":`${this._terminal.buffer.lines.length}`)||s.relatedTarget!==C)return;let x,E;if(a===0?(x=v,E=this._rowElements.pop(),this._rowContainer.removeChild(E)):(x=this._rowElements.shift(),E=v,this._rowContainer.removeChild(x)),x.removeEventListener("focus",this._topBoundaryFocusListener),E.removeEventListener("focus",this._bottomBoundaryFocusListener),a===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(a===0?-1:1),this._rowElements[a===0?1:this._rowElements.length-2].focus(),s.preventDefault(),s.stopImmediatePropagation()}_handleSelectionChange(){var b;if(this._rowElements.length===0)return;const s=document.getSelection();if(!s)return;if(s.isCollapsed)return void(this._rowContainer.contains(s.anchorNode)&&this._terminal.clearSelection());if(!s.anchorNode||!s.focusNode)return void console.error("anchorNode and/or focusNode are null");let a={node:s.anchorNode,offset:s.anchorOffset},v={node:s.focusNode,offset:s.focusOffset};if((a.node.compareDocumentPosition(v.node)&Node.DOCUMENT_POSITION_PRECEDING||a.node===v.node&&a.offset>v.offset)&&([a,v]=[v,a]),a.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(a={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(a.node))return;const C=this._rowElements.slice(-1)[0];if(v.node.compareDocumentPosition(C)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(v={node:C,offset:((b=C.textContent)==null?void 0:b.length)??0}),!this._rowContainer.contains(v.node))return;const x=({node:R,offset:A})=>{const O=R instanceof Text?R.parentNode:R;let P=parseInt(O==null?void 0:O.getAttribute("aria-posinset"),10)-1;if(isNaN(P))return console.warn("row is invalid. Race condition?"),null;const j=this._rowColumns.get(O);if(!j)return console.warn("columns is null. Race condition?"),null;let z=A<j.length?j[A]:j.slice(-1)[0]+1;return z>=this._terminal.cols&&(++P,z=0),{row:P,column:z}},E=x(a),y=x(v);if(E&&y){if(E.row>y.row||E.row===y.row&&E.column>=y.column)throw new Error("invalid range");this._terminal.select(E.column,E.row,(y.row-E.row)*this._terminal.cols-E.column+y.column)}}_handleResize(s){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let a=this._rowContainer.children.length;a<this._terminal.rows;a++)this._rowElements[a]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[a]);for(;this._rowElements.length>s;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const s=this._coreBrowserService.mainDocument.createElement("div");return s.setAttribute("role","listitem"),s.tabIndex=-1,this._refreshRowDimensions(s),s}_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 s=0;s<this._terminal.rows;s++)this._refreshRowDimensions(this._rowElements[s])}}_refreshRowDimensions(s){s.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=l=f([m(1,p.IInstantiationService),m(2,w.ICoreBrowserService),m(3,w.IRenderService)],l)},3614:(g,o)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function f(_,S){return S?"\x1B[200~"+_+"\x1B[201~":_}function m(_,S,w,p){_=f(_=c(_),w.decPrivateModes.bracketedPasteMode&&p.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(_,!0),S.value=""}function d(_,S,w){const p=w.getBoundingClientRect(),u=_.clientX-p.left-10,l=_.clientY-p.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${u}px`,S.style.top=`${l}px`,S.style.zIndex="1000",S.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=f,o.copyHandler=function(_,S){_.clipboardData&&_.clipboardData.setData("text/plain",S.selectionText),_.preventDefault()},o.handlePasteEvent=function(_,S,w,p){_.stopPropagation(),_.clipboardData&&m(_.clipboardData.getData("text/plain"),S,w,p)},o.paste=m,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(_,S,w,p,u){d(_,S,w),u&&p.rightClickSelect(_),S.value=p.selectionText,S.select()}},7239:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const f=c(1505);o.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(m,d,_){this._css.set(m,d,_)}getCss(m,d){return this._css.get(m,d)}setColor(m,d,_){this._color.set(m,d,_)}getColor(m,d){return this._color.get(m,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,f,m,d){c.addEventListener(f,m,d);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(f,m,d))}}}},3551:function(g,o,c){var f=this&&this.__decorate||function(l,s,a,v){var C,x=arguments.length,E=x<3?s:v===null?v=Object.getOwnPropertyDescriptor(s,a):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,s,a,v);else for(var y=l.length-1;y>=0;y--)(C=l[y])&&(E=(x<3?C(E):x>3?C(s,a,E):C(s,a))||E);return x>3&&E&&Object.defineProperty(s,a,E),E},m=this&&this.__param||function(l,s){return function(a,v){s(a,v,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=c(3656),_=c(8460),S=c(844),w=c(2585),p=c(4725);let u=o.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(l,s,a,v,C){super(),this._element=l,this._mouseService=s,this._renderService=a,this._bufferService=v,this._linkProviderService=C,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)(()=>{var x;this._lastMouseEvent=void 0,(x=this._activeProviderReplies)==null||x.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(l){this._lastMouseEvent=l;const s=this._positionFromMouseEvent(l,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const a=l.composedPath();for(let v=0;v<a.length;v++){const C=a[v];if(C.classList.contains("xterm"))break;if(C.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(l){if(this._activeLine!==l.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(l,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,l)||(this._clearCurrentLink(),this._askForLink(l,!0))}_askForLink(l,s){var v,C;this._activeProviderReplies&&s||((v=this._activeProviderReplies)==null||v.forEach(x=>{x==null||x.forEach(E=>{E.link.dispose&&E.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=l.y);let a=!1;for(const[x,E]of this._linkProviderService.linkProviders.entries())s?(C=this._activeProviderReplies)!=null&&C.get(x)&&(a=this._checkLinkProviderResult(x,l,a)):E.provideLinks(l.y,y=>{var R,A;if(this._isMouseOut)return;const b=y==null?void 0:y.map(O=>({link:O}));(R=this._activeProviderReplies)==null||R.set(x,b),a=this._checkLinkProviderResult(x,l,a),((A=this._activeProviderReplies)==null?void 0:A.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(l.y,this._activeProviderReplies)})}_removeIntersectingLinks(l,s){const a=new Set;for(let v=0;v<s.size;v++){const C=s.get(v);if(C)for(let x=0;x<C.length;x++){const E=C[x],y=E.link.range.start.y<l?0:E.link.range.start.x,b=E.link.range.end.y>l?this._bufferService.cols:E.link.range.end.x;for(let R=y;R<=b;R++){if(a.has(R)){C.splice(x--,1);break}a.add(R)}}}}_checkLinkProviderResult(l,s,a){var x;if(!this._activeProviderReplies)return a;const v=this._activeProviderReplies.get(l);let C=!1;for(let E=0;E<l;E++)this._activeProviderReplies.has(E)&&!this._activeProviderReplies.get(E)||(C=!0);if(!C&&v){const E=v.find(y=>this._linkAtPosition(y.link,s));E&&(a=!0,this._handleNewLink(E))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!a)for(let E=0;E<this._activeProviderReplies.size;E++){const y=(x=this._activeProviderReplies.get(E))==null?void 0:x.find(b=>this._linkAtPosition(b.link,s));if(y){a=!0,this._handleNewLink(y);break}}return a}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(l){if(!this._currentLink)return;const s=this._positionFromMouseEvent(l,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(l,this._currentLink.link.text)}_clearCurrentLink(l,s){this._currentLink&&this._lastMouseEvent&&(!l||!s||this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(l){if(!this._lastMouseEvent)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(l.link,s)&&(this._currentLink=l,this._currentLink.state={decorations:{underline:l.link.decorations===void 0||l.link.decorations.underline,pointerCursor:l.link.decorations===void 0||l.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,l.link,this._lastMouseEvent),l.link.decorations={},Object.defineProperties(l.link.decorations,{pointerCursor:{get:()=>{var a,v;return(v=(a=this._currentLink)==null?void 0:a.state)==null?void 0:v.decorations.pointerCursor},set:a=>{var v;(v=this._currentLink)!=null&&v.state&&this._currentLink.state.decorations.pointerCursor!==a&&(this._currentLink.state.decorations.pointerCursor=a,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",a))}},underline:{get:()=>{var a,v;return(v=(a=this._currentLink)==null?void 0:a.state)==null?void 0:v.decorations.underline},set:a=>{var v,C,x;(v=this._currentLink)!=null&&v.state&&((x=(C=this._currentLink)==null?void 0:C.state)==null?void 0:x.decorations.underline)!==a&&(this._currentLink.state.decorations.underline=a,this._currentLink.state.isHovered&&this._fireUnderlineEvent(l.link,a))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(a=>{if(!this._currentLink)return;const v=a.start===0?0:a.start+1+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.ydisp+1+a.end;if(this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=C&&(this._clearCurrentLink(v,C),this._lastMouseEvent)){const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._askForLink(x,!1)}})))}_linkHover(l,s,a){var v;(v=this._currentLink)!=null&&v.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&l.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(a,s.text)}_fireUnderlineEvent(l,s){const a=l.range,v=this._bufferService.buffer.ydisp,C=this._createLinkUnderlineEvent(a.start.x-1,a.start.y-v-1,a.end.x,a.end.y-v-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(C)}_linkLeave(l,s,a){var v;(v=this._currentLink)!=null&&v.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&l.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(a,s.text)}_linkAtPosition(l,s){const a=l.range.start.y*this._bufferService.cols+l.range.start.x,v=l.range.end.y*this._bufferService.cols+l.range.end.x,C=s.y*this._bufferService.cols+s.x;return a<=C&&C<=v}_positionFromMouseEvent(l,s,a){const v=a.getCoords(l,s,this._bufferService.cols,this._bufferService.rows);if(v)return{x:v[0],y:v[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(l,s,a,v,C){return{x1:l,y1:s,x2:a,y2:v,cols:this._bufferService.cols,fg:C}}};o.Linkifier=u=f([m(1,p.IMouseService),m(2,p.IRenderService),m(3,w.IBufferService),m(4,p.ILinkProviderService)],u)},9042:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(g,o,c){var f=this&&this.__decorate||function(p,u,l,s){var a,v=arguments.length,C=v<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,l):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(p,u,l,s);else for(var x=p.length-1;x>=0;x--)(a=p[x])&&(C=(v<3?a(C):v>3?a(u,l,C):a(u,l))||C);return v>3&&C&&Object.defineProperty(u,l,C),C},m=this&&this.__param||function(p,u){return function(l,s){u(l,s,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=c(511),_=c(2585);let S=o.OscLinkProvider=class{constructor(p,u,l){this._bufferService=p,this._optionsService=u,this._oscLinkService=l}provideLinks(p,u){var b;const l=this._bufferService.buffer.lines.get(p-1);if(!l)return void u(void 0);const s=[],a=this._optionsService.rawOptions.linkHandler,v=new d.CellData,C=l.getTrimmedLength();let x=-1,E=-1,y=!1;for(let R=0;R<C;R++)if(E!==-1||l.hasContent(R)){if(l.loadCell(R,v),v.hasExtendedAttrs()&&v.extended.urlId){if(E===-1){E=R,x=v.extended.urlId;continue}y=v.extended.urlId!==x}else E!==-1&&(y=!0);if(y||E!==-1&&R===C-1){const A=(b=this._oscLinkService.getLinkData(x))==null?void 0:b.uri;if(A){const O={start:{x:E+1,y:p},end:{x:R+(y||R!==C-1?0:1),y:p}};let P=!1;if(!(a!=null&&a.allowNonHttpProtocols))try{const j=new URL(A);["http:","https:"].includes(j.protocol)||(P=!0)}catch{P=!0}P||s.push({text:A,range:O,activate:(j,z)=>a?a.activate(j,z,O):w(0,z),hover:(j,z)=>{var K;return(K=a==null?void 0:a.hover)==null?void 0:K.call(a,j,z,O)},leave:(j,z)=>{var K;return(K=a==null?void 0:a.leave)==null?void 0:K.call(a,j,z,O)}})}y=!1,v.hasExtendedAttrs()&&v.extended.urlId?(E=R,x=v.extended.urlId):(E=-1,x=-1)}}u(s)}};function w(p,u){if(confirm(`Do you want to navigate to ${u}?
|
|
59
|
+
|
|
60
|
+
WARNING: This link could potentially be dangerous`)){const l=window.open();if(l){try{l.opener=null}catch{}l.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=S=f([m(0,_.IBufferService),m(1,_.IOptionsService),m(2,_.IOscLinkService)],S)},6193:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,f){this._renderCallback=c,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(c,f,m){this._rowCount=m,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,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 c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const f=c(3614),m=c(3656),d=c(3551),_=c(9042),S=c(3730),w=c(1680),p=c(3107),u=c(5744),l=c(2950),s=c(1296),a=c(428),v=c(4269),C=c(5114),x=c(8934),E=c(3230),y=c(9312),b=c(4725),R=c(6731),A=c(8055),O=c(8969),P=c(8460),j=c(844),z=c(6114),K=c(8437),H=c(2584),N=c(7399),k=c(5941),D=c(9074),T=c(2585),M=c(5435),W=c(4567),V=c(779);class Q extends O.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(I={}){super(I),this.browser=z,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new j.MutableDisposable),this._onCursorMove=this.register(new P.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new P.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new P.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new P.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new P.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new P.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new P.EventEmitter),this._onBlur=this.register(new P.EventEmitter),this._onA11yCharEmitter=this.register(new P.EventEmitter),this._onA11yTabEmitter=this.register(new P.EventEmitter),this._onWillOpen=this.register(new P.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(T.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(V.LinkProviderService),this._instantiationService.setService(b.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((L,U)=>this.refresh(L,U))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(L=>this._reportWindowsOptions(L))),this.register(this._inputHandler.onColor(L=>this._handleColorEvent(L))),this.register((0,P.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,P.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(L=>this._afterResize(L.cols,L.rows))),this.register((0,j.toDisposable)(()=>{var L,U;this._customKeyEventHandler=void 0,(U=(L=this.element)==null?void 0:L.parentNode)==null||U.removeChild(this.element)}))}_handleColorEvent(I){if(this._themeService)for(const L of I){let U,F="";switch(L.index){case 256:U="foreground",F="10";break;case 257:U="background",F="11";break;case 258:U="cursor",F="12";break;default:U="ansi",F="4;"+L.index}switch(L.type){case 0:const G=A.color.toColorRGB(U==="ansi"?this._themeService.colors.ansi[L.index]:this._themeService.colors[U]);this.coreService.triggerDataEvent(`${H.C0.ESC}]${F};${(0,k.toRgbString)(G)}${H.C1_ESCAPED.ST}`);break;case 1:if(U==="ansi")this._themeService.modifyColors(q=>q.ansi[L.index]=A.channels.toColor(...L.color));else{const q=U;this._themeService.modifyColors(te=>te[q]=A.channels.toColor(...L.color))}break;case 2:this._themeService.restoreColor(L.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(I){I?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(I){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(H.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var I;return(I=this.textarea)==null?void 0:I.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(H.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 I=this.buffer.ybase+this.buffer.y,L=this.buffer.lines.get(I);if(!L)return;const U=Math.min(this.buffer.x,this.cols-1),F=this._renderService.dimensions.css.cell.height,G=L.getWidth(U),q=this._renderService.dimensions.css.cell.width*G,te=this.buffer.y*this._renderService.dimensions.css.cell.height,_e=U*this._renderService.dimensions.css.cell.width;this.textarea.style.left=_e+"px",this.textarea.style.top=te+"px",this.textarea.style.width=q+"px",this.textarea.style.height=F+"px",this.textarea.style.lineHeight=F+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",L=>{this.hasSelection()&&(0,f.copyHandler)(L,this._selectionService)}));const I=L=>(0,f.handlePasteEvent)(L,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",I)),this.register((0,m.addDisposableDomListener)(this.element,"paste",I)),z.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",L=>{L.button===2&&(0,f.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",L=>{(0,f.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),z.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",L=>{L.button===1&&(0,f.moveTextAreaUnderMouseCursor)(L,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",I=>this._keyUp(I),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",I=>this._keyDown(I),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",I=>this._keyPress(I),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",I=>this._compositionHelper.compositionupdate(I))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,m.addDisposableDomListener)(this.textarea,"input",I=>this._inputEvent(I),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(I){var U;if(!I)throw new Error("Terminal requires a parent element.");if(I.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((U=this.element)==null?void 0:U.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=I.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"),I.appendChild(this.element);const L=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),L.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,m.addDisposableDomListener)(this.screenElement,"mousemove",F=>this.updateCursorStyle(F))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),L.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),z.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(C.CoreBrowserService,this.textarea,I.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(b.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",F=>this._handleTextAreaFocus(F))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(a.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(b.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(R.ThemeService),this._instantiationService.setService(b.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(v.CharacterJoinerService),this._instantiationService.setService(b.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(E.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(b.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(F=>this._onRender.fire(F))),this.onResize(F=>this._renderService.resize(F.cols,F.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(l.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(x.MouseService),this._instantiationService.setService(b.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(L);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(F=>this.scrollLines(F.amount,F.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(b.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(F=>this.scrollLines(F.amount,F.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(F=>this._renderService.handleSelectionChanged(F.start,F.end,F.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(F=>{this.textarea.value=F,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(F=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(p.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",F=>this._selectionService.handleMouseDown(F))),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(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",F=>this._handleScreenReaderModeOptionChange(F))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",F=>{!this._overviewRulerRenderer&&F&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(s.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const I=this,L=this.element;function U(q){const te=I._mouseService.getMouseReportCoords(q,I.screenElement);if(!te)return!1;let _e,pe;switch(q.overrideType||q.type){case"mousemove":pe=32,q.buttons===void 0?(_e=3,q.button!==void 0&&(_e=q.button<3?q.button:3)):_e=1&q.buttons?0:4&q.buttons?1:2&q.buttons?2:3;break;case"mouseup":pe=0,_e=q.button<3?q.button:3;break;case"mousedown":pe=1,_e=q.button<3?q.button:3;break;case"wheel":if(I._customWheelEventHandler&&I._customWheelEventHandler(q)===!1||I.viewport.getLinesScrolled(q)===0)return!1;pe=q.deltaY<0?0:1,_e=4;break;default:return!1}return!(pe===void 0||_e===void 0||_e>4)&&I.coreMouseService.triggerMouseEvent({col:te.col,row:te.row,x:te.x,y:te.y,button:_e,action:pe,ctrl:q.ctrlKey,alt:q.altKey,shift:q.shiftKey})}const F={mouseup:null,wheel:null,mousedrag:null,mousemove:null},G={mouseup:q=>(U(q),q.buttons||(this._document.removeEventListener("mouseup",F.mouseup),F.mousedrag&&this._document.removeEventListener("mousemove",F.mousedrag)),this.cancel(q)),wheel:q=>(U(q),this.cancel(q,!0)),mousedrag:q=>{q.buttons&&U(q)},mousemove:q=>{q.buttons||U(q)}};this.register(this.coreMouseService.onProtocolChange(q=>{q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(q)),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&q?F.mousemove||(L.addEventListener("mousemove",G.mousemove),F.mousemove=G.mousemove):(L.removeEventListener("mousemove",F.mousemove),F.mousemove=null),16&q?F.wheel||(L.addEventListener("wheel",G.wheel,{passive:!1}),F.wheel=G.wheel):(L.removeEventListener("wheel",F.wheel),F.wheel=null),2&q?F.mouseup||(F.mouseup=G.mouseup):(this._document.removeEventListener("mouseup",F.mouseup),F.mouseup=null),4&q?F.mousedrag||(F.mousedrag=G.mousedrag):(this._document.removeEventListener("mousemove",F.mousedrag),F.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(L,"mousedown",q=>{if(q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(q))return U(q),F.mouseup&&this._document.addEventListener("mouseup",F.mouseup),F.mousedrag&&this._document.addEventListener("mousemove",F.mousedrag),this.cancel(q)})),this.register((0,m.addDisposableDomListener)(L,"wheel",q=>{if(!F.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(q)===!1)return!1;if(!this.buffer.hasScrollback){const te=this.viewport.getLinesScrolled(q);if(te===0)return;const _e=H.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(q.deltaY<0?"A":"B");let pe="";for(let je=0;je<Math.abs(te);je++)pe+=_e;return this.coreService.triggerDataEvent(pe,!0),this.cancel(q,!0)}return this.viewport.handleWheel(q)?this.cancel(q):void 0}},{passive:!1})),this.register((0,m.addDisposableDomListener)(L,"touchstart",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(q),this.cancel(q)},{passive:!0})),this.register((0,m.addDisposableDomListener)(L,"touchmove",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(q)?void 0:this.cancel(q)},{passive:!1}))}refresh(I,L){var U;(U=this._renderService)==null||U.refreshRows(I,L)}updateCursorStyle(I){var L;(L=this._selectionService)!=null&&L.shouldColumnSelect(I)?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(I,L,U=0){var F;U===1?(super.scrollLines(I,L,U),this.refresh(0,this.rows-1)):(F=this.viewport)==null||F.scrollLines(I)}paste(I){(0,f.paste)(I,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(I){this._customKeyEventHandler=I}attachCustomWheelEventHandler(I){this._customWheelEventHandler=I}registerLinkProvider(I){return this._linkProviderService.registerLinkProvider(I)}registerCharacterJoiner(I){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const L=this._characterJoinerService.register(I);return this.refresh(0,this.rows-1),L}deregisterCharacterJoiner(I){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(I)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(I){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+I)}registerDecoration(I){return this._decorationService.registerDecoration(I)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(I,L,U){this._selectionService.setSelection(I,L,U)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var I;(I=this._selectionService)==null||I.clearSelection()}selectAll(){var I;(I=this._selectionService)==null||I.selectAll()}selectLines(I,L){var U;(U=this._selectionService)==null||U.selectLines(I,L)}_keyDown(I){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1)return!1;const L=this.browser.isMac&&this.options.macOptionIsMeta&&I.altKey;if(!L&&!this._compositionHelper.keydown(I))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;L||I.key!=="Dead"&&I.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const U=(0,N.evaluateKeyboardEvent)(I,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(I),U.type===3||U.type===2){const F=this.rows-1;return this.scrollLines(U.type===2?-F:F),this.cancel(I,!0)}return U.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,I)||(U.cancel&&this.cancel(I,!0),!U.key||!!(I.key&&!I.ctrlKey&&!I.altKey&&!I.metaKey&&I.key.length===1&&I.key.charCodeAt(0)>=65&&I.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(U.key!==H.C0.ETX&&U.key!==H.C0.CR||(this.textarea.value=""),this._onKey.fire({key:U.key,domEvent:I}),this._showCursor(),this.coreService.triggerDataEvent(U.key,!0),!this.optionsService.rawOptions.screenReaderMode||I.altKey||I.ctrlKey?this.cancel(I,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(I,L){const U=I.isMac&&!this.options.macOptionIsMeta&&L.altKey&&!L.ctrlKey&&!L.metaKey||I.isWindows&&L.altKey&&L.ctrlKey&&!L.metaKey||I.isWindows&&L.getModifierState("AltGraph");return L.type==="keypress"?U:U&&(!L.keyCode||L.keyCode>47)}_keyUp(I){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1||(function(L){return L.keyCode===16||L.keyCode===17||L.keyCode===18}(I)||this.focus(),this.updateCursorStyle(I),this._keyPressHandled=!1)}_keyPress(I){let L;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1)return!1;if(this.cancel(I),I.charCode)L=I.charCode;else if(I.which===null||I.which===void 0)L=I.keyCode;else{if(I.which===0||I.charCode===0)return!1;L=I.which}return!(!L||(I.altKey||I.ctrlKey||I.metaKey)&&!this._isThirdLevelShift(this.browser,I)||(L=String.fromCharCode(L),this._onKey.fire({key:L,domEvent:I}),this._showCursor(),this.coreService.triggerDataEvent(L,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(I){if(I.data&&I.inputType==="insertText"&&(!I.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const L=I.data;return this.coreService.triggerDataEvent(L,!0),this.cancel(I),!0}return!1}resize(I,L){I!==this.cols||L!==this.rows?super.resize(I,L):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(I,L){var U,F;(U=this._charSizeService)==null||U.measure(),(F=this.viewport)==null||F.syncScrollArea(!0)}clear(){var I;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 L=1;L<this.rows;L++)this.buffer.lines.push(this.buffer.getBlankLine(K.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(I=this.viewport)==null||I.reset(),this.refresh(0,this.rows-1)}}reset(){var L,U;this.options.rows=this.rows,this.options.cols=this.cols;const I=this._customKeyEventHandler;this._setup(),super.reset(),(L=this._selectionService)==null||L.reset(),this._decorationService.reset(),(U=this.viewport)==null||U.reset(),this._customKeyEventHandler=I,this.refresh(0,this.rows-1)}clearTextureAtlas(){var I;(I=this._renderService)==null||I.clearTextureAtlas()}_reportFocus(){var I;(I=this.element)!=null&&I.classList.contains("focus")?this.coreService.triggerDataEvent(H.C0.ESC+"[I"):this.coreService.triggerDataEvent(H.C0.ESC+"[O")}_reportWindowsOptions(I){if(this._renderService)switch(I){case M.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const L=this._renderService.dimensions.css.canvas.width.toFixed(0),U=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${H.C0.ESC}[4;${U};${L}t`);break;case M.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const F=this._renderService.dimensions.css.cell.width.toFixed(0),G=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${H.C0.ESC}[6;${G};${F}t`)}}cancel(I,L){if(this.options.cancelEvents||L)return I.preventDefault(),I.stopPropagation(),!1}}o.Terminal=Q},9924:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,f=1e3){this._renderCallback=c,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,f,m){this._rowCount=m,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=d-this._lastRefreshMs,S=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},S)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f)}}},1680:function(g,o,c){var f=this&&this.__decorate||function(l,s,a,v){var C,x=arguments.length,E=x<3?s:v===null?v=Object.getOwnPropertyDescriptor(s,a):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,s,a,v);else for(var y=l.length-1;y>=0;y--)(C=l[y])&&(E=(x<3?C(E):x>3?C(s,a,E):C(s,a))||E);return x>3&&E&&Object.defineProperty(s,a,E),E},m=this&&this.__param||function(l,s){return function(a,v){s(a,v,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=c(3656),_=c(4725),S=c(8460),w=c(844),p=c(2585);let u=o.Viewport=class extends w.Disposable{constructor(l,s,a,v,C,x,E,y){super(),this._viewportElement=l,this._scrollArea=s,this._bufferService=a,this._optionsService=v,this._charSizeService=C,this._renderService=x,this._coreBrowserService=E,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 S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(b=>this._activeBuffer=b.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(b=>this._renderDimensions=b)),this._handleThemeChange(y.colors),this.register(y.onChangeColors(b=>this._handleThemeChange(b))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(l){this._viewportElement.style.backgroundColor=l.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(l){if(l)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 s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==s&&(this._lastRecordedBufferHeight=s,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const l=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==l&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=l),this._refreshAnimationFrame=null}syncScrollArea(l=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(l);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(l)}_handleScroll(l){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 s=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const l=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(l*(this._smoothScrollState.target-this._smoothScrollState.origin)),l<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(l,s){const a=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&a<this._lastRecordedBufferHeight)||(l.cancelable&&l.preventDefault(),!1)}handleWheel(l){const s=this._getPixelsScrolled(l);return s!==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+s:this._smoothScrollState.target+=s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=s,this._bubbleScroll(l,s))}scrollLines(l){if(l!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const s=l*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!1})}_getPixelsScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let s=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getBufferElements(l,s){var y;let a,v="";const C=[],x=s??this._bufferService.buffer.lines.length,E=this._bufferService.buffer.lines;for(let b=l;b<x;b++){const R=E.get(b);if(!R)continue;const A=(y=E.get(b+1))==null?void 0:y.isWrapped;if(v+=R.translateToString(!A),!A||b===E.length-1){const O=document.createElement("div");O.textContent=v,C.push(O),v.length>0&&(a=O),v=""}}return{bufferElements:C,cursorElement:a}}getLinesScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let s=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=this._currentRowHeight+0,this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(l,s){const a=this._optionsService.rawOptions.fastScrollModifier;return a==="alt"&&s.altKey||a==="ctrl"&&s.ctrlKey||a==="shift"&&s.shiftKey?l*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:l*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(l){this._lastTouchY=l.touches[0].pageY}handleTouchMove(l){const s=this._lastTouchY-l.touches[0].pageY;return this._lastTouchY=l.touches[0].pageY,s!==0&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(l,s))}};o.Viewport=u=f([m(2,p.IBufferService),m(3,p.IOptionsService),m(4,_.ICharSizeService),m(5,_.IRenderService),m(6,_.ICoreBrowserService),m(7,_.IThemeService)],u)},3107:function(g,o,c){var f=this&&this.__decorate||function(p,u,l,s){var a,v=arguments.length,C=v<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,l):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(p,u,l,s);else for(var x=p.length-1;x>=0;x--)(a=p[x])&&(C=(v<3?a(C):v>3?a(u,l,C):a(u,l))||C);return v>3&&C&&Object.defineProperty(u,l,C),C},m=this&&this.__param||function(p,u){return function(l,s){u(l,s,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=c(4725),_=c(844),S=c(2585);let w=o.BufferDecorationRenderer=class extends _.Disposable{constructor(p,u,l,s,a){super(),this._screenElement=p,this._bufferService=u,this._coreBrowserService=l,this._decorationService=s,this._renderService=a,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register(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(v=>this._removeDecoration(v))),this.register((0,_.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 p of this._decorationService.decorations)this._renderDecoration(p);this._dimensionsChanged=!1}_renderDecoration(p){this._refreshStyle(p),this._dimensionsChanged&&this._refreshXPosition(p)}_createElement(p){var s;const u=this._coreBrowserService.mainDocument.createElement("div");u.classList.add("xterm-decoration"),u.classList.toggle("xterm-decoration-top-layer",((s=p==null?void 0:p.options)==null?void 0:s.layer)==="top"),u.style.width=`${Math.round((p.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,u.style.height=(p.options.height||1)*this._renderService.dimensions.css.cell.height+"px",u.style.top=(p.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",u.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const l=p.options.x??0;return l&&l>this._bufferService.cols&&(u.style.display="none"),this._refreshXPosition(p,u),u}_refreshStyle(p){const u=p.marker.line-this._bufferService.buffers.active.ydisp;if(u<0||u>=this._bufferService.rows)p.element&&(p.element.style.display="none",p.onRenderEmitter.fire(p.element));else{let l=this._decorationElements.get(p);l||(l=this._createElement(p),p.element=l,this._decorationElements.set(p,l),this._container.appendChild(l),p.onDispose(()=>{this._decorationElements.delete(p),l.remove()})),l.style.top=u*this._renderService.dimensions.css.cell.height+"px",l.style.display=this._altBufferIsActive?"none":"block",p.onRenderEmitter.fire(l)}}_refreshXPosition(p,u=p.element){if(!u)return;const l=p.options.x??0;(p.options.anchor||"left")==="right"?u.style.right=l?l*this._renderService.dimensions.css.cell.width+"px":"":u.style.left=l?l*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(p){var u;(u=this._decorationElements.get(p))==null||u.remove(),this._decorationElements.delete(p),p.dispose()}};o.BufferDecorationRenderer=w=f([m(1,S.IBufferService),m(2,d.ICoreBrowserService),m(3,S.IDecorationService),m(4,d.IRenderService)],w)},5871:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.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(c){if(c.options.overviewRulerOptions){for(const f of this._zones)if(f.color===c.options.overviewRulerOptions.color&&f.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,c.marker.line))return;if(this._lineAdjacentToZone(f,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(f,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,f){return f>=c.startBufferLine&&f<=c.endBufferLine}_lineAdjacentToZone(c,f,m){return f>=c.startBufferLine-this._linePadding[m||"full"]&&f<=c.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(c,f){c.startBufferLine=Math.min(c.startBufferLine,f),c.endBufferLine=Math.max(c.endBufferLine,f)}}},5744:function(g,o,c){var f=this&&this.__decorate||function(a,v,C,x){var E,y=arguments.length,b=y<3?v:x===null?x=Object.getOwnPropertyDescriptor(v,C):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(a,v,C,x);else for(var R=a.length-1;R>=0;R--)(E=a[R])&&(b=(y<3?E(b):y>3?E(v,C,b):E(v,C))||b);return y>3&&b&&Object.defineProperty(v,C,b),b},m=this&&this.__param||function(a,v){return function(C,x){v(C,x,a)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=c(5871),_=c(4725),S=c(844),w=c(2585),p={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0};let s=o.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(a,v,C,x,E,y,b){var A;super(),this._viewportElement=a,this._screenElement=v,this._bufferService=C,this._decorationService=x,this._renderService=E,this._optionsService=y,this._coreBrowserService=b,this._colorZoneStore=new d.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(),(A=this._viewportElement.parentElement)==null||A.insertBefore(this._canvas,this._viewportElement);const R=this._canvas.getContext("2d");if(!R)throw new Error("Ctx cannot be null");this._ctx=R,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)(()=>{var O;(O=this._canvas)==null||O.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 a=Math.floor(this._canvas.width/3),v=Math.ceil(this._canvas.width/3);u.full=this._canvas.width,u.left=a,u.center=v,u.right=a,this._refreshDrawHeightConstants(),l.full=0,l.left=0,l.center=u.left,l.right=u.left+u.center}_refreshDrawHeightConstants(){p.full=Math.round(2*this._coreBrowserService.dpr);const a=this._canvas.height/this._bufferService.buffer.lines.length,v=Math.round(Math.max(Math.min(a,12),6)*this._coreBrowserService.dpr);p.left=v,p.center=v,p.right=v}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.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 v of this._decorationService.decorations)this._colorZoneStore.addDecoration(v);this._ctx.lineWidth=1;const a=this._colorZoneStore.zones;for(const v of a)v.position!=="full"&&this._renderColorZone(v);for(const v of a)v.position==="full"&&this._renderColorZone(v);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(a){this._ctx.fillStyle=a.color,this._ctx.fillRect(l[a.position||"full"],Math.round((this._canvas.height-1)*(a.startBufferLine/this._bufferService.buffers.active.lines.length)-p[a.position||"full"]/2),u[a.position||"full"],Math.round((this._canvas.height-1)*((a.endBufferLine-a.startBufferLine)/this._bufferService.buffers.active.lines.length)+p[a.position||"full"]))}_queueRefresh(a,v){this._shouldUpdateDimensions=a||this._shouldUpdateDimensions,this._shouldUpdateAnchor=v||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};o.OverviewRulerRenderer=s=f([m(2,w.IBufferService),m(3,w.IDecorationService),m(4,_.IRenderService),m(5,w.IOptionsService),m(6,_.ICoreBrowserService)],s)},2950:function(g,o,c){var f=this&&this.__decorate||function(p,u,l,s){var a,v=arguments.length,C=v<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,l):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(p,u,l,s);else for(var x=p.length-1;x>=0;x--)(a=p[x])&&(C=(v<3?a(C):v>3?a(u,l,C):a(u,l))||C);return v>3&&C&&Object.defineProperty(u,l,C),C},m=this&&this.__param||function(p,u){return function(l,s){u(l,s,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=c(4725),_=c(2585),S=c(2584);let w=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(p,u,l,s,a,v){this._textarea=p,this._compositionView=u,this._bufferService=l,this._optionsService=s,this._coreService=a,this._renderService=v,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(p){this._compositionView.textContent=p.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(p){if(this._isComposing||this._isSendingComposition){if(p.keyCode===229||p.keyCode===16||p.keyCode===17||p.keyCode===18)return!1;this._finalizeComposition(!1)}return p.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(p){if(this._compositionView.classList.remove("active"),this._isComposing=!1,p){const u={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let l;this._isSendingComposition=!1,u.start+=this._dataAlreadySent.length,l=this._isComposing?this._textarea.value.substring(u.start,u.end):this._textarea.value.substring(u.start),l.length>0&&this._coreService.triggerDataEvent(l,!0)}},0)}else{this._isSendingComposition=!1;const u=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(u,!0)}}_handleAnyTextareaChanges(){const p=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const u=this._textarea.value,l=u.replace(p,"");this._dataAlreadySent=l,u.length>p.length?this._coreService.triggerDataEvent(l,!0):u.length<p.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):u.length===p.length&&u!==p&&this._coreService.triggerDataEvent(u,!0)}},0)}updateCompositionElements(p){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const u=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),l=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,a=u*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=a+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=l+"px",this._compositionView.style.lineHeight=l+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const v=this._compositionView.getBoundingClientRect();this._textarea.style.left=a+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(v.width,1)+"px",this._textarea.style.height=Math.max(v.height,1)+"px",this._textarea.style.lineHeight=v.height+"px"}p||setTimeout(()=>this.updateCompositionElements(!0),0)}}};o.CompositionHelper=w=f([m(2,_.IBufferService),m(3,_.IOptionsService),m(4,_.ICoreService),m(5,d.IRenderService)],w)},9806:(g,o)=>{function c(f,m,d){const _=d.getBoundingClientRect(),S=f.getComputedStyle(d),w=parseInt(S.getPropertyValue("padding-left")),p=parseInt(S.getPropertyValue("padding-top"));return[m.clientX-_.left-w,m.clientY-_.top-p]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(f,m,d,_,S,w,p,u,l){if(!w)return;const s=c(f,m,d);return s?(s[0]=Math.ceil((s[0]+(l?p/2:0))/p),s[1]=Math.ceil(s[1]/u),s[0]=Math.min(Math.max(s[0],1),_+(l?1:0)),s[1]=Math.min(Math.max(s[1],1),S),s):void 0}},9504:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const f=c(2584);function m(u,l,s,a){const v=u-d(u,s),C=l-d(l,s),x=Math.abs(v-C)-function(E,y,b){let R=0;const A=E-d(E,b),O=y-d(y,b);for(let P=0;P<Math.abs(A-O);P++){const j=_(E,y)==="A"?-1:1,z=b.buffer.lines.get(A+j*P);z!=null&&z.isWrapped&&R++}return R}(u,l,s);return p(x,w(_(u,l),a))}function d(u,l){let s=0,a=l.buffer.lines.get(u),v=a==null?void 0:a.isWrapped;for(;v&&u>=0&&u<l.rows;)s++,a=l.buffer.lines.get(--u),v=a==null?void 0:a.isWrapped;return s}function _(u,l){return u>l?"A":"B"}function S(u,l,s,a,v,C){let x=u,E=l,y="";for(;x!==s||E!==a;)x+=v?1:-1,v&&x>C.cols-1?(y+=C.buffer.translateBufferLineToString(E,!1,u,x),x=0,u=0,E++):!v&&x<0&&(y+=C.buffer.translateBufferLineToString(E,!1,0,u+1),x=C.cols-1,u=x,E--);return y+C.buffer.translateBufferLineToString(E,!1,u,x)}function w(u,l){const s=l?"O":"[";return f.C0.ESC+s+u}function p(u,l){u=Math.floor(u);let s="";for(let a=0;a<u;a++)s+=l;return s}o.moveToCellSequence=function(u,l,s,a){const v=s.buffer.x,C=s.buffer.y;if(!s.buffer.hasScrollback)return function(y,b,R,A,O,P){return m(b,A,O,P).length===0?"":p(S(y,b,y,b-d(b,O),!1,O).length,w("D",P))}(v,C,0,l,s,a)+m(C,l,s,a)+function(y,b,R,A,O,P){let j;j=m(b,A,O,P).length>0?A-d(A,O):b;const z=A,K=function(H,N,k,D,T,M){let W;return W=m(k,D,T,M).length>0?D-d(D,T):N,H<k&&W<=D||H>=k&&W<D?"C":"D"}(y,b,R,A,O,P);return p(S(y,j,R,z,K==="C",O).length,w(K,P))}(v,C,u,l,s,a);let x;if(C===l)return x=v>u?"D":"C",p(Math.abs(v-u),w(x,a));x=C>l?"D":"C";const E=Math.abs(C-l);return p(function(y,b){return b.cols-y}(C>l?u:v,s)+(E-1)*s.cols+1+((C>l?v:u)-1),w(x,a))}},1296:function(g,o,c){var f=this&&this.__decorate||function(P,j,z,K){var H,N=arguments.length,k=N<3?j:K===null?K=Object.getOwnPropertyDescriptor(j,z):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(P,j,z,K);else for(var D=P.length-1;D>=0;D--)(H=P[D])&&(k=(N<3?H(k):N>3?H(j,z,k):H(j,z))||k);return N>3&&k&&Object.defineProperty(j,z,k),k},m=this&&this.__param||function(P,j){return function(z,K){j(z,K,P)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=c(3787),_=c(2550),S=c(2223),w=c(6171),p=c(6052),u=c(4725),l=c(8055),s=c(8460),a=c(844),v=c(2585),C="xterm-dom-renderer-owner-",x="xterm-rows",E="xterm-fg-",y="xterm-bg-",b="xterm-focus",R="xterm-selection";let A=1,O=o.DomRenderer=class extends a.Disposable{constructor(P,j,z,K,H,N,k,D,T,M,W,V,Q){super(),this._terminal=P,this._document=j,this._element=z,this._screenElement=K,this._viewportElement=H,this._helperContainer=N,this._linkifier2=k,this._charSizeService=T,this._optionsService=M,this._bufferService=W,this._coreBrowserService=V,this._themeService=Q,this._terminalClass=A++,this._rowElements=[],this._selectionRenderModel=(0,p.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new s.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(x),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(R),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(Y=>this._injectCss(Y))),this._injectCss(this._themeService.colors),this._rowFactory=D.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(C+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(Y=>this._handleLinkHover(Y))),this.register(this._linkifier2.onHideLinkUnderline(Y=>this._handleLinkLeave(Y))),this.register((0,a.toDisposable)(()=>{this._element.classList.remove(C+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new _.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 P=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*P,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*P),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/P),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/P),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 z of this._rowElements)z.style.width=`${this.dimensions.css.canvas.width}px`,z.style.height=`${this.dimensions.css.cell.height}px`,z.style.lineHeight=`${this.dimensions.css.cell.height}px`,z.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const j=`${this._terminalSelector} .${x} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=j,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(P){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let j=`${this._terminalSelector} .${x} { color: ${P.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;j+=`${this._terminalSelector} .${x} .xterm-dim { color: ${l.color.multiplyOpacity(P.foreground,.5).css};}`,j+=`${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 z=`blink_underline_${this._terminalClass}`,K=`blink_bar_${this._terminalClass}`,H=`blink_block_${this._terminalClass}`;j+=`@keyframes ${z} { 50% { border-bottom-style: hidden; }}`,j+=`@keyframes ${K} { 50% { box-shadow: none; }}`,j+=`@keyframes ${H} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,j+=`${this._terminalSelector} .${x}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${x}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${x}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${H} 1s step-end infinite;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-block { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css};}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${P.cursor.css} !important; color: ${P.cursorAccent.css} !important;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${P.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${P.cursor.css} inset;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${P.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,j+=`${this._terminalSelector} .${R} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${R} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${R} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[N,k]of P.ansi.entries())j+=`${this._terminalSelector} .${E}${N} { color: ${k.css}; }${this._terminalSelector} .${E}${N}.xterm-dim { color: ${l.color.multiplyOpacity(k,.5).css}; }${this._terminalSelector} .${y}${N} { background-color: ${k.css}; }`;j+=`${this._terminalSelector} .${E}${S.INVERTED_DEFAULT_COLOR} { color: ${l.color.opaque(P.background).css}; }${this._terminalSelector} .${E}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${l.color.multiplyOpacity(l.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${y}${S.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=j}_setDefaultSpacing(){const P=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${P}px`,this._rowFactory.defaultSpacing=P}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(P,j){for(let z=this._rowElements.length;z<=j;z++){const K=this._document.createElement("div");this._rowContainer.appendChild(K),this._rowElements.push(K)}for(;this._rowElements.length>j;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,j){this._refreshRowElements(P,j),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(b),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(b),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(P,j,z){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,j,z),this.renderRows(0,this._bufferService.rows-1),!P||!j)return;this._selectionRenderModel.update(this._terminal,P,j,z);const K=this._selectionRenderModel.viewportStartRow,H=this._selectionRenderModel.viewportEndRow,N=this._selectionRenderModel.viewportCappedStartRow,k=this._selectionRenderModel.viewportCappedEndRow;if(N>=this._bufferService.rows||k<0)return;const D=this._document.createDocumentFragment();if(z){const T=P[0]>j[0];D.appendChild(this._createSelectionElement(N,T?j[0]:P[0],T?P[0]:j[0],k-N+1))}else{const T=K===N?P[0]:0,M=N===H?j[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(N,T,M));const W=k-N-1;if(D.appendChild(this._createSelectionElement(N+1,0,this._bufferService.cols,W)),N!==k){const V=H===k?j[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(k,0,V))}}this._selectionContainer.appendChild(D)}_createSelectionElement(P,j,z,K=1){const H=this._document.createElement("div"),N=j*this.dimensions.css.cell.width;let k=this.dimensions.css.cell.width*(z-j);return N+k>this.dimensions.css.canvas.width&&(k=this.dimensions.css.canvas.width-N),H.style.height=K*this.dimensions.css.cell.height+"px",H.style.top=P*this.dimensions.css.cell.height+"px",H.style.left=`${N}px`,H.style.width=`${k}px`,H}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const P of this._rowElements)P.replaceChildren()}renderRows(P,j){const z=this._bufferService.buffer,K=z.ybase+z.y,H=Math.min(z.x,this._bufferService.cols-1),N=this._optionsService.rawOptions.cursorBlink,k=this._optionsService.rawOptions.cursorStyle,D=this._optionsService.rawOptions.cursorInactiveStyle;for(let T=P;T<=j;T++){const M=T+z.ydisp,W=this._rowElements[T],V=z.lines.get(M);if(!W||!V)break;W.replaceChildren(...this._rowFactory.createRow(V,M,M===K,k,D,H,N,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${C}${this._terminalClass}`}_handleLinkHover(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!0)}_handleLinkLeave(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!1)}_setCellUnderline(P,j,z,K,H,N){z<0&&(P=0),K<0&&(j=0);const k=this._bufferService.rows-1;z=Math.max(Math.min(z,k),0),K=Math.max(Math.min(K,k),0),H=Math.min(H,this._bufferService.cols);const D=this._bufferService.buffer,T=D.ybase+D.y,M=Math.min(D.x,H-1),W=this._optionsService.rawOptions.cursorBlink,V=this._optionsService.rawOptions.cursorStyle,Q=this._optionsService.rawOptions.cursorInactiveStyle;for(let Y=z;Y<=K;++Y){const I=Y+D.ydisp,L=this._rowElements[Y],U=D.lines.get(I);if(!L||!U)break;L.replaceChildren(...this._rowFactory.createRow(U,I,I===T,V,Q,M,W,this.dimensions.css.cell.width,this._widthCache,N?Y===z?P:0:-1,N?(Y===K?j:H)-1:-1))}}};o.DomRenderer=O=f([m(7,v.IInstantiationService),m(8,u.ICharSizeService),m(9,v.IOptionsService),m(10,v.IBufferService),m(11,u.ICoreBrowserService),m(12,u.IThemeService)],O)},3787:function(g,o,c){var f=this&&this.__decorate||function(x,E,y,b){var R,A=arguments.length,O=A<3?E:b===null?b=Object.getOwnPropertyDescriptor(E,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(x,E,y,b);else for(var P=x.length-1;P>=0;P--)(R=x[P])&&(O=(A<3?R(O):A>3?R(E,y,O):R(E,y))||O);return A>3&&O&&Object.defineProperty(E,y,O),O},m=this&&this.__param||function(x,E){return function(y,b){E(y,b,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=c(2223),_=c(643),S=c(511),w=c(2585),p=c(8055),u=c(4725),l=c(4269),s=c(6171),a=c(3734);let v=o.DomRendererRowFactory=class{constructor(x,E,y,b,R,A,O){this._document=x,this._characterJoinerService=E,this._optionsService=y,this._coreBrowserService=b,this._coreService=R,this._decorationService=A,this._themeService=O,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(x,E,y){this._selectionStart=x,this._selectionEnd=E,this._columnSelectMode=y}createRow(x,E,y,b,R,A,O,P,j,z,K){const H=[],N=this._characterJoinerService.getJoinedCharacters(E),k=this._themeService.colors;let D,T=x.getNoBgTrimmedLength();y&&T<A+1&&(T=A+1);let M=0,W="",V=0,Q=0,Y=0,I=!1,L=0,U=!1,F=0;const G=[],q=z!==-1&&K!==-1;for(let te=0;te<T;te++){x.loadCell(te,this._workCell);let _e=this._workCell.getWidth();if(_e===0)continue;let pe=!1,je=te,Z=this._workCell;if(N.length>0&&te===N[0][0]){pe=!0;const ue=N.shift();Z=new l.JoinedCellData(this._workCell,x.translateToString(!0,ue[0],ue[1]),ue[1]-ue[0]),je=ue[1]-1,_e=Z.getWidth()}const zr=this._isCellInSelection(te,E),ln=y&&te===A,an=q&&te>=z&&te<=K;let cn=!1;this._decorationService.forEachDecorationAtCell(te,E,void 0,ue=>{cn=!0});let ji=Z.getChars()||_.WHITESPACE_CELL_CHAR;if(ji===" "&&(Z.isUnderline()||Z.isOverline())&&(ji=" "),F=_e*P-j.get(ji,Z.isBold(),Z.isItalic()),D){if(M&&(zr&&U||!zr&&!U&&Z.bg===V)&&(zr&&U&&k.selectionForeground||Z.fg===Q)&&Z.extended.ext===Y&&an===I&&F===L&&!ln&&!pe&&!cn){Z.isInvisible()?W+=_.WHITESPACE_CELL_CHAR:W+=ji,M++;continue}M&&(D.textContent=W),D=this._document.createElement("span"),M=0,W=""}else D=this._document.createElement("span");if(V=Z.bg,Q=Z.fg,Y=Z.extended.ext,I=an,L=F,U=zr,pe&&A>=te&&A<=je&&(A=te),!this._coreService.isCursorHidden&&ln&&this._coreService.isCursorInitialized){if(G.push("xterm-cursor"),this._coreBrowserService.isFocused)O&&G.push("xterm-cursor-blink"),G.push(b==="bar"?"xterm-cursor-bar":b==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){case"outline":G.push("xterm-cursor-outline");break;case"block":G.push("xterm-cursor-block");break;case"bar":G.push("xterm-cursor-bar");break;case"underline":G.push("xterm-cursor-underline")}}if(Z.isBold()&&G.push("xterm-bold"),Z.isItalic()&&G.push("xterm-italic"),Z.isDim()&&G.push("xterm-dim"),W=Z.isInvisible()?_.WHITESPACE_CELL_CHAR:Z.getChars()||_.WHITESPACE_CELL_CHAR,Z.isUnderline()&&(G.push(`xterm-underline-${Z.extended.underlineStyle}`),W===" "&&(W=" "),!Z.isUnderlineColorDefault()))if(Z.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${a.AttributeData.toColorRGB(Z.getUnderlineColor()).join(",")})`;else{let ue=Z.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Z.isBold()&&ue<8&&(ue+=8),D.style.textDecorationColor=k.ansi[ue].css}Z.isOverline()&&(G.push("xterm-overline"),W===" "&&(W=" ")),Z.isStrikethrough()&&G.push("xterm-strikethrough"),an&&(D.style.textDecoration="underline");let Ye=Z.getFgColor(),Wr=Z.getFgColorMode(),dt=Z.getBgColor(),Ur=Z.getBgColorMode();const un=!!Z.isInverse();if(un){const ue=Ye;Ye=dt,dt=ue;const Mh=Wr;Wr=Ur,Ur=Mh}let Dt,Hi,Rt,$r=!1;switch(this._decorationService.forEachDecorationAtCell(te,E,void 0,ue=>{ue.options.layer!=="top"&&$r||(ue.backgroundColorRGB&&(Ur=50331648,dt=ue.backgroundColorRGB.rgba>>8&16777215,Dt=ue.backgroundColorRGB),ue.foregroundColorRGB&&(Wr=50331648,Ye=ue.foregroundColorRGB.rgba>>8&16777215,Hi=ue.foregroundColorRGB),$r=ue.options.layer==="top")}),!$r&&zr&&(Dt=this._coreBrowserService.isFocused?k.selectionBackgroundOpaque:k.selectionInactiveBackgroundOpaque,dt=Dt.rgba>>8&16777215,Ur=50331648,$r=!0,k.selectionForeground&&(Wr=50331648,Ye=k.selectionForeground.rgba>>8&16777215,Hi=k.selectionForeground)),$r&&G.push("xterm-decoration-top"),Ur){case 16777216:case 33554432:Rt=k.ansi[dt],G.push(`xterm-bg-${dt}`);break;case 50331648:Rt=p.channels.toColor(dt>>16,dt>>8&255,255&dt),this._addStyle(D,`background-color:#${C((dt>>>0).toString(16),"0",6)}`);break;default:un?(Rt=k.foreground,G.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):Rt=k.background}switch(Dt||Z.isDim()&&(Dt=p.color.multiplyOpacity(Rt,.5)),Wr){case 16777216:case 33554432:Z.isBold()&&Ye<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ye+=8),this._applyMinimumContrast(D,Rt,k.ansi[Ye],Z,Dt,void 0)||G.push(`xterm-fg-${Ye}`);break;case 50331648:const ue=p.channels.toColor(Ye>>16&255,Ye>>8&255,255&Ye);this._applyMinimumContrast(D,Rt,ue,Z,Dt,Hi)||this._addStyle(D,`color:#${C(Ye.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,Rt,k.foreground,Z,Dt,Hi)||un&&G.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}G.length&&(D.className=G.join(" "),G.length=0),ln||pe||cn?D.textContent=W:M++,F!==this.defaultSpacing&&(D.style.letterSpacing=`${F}px`),H.push(D),te=je}return D&&M&&(D.textContent=W),H}_applyMinimumContrast(x,E,y,b,R,A){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.treatGlyphAsBackgroundColor)(b.getCode()))return!1;const O=this._getContrastCache(b);let P;if(R||A||(P=O.getColor(E.rgba,y.rgba)),P===void 0){const j=this._optionsService.rawOptions.minimumContrastRatio/(b.isDim()?2:1);P=p.color.ensureContrastRatio(R||E,A||y,j),O.setColor((R||E).rgba,(A||y).rgba,P??null)}return!!P&&(this._addStyle(x,`color:${P.css}`),!0)}_getContrastCache(x){return x.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(x,E){x.setAttribute("style",`${x.getAttribute("style")||""}${E};`)}_isCellInSelection(x,E){const y=this._selectionStart,b=this._selectionEnd;return!(!y||!b)&&(this._columnSelectMode?y[0]<=b[0]?x>=y[0]&&E>=y[1]&&x<b[0]&&E<=b[1]:x<y[0]&&E>=y[1]&&x>=b[0]&&E<=b[1]:E>y[1]&&E<b[1]||y[1]===b[1]&&E===y[1]&&x>=y[0]&&x<b[0]||y[1]<b[1]&&E===b[1]&&x<b[0]||y[1]<b[1]&&E===y[1]&&x>=y[0])}};function C(x,E,y){for(;x.length<y;)x=E+x;return x}o.DomRendererRowFactory=v=f([m(1,u.ICharacterJoinerService),m(2,w.IOptionsService),m(3,u.ICoreBrowserService),m(4,w.ICoreService),m(5,w.IDecorationService),m(6,u.IThemeService)],v)},2550:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.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 m=c.createElement("span");m.classList.add("xterm-char-measure-element");const d=c.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const S=c.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[m,d,_,S],this._container.appendChild(m),this._container.appendChild(d),this._container.appendChild(_),this._container.appendChild(S),f.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(c,f,m,d){c===this._font&&f===this._fontSize&&m===this._weight&&d===this._weightBold||(this._font=c,this._fontSize=f,this._weight=m,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(c,f,m){let d=0;if(!f&&!m&&c.length===1&&(d=c.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const w=this._measure(c,0);return w>0&&(this._flat[d]=w),w}let _=c;f&&(_+="B"),m&&(_+="I");let S=this._holey.get(_);if(S===void 0){let w=0;f&&(w|=1),m&&(w|=2),S=this._measure(c,w),S>0&&this._holey.set(_,S)}return S}_measure(c,f){const m=this._measureElements[f];return m.textContent=c.repeat(32),m.offsetWidth/32}}},2223:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const f=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(g,o)=>{function c(m){return 57508<=m&&m<=57558}function f(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},o.isEmoji=f,o.allowRescaling=function(m,d,_,S){return d===1&&_>Math.ceil(1.5*S)&&m!==void 0&&m>255&&!f(m)&&!c(m)&&!function(w){return 57344<=w&&w<=63743}(m)},o.treatGlyphAsBackgroundColor=function(m){return c(m)||function(d){return 9472<=d&&d<=9631}(m)},o.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}}}},o.computeNextVariantOffset=function(m,d,_=0){return(m-(2*Math.round(d)-_))%(2*Math.round(d))}},6052:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{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(m,d,_,S=!1){if(this.selectionStart=d,this.selectionEnd=_,!d||!_||d[0]===_[0]&&d[1]===_[1])return void this.clear();const w=m.buffers.active.ydisp,p=d[1]-w,u=_[1]-w,l=Math.max(p,0),s=Math.min(u,m.rows-1);l>=m.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=p,this.viewportEndRow=u,this.viewportCappedStartRow=l,this.viewportCappedEndRow=s,this.startCol=d[0],this.endCol=_[0])}isCellSelected(m,d,_){return!!this.hasSelection&&(_-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&_>=this.viewportCappedStartRow&&d<this.endCol&&_<=this.viewportCappedEndRow:d<this.startCol&&_>=this.viewportCappedStartRow&&d>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&d>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,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 c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,f=this.selectionEnd;return!(!c||!f)&&(c[1]>f[1]||c[1]===f[1]&&c[0]>f[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(g,o,c){var f=this&&this.__decorate||function(s,a,v,C){var x,E=arguments.length,y=E<3?a:C===null?C=Object.getOwnPropertyDescriptor(a,v):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,a,v,C);else for(var b=s.length-1;b>=0;b--)(x=s[b])&&(y=(E<3?x(y):E>3?x(a,v,y):x(a,v))||y);return E>3&&y&&Object.defineProperty(a,v,y),y},m=this&&this.__param||function(s,a){return function(v,C){a(v,C,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=c(2585),_=c(8460),S=c(844);let w=o.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(s,a,v){super(),this._optionsService=v,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new l(this._optionsService))}catch{this._measureStrategy=this.register(new u(s,a,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const s=this._measureStrategy.measure();s.width===this.width&&s.height===this.height||(this.width=s.width,this.height=s.height,this._onCharSizeChange.fire())}};o.CharSizeService=w=f([m(2,d.IOptionsService)],w);class p extends S.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(a,v){a!==void 0&&a>0&&v!==void 0&&v>0&&(this._result.width=a,this._result.height=v)}}class u extends p{constructor(a,v,C){super(),this._document=a,this._parentElement=v,this._optionsService=C,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 l extends p{constructor(a){super(),this._optionsService=a,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const v=this._ctx.measureText("W");if(!("width"in v&&"fontBoundingBoxAscent"in v&&"fontBoundingBoxDescent"in v))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const a=this._ctx.measureText("W");return this._validateAndSet(a.width,a.fontBoundingBoxAscent+a.fontBoundingBoxDescent),this._result}}},4269:function(g,o,c){var f=this&&this.__decorate||function(l,s,a,v){var C,x=arguments.length,E=x<3?s:v===null?v=Object.getOwnPropertyDescriptor(s,a):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,s,a,v);else for(var y=l.length-1;y>=0;y--)(C=l[y])&&(E=(x<3?C(E):x>3?C(s,a,E):C(s,a))||E);return x>3&&E&&Object.defineProperty(s,a,E),E},m=this&&this.__param||function(l,s){return function(a,v){s(a,v,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=c(3734),_=c(643),S=c(511),w=c(2585);class p extends d.AttributeData{constructor(s,a,v){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=a,this._width=v}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(s){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=p;let u=o.CharacterJoinerService=class Eh{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(s){const a={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(a),a.id}deregister(s){for(let a=0;a<this._characterJoiners.length;a++)if(this._characterJoiners[a].id===s)return this._characterJoiners.splice(a,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const a=this._bufferService.buffer.lines.get(s);if(!a||a.length===0)return[];const v=[],C=a.translateToString(!0);let x=0,E=0,y=0,b=a.getFg(0),R=a.getBg(0);for(let A=0;A<a.getTrimmedLength();A++)if(a.loadCell(A,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==b||this._workCell.bg!==R){if(A-x>1){const O=this._getJoinedRanges(C,y,E,a,x);for(let P=0;P<O.length;P++)v.push(O[P])}x=A,y=E,b=this._workCell.fg,R=this._workCell.bg}E+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-x>1){const A=this._getJoinedRanges(C,y,E,a,x);for(let O=0;O<A.length;O++)v.push(A[O])}return v}_getJoinedRanges(s,a,v,C,x){const E=s.substring(a,v);let y=[];try{y=this._characterJoiners[0].handler(E)}catch(b){console.error(b)}for(let b=1;b<this._characterJoiners.length;b++)try{const R=this._characterJoiners[b].handler(E);for(let A=0;A<R.length;A++)Eh._mergeRanges(y,R[A])}catch(R){console.error(R)}return this._stringRangesToCellRanges(y,C,x),y}_stringRangesToCellRanges(s,a,v){let C=0,x=!1,E=0,y=s[C];if(y){for(let b=v;b<this._bufferService.cols;b++){const R=a.getWidth(b),A=a.getString(b).length||_.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!x&&y[0]<=E&&(y[0]=b,x=!0),y[1]<=E){if(y[1]=b,y=s[++C],!y)break;y[0]<=E?(y[0]=b,x=!0):x=!1}E+=A}}y&&(y[1]=this._bufferService.cols)}}static _mergeRanges(s,a){let v=!1;for(let C=0;C<s.length;C++){const x=s[C];if(v){if(a[1]<=x[0])return s[C-1][1]=a[1],s;if(a[1]<=x[1])return s[C-1][1]=Math.max(a[1],x[1]),s.splice(C,1),s;s.splice(C,1),C--}else{if(a[1]<=x[0])return s.splice(C,0,a),s;if(a[1]<=x[1])return x[0]=Math.min(a[0],x[0]),s;a[0]<x[1]&&(x[0]=Math.min(a[0],x[0]),v=!0)}}return v?s[s.length-1][1]=a[1]:s.push(a),s}};o.CharacterJoinerService=u=f([m(0,w.IBufferService)],u)},5114:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const f=c(844),m=c(8460),d=c(3656);class _ extends f.Disposable{constructor(p,u,l){super(),this._textarea=p,this._window=u,this.mainDocument=l,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new S(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this.register((0,m.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(p){this._window!==p&&(this._window=p,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}}o.CoreBrowserService=_;class S extends f.Disposable{constructor(p){super(),this._parentWindow=p,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)(()=>this.clearListener()))}setWindow(p){this._parentWindow=p,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var p;this._outerListener&&((p=this._resolutionMediaMatchList)==null||p.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const f=c(844);class m extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const S=this.linkProviders.indexOf(_);S!==-1&&this.linkProviders.splice(S,1)}}}}o.LinkProviderService=m},8934:function(g,o,c){var f=this&&this.__decorate||function(w,p,u,l){var s,a=arguments.length,v=a<3?p:l===null?l=Object.getOwnPropertyDescriptor(p,u):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(w,p,u,l);else for(var C=w.length-1;C>=0;C--)(s=w[C])&&(v=(a<3?s(v):a>3?s(p,u,v):s(p,u))||v);return a>3&&v&&Object.defineProperty(p,u,v),v},m=this&&this.__param||function(w,p){return function(u,l){p(u,l,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=c(4725),_=c(9806);let S=o.MouseService=class{constructor(w,p){this._renderService=w,this._charSizeService=p}getCoords(w,p,u,l,s){return(0,_.getCoords)(window,w,p,u,l,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(w,p){const u=(0,_.getCoordsRelativeToElement)(window,w,p);if(this._charSizeService.hasValidSize)return u[0]=Math.min(Math.max(u[0],0),this._renderService.dimensions.css.canvas.width-1),u[1]=Math.min(Math.max(u[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(u[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(u[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(u[0]),y:Math.floor(u[1])}}};o.MouseService=S=f([m(0,d.IRenderService),m(1,d.ICharSizeService)],S)},3230:function(g,o,c){var f=this&&this.__decorate||function(s,a,v,C){var x,E=arguments.length,y=E<3?a:C===null?C=Object.getOwnPropertyDescriptor(a,v):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,a,v,C);else for(var b=s.length-1;b>=0;b--)(x=s[b])&&(y=(E<3?x(y):E>3?x(a,v,y):x(a,v))||y);return E>3&&y&&Object.defineProperty(a,v,y),y},m=this&&this.__param||function(s,a){return function(v,C){a(v,C,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=c(6193),_=c(4725),S=c(8460),w=c(844),p=c(7226),u=c(2585);let l=o.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(s,a,v,C,x,E,y,b){super(),this._rowCount=s,this._charSizeService=C,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new p.DebouncedIdleTask,this._observerDisposable=this.register(new w.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 S.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new S.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new S.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new S.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer((R,A)=>this._renderRows(R,A),y),this.register(this._renderDebouncer),this.register(y.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(E.onResize(()=>this._fullRefresh())),this.register(E.buffers.onBufferActivate(()=>{var R;return(R=this._renderer.value)==null?void 0:R.clear()})),this.register(v.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(x.onDecorationRegistered(()=>this._fullRefresh())),this.register(x.onDecorationRemoved(()=>this._fullRefresh())),this.register(v.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(E.cols,E.rows),this._fullRefresh()})),this.register(v.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(E.buffer.y,E.buffer.y,!0))),this.register(b.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(y.window,a),this.register(y.onWindowChange(R=>this._registerIntersectionObserver(R,a)))}_registerIntersectionObserver(s,a){if("IntersectionObserver"in s){const v=new s.IntersectionObserver(C=>this._handleIntersectionChange(C[C.length-1]),{threshold:0});v.observe(a),this._observerDisposable.value=(0,w.toDisposable)(()=>v.disconnect())}}_handleIntersectionChange(s){this._isPaused=s.isIntersecting===void 0?s.intersectionRatio===0:!s.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(s,a,v=!1){this._isPaused?this._needsFullRefresh=!0:(v||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(s,a,this._rowCount))}_renderRows(s,a){this._renderer.value&&(s=Math.min(s,this._rowCount-1),a=Math.min(a,this._rowCount-1),this._renderer.value.renderRows(s,a),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:s,end:a}),this._onRender.fire({start:s,end:a}),this._isNextRenderRedrawOnly=!0)}resize(s,a){this._rowCount=a,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(s){this._renderer.value=s,this._renderer.value&&(this._renderer.value.onRequestRedraw(a=>this.refreshRows(a.start,a.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(s){return this._renderDebouncer.addRefreshCallback(s)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var s,a;this._renderer.value&&((a=(s=this._renderer.value).clearTextureAtlas)==null||a.call(s),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(s,a){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var v;return(v=this._renderer.value)==null?void 0:v.handleResize(s,a)}):this._renderer.value.handleResize(s,a),this._fullRefresh())}handleCharSizeChanged(){var s;(s=this._renderer.value)==null||s.handleCharSizeChanged()}handleBlur(){var s;(s=this._renderer.value)==null||s.handleBlur()}handleFocus(){var s;(s=this._renderer.value)==null||s.handleFocus()}handleSelectionChanged(s,a,v){var C;this._selectionState.start=s,this._selectionState.end=a,this._selectionState.columnSelectMode=v,(C=this._renderer.value)==null||C.handleSelectionChanged(s,a,v)}handleCursorMove(){var s;(s=this._renderer.value)==null||s.handleCursorMove()}clear(){var s;(s=this._renderer.value)==null||s.clear()}};o.RenderService=l=f([m(2,u.IOptionsService),m(3,_.ICharSizeService),m(4,u.IDecorationService),m(5,u.IBufferService),m(6,_.ICoreBrowserService),m(7,_.IThemeService)],l)},9312:function(g,o,c){var f=this&&this.__decorate||function(y,b,R,A){var O,P=arguments.length,j=P<3?b:A===null?A=Object.getOwnPropertyDescriptor(b,R):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(y,b,R,A);else for(var z=y.length-1;z>=0;z--)(O=y[z])&&(j=(P<3?O(j):P>3?O(b,R,j):O(b,R))||j);return P>3&&j&&Object.defineProperty(b,R,j),j},m=this&&this.__param||function(y,b){return function(R,A){b(R,A,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=c(9806),_=c(9504),S=c(456),w=c(4725),p=c(8460),u=c(844),l=c(6114),s=c(4841),a=c(511),v=c(2585),C=" ",x=new RegExp(C,"g");let E=o.SelectionService=class extends u.Disposable{constructor(y,b,R,A,O,P,j,z,K){super(),this._element=y,this._screenElement=b,this._linkifier=R,this._bufferService=A,this._coreService=O,this._mouseService=P,this._optionsService=j,this._renderService=z,this._coreBrowserService=K,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new a.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new p.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new p.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new p.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new p.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=H=>this._handleMouseMove(H),this._mouseUpListener=H=>this._handleMouseUp(H),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(H=>this._handleTrim(H)),this.register(this._bufferService.buffers.onBufferActivate(H=>this._handleBufferActivate(H))),this.enable(),this._model=new S.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.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,b=this._model.finalSelectionEnd;return!(!y||!b||y[0]===b[0]&&y[1]===b[1])}get selectionText(){const y=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;if(!y||!b)return"";const R=this._bufferService.buffer,A=[];if(this._activeSelectionMode===3){if(y[0]===b[0])return"";const O=y[0]<b[0]?y[0]:b[0],P=y[0]<b[0]?b[0]:y[0];for(let j=y[1];j<=b[1];j++){const z=R.translateBufferLineToString(j,!0,O,P);A.push(z)}}else{const O=y[1]===b[1]?b[0]:void 0;A.push(R.translateBufferLineToString(y[1],!0,y[0],O));for(let P=y[1]+1;P<=b[1]-1;P++){const j=R.lines.get(P),z=R.translateBufferLineToString(P,!0);j!=null&&j.isWrapped?A[A.length-1]+=z:A.push(z)}if(y[1]!==b[1]){const P=R.lines.get(b[1]),j=R.translateBufferLineToString(b[1],!0,0,b[0]);P&&P.isWrapped?A[A.length-1]+=j:A.push(j)}}return A.map(O=>O.replace(x," ")).join(l.isWindows?`\r
|
|
61
|
+
`:`
|
|
62
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(y){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),l.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 b=this._getMouseBufferCoords(y),R=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!!(R&&A&&b)&&this._areCoordsInSelection(b,R,A)}isCellInSelection(y,b){const R=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!(!R||!A)&&this._areCoordsInSelection([y,b],R,A)}_areCoordsInSelection(y,b,R){return y[1]>b[1]&&y[1]<R[1]||b[1]===R[1]&&y[1]===b[1]&&y[0]>=b[0]&&y[0]<R[0]||b[1]<R[1]&&y[1]===R[1]&&y[0]<R[0]||b[1]<R[1]&&y[1]===b[1]&&y[0]>=b[0]}_selectWordAtCursor(y,b){var O,P;const R=(P=(O=this._linkifier.currentLink)==null?void 0:O.link)==null?void 0:P.range;if(R)return this._model.selectionStart=[R.start.x-1,R.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(R,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const A=this._getMouseBufferCoords(y);return!!A&&(this._selectWordAt(A,b),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(y,b){this._model.clearSelection(),y=Math.max(y,0),b=Math.min(b,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,y],this._model.selectionEnd=[this._bufferService.cols,b],this.refresh(),this._onSelectionChange.fire()}_handleTrim(y){this._model.handleTrim(y)&&this.refresh()}_getMouseBufferCoords(y){const b=this._mouseService.getCoords(y,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(b)return b[0]--,b[1]--,b[1]+=this._bufferService.buffer.ydisp,b}_getMouseEventScrollAmount(y){let b=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,y,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return b>=0&&b<=R?0:(b>R&&(b-=R),b=Math.min(Math.max(b,-50),50),b/=50,b/Math.abs(b)+Math.round(14*b))}shouldForceSelection(y){return l.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 b=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);b&&b.length!==this._model.selectionStart[0]&&b.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(y){this._selectWordAtCursor(y,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(y){const b=this._getMouseBufferCoords(y);b&&(this._activeSelectionMode=2,this._selectLineAt(b[1]))}shouldColumnSelect(y){return y.altKey&&!(l.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(y){if(y.stopImmediatePropagation(),!this._model.selectionStart)return;const b=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 R=this._bufferService.buffer;if(this._model.selectionEnd[1]<R.lines.length){const A=R.lines.get(this._model.selectionEnd[1]);A&&A.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}b&&b[0]===this._model.selectionEnd[0]&&b[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 b=y.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&b<500&&y.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const R=this._mouseService.getCoords(y,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){const A=(0,_.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(A,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const y=this._model.finalSelectionStart,b=this._model.finalSelectionEnd,R=!(!y||!b||y[0]===b[0]&&y[1]===b[1]);R?y&&b&&(this._oldSelectionStart&&this._oldSelectionEnd&&y[0]===this._oldSelectionStart[0]&&y[1]===this._oldSelectionStart[1]&&b[0]===this._oldSelectionEnd[0]&&b[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(y,b,R)):this._oldHasSelection&&this._fireOnSelectionChange(y,b,R)}_fireOnSelectionChange(y,b,R){this._oldSelectionStart=y,this._oldSelectionEnd=b,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(y){this.clearSelection(),this._trimListener.dispose(),this._trimListener=y.activeBuffer.lines.onTrim(b=>this._handleTrim(b))}_convertViewportColToCharacterIndex(y,b){let R=b;for(let A=0;b>=A;A++){const O=y.loadCell(A,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:O>1&&b!==A&&(R+=O-1)}return R}setSelection(y,b,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[y,b],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(y){this._isClickInSelection(y)||(this._selectWordAtCursor(y,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(y,b,R=!0,A=!0){if(y[0]>=this._bufferService.cols)return;const O=this._bufferService.buffer,P=O.lines.get(y[1]);if(!P)return;const j=O.translateBufferLineToString(y[1],!1);let z=this._convertViewportColToCharacterIndex(P,y[0]),K=z;const H=y[0]-z;let N=0,k=0,D=0,T=0;if(j.charAt(z)===" "){for(;z>0&&j.charAt(z-1)===" ";)z--;for(;K<j.length&&j.charAt(K+1)===" ";)K++}else{let V=y[0],Q=y[0];P.getWidth(V)===0&&(N++,V--),P.getWidth(Q)===2&&(k++,Q++);const Y=P.getString(Q).length;for(Y>1&&(T+=Y-1,K+=Y-1);V>0&&z>0&&!this._isCharWordSeparator(P.loadCell(V-1,this._workCell));){P.loadCell(V-1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===0?(N++,V--):I>1&&(D+=I-1,z-=I-1),z--,V--}for(;Q<P.length&&K+1<j.length&&!this._isCharWordSeparator(P.loadCell(Q+1,this._workCell));){P.loadCell(Q+1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===2?(k++,Q++):I>1&&(T+=I-1,K+=I-1),K++,Q++}}K++;let M=z+H-N+D,W=Math.min(this._bufferService.cols,K-z+N+k-D-T);if(b||j.slice(z,K).trim()!==""){if(R&&M===0&&P.getCodePoint(0)!==32){const V=O.lines.get(y[1]-1);if(V&&P.isWrapped&&V.getCodePoint(this._bufferService.cols-1)!==32){const Q=this._getWordAt([this._bufferService.cols-1,y[1]-1],!1,!0,!1);if(Q){const Y=this._bufferService.cols-Q.start;M-=Y,W+=Y}}}if(A&&M+W===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const V=O.lines.get(y[1]+1);if(V!=null&&V.isWrapped&&V.getCodePoint(0)!==32){const Q=this._getWordAt([0,y[1]+1],!1,!1,!0);Q&&(W+=Q.length)}}return{start:M,length:W}}}_selectWordAt(y,b){const R=this._getWordAt(y,b);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,y[1]--;this._model.selectionStart=[R.start,y[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(y){const b=this._getWordAt(y,!0);if(b){let R=y[1];for(;b.start<0;)b.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;b.start+b.length>this._bufferService.cols;)b.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?b.start:b.start+b.length,R]}}_isCharWordSeparator(y){return y.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(y.getChars())>=0}_selectLineAt(y){const b=this._bufferService.buffer.getWrappedRangeForLine(y),R={start:{x:0,y:b.first},end:{x:this._bufferService.cols-1,y:b.last}};this._model.selectionStart=[0,b.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(R,this._bufferService.cols)}};o.SelectionService=E=f([m(3,v.IBufferService),m(4,v.ICoreService),m(5,w.IMouseService),m(6,v.IOptionsService),m(7,w.IRenderService),m(8,w.ICoreBrowserService)],E)},4725:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const f=c(8343);o.ICharSizeService=(0,f.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),o.IMouseService=(0,f.createDecorator)("MouseService"),o.IRenderService=(0,f.createDecorator)("RenderService"),o.ISelectionService=(0,f.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,f.createDecorator)("ThemeService"),o.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(g,o,c){var f=this&&this.__decorate||function(E,y,b,R){var A,O=arguments.length,P=O<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,b):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(E,y,b,R);else for(var j=E.length-1;j>=0;j--)(A=E[j])&&(P=(O<3?A(P):O>3?A(y,b,P):A(y,b))||P);return O>3&&P&&Object.defineProperty(y,b,P),P},m=this&&this.__param||function(E,y){return function(b,R){y(b,R,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),_=c(8055),S=c(8460),w=c(844),p=c(2585),u=_.css.toColor("#ffffff"),l=_.css.toColor("#000000"),s=_.css.toColor("#ffffff"),a=_.css.toColor("#000000"),v={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const E=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],y=[0,95,135,175,215,255];for(let b=0;b<216;b++){const R=y[b/36%6|0],A=y[b/6%6|0],O=y[b%6];E.push({css:_.channels.toCss(R,A,O),rgba:_.channels.toRgba(R,A,O)})}for(let b=0;b<24;b++){const R=8+10*b;E.push({css:_.channels.toCss(R,R,R),rgba:_.channels.toRgba(R,R,R)})}return E})());let C=o.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(E){super(),this._optionsService=E,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:l,cursor:s,cursorAccent:a,selectionForeground:void 0,selectionBackgroundTransparent:v,selectionBackgroundOpaque:_.color.blend(l,v),selectionInactiveBackgroundTransparent:v,selectionInactiveBackgroundOpaque:_.color.blend(l,v),ansi:o.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(E={}){const y=this._colors;if(y.foreground=x(E.foreground,u),y.background=x(E.background,l),y.cursor=x(E.cursor,s),y.cursorAccent=x(E.cursorAccent,a),y.selectionBackgroundTransparent=x(E.selectionBackground,v),y.selectionBackgroundOpaque=_.color.blend(y.background,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundTransparent=x(E.selectionInactiveBackground,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundOpaque=_.color.blend(y.background,y.selectionInactiveBackgroundTransparent),y.selectionForeground=E.selectionForeground?x(E.selectionForeground,_.NULL_COLOR):void 0,y.selectionForeground===_.NULL_COLOR&&(y.selectionForeground=void 0),_.color.isOpaque(y.selectionBackgroundTransparent)&&(y.selectionBackgroundTransparent=_.color.opacity(y.selectionBackgroundTransparent,.3)),_.color.isOpaque(y.selectionInactiveBackgroundTransparent)&&(y.selectionInactiveBackgroundTransparent=_.color.opacity(y.selectionInactiveBackgroundTransparent,.3)),y.ansi=o.DEFAULT_ANSI_COLORS.slice(),y.ansi[0]=x(E.black,o.DEFAULT_ANSI_COLORS[0]),y.ansi[1]=x(E.red,o.DEFAULT_ANSI_COLORS[1]),y.ansi[2]=x(E.green,o.DEFAULT_ANSI_COLORS[2]),y.ansi[3]=x(E.yellow,o.DEFAULT_ANSI_COLORS[3]),y.ansi[4]=x(E.blue,o.DEFAULT_ANSI_COLORS[4]),y.ansi[5]=x(E.magenta,o.DEFAULT_ANSI_COLORS[5]),y.ansi[6]=x(E.cyan,o.DEFAULT_ANSI_COLORS[6]),y.ansi[7]=x(E.white,o.DEFAULT_ANSI_COLORS[7]),y.ansi[8]=x(E.brightBlack,o.DEFAULT_ANSI_COLORS[8]),y.ansi[9]=x(E.brightRed,o.DEFAULT_ANSI_COLORS[9]),y.ansi[10]=x(E.brightGreen,o.DEFAULT_ANSI_COLORS[10]),y.ansi[11]=x(E.brightYellow,o.DEFAULT_ANSI_COLORS[11]),y.ansi[12]=x(E.brightBlue,o.DEFAULT_ANSI_COLORS[12]),y.ansi[13]=x(E.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),y.ansi[14]=x(E.brightCyan,o.DEFAULT_ANSI_COLORS[14]),y.ansi[15]=x(E.brightWhite,o.DEFAULT_ANSI_COLORS[15]),E.extendedAnsi){const b=Math.min(y.ansi.length-16,E.extendedAnsi.length);for(let R=0;R<b;R++)y.ansi[R+16]=x(E.extendedAnsi[R],o.DEFAULT_ANSI_COLORS[R+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(E){this._restoreColor(E),this._onChangeColors.fire(this.colors)}_restoreColor(E){if(E!==void 0)switch(E){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[E]=this._restoreColors.ansi[E]}else for(let y=0;y<this._restoreColors.ansi.length;++y)this._colors.ansi[y]=this._restoreColors.ansi[y]}modifyColors(E){E(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 x(E,y){if(E!==void 0)try{return _.css.toColor(E)}catch{}return y}o.ThemeService=C=f([m(0,p.IOptionsService)],C)},6349:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const f=c(8460),m=c(844);class d extends m.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.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(S){if(this._maxLength===S)return;const w=new Array(S);for(let p=0;p<Math.min(S,this.length);p++)w[p]=this._array[this._getCyclicIndex(p)];this._array=w,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let w=this._length;w<S;w++)this._array[w]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,w){this._array[this._getCyclicIndex(S)]=w}push(S){this._array[this._getCyclicIndex(this._length)]=S,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(S,w,...p){if(w){for(let u=S;u<this._length-w;u++)this._array[this._getCyclicIndex(u)]=this._array[this._getCyclicIndex(u+w)];this._length-=w,this.onDeleteEmitter.fire({index:S,amount:w})}for(let u=this._length-1;u>=S;u--)this._array[this._getCyclicIndex(u+p.length)]=this._array[this._getCyclicIndex(u)];for(let u=0;u<p.length;u++)this._array[this._getCyclicIndex(S+u)]=p[u];if(p.length&&this.onInsertEmitter.fire({index:S,amount:p.length}),this._length+p.length>this._maxLength){const u=this._length+p.length-this._maxLength;this._startIndex+=u,this._length=this._maxLength,this.onTrimEmitter.fire(u)}else this._length+=p.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,w,p){if(!(w<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+p<0)throw new Error("Cannot shift elements in list beyond index 0");if(p>0){for(let l=w-1;l>=0;l--)this.set(S+l+p,this.get(S+l));const u=S+w+p-this._length;if(u>0)for(this._length+=u;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let u=0;u<w;u++)this.set(S+u+p,this.get(S+u))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}o.CircularList=d},1439:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(f,m=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const _ in f)d[_]=m<=1?f[_]:f[_]&&c(f[_],m-1);return d}},8055:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,f=0,m=0,d=0;var _,S,w,p,u;function l(a){const v=a.toString(16);return v.length<2?"0"+v:v}function s(a,v){return a<v?(v+.05)/(a+.05):(a+.05)/(v+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},function(a){a.toCss=function(v,C,x,E){return E!==void 0?`#${l(v)}${l(C)}${l(x)}${l(E)}`:`#${l(v)}${l(C)}${l(x)}`},a.toRgba=function(v,C,x,E=255){return(v<<24|C<<16|x<<8|E)>>>0},a.toColor=function(v,C,x,E){return{css:a.toCss(v,C,x,E),rgba:a.toRgba(v,C,x,E)}}}(_||(o.channels=_={})),function(a){function v(C,x){return d=Math.round(255*x),[c,f,m]=u.toChannels(C.rgba),{css:_.toCss(c,f,m,d),rgba:_.toRgba(c,f,m,d)}}a.blend=function(C,x){if(d=(255&x.rgba)/255,d===1)return{css:x.css,rgba:x.rgba};const E=x.rgba>>24&255,y=x.rgba>>16&255,b=x.rgba>>8&255,R=C.rgba>>24&255,A=C.rgba>>16&255,O=C.rgba>>8&255;return c=R+Math.round((E-R)*d),f=A+Math.round((y-A)*d),m=O+Math.round((b-O)*d),{css:_.toCss(c,f,m),rgba:_.toRgba(c,f,m)}},a.isOpaque=function(C){return(255&C.rgba)==255},a.ensureContrastRatio=function(C,x,E){const y=u.ensureContrastRatio(C.rgba,x.rgba,E);if(y)return _.toColor(y>>24&255,y>>16&255,y>>8&255)},a.opaque=function(C){const x=(255|C.rgba)>>>0;return[c,f,m]=u.toChannels(x),{css:_.toCss(c,f,m),rgba:x}},a.opacity=v,a.multiplyOpacity=function(C,x){return d=255&C.rgba,v(C,d*x/255)},a.toColorRGB=function(C){return[C.rgba>>24&255,C.rgba>>16&255,C.rgba>>8&255]}}(S||(o.color=S={})),function(a){let v,C;try{const x=document.createElement("canvas");x.width=1,x.height=1;const E=x.getContext("2d",{willReadFrequently:!0});E&&(v=E,v.globalCompositeOperation="copy",C=v.createLinearGradient(0,0,1,1))}catch{}a.toColor=function(x){if(x.match(/#[\da-f]{3,8}/i))switch(x.length){case 4:return c=parseInt(x.slice(1,2).repeat(2),16),f=parseInt(x.slice(2,3).repeat(2),16),m=parseInt(x.slice(3,4).repeat(2),16),_.toColor(c,f,m);case 5:return c=parseInt(x.slice(1,2).repeat(2),16),f=parseInt(x.slice(2,3).repeat(2),16),m=parseInt(x.slice(3,4).repeat(2),16),d=parseInt(x.slice(4,5).repeat(2),16),_.toColor(c,f,m,d);case 7:return{css:x,rgba:(parseInt(x.slice(1),16)<<8|255)>>>0};case 9:return{css:x,rgba:parseInt(x.slice(1),16)>>>0}}const E=x.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return c=parseInt(E[1]),f=parseInt(E[2]),m=parseInt(E[3]),d=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),_.toColor(c,f,m,d);if(!v||!C)throw new Error("css.toColor: Unsupported css format");if(v.fillStyle=C,v.fillStyle=x,typeof v.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(v.fillRect(0,0,1,1),[c,f,m,d]=v.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,f,m,d),css:x}}}(w||(o.css=w={})),function(a){function v(C,x,E){const y=C/255,b=x/255,R=E/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}a.relativeLuminance=function(C){return v(C>>16&255,C>>8&255,255&C)},a.relativeLuminance2=v}(p||(o.rgb=p={})),function(a){function v(x,E,y){const b=x>>24&255,R=x>>16&255,A=x>>8&255;let O=E>>24&255,P=E>>16&255,j=E>>8&255,z=s(p.relativeLuminance2(O,P,j),p.relativeLuminance2(b,R,A));for(;z<y&&(O>0||P>0||j>0);)O-=Math.max(0,Math.ceil(.1*O)),P-=Math.max(0,Math.ceil(.1*P)),j-=Math.max(0,Math.ceil(.1*j)),z=s(p.relativeLuminance2(O,P,j),p.relativeLuminance2(b,R,A));return(O<<24|P<<16|j<<8|255)>>>0}function C(x,E,y){const b=x>>24&255,R=x>>16&255,A=x>>8&255;let O=E>>24&255,P=E>>16&255,j=E>>8&255,z=s(p.relativeLuminance2(O,P,j),p.relativeLuminance2(b,R,A));for(;z<y&&(O<255||P<255||j<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),P=Math.min(255,P+Math.ceil(.1*(255-P))),j=Math.min(255,j+Math.ceil(.1*(255-j))),z=s(p.relativeLuminance2(O,P,j),p.relativeLuminance2(b,R,A));return(O<<24|P<<16|j<<8|255)>>>0}a.blend=function(x,E){if(d=(255&E)/255,d===1)return E;const y=E>>24&255,b=E>>16&255,R=E>>8&255,A=x>>24&255,O=x>>16&255,P=x>>8&255;return c=A+Math.round((y-A)*d),f=O+Math.round((b-O)*d),m=P+Math.round((R-P)*d),_.toRgba(c,f,m)},a.ensureContrastRatio=function(x,E,y){const b=p.relativeLuminance(x>>8),R=p.relativeLuminance(E>>8);if(s(b,R)<y){if(R<b){const P=v(x,E,y),j=s(b,p.relativeLuminance(P>>8));if(j<y){const z=C(x,E,y);return j>s(b,p.relativeLuminance(z>>8))?P:z}return P}const A=C(x,E,y),O=s(b,p.relativeLuminance(A>>8));if(O<y){const P=v(x,E,y);return O>s(b,p.relativeLuminance(P>>8))?A:P}return A}},a.reduceLuminance=v,a.increaseLuminance=C,a.toChannels=function(x){return[x>>24&255,x>>16&255,x>>8&255,255&x]}}(u||(o.rgba=u={})),o.toPaddedHex=l,o.contrastRatio=s},8969:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const f=c(844),m=c(2585),d=c(4348),_=c(7866),S=c(744),w=c(7302),p=c(6975),u=c(8460),l=c(1753),s=c(1480),a=c(7994),v=c(9282),C=c(5435),x=c(5981),E=c(2660);let y=!1;class b extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event(A=>{var O;(O=this._onScrollApi)==null||O.fire(A.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(A){for(const O in A)this.optionsService.options[O]=A[O]}constructor(A){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new w.OptionsService(A)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(p.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(l.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(a.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new C.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.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(O=>{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(O=>{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 x.WriteBuffer((O,P)=>this._inputHandler.parse(O,P))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(A,O){this._writeBuffer.write(A,O)}writeSync(A,O){this._logService.logLevel<=m.LogLevelEnum.WARN&&!y&&(this._logService.warn("writeSync is unreliable and will be removed soon."),y=!0),this._writeBuffer.writeSync(A,O)}input(A,O=!0){this.coreService.triggerDataEvent(A,O)}resize(A,O){isNaN(A)||isNaN(O)||(A=Math.max(A,S.MINIMUM_COLS),O=Math.max(O,S.MINIMUM_ROWS),this._bufferService.resize(A,O))}scroll(A,O=!1){this._bufferService.scroll(A,O)}scrollLines(A,O,P){this._bufferService.scrollLines(A,O,P)}scrollPages(A){this.scrollLines(A*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(A){const O=A-this._bufferService.buffer.ydisp;O!==0&&this.scrollLines(O)}registerEscHandler(A,O){return this._inputHandler.registerEscHandler(A,O)}registerDcsHandler(A,O){return this._inputHandler.registerDcsHandler(A,O)}registerCsiHandler(A,O){return this._inputHandler.registerCsiHandler(A,O)}registerOscHandler(A,O){return this._inputHandler.registerOscHandler(A,O)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let A=!1;const O=this.optionsService.rawOptions.windowsPty;O&&O.buildNumber!==void 0&&O.buildNumber!==void 0?A=O.backend==="conpty"&&O.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(A=!0),A?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const A=[];A.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),A.push(this.registerCsiHandler({final:"H"},()=>((0,v.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)(()=>{for(const O of A)O.dispose()})}}}o.CoreTerminal=b},8460:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===c)return void this._listeners.splice(f,1)}}})),this._event}fire(c,f){const m=[];for(let d=0;d<this._listeners.length;d++)m.push(this._listeners[d]);for(let d=0;d<m.length;d++)m[d].call(void 0,c,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,f){return c(m=>f.fire(m))},o.runAndSubscribe=function(c,f){return f(void 0),c(m=>f(m))}},5435:function(g,o,c){var f=this&&this.__decorate||function(N,k,D,T){var M,W=arguments.length,V=W<3?k:T===null?T=Object.getOwnPropertyDescriptor(k,D):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(N,k,D,T);else for(var Q=N.length-1;Q>=0;Q--)(M=N[Q])&&(V=(W<3?M(V):W>3?M(k,D,V):M(k,D))||V);return W>3&&V&&Object.defineProperty(k,D,V),V},m=this&&this.__param||function(N,k){return function(D,T){k(D,T,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=c(2584),_=c(7116),S=c(2015),w=c(844),p=c(482),u=c(8437),l=c(8460),s=c(643),a=c(511),v=c(3734),C=c(2585),x=c(1480),E=c(6242),y=c(6351),b=c(5941),R={"(":0,")":1,"*":2,"+":3,"-":1,".":2},A=131072;function O(N,k){if(N>24)return k.setWinLines||!1;switch(N){case 1:return!!k.restoreWin;case 2:return!!k.minimizeWin;case 3:return!!k.setWinPosition;case 4:return!!k.setWinSizePixels;case 5:return!!k.raiseWin;case 6:return!!k.lowerWin;case 7:return!!k.refreshWin;case 8:return!!k.setWinSizeChars;case 9:return!!k.maximizeWin;case 10:return!!k.fullscreenWin;case 11:return!!k.getWinState;case 13:return!!k.getWinPosition;case 14:return!!k.getWinSizePixels;case 15:return!!k.getScreenSizePixels;case 16:return!!k.getCellSizePixels;case 18:return!!k.getWinSizeChars;case 19:return!!k.getScreenSizeChars;case 20:return!!k.getIconTitle;case 21:return!!k.getWinTitle;case 22:return!!k.pushTitle;case 23:return!!k.popTitle;case 24:return!!k.setWinLines}return!1}var P;(function(N){N[N.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",N[N.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(o.WindowsOptionsReportType=P={}));let j=0;class z extends w.Disposable{getAttrData(){return this._curAttrData}constructor(k,D,T,M,W,V,Q,Y,I=new S.EscapeSequenceParser){super(),this._bufferService=k,this._charsetService=D,this._coreService=T,this._logService=M,this._optionsService=W,this._oscLinkService=V,this._coreMouseService=Q,this._unicodeService=Y,this._parser=I,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new p.StringToUtf32,this._utf8Decoder=new p.Utf8ToUtf32,this._workCell=new a.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new l.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new l.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new l.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new l.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new l.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new l.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new l.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new l.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new l.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new l.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new l.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 K(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(L=>this._activeBuffer=L.activeBuffer)),this._parser.setCsiHandlerFallback((L,U)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(L),params:U.toArray()})}),this._parser.setEscHandlerFallback(L=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(L)})}),this._parser.setExecuteHandlerFallback(L=>{this._logService.debug("Unknown EXECUTE code: ",{code:L})}),this._parser.setOscHandlerFallback((L,U,F)=>{this._logService.debug("Unknown OSC code: ",{identifier:L,action:U,data:F})}),this._parser.setDcsHandlerFallback((L,U,F)=>{U==="HOOK"&&(F=F.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(L),action:U,payload:F})}),this._parser.setPrintHandler((L,U,F)=>this.print(L,U,F)),this._parser.registerCsiHandler({final:"@"},L=>this.insertChars(L)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},L=>this.scrollLeft(L)),this._parser.registerCsiHandler({final:"A"},L=>this.cursorUp(L)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},L=>this.scrollRight(L)),this._parser.registerCsiHandler({final:"B"},L=>this.cursorDown(L)),this._parser.registerCsiHandler({final:"C"},L=>this.cursorForward(L)),this._parser.registerCsiHandler({final:"D"},L=>this.cursorBackward(L)),this._parser.registerCsiHandler({final:"E"},L=>this.cursorNextLine(L)),this._parser.registerCsiHandler({final:"F"},L=>this.cursorPrecedingLine(L)),this._parser.registerCsiHandler({final:"G"},L=>this.cursorCharAbsolute(L)),this._parser.registerCsiHandler({final:"H"},L=>this.cursorPosition(L)),this._parser.registerCsiHandler({final:"I"},L=>this.cursorForwardTab(L)),this._parser.registerCsiHandler({final:"J"},L=>this.eraseInDisplay(L,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},L=>this.eraseInDisplay(L,!0)),this._parser.registerCsiHandler({final:"K"},L=>this.eraseInLine(L,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},L=>this.eraseInLine(L,!0)),this._parser.registerCsiHandler({final:"L"},L=>this.insertLines(L)),this._parser.registerCsiHandler({final:"M"},L=>this.deleteLines(L)),this._parser.registerCsiHandler({final:"P"},L=>this.deleteChars(L)),this._parser.registerCsiHandler({final:"S"},L=>this.scrollUp(L)),this._parser.registerCsiHandler({final:"T"},L=>this.scrollDown(L)),this._parser.registerCsiHandler({final:"X"},L=>this.eraseChars(L)),this._parser.registerCsiHandler({final:"Z"},L=>this.cursorBackwardTab(L)),this._parser.registerCsiHandler({final:"`"},L=>this.charPosAbsolute(L)),this._parser.registerCsiHandler({final:"a"},L=>this.hPositionRelative(L)),this._parser.registerCsiHandler({final:"b"},L=>this.repeatPrecedingCharacter(L)),this._parser.registerCsiHandler({final:"c"},L=>this.sendDeviceAttributesPrimary(L)),this._parser.registerCsiHandler({prefix:">",final:"c"},L=>this.sendDeviceAttributesSecondary(L)),this._parser.registerCsiHandler({final:"d"},L=>this.linePosAbsolute(L)),this._parser.registerCsiHandler({final:"e"},L=>this.vPositionRelative(L)),this._parser.registerCsiHandler({final:"f"},L=>this.hVPosition(L)),this._parser.registerCsiHandler({final:"g"},L=>this.tabClear(L)),this._parser.registerCsiHandler({final:"h"},L=>this.setMode(L)),this._parser.registerCsiHandler({prefix:"?",final:"h"},L=>this.setModePrivate(L)),this._parser.registerCsiHandler({final:"l"},L=>this.resetMode(L)),this._parser.registerCsiHandler({prefix:"?",final:"l"},L=>this.resetModePrivate(L)),this._parser.registerCsiHandler({final:"m"},L=>this.charAttributes(L)),this._parser.registerCsiHandler({final:"n"},L=>this.deviceStatus(L)),this._parser.registerCsiHandler({prefix:"?",final:"n"},L=>this.deviceStatusPrivate(L)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},L=>this.softReset(L)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},L=>this.setCursorStyle(L)),this._parser.registerCsiHandler({final:"r"},L=>this.setScrollRegion(L)),this._parser.registerCsiHandler({final:"s"},L=>this.saveCursor(L)),this._parser.registerCsiHandler({final:"t"},L=>this.windowOptions(L)),this._parser.registerCsiHandler({final:"u"},L=>this.restoreCursor(L)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},L=>this.insertColumns(L)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},L=>this.deleteColumns(L)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},L=>this.selectProtected(L)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},L=>this.requestMode(L,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},L=>this.requestMode(L,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new E.OscHandler(L=>(this.setTitle(L),this.setIconName(L),!0))),this._parser.registerOscHandler(1,new E.OscHandler(L=>this.setIconName(L))),this._parser.registerOscHandler(2,new E.OscHandler(L=>this.setTitle(L))),this._parser.registerOscHandler(4,new E.OscHandler(L=>this.setOrReportIndexedColor(L))),this._parser.registerOscHandler(8,new E.OscHandler(L=>this.setHyperlink(L))),this._parser.registerOscHandler(10,new E.OscHandler(L=>this.setOrReportFgColor(L))),this._parser.registerOscHandler(11,new E.OscHandler(L=>this.setOrReportBgColor(L))),this._parser.registerOscHandler(12,new E.OscHandler(L=>this.setOrReportCursorColor(L))),this._parser.registerOscHandler(104,new E.OscHandler(L=>this.restoreIndexedColor(L))),this._parser.registerOscHandler(110,new E.OscHandler(L=>this.restoreFgColor(L))),this._parser.registerOscHandler(111,new E.OscHandler(L=>this.restoreBgColor(L))),this._parser.registerOscHandler(112,new E.OscHandler(L=>this.restoreCursorColor(L))),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 L in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:L},()=>this.selectCharset("("+L)),this._parser.registerEscHandler({intermediates:")",final:L},()=>this.selectCharset(")"+L)),this._parser.registerEscHandler({intermediates:"*",final:L},()=>this.selectCharset("*"+L)),this._parser.registerEscHandler({intermediates:"+",final:L},()=>this.selectCharset("+"+L)),this._parser.registerEscHandler({intermediates:"-",final:L},()=>this.selectCharset("-"+L)),this._parser.registerEscHandler({intermediates:".",final:L},()=>this.selectCharset("."+L)),this._parser.registerEscHandler({intermediates:"/",final:L},()=>this.selectCharset("/"+L));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(L=>(this._logService.error("Parsing error: ",L),L)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new y.DcsHandler((L,U)=>this.requestStatusString(L,U)))}_preserveStack(k,D,T,M){this._parseStack.paused=!0,this._parseStack.cursorStartX=k,this._parseStack.cursorStartY=D,this._parseStack.decodedLength=T,this._parseStack.position=M}_logSlowResolvingAsync(k){this._logService.logLevel<=C.LogLevelEnum.WARN&&Promise.race([k,new Promise((D,T)=>setTimeout(()=>T("#SLOW_TIMEOUT"),5e3))]).catch(D=>{if(D!=="#SLOW_TIMEOUT")throw D;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(k,D){let T,M=this._activeBuffer.x,W=this._activeBuffer.y,V=0;const Q=this._parseStack.paused;if(Q){if(T=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,D))return this._logSlowResolvingAsync(T),T;M=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,k.length>A&&(V=this._parseStack.position+A)}if(this._logService.logLevel<=C.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof k=="string"?` "${k}"`:` "${Array.prototype.map.call(k,L=>String.fromCharCode(L)).join("")}"`),typeof k=="string"?k.split("").map(L=>L.charCodeAt(0)):k),this._parseBuffer.length<k.length&&this._parseBuffer.length<A&&(this._parseBuffer=new Uint32Array(Math.min(k.length,A))),Q||this._dirtyRowTracker.clearRange(),k.length>A)for(let L=V;L<k.length;L+=A){const U=L+A<k.length?L+A:k.length,F=typeof k=="string"?this._stringDecoder.decode(k.substring(L,U),this._parseBuffer):this._utf8Decoder.decode(k.subarray(L,U),this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,F))return this._preserveStack(M,W,F,L),this._logSlowResolvingAsync(T),T}else if(!Q){const L=typeof k=="string"?this._stringDecoder.decode(k,this._parseBuffer):this._utf8Decoder.decode(k,this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,L))return this._preserveStack(M,W,L,0),this._logSlowResolvingAsync(T),T}this._activeBuffer.x===M&&this._activeBuffer.y===W||this._onCursorMove.fire();const Y=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),I=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);I<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(I,this._bufferService.rows-1),Math.min(Y,this._bufferService.rows-1))}print(k,D,T){let M,W;const V=this._charsetService.charset,Q=this._optionsService.rawOptions.screenReaderMode,Y=this._bufferService.cols,I=this._coreService.decPrivateModes.wraparound,L=this._coreService.modes.insertMode,U=this._curAttrData;let F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&T-D>0&&F.getWidth(this._activeBuffer.x-1)===2&&F.setCellFromCodepoint(this._activeBuffer.x-1,0,1,U);let G=this._parser.precedingJoinState;for(let q=D;q<T;++q){if(M=k[q],M<127&&V){const je=V[String.fromCharCode(M)];je&&(M=je.charCodeAt(0))}const te=this._unicodeService.charProperties(M,G);W=x.UnicodeService.extractWidth(te);const _e=x.UnicodeService.extractShouldJoin(te),pe=_e?x.UnicodeService.extractWidth(G):0;if(G=te,Q&&this._onA11yChar.fire((0,p.stringFromCodePoint)(M)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-pe>Y){if(I){const je=F;let Z=this._activeBuffer.x-pe;for(this._activeBuffer.x=pe,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),F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),pe>0&&F instanceof u.BufferLine&&F.copyCellsFrom(je,Z,0,pe,!1);Z<Y;)je.setCellFromCodepoint(Z++,0,1,U)}else if(this._activeBuffer.x=Y-1,W===2)continue}if(_e&&this._activeBuffer.x){const je=F.getWidth(this._activeBuffer.x-1)?1:2;F.addCodepointToCell(this._activeBuffer.x-je,M,W);for(let Z=W-pe;--Z>=0;)F.setCellFromCodepoint(this._activeBuffer.x++,0,0,U)}else if(L&&(F.insertCells(this._activeBuffer.x,W-pe,this._activeBuffer.getNullCell(U)),F.getWidth(Y-1)===2&&F.setCellFromCodepoint(Y-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,U)),F.setCellFromCodepoint(this._activeBuffer.x++,M,W,U),W>0)for(;--W;)F.setCellFromCodepoint(this._activeBuffer.x++,0,0,U)}this._parser.precedingJoinState=G,this._activeBuffer.x<Y&&T-D>0&&F.getWidth(this._activeBuffer.x)===0&&!F.hasContent(this._activeBuffer.x)&&F.setCellFromCodepoint(this._activeBuffer.x,0,1,U),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(k,D){return k.final!=="t"||k.prefix||k.intermediates?this._parser.registerCsiHandler(k,D):this._parser.registerCsiHandler(k,T=>!O(T.params[0],this._optionsService.rawOptions.windowOptions)||D(T))}registerDcsHandler(k,D){return this._parser.registerDcsHandler(k,new y.DcsHandler(D))}registerEscHandler(k,D){return this._parser.registerEscHandler(k,D)}registerOscHandler(k,D){return this._parser.registerOscHandler(k,new E.OscHandler(D))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var k;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&&((k=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&k.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);D.hasWidth(this._activeBuffer.x)&&!D.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const k=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-k),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(k=this._bufferService.cols-1){this._activeBuffer.x=Math.min(k,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(k,D){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=k,this._activeBuffer.y=this._activeBuffer.scrollTop+D):(this._activeBuffer.x=k,this._activeBuffer.y=D),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(k,D){this._restrictCursor(),this._setCursor(this._activeBuffer.x+k,this._activeBuffer.y+D)}cursorUp(k){const D=this._activeBuffer.y-this._activeBuffer.scrollTop;return D>=0?this._moveCursor(0,-Math.min(D,k.params[0]||1)):this._moveCursor(0,-(k.params[0]||1)),!0}cursorDown(k){const D=this._activeBuffer.scrollBottom-this._activeBuffer.y;return D>=0?this._moveCursor(0,Math.min(D,k.params[0]||1)):this._moveCursor(0,k.params[0]||1),!0}cursorForward(k){return this._moveCursor(k.params[0]||1,0),!0}cursorBackward(k){return this._moveCursor(-(k.params[0]||1),0),!0}cursorNextLine(k){return this.cursorDown(k),this._activeBuffer.x=0,!0}cursorPrecedingLine(k){return this.cursorUp(k),this._activeBuffer.x=0,!0}cursorCharAbsolute(k){return this._setCursor((k.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(k){return this._setCursor(k.length>=2?(k.params[1]||1)-1:0,(k.params[0]||1)-1),!0}charPosAbsolute(k){return this._setCursor((k.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(k){return this._moveCursor(k.params[0]||1,0),!0}linePosAbsolute(k){return this._setCursor(this._activeBuffer.x,(k.params[0]||1)-1),!0}vPositionRelative(k){return this._moveCursor(0,k.params[0]||1),!0}hVPosition(k){return this.cursorPosition(k),!0}tabClear(k){const D=k.params[0];return D===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:D===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(k){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=k.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(k){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=k.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(k){const D=k.params[0];return D===1&&(this._curAttrData.bg|=536870912),D!==2&&D!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(k,D,T,M=!1,W=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);V.replaceCells(D,T,this._activeBuffer.getNullCell(this._eraseAttrData()),W),M&&(V.isWrapped=!1)}_resetBufferLine(k,D=!1){const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);T&&(T.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),D),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+k),T.isWrapped=!1)}eraseInDisplay(k,D=!1){let T;switch(this._restrictCursor(this._bufferService.cols),k.params[0]){case 0:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);T<this._bufferService.rows;T++)this._resetBufferLine(T,D);this._dirtyRowTracker.markDirty(T);break;case 1:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T,0,this._activeBuffer.x+1,!0,D),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(T+1).isWrapped=!1);T--;)this._resetBufferLine(T,D);this._dirtyRowTracker.markDirty(0);break;case 2:for(T=this._bufferService.rows,this._dirtyRowTracker.markDirty(T-1);T--;)this._resetBufferLine(T,D);this._dirtyRowTracker.markDirty(0);break;case 3:const M=this._activeBuffer.lines.length-this._bufferService.rows;M>0&&(this._activeBuffer.lines.trimStart(M),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-M,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-M,0),this._onScroll.fire(0))}return!0}eraseInLine(k,D=!1){switch(this._restrictCursor(this._bufferService.cols),k.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,D);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,D)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(k){this._restrictCursor();let D=k.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y,M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-M+1;for(;D--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(T,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(k){this._restrictCursor();let D=k.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y;let M;for(M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,M=this._bufferService.rows-1+this._activeBuffer.ybase-M;D--;)this._activeBuffer.lines.splice(T,1),this._activeBuffer.lines.splice(M,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(k){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.insertCells(this._activeBuffer.x,k.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(k){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.deleteCells(this._activeBuffer.x,k.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(k){let D=k.params[0]||1;for(;D--;)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(k){let D=k.params[0]||1;for(;D--;)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(u.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=k.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);M.deleteCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=k.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);M.insertCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=k.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);M.insertCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=k.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);M.deleteCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(k){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(k.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(k){const D=this._parser.precedingJoinState;if(!D)return!0;const T=k.params[0]||1,M=x.UnicodeService.extractWidth(D),W=this._activeBuffer.x-M,V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),Q=new Uint32Array(V.length*T);let Y=0;for(let L=0;L<V.length;){const U=V.codePointAt(L)||0;Q[Y++]=U,L+=U>65535?2:1}let I=Y;for(let L=1;L<T;++L)Q.copyWithin(I,0,Y),I+=Y;return this.print(Q,0,I),!0}sendDeviceAttributesPrimary(k){return k.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(k){return k.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(k.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(k){return(this._optionsService.rawOptions.termName+"").indexOf(k)===0}setMode(k){for(let D=0;D<k.length;D++)switch(k.params[D]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(k){for(let D=0;D<k.length;D++)switch(k.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.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(k){for(let D=0;D<k.length;D++)switch(k.params[D]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(k){for(let D=0;D<k.length;D++)switch(k.params[D]){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(),k.params[D]===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(k,D){const T=this._coreService.decPrivateModes,{activeProtocol:M,activeEncoding:W}=this._coreMouseService,V=this._coreService,{buffers:Q,cols:Y}=this._bufferService,{active:I,alt:L}=Q,U=this._optionsService.rawOptions,F=_e=>_e?1:2,G=k.params[0];return q=G,te=D?G===2?4:G===4?F(V.modes.insertMode):G===12?3:G===20?F(U.convertEol):0:G===1?F(T.applicationCursorKeys):G===3?U.windowOptions.setWinLines?Y===80?2:Y===132?1:0:0:G===6?F(T.origin):G===7?F(T.wraparound):G===8?3:G===9?F(M==="X10"):G===12?F(U.cursorBlink):G===25?F(!V.isCursorHidden):G===45?F(T.reverseWraparound):G===66?F(T.applicationKeypad):G===67?4:G===1e3?F(M==="VT200"):G===1002?F(M==="DRAG"):G===1003?F(M==="ANY"):G===1004?F(T.sendFocus):G===1005?4:G===1006?F(W==="SGR"):G===1015?4:G===1016?F(W==="SGR_PIXELS"):G===1048?1:G===47||G===1047||G===1049?F(I===L):G===2004?F(T.bracketedPasteMode):0,V.triggerDataEvent(`${d.C0.ESC}[${D?"":"?"}${q};${te}$y`),!0;var q,te}_updateAttrColor(k,D,T,M,W){return D===2?(k|=50331648,k&=-16777216,k|=v.AttributeData.fromColorRGB([T,M,W])):D===5&&(k&=-50331904,k|=33554432|255&T),k}_extractColor(k,D,T){const M=[0,0,-1,0,0,0];let W=0,V=0;do{if(M[V+W]=k.params[D+V],k.hasSubParams(D+V)){const Q=k.getSubParams(D+V);let Y=0;do M[1]===5&&(W=1),M[V+Y+1+W]=Q[Y];while(++Y<Q.length&&Y+V+1+W<M.length);break}if(M[1]===5&&V+W>=2||M[1]===2&&V+W>=5)break;M[1]&&(W=1)}while(++V+D<k.length&&V+W<M.length);for(let Q=2;Q<M.length;++Q)M[Q]===-1&&(M[Q]=0);switch(M[0]){case 38:T.fg=this._updateAttrColor(T.fg,M[1],M[3],M[4],M[5]);break;case 48:T.bg=this._updateAttrColor(T.bg,M[1],M[3],M[4],M[5]);break;case 58:T.extended=T.extended.clone(),T.extended.underlineColor=this._updateAttrColor(T.extended.underlineColor,M[1],M[3],M[4],M[5])}return V}_processUnderline(k,D){D.extended=D.extended.clone(),(!~k||k>5)&&(k=1),D.extended.underlineStyle=k,D.fg|=268435456,k===0&&(D.fg&=-268435457),D.updateExtended()}_processSGR0(k){k.fg=u.DEFAULT_ATTR_DATA.fg,k.bg=u.DEFAULT_ATTR_DATA.bg,k.extended=k.extended.clone(),k.extended.underlineStyle=0,k.extended.underlineColor&=-67108864,k.updateExtended()}charAttributes(k){if(k.length===1&&k.params[0]===0)return this._processSGR0(this._curAttrData),!0;const D=k.length;let T;const M=this._curAttrData;for(let W=0;W<D;W++)T=k.params[W],T>=30&&T<=37?(M.fg&=-50331904,M.fg|=16777216|T-30):T>=40&&T<=47?(M.bg&=-50331904,M.bg|=16777216|T-40):T>=90&&T<=97?(M.fg&=-50331904,M.fg|=16777224|T-90):T>=100&&T<=107?(M.bg&=-50331904,M.bg|=16777224|T-100):T===0?this._processSGR0(M):T===1?M.fg|=134217728:T===3?M.bg|=67108864:T===4?(M.fg|=268435456,this._processUnderline(k.hasSubParams(W)?k.getSubParams(W)[0]:1,M)):T===5?M.fg|=536870912:T===7?M.fg|=67108864:T===8?M.fg|=1073741824:T===9?M.fg|=2147483648:T===2?M.bg|=134217728:T===21?this._processUnderline(2,M):T===22?(M.fg&=-134217729,M.bg&=-134217729):T===23?M.bg&=-67108865:T===24?(M.fg&=-268435457,this._processUnderline(0,M)):T===25?M.fg&=-536870913:T===27?M.fg&=-67108865:T===28?M.fg&=-1073741825:T===29?M.fg&=2147483647:T===39?(M.fg&=-67108864,M.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):T===49?(M.bg&=-67108864,M.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):T===38||T===48||T===58?W+=this._extractColor(k,W,M):T===53?M.bg|=1073741824:T===55?M.bg&=-1073741825:T===59?(M.extended=M.extended.clone(),M.extended.underlineColor=-1,M.updateExtended()):T===100?(M.fg&=-67108864,M.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,M.bg&=-67108864,M.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",T);return!0}deviceStatus(k){switch(k.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const D=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${D};${T}R`)}return!0}deviceStatusPrivate(k){if(k.params[0]===6){const D=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${D};${T}R`)}return!0}softReset(k){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=u.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(k){const D=k.params[0]||1;switch(D){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 T=D%2==1;return this._optionsService.options.cursorBlink=T,!0}setScrollRegion(k){const D=k.params[0]||1;let T;return(k.length<2||(T=k.params[1])>this._bufferService.rows||T===0)&&(T=this._bufferService.rows),T>D&&(this._activeBuffer.scrollTop=D-1,this._activeBuffer.scrollBottom=T-1,this._setCursor(0,0)),!0}windowOptions(k){if(!O(k.params[0],this._optionsService.rawOptions.windowOptions))return!0;const D=k.length>1?k.params[1]:0;switch(k.params[0]){case 14:D!==2&&this._onRequestWindowsOptionsReport.fire(P.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(P.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:D!==0&&D!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),D!==0&&D!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:D!==0&&D!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),D!==0&&D!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(k){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(k){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(k){return this._windowTitle=k,this._onTitleChange.fire(k),!0}setIconName(k){return this._iconName=k,!0}setOrReportIndexedColor(k){const D=[],T=k.split(";");for(;T.length>1;){const M=T.shift(),W=T.shift();if(/^\d+$/.exec(M)){const V=parseInt(M);if(H(V))if(W==="?")D.push({type:0,index:V});else{const Q=(0,b.parseColor)(W);Q&&D.push({type:1,index:V,color:Q})}}}return D.length&&this._onColor.fire(D),!0}setHyperlink(k){const D=k.split(";");return!(D.length<2)&&(D[1]?this._createHyperlink(D[0],D[1]):!D[0]&&this._finishHyperlink())}_createHyperlink(k,D){this._getCurrentLinkId()&&this._finishHyperlink();const T=k.split(":");let M;const W=T.findIndex(V=>V.startsWith("id="));return W!==-1&&(M=T[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:M,uri:D}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(k,D){const T=k.split(";");for(let M=0;M<T.length&&!(D>=this._specialColors.length);++M,++D)if(T[M]==="?")this._onColor.fire([{type:0,index:this._specialColors[D]}]);else{const W=(0,b.parseColor)(T[M]);W&&this._onColor.fire([{type:1,index:this._specialColors[D],color:W}])}return!0}setOrReportFgColor(k){return this._setOrReportSpecialColor(k,0)}setOrReportBgColor(k){return this._setOrReportSpecialColor(k,1)}setOrReportCursorColor(k){return this._setOrReportSpecialColor(k,2)}restoreIndexedColor(k){if(!k)return this._onColor.fire([{type:2}]),!0;const D=[],T=k.split(";");for(let M=0;M<T.length;++M)if(/^\d+$/.exec(T[M])){const W=parseInt(T[M]);H(W)&&D.push({type:2,index:W})}return D.length&&this._onColor.fire(D),!0}restoreFgColor(k){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(k){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(k){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,_.DEFAULT_CHARSET),!0}selectCharset(k){return k.length!==2?(this.selectDefaultCharset(),!0):(k[0]==="/"||this._charsetService.setgCharset(R[k[0]],_.CHARSETS[k[1]]||_.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 k=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,k,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=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(k){return this._charsetService.setgLevel(k),!0}screenAlignmentPattern(){const k=new a.CellData;k.content=4194373,k.fg=this._curAttrData.fg,k.bg=this._curAttrData.bg,this._setCursor(0,0);for(let D=0;D<this._bufferService.rows;++D){const T=this._activeBuffer.ybase+this._activeBuffer.y+D,M=this._activeBuffer.lines.get(T);M&&(M.fill(k),M.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(k,D){const T=this._bufferService.buffer,M=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${W}${d.C0.ESC}\\`),!0))(k==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:k==='"p'?'P1$r61;1"p':k==="r"?`P1$r${T.scrollTop+1};${T.scrollBottom+1}r`:k==="m"?"P1$r0m":k===" q"?`P1$r${{block:2,underline:4,bar:6}[M.cursorStyle]-(M.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(k,D){this._dirtyRowTracker.markRangeDirty(k,D)}}o.InputHandler=z;let K=class{constructor(N){this._bufferService=N,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(N){N<this.start?this.start=N:N>this.end&&(this.end=N)}markRangeDirty(N,k){N>k&&(j=N,N=k,k=j),N<this.start&&(this.start=N),k>this.end&&(this.end=k)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function H(N){return 0<=N&&N<256}K=f([m(0,C.IBufferService)],K)},844:(g,o)=>{function c(f){for(const m of f)m.dispose();f.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const m=this._disposables.indexOf(f);m!==-1&&this._disposables.splice(m,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var m;this._isDisposed||f===this._value||((m=this._value)==null||m.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},o.toDisposable=function(f){return{dispose:f}},o.disposeArray=c,o.getDisposeArrayDisposable=function(f){return{dispose:()=>c(f)}}},1505:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(m,d,_){this._data[m]||(this._data[m]={}),this._data[m][d]=_}get(m,d){return this._data[m]?this._data[m][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(f,m,d,_,S){this._data.get(f,m)||this._data.set(f,m,new c),this._data.get(f,m).set(d,_,S)}get(f,m,d,_){var S;return(S=this._data.get(f,m))==null?void 0:S.get(d,_)}clear(){this._data.clear()}}},6114:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,f=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const m=c.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),o.isIpad=f==="iPad",o.isIphone=f==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),o.isLinux=f.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(c=this._search(this._getKey(f)),this._array.splice(c,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const m=this._getKey(f);if(m===void 0||(c=this._search(m),c===-1)||this._getKey(this._array[c])!==m)return!1;do if(this._array[c]===f)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===m);return!1}*getKeyIterator(f){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===f)}forEachByKey(f,m){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do m(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===f)}values(){return[...this._array].values()}_search(f){let m=0,d=this._array.length-1;for(;d>=m;){let _=m+d>>1;const S=this._getKey(this._array[_]);if(S>f)d=_-1;else{if(!(S<f)){for(;_>0&&this._getKey(this._array[_-1])===f;)_--;return _}m=_+1}}return m}}},7226:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const f=c(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),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(S){this._idleCallback=void 0;let w=0,p=0,u=S.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),p=Math.max(w,p),l=S.timeRemaining(),1.5*p>l)return u-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-w))}ms`),void this._start();u=l}this.clear()}}class d extends m{_requestCallback(S){return setTimeout(()=>S(this._createDeadline(16)))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const w=Date.now()+S;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const f=c(643);o.updateWindowsModeWrappedState=function(m){const d=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),_=d==null?void 0:d.get(m.cols-1),S=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);S&&_&&(S.isWrapped=_[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&_[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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}}o.AttributeData=c;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,_=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=_}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=f},9092:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const f=c(6349),m=c(7226),d=c(3734),_=c(8437),S=c(4634),w=c(511),p=c(643),u=c(4863),l=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(s,a,v){this._hasScrollback=s,this._optionsService=a,this._bufferService=v,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=l.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,p.WHITESPACE_CELL_CHAR,p.WHITESPACE_CELL_WIDTH,p.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,a){return new _.BufferLine(this._bufferService.cols,this.getNullCell(s),a)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows}_getCorrectBufferLength(s){if(!this._hasScrollback)return s;const a=s+this._optionsService.rawOptions.scrollback;return a>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:a}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=_.DEFAULT_ATTR_DATA);let a=this._rows;for(;a--;)this.lines.push(this.getBlankLine(s))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(s,a){const v=this.getNullCell(_.DEFAULT_ATTR_DATA);let C=0;const x=this._getCorrectBufferLength(a);if(x>this.lines.maxLength&&(this.lines.maxLength=x),this.lines.length>0){if(this._cols<s)for(let y=0;y<this.lines.length;y++)C+=+this.lines.get(y).resize(s,v);let E=0;if(this._rows<a)for(let y=this._rows;y<a;y++)this.lines.length<a+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(s,v)):this.ybase>0&&this.lines.length<=this.ybase+this.y+E+1?(this.ybase--,E++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(s,v)));else for(let y=this._rows;y>a;y--)this.lines.length>a+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(x<this.lines.maxLength){const y=this.lines.length-x;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=x}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,a-1),E&&(this.y+=E),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=a-1,this._isReflowEnabled&&(this._reflow(s,a),this._cols>s))for(let E=0;E<this.lines.length;E++)C+=+this.lines.get(E).resize(s,v);this._cols=s,this._rows=a,this._memoryCleanupQueue.clear(),C>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let s=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,s=!1);let a=0;for(;this._memoryCleanupPosition<this.lines.length;)if(a+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),a>100)return!0;return s}get _isReflowEnabled(){const s=this._optionsService.rawOptions.windowsPty;return s&&s.buildNumber?this._hasScrollback&&s.backend==="conpty"&&s.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(s,a){this._cols!==s&&(s>this._cols?this._reflowLarger(s,a):this._reflowSmaller(s,a))}_reflowLarger(s,a){const v=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(v.length>0){const C=(0,S.reflowLargerCreateNewLayout)(this.lines,v);(0,S.reflowLargerApplyNewLayout)(this.lines,C.layout),this._reflowLargerAdjustViewport(s,a,C.countRemoved)}}_reflowLargerAdjustViewport(s,a,v){const C=this.getNullCell(_.DEFAULT_ATTR_DATA);let x=v;for(;x-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<a&&this.lines.push(new _.BufferLine(s,C))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-v,0)}_reflowSmaller(s,a){const v=this.getNullCell(_.DEFAULT_ATTR_DATA),C=[];let x=0;for(let E=this.lines.length-1;E>=0;E--){let y=this.lines.get(E);if(!y||!y.isWrapped&&y.getTrimmedLength()<=s)continue;const b=[y];for(;y.isWrapped&&E>0;)y=this.lines.get(--E),b.unshift(y);const R=this.ybase+this.y;if(R>=E&&R<E+b.length)continue;const A=b[b.length-1].getTrimmedLength(),O=(0,S.reflowSmallerGetNewLineLengths)(b,this._cols,s),P=O.length-b.length;let j;j=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+P):Math.max(0,this.lines.length-this.lines.maxLength+P);const z=[];for(let T=0;T<P;T++){const M=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);z.push(M)}z.length>0&&(C.push({start:E+b.length+x,newLines:z}),x+=z.length),b.push(...z);let K=O.length-1,H=O[K];H===0&&(K--,H=O[K]);let N=b.length-P-1,k=A;for(;N>=0;){const T=Math.min(k,H);if(b[K]===void 0)break;if(b[K].copyCellsFrom(b[N],k-T,H-T,T,!0),H-=T,H===0&&(K--,H=O[K]),k-=T,k===0){N--;const M=Math.max(N,0);k=(0,S.getWrappedLineTrimmedLength)(b,M,this._cols)}}for(let T=0;T<b.length;T++)O[T]<s&&b[T].setCell(O[T],v);let D=P-j;for(;D-- >0;)this.ybase===0?this.y<a-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+x)-a&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+a-1)}if(C.length>0){const E=[],y=[];for(let K=0;K<this.lines.length;K++)y.push(this.lines.get(K));const b=this.lines.length;let R=b-1,A=0,O=C[A];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+x);let P=0;for(let K=Math.min(this.lines.maxLength-1,b+x-1);K>=0;K--)if(O&&O.start>R+P){for(let H=O.newLines.length-1;H>=0;H--)this.lines.set(K--,O.newLines[H]);K++,E.push({index:R+1,amount:O.newLines.length}),P+=O.newLines.length,O=C[++A]}else this.lines.set(K,y[R--]);let j=0;for(let K=E.length-1;K>=0;K--)E[K].index+=j,this.lines.onInsertEmitter.fire(E[K]),j+=E[K].amount;const z=Math.max(0,b+x-this.lines.maxLength);z>0&&this.lines.onTrimEmitter.fire(z)}}translateBufferLineToString(s,a,v=0,C){const x=this.lines.get(s);return x?x.translateToString(a,v,C):""}getWrappedRangeForLine(s){let a=s,v=s;for(;a>0&&this.lines.get(a).isWrapped;)a--;for(;v+1<this.lines.length&&this.lines.get(v+1).isWrapped;)v++;return{first:a,last:v}}setupTabStops(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.rawOptions.tabStopWidth)this.tabs[s]=!0}prevStop(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s}nextStop(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s}clearMarkers(s){this._isClearing=!0;for(let a=0;a<this.markers.length;a++)this.markers[a].line===s&&(this.markers[a].dispose(),this.markers.splice(a--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].dispose(),this.markers.splice(s--,1);this._isClearing=!1}addMarker(s){const a=new u.Marker(s);return this.markers.push(a),a.register(this.lines.onTrim(v=>{a.line-=v,a.line<0&&a.dispose()})),a.register(this.lines.onInsert(v=>{a.line>=v.index&&(a.line+=v.amount)})),a.register(this.lines.onDelete(v=>{a.line>=v.index&&a.line<v.index+v.amount&&a.dispose(),a.line>v.index&&(a.line-=v.amount)})),a.register(a.onDispose(()=>this._removeMarker(a))),a}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const f=c(3734),m=c(511),d=c(643),_=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let S=0;class w{constructor(u,l,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);const a=l||m.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let v=0;v<u;++v)this.setCell(v,a);this.length=u}get(u){const l=this._data[3*u+0],s=2097151&l;return[this._data[3*u+1],2097152&l?this._combined[u]:s?(0,_.stringFromCodePoint)(s):"",l>>22,2097152&l?this._combined[u].charCodeAt(this._combined[u].length-1):s]}set(u,l){this._data[3*u+1]=l[d.CHAR_DATA_ATTR_INDEX],l[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=l[1],this._data[3*u+0]=2097152|u|l[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=l[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|l[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(u){return this._data[3*u+0]>>22}hasWidth(u){return 12582912&this._data[3*u+0]}getFg(u){return this._data[3*u+1]}getBg(u){return this._data[3*u+2]}hasContent(u){return 4194303&this._data[3*u+0]}getCodePoint(u){const l=this._data[3*u+0];return 2097152&l?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&l}isCombined(u){return 2097152&this._data[3*u+0]}getString(u){const l=this._data[3*u+0];return 2097152&l?this._combined[u]:2097151&l?(0,_.stringFromCodePoint)(2097151&l):""}isProtected(u){return 536870912&this._data[3*u+2]}loadCell(u,l){return S=3*u,l.content=this._data[S+0],l.fg=this._data[S+1],l.bg=this._data[S+2],2097152&l.content&&(l.combinedData=this._combined[u]),268435456&l.bg&&(l.extended=this._extendedAttrs[u]),l}setCell(u,l){2097152&l.content&&(this._combined[u]=l.combinedData),268435456&l.bg&&(this._extendedAttrs[u]=l.extended),this._data[3*u+0]=l.content,this._data[3*u+1]=l.fg,this._data[3*u+2]=l.bg}setCellFromCodepoint(u,l,s,a){268435456&a.bg&&(this._extendedAttrs[u]=a.extended),this._data[3*u+0]=l|s<<22,this._data[3*u+1]=a.fg,this._data[3*u+2]=a.bg}addCodepointToCell(u,l,s){let a=this._data[3*u+0];2097152&a?this._combined[u]+=(0,_.stringFromCodePoint)(l):2097151&a?(this._combined[u]=(0,_.stringFromCodePoint)(2097151&a)+(0,_.stringFromCodePoint)(l),a&=-2097152,a|=2097152):a=l|4194304,s&&(a&=-12582913,a|=s<<22),this._data[3*u+0]=a}insertCells(u,l,s){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),l<this.length-u){const a=new m.CellData;for(let v=this.length-u-l-1;v>=0;--v)this.setCell(u+l+v,this.loadCell(u+v,a));for(let v=0;v<l;++v)this.setCell(u+v,s)}else for(let a=u;a<this.length;++a)this.setCell(a,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(u,l,s){if(u%=this.length,l<this.length-u){const a=new m.CellData;for(let v=0;v<this.length-u-l;++v)this.setCell(u+v,this.loadCell(u+l+v,a));for(let v=this.length-l;v<this.length;++v)this.setCell(v,s)}else for(let a=u;a<this.length;++a)this.setCell(a,s);u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),this.getWidth(u)!==0||this.hasContent(u)||this.setCellFromCodepoint(u,0,1,s)}replaceCells(u,l,s,a=!1){if(a)for(u&&this.getWidth(u-1)===2&&!this.isProtected(u-1)&&this.setCellFromCodepoint(u-1,0,1,s),l<this.length&&this.getWidth(l-1)===2&&!this.isProtected(l)&&this.setCellFromCodepoint(l,0,1,s);u<l&&u<this.length;)this.isProtected(u)||this.setCell(u,s),u++;else for(u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),l<this.length&&this.getWidth(l-1)===2&&this.setCellFromCodepoint(l,0,1,s);u<l&&u<this.length;)this.setCell(u++,s)}resize(u,l){if(u===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*u;if(u>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const a=new Uint32Array(s);a.set(this._data),this._data=a}for(let a=this.length;a<u;++a)this.setCell(a,l)}else{this._data=this._data.subarray(0,s);const a=Object.keys(this._combined);for(let C=0;C<a.length;C++){const x=parseInt(a[C],10);x>=u&&delete this._combined[x]}const v=Object.keys(this._extendedAttrs);for(let C=0;C<v.length;C++){const x=parseInt(v[C],10);x>=u&&delete this._extendedAttrs[x]}}return this.length=u,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const u=new Uint32Array(this._data.length);return u.set(this._data),this._data=u,1}return 0}fill(u,l=!1){if(l)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,u);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,u)}}copyFrom(u){this.length!==u.length?this._data=new Uint32Array(u._data):this._data.set(u._data),this.length=u.length,this._combined={};for(const l in u._combined)this._combined[l]=u._combined[l];this._extendedAttrs={};for(const l in u._extendedAttrs)this._extendedAttrs[l]=u._extendedAttrs[l];this.isWrapped=u.isWrapped}clone(){const u=new w(0);u._data=new Uint32Array(this._data),u.length=this.length;for(const l in this._combined)u._combined[l]=this._combined[l];for(const l in this._extendedAttrs)u._extendedAttrs[l]=this._extendedAttrs[l];return u.isWrapped=this.isWrapped,u}getTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0}getNoBgTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0]||50331648&this._data[3*u+2])return u+(this._data[3*u+0]>>22);return 0}copyCellsFrom(u,l,s,a,v){const C=u._data;if(v)for(let E=a-1;E>=0;E--){for(let y=0;y<3;y++)this._data[3*(s+E)+y]=C[3*(l+E)+y];268435456&C[3*(l+E)+2]&&(this._extendedAttrs[s+E]=u._extendedAttrs[l+E])}else for(let E=0;E<a;E++){for(let y=0;y<3;y++)this._data[3*(s+E)+y]=C[3*(l+E)+y];268435456&C[3*(l+E)+2]&&(this._extendedAttrs[s+E]=u._extendedAttrs[l+E])}const x=Object.keys(u._combined);for(let E=0;E<x.length;E++){const y=parseInt(x[E],10);y>=l&&(this._combined[y-l+s]=u._combined[y])}}translateToString(u,l,s,a){l=l??0,s=s??this.length,u&&(s=Math.min(s,this.getTrimmedLength())),a&&(a.length=0);let v="";for(;l<s;){const C=this._data[3*l+0],x=2097151&C,E=2097152&C?this._combined[l]:x?(0,_.stringFromCodePoint)(x):d.WHITESPACE_CELL_CHAR;if(v+=E,a)for(let y=0;y<E.length;++y)a.push(l);l+=C>>22||1}return a&&a.push(l),v}}o.BufferLine=w},4841:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,f){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return f*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(g,o)=>{function c(f,m,d){if(m===f.length-1)return f[m].getTrimmedLength();const _=!f[m].hasContent(d-1)&&f[m].getWidth(d-1)===1,S=f[m+1].getWidth(0)===2;return _&&S?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(f,m,d,_,S){const w=[];for(let p=0;p<f.length-1;p++){let u=p,l=f.get(++u);if(!l.isWrapped)continue;const s=[f.get(p)];for(;u<f.length&&l.isWrapped;)s.push(l),l=f.get(++u);if(_>=p&&_<u){p+=s.length-1;continue}let a=0,v=c(s,a,m),C=1,x=0;for(;C<s.length;){const y=c(s,C,m),b=y-x,R=d-v,A=Math.min(b,R);s[a].copyCellsFrom(s[C],x,v,A,!1),v+=A,v===d&&(a++,v=0),x+=A,x===y&&(C++,x=0),v===0&&a!==0&&s[a-1].getWidth(d-1)===2&&(s[a].copyCellsFrom(s[a-1],d-1,v++,1,!1),s[a-1].setCell(d-1,S))}s[a].replaceCells(v,d,S);let E=0;for(let y=s.length-1;y>0&&(y>a||s[y].getTrimmedLength()===0);y--)E++;E>0&&(w.push(p+s.length-E),w.push(E)),p+=s.length-1}return w},o.reflowLargerCreateNewLayout=function(f,m){const d=[];let _=0,S=m[_],w=0;for(let p=0;p<f.length;p++)if(S===p){const u=m[++_];f.onDeleteEmitter.fire({index:p-w,amount:u}),p+=u-1,w+=u,S=m[++_]}else d.push(p);return{layout:d,countRemoved:w}},o.reflowLargerApplyNewLayout=function(f,m){const d=[];for(let _=0;_<m.length;_++)d.push(f.get(m[_]));for(let _=0;_<d.length;_++)f.set(_,d[_]);f.length=m.length},o.reflowSmallerGetNewLineLengths=function(f,m,d){const _=[],S=f.map((l,s)=>c(f,s,m)).reduce((l,s)=>l+s);let w=0,p=0,u=0;for(;u<S;){if(S-u<d){_.push(S-u);break}w+=d;const l=c(f,p,m);w>l&&(w-=l,p++);const s=f[p].getWidth(w-1)===2;s&&w--;const a=s?d-1:d;_.push(a),u+=a}return _},o.getWrappedLineTrimmedLength=c},5295:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const f=c(8460),m=c(844),d=c(9092);class _ extends m.Disposable{constructor(w,p){super(),this._optionsService=w,this._bufferService=p,this._onBufferActivate=this.register(new f.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 d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.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(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),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(w,p){this._normal.resize(w,p),this._alt.resize(w,p),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}o.BufferSet=_},511:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const f=c(482),m=c(643),d=c(3734);class _ extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const p=new _;return p.setFromCharData(w),p}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let p=!1;if(w[m.CHAR_DATA_CHAR_INDEX].length>2)p=!0;else if(w[m.CHAR_DATA_CHAR_INDEX].length===2){const u=w[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=u&&u<=56319){const l=w[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(u-55296)+l-56320+65536|w[m.CHAR_DATA_WIDTH_INDEX]<<22:p=!0}else p=!0}else this.content=w[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[m.CHAR_DATA_WIDTH_INDEX]<<22;p&&(this.combinedData=w[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=_},643:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const f=c(8460),m=c(844);class d{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}o.Marker=d,d._nextId=1},7116:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.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:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(g,o)=>{var c,f,m;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
|
|
63
|
+
`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""}(c||(o.C0=c={})),function(d){d.PAD="",d.HOP="",d.BPH="",d.NBH="",d.IND="",d.NEL="
",d.SSA="",d.ESA="",d.HTS="",d.HTJ="",d.VTS="",d.PLD="",d.PLU="",d.RI="",d.SS2="",d.SS3="",d.DCS="",d.PU1="",d.PU2="",d.STS="",d.CCH="",d.MW="",d.SPA="",d.EPA="",d.SOS="",d.SGCI="",d.SCI="",d.CSI="",d.ST="",d.OSC="",d.PM="",d.APC=""}(f||(o.C1=f={})),function(d){d.ST=`${c.ESC}\\`}(m||(o.C1_ESCAPED=m={}))},7399:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const f=c(2584),m={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:["'",'"']};o.evaluateKeyboardEvent=function(d,_,S,w){const p={type:0,cancel:!1,key:void 0},u=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?p.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?p.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?p.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(p.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:p.key=d.ctrlKey?"\b":f.C0.DEL,d.altKey&&(p.key=f.C0.ESC+p.key);break;case 9:if(d.shiftKey){p.key=f.C0.ESC+"[Z";break}p.key=f.C0.HT,p.cancel=!0;break;case 13:p.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,p.cancel=!0;break;case 27:p.key=f.C0.ESC,d.altKey&&(p.key=f.C0.ESC+f.C0.ESC),p.cancel=!0;break;case 37:if(d.metaKey)break;u?(p.key=f.C0.ESC+"[1;"+(u+1)+"D",p.key===f.C0.ESC+"[1;3D"&&(p.key=f.C0.ESC+(S?"b":"[1;5D"))):p.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;u?(p.key=f.C0.ESC+"[1;"+(u+1)+"C",p.key===f.C0.ESC+"[1;3C"&&(p.key=f.C0.ESC+(S?"f":"[1;5C"))):p.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;u?(p.key=f.C0.ESC+"[1;"+(u+1)+"A",S||p.key!==f.C0.ESC+"[1;3A"||(p.key=f.C0.ESC+"[1;5A")):p.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;u?(p.key=f.C0.ESC+"[1;"+(u+1)+"B",S||p.key!==f.C0.ESC+"[1;3B"||(p.key=f.C0.ESC+"[1;5B")):p.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(p.key=f.C0.ESC+"[2~");break;case 46:p.key=u?f.C0.ESC+"[3;"+(u+1)+"~":f.C0.ESC+"[3~";break;case 36:p.key=u?f.C0.ESC+"[1;"+(u+1)+"H":_?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:p.key=u?f.C0.ESC+"[1;"+(u+1)+"F":_?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?p.type=2:d.ctrlKey?p.key=f.C0.ESC+"[5;"+(u+1)+"~":p.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?p.type=3:d.ctrlKey?p.key=f.C0.ESC+"[6;"+(u+1)+"~":p.key=f.C0.ESC+"[6~";break;case 112:p.key=u?f.C0.ESC+"[1;"+(u+1)+"P":f.C0.ESC+"OP";break;case 113:p.key=u?f.C0.ESC+"[1;"+(u+1)+"Q":f.C0.ESC+"OQ";break;case 114:p.key=u?f.C0.ESC+"[1;"+(u+1)+"R":f.C0.ESC+"OR";break;case 115:p.key=u?f.C0.ESC+"[1;"+(u+1)+"S":f.C0.ESC+"OS";break;case 116:p.key=u?f.C0.ESC+"[15;"+(u+1)+"~":f.C0.ESC+"[15~";break;case 117:p.key=u?f.C0.ESC+"[17;"+(u+1)+"~":f.C0.ESC+"[17~";break;case 118:p.key=u?f.C0.ESC+"[18;"+(u+1)+"~":f.C0.ESC+"[18~";break;case 119:p.key=u?f.C0.ESC+"[19;"+(u+1)+"~":f.C0.ESC+"[19~";break;case 120:p.key=u?f.C0.ESC+"[20;"+(u+1)+"~":f.C0.ESC+"[20~";break;case 121:p.key=u?f.C0.ESC+"[21;"+(u+1)+"~":f.C0.ESC+"[21~";break;case 122:p.key=u?f.C0.ESC+"[23;"+(u+1)+"~":f.C0.ESC+"[23~";break;case 123:p.key=u?f.C0.ESC+"[24;"+(u+1)+"~":f.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(S&&!w||!d.altKey||d.metaKey)!S||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?p.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(p.key=f.C0.US),d.key==="@"&&(p.key=f.C0.NUL)):d.keyCode===65&&(p.type=1);else{const l=m[d.keyCode],s=l==null?void 0:l[d.shiftKey?1:0];if(s)p.key=f.C0.ESC+s;else if(d.keyCode>=65&&d.keyCode<=90){const a=d.ctrlKey?d.keyCode-64:d.keyCode+32;let v=String.fromCharCode(a);d.shiftKey&&(v=v.toUpperCase()),p.key=f.C0.ESC+v}else if(d.keyCode===32)p.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let a=d.code.slice(3,4);d.shiftKey||(a=a.toLowerCase()),p.key=f.C0.ESC+a,p.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?p.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?p.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?p.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?p.key=f.C0.DEL:d.keyCode===219?p.key=f.C0.ESC:d.keyCode===220?p.key=f.C0.FS:d.keyCode===221&&(p.key=f.C0.GS)}return p}},482:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,f=0,m=c.length){let d="";for(let _=f;_<m;++_){let S=c[_];S>65535?(S-=65536,d+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):d+=String.fromCharCode(S)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,f){const m=c.length;if(!m)return 0;let d=0,_=0;if(this._interim){const S=c.charCodeAt(_++);56320<=S&&S<=57343?f[d++]=1024*(this._interim-55296)+S-56320+65536:(f[d++]=this._interim,f[d++]=S),this._interim=0}for(let S=_;S<m;++S){const w=c.charCodeAt(S);if(55296<=w&&w<=56319){if(++S>=m)return this._interim=w,d;const p=c.charCodeAt(S);56320<=p&&p<=57343?f[d++]=1024*(w-55296)+p-56320+65536:(f[d++]=w,f[d++]=p)}else w!==65279&&(f[d++]=w)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,f){const m=c.length;if(!m)return 0;let d,_,S,w,p=0,u=0,l=0;if(this.interim[0]){let v=!1,C=this.interim[0];C&=(224&C)==192?31:(240&C)==224?15:7;let x,E=0;for(;(x=63&this.interim[++E])&&E<4;)C<<=6,C|=x;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,b=y-E;for(;l<b;){if(l>=m)return 0;if(x=c[l++],(192&x)!=128){l--,v=!0;break}this.interim[E++]=x,C<<=6,C|=63&x}v||(y===2?C<128?l--:f[p++]=C:y===3?C<2048||C>=55296&&C<=57343||C===65279||(f[p++]=C):C<65536||C>1114111||(f[p++]=C)),this.interim.fill(0)}const s=m-4;let a=l;for(;a<m;){for(;!(!(a<s)||128&(d=c[a])||128&(_=c[a+1])||128&(S=c[a+2])||128&(w=c[a+3]));)f[p++]=d,f[p++]=_,f[p++]=S,f[p++]=w,a+=4;if(d=c[a++],d<128)f[p++]=d;else if((224&d)==192){if(a>=m)return this.interim[0]=d,p;if(_=c[a++],(192&_)!=128){a--;continue}if(u=(31&d)<<6|63&_,u<128){a--;continue}f[p++]=u}else if((240&d)==224){if(a>=m)return this.interim[0]=d,p;if(_=c[a++],(192&_)!=128){a--;continue}if(a>=m)return this.interim[0]=d,this.interim[1]=_,p;if(S=c[a++],(192&S)!=128){a--;continue}if(u=(15&d)<<12|(63&_)<<6|63&S,u<2048||u>=55296&&u<=57343||u===65279)continue;f[p++]=u}else if((248&d)==240){if(a>=m)return this.interim[0]=d,p;if(_=c[a++],(192&_)!=128){a--;continue}if(a>=m)return this.interim[0]=d,this.interim[1]=_,p;if(S=c[a++],(192&S)!=128){a--;continue}if(a>=m)return this.interim[0]=d,this.interim[1]=_,this.interim[2]=S,p;if(w=c[a++],(192&w)!=128){a--;continue}if(u=(7&d)<<18|(63&_)<<12|(63&S)<<6|63&w,u<65536||u>1114111)continue;f[p++]=u}}return p}}},225:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const f=c(1480),m=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let _;o.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let S=0;S<m.length;++S)_.fill(0,m[S][0],m[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?_[S]:function(w,p){let u,l=0,s=p.length-1;if(w<p[0][0]||w>p[s][1])return!1;for(;s>=l;)if(u=l+s>>1,w>p[u][1])l=u+1;else{if(!(w<p[u][0]))return!0;s=u-1}return!1}(S,d)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,w){let p=this.wcwidth(S),u=p===0&&w!==0;if(u){const l=f.UnicodeService.extractWidth(w);l===0?u=!1:l>p&&(p=l)}return f.UnicodeService.createPropertyValue(0,p,u)}}},5981:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const f=c(8460),m=c(844);class d extends m.Disposable{constructor(S){super(),this._action=S,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let p;for(this._isSyncWriting=!0;p=this._writeBuffer.shift();){this._action(p);const u=this._callbacks.shift();u&&u()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,w){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+=S.length,this._writeBuffer.push(S),this._callbacks.push(w),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(w)}_innerWrite(S=0,w=!0){const p=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const u=this._writeBuffer[this._bufferOffset],l=this._action(u,w);if(l){const a=v=>Date.now()-p>=12?setTimeout(()=>this._innerWrite(0,v)):this._innerWrite(p,v);return void l.catch(v=>(queueMicrotask(()=>{throw v}),Promise.resolve(!1))).then(a)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=u.length,Date.now()-p>=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()}}o.WriteBuffer=d},5941:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\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})$/,f=/^[\da-f]+$/;function m(d,_){const S=d.toString(16),w=S.length<2?"0"+S:S;switch(_){case 4:return S[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}o.parseColor=function(d){if(!d)return;let _=d.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const S=c.exec(_);if(S){const w=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/w*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/w*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/w*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),f.exec(_)&&[3,6,9,12].includes(_.length))){const S=_.length/3,w=[0,0,0];for(let p=0;p<3;++p){const u=parseInt(_.slice(S*p,S*p+S),16);w[p]=S===1?u<<4:S===2?u:S===3?u>>4:u>>8}return w}},o.toRgbString=function(d,_=16){const[S,w,p]=d;return`rgb:${m(S,_)}/${m(w,_)}/${m(p,_)}`}},5770:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const f=c(482),m=c(8742),d=c(5770),_=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(w,p){this._handlers[w]===void 0&&(this._handlers[w]=[]);const u=this._handlers[w];return u.push(p),{dispose:()=>{const l=u.indexOf(p);l!==-1&&u.splice(l,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(w,p){if(this.reset(),this._ident=w,this._active=this._handlers[w]||_,this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].hook(p);else this._handlerFb(this._ident,"HOOK",p)}put(w,p,u){if(this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].put(w,p,u);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(w,p,u))}unhook(w,p=!0){if(this._active.length){let u=!1,l=this._active.length-1,s=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,u=p,s=this._stack.fallThrough,this._stack.paused=!1),!s&&u===!1){for(;l>=0&&(u=this._active[l].unhook(w),u!==!0);l--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,u;l--}for(;l>=0;l--)if(u=this._active[l].unhook(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,u}else this._handlerFb(this._ident,"UNHOOK",w);this._active=_,this._ident=0}};const S=new m.Params;S.addParam(0),o.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=S,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():S,this._data="",this._hitLimit=!1}put(w,p,u){this._hitLimit||(this._data+=(0,f.utf32ToString)(w,p,u),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let p=!1;if(this._hitLimit)p=!1;else if(w&&(p=this._handler(this._data,this._params),p instanceof Promise))return p.then(u=>(this._params=S,this._data="",this._hitLimit=!1,u));return this._params=S,this._data="",this._hitLimit=!1,p}}},2015:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const f=c(844),m=c(8742),d=c(6242),_=c(6351);class S{constructor(l){this.table=new Uint8Array(l)}setDefault(l,s){this.table.fill(l<<4|s)}add(l,s,a,v){this.table[s<<8|l]=a<<4|v}addMany(l,s,a,v){for(let C=0;C<l.length;C++)this.table[s<<8|l[C]]=a<<4|v}}o.TransitionTable=S;const w=160;o.VT500_TRANSITION_TABLE=function(){const u=new S(4095),l=Array.apply(null,Array(256)).map((E,y)=>y),s=(E,y)=>l.slice(E,y),a=s(32,127),v=s(0,24);v.push(25),v.push.apply(v,s(28,32));const C=s(0,14);let x;for(x in u.setDefault(1,0),u.addMany(a,0,2,0),C)u.addMany([24,26,153,154],x,3,0),u.addMany(s(128,144),x,3,0),u.addMany(s(144,152),x,3,0),u.add(156,x,0,0),u.add(27,x,11,1),u.add(157,x,4,8),u.addMany([152,158,159],x,0,7),u.add(155,x,11,3),u.add(144,x,11,9);return u.addMany(v,0,3,0),u.addMany(v,1,3,1),u.add(127,1,0,1),u.addMany(v,8,0,8),u.addMany(v,3,3,3),u.add(127,3,0,3),u.addMany(v,4,3,4),u.add(127,4,0,4),u.addMany(v,6,3,6),u.addMany(v,5,3,5),u.add(127,5,0,5),u.addMany(v,2,3,2),u.add(127,2,0,2),u.add(93,1,4,8),u.addMany(a,8,5,8),u.add(127,8,5,8),u.addMany([156,27,24,26,7],8,6,0),u.addMany(s(28,32),8,0,8),u.addMany([88,94,95],1,0,7),u.addMany(a,7,0,7),u.addMany(v,7,0,7),u.add(156,7,0,0),u.add(127,7,0,7),u.add(91,1,11,3),u.addMany(s(64,127),3,7,0),u.addMany(s(48,60),3,8,4),u.addMany([60,61,62,63],3,9,4),u.addMany(s(48,60),4,8,4),u.addMany(s(64,127),4,7,0),u.addMany([60,61,62,63],4,0,6),u.addMany(s(32,64),6,0,6),u.add(127,6,0,6),u.addMany(s(64,127),6,0,0),u.addMany(s(32,48),3,9,5),u.addMany(s(32,48),5,9,5),u.addMany(s(48,64),5,0,6),u.addMany(s(64,127),5,7,0),u.addMany(s(32,48),4,9,5),u.addMany(s(32,48),1,9,2),u.addMany(s(32,48),2,9,2),u.addMany(s(48,127),2,10,0),u.addMany(s(48,80),1,10,0),u.addMany(s(81,88),1,10,0),u.addMany([89,90,92],1,10,0),u.addMany(s(96,127),1,10,0),u.add(80,1,11,9),u.addMany(v,9,0,9),u.add(127,9,0,9),u.addMany(s(28,32),9,0,9),u.addMany(s(32,48),9,9,12),u.addMany(s(48,60),9,8,10),u.addMany([60,61,62,63],9,9,10),u.addMany(v,11,0,11),u.addMany(s(32,128),11,0,11),u.addMany(s(28,32),11,0,11),u.addMany(v,10,0,10),u.add(127,10,0,10),u.addMany(s(28,32),10,0,10),u.addMany(s(48,60),10,8,10),u.addMany([60,61,62,63],10,0,11),u.addMany(s(32,48),10,9,12),u.addMany(v,12,0,12),u.add(127,12,0,12),u.addMany(s(28,32),12,0,12),u.addMany(s(32,48),12,9,12),u.addMany(s(48,64),12,0,11),u.addMany(s(64,127),12,12,13),u.addMany(s(64,127),10,12,13),u.addMany(s(64,127),9,12,13),u.addMany(v,13,13,13),u.addMany(a,13,13,13),u.add(127,13,0,13),u.addMany([27,156,24,26],13,14,0),u.add(w,0,2,0),u.add(w,8,5,8),u.add(w,6,0,6),u.add(w,11,0,11),u.add(w,13,13,13),u}();class p extends f.Disposable{constructor(l=o.VT500_TRANSITION_TABLE){super(),this._transitions=l,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(s,a,v)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,a)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(l,s=[64,126]){let a=0;if(l.prefix){if(l.prefix.length>1)throw new Error("only one byte as prefix supported");if(a=l.prefix.charCodeAt(0),a&&60>a||a>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(l.intermediates){if(l.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let C=0;C<l.intermediates.length;++C){const x=l.intermediates.charCodeAt(C);if(32>x||x>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");a<<=8,a|=x}}if(l.final.length!==1)throw new Error("final must be a single byte");const v=l.final.charCodeAt(0);if(s[0]>v||v>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return a<<=8,a|=v,a}identToString(l){const s=[];for(;l;)s.push(String.fromCharCode(255&l)),l>>=8;return s.reverse().join("")}setPrintHandler(l){this._printHandler=l}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(l,s){const a=this._identifier(l,[48,126]);this._escHandlers[a]===void 0&&(this._escHandlers[a]=[]);const v=this._escHandlers[a];return v.push(s),{dispose:()=>{const C=v.indexOf(s);C!==-1&&v.splice(C,1)}}}clearEscHandler(l){this._escHandlers[this._identifier(l,[48,126])]&&delete this._escHandlers[this._identifier(l,[48,126])]}setEscHandlerFallback(l){this._escHandlerFb=l}setExecuteHandler(l,s){this._executeHandlers[l.charCodeAt(0)]=s}clearExecuteHandler(l){this._executeHandlers[l.charCodeAt(0)]&&delete this._executeHandlers[l.charCodeAt(0)]}setExecuteHandlerFallback(l){this._executeHandlerFb=l}registerCsiHandler(l,s){const a=this._identifier(l);this._csiHandlers[a]===void 0&&(this._csiHandlers[a]=[]);const v=this._csiHandlers[a];return v.push(s),{dispose:()=>{const C=v.indexOf(s);C!==-1&&v.splice(C,1)}}}clearCsiHandler(l){this._csiHandlers[this._identifier(l)]&&delete this._csiHandlers[this._identifier(l)]}setCsiHandlerFallback(l){this._csiHandlerFb=l}registerDcsHandler(l,s){return this._dcsParser.registerHandler(this._identifier(l),s)}clearDcsHandler(l){this._dcsParser.clearHandler(this._identifier(l))}setDcsHandlerFallback(l){this._dcsParser.setHandlerFallback(l)}registerOscHandler(l,s){return this._oscParser.registerHandler(l,s)}clearOscHandler(l){this._oscParser.clearHandler(l)}setOscHandlerFallback(l){this._oscParser.setHandlerFallback(l)}setErrorHandler(l){this._errorHandler=l}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(l,s,a,v,C){this._parseStack.state=l,this._parseStack.handlers=s,this._parseStack.handlerPos=a,this._parseStack.transition=v,this._parseStack.chunkPos=C}parse(l,s,a){let v,C=0,x=0,E=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,E=this._parseStack.chunkPos+1;else{if(a===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const y=this._parseStack.handlers;let b=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(a===!1&&b>-1){for(;b>=0&&(v=y[b](this._params),v!==!0);b--)if(v instanceof Promise)return this._parseStack.handlerPos=b,v}this._parseStack.handlers=[];break;case 4:if(a===!1&&b>-1){for(;b>=0&&(v=y[b](),v!==!0);b--)if(v instanceof Promise)return this._parseStack.handlerPos=b,v}this._parseStack.handlers=[];break;case 6:if(C=l[this._parseStack.chunkPos],v=this._dcsParser.unhook(C!==24&&C!==26,a),v)return v;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(C=l[this._parseStack.chunkPos],v=this._oscParser.end(C!==24&&C!==26,a),v)return v;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,E=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let y=E;y<s;++y){switch(C=l[y],x=this._transitions.table[this.currentState<<8|(C<160?C:w)],x>>4){case 2:for(let P=y+1;;++P){if(P>=s||(C=l[P])<32||C>126&&C<w){this._printHandler(l,y,P),y=P-1;break}if(++P>=s||(C=l[P])<32||C>126&&C<w){this._printHandler(l,y,P),y=P-1;break}if(++P>=s||(C=l[P])<32||C>126&&C<w){this._printHandler(l,y,P),y=P-1;break}if(++P>=s||(C=l[P])<32||C>126&&C<w){this._printHandler(l,y,P),y=P-1;break}}break;case 3:this._executeHandlers[C]?this._executeHandlers[C]():this._executeHandlerFb(C),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:y,code:C,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const b=this._csiHandlers[this._collect<<8|C];let R=b?b.length-1:-1;for(;R>=0&&(v=b[R](this._params),v!==!0);R--)if(v instanceof Promise)return this._preserveStack(3,b,R,x,y),v;R<0&&this._csiHandlerFb(this._collect<<8|C,this._params),this.precedingJoinState=0;break;case 8:do switch(C){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(C-48)}while(++y<s&&(C=l[y])>47&&C<60);y--;break;case 9:this._collect<<=8,this._collect|=C;break;case 10:const A=this._escHandlers[this._collect<<8|C];let O=A?A.length-1:-1;for(;O>=0&&(v=A[O](),v!==!0);O--)if(v instanceof Promise)return this._preserveStack(4,A,O,x,y),v;O<0&&this._escHandlerFb(this._collect<<8|C),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|C,this._params);break;case 13:for(let P=y+1;;++P)if(P>=s||(C=l[P])===24||C===26||C===27||C>127&&C<w){this._dcsParser.put(l,y,P),y=P-1;break}break;case 14:if(v=this._dcsParser.unhook(C!==24&&C!==26),v)return this._preserveStack(6,[],0,x,y),v;C===27&&(x|=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 P=y+1;;P++)if(P>=s||(C=l[P])<32||C>127&&C<w){this._oscParser.put(l,y,P),y=P-1;break}break;case 6:if(v=this._oscParser.end(C!==24&&C!==26),v)return this._preserveStack(5,[],0,x,y),v;C===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&x}}}o.EscapeSequenceParser=p},6242:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const f=c(5770),m=c(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,S){this._handlers[_]===void 0&&(this._handlers[_]=[]);const w=this._handlers[_];return w.push(S),{dispose:()=>{const p=w.indexOf(S);p!==-1&&w.splice(p,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,S,w){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(_,S,w);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(_,S,w))}start(){this.reset(),this._state=1}put(_,S,w){if(this._state!==3){if(this._state===1)for(;S<w;){const p=_[S++];if(p===59){this._state=2,this._start();break}if(p<48||57<p)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+p-48}this._state===2&&w-S>0&&this._put(_,S,w)}}end(_,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,p=this._active.length-1,u=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,w=S,u=this._stack.fallThrough,this._stack.paused=!1),!u&&w===!1){for(;p>=0&&(w=this._active[p].end(_),w!==!0);p--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,w;p--}for(;p>=0;p--)if(w=this._active[p].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",_);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,S,w){this._hitLimit||(this._data+=(0,m.utf32ToString)(_,S,w),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let S=!1;if(this._hitLimit)S=!1;else if(_&&(S=this._handler(this._data),S instanceof Promise))return S.then(w=>(this._data="",this._hitLimit=!1,w));return this._data="",this._hitLimit=!1,S}}},8742:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class f{static fromArray(d){const _=new f;if(!d.length)return _;for(let S=Array.isArray(d[0])?1:0;S<d.length;++S){const w=d[S];if(Array.isArray(w))for(let p=0;p<w.length;++p)_.addSubParam(w[p]);else _.addParam(w)}return _}constructor(d=32,_=32){if(this.maxLength=d,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new f(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let _=0;_<this.length;++_){d.push(this.params[_]);const S=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-S>0&&d.push(Array.prototype.slice.call(this._subParams,S,w))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const _=this._subParamsIdx[d]>>8,S=255&this._subParamsIdx[d];return S-_>0?this._subParams.subarray(_,S):null}getSubParamsAll(){const d={};for(let _=0;_<this.length;++_){const S=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-S>0&&(d[_]=this._subParams.slice(S,w))}return d}addDigit(d){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,w=S[_-1];S[_-1]=~w?Math.min(10*w+d,c):d}}o.Params=f},5741:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,f){const m={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(m),f.dispose=()=>this._wrappedAddonDispose(m),f.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let f=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===c){f=m;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(f,1)}}},8771:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const f=c(3785),m=c(511);o.BufferApiView=class{constructor(d,_){this._buffer=d,this.type=_}init(d){return this._buffer=d,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(d){const _=this._buffer.lines.get(d);if(_)return new f.BufferLineApiView(_)}getNullCell(){return new m.CellData}}},3785:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const f=c(511);o.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,d){if(!(m<0||m>=this._line.length))return d?(this._line.loadCell(m,d),d):this._line.loadCell(m,new f.CellData)}translateToString(m,d,_){return this._line.translateToString(m,d,_)}}},8285:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const f=c(8771),m=c(8460),d=c(844);class _ extends d.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.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)}}o.BufferNamespaceApi=_},7975:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,f){return this._core.registerCsiHandler(c,m=>f(m.toArray()))}addCsiHandler(c,f){return this.registerCsiHandler(c,f)}registerDcsHandler(c,f){return this._core.registerDcsHandler(c,(m,d)=>f(m,d.toArray()))}addDcsHandler(c,f){return this.registerDcsHandler(c,f)}registerEscHandler(c,f){return this._core.registerEscHandler(c,f)}addEscHandler(c,f){return this.registerEscHandler(c,f)}registerOscHandler(c,f){return this._core.registerOscHandler(c,f)}addOscHandler(c,f){return this.registerOscHandler(c,f)}}},7090:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(g,o,c){var f=this&&this.__decorate||function(u,l,s,a){var v,C=arguments.length,x=C<3?l:a===null?a=Object.getOwnPropertyDescriptor(l,s):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(u,l,s,a);else for(var E=u.length-1;E>=0;E--)(v=u[E])&&(x=(C<3?v(x):C>3?v(l,s,x):v(l,s))||x);return C>3&&x&&Object.defineProperty(l,s,x),x},m=this&&this.__param||function(u,l){return function(s,a){l(s,a,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=c(8460),_=c(844),S=c(5295),w=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let p=o.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(u){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(u.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(u.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(u,this))}resize(u,l){this.cols=u,this.rows=l,this.buffers.resize(u,l),this._onResize.fire({cols:u,rows:l})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(u,l=!1){const s=this.buffer;let a;a=this._cachedBlankLine,a&&a.length===this.cols&&a.getFg(0)===u.fg&&a.getBg(0)===u.bg||(a=s.getBlankLine(u,l),this._cachedBlankLine=a),a.isWrapped=l;const v=s.ybase+s.scrollTop,C=s.ybase+s.scrollBottom;if(s.scrollTop===0){const x=s.lines.isFull;C===s.lines.length-1?x?s.lines.recycle().copyFrom(a):s.lines.push(a.clone()):s.lines.splice(C+1,0,a.clone()),x?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const x=C-v+1;s.lines.shiftElements(v+1,x-1,-1),s.lines.set(C,a.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(u,l,s){const a=this.buffer;if(u<0){if(a.ydisp===0)return;this.isUserScrolling=!0}else u+a.ydisp>=a.ybase&&(this.isUserScrolling=!1);const v=a.ydisp;a.ydisp=Math.max(Math.min(a.ydisp+u,a.ybase),0),v!==a.ydisp&&(l||this._onScroll.fire(a.ydisp))}};o.BufferService=p=f([m(0,w.IOptionsService)],p)},7994:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,f){this._charsets[c]=f,this.glevel===c&&(this.charset=f)}}},1753:function(g,o,c){var f=this&&this.__decorate||function(a,v,C,x){var E,y=arguments.length,b=y<3?v:x===null?x=Object.getOwnPropertyDescriptor(v,C):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(a,v,C,x);else for(var R=a.length-1;R>=0;R--)(E=a[R])&&(b=(y<3?E(b):y>3?E(v,C,b):E(v,C))||b);return y>3&&b&&Object.defineProperty(v,C,b),b},m=this&&this.__param||function(a,v){return function(C,x){v(C,x,a)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=c(2585),_=c(8460),S=c(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:a=>a.button!==4&&a.action===1&&(a.ctrl=!1,a.alt=!1,a.shift=!1,!0)},VT200:{events:19,restrict:a=>a.action!==32},DRAG:{events:23,restrict:a=>a.action!==32||a.button!==3},ANY:{events:31,restrict:a=>!0}};function p(a,v){let C=(a.ctrl?16:0)|(a.shift?4:0)|(a.alt?8:0);return a.button===4?(C|=64,C|=a.action):(C|=3&a.button,4&a.button&&(C|=64),8&a.button&&(C|=128),a.action===32?C|=32:a.action!==0||v||(C|=3)),C}const u=String.fromCharCode,l={DEFAULT:a=>{const v=[p(a,!1)+32,a.col+32,a.row+32];return v[0]>255||v[1]>255||v[2]>255?"":`\x1B[M${u(v[0])}${u(v[1])}${u(v[2])}`},SGR:a=>{const v=a.action===0&&a.button!==4?"m":"M";return`\x1B[<${p(a,!0)};${a.col};${a.row}${v}`},SGR_PIXELS:a=>{const v=a.action===0&&a.button!==4?"m":"M";return`\x1B[<${p(a,!0)};${a.x};${a.y}${v}`}};let s=o.CoreMouseService=class extends S.Disposable{constructor(a,v){super(),this._bufferService=a,this._coreService=v,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const C of Object.keys(w))this.addProtocol(C,w[C]);for(const C of Object.keys(l))this.addEncoding(C,l[C]);this.reset()}addProtocol(a,v){this._protocols[a]=v}addEncoding(a,v){this._encodings[a]=v}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(a){if(!this._protocols[a])throw new Error(`unknown protocol "${a}"`);this._activeProtocol=a,this._onProtocolChange.fire(this._protocols[a].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(a){if(!this._encodings[a])throw new Error(`unknown encoding "${a}"`);this._activeEncoding=a}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(a){if(a.col<0||a.col>=this._bufferService.cols||a.row<0||a.row>=this._bufferService.rows||a.button===4&&a.action===32||a.button===3&&a.action!==32||a.button!==4&&(a.action===2||a.action===3)||(a.col++,a.row++,a.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,a,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(a))return!1;const v=this._encodings[this._activeEncoding](a);return v&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(v):this._coreService.triggerDataEvent(v,!0)),this._lastEvent=a,!0}explainEvents(a){return{down:!!(1&a),up:!!(2&a),drag:!!(4&a),move:!!(8&a),wheel:!!(16&a)}}_equalEvents(a,v,C){if(C){if(a.x!==v.x||a.y!==v.y)return!1}else if(a.col!==v.col||a.row!==v.row)return!1;return a.button===v.button&&a.action===v.action&&a.ctrl===v.ctrl&&a.alt===v.alt&&a.shift===v.shift}};o.CoreMouseService=s=f([m(0,d.IBufferService),m(1,d.ICoreService)],s)},6975:function(g,o,c){var f=this&&this.__decorate||function(s,a,v,C){var x,E=arguments.length,y=E<3?a:C===null?C=Object.getOwnPropertyDescriptor(a,v):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,a,v,C);else for(var b=s.length-1;b>=0;b--)(x=s[b])&&(y=(E<3?x(y):E>3?x(a,v,y):x(a,v))||y);return E>3&&y&&Object.defineProperty(a,v,y),y},m=this&&this.__param||function(s,a){return function(v,C){a(v,C,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=c(1439),_=c(8460),S=c(844),w=c(2585),p=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let l=o.CoreService=class extends S.Disposable{constructor(s,a,v){super(),this._bufferService=s,this._logService=a,this._optionsService=v,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(p),this.decPrivateModes=(0,d.clone)(u)}reset(){this.modes=(0,d.clone)(p),this.decPrivateModes=(0,d.clone)(u)}triggerDataEvent(s,a=!1){if(this._optionsService.rawOptions.disableStdin)return;const v=this._bufferService.buffer;a&&this._optionsService.rawOptions.scrollOnUserInput&&v.ybase!==v.ydisp&&this._onRequestScrollToBottom.fire(),a&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,()=>s.split("").map(C=>C.charCodeAt(0))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,()=>s.split("").map(a=>a.charCodeAt(0))),this._onBinary.fire(s))}};o.CoreService=l=f([m(0,w.IBufferService),m(1,w.ILogService),m(2,w.IOptionsService)],l)},9074:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const f=c(8055),m=c(8460),d=c(844),_=c(6106);let S=0,w=0;class p extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList(s=>s==null?void 0:s.marker.line),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>this.reset()))}registerDecoration(s){if(s.marker.isDisposed)return;const a=new u(s);if(a){const v=a.marker.onDispose(()=>a.dispose());a.onDispose(()=>{a&&(this._decorations.delete(a)&&this._onDecorationRemoved.fire(a),v.dispose())}),this._decorations.insert(a),this._onDecorationRegistered.fire(a)}return a}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,a,v){let C=0,x=0;for(const E of this._decorations.getKeyIterator(a))C=E.options.x??0,x=C+(E.options.width??1),s>=C&&s<x&&(!v||(E.options.layer??"bottom")===v)&&(yield E)}forEachDecorationAtCell(s,a,v,C){this._decorations.forEachByKey(a,x=>{S=x.options.x??0,w=S+(x.options.width??1),s>=S&&s<w&&(!v||(x.options.layer??"bottom")===v)&&C(x)})}}o.DecorationService=p;class u extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const f=c(2585),m=c(8343);class d{constructor(...S){this._entries=new Map;for(const[w,p]of S)this.set(w,p)}set(S,w){const p=this._entries.get(S);return this._entries.set(S,w),p}forEach(S){for(const[w,p]of this._entries.entries())S(w,p)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(_,S){this._services.set(_,S)}getService(_){return this._services.get(_)}createInstance(_,...S){const w=(0,m.getServiceDependencies)(_).sort((l,s)=>l.index-s.index),p=[];for(const l of w){const s=this._services.get(l.id);if(!s)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${l.id}.`);p.push(s)}const u=w.length>0?w[0].index:S.length;if(S.length!==u)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${u+1} conflicts with ${S.length} static arguments`);return new _(...S,...p)}}},7866:function(g,o,c){var f=this&&this.__decorate||function(u,l,s,a){var v,C=arguments.length,x=C<3?l:a===null?a=Object.getOwnPropertyDescriptor(l,s):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(u,l,s,a);else for(var E=u.length-1;E>=0;E--)(v=u[E])&&(x=(C<3?v(x):C>3?v(l,s,x):v(l,s))||x);return C>3&&x&&Object.defineProperty(l,s,x),x},m=this&&this.__param||function(u,l){return function(s,a){l(s,a,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=c(844),_=c(2585),S={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let w,p=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(u){super(),this._optionsService=u,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),w=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(u){for(let l=0;l<u.length;l++)typeof u[l]=="function"&&(u[l]=u[l]())}_log(u,l,s){this._evalLazyOptionalParams(s),u.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+l,...s)}trace(u,...l){var s;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,u,l)}debug(u,...l){var s;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,u,l)}info(u,...l){var s;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,u,l)}warn(u,...l){var s;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,u,l)}error(u,...l){var s;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,u,l)}};o.LogService=p=f([m(0,_.IOptionsService)],p),o.setTraceLogger=function(u){w=u},o.traceCall=function(u,l,s){if(typeof s.value!="function")throw new Error("not supported");const a=s.value;s.value=function(...v){if(w.logLevel!==_.LogLevelEnum.TRACE)return a.apply(this,v);w.trace(`GlyphRenderer#${a.name}(${v.map(x=>JSON.stringify(x)).join(", ")})`);const C=a.apply(this,v);return w.trace(`GlyphRenderer#${a.name} return`,C),C}}},7302:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const f=c(8460),m=c(844),d=c(6114);o.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:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends m.Disposable{constructor(p){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const u={...o.DEFAULT_OPTIONS};for(const l in p)if(l in u)try{const s=p[l];u[l]=this._sanitizeAndValidateOption(l,s)}catch(s){console.error(s)}this.rawOptions=u,this.options={...u},this._setupOptions(),this.register((0,m.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(p,u){return this.onOptionChange(l=>{l===p&&u(this.rawOptions[p])})}onMultipleOptionChange(p,u){return this.onOptionChange(l=>{p.indexOf(l)!==-1&&u()})}_setupOptions(){const p=l=>{if(!(l in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);return this.rawOptions[l]},u=(l,s)=>{if(!(l in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);s=this._sanitizeAndValidateOption(l,s),this.rawOptions[l]!==s&&(this.rawOptions[l]=s,this._onOptionChange.fire(l))};for(const l in this.rawOptions){const s={get:p.bind(this,l),set:u.bind(this,l)};Object.defineProperty(this.options,l,s)}}_sanitizeAndValidateOption(p,u){switch(p){case"cursorStyle":if(u||(u=o.DEFAULT_OPTIONS[p]),!function(l){return l==="block"||l==="underline"||l==="bar"}(u))throw new Error(`"${u}" is not a valid value for ${p}`);break;case"wordSeparator":u||(u=o.DEFAULT_OPTIONS[p]);break;case"fontWeight":case"fontWeightBold":if(typeof u=="number"&&1<=u&&u<=1e3)break;u=_.includes(u)?u:o.DEFAULT_OPTIONS[p];break;case"cursorWidth":u=Math.floor(u);case"lineHeight":case"tabStopWidth":if(u<1)throw new Error(`${p} cannot be less than 1, value: ${u}`);break;case"minimumContrastRatio":u=Math.max(1,Math.min(21,Math.round(10*u)/10));break;case"scrollback":if((u=Math.min(u,4294967295))<0)throw new Error(`${p} cannot be less than 0, value: ${u}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(u<=0)throw new Error(`${p} cannot be less than or equal to 0, value: ${u}`);break;case"rows":case"cols":if(!u&&u!==0)throw new Error(`${p} must be numeric, value: ${u}`);break;case"windowsPty":u=u??{}}return u}}o.OptionsService=S},2660:function(g,o,c){var f=this&&this.__decorate||function(S,w,p,u){var l,s=arguments.length,a=s<3?w:u===null?u=Object.getOwnPropertyDescriptor(w,p):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(S,w,p,u);else for(var v=S.length-1;v>=0;v--)(l=S[v])&&(a=(s<3?l(a):s>3?l(w,p,a):l(w,p))||a);return s>3&&a&&Object.defineProperty(w,p,a),a},m=this&&this.__param||function(S,w){return function(p,u){w(p,u,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=c(2585);let _=o.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const w=this._bufferService.buffer;if(S.id===void 0){const v=w.addMarker(w.ybase+w.y),C={data:S,id:this._nextId++,lines:[v]};return v.onDispose(()=>this._removeMarkerFromLink(C,v)),this._dataByLinkId.set(C.id,C),C.id}const p=S,u=this._getEntryIdKey(p),l=this._entriesWithId.get(u);if(l)return this.addLineToLink(l.id,w.ybase+w.y),l.id;const s=w.addMarker(w.ybase+w.y),a={id:this._nextId++,key:this._getEntryIdKey(p),data:p,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(a,s)),this._entriesWithId.set(a.key,a),this._dataByLinkId.set(a.id,a),a.id}addLineToLink(S,w){const p=this._dataByLinkId.get(S);if(p&&p.lines.every(u=>u.line!==w)){const u=this._bufferService.buffer.addMarker(w);p.lines.push(u),u.onDispose(()=>this._removeMarkerFromLink(p,u))}}getLinkData(S){var w;return(w=this._dataByLinkId.get(S))==null?void 0:w.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,w){const p=S.lines.indexOf(w);p!==-1&&(S.lines.splice(p,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};o.OscLinkService=_=f([m(0,d.IBufferService)],_)},8343:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",f="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(m){return m[f]||[]},o.createDecorator=function(m){if(o.serviceRegistry.has(m))return o.serviceRegistry.get(m);const d=function(_,S,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(p,u,l){u[c]===u?u[f].push({id:p,index:l}):(u[f]=[{id:p,index:l}],u[c]=u)})(d,_,w)};return d.toString=()=>m,o.serviceRegistry.set(m,d),d}},2585:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const f=c(8343);var m;o.IBufferService=(0,f.createDecorator)("BufferService"),o.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),o.ICoreService=(0,f.createDecorator)("CoreService"),o.ICharsetService=(0,f.createDecorator)("CharsetService"),o.IInstantiationService=(0,f.createDecorator)("InstantiationService"),function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"}(m||(o.LogLevelEnum=m={})),o.ILogService=(0,f.createDecorator)("LogService"),o.IOptionsService=(0,f.createDecorator)("OptionsService"),o.IOscLinkService=(0,f.createDecorator)("OscLinkService"),o.IUnicodeService=(0,f.createDecorator)("UnicodeService"),o.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(g,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const f=c(8460),m=c(225);class d{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,w,p=!1){return(16777215&S)<<3|(3&w)<<1|(p?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const S=new m.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(S){if(!this._providers[S])throw new Error(`unknown Unicode version "${S}"`);this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)}register(S){this._providers[S.version]=S}wcwidth(S){return this._activeProvider.wcwidth(S)}getStringCellWidth(S){let w=0,p=0;const u=S.length;for(let l=0;l<u;++l){let s=S.charCodeAt(l);if(55296<=s&&s<=56319){if(++l>=u)return w+this.wcwidth(s);const C=S.charCodeAt(l);56320<=C&&C<=57343?s=1024*(s-55296)+C-56320+65536:w+=this.wcwidth(C)}const a=this.charProperties(s,p);let v=d.extractWidth(a);d.extractShouldJoin(a)&&(v-=d.extractWidth(p)),w+=v,p=a}return w}charProperties(S,w){return this._activeProvider.charProperties(S,w)}}o.UnicodeService=d}},i={};function n(g){var o=i[g];if(o!==void 0)return o.exports;var c=i[g]={exports:{}};return r[g].call(c.exports,c,c.exports,n),c.exports}var h={};return(()=>{var g=h;Object.defineProperty(g,"__esModule",{value:!0}),g.Terminal=void 0;const o=n(9042),c=n(3236),f=n(844),m=n(5741),d=n(8285),_=n(7975),S=n(7090),w=["cols","rows"];class p extends f.Disposable{constructor(l){super(),this._core=this.register(new c.Terminal(l)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const s=v=>this._core.options[v],a=(v,C)=>{this._checkReadonlyOptions(v),this._core.options[v]=C};for(const v in this._core.options){const C={get:s.bind(this,v),set:a.bind(this,v)};Object.defineProperty(this._publicOptions,v,C)}}_checkReadonlyOptions(l){if(w.includes(l))throw new Error(`Option "${l}" 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 _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new S.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 d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const l=this._core.coreService.decPrivateModes;let s="none";switch(this._core.coreMouseService.activeProtocol){case"X10":s="x10";break;case"VT200":s="vt200";break;case"DRAG":s="drag";break;case"ANY":s="any"}return{applicationCursorKeysMode:l.applicationCursorKeys,applicationKeypadMode:l.applicationKeypad,bracketedPasteMode:l.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:l.origin,reverseWraparoundMode:l.reverseWraparound,sendFocusMode:l.sendFocus,wraparoundMode:l.wraparound}}get options(){return this._publicOptions}set options(l){for(const s in l)this._publicOptions[s]=l[s]}blur(){this._core.blur()}focus(){this._core.focus()}input(l,s=!0){this._core.input(l,s)}resize(l,s){this._verifyIntegers(l,s),this._core.resize(l,s)}open(l){this._core.open(l)}attachCustomKeyEventHandler(l){this._core.attachCustomKeyEventHandler(l)}attachCustomWheelEventHandler(l){this._core.attachCustomWheelEventHandler(l)}registerLinkProvider(l){return this._core.registerLinkProvider(l)}registerCharacterJoiner(l){return this._checkProposedApi(),this._core.registerCharacterJoiner(l)}deregisterCharacterJoiner(l){this._checkProposedApi(),this._core.deregisterCharacterJoiner(l)}registerMarker(l=0){return this._verifyIntegers(l),this._core.registerMarker(l)}registerDecoration(l){return this._checkProposedApi(),this._verifyPositiveIntegers(l.x??0,l.width??0,l.height??0),this._core.registerDecoration(l)}hasSelection(){return this._core.hasSelection()}select(l,s,a){this._verifyIntegers(l,s,a),this._core.select(l,s,a)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(l,s){this._verifyIntegers(l,s),this._core.selectLines(l,s)}dispose(){super.dispose()}scrollLines(l){this._verifyIntegers(l),this._core.scrollLines(l)}scrollPages(l){this._verifyIntegers(l),this._core.scrollPages(l)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(l){this._verifyIntegers(l),this._core.scrollToLine(l)}clear(){this._core.clear()}write(l,s){this._core.write(l,s)}writeln(l,s){this._core.write(l),this._core.write(`\r
|
|
64
|
+
`,s)}paste(l){this._core.paste(l)}refresh(l,s){this._verifyIntegers(l,s),this._core.refresh(l,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(l){this._addonManager.loadAddon(this,l)}static get strings(){return o}_verifyIntegers(...l){for(const s of l)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...l){for(const s of l)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}g.Terminal=p})(),h})())})(xh);var K_=xh.exports,kh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.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 h=this._terminal._core;this._terminal.rows===n.rows&&this._terminal.cols===n.cols||(h._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,h=n._renderService.dimensions;if(h.css.cell.width===0||h.css.cell.height===0)return;const g=this._terminal.options.scrollback===0?0:n.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),f=Math.max(0,parseInt(o.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),d=c-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),_=f-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-g;return{cols:Math.max(2,Math.floor(_/h.css.cell.width)),rows:Math.max(1,Math.floor(d/h.css.cell.height))}}}})(),r})())})(kh);var ec=kh.exports,bh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(g,o)=>{function c(m){try{const d=new URL(m),_=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return m.toLocaleLowerCase().startsWith(_.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(m,d,_,S={}){this._terminal=m,this._regex=d,this._handler=_,this._options=S}provideLinks(m,d){const _=f.computeLink(m,this._regex,this._terminal,this._handler);d(this._addCallbacks(_))}_addCallbacks(m){return m.map(d=>(d.leave=this._options.leave,d.hover=(_,S)=>{if(this._options.hover){const{range:w}=d;this._options.hover(_,S,w)}},d))}};class f{static computeLink(d,_,S,w){const p=new RegExp(_.source,(_.flags||"")+"g"),[u,l]=f._getWindowedLineStrings(d-1,S),s=u.join("");let a;const v=[];for(;a=p.exec(s);){const C=a[0];if(!c(C))continue;const[x,E]=f._mapStrIdx(S,l,0,a.index),[y,b]=f._mapStrIdx(S,x,E,C.length);if(x===-1||E===-1||y===-1||b===-1)continue;const R={start:{x:E+1,y:x+1},end:{x:b,y:y+1}};v.push({range:R,text:C,activate:w})}return v}static _getWindowedLineStrings(d,_){let S,w=d,p=d,u=0,l="";const s=[];if(S=_.buffer.active.getLine(d)){const a=S.translateToString(!0);if(S.isWrapped&&a[0]!==" "){for(u=0;(S=_.buffer.active.getLine(--w))&&u<2048&&(l=S.translateToString(!0),u+=l.length,s.push(l),S.isWrapped&&l.indexOf(" ")===-1););s.reverse()}for(s.push(a),u=0;(S=_.buffer.active.getLine(++p))&&S.isWrapped&&u<2048&&(l=S.translateToString(!0),u+=l.length,s.push(l),l.indexOf(" ")===-1););}return[s,w]}static _mapStrIdx(d,_,S,w){const p=d.buffer.active,u=p.getNullCell();let l=S;for(;w;){const s=p.getLine(_);if(!s)return[-1,-1];for(let a=l;a<s.length;++a){s.getCell(a,u);const v=u.getChars();if(u.getWidth()&&(w-=v.length||1,a===s.length-1&&v==="")){const C=p.getLine(_+1);C&&C.isWrapped&&(C.getCell(0,u),u.getWidth()===2&&(w+=1))}if(w<0)return[_,a]}_++,l=0}return[_,l]}}o.LinkComputer=f}},i={};function n(g){var o=i[g];if(o!==void 0)return o.exports;var c=i[g]={exports:{}};return r[g](c,c.exports,n),c.exports}var h={};return(()=>{var g=h;Object.defineProperty(g,"__esModule",{value:!0}),g.WebLinksAddon=void 0;const o=n(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(m,d){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}g.WebLinksAddon=class{constructor(m=f,d={}){this._handler=m,this._options=d}activate(m){this._terminal=m;const d=this._options,_=d.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,_,this._handler,d))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),h})())})(bh);var V_=bh.exports;const jo=new Set,Ho=new Map,Fo=new Map;function q_(e,t){Fo.set(e,t)}function G_(e){const t=Fo.get(e);return t!==void 0?(Fo.delete(e),t):null}function X_({terminalId:e,projectId:t,cwd:r}){const i=J.useRef(null),n=J.useRef(null),h=J.useRef(null),g=J.useRef(null),o=Le(_=>_.setTerminalInstance),c=Le(_=>_.createSession),f=ae(_=>_.setFocusedTerminal);J.useEffect(()=>{const _=i.current;if(!_)return;_.innerHTML="";const S=Le.getState().sessions[e],w=Ho.get(e);if(S!=null&&S.terminal&&w){const s=S.terminal;n.current=s,_.appendChild(w);const a=new ec.FitAddon;return s.loadAddon(a),h.current=a,requestAnimationFrame(()=>{try{a.fit();const{cols:v,rows:C}=s;g.current={cols:v,rows:C},Ke({type:"pty:resize",terminalId:e,cols:v,rows:C})}catch{}}),()=>{}}const p=new K_.Terminal({theme:z_,fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', 'Menlo', monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"block",allowProposedApi:!0,scrollback:1e4}),u=new ec.FitAddon,l=new V_.WebLinksAddon;return p.loadAddon(u),p.loadAddon(l),p.open(_),n.current=p,h.current=u,p.element&&Ho.set(e,p.element),c(e,t),o(e,p),p.attachCustomKeyEventHandler(s=>s.key==="Enter"&&s.shiftKey?(s.type==="keydown"&&Ke({type:"pty:input",terminalId:e,data:`
|
|
65
|
+
`}),!1):!0),p.onData(s=>{Ke({type:"pty:input",terminalId:e,data:s})}),p.onTitleChange(s=>{Le.getState().setTitle(e,s)}),jo.has(e)||(jo.add(e),requestAnimationFrame(()=>{try{u.fit()}catch{}Ke({type:"pty:spawn",terminalId:e,projectId:t,cwd:r}),Ke({type:"pty:resize",terminalId:e,cols:p.cols,rows:p.rows}),g.current={cols:p.cols,rows:p.rows},p.focus(),f(e)})),()=>{}},[e,t,r,c,o]);const m=J.useCallback(()=>{const _=h.current,S=n.current;if(!(!_||!S))try{_.fit();const{cols:w,rows:p}=S,u=g.current;(!u||u.cols!==w||u.rows!==p)&&(g.current={cols:w,rows:p},Ke({type:"pty:resize",terminalId:e,cols:w,rows:p}))}catch{}},[e]),d=J.useCallback(()=>{var _;(_=n.current)==null||_.focus(),f(e)},[e,f]);return{containerRef:i,fit:m,focus:d,terminalRef:n}}function nn(e){jo.delete(e),Ho.delete(e)}let Je=null;function Q_(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Ke(e){(Je==null?void 0:Je.readyState)===WebSocket.OPEN&&Je.send(JSON.stringify(e))}function Y_(){const e=ae(h=>h.setConnectionStatus),t=ye(h=>h.addProject),r=ye(h=>h.setActiveProject),i=J.useRef(),n=J.useCallback(()=>{if((Je==null?void 0:Je.readyState)===WebSocket.OPEN||(Je==null?void 0:Je.readyState)===WebSocket.CONNECTING)return;e("connecting");const h=new WebSocket(Q_());Je=h,h.onopen=()=>{e("connected")},h.onmessage=g=>{var o,c,f;try{const m=JSON.parse(g.data);if(m.type==="pty:output"){const d=Le.getState().sessions[m.terminalId];(o=d==null?void 0:d.terminal)==null||o.write(m.data);const _=G_(m.terminalId);_&&Ke({type:"pty:input",terminalId:m.terminalId,data:_});return}if(m.type==="pty:exit"){const d=m.terminalId,_=Le.getState().sessions[d],S=_==null?void 0:_.projectId;if((c=_==null?void 0:_.terminal)==null||c.dispose(),Le.getState().removeSession(d),nn(d),S){ie.getState().removePaneFromProject(S,d),ye.getState().removeTerminalFromProject(S,d);const w=Se(ie.getState().getLayout(S)),p=ae.getState().focusedTerminalId;if(p===d&&w.length>0){const u=w[0];ae.getState().setFocusedTerminal(u);const l=Le.getState().sessions[u];(f=l==null?void 0:l.terminal)==null||f.focus()}else p===d&&ae.getState().setFocusedTerminal(null)}return}m.type==="project:spawned"&&(t({id:m.projectId,name:m.name,cwd:m.cwd,terminalIds:[]}),r(m.projectId))}catch{}},h.onclose=()=>{e("disconnected"),Je=null,i.current=setTimeout(n,2e3)},h.onerror=()=>{h.close()}},[e,t,r]);J.useEffect(()=>(n(),()=>{clearTimeout(i.current)}),[n])}const J_=new Set(["n","w","t","d"]);function Z_(){const e=ae(r=>r.toggleSidebar),t=ae(r=>r.setFocusedTerminal);J.useEffect(()=>{const r=i=>{var d,_,S;const n=i.key.toLowerCase();if(i.altKey&&!i.metaKey&&!i.ctrlKey&&["arrowleft","arrowright","arrowup","arrowdown"].includes(n)){i.preventDefault(),i.stopPropagation();const w=ye.getState().activeProjectId;if(!w)return;const p=ie.getState().getLayout(w),u=ae.getState().focusedTerminalId;if(!u||!p)return;const s=jn(p,u,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");s&&ie.getState().swapPanesInProject(w,u,s);return}if(!(i.metaKey||i.ctrlKey))return;(J_.has(n)||n>="1"&&n<="9"||["arrowleft","arrowright","arrowup","arrowdown"].includes(n))&&(i.preventDefault(),i.stopPropagation());const g=ye.getState().activeProjectId;if(!g)return;const o=ie.getState().getLayout(g),c=ae.getState().focusedTerminalId,f=ye.getState().projects[g];if(n==="d"&&!i.shiftKey){e();return}if(n==="n"){if(!f)return;const w=crypto.randomUUID(),p=Se(o);if(p.length>0){const u=c??p[p.length-1],l=i.shiftKey?"horizontal":"vertical";ie.getState().addPaneToProject(g,u,w,l)}else ie.getState().setLayout(g,{type:"leaf",terminalId:w});ye.getState().addTerminalToProject(g,w),t(w);return}if(n==="w"&&!i.shiftKey){if(!c||!o)return;Ke({type:"pty:kill",terminalId:c}),ie.getState().removePaneFromProject(g,c),ye.getState().removeTerminalFromProject(g,c);const w=Le.getState().sessions[c];(d=w==null?void 0:w.terminal)==null||d.dispose(),Le.getState().removeSession(c),nn(c);const p=Se(ie.getState().getLayout(g));t(p[0]??null);return}if(n==="t"&&!i.shiftKey){if(!f)return;const w=Se(o);w.length>0&&ie.getState().cyclePreset(g,w);return}if(["arrowleft","arrowright","arrowup","arrowdown"].includes(n)&&!i.shiftKey){if(!c||!o)return;const p=jn(o,c,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");if(p){t(p);const u=Le.getState().sessions[p];(_=u==null?void 0:u.terminal)==null||_.focus()}return}if(["arrowleft","arrowright","arrowup","arrowdown"].includes(n)&&i.shiftKey){if(!c||!o)return;const p=jn(o,c,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");p&&ie.getState().swapPanesInProject(g,c,p);return}const m=parseInt(n);if(m>=1&&m<=9){const p=Se(o)[m-1];if(p){t(p);const u=Le.getState().sessions[p];(S=u==null?void 0:u.terminal)==null||S.focus()}return}};return window.addEventListener("keydown",r,{capture:!0}),()=>window.removeEventListener("keydown",r,{capture:!0})},[e,t])}/**
|
|
66
|
+
* @license lucide-react v0.400.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const ep=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Lh=(...e)=>e.filter((t,r,i)=>!!t&&i.indexOf(t)===r).join(" ");/**
|
|
71
|
+
* @license lucide-react v0.400.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/var tp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
76
|
+
* @license lucide-react v0.400.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const rp=J.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:n="",children:h,iconNode:g,...o},c)=>J.createElement("svg",{ref:c,...tp,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:Lh("lucide",n),...o},[...g.map(([f,m])=>J.createElement(f,m)),...Array.isArray(h)?h:[h]]));/**
|
|
81
|
+
* @license lucide-react v0.400.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const ge=(e,t)=>{const r=J.forwardRef(({className:i,...n},h)=>J.createElement(rp,{ref:h,iconNode:t,className:Lh(`lucide-${ep(e)}`,i),...n}));return r.displayName=`${e}`,r};/**
|
|
86
|
+
* @license lucide-react v0.400.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const ip=ge("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
91
|
+
* @license lucide-react v0.400.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const sp=ge("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
96
|
+
* @license lucide-react v0.400.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const np=ge("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
101
|
+
* @license lucide-react v0.400.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const Il=ge("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/**
|
|
106
|
+
* @license lucide-react v0.400.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const op=ge("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
111
|
+
* @license lucide-react v0.400.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const Dh=ge("Grid2x2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/**
|
|
116
|
+
* @license lucide-react v0.400.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const lp=ge("GripHorizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]);/**
|
|
121
|
+
* @license lucide-react v0.400.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const ap=ge("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
|
|
126
|
+
* @license lucide-react v0.400.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const cp=ge("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
131
|
+
* @license lucide-react v0.400.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const up=ge("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
|
|
136
|
+
* @license lucide-react v0.400.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const hp=ge("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
|
|
141
|
+
* @license lucide-react v0.400.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const Rh=ge("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
146
|
+
* @license lucide-react v0.400.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const Ph=ge("PanelTop",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]]);/**
|
|
151
|
+
* @license lucide-react v0.400.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const dp=ge("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
156
|
+
* @license lucide-react v0.400.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const fp=ge("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
161
|
+
* @license lucide-react v0.400.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const Nl=ge("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
166
|
+
* @license lucide-react v0.400.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const jl=ge("Rows2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]]);/**
|
|
171
|
+
* @license lucide-react v0.400.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const Th=ge("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
|
|
176
|
+
* @license lucide-react v0.400.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const Hl=ge("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
181
|
+
* @license lucide-react v0.400.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const Fl=ge("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
186
|
+
* @license lucide-react v0.400.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const _p=ge("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
191
|
+
* @license lucide-react v0.400.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const on=ge("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ii=Ni()(Ch(e=>({favourites:{},addFavourite:t=>e(r=>({favourites:{...r.favourites,[t.id]:t}})),updateFavourite:(t,r)=>e(i=>{const n=i.favourites[t];return n?{favourites:{...i.favourites,[t]:{...n,...r}}}:i}),removeFavourite:t=>e(r=>{const{[t]:i,...n}=r.favourites;return{favourites:n}})}),{name:"paneful-favourites",partialize:e=>({favourites:e.favourites})}));function tc(e){const t=ie.getState().getLayout(e);Se(t).forEach(i=>{var h;const n=Le.getState().sessions[i];(h=n==null?void 0:n.terminal)==null||h.dispose(),Le.getState().removeSession(i),nn(i)}),Ke({type:"project:kill",projectId:e}),ie.getState().setLayout(e,null),ye.getState().clearProjectTerminals(e)}function pp({project:e,isActive:t,onClick:r,onKill:i,onRemove:n}){const h=e.terminalIds.length;return B.jsxs("div",{onClick:r,className:`
|
|
196
|
+
group flex items-center gap-2 px-3 py-2 mx-2 rounded-lg cursor-pointer
|
|
197
|
+
transition-colors duration-100
|
|
198
|
+
${t?"bg-accent/10 text-[var(--text-primary)]":"text-[var(--text-secondary)] hover:bg-[var(--surface-2)] hover:text-[var(--text-primary)]"}
|
|
199
|
+
`,children:[B.jsx(op,{size:14,className:t?"text-accent":"text-[var(--text-muted)]"}),B.jsxs("div",{className:"flex-1 min-w-0",children:[B.jsx("div",{className:"text-xs font-medium truncate",children:e.name}),B.jsx("div",{className:"text-[10px] text-[var(--text-muted)] truncate font-mono",children:e.cwd})]}),h>0&&B.jsxs("span",{className:"text-[10px] tabular-nums px-1.5 py-0.5 rounded-full bg-[var(--surface-3)] text-[var(--text-muted)] flex items-center gap-0.5",children:[B.jsx(Hl,{size:8}),h]}),B.jsxs("div",{className:"hidden group-hover:flex items-center gap-0.5",children:[h>0&&B.jsx("button",{onClick:g=>{g.stopPropagation(),i()},title:"Kill all terminals",className:"p-0.5 rounded text-[var(--text-muted)] hover:text-[var(--danger)] hover:bg-[var(--danger-dim)] transition-colors",children:B.jsx(np,{size:12})}),B.jsx("button",{onClick:g=>{g.stopPropagation(),n()},title:"Remove project",className:"p-0.5 rounded text-[var(--text-muted)] hover:text-[var(--danger)] hover:bg-[var(--danger-dim)] transition-colors",children:B.jsx(Fl,{size:12})})]})]})}function vp({open:e,onClose:t,onCreate:r}){const[i,n]=J.useState(""),[h,g]=J.useState("~"),o=J.useRef(null);if(J.useEffect(()=>{e&&(n(""),g("~"),setTimeout(()=>{var f;return(f=o.current)==null?void 0:f.focus()},50))},[e]),!e)return null;const c=f=>{f.preventDefault(),i.trim()&&(h.replace(/^~/,"$HOME"),r(i.trim(),h.trim()||"~"),t())};return B.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:B.jsxs("div",{className:"bg-[var(--surface-1)] border border-[var(--border)] rounded-xl w-[400px] shadow-2xl animate-fade-in",onClick:f=>f.stopPropagation(),children:[B.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[B.jsx("h3",{className:"text-sm font-medium text-[var(--text-primary)]",children:"New Project"}),B.jsx("button",{onClick:t,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",children:B.jsx(on,{size:14})})]}),B.jsxs("form",{onSubmit:c,className:"p-4 space-y-4",children:[B.jsxs("div",{children:[B.jsx("label",{className:"block text-xs text-[var(--text-secondary)] mb-1.5",children:"Project Name"}),B.jsx("input",{ref:o,value:i,onChange:f=>n(f.target.value),placeholder:"my-project",className:`
|
|
200
|
+
w-full px-3 py-2 text-sm
|
|
201
|
+
bg-[var(--surface-0)] border border-[var(--border)]
|
|
202
|
+
text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
|
|
203
|
+
rounded-lg outline-none
|
|
204
|
+
focus:border-accent focus:ring-1 focus:ring-accent/30
|
|
205
|
+
transition-colors
|
|
206
|
+
`})]}),B.jsxs("div",{children:[B.jsx("label",{className:"block text-xs text-[var(--text-secondary)] mb-1.5",children:"Working Directory"}),B.jsx("input",{value:h,onChange:f=>g(f.target.value),placeholder:"/path/to/project",className:`
|
|
207
|
+
w-full px-3 py-2 text-sm font-mono
|
|
208
|
+
bg-[var(--surface-0)] border border-[var(--border)]
|
|
209
|
+
text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
|
|
210
|
+
rounded-lg outline-none
|
|
211
|
+
focus:border-accent focus:ring-1 focus:ring-accent/30
|
|
212
|
+
transition-colors
|
|
213
|
+
`})]}),B.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[B.jsx("button",{type:"button",onClick:t,className:`
|
|
214
|
+
px-3 py-1.5 text-xs text-[var(--text-secondary)]
|
|
215
|
+
hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)]
|
|
216
|
+
rounded-lg transition-colors
|
|
217
|
+
`,children:"Cancel"}),B.jsx("button",{type:"submit",disabled:!i.trim(),className:`
|
|
218
|
+
px-3 py-1.5 text-xs font-medium
|
|
219
|
+
bg-accent hover:bg-accent/80
|
|
220
|
+
disabled:opacity-40 disabled:cursor-not-allowed
|
|
221
|
+
text-white rounded-lg transition-colors
|
|
222
|
+
`,children:"Create"})]})]})]})})}const gp={"even-horizontal":"Rows","even-vertical":"Columns","main-left":"Main + Stack","main-top":"Main + Row",grid:"Grid"};function mp({favourite:e,onLaunch:t,onEdit:r,onDelete:i}){const n=`${gp[e.preset]??e.preset}, ${e.slots.length} terminal${e.slots.length!==1?"s":""}`;return B.jsxs("div",{className:`
|
|
223
|
+
group flex items-center gap-2 px-3 py-2 mx-2 rounded-lg cursor-pointer
|
|
224
|
+
text-[var(--text-secondary)] hover:bg-[var(--surface-2)] hover:text-[var(--text-primary)]
|
|
225
|
+
transition-colors duration-100
|
|
226
|
+
`,onClick:t,children:[B.jsx(Th,{size:14,className:"text-[var(--text-muted)] flex-shrink-0"}),B.jsxs("div",{className:"flex-1 min-w-0",children:[B.jsx("div",{className:"text-xs font-medium truncate",children:e.name}),B.jsxs("div",{className:"text-[10px] text-[var(--text-muted)] truncate flex items-center gap-0.5",children:[B.jsx(Hl,{size:8}),n]})]}),B.jsxs("div",{className:"hidden group-hover:flex items-center gap-0.5",children:[B.jsx("button",{onClick:h=>{h.stopPropagation(),t()},title:"Launch",className:"p-0.5 rounded text-[var(--text-muted)] hover:text-[var(--success)] hover:bg-green-500/10 transition-colors",children:B.jsx(fp,{size:12})}),B.jsx("button",{onClick:h=>{h.stopPropagation(),r()},title:"Edit",className:"p-0.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",children:B.jsx(dp,{size:12})}),B.jsx("button",{onClick:h=>{h.stopPropagation(),i()},title:"Delete",className:"p-0.5 rounded text-[var(--text-muted)] hover:text-[var(--danger)] hover:bg-[var(--danger-dim)] transition-colors",children:B.jsx(Fl,{size:12})})]})]})}function Sp({favourites:e,onLaunch:t,onEdit:r,onDelete:i}){const[n,h]=J.useState(!1);return e.length===0?null:B.jsxs("div",{children:[B.jsxs("button",{onClick:()=>h(!n),className:`
|
|
227
|
+
flex items-center gap-1 w-full px-4 py-1.5
|
|
228
|
+
text-[10px] font-semibold uppercase tracking-wider
|
|
229
|
+
text-[var(--text-muted)] hover:text-[var(--text-secondary)]
|
|
230
|
+
transition-colors
|
|
231
|
+
`,children:[n?B.jsx(sp,{size:10}):B.jsx(ip,{size:10}),"Favourites"]}),!n&&B.jsx("div",{children:e.map(g=>B.jsx(mp,{favourite:g,onLaunch:()=>t(g),onEdit:()=>r(g),onDelete:()=>i(g.id)},g.id))})]})}const yp={"even-horizontal":B.jsx(jl,{size:16}),"even-vertical":B.jsx(Il,{size:16}),"main-left":B.jsx(Rh,{size:16}),"main-top":B.jsx(Ph,{size:16}),grid:B.jsx(Dh,{size:16})},rc={"even-horizontal":"Rows","even-vertical":"Columns","main-left":"Main + Stack","main-top":"Main + Row",grid:"Grid"};function Ah({open:e,onClose:t,onSave:r,editingFavourite:i,defaultPreset:n,defaultSlotCount:h}){const[g,o]=J.useState(""),[c,f]=J.useState("even-horizontal"),[m,d]=J.useState([{label:"",command:""}]),_=J.useRef(null);if(J.useEffect(()=>{if(e){if(i)o(i.name),f(i.preset),d(i.slots.map(l=>({...l})));else{o(""),f(n??"even-horizontal");const l=h??1;d(Array.from({length:l},()=>({label:"",command:""})))}setTimeout(()=>{var l;return(l=_.current)==null?void 0:l.focus()},50)}},[e,i,n,h]),!e)return null;const S=l=>{l.preventDefault(),!(!g.trim()||m.length===0)&&(r(g.trim(),c,m),t())},w=()=>{d([...m,{label:"",command:""}])},p=l=>{m.length<=1||d(m.filter((s,a)=>a!==l))},u=(l,s,a)=>{d(m.map((v,C)=>C===l?{...v,[s]:a}:v))};return B.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:B.jsxs("div",{className:"bg-[var(--surface-1)] border border-[var(--border)] rounded-xl w-[440px] shadow-2xl animate-fade-in max-h-[80vh] flex flex-col",onClick:l=>l.stopPropagation(),children:[B.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[B.jsx("h3",{className:"text-sm font-medium text-[var(--text-primary)]",children:i?"Edit Favourite":"Save Favourite"}),B.jsx("button",{onClick:t,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",children:B.jsx(on,{size:14})})]}),B.jsxs("form",{onSubmit:S,className:"p-4 space-y-4 overflow-y-auto",children:[B.jsxs("div",{children:[B.jsx("label",{className:"block text-xs text-[var(--text-secondary)] mb-1.5",children:"Name"}),B.jsx("input",{ref:_,value:g,onChange:l=>o(l.target.value),placeholder:"My Workspace",className:`
|
|
232
|
+
w-full px-3 py-2 text-sm
|
|
233
|
+
bg-[var(--surface-0)] border border-[var(--border)]
|
|
234
|
+
text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
|
|
235
|
+
rounded-lg outline-none
|
|
236
|
+
focus:border-accent focus:ring-1 focus:ring-accent/30
|
|
237
|
+
transition-colors
|
|
238
|
+
`})]}),B.jsxs("div",{children:[B.jsx("label",{className:"block text-xs text-[var(--text-secondary)] mb-1.5",children:"Layout"}),B.jsx("div",{className:"flex gap-1",children:fi.map(l=>B.jsxs("button",{type:"button",onClick:()=>f(l),className:`
|
|
239
|
+
flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs transition-colors
|
|
240
|
+
${c===l?"bg-accent/15 text-accent border border-accent/30":"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] border border-transparent"}
|
|
241
|
+
`,title:rc[l],children:[yp[l],B.jsx("span",{className:"hidden sm:inline",children:rc[l]})]},l))})]}),B.jsxs("div",{children:[B.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[B.jsx("label",{className:"text-xs text-[var(--text-secondary)]",children:"Terminal Slots"}),B.jsxs("button",{type:"button",onClick:w,className:"flex items-center gap-0.5 text-[10px] text-accent hover:text-accent/80 transition-colors",children:[B.jsx(Nl,{size:10}),"Add"]})]}),B.jsx("div",{className:"space-y-2",children:m.map((l,s)=>B.jsxs("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-[var(--surface-0)] border border-[var(--border)]",children:[B.jsxs("div",{className:"flex-1 space-y-1.5",children:[B.jsx("input",{value:l.label,onChange:a=>u(s,"label",a.target.value),placeholder:`Terminal ${s+1}`,className:`
|
|
242
|
+
w-full px-2 py-1 text-xs
|
|
243
|
+
bg-transparent border border-[var(--border)]
|
|
244
|
+
text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
|
|
245
|
+
rounded outline-none
|
|
246
|
+
focus:border-accent focus:ring-1 focus:ring-accent/30
|
|
247
|
+
transition-colors
|
|
248
|
+
`}),B.jsx("input",{value:l.command,onChange:a=>u(s,"command",a.target.value),placeholder:"Command (optional)",className:`
|
|
249
|
+
w-full px-2 py-1 text-xs font-mono
|
|
250
|
+
bg-transparent border border-[var(--border)]
|
|
251
|
+
text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
|
|
252
|
+
rounded outline-none
|
|
253
|
+
focus:border-accent focus:ring-1 focus:ring-accent/30
|
|
254
|
+
transition-colors
|
|
255
|
+
`})]}),m.length>1&&B.jsx("button",{type:"button",onClick:()=>p(s),className:"p-1 mt-0.5 rounded text-[var(--text-muted)] hover:text-[var(--danger)] hover:bg-[var(--danger-dim)] transition-colors",children:B.jsx(Fl,{size:12})})]},s))})]}),B.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[B.jsx("button",{type:"button",onClick:t,className:`
|
|
256
|
+
px-3 py-1.5 text-xs text-[var(--text-secondary)]
|
|
257
|
+
hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)]
|
|
258
|
+
rounded-lg transition-colors
|
|
259
|
+
`,children:"Cancel"}),B.jsx("button",{type:"submit",disabled:!g.trim()||m.length===0,className:`
|
|
260
|
+
px-3 py-1.5 text-xs font-medium
|
|
261
|
+
bg-accent hover:bg-accent/80
|
|
262
|
+
disabled:opacity-40 disabled:cursor-not-allowed
|
|
263
|
+
text-white rounded-lg transition-colors
|
|
264
|
+
`,children:i?"Update":"Save"})]})]})]})})}function wp({open:e,onClose:t,onConfirm:r,terminalCount:i,favouriteName:n}){return e?B.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:B.jsxs("div",{className:"bg-[var(--surface-1)] border border-[var(--border)] rounded-xl w-[380px] shadow-2xl animate-fade-in",onClick:h=>h.stopPropagation(),children:[B.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[B.jsx("h3",{className:"text-sm font-medium text-[var(--text-primary)]",children:"Launch Favourite"}),B.jsx("button",{onClick:t,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",children:B.jsx(on,{size:14})})]}),B.jsxs("div",{className:"p-4 space-y-4",children:[B.jsxs("div",{className:"flex items-start gap-3",children:[B.jsx("div",{className:"p-2 rounded-lg bg-yellow-500/10",children:B.jsx(_p,{size:16,className:"text-yellow-500"})}),B.jsxs("div",{className:"text-sm text-[var(--text-secondary)]",children:["Launching ",B.jsx("span",{className:"font-medium text-[var(--text-primary)]",children:n})," will close ",i," existing terminal",i!==1?"s":"",". Continue?"]})]}),B.jsxs("div",{className:"flex justify-end gap-2",children:[B.jsx("button",{onClick:t,className:`
|
|
265
|
+
px-3 py-1.5 text-xs text-[var(--text-secondary)]
|
|
266
|
+
hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)]
|
|
267
|
+
rounded-lg transition-colors
|
|
268
|
+
`,children:"Cancel"}),B.jsx("button",{onClick:()=>{r(),t()},className:`
|
|
269
|
+
px-3 py-1.5 text-xs font-medium
|
|
270
|
+
bg-accent hover:bg-accent/80
|
|
271
|
+
text-white rounded-lg transition-colors
|
|
272
|
+
`,children:"Launch"})]})]})]})}):null}function Cp(){const[e,t]=J.useState(!1),[r,i]=J.useState(!1),[n,h]=J.useState(!1),[g,o]=J.useState(null),[c,f]=J.useState(null),m=ye(H=>H.projects),d=ye(H=>H.activeProjectId),_=ye(H=>H.setActiveProject),S=ye(H=>H.addProject),w=ye(H=>H.removeProject),p=ye(H=>H.addTerminalToProject),u=ae(H=>H.sidebarOpen),l=ae(H=>H.toggleSidebar),s=ae(H=>H.connectionStatus),a=ii(H=>H.favourites);ii(H=>H.addFavourite);const v=ii(H=>H.updateFavourite),C=ii(H=>H.removeFavourite),x=(H,N)=>{const k=crypto.randomUUID();S({id:k,name:H,cwd:N,terminalIds:[]}),Ke({type:"project:create",projectId:k,name:H,cwd:N}),_(k)},E=H=>{tc(H)},y=H=>{E(H),Ke({type:"project:remove",projectId:H}),ie.getState().removeProjectLayout(H),w(H)},b=H=>{if(!d||!m[d])return;tc(d);const k=H.slots.map(()=>crypto.randomUUID());H.slots.forEach((T,M)=>{T.command.trim()&&q_(k[M],T.command+`
|
|
273
|
+
`)});const D=Fs(k,H.preset);ie.getState().setLayout(d,D),k.forEach(T=>{p(d,T)}),k.length>0&&ae.getState().setFocusedTerminal(k[0])},R=H=>{if(!d)return;const N=ie.getState().getLayout(d);Se(N).length>0?(f(H),h(!0)):b(H)},A=H=>{o(H),i(!0)},O=(H,N,k)=>{g&&v(g.id,{name:H,preset:N,slots:k}),o(null)};if(!u)return null;const P=Object.values(m),j=Object.values(a),K=(d?m[d]:null)?Se(ie.getState().getLayout(d)).length:0;return B.jsxs("div",{className:"w-56 flex-shrink-0 bg-[var(--surface-1)] border-r border-[var(--border)] flex flex-col h-full",children:[B.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[B.jsxs("div",{className:"flex items-center gap-2",children:[B.jsx("span",{className:"text-sm font-semibold tracking-tight text-[var(--text-primary)]",children:"Paneful"}),B.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${s==="connected"?"bg-[var(--success)]":s==="connecting"?"bg-yellow-500 animate-pulse":"bg-[var(--danger)]"}`,title:s})]}),B.jsx("button",{onClick:l,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Hide sidebar",children:B.jsx(up,{size:14})})]}),B.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:P.length===0&&j.length===0?B.jsx("div",{className:"px-4 py-8 text-center",children:B.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"No projects yet"})}):B.jsxs(B.Fragment,{children:[P.map(H=>B.jsx(pp,{project:H,isActive:H.id===d,onClick:()=>_(H.id),onKill:()=>E(H.id),onRemove:()=>y(H.id)},H.id)),B.jsx(Sp,{favourites:j,onLaunch:R,onEdit:A,onDelete:C})]})}),B.jsx("div",{className:"p-2 border-t border-[var(--border)]",children:B.jsxs("button",{onClick:()=>t(!0),className:`
|
|
274
|
+
w-full flex items-center justify-center gap-1.5
|
|
275
|
+
px-3 py-2 text-xs
|
|
276
|
+
text-[var(--text-secondary)] hover:text-[var(--text-primary)]
|
|
277
|
+
bg-[var(--surface-2)] hover:bg-[var(--surface-3)]
|
|
278
|
+
rounded-lg transition-colors
|
|
279
|
+
`,children:[B.jsx(Nl,{size:14}),"New Project"]})}),B.jsx(vp,{open:e,onClose:()=>t(!1),onCreate:x}),B.jsx(Ah,{open:r,onClose:()=>{i(!1),o(null)},onSave:O,editingFavourite:g}),B.jsx(wp,{open:n,onClose:()=>{h(!1),f(null)},onConfirm:()=>{c&&b(c)},terminalCount:K,favouriteName:(c==null?void 0:c.name)??""})]})}const xp={"even-horizontal":B.jsx(jl,{size:14}),"even-vertical":B.jsx(Il,{size:14}),"main-left":B.jsx(Rh,{size:14}),"main-top":B.jsx(Ph,{size:14}),grid:B.jsx(Dh,{size:14})},Ep={"even-horizontal":"Rows","even-vertical":"Columns","main-left":"Main + Stack","main-top":"Main + Row",grid:"Grid"};function kp({onNewPane:e}){const[t,r]=J.useState(!1),i=ae(w=>w.sidebarOpen),n=ae(w=>w.toggleSidebar),h=ye(w=>w.activeProjectId),g=ie(w=>w.currentPresetIndex),o=ie(w=>w.cyclePreset),c=ii(w=>w.addFavourite),f=()=>{if(!h)return;const w=ie.getState().getLayout(h),p=Se(w);p.length>0&&o(h,p)},m=()=>{if(!h)return;const w=ie.getState().getLayout(h),p=Se(w);if(p.length===0)return;let u;p.length<=2?u="even-vertical":p.length===3?u="main-left":u="grid";const l=Fs(p,u);l&&ie.getState().setLayout(h,l)},d=(w,p,u)=>{c({id:crypto.randomUUID(),name:w,preset:p,slots:u})},_=fi[g],S=h?Se(ie.getState().getLayout(h)).length:0;return B.jsxs("div",{className:"h-9 flex-shrink-0 flex items-center px-2 gap-1 bg-[var(--surface-1)] border-b border-[var(--border)]",children:[!i&&B.jsx("button",{onClick:n,className:"p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Show sidebar (Cmd+D)",children:B.jsx(hp,{size:14})}),B.jsx("div",{className:"w-px h-4 bg-[var(--border)] mx-1"}),B.jsx("button",{onClick:()=>e("vertical"),className:"p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Split vertical (Cmd+N)",children:B.jsx(Il,{size:14})}),B.jsx("button",{onClick:()=>e("horizontal"),className:"p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Split horizontal (Cmd+Shift+N)",children:B.jsx(jl,{size:14})}),B.jsx("div",{className:"w-px h-4 bg-[var(--border)] mx-1"}),B.jsxs("button",{onClick:f,className:"flex items-center gap-1.5 px-2 py-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors text-xs",title:"Cycle layout (Cmd+T)",children:[xp[_],B.jsx("span",{className:"hidden sm:inline",children:Ep[_]})]}),B.jsx("button",{onClick:m,className:"p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Auto reorganize",children:B.jsx(cp,{size:14})}),B.jsx("div",{className:"w-px h-4 bg-[var(--border)] mx-1"}),B.jsx("button",{onClick:()=>r(!0),className:"p-1.5 rounded text-[var(--text-muted)] hover:text-yellow-400 hover:bg-[var(--surface-3)] transition-colors",title:"Save as favourite",children:B.jsx(Th,{size:14})}),B.jsx("div",{className:"flex-1"}),B.jsxs("div",{className:"hidden md:flex items-center gap-1 text-[10px] text-[var(--text-muted)]",children:[B.jsx(ap,{size:10}),B.jsx("span",{children:"Cmd+N split"}),B.jsx("span",{className:"mx-1",children:"|"}),B.jsx("span",{children:"Cmd+W close"}),B.jsx("span",{className:"mx-1",children:"|"}),B.jsx("span",{children:"Cmd+D sidebar"})]}),B.jsx(Ah,{open:t,onClose:()=>r(!1),onSave:d,defaultPreset:_,defaultSlotCount:Math.max(S,1)})]})}function bp(e,t){const r=J.useRef();J.useEffect(()=>{const i=e.current;if(!i)return;const n=new ResizeObserver(()=>{clearTimeout(r.current),r.current=setTimeout(t,F_)});return n.observe(i),()=>{n.disconnect(),clearTimeout(r.current)}},[e,t])}function Lp(e,t){const r=ae(_=>_.setDragging),i=ae(_=>_.setDropTarget),n=ae(_=>_.draggingTerminalId),h=ie(_=>_.movePaneInProject),g=ie(_=>_.swapPanesInProject),o=J.useCallback(_=>{_.dataTransfer.setData("text/plain",e),_.dataTransfer.effectAllowed="move",r(e)},[e,r]),c=J.useCallback(()=>{r(null),i(null)},[r,i]),f=J.useCallback(_=>{if(_.preventDefault(),_.dataTransfer.dropEffect="move",!n||n===e){i(null);return}const S=_.currentTarget.getBoundingClientRect(),w=(_.clientX-S.left)/S.width,p=(_.clientY-S.top)/S.height;let u="center";const l=.2;w<l?u="left":w>1-l?u="right":p<l?u="top":p>1-l&&(u="bottom"),i({terminalId:e,edge:u})},[e,n,i]),m=J.useCallback(()=>{i(null)},[i]),d=J.useCallback(_=>{_.preventDefault();const S=_.dataTransfer.getData("text/plain");if(!S||S===e)return;const w=ae.getState().dropTarget;w&&(w.edge==="center"?g(t,S,e):h(t,S,e,w.edge),r(null),i(null))},[e,t,h,g,r,i]);return{onDragStart:o,onDragEnd:c,onDragOver:f,onDragLeave:m,onDrop:d}}function Dp({terminalId:e,projectId:t,isFocused:r,onClose:i,dragProps:n}){const h=Le(d=>d.sessions[e]),g=(h==null?void 0:h.title)??"Terminal",o=(h==null?void 0:h.alive)??!0,c=ie(d=>d.getLayout(t)),m=Se(c).indexOf(e)+1;return B.jsxs("div",{draggable:!0,onDragStart:n.onDragStart,onDragEnd:n.onDragEnd,className:`
|
|
280
|
+
flex items-center h-7 px-2 gap-1.5 flex-shrink-0
|
|
281
|
+
bg-[var(--surface-2)] border-b
|
|
282
|
+
border-[var(--border)]
|
|
283
|
+
transition-colors duration-100
|
|
284
|
+
select-none cursor-grab active:cursor-grabbing
|
|
285
|
+
`,children:[B.jsx("div",{className:"text-[var(--text-muted)]",children:B.jsx(lp,{size:12})}),B.jsx("span",{className:"text-[10px] font-medium text-[var(--text-muted)] tabular-nums",children:m}),B.jsx("span",{className:"text-xs text-[var(--text-secondary)] truncate flex-1",children:g}),!o&&B.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--danger)]"}),B.jsx("button",{onClick:d=>{d.stopPropagation(),i()},onMouseDown:d=>d.stopPropagation(),draggable:!1,className:`
|
|
286
|
+
p-0.5 rounded text-[var(--text-muted)]
|
|
287
|
+
hover:text-[var(--danger)] hover:bg-[var(--danger-dim)]
|
|
288
|
+
transition-colors
|
|
289
|
+
`,children:B.jsx(on,{size:12})})]})}function Rp({terminalId:e}){const t=ae(h=>h.dropTarget);if(!t||t.terminalId!==e)return null;const r=t.edge,i=r==="center",n={left:"left-0 top-0 bottom-0 w-1/2",right:"right-0 top-0 bottom-0 w-1/2",top:"left-0 right-0 top-0 h-1/2",bottom:"left-0 right-0 bottom-0 h-1/2",center:"inset-0"};return B.jsx("div",{className:`
|
|
290
|
+
absolute ${n[r]??"inset-0"}
|
|
291
|
+
pointer-events-none z-20
|
|
292
|
+
${i?"bg-accent/15 border-2 border-accent/40":"bg-accent/20 border-2 border-accent/50"}
|
|
293
|
+
rounded-sm transition-all duration-100
|
|
294
|
+
`})}function Pp({terminalId:e,projectId:t,cwd:r}){const i=ae(w=>w.focusedTerminalId),n=ae(w=>w.draggingTerminalId),h=i===e,g=n===e,{containerRef:o,fit:c,focus:f}=X_({terminalId:e,projectId:t,cwd:r}),m=Lp(e,t);bp(o,c);const d=J.useCallback(()=>{var u;Ke({type:"pty:kill",terminalId:e}),ie.getState().removePaneFromProject(t,e),ye.getState().removeTerminalFromProject(t,e);const w=Le.getState().sessions[e];(u=w==null?void 0:w.terminal)==null||u.dispose(),Le.getState().removeSession(e),nn(e);const p=Se(ie.getState().getLayout(t));ae.getState().setFocusedTerminal(p[0]??null)},[e,t]),_=J.useCallback(w=>{if(w.dataTransfer.files.length>0){w.preventDefault(),w.stopPropagation();const p=Array.from(w.dataTransfer.files).map(u=>u.path).filter(Boolean).map(u=>u.includes(" ")?`'${u}'`:u);p.length>0&&(Ke({type:"pty:input",terminalId:e,data:p.join(" ")}),f());return}m.onDrop(w)},[e,m,f]),S=J.useCallback(w=>{if(w.dataTransfer.types.includes("Files")){w.preventDefault(),w.dataTransfer.dropEffect="copy";return}m.onDragOver(w)},[m]);return B.jsxs("div",{style:{borderColor:h?"rgba(107,107,128,0.35)":"transparent"},className:`
|
|
295
|
+
flex flex-col h-full w-full relative border
|
|
296
|
+
${g?"opacity-40":""}
|
|
297
|
+
transition-colors duration-100
|
|
298
|
+
`,onClick:f,onDragOver:S,onDragLeave:m.onDragLeave,onDrop:_,children:[B.jsx(Dp,{terminalId:e,projectId:t,isFocused:h,onClose:d,dragProps:{onDragStart:m.onDragStart,onDragEnd:m.onDragEnd}}),B.jsx("div",{ref:o,className:"flex-1 min-h-0 min-w-0 overflow-hidden"}),B.jsx(Rp,{terminalId:e})]})}function Tp({projectId:e,path:t,direction:r}){const i=ie(g=>g.resizePaneInProject),n=J.useRef(null);return{onMouseDown:J.useCallback(g=>{var _;g.preventDefault(),g.stopPropagation();const o=(_=n.current)==null?void 0:_.parentElement;if(!o)return;const c=o.getBoundingClientRect();r==="vertical"?g.clientX:g.clientY;const f=r==="vertical"?c.width:c.height,m=S=>{const w=r==="vertical"?S.clientX:S.clientY,p=r==="vertical"?c.left:c.top,u=(w-p)/f;i(e,t,u)},d=()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",d),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",m),document.addEventListener("mouseup",d),document.body.style.cursor=r==="vertical"?"col-resize":"row-resize",document.body.style.userSelect="none"},[e,t,r,i]),containerRef:n}}function Ap({projectId:e,path:t,direction:r}){const{onMouseDown:i,containerRef:n}=Tp({projectId:e,path:t,direction:r}),h=r==="vertical";return B.jsxs("div",{ref:n,className:`
|
|
299
|
+
relative z-10 flex-shrink-0
|
|
300
|
+
${h?"w-[4px] cursor-col-resize":"h-[4px] cursor-row-resize"}
|
|
301
|
+
group
|
|
302
|
+
`,onMouseDown:i,children:[B.jsx("div",{className:`
|
|
303
|
+
absolute
|
|
304
|
+
${h?"inset-y-0 -left-[2px] w-[8px]":"inset-x-0 -top-[2px] h-[8px]"}
|
|
305
|
+
transition-colors duration-150
|
|
306
|
+
hover:bg-accent/40
|
|
307
|
+
group-active:bg-accent/60
|
|
308
|
+
`}),B.jsx("div",{className:`
|
|
309
|
+
${h?"w-full h-full":"h-full w-full"}
|
|
310
|
+
bg-[var(--border)]
|
|
311
|
+
transition-colors duration-150
|
|
312
|
+
group-hover:bg-accent/60
|
|
313
|
+
group-active:bg-accent
|
|
314
|
+
`})]})}function zo({node:e,projectId:t,cwd:r,path:i=[]}){if(e.type==="leaf")return B.jsx(Pp,{terminalId:e.terminalId,projectId:t,cwd:r});const n=e.direction==="vertical",h=`${e.ratio*100}%`,g=`${(1-e.ratio)*100}%`;return B.jsxs("div",{className:`flex ${n?"flex-row":"flex-col"} h-full w-full`,children:[B.jsx("div",{style:{flexBasis:h,minWidth:0,minHeight:0,overflow:"hidden"},className:"flex",children:B.jsx(zo,{node:e.first,projectId:t,cwd:r,path:[...i,0]})}),B.jsx(Ap,{projectId:t,path:i,direction:e.direction}),B.jsx("div",{style:{flexBasis:g,minWidth:0,minHeight:0,overflow:"hidden"},className:"flex",children:B.jsx(zo,{node:e.second,projectId:t,cwd:r,path:[...i,1]})})]})}function Mp(){const[e,t]=J.useState(null);return J.useEffect(()=>{let r=!1;return fetch("https://dummyjson.com/quotes/random").then(i=>i.json()).then(i=>{!r&&(i!=null&&i.quote)&&t({text:i.quote,author:i.author})}).catch(()=>{}),()=>{r=!0}},[]),e}function Bp({onNewTerminal:e,projectName:t}){const r=Mp();return B.jsx("div",{className:"h-full w-full flex items-center justify-center bg-[var(--surface-0)]",children:B.jsxs("div",{className:"flex flex-col items-center gap-6 text-center max-w-lg px-8",children:[B.jsx("div",{className:"w-16 h-16 rounded-2xl bg-[var(--surface-2)] border border-[var(--border)] flex items-center justify-center",children:B.jsx(Hl,{size:28,className:"text-[var(--text-muted)]"})}),B.jsxs("div",{children:[B.jsx("h2",{className:"text-lg font-medium text-[var(--text-primary)] mb-1",children:t??"No project selected"}),B.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:t?"This project has no active terminals.":"Create a project to get started."})]}),t&&B.jsxs("button",{onClick:e,className:`
|
|
315
|
+
flex items-center gap-2 px-4 py-2
|
|
316
|
+
bg-accent hover:bg-accent/80
|
|
317
|
+
text-white text-sm font-medium
|
|
318
|
+
rounded-lg transition-colors
|
|
319
|
+
`,children:[B.jsx(Nl,{size:16}),"New Terminal"]}),r&&B.jsxs("div",{className:"mt-4 max-w-sm",children:[B.jsxs("p",{className:"text-sm italic text-[var(--text-muted)] leading-relaxed",children:['"',r.text,'"']}),B.jsxs("p",{className:"text-xs text-[var(--text-muted)]/60 mt-2",children:["— ",r.author]})]})]})})}function Op(){Y_(),Z_();const e=ye(c=>c.activeProjectId),t=ye(c=>c.activeProjectId?c.projects[c.activeProjectId]:null),r=ie(c=>e?c.getLayout(e):null),i=ae(c=>c.focusedTerminalId),n=ae(c=>c.setFocusedTerminal),h=ye(c=>c.addTerminalToProject),g=J.useCallback(c=>{if(!e||!t)return;const f=crypto.randomUUID(),m=Se(r),d=i??m[0];d?ie.getState().addPaneToProject(e,d,f,c):ie.getState().setLayout(e,{type:"leaf",terminalId:f}),h(e,f),n(f)},[e,t,r,i,h,n]),o=J.useCallback(()=>{g("vertical")},[g]);return B.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-[var(--surface-0)]",children:[B.jsx(Cp,{}),B.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[B.jsx(kp,{onNewPane:g}),B.jsx("div",{className:"flex-1 min-h-0 min-w-0",children:r?B.jsx(zo,{node:r,projectId:e,cwd:(t==null?void 0:t.cwd)??"/"},e):B.jsx(Bp,{onNewTerminal:o,projectName:t==null?void 0:t.name})})]})]})}Hn.createRoot(document.getElementById("root")).render(B.jsx(_c.StrictMode,{children:B.jsx(Op,{})}));
|