paneful 0.6.2 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,349 @@
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 m of h.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).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 nc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oc={exports:{}},Us={},ac={exports:{}},ie={};/**
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 Oi=Symbol.for("react.element"),jh=Symbol.for("react.portal"),Nh=Symbol.for("react.fragment"),Hh=Symbol.for("react.strict_mode"),Fh=Symbol.for("react.profiler"),zh=Symbol.for("react.provider"),Wh=Symbol.for("react.context"),Uh=Symbol.for("react.forward_ref"),$h=Symbol.for("react.suspense"),Kh=Symbol.for("react.memo"),Vh=Symbol.for("react.lazy"),Wa=Symbol.iterator;function qh(e){return e===null||typeof e!="object"?null:(e=Wa&&e[Wa]||e["@@iterator"],typeof e=="function"?e:null)}var lc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},cc=Object.assign,uc={};function Hr(e,t,r){this.props=e,this.context=t,this.refs=uc,this.updater=r||lc}Hr.prototype.isReactComponent={};Hr.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")};Hr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function hc(){}hc.prototype=Hr.prototype;function Uo(e,t,r){this.props=e,this.context=t,this.refs=uc,this.updater=r||lc}var $o=Uo.prototype=new hc;$o.constructor=Uo;cc($o,Hr.prototype);$o.isPureReactComponent=!0;var Ua=Array.isArray,dc=Object.prototype.hasOwnProperty,Ko={current:null},fc={key:!0,ref:!0,__self:!0,__source:!0};function pc(e,t,r){var i,n={},h=null,m=null;if(t!=null)for(i in t.ref!==void 0&&(m=t.ref),t.key!==void 0&&(h=""+t.key),t)dc.call(t,i)&&!fc.hasOwnProperty(i)&&(n[i]=t[i]);var a=arguments.length-2;if(a===1)n.children=r;else if(1<a){for(var u=Array(a),f=0;f<a;f++)u[f]=arguments[f+2];n.children=u}if(e&&e.defaultProps)for(i in a=e.defaultProps,a)n[i]===void 0&&(n[i]=a[i]);return{$$typeof:Oi,type:e,key:h,ref:m,props:n,_owner:Ko.current}}function Gh(e,t){return{$$typeof:Oi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Vo(e){return typeof e=="object"&&e!==null&&e.$$typeof===Oi}function Xh(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var $a=/\/+/g;function hn(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Xh(""+e.key):t.toString(36)}function os(e,t,r,i,n){var h=typeof e;(h==="undefined"||h==="boolean")&&(e=null);var m=!1;if(e===null)m=!0;else switch(h){case"string":case"number":m=!0;break;case"object":switch(e.$$typeof){case Oi:case jh:m=!0}}if(m)return m=e,n=n(m),e=i===""?"."+hn(m,0):i,Ua(n)?(r="",e!=null&&(r=e.replace($a,"$&/")+"/"),os(n,t,r,"",function(f){return f})):n!=null&&(Vo(n)&&(n=Gh(n,r+(!n.key||m&&m.key===n.key?"":(""+n.key).replace($a,"$&/")+"/")+e)),t.push(n)),1;if(m=0,i=i===""?".":i+":",Ua(e))for(var a=0;a<e.length;a++){h=e[a];var u=i+hn(h,a);m+=os(h,t,r,u,n)}else if(u=qh(e),typeof u=="function")for(e=u.call(e),a=0;!(h=e.next()).done;)h=h.value,u=i+hn(h,a++),m+=os(h,t,r,u,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 m}function Ui(e,t,r){if(e==null)return e;var i=[],n=0;return os(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 je={current:null},as={transition:null},Yh={ReactCurrentDispatcher:je,ReactCurrentBatchConfig:as,ReactCurrentOwner:Ko};function _c(){throw Error("act(...) is not supported in production builds of React.")}ie.Children={map:Ui,forEach:function(e,t,r){Ui(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Ui(e,function(){t++}),t},toArray:function(e){return Ui(e,function(t){return t})||[]},only:function(e){if(!Vo(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ie.Component=Hr;ie.Fragment=Nh;ie.Profiler=Fh;ie.PureComponent=Uo;ie.StrictMode=Hh;ie.Suspense=$h;ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yh;ie.act=_c;ie.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=cc({},e.props),n=e.key,h=e.ref,m=e._owner;if(t!=null){if(t.ref!==void 0&&(h=t.ref,m=Ko.current),t.key!==void 0&&(n=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(u in t)dc.call(t,u)&&!fc.hasOwnProperty(u)&&(i[u]=t[u]===void 0&&a!==void 0?a[u]:t[u])}var u=arguments.length-2;if(u===1)i.children=r;else if(1<u){a=Array(u);for(var f=0;f<u;f++)a[f]=arguments[f+2];i.children=a}return{$$typeof:Oi,type:e.type,key:n,ref:h,props:i,_owner:m}};ie.createContext=function(e){return e={$$typeof:Wh,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:zh,_context:e},e.Consumer=e};ie.createElement=pc;ie.createFactory=function(e){var t=pc.bind(null,e);return t.type=e,t};ie.createRef=function(){return{current:null}};ie.forwardRef=function(e){return{$$typeof:Uh,render:e}};ie.isValidElement=Vo;ie.lazy=function(e){return{$$typeof:Vh,_payload:{_status:-1,_result:e},_init:Qh}};ie.memo=function(e,t){return{$$typeof:Kh,type:e,compare:t===void 0?null:t}};ie.startTransition=function(e){var t=as.transition;as.transition={};try{e()}finally{as.transition=t}};ie.unstable_act=_c;ie.useCallback=function(e,t){return je.current.useCallback(e,t)};ie.useContext=function(e){return je.current.useContext(e)};ie.useDebugValue=function(){};ie.useDeferredValue=function(e){return je.current.useDeferredValue(e)};ie.useEffect=function(e,t){return je.current.useEffect(e,t)};ie.useId=function(){return je.current.useId()};ie.useImperativeHandle=function(e,t,r){return je.current.useImperativeHandle(e,t,r)};ie.useInsertionEffect=function(e,t){return je.current.useInsertionEffect(e,t)};ie.useLayoutEffect=function(e,t){return je.current.useLayoutEffect(e,t)};ie.useMemo=function(e,t){return je.current.useMemo(e,t)};ie.useReducer=function(e,t,r){return je.current.useReducer(e,t,r)};ie.useRef=function(e){return je.current.useRef(e)};ie.useState=function(e){return je.current.useState(e)};ie.useSyncExternalStore=function(e,t,r){return je.current.useSyncExternalStore(e,t,r)};ie.useTransition=function(){return je.current.useTransition()};ie.version="18.3.1";ac.exports=ie;var Q=ac.exports;const vc=nc(Q);/**
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 Jh=Q,Zh=Symbol.for("react.element"),ed=Symbol.for("react.fragment"),td=Object.prototype.hasOwnProperty,rd=Jh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,id={key:!0,ref:!0,__self:!0,__source:!0};function gc(e,t,r){var i,n={},h=null,m=null;r!==void 0&&(h=""+r),t.key!==void 0&&(h=""+t.key),t.ref!==void 0&&(m=t.ref);for(i in t)td.call(t,i)&&!id.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:Zh,type:e,key:h,ref:m,props:n,_owner:rd.current}}Us.Fragment=ed;Us.jsx=gc;Us.jsxs=gc;oc.exports=Us;var A=oc.exports,Hn={},mc={exports:{}},Qe={},Sc={exports:{}},yc={};/**
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(j,E){var D=j.length;j.push(E);e:for(;0<D;){var P=D-1>>>1,O=j[P];if(0<n(O,E))j[P]=E,j[D]=O,D=P;else break e}}function r(j){return j.length===0?null:j[0]}function i(j){if(j.length===0)return null;var E=j[0],D=j.pop();if(D!==E){j[0]=D;e:for(var P=0,O=j.length,W=O>>>1;P<W;){var V=2*(P+1)-1,J=j[V],Z=V+1,I=j[Z];if(0>n(J,D))Z<O&&0>n(I,J)?(j[P]=I,j[Z]=D,P=Z):(j[P]=J,j[V]=D,P=V);else if(Z<O&&0>n(I,D))j[P]=I,j[Z]=D,P=Z;else break e}}return E}function n(j,E){var D=j.sortIndex-E.sortIndex;return D!==0?D:j.id-E.id}if(typeof performance=="object"&&typeof performance.now=="function"){var h=performance;e.unstable_now=function(){return h.now()}}else{var m=Date,a=m.now();e.unstable_now=function(){return m.now()-a}}var u=[],f=[],g=1,d=null,p=3,S=!1,w=!1,_=!1,c=typeof setTimeout=="function"?setTimeout:null,o=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 l(j){for(var E=r(f);E!==null;){if(E.callback===null)i(f);else if(E.startTime<=j)i(f),E.sortIndex=E.expirationTime,t(u,E);else break;E=r(f)}}function v(j){if(_=!1,l(j),!w)if(r(u)!==null)w=!0,K(C);else{var E=r(f);E!==null&&q(v,E.startTime-j)}}function C(j,E){w=!1,_&&(_=!1,o(y),y=-1),S=!0;var D=p;try{for(l(E),d=r(u);d!==null&&(!(d.expirationTime>E)||j&&!M());){var P=d.callback;if(typeof P=="function"){d.callback=null,p=d.priorityLevel;var O=P(d.expirationTime<=E);E=e.unstable_now(),typeof O=="function"?d.callback=O:d===r(u)&&i(u),l(E)}else i(u);d=r(u)}if(d!==null)var W=!0;else{var V=r(f);V!==null&&q(v,V.startTime-E),W=!1}return W}finally{d=null,p=D,S=!1}}var x=!1,k=null,y=-1,b=5,R=-1;function M(){return!(e.unstable_now()-R<b)}function B(){if(k!==null){var j=e.unstable_now();R=j;var E=!0;try{E=k(!0,j)}finally{E?T():(x=!1,k=null)}}else x=!1}var T;if(typeof s=="function")T=function(){s(B)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,F=N.port2;N.port1.onmessage=B,T=function(){F.postMessage(null)}}else T=function(){c(B,0)};function K(j){k=j,x||(x=!0,T())}function q(j,E){y=c(function(){j(e.unstable_now())},E)}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(j){j.callback=null},e.unstable_continueExecution=function(){w||S||(w=!0,K(C))},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(j){switch(p){case 1:case 2:case 3:var E=3;break;default:E=p}var D=p;p=E;try{return j()}finally{p=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(j,E){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var D=p;p=j;try{return E()}finally{p=D}},e.unstable_scheduleCallback=function(j,E,D){var P=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?P+D:P):D=P,j){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=D+O,j={id:g++,callback:E,priorityLevel:j,startTime:D,expirationTime:O,sortIndex:-1},D>P?(j.sortIndex=D,t(f,j),r(u)===null&&j===r(f)&&(_?(o(y),y=-1):_=!0,q(v,D-P))):(j.sortIndex=O,t(u,j),w||S||(w=!0,K(C))),j},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(j){var E=p;return function(){var D=p;p=E;try{return j.apply(this,arguments)}finally{p=D}}}})(yc);Sc.exports=yc;var sd=Sc.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 nd=Q,Xe=sd;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 wc=new Set,_i={};function ur(e,t){Pr(e,t),Pr(e+"Capture",t)}function Pr(e,t){for(_i[e]=t,e=0;e<t.length;e++)wc.add(t[e])}var kt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fn=Object.prototype.hasOwnProperty,od=/^[: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]*$/,Ka={},Va={};function ad(e){return Fn.call(Va,e)?!0:Fn.call(Ka,e)?!1:od.test(e)?Va[e]=!0:(Ka[e]=!0,!1)}function ld(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 cd(e,t,r,i){if(t===null||typeof t>"u"||ld(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,m){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=m}var Te={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Te[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];Te[t]=new Ne(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Te[e]=new Ne(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Te[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){Te[e]=new Ne(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Te[e]=new Ne(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Te[e]=new Ne(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Te[e]=new Ne(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Te[e]=new Ne(e,5,!1,e.toLowerCase(),null,!1,!1)});var qo=/[\-:]([a-z])/g;function Go(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(qo,Go);Te[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(qo,Go);Te[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(qo,Go);Te[t]=new Ne(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Te[e]=new Ne(e,1,!1,e.toLowerCase(),null,!1,!1)});Te.xlinkHref=new Ne("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Te[e]=new Ne(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xo(e,t,r,i){var n=Te.hasOwnProperty(t)?Te[t]:null;(n!==null?n.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(cd(t,r,n,i)&&(r=null),i||n===null?ad(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 Dt=nd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$i=Symbol.for("react.element"),fr=Symbol.for("react.portal"),pr=Symbol.for("react.fragment"),Qo=Symbol.for("react.strict_mode"),zn=Symbol.for("react.profiler"),Cc=Symbol.for("react.provider"),xc=Symbol.for("react.context"),Yo=Symbol.for("react.forward_ref"),Wn=Symbol.for("react.suspense"),Un=Symbol.for("react.suspense_list"),Jo=Symbol.for("react.memo"),Mt=Symbol.for("react.lazy"),kc=Symbol.for("react.offscreen"),qa=Symbol.iterator;function Vr(e){return e===null||typeof e!="object"?null:(e=qa&&e[qa]||e["@@iterator"],typeof e=="function"?e:null)}var me=Object.assign,dn;function ei(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 pn(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
+ `),m=n.length-1,a=h.length-1;1<=m&&0<=a&&n[m]!==h[a];)a--;for(;1<=m&&0<=a;m--,a--)if(n[m]!==h[a]){if(m!==1||a!==1)do if(m--,a--,0>a||n[m]!==h[a]){var u=`
37
+ `+n[m].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=m&&0<=a);break}}}finally{fn=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?ei(e):""}function ud(e){switch(e.tag){case 5:return ei(e.type);case 16:return ei("Lazy");case 13:return ei("Suspense");case 19:return ei("SuspenseList");case 0:case 2:case 15:return e=pn(e.type,!1),e;case 11:return e=pn(e.type.render,!1),e;case 1:return e=pn(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 pr:return"Fragment";case fr:return"Portal";case zn:return"Profiler";case Qo:return"StrictMode";case Wn:return"Suspense";case Un:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case xc:return(e.displayName||"Context")+".Consumer";case Cc:return(e._context.displayName||"Context")+".Provider";case Yo:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jo:return t=e.displayName||null,t!==null?t:$n(e.type)||"Memo";case Mt:t=e._payload,e=e._init;try{return $n(e(t))}catch{}}return null}function hd(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===Qo?"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 Vt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ec(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function dd(e){var t=Ec(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(m){i=""+m,h.call(this,m)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(m){i=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ki(e){e._valueTracker||(e._valueTracker=dd(e))}function bc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=Ec(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function ms(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 me({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Ga(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=Vt(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 Lc(e,t){t=t.checked,t!=null&&Xo(e,"checked",t,!1)}function Vn(e,t){Lc(e,t);var r=Vt(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,Vt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Xa(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"||ms(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var ti=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=""+Vt(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 me({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Qa(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(ti(r)){if(1<r.length)throw Error($(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Vt(r)}}function Dc(e,t){var r=Vt(t.value),i=Vt(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 Ya(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Rc(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"?Rc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Vi,Tc=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(Vi=Vi||document.createElement("div"),Vi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Vi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function vi(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ni={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},fd=["Webkit","ms","Moz","O"];Object.keys(ni).forEach(function(e){fd.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ni[t]=ni[e]})});function Pc(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ni.hasOwnProperty(e)&&ni[e]?(""+t).trim():t+"px"}function Mc(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,n=Pc(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,n):e[r]=n}}var pd=me({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(pd[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 Zo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zn=null,br=null,Lr=null;function Ja(e){if(e=ji(e)){if(typeof Zn!="function")throw Error($(280));var t=e.stateNode;t&&(t=Gs(t),Zn(e.stateNode,e.type,t))}}function Ac(e){br?Lr?Lr.push(e):Lr=[e]:br=e}function Oc(){if(br){var e=br,t=Lr;if(Lr=br=null,Ja(e),t)for(e=0;e<t.length;e++)Ja(t[e])}}function Bc(e,t){return e(t)}function Ic(){}var _n=!1;function jc(e,t,r){if(_n)return e(t,r);_n=!0;try{return Bc(e,t,r)}finally{_n=!1,(br!==null||Lr!==null)&&(Ic(),Oc())}}function gi(e,t){var r=e.stateNode;if(r===null)return null;var i=Gs(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(kt)try{var qr={};Object.defineProperty(qr,"passive",{get:function(){eo=!0}}),window.addEventListener("test",qr,qr),window.removeEventListener("test",qr,qr)}catch{eo=!1}function _d(e,t,r,i,n,h,m,a,u){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(g){this.onError(g)}}var oi=!1,Ss=null,ys=!1,to=null,vd={onError:function(e){oi=!0,Ss=e}};function gd(e,t,r,i,n,h,m,a,u){oi=!1,Ss=null,_d.apply(vd,arguments)}function md(e,t,r,i,n,h,m,a,u){if(gd.apply(this,arguments),oi){if(oi){var f=Ss;oi=!1,Ss=null}else throw Error($(198));ys||(ys=!0,to=f)}}function hr(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 Nc(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 Za(e){if(hr(e)!==e)throw Error($(188))}function Sd(e){var t=e.alternate;if(!t){if(t=hr(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 Za(n),e;if(h===i)return Za(n),t;h=h.sibling}throw Error($(188))}if(r.return!==i.return)r=n,i=h;else{for(var m=!1,a=n.child;a;){if(a===r){m=!0,r=n,i=h;break}if(a===i){m=!0,i=n,r=h;break}a=a.sibling}if(!m){for(a=h.child;a;){if(a===r){m=!0,r=h,i=n;break}if(a===i){m=!0,i=h,r=n;break}a=a.sibling}if(!m)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 Hc(e){return e=Sd(e),e!==null?Fc(e):null}function Fc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Fc(e);if(t!==null)return t;e=e.sibling}return null}var zc=Xe.unstable_scheduleCallback,el=Xe.unstable_cancelCallback,yd=Xe.unstable_shouldYield,wd=Xe.unstable_requestPaint,we=Xe.unstable_now,Cd=Xe.unstable_getCurrentPriorityLevel,ea=Xe.unstable_ImmediatePriority,Wc=Xe.unstable_UserBlockingPriority,ws=Xe.unstable_NormalPriority,xd=Xe.unstable_LowPriority,Uc=Xe.unstable_IdlePriority,$s=null,gt=null;function kd(e){if(gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot($s,e,void 0,(e.current.flags&128)===128)}catch{}}var ut=Math.clz32?Math.clz32:Ld,Ed=Math.log,bd=Math.LN2;function Ld(e){return e>>>=0,e===0?32:31-(Ed(e)/bd|0)|0}var qi=64,Gi=4194304;function ri(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 Cs(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,n=e.suspendedLanes,h=e.pingedLanes,m=r&268435455;if(m!==0){var a=m&~n;a!==0?i=ri(a):(h&=m,h!==0&&(i=ri(h)))}else m=r&~n,m!==0?i=ri(m):h!==0&&(i=ri(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-ut(t),n=1<<r,i|=e[r],t&=~n;return i}function Dd(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 Rd(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,n=e.expirationTimes,h=e.pendingLanes;0<h;){var m=31-ut(h),a=1<<m,u=n[m];u===-1?(!(a&r)||a&i)&&(n[m]=Dd(a,t)):u<=t&&(e.expiredLanes|=a),h&=~a}}function ro(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function $c(){var e=qi;return qi<<=1,!(qi&4194240)&&(qi=64),e}function vn(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Bi(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ut(t),e[t]=r}function Td(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-ut(r),h=1<<n;t[n]=0,i[n]=-1,e[n]=-1,r&=~h}}function ta(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-ut(r),n=1<<i;n&t|e[i]&t&&(e[i]|=t),r&=~n}}var le=0;function Kc(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Vc,ra,qc,Gc,Xc,io=!1,Xi=[],Nt=null,Ht=null,Ft=null,mi=new Map,Si=new Map,Ot=[],Pd="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 tl(e,t){switch(e){case"focusin":case"focusout":Nt=null;break;case"dragenter":case"dragleave":Ht=null;break;case"mouseover":case"mouseout":Ft=null;break;case"pointerover":case"pointerout":mi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Si.delete(t.pointerId)}}function Gr(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=ji(t),t!==null&&ra(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function Md(e,t,r,i,n){switch(t){case"focusin":return Nt=Gr(Nt,e,t,r,i,n),!0;case"dragenter":return Ht=Gr(Ht,e,t,r,i,n),!0;case"mouseover":return Ft=Gr(Ft,e,t,r,i,n),!0;case"pointerover":var h=n.pointerId;return mi.set(h,Gr(mi.get(h)||null,e,t,r,i,n)),!0;case"gotpointercapture":return h=n.pointerId,Si.set(h,Gr(Si.get(h)||null,e,t,r,i,n)),!0}return!1}function Qc(e){var t=Zt(e.target);if(t!==null){var r=hr(t);if(r!==null){if(t=r.tag,t===13){if(t=Nc(r),t!==null){e.blockedOn=t,Xc(e.priority,function(){qc(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 ls(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=ji(r),t!==null&&ra(t),e.blockedOn=r,!1;t.shift()}return!0}function rl(e,t,r){ls(e)&&r.delete(t)}function Ad(){io=!1,Nt!==null&&ls(Nt)&&(Nt=null),Ht!==null&&ls(Ht)&&(Ht=null),Ft!==null&&ls(Ft)&&(Ft=null),mi.forEach(rl),Si.forEach(rl)}function Xr(e,t){e.blockedOn===t&&(e.blockedOn=null,io||(io=!0,Xe.unstable_scheduleCallback(Xe.unstable_NormalPriority,Ad)))}function yi(e){function t(n){return Xr(n,e)}if(0<Xi.length){Xr(Xi[0],e);for(var r=1;r<Xi.length;r++){var i=Xi[r];i.blockedOn===e&&(i.blockedOn=null)}}for(Nt!==null&&Xr(Nt,e),Ht!==null&&Xr(Ht,e),Ft!==null&&Xr(Ft,e),mi.forEach(t),Si.forEach(t),r=0;r<Ot.length;r++)i=Ot[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<Ot.length&&(r=Ot[0],r.blockedOn===null);)Qc(r),r.blockedOn===null&&Ot.shift()}var Dr=Dt.ReactCurrentBatchConfig,xs=!0;function Od(e,t,r,i){var n=le,h=Dr.transition;Dr.transition=null;try{le=1,ia(e,t,r,i)}finally{le=n,Dr.transition=h}}function Bd(e,t,r,i){var n=le,h=Dr.transition;Dr.transition=null;try{le=4,ia(e,t,r,i)}finally{le=n,Dr.transition=h}}function ia(e,t,r,i){if(xs){var n=so(e,t,r,i);if(n===null)bn(e,t,i,ks,r),tl(e,i);else if(Md(n,e,t,r,i))i.stopPropagation();else if(tl(e,i),t&4&&-1<Pd.indexOf(e)){for(;n!==null;){var h=ji(n);if(h!==null&&Vc(h),h=so(e,t,r,i),h===null&&bn(e,t,i,ks,r),h===n)break;n=h}n!==null&&i.stopPropagation()}else bn(e,t,i,null,r)}}var ks=null;function so(e,t,r,i){if(ks=null,e=Zo(i),e=Zt(e),e!==null)if(t=hr(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Nc(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 ks=e,null}function Yc(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(Cd()){case ea:return 1;case Wc:return 4;case ws:case xd:return 16;case Uc:return 536870912;default:return 16}default:return 16}}var It=null,sa=null,cs=null;function Jc(){if(cs)return cs;var e,t=sa,r=t.length,i,n="value"in It?It.value:It.textContent,h=n.length;for(e=0;e<r&&t[e]===n[e];e++);var m=r-e;for(i=1;i<=m&&t[r-i]===n[h-i];i++);return cs=n.slice(e,1<i?1-i:void 0)}function us(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 il(){return!1}function Ye(e){function t(r,i,n,h,m){this._reactName=r,this._targetInst=n,this.type=i,this.nativeEvent=h,this.target=m,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(r=e[a],this[a]=r?r(h):h[a]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Qi:il,this.isPropagationStopped=il,this}return me(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 Fr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},na=Ye(Fr),Ii=me({},Fr,{view:0,detail:0}),Id=Ye(Ii),gn,mn,Qr,Ks=me({},Ii,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:oa,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!==Qr&&(Qr&&e.type==="mousemove"?(gn=e.screenX-Qr.screenX,mn=e.screenY-Qr.screenY):mn=gn=0,Qr=e),gn)},movementY:function(e){return"movementY"in e?e.movementY:mn}}),sl=Ye(Ks),jd=me({},Ks,{dataTransfer:0}),Nd=Ye(jd),Hd=me({},Ii,{relatedTarget:0}),Sn=Ye(Hd),Fd=me({},Fr,{animationName:0,elapsedTime:0,pseudoElement:0}),zd=Ye(Fd),Wd=me({},Fr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ud=Ye(Wd),$d=me({},Fr,{data:0}),nl=Ye($d),Kd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vd={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"},qd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Gd(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=qd[e])?!!t[e]:!1}function oa(){return Gd}var Xd=me({},Ii,{key:function(e){if(e.key){var t=Kd[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=us(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Vd[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:oa,charCode:function(e){return e.type==="keypress"?us(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?us(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Qd=Ye(Xd),Yd=me({},Ks,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ol=Ye(Yd),Jd=me({},Ii,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:oa}),Zd=Ye(Jd),ef=me({},Fr,{propertyName:0,elapsedTime:0,pseudoElement:0}),tf=Ye(ef),rf=me({},Ks,{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}),sf=Ye(rf),nf=[9,13,27,32],aa=kt&&"CompositionEvent"in window,ai=null;kt&&"documentMode"in document&&(ai=document.documentMode);var of=kt&&"TextEvent"in window&&!ai,Zc=kt&&(!aa||ai&&8<ai&&11>=ai),al=" ",ll=!1;function eu(e,t){switch(e){case"keyup":return nf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _r=!1;function af(e,t){switch(e){case"compositionend":return tu(t);case"keypress":return t.which!==32?null:(ll=!0,al);case"textInput":return e=t.data,e===al&&ll?null:e;default:return null}}function lf(e,t){if(_r)return e==="compositionend"||!aa&&eu(e,t)?(e=Jc(),cs=sa=It=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 Zc&&t.locale!=="ko"?null:t.data;default:return null}}var cf={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 cl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!cf[e.type]:t==="textarea"}function ru(e,t,r,i){Ac(i),t=Es(t,"onChange"),0<t.length&&(r=new na("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var li=null,wi=null;function uf(e){fu(e,0)}function Vs(e){var t=mr(e);if(bc(t))return e}function hf(e,t){if(e==="change")return t}var iu=!1;if(kt){var yn;if(kt){var wn="oninput"in document;if(!wn){var ul=document.createElement("div");ul.setAttribute("oninput","return;"),wn=typeof ul.oninput=="function"}yn=wn}else yn=!1;iu=yn&&(!document.documentMode||9<document.documentMode)}function hl(){li&&(li.detachEvent("onpropertychange",su),wi=li=null)}function su(e){if(e.propertyName==="value"&&Vs(wi)){var t=[];ru(t,wi,e,Zo(e)),jc(uf,t)}}function df(e,t,r){e==="focusin"?(hl(),li=t,wi=r,li.attachEvent("onpropertychange",su)):e==="focusout"&&hl()}function ff(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vs(wi)}function pf(e,t){if(e==="click")return Vs(t)}function _f(e,t){if(e==="input"||e==="change")return Vs(t)}function vf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dt=typeof Object.is=="function"?Object.is:vf;function Ci(e,t){if(dt(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)||!dt(e[n],t[n]))return!1}return!0}function dl(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fl(e,t){var r=dl(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=dl(r)}}function nu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?nu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ou(){for(var e=window,t=ms();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ms(e.document)}return t}function la(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 gf(e){var t=ou(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&nu(r.ownerDocument.documentElement,r)){if(i!==null&&la(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=fl(r,h);var m=fl(r,i);n&&m&&(e.rangeCount!==1||e.anchorNode!==n.node||e.anchorOffset!==n.offset||e.focusNode!==m.node||e.focusOffset!==m.offset)&&(t=t.createRange(),t.setStart(n.node,n.offset),e.removeAllRanges(),h>i?(e.addRange(t),e.extend(m.node,m.offset)):(t.setEnd(m.node,m.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 mf=kt&&"documentMode"in document&&11>=document.documentMode,vr=null,no=null,ci=null,oo=!1;function pl(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;oo||vr==null||vr!==ms(i)||(i=vr,"selectionStart"in i&&la(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}),ci&&Ci(ci,i)||(ci=i,i=Es(no,"onSelect"),0<i.length&&(t=new na("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=vr)))}function Yi(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var gr={animationend:Yi("Animation","AnimationEnd"),animationiteration:Yi("Animation","AnimationIteration"),animationstart:Yi("Animation","AnimationStart"),transitionend:Yi("Transition","TransitionEnd")},Cn={},au={};kt&&(au=document.createElement("div").style,"AnimationEvent"in window||(delete gr.animationend.animation,delete gr.animationiteration.animation,delete gr.animationstart.animation),"TransitionEvent"in window||delete gr.transitionend.transition);function qs(e){if(Cn[e])return Cn[e];if(!gr[e])return e;var t=gr[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in au)return Cn[e]=t[r];return e}var lu=qs("animationend"),cu=qs("animationiteration"),uu=qs("animationstart"),hu=qs("transitionend"),du=new Map,_l="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 Gt(e,t){du.set(e,t),ur(t,[e])}for(var xn=0;xn<_l.length;xn++){var kn=_l[xn],Sf=kn.toLowerCase(),yf=kn[0].toUpperCase()+kn.slice(1);Gt(Sf,"on"+yf)}Gt(lu,"onAnimationEnd");Gt(cu,"onAnimationIteration");Gt(uu,"onAnimationStart");Gt("dblclick","onDoubleClick");Gt("focusin","onFocus");Gt("focusout","onBlur");Gt(hu,"onTransitionEnd");Pr("onMouseEnter",["mouseout","mouseover"]);Pr("onMouseLeave",["mouseout","mouseover"]);Pr("onPointerEnter",["pointerout","pointerover"]);Pr("onPointerLeave",["pointerout","pointerover"]);ur("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ur("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ur("onBeforeInput",["compositionend","keypress","textInput","paste"]);ur("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ur("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ur("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ii="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(" "),wf=new Set("cancel close invalid load scroll toggle".split(" ").concat(ii));function vl(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,md(i,t,void 0,e),e.currentTarget=null}function fu(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 m=i.length-1;0<=m;m--){var a=i[m],u=a.instance,f=a.currentTarget;if(a=a.listener,u!==h&&n.isPropagationStopped())break e;vl(n,a,f),h=u}else for(m=0;m<i.length;m++){if(a=i[m],u=a.instance,f=a.currentTarget,a=a.listener,u!==h&&n.isPropagationStopped())break e;vl(n,a,f),h=u}}}if(ys)throw e=to,ys=!1,to=null,e}function he(e,t){var r=t[ho];r===void 0&&(r=t[ho]=new Set);var i=e+"__bubble";r.has(i)||(pu(t,e,2,!1),r.add(i))}function En(e,t,r){var i=0;t&&(i|=4),pu(r,e,i,t)}var Ji="_reactListening"+Math.random().toString(36).slice(2);function xi(e){if(!e[Ji]){e[Ji]=!0,wc.forEach(function(r){r!=="selectionchange"&&(wf.has(r)||En(r,!1,e),En(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ji]||(t[Ji]=!0,En("selectionchange",!1,t))}}function pu(e,t,r,i){switch(Yc(t)){case 1:var n=Od;break;case 4:n=Bd;break;default:n=ia}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 m=i.tag;if(m===3||m===4){var a=i.stateNode.containerInfo;if(a===n||a.nodeType===8&&a.parentNode===n)break;if(m===4)for(m=i.return;m!==null;){var u=m.tag;if((u===3||u===4)&&(u=m.stateNode.containerInfo,u===n||u.nodeType===8&&u.parentNode===n))return;m=m.return}for(;a!==null;){if(m=Zt(a),m===null)return;if(u=m.tag,u===5||u===6){i=h=m;continue e}a=a.parentNode}}i=i.return}jc(function(){var f=h,g=Zo(r),d=[];e:{var p=du.get(e);if(p!==void 0){var S=na,w=e;switch(e){case"keypress":if(us(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=sl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":S=Nd;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":S=Zd;break;case lu:case cu:case uu:S=zd;break;case hu:S=tf;break;case"scroll":S=Id;break;case"wheel":S=sf;break;case"copy":case"cut":case"paste":S=Ud;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":S=ol}var _=(t&4)!==0,c=!_&&e==="scroll",o=_?p!==null?p+"Capture":null:p;_=[];for(var s=f,l;s!==null;){l=s;var v=l.stateNode;if(l.tag===5&&v!==null&&(l=v,o!==null&&(v=gi(s,o),v!=null&&_.push(ki(s,v,l)))),c)break;s=s.return}0<_.length&&(p=new S(p,w,null,r,g),d.push({event:p,listeners:_}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",S=e==="mouseout"||e==="pointerout",p&&r!==Jn&&(w=r.relatedTarget||r.fromElement)&&(Zt(w)||w[Et]))break e;if((S||p)&&(p=g.window===g?g:(p=g.ownerDocument)?p.defaultView||p.parentWindow:window,S?(w=r.relatedTarget||r.toElement,S=f,w=w?Zt(w):null,w!==null&&(c=hr(w),w!==c||w.tag!==5&&w.tag!==6)&&(w=null)):(S=null,w=f),S!==w)){if(_=sl,v="onMouseLeave",o="onMouseEnter",s="mouse",(e==="pointerout"||e==="pointerover")&&(_=ol,v="onPointerLeave",o="onPointerEnter",s="pointer"),c=S==null?p:mr(S),l=w==null?p:mr(w),p=new _(v,s+"leave",S,r,g),p.target=c,p.relatedTarget=l,v=null,Zt(g)===f&&(_=new _(o,s+"enter",w,r,g),_.target=l,_.relatedTarget=c,v=_),c=v,S&&w)t:{for(_=S,o=w,s=0,l=_;l;l=dr(l))s++;for(l=0,v=o;v;v=dr(v))l++;for(;0<s-l;)_=dr(_),s--;for(;0<l-s;)o=dr(o),l--;for(;s--;){if(_===o||o!==null&&_===o.alternate)break t;_=dr(_),o=dr(o)}_=null}else _=null;S!==null&&gl(d,p,S,_,!1),w!==null&&c!==null&&gl(d,c,w,_,!0)}}e:{if(p=f?mr(f):window,S=p.nodeName&&p.nodeName.toLowerCase(),S==="select"||S==="input"&&p.type==="file")var C=hf;else if(cl(p))if(iu)C=_f;else{C=ff;var x=df}else(S=p.nodeName)&&S.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(C=pf);if(C&&(C=C(e,f))){ru(d,C,r,g);break e}x&&x(e,p,f),e==="focusout"&&(x=p._wrapperState)&&x.controlled&&p.type==="number"&&qn(p,"number",p.value)}switch(x=f?mr(f):window,e){case"focusin":(cl(x)||x.contentEditable==="true")&&(vr=x,no=f,ci=null);break;case"focusout":ci=no=vr=null;break;case"mousedown":oo=!0;break;case"contextmenu":case"mouseup":case"dragend":oo=!1,pl(d,r,g);break;case"selectionchange":if(mf)break;case"keydown":case"keyup":pl(d,r,g)}var k;if(aa)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?eu(e,r)&&(y="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(y="onCompositionStart");y&&(Zc&&r.locale!=="ko"&&(_r||y!=="onCompositionStart"?y==="onCompositionEnd"&&_r&&(k=Jc()):(It=g,sa="value"in It?It.value:It.textContent,_r=!0)),x=Es(f,y),0<x.length&&(y=new nl(y,e,null,r,g),d.push({event:y,listeners:x}),k?y.data=k:(k=tu(r),k!==null&&(y.data=k)))),(k=of?af(e,r):lf(e,r))&&(f=Es(f,"onBeforeInput"),0<f.length&&(g=new nl("onBeforeInput","beforeinput",null,r,g),d.push({event:g,listeners:f}),g.data=k))}fu(d,t)})}function ki(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Es(e,t){for(var r=t+"Capture",i=[];e!==null;){var n=e,h=n.stateNode;n.tag===5&&h!==null&&(n=h,h=gi(e,r),h!=null&&i.unshift(ki(e,h,n)),h=gi(e,t),h!=null&&i.push(ki(e,h,n))),e=e.return}return i}function dr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function gl(e,t,r,i,n){for(var h=t._reactName,m=[];r!==null&&r!==i;){var a=r,u=a.alternate,f=a.stateNode;if(u!==null&&u===i)break;a.tag===5&&f!==null&&(a=f,n?(u=gi(r,h),u!=null&&m.unshift(ki(r,u,a))):n||(u=gi(r,h),u!=null&&m.push(ki(r,u,a)))),r=r.return}m.length!==0&&e.push({event:t,listeners:m})}var Cf=/\r\n?/g,xf=/\u0000|\uFFFD/g;function ml(e){return(typeof e=="string"?e:""+e).replace(Cf,`
38
+ `).replace(xf,"")}function Zi(e,t,r){if(t=ml(t),ml(e)!==t&&r)throw Error($(425))}function bs(){}var ao=null,lo=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,kf=typeof clearTimeout=="function"?clearTimeout:void 0,Sl=typeof Promise=="function"?Promise:void 0,Ef=typeof queueMicrotask=="function"?queueMicrotask:typeof Sl<"u"?function(e){return Sl.resolve(null).then(e).catch(bf)}:uo;function bf(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),yi(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=n}while(r);yi(t)}function zt(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 yl(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 zr=Math.random().toString(36).slice(2),vt="__reactFiber$"+zr,Ei="__reactProps$"+zr,Et="__reactContainer$"+zr,ho="__reactEvents$"+zr,Lf="__reactListeners$"+zr,Df="__reactHandles$"+zr;function Zt(e){var t=e[vt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Et]||r[vt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=yl(e);e!==null;){if(r=e[vt])return r;e=yl(e)}return t}e=r,r=e.parentNode}return null}function ji(e){return e=e[vt]||e[Et],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function mr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error($(33))}function Gs(e){return e[Ei]||null}var fo=[],Sr=-1;function Xt(e){return{current:e}}function de(e){0>Sr||(e.current=fo[Sr],fo[Sr]=null,Sr--)}function ue(e,t){Sr++,fo[Sr]=e.current,e.current=t}var qt={},Oe=Xt(qt),Ue=Xt(!1),nr=qt;function Mr(e,t){var r=e.type.contextTypes;if(!r)return qt;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 $e(e){return e=e.childContextTypes,e!=null}function Ls(){de(Ue),de(Oe)}function wl(e,t,r){if(Oe.current!==qt)throw Error($(168));ue(Oe,t),ue(Ue,r)}function _u(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,hd(e)||"Unknown",n));return me({},r,i)}function Ds(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qt,nr=Oe.current,ue(Oe,e),ue(Ue,Ue.current),!0}function Cl(e,t,r){var i=e.stateNode;if(!i)throw Error($(169));r?(e=_u(e,t,nr),i.__reactInternalMemoizedMergedChildContext=e,de(Ue),de(Oe),ue(Oe,e)):de(Ue),ue(Ue,r)}var yt=null,Xs=!1,Dn=!1;function vu(e){yt===null?yt=[e]:yt.push(e)}function Rf(e){Xs=!0,vu(e)}function Qt(){if(!Dn&&yt!==null){Dn=!0;var e=0,t=le;try{var r=yt;for(le=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}yt=null,Xs=!1}catch(n){throw yt!==null&&(yt=yt.slice(e+1)),zc(ea,Qt),n}finally{le=t,Dn=!1}}return null}var yr=[],wr=0,Rs=null,Ts=0,et=[],tt=0,or=null,wt=1,Ct="";function Yt(e,t){yr[wr++]=Ts,yr[wr++]=Rs,Rs=e,Ts=t}function gu(e,t,r){et[tt++]=wt,et[tt++]=Ct,et[tt++]=or,or=e;var i=wt;e=Ct;var n=32-ut(i)-1;i&=~(1<<n),r+=1;var h=32-ut(t)+n;if(30<h){var m=n-n%5;h=(i&(1<<m)-1).toString(32),i>>=m,n-=m,wt=1<<32-ut(t)+n|r<<n|i,Ct=h+e}else wt=1<<h|r<<n|i,Ct=e}function ca(e){e.return!==null&&(Yt(e,1),gu(e,1,0))}function ua(e){for(;e===Rs;)Rs=yr[--wr],yr[wr]=null,Ts=yr[--wr],yr[wr]=null;for(;e===or;)or=et[--tt],et[tt]=null,Ct=et[--tt],et[tt]=null,wt=et[--tt],et[tt]=null}var Ge=null,qe=null,fe=!1,ct=null;function mu(e,t){var r=rt(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 xl(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,Ge=e,qe=zt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ge=e,qe=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=or!==null?{id:wt,overflow:Ct}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=rt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Ge=e,qe=null,!0):!1;default:return!1}}function po(e){return(e.mode&1)!==0&&(e.flags&128)===0}function _o(e){if(fe){var t=qe;if(t){var r=t;if(!xl(e,t)){if(po(e))throw Error($(418));t=zt(r.nextSibling);var i=Ge;t&&xl(e,t)?mu(i,r):(e.flags=e.flags&-4097|2,fe=!1,Ge=e)}}else{if(po(e))throw Error($(418));e.flags=e.flags&-4097|2,fe=!1,Ge=e}}}function kl(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ge=e}function es(e){if(e!==Ge)return!1;if(!fe)return kl(e),fe=!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=qe)){if(po(e))throw Su(),Error($(418));for(;t;)mu(e,t),t=zt(t.nextSibling)}if(kl(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){qe=zt(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}qe=null}}else qe=Ge?zt(e.stateNode.nextSibling):null;return!0}function Su(){for(var e=qe;e;)e=zt(e.nextSibling)}function Ar(){qe=Ge=null,fe=!1}function ha(e){ct===null?ct=[e]:ct.push(e)}var Tf=Dt.ReactCurrentBatchConfig;function Yr(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(m){var a=n.refs;m===null?delete a[h]:a[h]=m},t._stringRef=h,t)}if(typeof e!="string")throw Error($(284));if(!r._owner)throw Error($(290,e))}return e}function ts(e,t){throw e=Object.prototype.toString.call(t),Error($(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function El(e){var t=e._init;return t(e._payload)}function yu(e){function t(o,s){if(e){var l=o.deletions;l===null?(o.deletions=[s],o.flags|=16):l.push(s)}}function r(o,s){if(!e)return null;for(;s!==null;)t(o,s),s=s.sibling;return null}function i(o,s){for(o=new Map;s!==null;)s.key!==null?o.set(s.key,s):o.set(s.index,s),s=s.sibling;return o}function n(o,s){return o=Kt(o,s),o.index=0,o.sibling=null,o}function h(o,s,l){return o.index=l,e?(l=o.alternate,l!==null?(l=l.index,l<s?(o.flags|=2,s):l):(o.flags|=2,s)):(o.flags|=1048576,s)}function m(o){return e&&o.alternate===null&&(o.flags|=2),o}function a(o,s,l,v){return s===null||s.tag!==6?(s=Bn(l,o.mode,v),s.return=o,s):(s=n(s,l),s.return=o,s)}function u(o,s,l,v){var C=l.type;return C===pr?g(o,s,l.props.children,v,l.key):s!==null&&(s.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Mt&&El(C)===s.type)?(v=n(s,l.props),v.ref=Yr(o,s,l),v.return=o,v):(v=gs(l.type,l.key,l.props,null,o.mode,v),v.ref=Yr(o,s,l),v.return=o,v)}function f(o,s,l,v){return s===null||s.tag!==4||s.stateNode.containerInfo!==l.containerInfo||s.stateNode.implementation!==l.implementation?(s=In(l,o.mode,v),s.return=o,s):(s=n(s,l.children||[]),s.return=o,s)}function g(o,s,l,v,C){return s===null||s.tag!==7?(s=ir(l,o.mode,v,C),s.return=o,s):(s=n(s,l),s.return=o,s)}function d(o,s,l){if(typeof s=="string"&&s!==""||typeof s=="number")return s=Bn(""+s,o.mode,l),s.return=o,s;if(typeof s=="object"&&s!==null){switch(s.$$typeof){case $i:return l=gs(s.type,s.key,s.props,null,o.mode,l),l.ref=Yr(o,null,s),l.return=o,l;case fr:return s=In(s,o.mode,l),s.return=o,s;case Mt:var v=s._init;return d(o,v(s._payload),l)}if(ti(s)||Vr(s))return s=ir(s,o.mode,l,null),s.return=o,s;ts(o,s)}return null}function p(o,s,l,v){var C=s!==null?s.key:null;if(typeof l=="string"&&l!==""||typeof l=="number")return C!==null?null:a(o,s,""+l,v);if(typeof l=="object"&&l!==null){switch(l.$$typeof){case $i:return l.key===C?u(o,s,l,v):null;case fr:return l.key===C?f(o,s,l,v):null;case Mt:return C=l._init,p(o,s,C(l._payload),v)}if(ti(l)||Vr(l))return C!==null?null:g(o,s,l,v,null);ts(o,l)}return null}function S(o,s,l,v,C){if(typeof v=="string"&&v!==""||typeof v=="number")return o=o.get(l)||null,a(s,o,""+v,C);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case $i:return o=o.get(v.key===null?l:v.key)||null,u(s,o,v,C);case fr:return o=o.get(v.key===null?l:v.key)||null,f(s,o,v,C);case Mt:var x=v._init;return S(o,s,l,x(v._payload),C)}if(ti(v)||Vr(v))return o=o.get(l)||null,g(s,o,v,C,null);ts(s,v)}return null}function w(o,s,l,v){for(var C=null,x=null,k=s,y=s=0,b=null;k!==null&&y<l.length;y++){k.index>y?(b=k,k=null):b=k.sibling;var R=p(o,k,l[y],v);if(R===null){k===null&&(k=b);break}e&&k&&R.alternate===null&&t(o,k),s=h(R,s,y),x===null?C=R:x.sibling=R,x=R,k=b}if(y===l.length)return r(o,k),fe&&Yt(o,y),C;if(k===null){for(;y<l.length;y++)k=d(o,l[y],v),k!==null&&(s=h(k,s,y),x===null?C=k:x.sibling=k,x=k);return fe&&Yt(o,y),C}for(k=i(o,k);y<l.length;y++)b=S(k,o,y,l[y],v),b!==null&&(e&&b.alternate!==null&&k.delete(b.key===null?y:b.key),s=h(b,s,y),x===null?C=b:x.sibling=b,x=b);return e&&k.forEach(function(M){return t(o,M)}),fe&&Yt(o,y),C}function _(o,s,l,v){var C=Vr(l);if(typeof C!="function")throw Error($(150));if(l=C.call(l),l==null)throw Error($(151));for(var x=C=null,k=s,y=s=0,b=null,R=l.next();k!==null&&!R.done;y++,R=l.next()){k.index>y?(b=k,k=null):b=k.sibling;var M=p(o,k,R.value,v);if(M===null){k===null&&(k=b);break}e&&k&&M.alternate===null&&t(o,k),s=h(M,s,y),x===null?C=M:x.sibling=M,x=M,k=b}if(R.done)return r(o,k),fe&&Yt(o,y),C;if(k===null){for(;!R.done;y++,R=l.next())R=d(o,R.value,v),R!==null&&(s=h(R,s,y),x===null?C=R:x.sibling=R,x=R);return fe&&Yt(o,y),C}for(k=i(o,k);!R.done;y++,R=l.next())R=S(k,o,y,R.value,v),R!==null&&(e&&R.alternate!==null&&k.delete(R.key===null?y:R.key),s=h(R,s,y),x===null?C=R:x.sibling=R,x=R);return e&&k.forEach(function(B){return t(o,B)}),fe&&Yt(o,y),C}function c(o,s,l,v){if(typeof l=="object"&&l!==null&&l.type===pr&&l.key===null&&(l=l.props.children),typeof l=="object"&&l!==null){switch(l.$$typeof){case $i:e:{for(var C=l.key,x=s;x!==null;){if(x.key===C){if(C=l.type,C===pr){if(x.tag===7){r(o,x.sibling),s=n(x,l.props.children),s.return=o,o=s;break e}}else if(x.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Mt&&El(C)===x.type){r(o,x.sibling),s=n(x,l.props),s.ref=Yr(o,x,l),s.return=o,o=s;break e}r(o,x);break}else t(o,x);x=x.sibling}l.type===pr?(s=ir(l.props.children,o.mode,v,l.key),s.return=o,o=s):(v=gs(l.type,l.key,l.props,null,o.mode,v),v.ref=Yr(o,s,l),v.return=o,o=v)}return m(o);case fr:e:{for(x=l.key;s!==null;){if(s.key===x)if(s.tag===4&&s.stateNode.containerInfo===l.containerInfo&&s.stateNode.implementation===l.implementation){r(o,s.sibling),s=n(s,l.children||[]),s.return=o,o=s;break e}else{r(o,s);break}else t(o,s);s=s.sibling}s=In(l,o.mode,v),s.return=o,o=s}return m(o);case Mt:return x=l._init,c(o,s,x(l._payload),v)}if(ti(l))return w(o,s,l,v);if(Vr(l))return _(o,s,l,v);ts(o,l)}return typeof l=="string"&&l!==""||typeof l=="number"?(l=""+l,s!==null&&s.tag===6?(r(o,s.sibling),s=n(s,l),s.return=o,o=s):(r(o,s),s=Bn(l,o.mode,v),s.return=o,o=s),m(o)):r(o,s)}return c}var Or=yu(!0),wu=yu(!1),Ps=Xt(null),Ms=null,Cr=null,da=null;function fa(){da=Cr=Ms=null}function pa(e){var t=Ps.current;de(Ps),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 Rr(e,t){Ms=e,da=Cr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(We=!0),e.firstContext=null)}function st(e){var t=e._currentValue;if(da!==e)if(e={context:e,memoizedValue:t,next:null},Cr===null){if(Ms===null)throw Error($(308));Cr=e,Ms.dependencies={lanes:0,firstContext:e}}else Cr=Cr.next=e;return t}var er=null;function _a(e){er===null?er=[e]:er.push(e)}function Cu(e,t,r,i){var n=t.interleaved;return n===null?(r.next=r,_a(t)):(r.next=n.next,n.next=r),t.interleaved=r,bt(e,i)}function bt(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 va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function xu(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 xt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wt(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,ae&2){var n=i.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),i.pending=t,bt(e,r)}return n=i.interleaved,n===null?(t.next=t,_a(i)):(t.next=n.next,n.next=t),i.interleaved=t,bt(e,r)}function hs(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,ta(e,r)}}function bl(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 m={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};h===null?n=h=m:h=h.next=m,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 As(e,t,r,i){var n=e.updateQueue;At=!1;var h=n.firstBaseUpdate,m=n.lastBaseUpdate,a=n.shared.pending;if(a!==null){n.shared.pending=null;var u=a,f=u.next;u.next=null,m===null?h=f:m.next=f,m=u;var g=e.alternate;g!==null&&(g=g.updateQueue,a=g.lastBaseUpdate,a!==m&&(a===null?g.firstBaseUpdate=f:a.next=f,g.lastBaseUpdate=u))}if(h!==null){var d=n.baseState;m=0,g=f=u=null,a=h;do{var p=a.lane,S=a.eventTime;if((i&p)===p){g!==null&&(g=g.next={eventTime:S,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var w=e,_=a;switch(p=t,S=r,_.tag){case 1:if(w=_.payload,typeof w=="function"){d=w.call(S,d,p);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=_.payload,p=typeof w=="function"?w.call(S,d,p):w,p==null)break e;d=me({},d,p);break e;case 2:At=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=n.effects,p===null?n.effects=[a]:p.push(a))}else S={eventTime:S,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},g===null?(f=g=S,u=d):g=g.next=S,m|=p;if(a=a.next,a===null){if(a=n.shared.pending,a===null)break;p=a,a=p.next,p.next=null,n.lastBaseUpdate=p,n.shared.pending=null}}while(!0);if(g===null&&(u=d),n.baseState=u,n.firstBaseUpdate=f,n.lastBaseUpdate=g,t=n.shared.interleaved,t!==null){n=t;do m|=n.lane,n=n.next;while(n!==t)}else h===null&&(n.shared.lanes=0);lr|=m,e.lanes=m,e.memoizedState=d}}function Ll(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 Ni={},mt=Xt(Ni),bi=Xt(Ni),Li=Xt(Ni);function tr(e){if(e===Ni)throw Error($(174));return e}function ga(e,t){switch(ue(Li,t),ue(bi,e),ue(mt,Ni),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)}de(mt),ue(mt,t)}function Br(){de(mt),de(bi),de(Li)}function ku(e){tr(Li.current);var t=tr(mt.current),r=Xn(t,e.type);t!==r&&(ue(bi,e),ue(mt,r))}function ma(e){bi.current===e&&(de(mt),de(bi))}var _e=Xt(0);function Os(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 Sa(){for(var e=0;e<Rn.length;e++)Rn[e]._workInProgressVersionPrimary=null;Rn.length=0}var ds=Dt.ReactCurrentDispatcher,Tn=Dt.ReactCurrentBatchConfig,ar=0,ge=null,xe=null,Ee=null,Bs=!1,ui=!1,Di=0,Pf=0;function Pe(){throw Error($(321))}function ya(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!dt(e[r],t[r]))return!1;return!0}function wa(e,t,r,i,n,h){if(ar=h,ge=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ds.current=e===null||e.memoizedState===null?Bf:If,e=r(i,n),ui){h=0;do{if(ui=!1,Di=0,25<=h)throw Error($(301));h+=1,Ee=xe=null,t.updateQueue=null,ds.current=jf,e=r(i,n)}while(ui)}if(ds.current=Is,t=xe!==null&&xe.next!==null,ar=0,Ee=xe=ge=null,Bs=!1,t)throw Error($(300));return e}function Ca(){var e=Di!==0;return Di=0,e}function _t(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ee===null?ge.memoizedState=Ee=e:Ee=Ee.next=e,Ee}function nt(){if(xe===null){var e=ge.alternate;e=e!==null?e.memoizedState:null}else e=xe.next;var t=Ee===null?ge.memoizedState:Ee.next;if(t!==null)Ee=t,xe=e;else{if(e===null)throw Error($(310));xe=e,e={memoizedState:xe.memoizedState,baseState:xe.baseState,baseQueue:xe.baseQueue,queue:xe.queue,next:null},Ee===null?ge.memoizedState=Ee=e:Ee=Ee.next=e}return Ee}function Ri(e,t){return typeof t=="function"?t(e):t}function Pn(e){var t=nt(),r=t.queue;if(r===null)throw Error($(311));r.lastRenderedReducer=e;var i=xe,n=i.baseQueue,h=r.pending;if(h!==null){if(n!==null){var m=n.next;n.next=h.next,h.next=m}i.baseQueue=n=h,r.pending=null}if(n!==null){h=n.next,i=i.baseState;var a=m=null,u=null,f=h;do{var g=f.lane;if((ar&g)===g)u!==null&&(u=u.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:g,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(a=u=d,m=i):u=u.next=d,ge.lanes|=g,lr|=g}f=f.next}while(f!==null&&f!==h);u===null?m=i:u.next=a,dt(i,t.memoizedState)||(We=!0),t.memoizedState=i,t.baseState=m,t.baseQueue=u,r.lastRenderedState=i}if(e=r.interleaved,e!==null){n=e;do h=n.lane,ge.lanes|=h,lr|=h,n=n.next;while(n!==e)}else n===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Mn(e){var t=nt(),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 m=n=n.next;do h=e(h,m.action),m=m.next;while(m!==n);dt(h,t.memoizedState)||(We=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),r.lastRenderedState=h}return[h,i]}function Eu(){}function bu(e,t){var r=ge,i=nt(),n=t(),h=!dt(i.memoizedState,n);if(h&&(i.memoizedState=n,We=!0),i=i.queue,xa(Ru.bind(null,r,i,e),[e]),i.getSnapshot!==t||h||Ee!==null&&Ee.memoizedState.tag&1){if(r.flags|=2048,Ti(9,Du.bind(null,r,i,n,t),void 0,null),be===null)throw Error($(349));ar&30||Lu(r,t,n)}return n}function Lu(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ge.updateQueue,t===null?(t={lastEffect:null,stores:null},ge.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Du(e,t,r,i){t.value=r,t.getSnapshot=i,Tu(t)&&Pu(e)}function Ru(e,t,r){return r(function(){Tu(t)&&Pu(e)})}function Tu(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!dt(e,r)}catch{return!0}}function Pu(e){var t=bt(e,1);t!==null&&ht(t,e,1,-1)}function Dl(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:Ri,lastRenderedState:e},t.queue=e,e=e.dispatch=Of.bind(null,ge,e),[t.memoizedState,e]}function Ti(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=ge.updateQueue,t===null?(t={lastEffect:null,stores:null},ge.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 Mu(){return nt().memoizedState}function fs(e,t,r,i){var n=_t();ge.flags|=e,n.memoizedState=Ti(1|t,r,void 0,i===void 0?null:i)}function Qs(e,t,r,i){var n=nt();i=i===void 0?null:i;var h=void 0;if(xe!==null){var m=xe.memoizedState;if(h=m.destroy,i!==null&&ya(i,m.deps)){n.memoizedState=Ti(t,r,h,i);return}}ge.flags|=e,n.memoizedState=Ti(1|t,r,h,i)}function Rl(e,t){return fs(8390656,8,e,t)}function xa(e,t){return Qs(2048,8,e,t)}function Au(e,t){return Qs(4,2,e,t)}function Ou(e,t){return Qs(4,4,e,t)}function Bu(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 Iu(e,t,r){return r=r!=null?r.concat([e]):null,Qs(4,4,Bu.bind(null,t,e),r)}function ka(){}function ju(e,t){var r=nt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&ya(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function Nu(e,t){var r=nt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&ya(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function Hu(e,t,r){return ar&21?(dt(r,t)||(r=$c(),ge.lanes|=r,lr|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,We=!0),e.memoizedState=r)}function Mf(e,t){var r=le;le=r!==0&&4>r?r:4,e(!0);var i=Tn.transition;Tn.transition={};try{e(!1),t()}finally{le=r,Tn.transition=i}}function Fu(){return nt().memoizedState}function Af(e,t,r){var i=$t(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},zu(e))Wu(t,r);else if(r=Cu(e,t,r,i),r!==null){var n=Ie();ht(r,e,i,n),Uu(r,t,i)}}function Of(e,t,r){var i=$t(e),n={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(zu(e))Wu(t,n);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var m=t.lastRenderedState,a=h(m,r);if(n.hasEagerState=!0,n.eagerState=a,dt(a,m)){var u=t.interleaved;u===null?(n.next=n,_a(t)):(n.next=u.next,u.next=n),t.interleaved=n;return}}catch{}finally{}r=Cu(e,t,n,i),r!==null&&(n=Ie(),ht(r,e,i,n),Uu(r,t,i))}}function zu(e){var t=e.alternate;return e===ge||t!==null&&t===ge}function Wu(e,t){ui=Bs=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Uu(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,ta(e,r)}}var Is={readContext:st,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},Bf={readContext:st,useCallback:function(e,t){return _t().memoizedState=[e,t===void 0?null:t],e},useContext:st,useEffect:Rl,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,fs(4194308,4,Bu.bind(null,t,e),r)},useLayoutEffect:function(e,t){return fs(4194308,4,e,t)},useInsertionEffect:function(e,t){return fs(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=Af.bind(null,ge,e),[i.memoizedState,e]},useRef:function(e){var t=_t();return e={current:e},t.memoizedState=e},useState:Dl,useDebugValue:ka,useDeferredValue:function(e){return _t().memoizedState=e},useTransition:function(){var e=Dl(!1),t=e[0];return e=Mf.bind(null,e[1]),_t().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=ge,n=_t();if(fe){if(r===void 0)throw Error($(407));r=r()}else{if(r=t(),be===null)throw Error($(349));ar&30||Lu(i,t,r)}n.memoizedState=r;var h={value:r,getSnapshot:t};return n.queue=h,Rl(Ru.bind(null,i,h,e),[e]),i.flags|=2048,Ti(9,Du.bind(null,i,h,r,t),void 0,null),r},useId:function(){var e=_t(),t=be.identifierPrefix;if(fe){var r=Ct,i=wt;r=(i&~(1<<32-ut(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=Di++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Pf++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},If={readContext:st,useCallback:ju,useContext:st,useEffect:xa,useImperativeHandle:Iu,useInsertionEffect:Au,useLayoutEffect:Ou,useMemo:Nu,useReducer:Pn,useRef:Mu,useState:function(){return Pn(Ri)},useDebugValue:ka,useDeferredValue:function(e){var t=nt();return Hu(t,xe.memoizedState,e)},useTransition:function(){var e=Pn(Ri)[0],t=nt().memoizedState;return[e,t]},useMutableSource:Eu,useSyncExternalStore:bu,useId:Fu,unstable_isNewReconciler:!1},jf={readContext:st,useCallback:ju,useContext:st,useEffect:xa,useImperativeHandle:Iu,useInsertionEffect:Au,useLayoutEffect:Ou,useMemo:Nu,useReducer:Mn,useRef:Mu,useState:function(){return Mn(Ri)},useDebugValue:ka,useDeferredValue:function(e){var t=nt();return xe===null?t.memoizedState=e:Hu(t,xe.memoizedState,e)},useTransition:function(){var e=Mn(Ri)[0],t=nt().memoizedState;return[e,t]},useMutableSource:Eu,useSyncExternalStore:bu,useId:Fu,unstable_isNewReconciler:!1};function at(e,t){if(e&&e.defaultProps){t=me({},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:me({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Ys={isMounted:function(e){return(e=e._reactInternals)?hr(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=Ie(),n=$t(e),h=xt(i,n);h.payload=t,r!=null&&(h.callback=r),t=Wt(e,h,n),t!==null&&(ht(t,e,n,i),hs(t,e,n))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=Ie(),n=$t(e),h=xt(i,n);h.tag=1,h.payload=t,r!=null&&(h.callback=r),t=Wt(e,h,n),t!==null&&(ht(t,e,n,i),hs(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Ie(),i=$t(e),n=xt(r,i);n.tag=2,t!=null&&(n.callback=t),t=Wt(e,n,i),t!==null&&(ht(t,e,i,r),hs(t,e,i))}};function Tl(e,t,r,i,n,h,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,h,m):t.prototype&&t.prototype.isPureReactComponent?!Ci(r,i)||!Ci(n,h):!0}function $u(e,t,r){var i=!1,n=qt,h=t.contextType;return typeof h=="object"&&h!==null?h=st(h):(n=$e(t)?nr:Oe.current,i=t.contextTypes,h=(i=i!=null)?Mr(e,n):qt),t=new t(r,h),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ys,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=h),t}function Pl(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&&Ys.enqueueReplaceState(t,t.state,null)}function mo(e,t,r,i){var n=e.stateNode;n.props=r,n.state=e.memoizedState,n.refs={},va(e);var h=t.contextType;typeof h=="object"&&h!==null?n.context=st(h):(h=$e(t)?nr:Oe.current,n.context=Mr(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&&Ys.enqueueReplaceState(n,n.state,null),As(e,r,n,i),n.state=e.memoizedState),typeof n.componentDidMount=="function"&&(e.flags|=4194308)}function Ir(e,t){try{var r="",i=t;do r+=ud(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 An(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 Nf=typeof WeakMap=="function"?WeakMap:Map;function Ku(e,t,r){r=xt(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){Ns||(Ns=!0,Ro=i),So(e,t)},r}function Vu(e,t,r){r=xt(-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"&&(Ut===null?Ut=new Set([this]):Ut.add(this));var m=t.stack;this.componentDidCatch(t.value,{componentStack:m!==null?m:""})}),r}function Ml(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new Nf;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=Jf.bind(null,e,t,r),t.then(e,e))}function Al(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 Ol(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=xt(-1,1),t.tag=2,Wt(r,t,1))),r.lanes|=1),e)}var Hf=Dt.ReactCurrentOwner,We=!1;function Be(e,t,r,i){t.child=e===null?wu(t,null,r,i):Or(t,e.child,r,i)}function Bl(e,t,r,i,n){r=r.render;var h=t.ref;return Rr(t,n),i=wa(e,t,r,i,h,n),r=Ca(),e!==null&&!We?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,Lt(e,t,n)):(fe&&r&&ca(t),t.flags|=1,Be(e,t,i,n),t.child)}function Il(e,t,r,i,n){if(e===null){var h=r.type;return typeof h=="function"&&!Ma(h)&&h.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=h,qu(e,t,h,i,n)):(e=gs(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 m=h.memoizedProps;if(r=r.compare,r=r!==null?r:Ci,r(m,i)&&e.ref===t.ref)return Lt(e,t,n)}return t.flags|=1,e=Kt(h,i),e.ref=t.ref,e.return=t,t.child=e}function qu(e,t,r,i,n){if(e!==null){var h=e.memoizedProps;if(Ci(h,i)&&e.ref===t.ref)if(We=!1,t.pendingProps=i=h,(e.lanes&n)!==0)e.flags&131072&&(We=!0);else return t.lanes=e.lanes,Lt(e,t,n)}return yo(e,t,r,i,n)}function Gu(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},ue(kr,Ve),Ve|=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,ue(kr,Ve),Ve|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=h!==null?h.baseLanes:r,ue(kr,Ve),Ve|=i}else h!==null?(i=h.baseLanes|r,t.memoizedState=null):i=r,ue(kr,Ve),Ve|=i;return Be(e,t,n,r),t.child}function Xu(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=$e(r)?nr:Oe.current;return h=Mr(t,h),Rr(t,n),r=wa(e,t,r,i,h,n),i=Ca(),e!==null&&!We?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,Lt(e,t,n)):(fe&&i&&ca(t),t.flags|=1,Be(e,t,r,n),t.child)}function jl(e,t,r,i,n){if($e(r)){var h=!0;Ds(t)}else h=!1;if(Rr(t,n),t.stateNode===null)ps(e,t),$u(t,r,i),mo(t,r,i,n),i=!0;else if(e===null){var m=t.stateNode,a=t.memoizedProps;m.props=a;var u=m.context,f=r.contextType;typeof f=="object"&&f!==null?f=st(f):(f=$e(r)?nr:Oe.current,f=Mr(t,f));var g=r.getDerivedStateFromProps,d=typeof g=="function"||typeof m.getSnapshotBeforeUpdate=="function";d||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(a!==i||u!==f)&&Pl(t,m,i,f),At=!1;var p=t.memoizedState;m.state=p,As(t,i,m,n),u=t.memoizedState,a!==i||p!==u||Ue.current||At?(typeof g=="function"&&(go(t,r,g,i),u=t.memoizedState),(a=At||Tl(t,r,a,i,p,u,f))?(d||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(t.flags|=4194308)):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=u),m.props=i,m.state=u,m.context=f,i=a):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{m=t.stateNode,xu(e,t),a=t.memoizedProps,f=t.type===t.elementType?a:at(t.type,a),m.props=f,d=t.pendingProps,p=m.context,u=r.contextType,typeof u=="object"&&u!==null?u=st(u):(u=$e(r)?nr:Oe.current,u=Mr(t,u));var S=r.getDerivedStateFromProps;(g=typeof S=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(a!==d||p!==u)&&Pl(t,m,i,u),At=!1,p=t.memoizedState,m.state=p,As(t,i,m,n);var w=t.memoizedState;a!==d||p!==w||Ue.current||At?(typeof S=="function"&&(go(t,r,S,i),w=t.memoizedState),(f=At||Tl(t,r,f,i,p,w,u)||!1)?(g||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(i,w,u),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(i,w,u)),typeof m.componentDidUpdate=="function"&&(t.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof m.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=w),m.props=i,m.state=w,m.context=u,i=f):(typeof m.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),i=!1)}return wo(e,t,r,i,h,n)}function wo(e,t,r,i,n,h){Xu(e,t);var m=(t.flags&128)!==0;if(!i&&!m)return n&&Cl(t,r,!1),Lt(e,t,h);i=t.stateNode,Hf.current=t;var a=m&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&m?(t.child=Or(t,e.child,null,h),t.child=Or(t,null,a,h)):Be(e,t,a,h),t.memoizedState=i.state,n&&Cl(t,r,!0),t.child}function Qu(e){var t=e.stateNode;t.pendingContext?wl(e,t.pendingContext,t.pendingContext!==t.context):t.context&&wl(e,t.context,!1),ga(e,t.containerInfo)}function Nl(e,t,r,i,n){return Ar(),ha(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 Yu(e,t,r){var i=t.pendingProps,n=_e.current,h=!1,m=(t.flags&128)!==0,a;if((a=m)||(a=e!==null&&e.memoizedState===null?!1:(n&2)!==0),a?(h=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(n|=1),ue(_e,n&1),e===null)return _o(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):(m=i.children,e=i.fallback,h?(i=t.mode,h=t.child,m={mode:"hidden",children:m},!(i&1)&&h!==null?(h.childLanes=0,h.pendingProps=m):h=en(m,i,0,null),e=ir(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):Ea(t,m));if(n=e.memoizedState,n!==null&&(a=n.dehydrated,a!==null))return Ff(e,t,m,i,a,n,r);if(h){h=i.fallback,m=t.mode,n=e.child,a=n.sibling;var u={mode:"hidden",children:i.children};return!(m&1)&&t.child!==n?(i=t.child,i.childLanes=0,i.pendingProps=u,t.deletions=null):(i=Kt(n,u),i.subtreeFlags=n.subtreeFlags&14680064),a!==null?h=Kt(a,h):(h=ir(h,m,r,null),h.flags|=2),h.return=t,i.return=t,i.sibling=h,t.child=i,i=h,h=t.child,m=e.child.memoizedState,m=m===null?xo(r):{baseLanes:m.baseLanes|r,cachePool:null,transitions:m.transitions},h.memoizedState=m,h.childLanes=e.childLanes&~r,t.memoizedState=Co,i}return h=e.child,e=h.sibling,i=Kt(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 Ea(e,t){return t=en({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function rs(e,t,r,i){return i!==null&&ha(i),Or(t,e.child,null,r),e=Ea(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ff(e,t,r,i,n,h,m){if(r)return t.flags&256?(t.flags&=-257,i=An(Error($(422))),rs(e,t,m,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(h=i.fallback,n=t.mode,i=en({mode:"visible",children:i.children},n,0,null),h=ir(h,n,m,null),h.flags|=2,i.return=t,h.return=t,i.sibling=h,t.child=i,t.mode&1&&Or(t,e.child,null,m),t.child.memoizedState=xo(m),t.memoizedState=Co,h);if(!(t.mode&1))return rs(e,t,m,null);if(n.data==="$!"){if(i=n.nextSibling&&n.nextSibling.dataset,i)var a=i.dgst;return i=a,h=Error($(419)),i=An(h,i,void 0),rs(e,t,m,i)}if(a=(m&e.childLanes)!==0,We||a){if(i=be,i!==null){switch(m&-m){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|m)?0:n,n!==0&&n!==h.retryLane&&(h.retryLane=n,bt(e,n),ht(i,e,n,-1))}return Pa(),i=An(Error($(421))),rs(e,t,m,i)}return n.data==="$?"?(t.flags|=128,t.child=e.child,t=Zf.bind(null,e),n._reactRetry=t,null):(e=h.treeContext,qe=zt(n.nextSibling),Ge=t,fe=!0,ct=null,e!==null&&(et[tt++]=wt,et[tt++]=Ct,et[tt++]=or,wt=e.id,Ct=e.overflow,or=t),t=Ea(t,i.children),t.flags|=4096,t)}function Hl(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),vo(e.return,t,r)}function On(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 Ju(e,t,r){var i=t.pendingProps,n=i.revealOrder,h=i.tail;if(Be(e,t,i.children,r),i=_e.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&&Hl(e,r,t);else if(e.tag===19)Hl(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(ue(_e,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&&Os(e)===null&&(n=r),r=r.sibling;r=n,r===null?(n=t.child,t.child=null):(n=r.sibling,r.sibling=null),On(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&&Os(e)===null){t.child=n;break}e=n.sibling,n.sibling=r,r=n,n=e}On(t,!0,r,null,h);break;case"together":On(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ps(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Lt(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=Kt(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Kt(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function zf(e,t,r){switch(t.tag){case 3:Qu(t),Ar();break;case 5:ku(t);break;case 1:$e(t.type)&&Ds(t);break;case 4:ga(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,n=t.memoizedProps.value;ue(Ps,i._currentValue),i._currentValue=n;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(ue(_e,_e.current&1),t.flags|=128,null):r&t.child.childLanes?Yu(e,t,r):(ue(_e,_e.current&1),e=Lt(e,t,r),e!==null?e.sibling:null);ue(_e,_e.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return Ju(e,t,r);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),ue(_e,_e.current),i)break;return null;case 22:case 23:return t.lanes=0,Gu(e,t,r)}return Lt(e,t,r)}var Zu,ko,eh,th;Zu=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}};ko=function(){};eh=function(e,t,r,i){var n=e.memoizedProps;if(n!==i){e=t.stateNode,tr(mt.current);var h=null;switch(r){case"input":n=Kn(e,n),i=Kn(e,i),h=[];break;case"select":n=me({},n,{value:void 0}),i=me({},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=bs)}Qn(r,i);var m;r=null;for(f in n)if(!i.hasOwnProperty(f)&&n.hasOwnProperty(f)&&n[f]!=null)if(f==="style"){var a=n[f];for(m in a)a.hasOwnProperty(m)&&(r||(r={}),r[m]="")}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 u=i[f];if(a=n!=null?n[f]:void 0,i.hasOwnProperty(f)&&u!==a&&(u!=null||a!=null))if(f==="style")if(a){for(m in a)!a.hasOwnProperty(m)||u&&u.hasOwnProperty(m)||(r||(r={}),r[m]="");for(m in u)u.hasOwnProperty(m)&&a[m]!==u[m]&&(r||(r={}),r[m]=u[m])}else r||(h||(h=[]),h.push(f,r)),r=u;else f==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,a=a?a.__html:void 0,u!=null&&a!==u&&(h=h||[]).push(f,u)):f==="children"?typeof u!="string"&&typeof u!="number"||(h=h||[]).push(f,""+u):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(_i.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&he("scroll",e),h||a===u||(h=[])):(h=h||[]).push(f,u))}r&&(h=h||[]).push("style",r);var f=h;(t.updateQueue=f)&&(t.flags|=4)}};th=function(e,t,r,i){r!==i&&(t.flags|=4)};function Jr(e,t){if(!fe)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 Me(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 Wf(e,t,r){var i=t.pendingProps;switch(ua(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Me(t),null;case 1:return $e(t.type)&&Ls(),Me(t),null;case 3:return i=t.stateNode,Br(),de(Ue),de(Oe),Sa(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(es(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ct!==null&&(Mo(ct),ct=null))),ko(e,t),Me(t),null;case 5:ma(t);var n=tr(Li.current);if(r=t.type,e!==null&&t.stateNode!=null)eh(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 Me(t),null}if(e=tr(mt.current),es(t)){i=t.stateNode,r=t.type;var h=t.memoizedProps;switch(i[vt]=t,i[Ei]=h,e=(t.mode&1)!==0,r){case"dialog":he("cancel",i),he("close",i);break;case"iframe":case"object":case"embed":he("load",i);break;case"video":case"audio":for(n=0;n<ii.length;n++)he(ii[n],i);break;case"source":he("error",i);break;case"img":case"image":case"link":he("error",i),he("load",i);break;case"details":he("toggle",i);break;case"input":Ga(i,h),he("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!h.multiple},he("invalid",i);break;case"textarea":Qa(i,h),he("invalid",i)}Qn(r,h),n=null;for(var m in h)if(h.hasOwnProperty(m)){var a=h[m];m==="children"?typeof a=="string"?i.textContent!==a&&(h.suppressHydrationWarning!==!0&&Zi(i.textContent,a,e),n=["children",a]):typeof a=="number"&&i.textContent!==""+a&&(h.suppressHydrationWarning!==!0&&Zi(i.textContent,a,e),n=["children",""+a]):_i.hasOwnProperty(m)&&a!=null&&m==="onScroll"&&he("scroll",i)}switch(r){case"input":Ki(i),Xa(i,h,!0);break;case"textarea":Ki(i),Ya(i);break;case"select":case"option":break;default:typeof h.onClick=="function"&&(i.onclick=bs)}i=n,t.updateQueue=i,i!==null&&(t.flags|=4)}else{m=n.nodeType===9?n:n.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Rc(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=m.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=m.createElement(r,{is:i.is}):(e=m.createElement(r),r==="select"&&(m=e,i.multiple?m.multiple=!0:i.size&&(m.size=i.size))):e=m.createElementNS(e,r),e[vt]=t,e[Ei]=i,Zu(e,t,!1,!1),t.stateNode=e;e:{switch(m=Yn(r,i),r){case"dialog":he("cancel",e),he("close",e),n=i;break;case"iframe":case"object":case"embed":he("load",e),n=i;break;case"video":case"audio":for(n=0;n<ii.length;n++)he(ii[n],e);n=i;break;case"source":he("error",e),n=i;break;case"img":case"image":case"link":he("error",e),he("load",e),n=i;break;case"details":he("toggle",e),n=i;break;case"input":Ga(e,i),n=Kn(e,i),he("invalid",e);break;case"option":n=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},n=me({},i,{value:void 0}),he("invalid",e);break;case"textarea":Qa(e,i),n=Gn(e,i),he("invalid",e);break;default:n=i}Qn(r,n),a=n;for(h in a)if(a.hasOwnProperty(h)){var u=a[h];h==="style"?Mc(e,u):h==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Tc(e,u)):h==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&vi(e,u):typeof u=="number"&&vi(e,""+u):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(_i.hasOwnProperty(h)?u!=null&&h==="onScroll"&&he("scroll",e):u!=null&&Xo(e,h,u,m))}switch(r){case"input":Ki(e),Xa(e,i,!1);break;case"textarea":Ki(e),Ya(e);break;case"option":i.value!=null&&e.setAttribute("value",""+Vt(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=bs)}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 Me(t),null;case 6:if(e&&t.stateNode!=null)th(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error($(166));if(r=tr(Li.current),tr(mt.current),es(t)){if(i=t.stateNode,r=t.memoizedProps,i[vt]=t,(h=i.nodeValue!==r)&&(e=Ge,e!==null))switch(e.tag){case 3:Zi(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Zi(i.nodeValue,r,(e.mode&1)!==0)}h&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[vt]=t,t.stateNode=i}return Me(t),null;case 13:if(de(_e),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(fe&&qe!==null&&t.mode&1&&!(t.flags&128))Su(),Ar(),t.flags|=98560,h=!1;else if(h=es(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[vt]=t}else Ar(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Me(t),h=!1}else ct!==null&&(Mo(ct),ct=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||_e.current&1?ke===0&&(ke=3):Pa())),t.updateQueue!==null&&(t.flags|=4),Me(t),null);case 4:return Br(),ko(e,t),e===null&&xi(t.stateNode.containerInfo),Me(t),null;case 10:return pa(t.type._context),Me(t),null;case 17:return $e(t.type)&&Ls(),Me(t),null;case 19:if(de(_e),h=t.memoizedState,h===null)return Me(t),null;if(i=(t.flags&128)!==0,m=h.rendering,m===null)if(i)Jr(h,!1);else{if(ke!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(m=Os(e),m!==null){for(t.flags|=128,Jr(h,!1),i=m.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,m=h.alternate,m===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=m.childLanes,h.lanes=m.lanes,h.child=m.child,h.subtreeFlags=0,h.deletions=null,h.memoizedProps=m.memoizedProps,h.memoizedState=m.memoizedState,h.updateQueue=m.updateQueue,h.type=m.type,e=m.dependencies,h.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return ue(_e,_e.current&1|2),t.child}e=e.sibling}h.tail!==null&&we()>jr&&(t.flags|=128,i=!0,Jr(h,!1),t.lanes=4194304)}else{if(!i)if(e=Os(m),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Jr(h,!0),h.tail===null&&h.tailMode==="hidden"&&!m.alternate&&!fe)return Me(t),null}else 2*we()-h.renderingStartTime>jr&&r!==1073741824&&(t.flags|=128,i=!0,Jr(h,!1),t.lanes=4194304);h.isBackwards?(m.sibling=t.child,t.child=m):(r=h.last,r!==null?r.sibling=m:t.child=m,h.last=m)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=we(),t.sibling=null,r=_e.current,ue(_e,i?r&1|2:r&1),t):(Me(t),null);case 22:case 23:return Ta(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Ve&1073741824&&(Me(t),t.subtreeFlags&6&&(t.flags|=8192)):Me(t),null;case 24:return null;case 25:return null}throw Error($(156,t.tag))}function Uf(e,t){switch(ua(t),t.tag){case 1:return $e(t.type)&&Ls(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Br(),de(Ue),de(Oe),Sa(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ma(t),null;case 13:if(de(_e),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 de(_e),null;case 4:return Br(),null;case 10:return pa(t.type._context),null;case 22:case 23:return Ta(),null;case 24:return null;default:return null}}var is=!1,Ae=!1,$f=typeof WeakSet=="function"?WeakSet:Set,Y=null;function xr(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){Se(e,t,i)}else r.current=null}function Eo(e,t,r){try{r()}catch(i){Se(e,t,i)}}var Fl=!1;function Kf(e,t){if(ao=xs,e=ou(),la(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 m=0,a=-1,u=-1,f=0,g=0,d=e,p=null;t:for(;;){for(var S;d!==r||n!==0&&d.nodeType!==3||(a=m+n),d!==h||i!==0&&d.nodeType!==3||(u=m+i),d.nodeType===3&&(m+=d.nodeValue.length),(S=d.firstChild)!==null;)p=d,d=S;for(;;){if(d===e)break t;if(p===r&&++f===n&&(a=m),p===h&&++g===i&&(u=m),(S=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=S}r=a===-1||u===-1?null:{start:a,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(lo={focusedElem:e,selectionRange:r},xs=!1,Y=t;Y!==null;)if(t=Y,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;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 _=w.memoizedProps,c=w.memoizedState,o=t.stateNode,s=o.getSnapshotBeforeUpdate(t.elementType===t.type?_:at(t.type,_),c);o.__reactInternalSnapshotBeforeUpdate=s}break;case 3:var l=t.stateNode.containerInfo;l.nodeType===1?l.textContent="":l.nodeType===9&&l.documentElement&&l.removeChild(l.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error($(163))}}catch(v){Se(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return w=Fl,Fl=!1,w}function hi(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&&Eo(t,r,h)}n=n.next}while(n!==i)}}function Js(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 rh(e){var t=e.alternate;t!==null&&(e.alternate=null,rh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vt],delete t[Ei],delete t[ho],delete t[Lf],delete t[Df])),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 ih(e){return e.tag===5||e.tag===3||e.tag===4}function zl(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ih(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=bs));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 Le=null,lt=!1;function Pt(e,t,r){for(r=r.child;r!==null;)sh(e,t,r),r=r.sibling}function sh(e,t,r){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount($s,r)}catch{}switch(r.tag){case 5:Ae||xr(r,t);case 6:var i=Le,n=lt;Le=null,Pt(e,t,r),Le=i,lt=n,Le!==null&&(lt?(e=Le,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Le.removeChild(r.stateNode));break;case 18:Le!==null&&(lt?(e=Le,r=r.stateNode,e.nodeType===8?Ln(e.parentNode,r):e.nodeType===1&&Ln(e,r),yi(e)):Ln(Le,r.stateNode));break;case 4:i=Le,n=lt,Le=r.stateNode.containerInfo,lt=!0,Pt(e,t,r),Le=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,m=h.destroy;h=h.tag,m!==void 0&&(h&2||h&4)&&Eo(r,t,m),n=n.next}while(n!==i)}Pt(e,t,r);break;case 1:if(!Ae&&(xr(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(a){Se(r,t,a)}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 Wl(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new $f),t.forEach(function(i){var n=ep.bind(null,e,i);r.has(i)||(r.add(i),i.then(n,n))})}}function ot(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,m=t,a=m;e:for(;a!==null;){switch(a.tag){case 5:Le=a.stateNode,lt=!1;break e;case 3:Le=a.stateNode.containerInfo,lt=!0;break e;case 4:Le=a.stateNode.containerInfo,lt=!0;break e}a=a.return}if(Le===null)throw Error($(160));sh(h,m,n),Le=null,lt=!1;var u=n.alternate;u!==null&&(u.return=null),n.return=null}catch(f){Se(n,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)nh(t,e),t=t.sibling}function nh(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ot(t,e),pt(e),i&4){try{hi(3,e,e.return),Js(3,e)}catch(_){Se(e,e.return,_)}try{hi(5,e,e.return)}catch(_){Se(e,e.return,_)}}break;case 1:ot(t,e),pt(e),i&512&&r!==null&&xr(r,r.return);break;case 5:if(ot(t,e),pt(e),i&512&&r!==null&&xr(r,r.return),e.flags&32){var n=e.stateNode;try{vi(n,"")}catch(_){Se(e,e.return,_)}}if(i&4&&(n=e.stateNode,n!=null)){var h=e.memoizedProps,m=r!==null?r.memoizedProps:h,a=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{a==="input"&&h.type==="radio"&&h.name!=null&&Lc(n,h),Yn(a,m);var f=Yn(a,h);for(m=0;m<u.length;m+=2){var g=u[m],d=u[m+1];g==="style"?Mc(n,d):g==="dangerouslySetInnerHTML"?Tc(n,d):g==="children"?vi(n,d):Xo(n,g,d,f)}switch(a){case"input":Vn(n,h);break;case"textarea":Dc(n,h);break;case"select":var p=n._wrapperState.wasMultiple;n._wrapperState.wasMultiple=!!h.multiple;var S=h.value;S!=null?Er(n,!!h.multiple,S,!1):p!==!!h.multiple&&(h.defaultValue!=null?Er(n,!!h.multiple,h.defaultValue,!0):Er(n,!!h.multiple,h.multiple?[]:"",!1))}n[Ei]=h}catch(_){Se(e,e.return,_)}}break;case 6:if(ot(t,e),pt(e),i&4){if(e.stateNode===null)throw Error($(162));n=e.stateNode,h=e.memoizedProps;try{n.nodeValue=h}catch(_){Se(e,e.return,_)}}break;case 3:if(ot(t,e),pt(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{yi(t.containerInfo)}catch(_){Se(e,e.return,_)}break;case 4:ot(t,e),pt(e);break;case 13:ot(t,e),pt(e),n=e.child,n.flags&8192&&(h=n.memoizedState!==null,n.stateNode.isHidden=h,!h||n.alternate!==null&&n.alternate.memoizedState!==null||(Da=we())),i&4&&Wl(e);break;case 22:if(g=r!==null&&r.memoizedState!==null,e.mode&1?(Ae=(f=Ae)||g,ot(t,e),Ae=f):ot(t,e),pt(e),i&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!g&&e.mode&1)for(Y=e,g=e.child;g!==null;){for(d=Y=g;Y!==null;){switch(p=Y,S=p.child,p.tag){case 0:case 11:case 14:case 15:hi(4,p,p.return);break;case 1:xr(p,p.return);var w=p.stateNode;if(typeof w.componentWillUnmount=="function"){i=p,r=p.return;try{t=i,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(_){Se(i,r,_)}}break;case 5:xr(p,p.return);break;case 22:if(p.memoizedState!==null){$l(d);continue}}S!==null?(S.return=p,Y=S):$l(d)}g=g.sibling}e:for(g=null,d=e;;){if(d.tag===5){if(g===null){g=d;try{n=d.stateNode,f?(h=n.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none"):(a=d.stateNode,u=d.memoizedProps.style,m=u!=null&&u.hasOwnProperty("display")?u.display:null,a.style.display=Pc("display",m))}catch(_){Se(e,e.return,_)}}}else if(d.tag===6){if(g===null)try{d.stateNode.nodeValue=f?"":d.memoizedProps}catch(_){Se(e,e.return,_)}}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;g===d&&(g=null),d=d.return}g===d&&(g=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:ot(t,e),pt(e),i&4&&Wl(e);break;case 21:break;default:ot(t,e),pt(e)}}function pt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(ih(r)){var i=r;break e}r=r.return}throw Error($(160))}switch(i.tag){case 5:var n=i.stateNode;i.flags&32&&(vi(n,""),i.flags&=-33);var h=zl(e);Do(e,h,n);break;case 3:case 4:var m=i.stateNode.containerInfo,a=zl(e);Lo(e,a,m);break;default:throw Error($(161))}}catch(u){Se(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Vf(e,t,r){Y=e,oh(e)}function oh(e,t,r){for(var i=(e.mode&1)!==0;Y!==null;){var n=Y,h=n.child;if(n.tag===22&&i){var m=n.memoizedState!==null||is;if(!m){var a=n.alternate,u=a!==null&&a.memoizedState!==null||Ae;a=is;var f=Ae;if(is=m,(Ae=u)&&!f)for(Y=n;Y!==null;)m=Y,u=m.child,m.tag===22&&m.memoizedState!==null?Kl(n):u!==null?(u.return=m,Y=u):Kl(n);for(;h!==null;)Y=h,oh(h),h=h.sibling;Y=n,is=a,Ae=f}Ul(e)}else n.subtreeFlags&8772&&h!==null?(h.return=n,Y=h):Ul(e)}}function Ul(e){for(;Y!==null;){var t=Y;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ae||Js(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:at(t.type,r.memoizedProps);i.componentDidUpdate(n,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var h=t.updateQueue;h!==null&&Ll(t,h,i);break;case 3:var m=t.updateQueue;if(m!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Ll(t,m,r)}break;case 5:var a=t.stateNode;if(r===null&&t.flags&4){r=a;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.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 g=f.memoizedState;if(g!==null){var d=g.dehydrated;d!==null&&yi(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(p){Se(t,t.return,p)}}if(t===e){Y=null;break}if(r=t.sibling,r!==null){r.return=t.return,Y=r;break}Y=t.return}}function $l(e){for(;Y!==null;){var t=Y;if(t===e){Y=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Y=r;break}Y=t.return}}function Kl(e){for(;Y!==null;){var t=Y;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Js(4,t)}catch(u){Se(t,r,u)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var n=t.return;try{i.componentDidMount()}catch(u){Se(t,n,u)}}var h=t.return;try{bo(t)}catch(u){Se(t,h,u)}break;case 5:var m=t.return;try{bo(t)}catch(u){Se(t,m,u)}}}catch(u){Se(t,t.return,u)}if(t===e){Y=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Y=a;break}Y=t.return}}var qf=Math.ceil,js=Dt.ReactCurrentDispatcher,ba=Dt.ReactCurrentOwner,it=Dt.ReactCurrentBatchConfig,ae=0,be=null,Ce=null,Re=0,Ve=0,kr=Xt(0),ke=0,Pi=null,lr=0,Zs=0,La=0,di=null,Fe=null,Da=0,jr=1/0,St=null,Ns=!1,Ro=null,Ut=null,ss=!1,jt=null,Hs=0,fi=0,To=null,_s=-1,vs=0;function Ie(){return ae&6?we():_s!==-1?_s:_s=we()}function $t(e){return e.mode&1?ae&2&&Re!==0?Re&-Re:Tf.transition!==null?(vs===0&&(vs=$c()),vs):(e=le,e!==0||(e=window.event,e=e===void 0?16:Yc(e.type)),e):1}function ht(e,t,r,i){if(50<fi)throw fi=0,To=null,Error($(185));Bi(e,r,i),(!(ae&2)||e!==be)&&(e===be&&(!(ae&2)&&(Zs|=r),ke===4&&Bt(e,Re)),Ke(e,i),r===1&&ae===0&&!(t.mode&1)&&(jr=we()+500,Xs&&Qt()))}function Ke(e,t){var r=e.callbackNode;Rd(e,t);var i=Cs(e,e===be?Re:0);if(i===0)r!==null&&el(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&el(r),t===1)e.tag===0?Rf(Vl.bind(null,e)):vu(Vl.bind(null,e)),Ef(function(){!(ae&6)&&Qt()}),r=null;else{switch(Kc(i)){case 1:r=ea;break;case 4:r=Wc;break;case 16:r=ws;break;case 536870912:r=Uc;break;default:r=ws}r=ph(r,ah.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function ah(e,t){if(_s=-1,vs=0,ae&6)throw Error($(327));var r=e.callbackNode;if(Tr()&&e.callbackNode!==r)return null;var i=Cs(e,e===be?Re:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=Fs(e,i);else{t=i;var n=ae;ae|=2;var h=ch();(be!==e||Re!==t)&&(St=null,jr=we()+500,rr(e,t));do try{Qf();break}catch(a){lh(e,a)}while(!0);fa(),js.current=h,ae=n,Ce!==null?t=0:(be=null,Re=0,t=ke)}if(t!==0){if(t===2&&(n=ro(e),n!==0&&(i=n,t=Po(e,n))),t===1)throw r=Pi,rr(e,0),Bt(e,i),Ke(e,we()),r;if(t===6)Bt(e,i);else{if(n=e.current.alternate,!(i&30)&&!Gf(n)&&(t=Fs(e,i),t===2&&(h=ro(e),h!==0&&(i=h,t=Po(e,h))),t===1))throw r=Pi,rr(e,0),Bt(e,i),Ke(e,we()),r;switch(e.finishedWork=n,e.finishedLanes=i,t){case 0:case 1:throw Error($(345));case 2:Jt(e,Fe,St);break;case 3:if(Bt(e,i),(i&130023424)===i&&(t=Da+500-we(),10<t)){if(Cs(e,0)!==0)break;if(n=e.suspendedLanes,(n&i)!==i){Ie(),e.pingedLanes|=e.suspendedLanes&n;break}e.timeoutHandle=uo(Jt.bind(null,e,Fe,St),t);break}Jt(e,Fe,St);break;case 4:if(Bt(e,i),(i&4194240)===i)break;for(t=e.eventTimes,n=-1;0<i;){var m=31-ut(i);h=1<<m,m=t[m],m>n&&(n=m),i&=~h}if(i=n,i=we()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*qf(i/1960))-i,10<i){e.timeoutHandle=uo(Jt.bind(null,e,Fe,St),i);break}Jt(e,Fe,St);break;case 5:Jt(e,Fe,St);break;default:throw Error($(329))}}}return Ke(e,we()),e.callbackNode===r?ah.bind(null,e):null}function Po(e,t){var r=di;return e.current.memoizedState.isDehydrated&&(rr(e,t).flags|=256),e=Fs(e,t),e!==2&&(t=Fe,Fe=r,t!==null&&Mo(t)),e}function Mo(e){Fe===null?Fe=e:Fe.push.apply(Fe,e)}function Gf(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(!dt(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&=~La,t&=~Zs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-ut(t),i=1<<r;e[r]=-1,t&=~i}}function Vl(e){if(ae&6)throw Error($(327));Tr();var t=Cs(e,0);if(!(t&1))return Ke(e,we()),null;var r=Fs(e,t);if(e.tag!==0&&r===2){var i=ro(e);i!==0&&(t=i,r=Po(e,i))}if(r===1)throw r=Pi,rr(e,0),Bt(e,t),Ke(e,we()),r;if(r===6)throw Error($(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Jt(e,Fe,St),Ke(e,we()),null}function Ra(e,t){var r=ae;ae|=1;try{return e(t)}finally{ae=r,ae===0&&(jr=we()+500,Xs&&Qt())}}function cr(e){jt!==null&&jt.tag===0&&!(ae&6)&&Tr();var t=ae;ae|=1;var r=it.transition,i=le;try{if(it.transition=null,le=1,e)return e()}finally{le=i,it.transition=r,ae=t,!(ae&6)&&Qt()}}function Ta(){Ve=kr.current,de(kr)}function rr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,kf(r)),Ce!==null)for(r=Ce.return;r!==null;){var i=r;switch(ua(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Ls();break;case 3:Br(),de(Ue),de(Oe),Sa();break;case 5:ma(i);break;case 4:Br();break;case 13:de(_e);break;case 19:de(_e);break;case 10:pa(i.type._context);break;case 22:case 23:Ta()}r=r.return}if(be=e,Ce=e=Kt(e.current,null),Re=Ve=t,ke=0,Pi=null,La=Zs=lr=0,Fe=di=null,er!==null){for(t=0;t<er.length;t++)if(r=er[t],i=r.interleaved,i!==null){r.interleaved=null;var n=i.next,h=r.pending;if(h!==null){var m=h.next;h.next=n,i.next=m}r.pending=i}er=null}return e}function lh(e,t){do{var r=Ce;try{if(fa(),ds.current=Is,Bs){for(var i=ge.memoizedState;i!==null;){var n=i.queue;n!==null&&(n.pending=null),i=i.next}Bs=!1}if(ar=0,Ee=xe=ge=null,ui=!1,Di=0,ba.current=null,r===null||r.return===null){ke=1,Pi=t,Ce=null;break}e:{var h=e,m=r.return,a=r,u=t;if(t=Re,a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,g=a,d=g.tag;if(!(g.mode&1)&&(d===0||d===11||d===15)){var p=g.alternate;p?(g.updateQueue=p.updateQueue,g.memoizedState=p.memoizedState,g.lanes=p.lanes):(g.updateQueue=null,g.memoizedState=null)}var S=Al(m);if(S!==null){S.flags&=-257,Ol(S,m,a,h,t),S.mode&1&&Ml(h,f,t),t=S,u=f;var w=t.updateQueue;if(w===null){var _=new Set;_.add(u),t.updateQueue=_}else w.add(u);break e}else{if(!(t&1)){Ml(h,f,t),Pa();break e}u=Error($(426))}}else if(fe&&a.mode&1){var c=Al(m);if(c!==null){!(c.flags&65536)&&(c.flags|=256),Ol(c,m,a,h,t),ha(Ir(u,a));break e}}h=u=Ir(u,a),ke!==4&&(ke=2),di===null?di=[h]:di.push(h),h=m;do{switch(h.tag){case 3:h.flags|=65536,t&=-t,h.lanes|=t;var o=Ku(h,u,t);bl(h,o);break e;case 1:a=u;var s=h.type,l=h.stateNode;if(!(h.flags&128)&&(typeof s.getDerivedStateFromError=="function"||l!==null&&typeof l.componentDidCatch=="function"&&(Ut===null||!Ut.has(l)))){h.flags|=65536,t&=-t,h.lanes|=t;var v=Vu(h,a,t);bl(h,v);break e}}h=h.return}while(h!==null)}hh(r)}catch(C){t=C,Ce===r&&r!==null&&(Ce=r=r.return);continue}break}while(!0)}function ch(){var e=js.current;return js.current=Is,e===null?Is:e}function Pa(){(ke===0||ke===3||ke===2)&&(ke=4),be===null||!(lr&268435455)&&!(Zs&268435455)||Bt(be,Re)}function Fs(e,t){var r=ae;ae|=2;var i=ch();(be!==e||Re!==t)&&(St=null,rr(e,t));do try{Xf();break}catch(n){lh(e,n)}while(!0);if(fa(),ae=r,js.current=i,Ce!==null)throw Error($(261));return be=null,Re=0,ke}function Xf(){for(;Ce!==null;)uh(Ce)}function Qf(){for(;Ce!==null&&!yd();)uh(Ce)}function uh(e){var t=fh(e.alternate,e,Ve);e.memoizedProps=e.pendingProps,t===null?hh(e):Ce=t,ba.current=null}function hh(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Uf(r,t),r!==null){r.flags&=32767,Ce=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ke=6,Ce=null;return}}else if(r=Wf(r,t,Ve),r!==null){Ce=r;return}if(t=t.sibling,t!==null){Ce=t;return}Ce=t=e}while(t!==null);ke===0&&(ke=5)}function Jt(e,t,r){var i=le,n=it.transition;try{it.transition=null,le=1,Yf(e,t,r,i)}finally{it.transition=n,le=i}return null}function Yf(e,t,r,i){do Tr();while(jt!==null);if(ae&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(Td(e,h),e===be&&(Ce=be=null,Re=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||ss||(ss=!0,ph(ws,function(){return Tr(),null})),h=(r.flags&15990)!==0,r.subtreeFlags&15990||h){h=it.transition,it.transition=null;var m=le;le=1;var a=ae;ae|=4,ba.current=null,Kf(e,r),nh(r,e),gf(lo),xs=!!ao,lo=ao=null,e.current=r,Vf(r),wd(),ae=a,le=m,it.transition=h}else e.current=r;if(ss&&(ss=!1,jt=e,Hs=n),h=e.pendingLanes,h===0&&(Ut=null),kd(r.stateNode),Ke(e,we()),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(Ns)throw Ns=!1,e=Ro,Ro=null,e;return Hs&1&&e.tag!==0&&Tr(),h=e.pendingLanes,h&1?e===To?fi++:(fi=0,To=e):fi=0,Qt(),null}function Tr(){if(jt!==null){var e=Kc(Hs),t=it.transition,r=le;try{if(it.transition=null,le=16>e?16:e,jt===null)var i=!1;else{if(e=jt,jt=null,Hs=0,ae&6)throw Error($(331));var n=ae;for(ae|=4,Y=e.current;Y!==null;){var h=Y,m=h.child;if(Y.flags&16){var a=h.deletions;if(a!==null){for(var u=0;u<a.length;u++){var f=a[u];for(Y=f;Y!==null;){var g=Y;switch(g.tag){case 0:case 11:case 15:hi(8,g,h)}var d=g.child;if(d!==null)d.return=g,Y=d;else for(;Y!==null;){g=Y;var p=g.sibling,S=g.return;if(rh(g),g===f){Y=null;break}if(p!==null){p.return=S,Y=p;break}Y=S}}}var w=h.alternate;if(w!==null){var _=w.child;if(_!==null){w.child=null;do{var c=_.sibling;_.sibling=null,_=c}while(_!==null)}}Y=h}}if(h.subtreeFlags&2064&&m!==null)m.return=h,Y=m;else e:for(;Y!==null;){if(h=Y,h.flags&2048)switch(h.tag){case 0:case 11:case 15:hi(9,h,h.return)}var o=h.sibling;if(o!==null){o.return=h.return,Y=o;break e}Y=h.return}}var s=e.current;for(Y=s;Y!==null;){m=Y;var l=m.child;if(m.subtreeFlags&2064&&l!==null)l.return=m,Y=l;else e:for(m=s;Y!==null;){if(a=Y,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Js(9,a)}}catch(C){Se(a,a.return,C)}if(a===m){Y=null;break e}var v=a.sibling;if(v!==null){v.return=a.return,Y=v;break e}Y=a.return}}if(ae=n,Qt(),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot($s,e)}catch{}i=!0}return i}finally{le=r,it.transition=t}}return!1}function ql(e,t,r){t=Ir(r,t),t=Ku(e,t,1),e=Wt(e,t,1),t=Ie(),e!==null&&(Bi(e,1,t),Ke(e,t))}function Se(e,t,r){if(e.tag===3)ql(e,e,r);else for(;t!==null;){if(t.tag===3){ql(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Ut===null||!Ut.has(i))){e=Ir(r,e),e=Vu(t,e,1),t=Wt(t,e,1),e=Ie(),t!==null&&(Bi(t,1,e),Ke(t,e));break}}t=t.return}}function Jf(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=Ie(),e.pingedLanes|=e.suspendedLanes&r,be===e&&(Re&r)===r&&(ke===4||ke===3&&(Re&130023424)===Re&&500>we()-Da?rr(e,0):La|=r),Ke(e,t)}function dh(e,t){t===0&&(e.mode&1?(t=Gi,Gi<<=1,!(Gi&130023424)&&(Gi=4194304)):t=1);var r=Ie();e=bt(e,t),e!==null&&(Bi(e,t,r),Ke(e,r))}function Zf(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),dh(e,r)}function ep(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),dh(e,r)}var fh;fh=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ue.current)We=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return We=!1,zf(e,t,r);We=!!(e.flags&131072)}else We=!1,fe&&t.flags&1048576&&gu(t,Ts,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;ps(e,t),e=t.pendingProps;var n=Mr(t,Oe.current);Rr(t,r),n=wa(null,t,i,e,n,r);var h=Ca();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,$e(i)?(h=!0,Ds(t)):h=!1,t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,va(t),n.updater=Ys,t.stateNode=n,n._reactInternals=t,mo(t,i,e,r),t=wo(null,t,i,!0,h,r)):(t.tag=0,fe&&h&&ca(t),Be(null,t,n,r),t=t.child),t;case 16:i=t.elementType;e:{switch(ps(e,t),e=t.pendingProps,n=i._init,i=n(i._payload),t.type=i,n=t.tag=rp(i),e=at(i,e),n){case 0:t=yo(null,t,i,e,r);break e;case 1:t=jl(null,t,i,e,r);break e;case 11:t=Bl(null,t,i,e,r);break e;case 14:t=Il(null,t,i,at(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:at(i,n),yo(e,t,i,n,r);case 1:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:at(i,n),jl(e,t,i,n,r);case 3:e:{if(Qu(t),e===null)throw Error($(387));i=t.pendingProps,h=t.memoizedState,n=h.element,xu(e,t),As(t,i,null,r);var m=t.memoizedState;if(i=m.element,h.isDehydrated)if(h={element:i,isDehydrated:!1,cache:m.cache,pendingSuspenseBoundaries:m.pendingSuspenseBoundaries,transitions:m.transitions},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){n=Ir(Error($(423)),t),t=Nl(e,t,i,r,n);break e}else if(i!==n){n=Ir(Error($(424)),t),t=Nl(e,t,i,r,n);break e}else for(qe=zt(t.stateNode.containerInfo.firstChild),Ge=t,fe=!0,ct=null,r=wu(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ar(),i===n){t=Lt(e,t,r);break e}Be(e,t,i,r)}t=t.child}return t;case 5:return ku(t),e===null&&_o(t),i=t.type,n=t.pendingProps,h=e!==null?e.memoizedProps:null,m=n.children,co(i,n)?m=null:h!==null&&co(i,h)&&(t.flags|=32),Xu(e,t),Be(e,t,m,r),t.child;case 6:return e===null&&_o(t),null;case 13:return Yu(e,t,r);case 4:return ga(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Or(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:at(i,n),Bl(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,m=n.value,ue(Ps,i._currentValue),i._currentValue=m,h!==null)if(dt(h.value,m)){if(h.children===n.children&&!Ue.current){t=Lt(e,t,r);break e}}else for(h=t.child,h!==null&&(h.return=t);h!==null;){var a=h.dependencies;if(a!==null){m=h.child;for(var u=a.firstContext;u!==null;){if(u.context===i){if(h.tag===1){u=xt(-1,r&-r),u.tag=2;var f=h.updateQueue;if(f!==null){f=f.shared;var g=f.pending;g===null?u.next=u:(u.next=g.next,g.next=u),f.pending=u}}h.lanes|=r,u=h.alternate,u!==null&&(u.lanes|=r),vo(h.return,r,t),a.lanes|=r;break}u=u.next}}else if(h.tag===10)m=h.type===t.type?null:h.child;else if(h.tag===18){if(m=h.return,m===null)throw Error($(341));m.lanes|=r,a=m.alternate,a!==null&&(a.lanes|=r),vo(m,r,t),m=h.sibling}else m=h.child;if(m!==null)m.return=h;else for(m=h;m!==null;){if(m===t){m=null;break}if(h=m.sibling,h!==null){h.return=m.return,m=h;break}m=m.return}h=m}Be(e,t,n.children,r),t=t.child}return t;case 9:return n=t.type,i=t.pendingProps.children,Rr(t,r),n=st(n),i=i(n),t.flags|=1,Be(e,t,i,r),t.child;case 14:return i=t.type,n=at(i,t.pendingProps),n=at(i.type,n),Il(e,t,i,n,r);case 15:return qu(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:at(i,n),ps(e,t),t.tag=1,$e(i)?(e=!0,Ds(t)):e=!1,Rr(t,r),$u(t,i,n),mo(t,i,n,r),wo(null,t,i,!0,e,r);case 19:return Ju(e,t,r);case 22:return Gu(e,t,r)}throw Error($(156,t.tag))};function ph(e,t){return zc(e,t)}function tp(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 rt(e,t,r,i){return new tp(e,t,r,i)}function Ma(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rp(e){if(typeof e=="function")return Ma(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Yo)return 11;if(e===Jo)return 14}return 2}function Kt(e,t){var r=e.alternate;return r===null?(r=rt(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 gs(e,t,r,i,n,h){var m=2;if(i=e,typeof e=="function")Ma(e)&&(m=1);else if(typeof e=="string")m=5;else e:switch(e){case pr:return ir(r.children,n,h,t);case Qo:m=8,n|=8;break;case zn:return e=rt(12,r,t,n|2),e.elementType=zn,e.lanes=h,e;case Wn:return e=rt(13,r,t,n),e.elementType=Wn,e.lanes=h,e;case Un:return e=rt(19,r,t,n),e.elementType=Un,e.lanes=h,e;case kc:return en(r,n,h,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Cc:m=10;break e;case xc:m=9;break e;case Yo:m=11;break e;case Jo:m=14;break e;case Mt:m=16,i=null;break e}throw Error($(130,e==null?e:typeof e,""))}return t=rt(m,r,t,n),t.elementType=e,t.type=i,t.lanes=h,t}function ir(e,t,r,i){return e=rt(7,e,i,t),e.lanes=r,e}function en(e,t,r,i){return e=rt(22,e,i,t),e.elementType=kc,e.lanes=r,e.stateNode={isHidden:!1},e}function Bn(e,t,r){return e=rt(6,e,null,t),e.lanes=r,e}function In(e,t,r){return t=rt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ip(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 Aa(e,t,r,i,n,h,m,a,u){return e=new ip(e,t,r,a,u),t===1?(t=1,h===!0&&(t|=8)):t=0,h=rt(3,null,null,t),e.current=h,h.stateNode=e,h.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},va(h),e}function sp(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:fr,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function _h(e){if(!e)return qt;e=e._reactInternals;e:{if(hr(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($e(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($e(r))return _u(e,r,t)}return t}function vh(e,t,r,i,n,h,m,a,u){return e=Aa(r,i,!0,e,n,h,m,a,u),e.context=_h(null),r=e.current,i=Ie(),n=$t(r),h=xt(i,n),h.callback=t??null,Wt(r,h,n),e.current.lanes=n,Bi(e,n,i),Ke(e,i),e}function tn(e,t,r,i){var n=t.current,h=Ie(),m=$t(n);return r=_h(r),t.context===null?t.context=r:t.pendingContext=r,t=xt(h,m),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=Wt(n,t,m),e!==null&&(ht(e,n,m,h),hs(e,n,m)),m}function zs(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 Gl(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Oa(e,t){Gl(e,t),(e=e.alternate)&&Gl(e,t)}function np(){return null}var gh=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ba(e){this._internalRoot=e}rn.prototype.render=Ba.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error($(409));tn(e,t,null,null)};rn.prototype.unmount=Ba.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cr(function(){tn(null,e,null,null)}),t[Et]=null}};function rn(e){this._internalRoot=e}rn.prototype.unstable_scheduleHydration=function(e){if(e){var t=Gc();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Ot.length&&t!==0&&t<Ot[r].priority;r++);Ot.splice(r,0,e),r===0&&Qc(e)}};function Ia(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function sn(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Xl(){}function op(e,t,r,i,n){if(n){if(typeof i=="function"){var h=i;i=function(){var f=zs(m);h.call(f)}}var m=vh(t,i,e,0,null,!1,!1,"",Xl);return e._reactRootContainer=m,e[Et]=m.current,xi(e.nodeType===8?e.parentNode:e),cr(),m}for(;n=e.lastChild;)e.removeChild(n);if(typeof i=="function"){var a=i;i=function(){var f=zs(u);a.call(f)}}var u=Aa(e,0,!1,null,null,!1,!1,"",Xl);return e._reactRootContainer=u,e[Et]=u.current,xi(e.nodeType===8?e.parentNode:e),cr(function(){tn(t,u,r,i)}),u}function nn(e,t,r,i,n){var h=r._reactRootContainer;if(h){var m=h;if(typeof n=="function"){var a=n;n=function(){var u=zs(m);a.call(u)}}tn(t,m,e,n)}else m=op(r,t,e,n,i);return zs(m)}Vc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=ri(t.pendingLanes);r!==0&&(ta(t,r|1),Ke(t,we()),!(ae&6)&&(jr=we()+500,Qt()))}break;case 13:cr(function(){var i=bt(e,1);if(i!==null){var n=Ie();ht(i,e,1,n)}}),Oa(e,1)}};ra=function(e){if(e.tag===13){var t=bt(e,134217728);if(t!==null){var r=Ie();ht(t,e,134217728,r)}Oa(e,134217728)}};qc=function(e){if(e.tag===13){var t=$t(e),r=bt(e,t);if(r!==null){var i=Ie();ht(r,e,t,i)}Oa(e,t)}};Gc=function(){return le};Xc=function(e,t){var r=le;try{return le=e,t()}finally{le=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=Gs(i);if(!n)throw Error($(90));bc(i),Vn(i,n)}}}break;case"textarea":Dc(e,r);break;case"select":t=r.value,t!=null&&Er(e,!!r.multiple,t,!1)}};Bc=Ra;Ic=cr;var ap={usingClientEntryPoint:!1,Events:[ji,mr,Gs,Ac,Oc,Ra]},Zr={findFiberByHostInstance:Zt,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},lp={bundleType:Zr.bundleType,version:Zr.version,rendererPackageName:Zr.rendererPackageName,rendererConfig:Zr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Dt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Hc(e),e===null?null:e.stateNode},findFiberByHostInstance:Zr.findFiberByHostInstance||np,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 ns=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ns.isDisabled&&ns.supportsFiber)try{$s=ns.inject(lp),gt=ns}catch{}}Qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ap;Qe.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ia(t))throw Error($(200));return sp(e,t,null,r)};Qe.createRoot=function(e,t){if(!Ia(e))throw Error($(299));var r=!1,i="",n=gh;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(n=t.onRecoverableError)),t=Aa(e,1,!1,null,null,r,!1,i,n),e[Et]=t.current,xi(e.nodeType===8?e.parentNode:e),new Ba(t)};Qe.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=Hc(t),e=e===null?null:e.stateNode,e};Qe.flushSync=function(e){return cr(e)};Qe.hydrate=function(e,t,r){if(!sn(t))throw Error($(200));return nn(null,e,t,!0,r)};Qe.hydrateRoot=function(e,t,r){if(!Ia(e))throw Error($(405));var i=r!=null&&r.hydratedSources||null,n=!1,h="",m=gh;if(r!=null&&(r.unstable_strictMode===!0&&(n=!0),r.identifierPrefix!==void 0&&(h=r.identifierPrefix),r.onRecoverableError!==void 0&&(m=r.onRecoverableError)),t=vh(t,null,e,1,r??null,n,!1,h,m),e[Et]=t.current,xi(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 rn(t)};Qe.render=function(e,t,r){if(!sn(t))throw Error($(200));return nn(null,e,t,!1,r)};Qe.unmountComponentAtNode=function(e){if(!sn(e))throw Error($(40));return e._reactRootContainer?(cr(function(){nn(null,null,e,!1,function(){e._reactRootContainer=null,e[Et]=null})}),!0):!1};Qe.unstable_batchedUpdates=Ra;Qe.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!sn(r))throw Error($(200));if(e==null||e._reactInternals===void 0)throw Error($(38));return nn(e,t,r,!1,i)};Qe.version="18.3.1-next-f1338f8080-20240426";function mh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(mh)}catch(e){console.error(e)}}mh(),mc.exports=Qe;var cp=mc.exports,Ql=cp;Hn.createRoot=Ql.createRoot,Hn.hydrateRoot=Ql.hydrateRoot;const up={},Yl=e=>{let t;const r=new Set,i=(g,d)=>{const p=typeof g=="function"?g(t):g;if(!Object.is(p,t)){const S=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(w=>w(t,S))}},n=()=>t,u={setState:i,getState:n,getInitialState:()=>f,subscribe:g=>(r.add(g),()=>r.delete(g)),destroy:()=>{(up?"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,u);return u},hp=e=>e?Yl(e):Yl;var Sh={exports:{}},yh={},wh={exports:{}},Ch={};/**
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=Q;function dp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var fp=typeof Object.is=="function"?Object.is:dp,pp=Nr.useState,_p=Nr.useEffect,vp=Nr.useLayoutEffect,gp=Nr.useDebugValue;function mp(e,t){var r=t(),i=pp({inst:{value:r,getSnapshot:t}}),n=i[0].inst,h=i[1];return vp(function(){n.value=r,n.getSnapshot=t,jn(n)&&h({inst:n})},[e,r,t]),_p(function(){return jn(n)&&h({inst:n}),e(function(){jn(n)&&h({inst:n})})},[e]),gp(r),r}function jn(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!fp(e,r)}catch{return!0}}function Sp(e,t){return t()}var yp=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Sp:mp;Ch.useSyncExternalStore=Nr.useSyncExternalStore!==void 0?Nr.useSyncExternalStore:yp;wh.exports=Ch;var wp=wh.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 on=Q,Cp=wp;function xp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kp=typeof Object.is=="function"?Object.is:xp,Ep=Cp.useSyncExternalStore,bp=on.useRef,Lp=on.useEffect,Dp=on.useMemo,Rp=on.useDebugValue;yh.useSyncExternalStoreWithSelector=function(e,t,r,i,n){var h=bp(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=Dp(function(){function u(S){if(!f){if(f=!0,g=S,S=i(S),n!==void 0&&m.hasValue){var w=m.value;if(n(w,S))return d=w}return d=S}if(w=d,kp(g,S))return w;var _=i(S);return n!==void 0&&n(w,_)?(g=S,w):(g=S,d=_)}var f=!1,g,d,p=r===void 0?null:r;return[function(){return u(t())},p===null?void 0:function(){return u(p())}]},[t,r,i,n]);var a=Ep(e,h[0],h[1]);return Lp(function(){m.hasValue=!0,m.value=a},[a]),Rp(a),a};Sh.exports=yh;var Tp=Sh.exports;const Pp=nc(Tp),xh={},{useDebugValue:Mp}=vc,{useSyncExternalStoreWithSelector:Ap}=Pp;let Jl=!1;const Op=e=>e;function Bp(e,t=Op,r){(xh?"production":void 0)!=="production"&&r&&!Jl&&(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"),Jl=!0);const i=Ap(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return Mp(i),i}const Zl=e=>{(xh?"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"?hp(e):e,r=(i,n)=>Bp(t,i,n);return Object.assign(r,t),r},Hi=e=>e?Zl(e):Zl,De=Hi((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)})),Ip={};function jp(e,t){let r;try{r=e()}catch{return}return{getItem:n=>{var h;const m=u=>u===null?null:JSON.parse(u,void 0),a=(h=r.getItem(n))!=null?h:null;return a instanceof Promise?a.then(m):m(a)},setItem:(n,h)=>r.setItem(n,JSON.stringify(h,void 0)),removeItem:n=>r.removeItem(n)}}const Mi=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(i){return Mi(i)(r)},catch(i){return this}}}catch(r){return{then(i){return this},catch(i){return Mi(i)(r)}}}},Np=(e,t)=>(r,i,n)=>{let h={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:c=>c,version:0,merge:(c,o)=>({...o,...c}),...t},m=!1;const a=new Set,u=new Set;let f;try{f=h.getStorage()}catch{}if(!f)return e((...c)=>{console.warn(`[zustand persist middleware] Unable to update item '${h.name}', the given storage is currently unavailable.`),r(...c)},i,n);const g=Mi(h.serialize),d=()=>{const c=h.partialize({...i()});let o;const s=g({state:c,version:h.version}).then(l=>f.setItem(h.name,l)).catch(l=>{o=l});if(o)throw o;return s},p=n.setState;n.setState=(c,o)=>{p(c,o),d()};const S=e((...c)=>{r(...c),d()},i,n);let w;const _=()=>{var c;if(!f)return;m=!1,a.forEach(s=>s(i()));const o=((c=h.onRehydrateStorage)==null?void 0:c.call(h,i()))||void 0;return Mi(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 l;return w=h.merge(s,(l=i())!=null?l:S),r(w,!0),d()}).then(()=>{o==null||o(w,void 0),m=!0,u.forEach(s=>s(w))}).catch(s=>{o==null||o(void 0,s)})};return n.persist={setOptions:c=>{h={...h,...c},c.getStorage&&(f=c.getStorage())},clearStorage:()=>{f==null||f.removeItem(h.name)},getOptions:()=>h,rehydrate:()=>_(),hasHydrated:()=>m,onHydrate:c=>(a.add(c),()=>{a.delete(c)}),onFinishHydration:c=>(u.add(c),()=>{u.delete(c)})},_(),w||S},Hp=(e,t)=>(r,i,n)=>{let h={storage:jp(()=>localStorage),partialize:_=>_,version:0,merge:(_,c)=>({...c,..._}),...t},m=!1;const a=new Set,u=new Set;let f=h.storage;if(!f)return e((..._)=>{console.warn(`[zustand persist middleware] Unable to update item '${h.name}', the given storage is currently unavailable.`),r(..._)},i,n);const g=()=>{const _=h.partialize({...i()});return f.setItem(h.name,{state:_,version:h.version})},d=n.setState;n.setState=(_,c)=>{d(_,c),g()};const p=e((..._)=>{r(..._),g()},i,n);n.getInitialState=()=>p;let S;const w=()=>{var _,c;if(!f)return;m=!1,a.forEach(s=>{var l;return s((l=i())!=null?l:p)});const o=((c=h.onRehydrateStorage)==null?void 0:c.call(h,(_=i())!=null?_:p))||void 0;return Mi(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 l;const[v,C]=s;if(S=h.merge(C,(l=i())!=null?l:p),r(S,!0),v)return g()}).then(()=>{o==null||o(S,void 0),S=i(),m=!0,u.forEach(s=>s(S))}).catch(s=>{o==null||o(void 0,s)})};return n.persist={setOptions:_=>{h={...h,..._},_.storage&&(f=_.storage)},clearStorage:()=>{f==null||f.removeItem(h.name)},getOptions:()=>h,rehydrate:()=>w(),hasHydrated:()=>m,onHydrate:_=>(a.add(_),()=>{a.delete(_)}),onFinishHydration:_=>(u.add(_),()=>{u.delete(_)})},h.skipHydration||w(),S||p},Fp=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((Ip?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),Np(e,t)):Hp(e,t),kh=Fp,ve=Hi()(kh((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,m=i.activeProjectId===r?Object.keys(h)[0]??null:i.activeProjectId;return{projects:h,activeProjectId:m}}),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(m=>m!==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}})),zp=.1,Wp=.9,Up=16,$p={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"},Kp={background:"#ffffff",foreground:"#1a1a2e",cursor:"#1a1a2e",cursorAccent:"#ffffff",selectionBackground:"#5b5bd630",selectionForeground:"#1a1a2e",black:"#1a1a2e",red:"#dc3545",green:"#1a8f5c",yellow:"#b58900",blue:"#5b5bd6",magenta:"#9b3bb0",cyan:"#0f8a7e",white:"#f5f5f7",brightBlack:"#8888a0",brightRed:"#e5484d",brightGreen:"#30a46c",brightYellow:"#d4a017",brightBlue:"#6e6ee6",brightMagenta:"#ab4aba",brightCyan:"#12a594",brightWhite:"#ffffff"};function ye(e){return e?e.type==="leaf"?[e.terminalId]:[...ye(e.first),...ye(e.second)]:[]}function Ao(e,t){if(e.type==="leaf")return null;const r=ye(e.first),i=ye(e.second);return r.includes(t)||i.includes(t)?e.direction:Ao(e.first,t)??Ao(e.second,t)}function Vp(e,t,r,i){if(!e)return{type:"leaf",terminalId:r};const n=i??(Ao(e,t)==="vertical"?"horizontal":"vertical");return Oo(e,t,r,n)}function Oo(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:Oo(e.first,t,r,i),second:Oo(e.second,t,r,i)}}function Ws(e,t){if(!e)return null;if(e.type==="leaf")return e.terminalId===t?null:e;const r=ye(e.first),i=ye(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=Ws(e.first,t);return n?{...e,first:n}:e.second}if(i.includes(t)){const n=Ws(e.second,t);return n?{...e,second:n}:e.first}return e}function Bo(e,t,r){const i=Math.max(zp,Math.min(Wp,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:Bo(e.first,h,i)}:{...e,second:Bo(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 qp(e,t,r,i){const n=Ws(e,t);return n?jo(n,r,t,i==="left"||i==="right"?"vertical":"horizontal",i==="left"||i==="top"):null}function jo(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:jo(e.first,t,r,i,n),second:jo(e.second,t,r,i,n)}}const pi=["even-horizontal","even-vertical","main-left","main-top","grid"];function Ai(e,t){if(e.length===0)return null;if(e.length===1)return{type:"leaf",terminalId:e[0]};switch(t){case"even-horizontal":return sr(e,"horizontal");case"even-vertical":return sr(e,"vertical");case"main-left":return ec(e,"vertical");case"main-top":return ec(e,"horizontal");case"grid":return Gp(e)}}function sr(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:sr(e.slice(1),t)}}function ec(e,t,r){const[i,...n]=e,m=sr(n,t==="vertical"?"horizontal":"vertical");return{type:"split",direction:t,ratio:.6,first:{type:"leaf",terminalId:i},second:m}}function Gp(e){if(e.length<=2)return sr(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:sr(r,"vertical"),second:i.length>0?sr(i,"vertical"):{type:"leaf",terminalId:r[r.length-1]}}}function Nn(e,t,r){const i=ye(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 oe=Hi((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(m=>{const a=m.layouts[r]??null,u=Vp(a,i,n,h);return{layouts:{...m.layouts,[r]:u}}}),removePaneFromProject:(r,i)=>e(n=>{const h=n.layouts[r];if(!h)return n;const m=Ws(h,i);return{layouts:{...n.layouts,[r]:m}}}),resizePaneInProject:(r,i,n)=>e(h=>{const m=h.layouts[r];if(!m)return h;const a=Bo(m,i,n);return{layouts:{...h.layouts,[r]:a}}}),swapPanesInProject:(r,i,n)=>e(h=>{const m=h.layouts[r];if(!m)return h;const a=Io(m,i,n);return{layouts:{...h.layouts,[r]:a}}}),movePaneInProject:(r,i,n,h)=>e(m=>{const a=m.layouts[r];if(!a)return m;const u=qp(a,i,n,h);return{layouts:{...m.layouts,[r]:u}}}),applyPresetToProject:(r,i)=>e(n=>{const h=pi[n.currentPresetIndex],m=Ai(i,h);return{layouts:{...n.layouts,[r]:m}}}),cyclePreset:(r,i)=>e(n=>{const h=(n.currentPresetIndex+1)%pi.length,m=pi[h],a=Ai(i,m);return{currentPresetIndex:h,layouts:{...n.layouts,[r]:a}}}),removeProjectLayout:r=>e(i=>{const{[r]:n,...h}=i.layouts;return{layouts:h}})}));function No(e){document.documentElement.setAttribute("data-theme",e)}function Xp(e){return e==="system"?window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark":e}const Eh=localStorage.getItem("paneful:theme")||"system";No(Eh);const re=Hi((e,t)=>({focusedTerminalId:null,sidebarOpen:!0,sidebarWidth:Number(localStorage.getItem("paneful:sidebar-width"))||224,draggingTerminalId:null,dropTarget:null,connectionStatus:"connecting",editorSyncEnabled:localStorage.getItem("paneful:editor-sync")!=="0",theme:Eh,setFocusedTerminal:r=>e({focusedTerminalId:r}),toggleSidebar:()=>e(r=>({sidebarOpen:!r.sidebarOpen})),setSidebarOpen:r=>e({sidebarOpen:r}),setSidebarWidth:r=>{const i=Math.min(400,Math.max(160,r));localStorage.setItem("paneful:sidebar-width",String(i)),e({sidebarWidth:i})},setDragging:r=>e({draggingTerminalId:r}),setDropTarget:r=>e({dropTarget:r}),setConnectionStatus:r=>e({connectionStatus:r}),toggleEditorSync:()=>e(r=>{const i=!r.editorSyncEnabled;return localStorage.setItem("paneful:editor-sync",i?"1":"0"),{editorSyncEnabled:i}}),setTheme:r=>{localStorage.setItem("paneful:theme",r),No(r),e({theme:r})},cycleTheme:()=>{const r=["system","light","dark"],i=t().theme,n=r[(r.indexOf(i)+1)%r.length];localStorage.setItem("paneful:theme",n),No(n),e({theme:n})}}));var bh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(globalThis,()=>(()=>{var r={4567:function(m,a,u){var f=this&&this.__decorate||function(s,l,v,C){var x,k=arguments.length,y=k<3?l:C===null?C=Object.getOwnPropertyDescriptor(l,v):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,l,v,C);else for(var b=s.length-1;b>=0;b--)(x=s[b])&&(y=(k<3?x(y):k>3?x(l,v,y):x(l,v))||y);return k>3&&y&&Object.defineProperty(l,v,y),y},g=this&&this.__param||function(s,l){return function(v,C){l(v,C,s)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const d=u(9042),p=u(9924),S=u(844),w=u(4725),_=u(2585),c=u(3656);let o=a.AccessibilityManager=class extends S.Disposable{constructor(s,l,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 p.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,c.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 l=0;l<s;l++)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,l){this._liveRegionDebouncer.refresh(s,l,this._terminal.rows)}_renderRows(s,l){const v=this._terminal.buffer,C=v.lines.length.toString();for(let x=s;x<=l;x++){const k=v.lines.get(v.ydisp+x),y=[],b=(k==null?void 0:k.translateToString(!0,void 0,void 0,y))||"",R=(v.ydisp+x+1).toString(),M=this._rowElements[x];M&&(b.length===0?(M.innerText=" ",this._rowColumns.set(M,[0,1])):(M.textContent=b,this._rowColumns.set(M,y)),M.setAttribute("aria-posinset",R),M.setAttribute("aria-setsize",C))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(s,l){const v=s.target,C=this._rowElements[l===0?1:this._rowElements.length-2];if(v.getAttribute("aria-posinset")===(l===0?"1":`${this._terminal.buffer.lines.length}`)||s.relatedTarget!==C)return;let x,k;if(l===0?(x=v,k=this._rowElements.pop(),this._rowContainer.removeChild(k)):(x=this._rowElements.shift(),k=v,this._rowContainer.removeChild(x)),x.removeEventListener("focus",this._topBoundaryFocusListener),k.removeEventListener("focus",this._bottomBoundaryFocusListener),l===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(l===0?-1:1),this._rowElements[l===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 l={node:s.anchorNode,offset:s.anchorOffset},v={node:s.focusNode,offset:s.focusOffset};if((l.node.compareDocumentPosition(v.node)&Node.DOCUMENT_POSITION_PRECEDING||l.node===v.node&&l.offset>v.offset)&&([l,v]=[v,l]),l.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(l={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(l.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:M})=>{const B=R instanceof Text?R.parentNode:R;let T=parseInt(B==null?void 0:B.getAttribute("aria-posinset"),10)-1;if(isNaN(T))return console.warn("row is invalid. Race condition?"),null;const N=this._rowColumns.get(B);if(!N)return console.warn("columns is null. Race condition?"),null;let F=M<N.length?N[M]:N.slice(-1)[0]+1;return F>=this._terminal.cols&&(++T,F=0),{row:T,column:F}},k=x(l),y=x(v);if(k&&y){if(k.row>y.row||k.row===y.row&&k.column>=y.column)throw new Error("invalid range");this._terminal.select(k.column,k.row,(y.row-k.row)*this._terminal.cols-k.column+y.column)}}_handleResize(s){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let l=this._rowContainer.children.length;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);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`}};a.AccessibilityManager=o=f([g(1,_.IInstantiationService),g(2,w.ICoreBrowserService),g(3,w.IRenderService)],o)},3614:(m,a)=>{function u(p){return p.replace(/\r?\n/g,"\r")}function f(p,S){return S?"\x1B[200~"+p+"\x1B[201~":p}function g(p,S,w,_){p=f(p=u(p),w.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(p,!0),S.value=""}function d(p,S,w){const _=w.getBoundingClientRect(),c=p.clientX-_.left-10,o=p.clientY-_.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${c}px`,S.style.top=`${o}px`,S.style.zIndex="1000",S.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=u,a.bracketTextForPaste=f,a.copyHandler=function(p,S){p.clipboardData&&p.clipboardData.setData("text/plain",S.selectionText),p.preventDefault()},a.handlePasteEvent=function(p,S,w,_){p.stopPropagation(),p.clipboardData&&g(p.clipboardData.getData("text/plain"),S,w,_)},a.paste=g,a.moveTextAreaUnderMouseCursor=d,a.rightClickHandler=function(p,S,w,_,c){d(p,S,w),c&&_.rightClickSelect(p),S.value=_.selectionText,S.select()}},7239:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const f=u(1505);a.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(g,d,p){this._css.set(g,d,p)}getCss(g,d){return this._css.get(g,d)}setColor(g,d,p){this._color.set(g,d,p)}getColor(g,d){return this._color.get(g,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(u,f,g,d){u.addEventListener(f,g,d);let p=!1;return{dispose:()=>{p||(p=!0,u.removeEventListener(f,g,d))}}}},3551:function(m,a,u){var f=this&&this.__decorate||function(o,s,l,v){var C,x=arguments.length,k=x<3?s:v===null?v=Object.getOwnPropertyDescriptor(s,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,s,l,v);else for(var y=o.length-1;y>=0;y--)(C=o[y])&&(k=(x<3?C(k):x>3?C(s,l,k):C(s,l))||k);return x>3&&k&&Object.defineProperty(s,l,k),k},g=this&&this.__param||function(o,s){return function(l,v){s(l,v,o)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const d=u(3656),p=u(8460),S=u(844),w=u(2585),_=u(4725);let c=a.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(o,s,l,v,C){super(),this._element=o,this._mouseService=s,this._renderService=l,this._bufferService=v,this._linkProviderService=C,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,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(o){this._lastMouseEvent=o;const s=this._positionFromMouseEvent(o,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const l=o.composedPath();for(let v=0;v<l.length;v++){const C=l[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(o){if(this._activeLine!==o.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(o,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,o)||(this._clearCurrentLink(),this._askForLink(o,!0))}_askForLink(o,s){var v,C;this._activeProviderReplies&&s||((v=this._activeProviderReplies)==null||v.forEach(x=>{x==null||x.forEach(k=>{k.link.dispose&&k.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=o.y);let l=!1;for(const[x,k]of this._linkProviderService.linkProviders.entries())s?(C=this._activeProviderReplies)!=null&&C.get(x)&&(l=this._checkLinkProviderResult(x,o,l)):k.provideLinks(o.y,y=>{var R,M;if(this._isMouseOut)return;const b=y==null?void 0:y.map(B=>({link:B}));(R=this._activeProviderReplies)==null||R.set(x,b),l=this._checkLinkProviderResult(x,o,l),((M=this._activeProviderReplies)==null?void 0:M.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(o.y,this._activeProviderReplies)})}_removeIntersectingLinks(o,s){const l=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 k=C[x],y=k.link.range.start.y<o?0:k.link.range.start.x,b=k.link.range.end.y>o?this._bufferService.cols:k.link.range.end.x;for(let R=y;R<=b;R++){if(l.has(R)){C.splice(x--,1);break}l.add(R)}}}}_checkLinkProviderResult(o,s,l){var x;if(!this._activeProviderReplies)return l;const v=this._activeProviderReplies.get(o);let C=!1;for(let k=0;k<o;k++)this._activeProviderReplies.has(k)&&!this._activeProviderReplies.get(k)||(C=!0);if(!C&&v){const k=v.find(y=>this._linkAtPosition(y.link,s));k&&(l=!0,this._handleNewLink(k))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!l)for(let k=0;k<this._activeProviderReplies.size;k++){const y=(x=this._activeProviderReplies.get(k))==null?void 0:x.find(b=>this._linkAtPosition(b.link,s));if(y){l=!0,this._handleNewLink(y);break}}return l}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(o){if(!this._currentLink)return;const s=this._positionFromMouseEvent(o,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(o,this._currentLink.link.text)}_clearCurrentLink(o,s){this._currentLink&&this._lastMouseEvent&&(!o||!s||this._currentLink.link.range.start.y>=o&&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(o){if(!this._lastMouseEvent)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(o.link,s)&&(this._currentLink=o,this._currentLink.state={decorations:{underline:o.link.decorations===void 0||o.link.decorations.underline,pointerCursor:o.link.decorations===void 0||o.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,o.link,this._lastMouseEvent),o.link.decorations={},Object.defineProperties(o.link.decorations,{pointerCursor:{get:()=>{var l,v;return(v=(l=this._currentLink)==null?void 0:l.state)==null?void 0:v.decorations.pointerCursor},set:l=>{var v;(v=this._currentLink)!=null&&v.state&&this._currentLink.state.decorations.pointerCursor!==l&&(this._currentLink.state.decorations.pointerCursor=l,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",l))}},underline:{get:()=>{var l,v;return(v=(l=this._currentLink)==null?void 0:l.state)==null?void 0:v.decorations.underline},set:l=>{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)!==l&&(this._currentLink.state.decorations.underline=l,this._currentLink.state.isHovered&&this._fireUnderlineEvent(o.link,l))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(l=>{if(!this._currentLink)return;const v=l.start===0?0:l.start+1+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.ydisp+1+l.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(o,s,l){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&&o.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(l,s.text)}_fireUnderlineEvent(o,s){const l=o.range,v=this._bufferService.buffer.ydisp,C=this._createLinkUnderlineEvent(l.start.x-1,l.start.y-v-1,l.end.x,l.end.y-v-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(C)}_linkLeave(o,s,l){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&&o.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(l,s.text)}_linkAtPosition(o,s){const l=o.range.start.y*this._bufferService.cols+o.range.start.x,v=o.range.end.y*this._bufferService.cols+o.range.end.x,C=s.y*this._bufferService.cols+s.x;return l<=C&&C<=v}_positionFromMouseEvent(o,s,l){const v=l.getCoords(o,s,this._bufferService.cols,this._bufferService.rows);if(v)return{x:v[0],y:v[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(o,s,l,v,C){return{x1:o,y1:s,x2:l,y2:v,cols:this._bufferService.cols,fg:C}}};a.Linkifier=c=f([g(1,_.IMouseService),g(2,_.IRenderService),g(3,w.IBufferService),g(4,_.ILinkProviderService)],c)},9042:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(m,a,u){var f=this&&this.__decorate||function(_,c,o,s){var l,v=arguments.length,C=v<3?c:s===null?s=Object.getOwnPropertyDescriptor(c,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(_,c,o,s);else for(var x=_.length-1;x>=0;x--)(l=_[x])&&(C=(v<3?l(C):v>3?l(c,o,C):l(c,o))||C);return v>3&&C&&Object.defineProperty(c,o,C),C},g=this&&this.__param||function(_,c){return function(o,s){c(o,s,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const d=u(511),p=u(2585);let S=a.OscLinkProvider=class{constructor(_,c,o){this._bufferService=_,this._optionsService=c,this._oscLinkService=o}provideLinks(_,c){var b;const o=this._bufferService.buffer.lines.get(_-1);if(!o)return void c(void 0);const s=[],l=this._optionsService.rawOptions.linkHandler,v=new d.CellData,C=o.getTrimmedLength();let x=-1,k=-1,y=!1;for(let R=0;R<C;R++)if(k!==-1||o.hasContent(R)){if(o.loadCell(R,v),v.hasExtendedAttrs()&&v.extended.urlId){if(k===-1){k=R,x=v.extended.urlId;continue}y=v.extended.urlId!==x}else k!==-1&&(y=!0);if(y||k!==-1&&R===C-1){const M=(b=this._oscLinkService.getLinkData(x))==null?void 0:b.uri;if(M){const B={start:{x:k+1,y:_},end:{x:R+(y||R!==C-1?0:1),y:_}};let T=!1;if(!(l!=null&&l.allowNonHttpProtocols))try{const N=new URL(M);["http:","https:"].includes(N.protocol)||(T=!0)}catch{T=!0}T||s.push({text:M,range:B,activate:(N,F)=>l?l.activate(N,F,B):w(0,F),hover:(N,F)=>{var K;return(K=l==null?void 0:l.hover)==null?void 0:K.call(l,N,F,B)},leave:(N,F)=>{var K;return(K=l==null?void 0:l.leave)==null?void 0:K.call(l,N,F,B)}})}y=!1,v.hasExtendedAttrs()&&v.extended.urlId?(k=R,x=v.extended.urlId):(k=-1,x=-1)}}c(s)}};function w(_,c){if(confirm(`Do you want to navigate to ${c}?
59
+
60
+ WARNING: This link could potentially be dangerous`)){const o=window.open();if(o){try{o.opener=null}catch{}o.location.href=c}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=S=f([g(0,p.IBufferService),g(1,p.IOptionsService),g(2,p.IOscLinkService)],S)},6193:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(u,f){this._renderCallback=u,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(u,f,g){this._rowCount=g,u=u!==void 0?u:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,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 u=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const f=u(3614),g=u(3656),d=u(3551),p=u(9042),S=u(3730),w=u(1680),_=u(3107),c=u(5744),o=u(2950),s=u(1296),l=u(428),v=u(4269),C=u(5114),x=u(8934),k=u(3230),y=u(9312),b=u(4725),R=u(6731),M=u(8055),B=u(8969),T=u(8460),N=u(844),F=u(6114),K=u(8437),q=u(2584),j=u(7399),E=u(5941),D=u(9074),P=u(2585),O=u(5435),W=u(4567),V=u(779);class J extends B.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=F,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new N.MutableDisposable),this._onCursorMove=this.register(new T.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new T.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new T.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new T.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new T.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new T.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new T.EventEmitter),this._onBlur=this.register(new T.EventEmitter),this._onA11yCharEmitter=this.register(new T.EventEmitter),this._onA11yTabEmitter=this.register(new T.EventEmitter),this._onWillOpen=this.register(new T.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(P.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,T.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,T.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,T.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,T.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(L=>this._afterResize(L.cols,L.rows))),this.register((0,N.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,H="";switch(L.index){case 256:U="foreground",H="10";break;case 257:U="background",H="11";break;case 258:U="cursor",H="12";break;default:U="ansi",H="4;"+L.index}switch(L.type){case 0:const X=M.color.toColorRGB(U==="ansi"?this._themeService.colors.ansi[L.index]:this._themeService.colors[U]);this.coreService.triggerDataEvent(`${q.C0.ESC}]${H};${(0,E.toRgbString)(X)}${q.C1_ESCAPED.ST}`);break;case 1:if(U==="ansi")this._themeService.modifyColors(G=>G.ansi[L.index]=M.channels.toColor(...L.color));else{const G=U;this._themeService.modifyColors(se=>se[G]=M.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(q.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(q.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),H=this._renderService.dimensions.css.cell.height,X=L.getWidth(U),G=this._renderService.dimensions.css.cell.width*X,se=this.buffer.y*this._renderService.dimensions.css.cell.height,z=U*this._renderService.dimensions.css.cell.width;this.textarea.style.left=z+"px",this.textarea.style.top=se+"px",this.textarea.style.width=G+"px",this.textarea.style.height=H+"px",this.textarea.style.lineHeight=H+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.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,g.addDisposableDomListener)(this.textarea,"paste",I)),this.register((0,g.addDisposableDomListener)(this.element,"paste",I)),F.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",L=>{L.button===2&&(0,f.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",L=>{(0,f.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),F.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",L=>{L.button===1&&(0,f.moveTextAreaUnderMouseCursor)(L,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",I=>this._keyUp(I),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",I=>this._keyDown(I),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",I=>this._keyPress(I),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",I=>this._compositionHelper.compositionupdate(I))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,g.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,g.addDisposableDomListener)(this.screenElement,"mousemove",H=>this.updateCursorStyle(H))),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",p.promptLabel),F.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,g.addDisposableDomListener)(this.textarea,"focus",H=>this._handleTextAreaFocus(H))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(l.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(k.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(b.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(H=>this._onRender.fire(H))),this.onResize(H=>this._renderService.resize(H.cols,H.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(o.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(H=>this.scrollLines(H.amount,H.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(H=>this.scrollLines(H.amount,H.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(H=>this._renderService.handleSelectionChanged(H.start,H.end,H.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(H=>{this.textarea.value=H,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(H=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(_.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",H=>this._selectionService.handleMouseDown(H))),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",H=>this._handleScreenReaderModeOptionChange(H))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(c.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",H=>{!this._overviewRulerRenderer&&H&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(c.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(G){const se=I._mouseService.getMouseReportCoords(G,I.screenElement);if(!se)return!1;let z,te;switch(G.overrideType||G.type){case"mousemove":te=32,G.buttons===void 0?(z=3,G.button!==void 0&&(z=G.button<3?G.button:3)):z=1&G.buttons?0:4&G.buttons?1:2&G.buttons?2:3;break;case"mouseup":te=0,z=G.button<3?G.button:3;break;case"mousedown":te=1,z=G.button<3?G.button:3;break;case"wheel":if(I._customWheelEventHandler&&I._customWheelEventHandler(G)===!1||I.viewport.getLinesScrolled(G)===0)return!1;te=G.deltaY<0?0:1,z=4;break;default:return!1}return!(te===void 0||z===void 0||z>4)&&I.coreMouseService.triggerMouseEvent({col:se.col,row:se.row,x:se.x,y:se.y,button:z,action:te,ctrl:G.ctrlKey,alt:G.altKey,shift:G.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},X={mouseup:G=>(U(G),G.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(G)),wheel:G=>(U(G),this.cancel(G,!0)),mousedrag:G=>{G.buttons&&U(G)},mousemove:G=>{G.buttons||U(G)}};this.register(this.coreMouseService.onProtocolChange(G=>{G?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(G)),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&G?H.mousemove||(L.addEventListener("mousemove",X.mousemove),H.mousemove=X.mousemove):(L.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&G?H.wheel||(L.addEventListener("wheel",X.wheel,{passive:!1}),H.wheel=X.wheel):(L.removeEventListener("wheel",H.wheel),H.wheel=null),2&G?H.mouseup||(H.mouseup=X.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&G?H.mousedrag||(H.mousedrag=X.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(L,"mousedown",G=>{if(G.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(G))return U(G),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(G)})),this.register((0,g.addDisposableDomListener)(L,"wheel",G=>{if(!H.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(G)===!1)return!1;if(!this.buffer.hasScrollback){const se=this.viewport.getLinesScrolled(G);if(se===0)return;const z=q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(G.deltaY<0?"A":"B");let te="";for(let ne=0;ne<Math.abs(se);ne++)te+=z;return this.coreService.triggerDataEvent(te,!0),this.cancel(G,!0)}return this.viewport.handleWheel(G)?this.cancel(G):void 0}},{passive:!1})),this.register((0,g.addDisposableDomListener)(L,"touchstart",G=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(G),this.cancel(G)},{passive:!0})),this.register((0,g.addDisposableDomListener)(L,"touchmove",G=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(G)?void 0:this.cancel(G)},{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 H;U===1?(super.scrollLines(I,L,U),this.refresh(0,this.rows-1)):(H=this.viewport)==null||H.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,j.evaluateKeyboardEvent)(I,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(I),U.type===3||U.type===2){const H=this.rows-1;return this.scrollLines(U.type===2?-H:H),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!==q.C0.ETX&&U.key!==q.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,H;(U=this._charSizeService)==null||U.measure(),(H=this.viewport)==null||H.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(q.C0.ESC+"[I"):this.coreService.triggerDataEvent(q.C0.ESC+"[O")}_reportWindowsOptions(I){if(this._renderService)switch(I){case O.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(`${q.C0.ESC}[4;${U};${L}t`);break;case O.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const H=this._renderService.dimensions.css.cell.width.toFixed(0),X=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[6;${X};${H}t`)}}cancel(I,L){if(this.options.cancelEvents||L)return I.preventDefault(),I.stopPropagation(),!1}}a.Terminal=J},9924:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(u,f=1e3){this._renderCallback=u,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,f,g){this._rowCount=g,u=u!==void 0?u:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,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 p=d-this._lastRefreshMs,S=this._debounceThresholdMS-p;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 u=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,f)}}},1680:function(m,a,u){var f=this&&this.__decorate||function(o,s,l,v){var C,x=arguments.length,k=x<3?s:v===null?v=Object.getOwnPropertyDescriptor(s,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,s,l,v);else for(var y=o.length-1;y>=0;y--)(C=o[y])&&(k=(x<3?C(k):x>3?C(s,l,k):C(s,l))||k);return x>3&&k&&Object.defineProperty(s,l,k),k},g=this&&this.__param||function(o,s){return function(l,v){s(l,v,o)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const d=u(3656),p=u(4725),S=u(8460),w=u(844),_=u(2585);let c=a.Viewport=class extends w.Disposable{constructor(o,s,l,v,C,x,k,y){super(),this._viewportElement=o,this._scrollArea=s,this._bufferService=l,this._optionsService=v,this._charSizeService=C,this._renderService=x,this._coreBrowserService=k,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(o){this._viewportElement.style.backgroundColor=o.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(o){if(o)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 o=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==o&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=o),this._refreshAnimationFrame=null}syncScrollArea(o=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(o);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(o)}_handleScroll(o){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 o=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(o*(this._smoothScrollState.target-this._smoothScrollState.origin)),o<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(o,s){const l=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&l<this._lastRecordedBufferHeight)||(o.cancelable&&o.preventDefault(),!1)}handleWheel(o){const s=this._getPixelsScrolled(o);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(o,s))}scrollLines(o){if(o!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const s=o*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:o,suppressScrollEvent:!1})}_getPixelsScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let s=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getBufferElements(o,s){var y;let l,v="";const C=[],x=s??this._bufferService.buffer.lines.length,k=this._bufferService.buffer.lines;for(let b=o;b<x;b++){const R=k.get(b);if(!R)continue;const M=(y=k.get(b+1))==null?void 0:y.isWrapped;if(v+=R.translateToString(!M),!M||b===k.length-1){const B=document.createElement("div");B.textContent=v,C.push(B),v.length>0&&(l=B),v=""}}return{bufferElements:C,cursorElement:l}}getLinesScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let s=this._applyScrollModifier(o.deltaY,o);return o.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):o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(o,s){const l=this._optionsService.rawOptions.fastScrollModifier;return l==="alt"&&s.altKey||l==="ctrl"&&s.ctrlKey||l==="shift"&&s.shiftKey?o*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:o*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(o){this._lastTouchY=o.touches[0].pageY}handleTouchMove(o){const s=this._lastTouchY-o.touches[0].pageY;return this._lastTouchY=o.touches[0].pageY,s!==0&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(o,s))}};a.Viewport=c=f([g(2,_.IBufferService),g(3,_.IOptionsService),g(4,p.ICharSizeService),g(5,p.IRenderService),g(6,p.ICoreBrowserService),g(7,p.IThemeService)],c)},3107:function(m,a,u){var f=this&&this.__decorate||function(_,c,o,s){var l,v=arguments.length,C=v<3?c:s===null?s=Object.getOwnPropertyDescriptor(c,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(_,c,o,s);else for(var x=_.length-1;x>=0;x--)(l=_[x])&&(C=(v<3?l(C):v>3?l(c,o,C):l(c,o))||C);return v>3&&C&&Object.defineProperty(c,o,C),C},g=this&&this.__param||function(_,c){return function(o,s){c(o,s,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const d=u(4725),p=u(844),S=u(2585);let w=a.BufferDecorationRenderer=class extends p.Disposable{constructor(_,c,o,s,l){super(),this._screenElement=_,this._bufferService=c,this._coreBrowserService=o,this._decorationService=s,this._renderService=l,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,p.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 _ of this._decorationService.decorations)this._renderDecoration(_);this._dimensionsChanged=!1}_renderDecoration(_){this._refreshStyle(_),this._dimensionsChanged&&this._refreshXPosition(_)}_createElement(_){var s;const c=this._coreBrowserService.mainDocument.createElement("div");c.classList.add("xterm-decoration"),c.classList.toggle("xterm-decoration-top-layer",((s=_==null?void 0:_.options)==null?void 0:s.layer)==="top"),c.style.width=`${Math.round((_.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,c.style.height=(_.options.height||1)*this._renderService.dimensions.css.cell.height+"px",c.style.top=(_.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",c.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const o=_.options.x??0;return o&&o>this._bufferService.cols&&(c.style.display="none"),this._refreshXPosition(_,c),c}_refreshStyle(_){const c=_.marker.line-this._bufferService.buffers.active.ydisp;if(c<0||c>=this._bufferService.rows)_.element&&(_.element.style.display="none",_.onRenderEmitter.fire(_.element));else{let o=this._decorationElements.get(_);o||(o=this._createElement(_),_.element=o,this._decorationElements.set(_,o),this._container.appendChild(o),_.onDispose(()=>{this._decorationElements.delete(_),o.remove()})),o.style.top=c*this._renderService.dimensions.css.cell.height+"px",o.style.display=this._altBufferIsActive?"none":"block",_.onRenderEmitter.fire(o)}}_refreshXPosition(_,c=_.element){if(!c)return;const o=_.options.x??0;(_.options.anchor||"left")==="right"?c.style.right=o?o*this._renderService.dimensions.css.cell.width+"px":"":c.style.left=o?o*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(_){var c;(c=this._decorationElements.get(_))==null||c.remove(),this._decorationElements.delete(_),_.dispose()}};a.BufferDecorationRenderer=w=f([g(1,S.IBufferService),g(2,d.ICoreBrowserService),g(3,S.IDecorationService),g(4,d.IRenderService)],w)},5871:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.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(u){if(u.options.overviewRulerOptions){for(const f of this._zones)if(f.color===u.options.overviewRulerOptions.color&&f.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,u.marker.line))return;if(this._lineAdjacentToZone(f,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(f,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,f){return f>=u.startBufferLine&&f<=u.endBufferLine}_lineAdjacentToZone(u,f,g){return f>=u.startBufferLine-this._linePadding[g||"full"]&&f<=u.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(u,f){u.startBufferLine=Math.min(u.startBufferLine,f),u.endBufferLine=Math.max(u.endBufferLine,f)}}},5744:function(m,a,u){var f=this&&this.__decorate||function(l,v,C,x){var k,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(l,v,C,x);else for(var R=l.length-1;R>=0;R--)(k=l[R])&&(b=(y<3?k(b):y>3?k(v,C,b):k(v,C))||b);return y>3&&b&&Object.defineProperty(v,C,b),b},g=this&&this.__param||function(l,v){return function(C,x){v(C,x,l)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const d=u(5871),p=u(4725),S=u(844),w=u(2585),_={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0};let s=a.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(l,v,C,x,k,y,b){var M;super(),this._viewportElement=l,this._screenElement=v,this._bufferService=C,this._decorationService=x,this._renderService=k,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(),(M=this._viewportElement.parentElement)==null||M.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 B;(B=this._canvas)==null||B.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 l=Math.floor(this._canvas.width/3),v=Math.ceil(this._canvas.width/3);c.full=this._canvas.width,c.left=l,c.center=v,c.right=l,this._refreshDrawHeightConstants(),o.full=0,o.left=0,o.center=c.left,o.right=c.left+c.center}_refreshDrawHeightConstants(){_.full=Math.round(2*this._coreBrowserService.dpr);const l=this._canvas.height/this._bufferService.buffer.lines.length,v=Math.round(Math.max(Math.min(l,12),6)*this._coreBrowserService.dpr);_.left=v,_.center=v,_.right=v}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.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 l=this._colorZoneStore.zones;for(const v of l)v.position!=="full"&&this._renderColorZone(v);for(const v of l)v.position==="full"&&this._renderColorZone(v);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(l){this._ctx.fillStyle=l.color,this._ctx.fillRect(o[l.position||"full"],Math.round((this._canvas.height-1)*(l.startBufferLine/this._bufferService.buffers.active.lines.length)-_[l.position||"full"]/2),c[l.position||"full"],Math.round((this._canvas.height-1)*((l.endBufferLine-l.startBufferLine)/this._bufferService.buffers.active.lines.length)+_[l.position||"full"]))}_queueRefresh(l,v){this._shouldUpdateDimensions=l||this._shouldUpdateDimensions,this._shouldUpdateAnchor=v||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};a.OverviewRulerRenderer=s=f([g(2,w.IBufferService),g(3,w.IDecorationService),g(4,p.IRenderService),g(5,w.IOptionsService),g(6,p.ICoreBrowserService)],s)},2950:function(m,a,u){var f=this&&this.__decorate||function(_,c,o,s){var l,v=arguments.length,C=v<3?c:s===null?s=Object.getOwnPropertyDescriptor(c,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(_,c,o,s);else for(var x=_.length-1;x>=0;x--)(l=_[x])&&(C=(v<3?l(C):v>3?l(c,o,C):l(c,o))||C);return v>3&&C&&Object.defineProperty(c,o,C),C},g=this&&this.__param||function(_,c){return function(o,s){c(o,s,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const d=u(4725),p=u(2585),S=u(2584);let w=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(_,c,o,s,l,v){this._textarea=_,this._compositionView=c,this._bufferService=o,this._optionsService=s,this._coreService=l,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(_){this._compositionView.textContent=_.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(_){if(this._isComposing||this._isSendingComposition){if(_.keyCode===229||_.keyCode===16||_.keyCode===17||_.keyCode===18)return!1;this._finalizeComposition(!1)}return _.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(_){if(this._compositionView.classList.remove("active"),this._isComposing=!1,_){const c={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let o;this._isSendingComposition=!1,c.start+=this._dataAlreadySent.length,o=this._isComposing?this._textarea.value.substring(c.start,c.end):this._textarea.value.substring(c.start),o.length>0&&this._coreService.triggerDataEvent(o,!0)}},0)}else{this._isSendingComposition=!1;const c=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(c,!0)}}_handleAnyTextareaChanges(){const _=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const c=this._textarea.value,o=c.replace(_,"");this._dataAlreadySent=o,c.length>_.length?this._coreService.triggerDataEvent(o,!0):c.length<_.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):c.length===_.length&&c!==_&&this._coreService.triggerDataEvent(c,!0)}},0)}updateCompositionElements(_){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const c=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),o=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,l=c*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=l+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=o+"px",this._compositionView.style.lineHeight=o+"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=l+"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"}_||setTimeout(()=>this.updateCompositionElements(!0),0)}}};a.CompositionHelper=w=f([g(2,p.IBufferService),g(3,p.IOptionsService),g(4,p.ICoreService),g(5,d.IRenderService)],w)},9806:(m,a)=>{function u(f,g,d){const p=d.getBoundingClientRect(),S=f.getComputedStyle(d),w=parseInt(S.getPropertyValue("padding-left")),_=parseInt(S.getPropertyValue("padding-top"));return[g.clientX-p.left-w,g.clientY-p.top-_]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=u,a.getCoords=function(f,g,d,p,S,w,_,c,o){if(!w)return;const s=u(f,g,d);return s?(s[0]=Math.ceil((s[0]+(o?_/2:0))/_),s[1]=Math.ceil(s[1]/c),s[0]=Math.min(Math.max(s[0],1),p+(o?1:0)),s[1]=Math.min(Math.max(s[1],1),S),s):void 0}},9504:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const f=u(2584);function g(c,o,s,l){const v=c-d(c,s),C=o-d(o,s),x=Math.abs(v-C)-function(k,y,b){let R=0;const M=k-d(k,b),B=y-d(y,b);for(let T=0;T<Math.abs(M-B);T++){const N=p(k,y)==="A"?-1:1,F=b.buffer.lines.get(M+N*T);F!=null&&F.isWrapped&&R++}return R}(c,o,s);return _(x,w(p(c,o),l))}function d(c,o){let s=0,l=o.buffer.lines.get(c),v=l==null?void 0:l.isWrapped;for(;v&&c>=0&&c<o.rows;)s++,l=o.buffer.lines.get(--c),v=l==null?void 0:l.isWrapped;return s}function p(c,o){return c>o?"A":"B"}function S(c,o,s,l,v,C){let x=c,k=o,y="";for(;x!==s||k!==l;)x+=v?1:-1,v&&x>C.cols-1?(y+=C.buffer.translateBufferLineToString(k,!1,c,x),x=0,c=0,k++):!v&&x<0&&(y+=C.buffer.translateBufferLineToString(k,!1,0,c+1),x=C.cols-1,c=x,k--);return y+C.buffer.translateBufferLineToString(k,!1,c,x)}function w(c,o){const s=o?"O":"[";return f.C0.ESC+s+c}function _(c,o){c=Math.floor(c);let s="";for(let l=0;l<c;l++)s+=o;return s}a.moveToCellSequence=function(c,o,s,l){const v=s.buffer.x,C=s.buffer.y;if(!s.buffer.hasScrollback)return function(y,b,R,M,B,T){return g(b,M,B,T).length===0?"":_(S(y,b,y,b-d(b,B),!1,B).length,w("D",T))}(v,C,0,o,s,l)+g(C,o,s,l)+function(y,b,R,M,B,T){let N;N=g(b,M,B,T).length>0?M-d(M,B):b;const F=M,K=function(q,j,E,D,P,O){let W;return W=g(E,D,P,O).length>0?D-d(D,P):j,q<E&&W<=D||q>=E&&W<D?"C":"D"}(y,b,R,M,B,T);return _(S(y,N,R,F,K==="C",B).length,w(K,T))}(v,C,c,o,s,l);let x;if(C===o)return x=v>c?"D":"C",_(Math.abs(v-c),w(x,l));x=C>o?"D":"C";const k=Math.abs(C-o);return _(function(y,b){return b.cols-y}(C>o?c:v,s)+(k-1)*s.cols+1+((C>o?v:c)-1),w(x,l))}},1296:function(m,a,u){var f=this&&this.__decorate||function(T,N,F,K){var q,j=arguments.length,E=j<3?N:K===null?K=Object.getOwnPropertyDescriptor(N,F):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(T,N,F,K);else for(var D=T.length-1;D>=0;D--)(q=T[D])&&(E=(j<3?q(E):j>3?q(N,F,E):q(N,F))||E);return j>3&&E&&Object.defineProperty(N,F,E),E},g=this&&this.__param||function(T,N){return function(F,K){N(F,K,T)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const d=u(3787),p=u(2550),S=u(2223),w=u(6171),_=u(6052),c=u(4725),o=u(8055),s=u(8460),l=u(844),v=u(2585),C="xterm-dom-renderer-owner-",x="xterm-rows",k="xterm-fg-",y="xterm-bg-",b="xterm-focus",R="xterm-selection";let M=1,B=a.DomRenderer=class extends l.Disposable{constructor(T,N,F,K,q,j,E,D,P,O,W,V,J){super(),this._terminal=T,this._document=N,this._element=F,this._screenElement=K,this._viewportElement=q,this._helperContainer=j,this._linkifier2=E,this._charSizeService=P,this._optionsService=O,this._bufferService=W,this._coreBrowserService=V,this._themeService=J,this._terminalClass=M++,this._rowElements=[],this._selectionRenderModel=(0,_.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(Z=>this._injectCss(Z))),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(Z=>this._handleLinkHover(Z))),this.register(this._linkifier2.onHideLinkUnderline(Z=>this._handleLinkLeave(Z))),this.register((0,l.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 p.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 T=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*T,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*T),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/T),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/T),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 F of this._rowElements)F.style.width=`${this.dimensions.css.canvas.width}px`,F.style.height=`${this.dimensions.css.cell.height}px`,F.style.lineHeight=`${this.dimensions.css.cell.height}px`,F.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const N=`${this._terminalSelector} .${x} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=N,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(T){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let N=`${this._terminalSelector} .${x} { color: ${T.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;N+=`${this._terminalSelector} .${x} .xterm-dim { color: ${o.color.multiplyOpacity(T.foreground,.5).css};}`,N+=`${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 F=`blink_underline_${this._terminalClass}`,K=`blink_bar_${this._terminalClass}`,q=`blink_block_${this._terminalClass}`;N+=`@keyframes ${F} { 50% { border-bottom-style: hidden; }}`,N+=`@keyframes ${K} { 50% { box-shadow: none; }}`,N+=`@keyframes ${q} { 0% { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css}; } 50% { background-color: inherit; color: ${T.cursor.css}; }}`,N+=`${this._terminalSelector} .${x}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${F} 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: ${q} 1s step-end infinite;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-block { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css};}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${T.cursor.css} !important; color: ${T.cursorAccent.css} !important;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${T.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${T.cursor.css} inset;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${T.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,N+=`${this._terminalSelector} .${R} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${R} div { position: absolute; background-color: ${T.selectionBackgroundOpaque.css};}${this._terminalSelector} .${R} div { position: absolute; background-color: ${T.selectionInactiveBackgroundOpaque.css};}`;for(const[j,E]of T.ansi.entries())N+=`${this._terminalSelector} .${k}${j} { color: ${E.css}; }${this._terminalSelector} .${k}${j}.xterm-dim { color: ${o.color.multiplyOpacity(E,.5).css}; }${this._terminalSelector} .${y}${j} { background-color: ${E.css}; }`;N+=`${this._terminalSelector} .${k}${S.INVERTED_DEFAULT_COLOR} { color: ${o.color.opaque(T.background).css}; }${this._terminalSelector} .${k}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${o.color.multiplyOpacity(o.color.opaque(T.background),.5).css}; }${this._terminalSelector} .${y}${S.INVERTED_DEFAULT_COLOR} { background-color: ${T.foreground.css}; }`,this._themeStyleElement.textContent=N}_setDefaultSpacing(){const T=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${T}px`,this._rowFactory.defaultSpacing=T}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(T,N){for(let F=this._rowElements.length;F<=N;F++){const K=this._document.createElement("div");this._rowContainer.appendChild(K),this._rowElements.push(K)}for(;this._rowElements.length>N;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(T,N){this._refreshRowElements(T,N),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(T,N,F){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(T,N,F),this.renderRows(0,this._bufferService.rows-1),!T||!N)return;this._selectionRenderModel.update(this._terminal,T,N,F);const K=this._selectionRenderModel.viewportStartRow,q=this._selectionRenderModel.viewportEndRow,j=this._selectionRenderModel.viewportCappedStartRow,E=this._selectionRenderModel.viewportCappedEndRow;if(j>=this._bufferService.rows||E<0)return;const D=this._document.createDocumentFragment();if(F){const P=T[0]>N[0];D.appendChild(this._createSelectionElement(j,P?N[0]:T[0],P?T[0]:N[0],E-j+1))}else{const P=K===j?T[0]:0,O=j===q?N[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(j,P,O));const W=E-j-1;if(D.appendChild(this._createSelectionElement(j+1,0,this._bufferService.cols,W)),j!==E){const V=q===E?N[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(E,0,V))}}this._selectionContainer.appendChild(D)}_createSelectionElement(T,N,F,K=1){const q=this._document.createElement("div"),j=N*this.dimensions.css.cell.width;let E=this.dimensions.css.cell.width*(F-N);return j+E>this.dimensions.css.canvas.width&&(E=this.dimensions.css.canvas.width-j),q.style.height=K*this.dimensions.css.cell.height+"px",q.style.top=T*this.dimensions.css.cell.height+"px",q.style.left=`${j}px`,q.style.width=`${E}px`,q}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 T of this._rowElements)T.replaceChildren()}renderRows(T,N){const F=this._bufferService.buffer,K=F.ybase+F.y,q=Math.min(F.x,this._bufferService.cols-1),j=this._optionsService.rawOptions.cursorBlink,E=this._optionsService.rawOptions.cursorStyle,D=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=T;P<=N;P++){const O=P+F.ydisp,W=this._rowElements[P],V=F.lines.get(O);if(!W||!V)break;W.replaceChildren(...this._rowFactory.createRow(V,O,O===K,E,D,q,j,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${C}${this._terminalClass}`}_handleLinkHover(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!0)}_handleLinkLeave(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!1)}_setCellUnderline(T,N,F,K,q,j){F<0&&(T=0),K<0&&(N=0);const E=this._bufferService.rows-1;F=Math.max(Math.min(F,E),0),K=Math.max(Math.min(K,E),0),q=Math.min(q,this._bufferService.cols);const D=this._bufferService.buffer,P=D.ybase+D.y,O=Math.min(D.x,q-1),W=this._optionsService.rawOptions.cursorBlink,V=this._optionsService.rawOptions.cursorStyle,J=this._optionsService.rawOptions.cursorInactiveStyle;for(let Z=F;Z<=K;++Z){const I=Z+D.ydisp,L=this._rowElements[Z],U=D.lines.get(I);if(!L||!U)break;L.replaceChildren(...this._rowFactory.createRow(U,I,I===P,V,J,O,W,this.dimensions.css.cell.width,this._widthCache,j?Z===F?T:0:-1,j?(Z===K?N:q)-1:-1))}}};a.DomRenderer=B=f([g(7,v.IInstantiationService),g(8,c.ICharSizeService),g(9,v.IOptionsService),g(10,v.IBufferService),g(11,c.ICoreBrowserService),g(12,c.IThemeService)],B)},3787:function(m,a,u){var f=this&&this.__decorate||function(x,k,y,b){var R,M=arguments.length,B=M<3?k:b===null?b=Object.getOwnPropertyDescriptor(k,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(x,k,y,b);else for(var T=x.length-1;T>=0;T--)(R=x[T])&&(B=(M<3?R(B):M>3?R(k,y,B):R(k,y))||B);return M>3&&B&&Object.defineProperty(k,y,B),B},g=this&&this.__param||function(x,k){return function(y,b){k(y,b,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const d=u(2223),p=u(643),S=u(511),w=u(2585),_=u(8055),c=u(4725),o=u(4269),s=u(6171),l=u(3734);let v=a.DomRendererRowFactory=class{constructor(x,k,y,b,R,M,B){this._document=x,this._characterJoinerService=k,this._optionsService=y,this._coreBrowserService=b,this._coreService=R,this._decorationService=M,this._themeService=B,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(x,k,y){this._selectionStart=x,this._selectionEnd=k,this._columnSelectMode=y}createRow(x,k,y,b,R,M,B,T,N,F,K){const q=[],j=this._characterJoinerService.getJoinedCharacters(k),E=this._themeService.colors;let D,P=x.getNoBgTrimmedLength();y&&P<M+1&&(P=M+1);let O=0,W="",V=0,J=0,Z=0,I=!1,L=0,U=!1,H=0;const X=[],G=F!==-1&&K!==-1;for(let se=0;se<P;se++){x.loadCell(se,this._workCell);let z=this._workCell.getWidth();if(z===0)continue;let te=!1,ne=se,ee=this._workCell;if(j.length>0&&se===j[0][0]){te=!0;const pe=j.shift();ee=new o.JoinedCellData(this._workCell,x.translateToString(!0,pe[0],pe[1]),pe[1]-pe[0]),ne=pe[1]-1,z=ee.getWidth()}const He=this._isCellInSelection(se,k),Wr=y&&se===M,ln=G&&se>=F&&se<=K;let cn=!1;this._decorationService.forEachDecorationAtCell(se,k,void 0,pe=>{cn=!0});let zi=ee.getChars()||p.WHITESPACE_CELL_CHAR;if(zi===" "&&(ee.isUnderline()||ee.isOverline())&&(zi=" "),H=z*T-N.get(zi,ee.isBold(),ee.isItalic()),D){if(O&&(He&&U||!He&&!U&&ee.bg===V)&&(He&&U&&E.selectionForeground||ee.fg===J)&&ee.extended.ext===Z&&ln===I&&H===L&&!Wr&&!te&&!cn){ee.isInvisible()?W+=p.WHITESPACE_CELL_CHAR:W+=zi,O++;continue}O&&(D.textContent=W),D=this._document.createElement("span"),O=0,W=""}else D=this._document.createElement("span");if(V=ee.bg,J=ee.fg,Z=ee.extended.ext,I=ln,L=H,U=He,te&&M>=se&&M<=ne&&(M=se),!this._coreService.isCursorHidden&&Wr&&this._coreService.isCursorInitialized){if(X.push("xterm-cursor"),this._coreBrowserService.isFocused)B&&X.push("xterm-cursor-blink"),X.push(b==="bar"?"xterm-cursor-bar":b==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){case"outline":X.push("xterm-cursor-outline");break;case"block":X.push("xterm-cursor-block");break;case"bar":X.push("xterm-cursor-bar");break;case"underline":X.push("xterm-cursor-underline")}}if(ee.isBold()&&X.push("xterm-bold"),ee.isItalic()&&X.push("xterm-italic"),ee.isDim()&&X.push("xterm-dim"),W=ee.isInvisible()?p.WHITESPACE_CELL_CHAR:ee.getChars()||p.WHITESPACE_CELL_CHAR,ee.isUnderline()&&(X.push(`xterm-underline-${ee.extended.underlineStyle}`),W===" "&&(W=" "),!ee.isUnderlineColorDefault()))if(ee.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${l.AttributeData.toColorRGB(ee.getUnderlineColor()).join(",")})`;else{let pe=ee.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ee.isBold()&&pe<8&&(pe+=8),D.style.textDecorationColor=E.ansi[pe].css}ee.isOverline()&&(X.push("xterm-overline"),W===" "&&(W=" ")),ee.isStrikethrough()&&X.push("xterm-strikethrough"),ln&&(D.style.textDecoration="underline");let Je=ee.getFgColor(),Ur=ee.getFgColorMode(),ft=ee.getBgColor(),$r=ee.getBgColorMode();const un=!!ee.isInverse();if(un){const pe=Je;Je=ft,ft=pe;const Ih=Ur;Ur=$r,$r=Ih}let Rt,Wi,Tt,Kr=!1;switch(this._decorationService.forEachDecorationAtCell(se,k,void 0,pe=>{pe.options.layer!=="top"&&Kr||(pe.backgroundColorRGB&&($r=50331648,ft=pe.backgroundColorRGB.rgba>>8&16777215,Rt=pe.backgroundColorRGB),pe.foregroundColorRGB&&(Ur=50331648,Je=pe.foregroundColorRGB.rgba>>8&16777215,Wi=pe.foregroundColorRGB),Kr=pe.options.layer==="top")}),!Kr&&He&&(Rt=this._coreBrowserService.isFocused?E.selectionBackgroundOpaque:E.selectionInactiveBackgroundOpaque,ft=Rt.rgba>>8&16777215,$r=50331648,Kr=!0,E.selectionForeground&&(Ur=50331648,Je=E.selectionForeground.rgba>>8&16777215,Wi=E.selectionForeground)),Kr&&X.push("xterm-decoration-top"),$r){case 16777216:case 33554432:Tt=E.ansi[ft],X.push(`xterm-bg-${ft}`);break;case 50331648:Tt=_.channels.toColor(ft>>16,ft>>8&255,255&ft),this._addStyle(D,`background-color:#${C((ft>>>0).toString(16),"0",6)}`);break;default:un?(Tt=E.foreground,X.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):Tt=E.background}switch(Rt||ee.isDim()&&(Rt=_.color.multiplyOpacity(Tt,.5)),Ur){case 16777216:case 33554432:ee.isBold()&&Je<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Je+=8),this._applyMinimumContrast(D,Tt,E.ansi[Je],ee,Rt,void 0)||X.push(`xterm-fg-${Je}`);break;case 50331648:const pe=_.channels.toColor(Je>>16&255,Je>>8&255,255&Je);this._applyMinimumContrast(D,Tt,pe,ee,Rt,Wi)||this._addStyle(D,`color:#${C(Je.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,Tt,E.foreground,ee,Rt,Wi)||un&&X.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}X.length&&(D.className=X.join(" "),X.length=0),Wr||te||cn?D.textContent=W:O++,H!==this.defaultSpacing&&(D.style.letterSpacing=`${H}px`),q.push(D),se=ne}return D&&O&&(D.textContent=W),q}_applyMinimumContrast(x,k,y,b,R,M){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.treatGlyphAsBackgroundColor)(b.getCode()))return!1;const B=this._getContrastCache(b);let T;if(R||M||(T=B.getColor(k.rgba,y.rgba)),T===void 0){const N=this._optionsService.rawOptions.minimumContrastRatio/(b.isDim()?2:1);T=_.color.ensureContrastRatio(R||k,M||y,N),B.setColor((R||k).rgba,(M||y).rgba,T??null)}return!!T&&(this._addStyle(x,`color:${T.css}`),!0)}_getContrastCache(x){return x.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(x,k){x.setAttribute("style",`${x.getAttribute("style")||""}${k};`)}_isCellInSelection(x,k){const y=this._selectionStart,b=this._selectionEnd;return!(!y||!b)&&(this._columnSelectMode?y[0]<=b[0]?x>=y[0]&&k>=y[1]&&x<b[0]&&k<=b[1]:x<y[0]&&k>=y[1]&&x>=b[0]&&k<=b[1]:k>y[1]&&k<b[1]||y[1]===b[1]&&k===y[1]&&x>=y[0]&&x<b[0]||y[1]<b[1]&&k===b[1]&&x<b[0]||y[1]<b[1]&&k===y[1]&&x>=y[0])}};function C(x,k,y){for(;x.length<y;)x=k+x;return x}a.DomRendererRowFactory=v=f([g(1,c.ICharacterJoinerService),g(2,w.IOptionsService),g(3,c.ICoreBrowserService),g(4,w.ICoreService),g(5,w.IDecorationService),g(6,c.IThemeService)],v)},2550:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(u,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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 g=u.createElement("span");g.classList.add("xterm-char-measure-element");const d=u.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const p=u.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const S=u.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[g,d,p,S],this._container.appendChild(g),this._container.appendChild(d),this._container.appendChild(p),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(u,f,g,d){u===this._font&&f===this._fontSize&&g===this._weight&&d===this._weightBold||(this._font=u,this._fontSize=f,this._weight=g,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(u,f,g){let d=0;if(!f&&!g&&u.length===1&&(d=u.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const w=this._measure(u,0);return w>0&&(this._flat[d]=w),w}let p=u;f&&(p+="B"),g&&(p+="I");let S=this._holey.get(p);if(S===void 0){let w=0;f&&(w|=1),g&&(w|=2),S=this._measure(u,w),S>0&&this._holey.set(p,S)}return S}_measure(u,f){const g=this._measureElements[f];return g.textContent=u.repeat(32),g.offsetWidth/32}}},2223:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const f=u(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(m,a)=>{function u(g){return 57508<=g&&g<=57558}function f(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},a.isPowerlineGlyph=u,a.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},a.isEmoji=f,a.allowRescaling=function(g,d,p,S){return d===1&&p>Math.ceil(1.5*S)&&g!==void 0&&g>255&&!f(g)&&!u(g)&&!function(w){return 57344<=w&&w<=63743}(g)},a.treatGlyphAsBackgroundColor=function(g){return u(g)||function(d){return 9472<=d&&d<=9631}(g)},a.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}}}},a.computeNextVariantOffset=function(g,d,p=0){return(g-(2*Math.round(d)-p))%(2*Math.round(d))}},6052:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class u{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(g,d,p,S=!1){if(this.selectionStart=d,this.selectionEnd=p,!d||!p||d[0]===p[0]&&d[1]===p[1])return void this.clear();const w=g.buffers.active.ydisp,_=d[1]-w,c=p[1]-w,o=Math.max(_,0),s=Math.min(c,g.rows-1);o>=g.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=_,this.viewportEndRow=c,this.viewportCappedStartRow=o,this.viewportCappedEndRow=s,this.startCol=d[0],this.endCol=p[0])}isCellSelected(g,d,p){return!!this.hasSelection&&(p-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&p>=this.viewportCappedStartRow&&d<this.endCol&&p<=this.viewportCappedEndRow:d<this.startCol&&p>=this.viewportCappedStartRow&&d>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&d>=this.startCol)}}a.createSelectionRenderModel=function(){return new u}},456:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(u){this._bufferService=u,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 u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,f=this.selectionEnd;return!(!u||!f)&&(u[1]>f[1]||u[1]===f[1]&&u[0]>f[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(m,a,u){var f=this&&this.__decorate||function(s,l,v,C){var x,k=arguments.length,y=k<3?l:C===null?C=Object.getOwnPropertyDescriptor(l,v):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,l,v,C);else for(var b=s.length-1;b>=0;b--)(x=s[b])&&(y=(k<3?x(y):k>3?x(l,v,y):x(l,v))||y);return k>3&&y&&Object.defineProperty(l,v,y),y},g=this&&this.__param||function(s,l){return function(v,C){l(v,C,s)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const d=u(2585),p=u(8460),S=u(844);let w=a.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(s,l,v){super(),this._optionsService=v,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new o(this._optionsService))}catch{this._measureStrategy=this.register(new c(s,l,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())}};a.CharSizeService=w=f([g(2,d.IOptionsService)],w);class _ extends S.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(l,v){l!==void 0&&l>0&&v!==void 0&&v>0&&(this._result.width=l,this._result.height=v)}}class c extends _{constructor(l,v,C){super(),this._document=l,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 o extends _{constructor(l){super(),this._optionsService=l,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 l=this._ctx.measureText("W");return this._validateAndSet(l.width,l.fontBoundingBoxAscent+l.fontBoundingBoxDescent),this._result}}},4269:function(m,a,u){var f=this&&this.__decorate||function(o,s,l,v){var C,x=arguments.length,k=x<3?s:v===null?v=Object.getOwnPropertyDescriptor(s,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,s,l,v);else for(var y=o.length-1;y>=0;y--)(C=o[y])&&(k=(x<3?C(k):x>3?C(s,l,k):C(s,l))||k);return x>3&&k&&Object.defineProperty(s,l,k),k},g=this&&this.__param||function(o,s){return function(l,v){s(l,v,o)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const d=u(3734),p=u(643),S=u(511),w=u(2585);class _ extends d.AttributeData{constructor(s,l,v){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=l,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()]}}a.JoinedCellData=_;let c=a.CharacterJoinerService=class Lh{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(s){const l={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(l),l.id}deregister(s){for(let l=0;l<this._characterJoiners.length;l++)if(this._characterJoiners[l].id===s)return this._characterJoiners.splice(l,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const l=this._bufferService.buffer.lines.get(s);if(!l||l.length===0)return[];const v=[],C=l.translateToString(!0);let x=0,k=0,y=0,b=l.getFg(0),R=l.getBg(0);for(let M=0;M<l.getTrimmedLength();M++)if(l.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==b||this._workCell.bg!==R){if(M-x>1){const B=this._getJoinedRanges(C,y,k,l,x);for(let T=0;T<B.length;T++)v.push(B[T])}x=M,y=k,b=this._workCell.fg,R=this._workCell.bg}k+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-x>1){const M=this._getJoinedRanges(C,y,k,l,x);for(let B=0;B<M.length;B++)v.push(M[B])}return v}_getJoinedRanges(s,l,v,C,x){const k=s.substring(l,v);let y=[];try{y=this._characterJoiners[0].handler(k)}catch(b){console.error(b)}for(let b=1;b<this._characterJoiners.length;b++)try{const R=this._characterJoiners[b].handler(k);for(let M=0;M<R.length;M++)Lh._mergeRanges(y,R[M])}catch(R){console.error(R)}return this._stringRangesToCellRanges(y,C,x),y}_stringRangesToCellRanges(s,l,v){let C=0,x=!1,k=0,y=s[C];if(y){for(let b=v;b<this._bufferService.cols;b++){const R=l.getWidth(b),M=l.getString(b).length||p.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!x&&y[0]<=k&&(y[0]=b,x=!0),y[1]<=k){if(y[1]=b,y=s[++C],!y)break;y[0]<=k?(y[0]=b,x=!0):x=!1}k+=M}}y&&(y[1]=this._bufferService.cols)}}static _mergeRanges(s,l){let v=!1;for(let C=0;C<s.length;C++){const x=s[C];if(v){if(l[1]<=x[0])return s[C-1][1]=l[1],s;if(l[1]<=x[1])return s[C-1][1]=Math.max(l[1],x[1]),s.splice(C,1),s;s.splice(C,1),C--}else{if(l[1]<=x[0])return s.splice(C,0,l),s;if(l[1]<=x[1])return x[0]=Math.min(l[0],x[0]),s;l[0]<x[1]&&(x[0]=Math.min(l[0],x[0]),v=!0)}}return v?s[s.length-1][1]=l[1]:s.push(l),s}};a.CharacterJoinerService=c=f([g(0,w.IBufferService)],c)},5114:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const f=u(844),g=u(8460),d=u(3656);class p extends f.Disposable{constructor(_,c,o){super(),this._textarea=_,this._window=c,this.mainDocument=o,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new S(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this.register((0,g.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(_){this._window!==_&&(this._window=_,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}}a.CoreBrowserService=p;class S extends f.Disposable{constructor(_){super(),this._parentWindow=_,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new g.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(_){this._parentWindow=_,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 _;this._outerListener&&((_=this._resolutionMediaMatchList)==null||_.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:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const f=u(844);class g extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const S=this.linkProviders.indexOf(p);S!==-1&&this.linkProviders.splice(S,1)}}}}a.LinkProviderService=g},8934:function(m,a,u){var f=this&&this.__decorate||function(w,_,c,o){var s,l=arguments.length,v=l<3?_:o===null?o=Object.getOwnPropertyDescriptor(_,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(w,_,c,o);else for(var C=w.length-1;C>=0;C--)(s=w[C])&&(v=(l<3?s(v):l>3?s(_,c,v):s(_,c))||v);return l>3&&v&&Object.defineProperty(_,c,v),v},g=this&&this.__param||function(w,_){return function(c,o){_(c,o,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const d=u(4725),p=u(9806);let S=a.MouseService=class{constructor(w,_){this._renderService=w,this._charSizeService=_}getCoords(w,_,c,o,s){return(0,p.getCoords)(window,w,_,c,o,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(w,_){const c=(0,p.getCoordsRelativeToElement)(window,w,_);if(this._charSizeService.hasValidSize)return c[0]=Math.min(Math.max(c[0],0),this._renderService.dimensions.css.canvas.width-1),c[1]=Math.min(Math.max(c[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(c[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(c[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(c[0]),y:Math.floor(c[1])}}};a.MouseService=S=f([g(0,d.IRenderService),g(1,d.ICharSizeService)],S)},3230:function(m,a,u){var f=this&&this.__decorate||function(s,l,v,C){var x,k=arguments.length,y=k<3?l:C===null?C=Object.getOwnPropertyDescriptor(l,v):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,l,v,C);else for(var b=s.length-1;b>=0;b--)(x=s[b])&&(y=(k<3?x(y):k>3?x(l,v,y):x(l,v))||y);return k>3&&y&&Object.defineProperty(l,v,y),y},g=this&&this.__param||function(s,l){return function(v,C){l(v,C,s)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const d=u(6193),p=u(4725),S=u(8460),w=u(844),_=u(7226),c=u(2585);let o=a.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(s,l,v,C,x,k,y,b){super(),this._rowCount=s,this._charSizeService=C,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new _.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,M)=>this._renderRows(R,M),y),this.register(this._renderDebouncer),this.register(y.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(k.onResize(()=>this._fullRefresh())),this.register(k.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(k.cols,k.rows),this._fullRefresh()})),this.register(v.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(k.buffer.y,k.buffer.y,!0))),this.register(b.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(y.window,l),this.register(y.onWindowChange(R=>this._registerIntersectionObserver(R,l)))}_registerIntersectionObserver(s,l){if("IntersectionObserver"in s){const v=new s.IntersectionObserver(C=>this._handleIntersectionChange(C[C.length-1]),{threshold:0});v.observe(l),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,l,v=!1){this._isPaused?this._needsFullRefresh=!0:(v||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(s,l,this._rowCount))}_renderRows(s,l){this._renderer.value&&(s=Math.min(s,this._rowCount-1),l=Math.min(l,this._rowCount-1),this._renderer.value.renderRows(s,l),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:l}),this._onRender.fire({start:s,end:l}),this._isNextRenderRedrawOnly=!0)}resize(s,l){this._rowCount=l,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(l=>this.refreshRows(l.start,l.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,l;this._renderer.value&&((l=(s=this._renderer.value).clearTextureAtlas)==null||l.call(s),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(s,l){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var v;return(v=this._renderer.value)==null?void 0:v.handleResize(s,l)}):this._renderer.value.handleResize(s,l),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,l,v){var C;this._selectionState.start=s,this._selectionState.end=l,this._selectionState.columnSelectMode=v,(C=this._renderer.value)==null||C.handleSelectionChanged(s,l,v)}handleCursorMove(){var s;(s=this._renderer.value)==null||s.handleCursorMove()}clear(){var s;(s=this._renderer.value)==null||s.clear()}};a.RenderService=o=f([g(2,c.IOptionsService),g(3,p.ICharSizeService),g(4,c.IDecorationService),g(5,c.IBufferService),g(6,p.ICoreBrowserService),g(7,p.IThemeService)],o)},9312:function(m,a,u){var f=this&&this.__decorate||function(y,b,R,M){var B,T=arguments.length,N=T<3?b:M===null?M=Object.getOwnPropertyDescriptor(b,R):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,b,R,M);else for(var F=y.length-1;F>=0;F--)(B=y[F])&&(N=(T<3?B(N):T>3?B(b,R,N):B(b,R))||N);return T>3&&N&&Object.defineProperty(b,R,N),N},g=this&&this.__param||function(y,b){return function(R,M){b(R,M,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const d=u(9806),p=u(9504),S=u(456),w=u(4725),_=u(8460),c=u(844),o=u(6114),s=u(4841),l=u(511),v=u(2585),C=" ",x=new RegExp(C,"g");let k=a.SelectionService=class extends c.Disposable{constructor(y,b,R,M,B,T,N,F,K){super(),this._element=y,this._screenElement=b,this._linkifier=R,this._bufferService=M,this._coreService=B,this._mouseService=T,this._optionsService=N,this._renderService=F,this._coreBrowserService=K,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new l.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new _.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new _.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=q=>this._handleMouseMove(q),this._mouseUpListener=q=>this._handleMouseUp(q),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(q=>this._handleTrim(q)),this.register(this._bufferService.buffers.onBufferActivate(q=>this._handleBufferActivate(q))),this.enable(),this._model=new S.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,c.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,M=[];if(this._activeSelectionMode===3){if(y[0]===b[0])return"";const B=y[0]<b[0]?y[0]:b[0],T=y[0]<b[0]?b[0]:y[0];for(let N=y[1];N<=b[1];N++){const F=R.translateBufferLineToString(N,!0,B,T);M.push(F)}}else{const B=y[1]===b[1]?b[0]:void 0;M.push(R.translateBufferLineToString(y[1],!0,y[0],B));for(let T=y[1]+1;T<=b[1]-1;T++){const N=R.lines.get(T),F=R.translateBufferLineToString(T,!0);N!=null&&N.isWrapped?M[M.length-1]+=F:M.push(F)}if(y[1]!==b[1]){const T=R.lines.get(b[1]),N=R.translateBufferLineToString(b[1],!0,0,b[0]);T&&T.isWrapped?M[M.length-1]+=N:M.push(N)}}return M.map(B=>B.replace(x," ")).join(o.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())),o.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,M=this._model.finalSelectionEnd;return!!(R&&M&&b)&&this._areCoordsInSelection(b,R,M)}isCellInSelection(y,b){const R=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!R||!M)&&this._areCoordsInSelection([y,b],R,M)}_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 B,T;const R=(T=(B=this._linkifier.currentLink)==null?void 0:B.link)==null?void 0:T.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 M=this._getMouseBufferCoords(y);return!!M&&(this._selectWordAt(M,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 o.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&&!(o.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 M=R.lines.get(this._model.selectionEnd[1]);M&&M.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 M=(0,p.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(M,!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 M=0;b>=M;M++){const B=y.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:B>1&&b!==M&&(R+=B-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,M=!0){if(y[0]>=this._bufferService.cols)return;const B=this._bufferService.buffer,T=B.lines.get(y[1]);if(!T)return;const N=B.translateBufferLineToString(y[1],!1);let F=this._convertViewportColToCharacterIndex(T,y[0]),K=F;const q=y[0]-F;let j=0,E=0,D=0,P=0;if(N.charAt(F)===" "){for(;F>0&&N.charAt(F-1)===" ";)F--;for(;K<N.length&&N.charAt(K+1)===" ";)K++}else{let V=y[0],J=y[0];T.getWidth(V)===0&&(j++,V--),T.getWidth(J)===2&&(E++,J++);const Z=T.getString(J).length;for(Z>1&&(P+=Z-1,K+=Z-1);V>0&&F>0&&!this._isCharWordSeparator(T.loadCell(V-1,this._workCell));){T.loadCell(V-1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===0?(j++,V--):I>1&&(D+=I-1,F-=I-1),F--,V--}for(;J<T.length&&K+1<N.length&&!this._isCharWordSeparator(T.loadCell(J+1,this._workCell));){T.loadCell(J+1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===2?(E++,J++):I>1&&(P+=I-1,K+=I-1),K++,J++}}K++;let O=F+q-j+D,W=Math.min(this._bufferService.cols,K-F+j+E-D-P);if(b||N.slice(F,K).trim()!==""){if(R&&O===0&&T.getCodePoint(0)!==32){const V=B.lines.get(y[1]-1);if(V&&T.isWrapped&&V.getCodePoint(this._bufferService.cols-1)!==32){const J=this._getWordAt([this._bufferService.cols-1,y[1]-1],!1,!0,!1);if(J){const Z=this._bufferService.cols-J.start;O-=Z,W+=Z}}}if(M&&O+W===this._bufferService.cols&&T.getCodePoint(this._bufferService.cols-1)!==32){const V=B.lines.get(y[1]+1);if(V!=null&&V.isWrapped&&V.getCodePoint(0)!==32){const J=this._getWordAt([0,y[1]+1],!1,!1,!0);J&&(W+=J.length)}}return{start:O,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)}};a.SelectionService=k=f([g(3,v.IBufferService),g(4,v.ICoreService),g(5,w.IMouseService),g(6,v.IOptionsService),g(7,w.IRenderService),g(8,w.ICoreBrowserService)],k)},4725:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const f=u(8343);a.ICharSizeService=(0,f.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),a.IMouseService=(0,f.createDecorator)("MouseService"),a.IRenderService=(0,f.createDecorator)("RenderService"),a.ISelectionService=(0,f.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,f.createDecorator)("ThemeService"),a.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(m,a,u){var f=this&&this.__decorate||function(k,y,b,R){var M,B=arguments.length,T=B<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,b):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(k,y,b,R);else for(var N=k.length-1;N>=0;N--)(M=k[N])&&(T=(B<3?M(T):B>3?M(y,b,T):M(y,b))||T);return B>3&&T&&Object.defineProperty(y,b,T),T},g=this&&this.__param||function(k,y){return function(b,R){y(b,R,k)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const d=u(7239),p=u(8055),S=u(8460),w=u(844),_=u(2585),c=p.css.toColor("#ffffff"),o=p.css.toColor("#000000"),s=p.css.toColor("#ffffff"),l=p.css.toColor("#000000"),v={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const k=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],y=[0,95,135,175,215,255];for(let b=0;b<216;b++){const R=y[b/36%6|0],M=y[b/6%6|0],B=y[b%6];k.push({css:p.channels.toCss(R,M,B),rgba:p.channels.toRgba(R,M,B)})}for(let b=0;b<24;b++){const R=8+10*b;k.push({css:p.channels.toCss(R,R,R),rgba:p.channels.toRgba(R,R,R)})}return k})());let C=a.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(k){super(),this._optionsService=k,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:c,background:o,cursor:s,cursorAccent:l,selectionForeground:void 0,selectionBackgroundTransparent:v,selectionBackgroundOpaque:p.color.blend(o,v),selectionInactiveBackgroundTransparent:v,selectionInactiveBackgroundOpaque:p.color.blend(o,v),ansi:a.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(k={}){const y=this._colors;if(y.foreground=x(k.foreground,c),y.background=x(k.background,o),y.cursor=x(k.cursor,s),y.cursorAccent=x(k.cursorAccent,l),y.selectionBackgroundTransparent=x(k.selectionBackground,v),y.selectionBackgroundOpaque=p.color.blend(y.background,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundTransparent=x(k.selectionInactiveBackground,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundOpaque=p.color.blend(y.background,y.selectionInactiveBackgroundTransparent),y.selectionForeground=k.selectionForeground?x(k.selectionForeground,p.NULL_COLOR):void 0,y.selectionForeground===p.NULL_COLOR&&(y.selectionForeground=void 0),p.color.isOpaque(y.selectionBackgroundTransparent)&&(y.selectionBackgroundTransparent=p.color.opacity(y.selectionBackgroundTransparent,.3)),p.color.isOpaque(y.selectionInactiveBackgroundTransparent)&&(y.selectionInactiveBackgroundTransparent=p.color.opacity(y.selectionInactiveBackgroundTransparent,.3)),y.ansi=a.DEFAULT_ANSI_COLORS.slice(),y.ansi[0]=x(k.black,a.DEFAULT_ANSI_COLORS[0]),y.ansi[1]=x(k.red,a.DEFAULT_ANSI_COLORS[1]),y.ansi[2]=x(k.green,a.DEFAULT_ANSI_COLORS[2]),y.ansi[3]=x(k.yellow,a.DEFAULT_ANSI_COLORS[3]),y.ansi[4]=x(k.blue,a.DEFAULT_ANSI_COLORS[4]),y.ansi[5]=x(k.magenta,a.DEFAULT_ANSI_COLORS[5]),y.ansi[6]=x(k.cyan,a.DEFAULT_ANSI_COLORS[6]),y.ansi[7]=x(k.white,a.DEFAULT_ANSI_COLORS[7]),y.ansi[8]=x(k.brightBlack,a.DEFAULT_ANSI_COLORS[8]),y.ansi[9]=x(k.brightRed,a.DEFAULT_ANSI_COLORS[9]),y.ansi[10]=x(k.brightGreen,a.DEFAULT_ANSI_COLORS[10]),y.ansi[11]=x(k.brightYellow,a.DEFAULT_ANSI_COLORS[11]),y.ansi[12]=x(k.brightBlue,a.DEFAULT_ANSI_COLORS[12]),y.ansi[13]=x(k.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),y.ansi[14]=x(k.brightCyan,a.DEFAULT_ANSI_COLORS[14]),y.ansi[15]=x(k.brightWhite,a.DEFAULT_ANSI_COLORS[15]),k.extendedAnsi){const b=Math.min(y.ansi.length-16,k.extendedAnsi.length);for(let R=0;R<b;R++)y.ansi[R+16]=x(k.extendedAnsi[R],a.DEFAULT_ANSI_COLORS[R+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(k){this._restoreColor(k),this._onChangeColors.fire(this.colors)}_restoreColor(k){if(k!==void 0)switch(k){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[k]=this._restoreColors.ansi[k]}else for(let y=0;y<this._restoreColors.ansi.length;++y)this._colors.ansi[y]=this._restoreColors.ansi[y]}modifyColors(k){k(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(k,y){if(k!==void 0)try{return p.css.toColor(k)}catch{}return y}a.ThemeService=C=f([g(0,_.IOptionsService)],C)},6349:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const f=u(8460),g=u(844);class d extends g.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 _=0;_<Math.min(S,this.length);_++)w[_]=this._array[this._getCyclicIndex(_)];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,..._){if(w){for(let c=S;c<this._length-w;c++)this._array[this._getCyclicIndex(c)]=this._array[this._getCyclicIndex(c+w)];this._length-=w,this.onDeleteEmitter.fire({index:S,amount:w})}for(let c=this._length-1;c>=S;c--)this._array[this._getCyclicIndex(c+_.length)]=this._array[this._getCyclicIndex(c)];for(let c=0;c<_.length;c++)this._array[this._getCyclicIndex(S+c)]=_[c];if(_.length&&this.onInsertEmitter.fire({index:S,amount:_.length}),this._length+_.length>this._maxLength){const c=this._length+_.length-this._maxLength;this._startIndex+=c,this._length=this._maxLength,this.onTrimEmitter.fire(c)}else this._length+=_.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,w,_){if(!(w<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let o=w-1;o>=0;o--)this.set(S+o+_,this.get(S+o));const c=S+w+_-this._length;if(c>0)for(this._length+=c;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let c=0;c<w;c++)this.set(S+c+_,this.get(S+c))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}a.CircularList=d},1439:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function u(f,g=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const p in f)d[p]=g<=1?f[p]:f[p]&&u(f[p],g-1);return d}},8055:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let u=0,f=0,g=0,d=0;var p,S,w,_,c;function o(l){const v=l.toString(16);return v.length<2?"0"+v:v}function s(l,v){return l<v?(v+.05)/(l+.05):(l+.05)/(v+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},function(l){l.toCss=function(v,C,x,k){return k!==void 0?`#${o(v)}${o(C)}${o(x)}${o(k)}`:`#${o(v)}${o(C)}${o(x)}`},l.toRgba=function(v,C,x,k=255){return(v<<24|C<<16|x<<8|k)>>>0},l.toColor=function(v,C,x,k){return{css:l.toCss(v,C,x,k),rgba:l.toRgba(v,C,x,k)}}}(p||(a.channels=p={})),function(l){function v(C,x){return d=Math.round(255*x),[u,f,g]=c.toChannels(C.rgba),{css:p.toCss(u,f,g,d),rgba:p.toRgba(u,f,g,d)}}l.blend=function(C,x){if(d=(255&x.rgba)/255,d===1)return{css:x.css,rgba:x.rgba};const k=x.rgba>>24&255,y=x.rgba>>16&255,b=x.rgba>>8&255,R=C.rgba>>24&255,M=C.rgba>>16&255,B=C.rgba>>8&255;return u=R+Math.round((k-R)*d),f=M+Math.round((y-M)*d),g=B+Math.round((b-B)*d),{css:p.toCss(u,f,g),rgba:p.toRgba(u,f,g)}},l.isOpaque=function(C){return(255&C.rgba)==255},l.ensureContrastRatio=function(C,x,k){const y=c.ensureContrastRatio(C.rgba,x.rgba,k);if(y)return p.toColor(y>>24&255,y>>16&255,y>>8&255)},l.opaque=function(C){const x=(255|C.rgba)>>>0;return[u,f,g]=c.toChannels(x),{css:p.toCss(u,f,g),rgba:x}},l.opacity=v,l.multiplyOpacity=function(C,x){return d=255&C.rgba,v(C,d*x/255)},l.toColorRGB=function(C){return[C.rgba>>24&255,C.rgba>>16&255,C.rgba>>8&255]}}(S||(a.color=S={})),function(l){let v,C;try{const x=document.createElement("canvas");x.width=1,x.height=1;const k=x.getContext("2d",{willReadFrequently:!0});k&&(v=k,v.globalCompositeOperation="copy",C=v.createLinearGradient(0,0,1,1))}catch{}l.toColor=function(x){if(x.match(/#[\da-f]{3,8}/i))switch(x.length){case 4:return u=parseInt(x.slice(1,2).repeat(2),16),f=parseInt(x.slice(2,3).repeat(2),16),g=parseInt(x.slice(3,4).repeat(2),16),p.toColor(u,f,g);case 5:return u=parseInt(x.slice(1,2).repeat(2),16),f=parseInt(x.slice(2,3).repeat(2),16),g=parseInt(x.slice(3,4).repeat(2),16),d=parseInt(x.slice(4,5).repeat(2),16),p.toColor(u,f,g,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 k=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(k)return u=parseInt(k[1]),f=parseInt(k[2]),g=parseInt(k[3]),d=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),p.toColor(u,f,g,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),[u,f,g,d]=v.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(u,f,g,d),css:x}}}(w||(a.css=w={})),function(l){function v(C,x,k){const y=C/255,b=x/255,R=k/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))}l.relativeLuminance=function(C){return v(C>>16&255,C>>8&255,255&C)},l.relativeLuminance2=v}(_||(a.rgb=_={})),function(l){function v(x,k,y){const b=x>>24&255,R=x>>16&255,M=x>>8&255;let B=k>>24&255,T=k>>16&255,N=k>>8&255,F=s(_.relativeLuminance2(B,T,N),_.relativeLuminance2(b,R,M));for(;F<y&&(B>0||T>0||N>0);)B-=Math.max(0,Math.ceil(.1*B)),T-=Math.max(0,Math.ceil(.1*T)),N-=Math.max(0,Math.ceil(.1*N)),F=s(_.relativeLuminance2(B,T,N),_.relativeLuminance2(b,R,M));return(B<<24|T<<16|N<<8|255)>>>0}function C(x,k,y){const b=x>>24&255,R=x>>16&255,M=x>>8&255;let B=k>>24&255,T=k>>16&255,N=k>>8&255,F=s(_.relativeLuminance2(B,T,N),_.relativeLuminance2(b,R,M));for(;F<y&&(B<255||T<255||N<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),T=Math.min(255,T+Math.ceil(.1*(255-T))),N=Math.min(255,N+Math.ceil(.1*(255-N))),F=s(_.relativeLuminance2(B,T,N),_.relativeLuminance2(b,R,M));return(B<<24|T<<16|N<<8|255)>>>0}l.blend=function(x,k){if(d=(255&k)/255,d===1)return k;const y=k>>24&255,b=k>>16&255,R=k>>8&255,M=x>>24&255,B=x>>16&255,T=x>>8&255;return u=M+Math.round((y-M)*d),f=B+Math.round((b-B)*d),g=T+Math.round((R-T)*d),p.toRgba(u,f,g)},l.ensureContrastRatio=function(x,k,y){const b=_.relativeLuminance(x>>8),R=_.relativeLuminance(k>>8);if(s(b,R)<y){if(R<b){const T=v(x,k,y),N=s(b,_.relativeLuminance(T>>8));if(N<y){const F=C(x,k,y);return N>s(b,_.relativeLuminance(F>>8))?T:F}return T}const M=C(x,k,y),B=s(b,_.relativeLuminance(M>>8));if(B<y){const T=v(x,k,y);return B>s(b,_.relativeLuminance(T>>8))?M:T}return M}},l.reduceLuminance=v,l.increaseLuminance=C,l.toChannels=function(x){return[x>>24&255,x>>16&255,x>>8&255,255&x]}}(c||(a.rgba=c={})),a.toPaddedHex=o,a.contrastRatio=s},8969:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const f=u(844),g=u(2585),d=u(4348),p=u(7866),S=u(744),w=u(7302),_=u(6975),c=u(8460),o=u(1753),s=u(1480),l=u(7994),v=u(9282),C=u(5435),x=u(5981),k=u(2660);let y=!1;class b extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new c.EventEmitter),this._onScroll.event(M=>{var B;(B=this._onScrollApi)==null||B.fire(M.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(M){for(const B in M)this.optionsService.options[B]=M[B]}constructor(M){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new c.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new c.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new c.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new c.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new c.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new w.OptionsService(M)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(_.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(o.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(l.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(k.OscLinkService),this._instantiationService.setService(g.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,c.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,c.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,c.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,c.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(B=>{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(B=>{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((B,T)=>this._inputHandler.parse(B,T))),this.register((0,c.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,B){this._writeBuffer.write(M,B)}writeSync(M,B){this._logService.logLevel<=g.LogLevelEnum.WARN&&!y&&(this._logService.warn("writeSync is unreliable and will be removed soon."),y=!0),this._writeBuffer.writeSync(M,B)}input(M,B=!0){this.coreService.triggerDataEvent(M,B)}resize(M,B){isNaN(M)||isNaN(B)||(M=Math.max(M,S.MINIMUM_COLS),B=Math.max(B,S.MINIMUM_ROWS),this._bufferService.resize(M,B))}scroll(M,B=!1){this._bufferService.scroll(M,B)}scrollLines(M,B,T){this._bufferService.scrollLines(M,B,T)}scrollPages(M){this.scrollLines(M*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(M){const B=M-this._bufferService.buffer.ydisp;B!==0&&this.scrollLines(B)}registerEscHandler(M,B){return this._inputHandler.registerEscHandler(M,B)}registerDcsHandler(M,B){return this._inputHandler.registerDcsHandler(M,B)}registerCsiHandler(M,B){return this._inputHandler.registerCsiHandler(M,B)}registerOscHandler(M,B){return this._inputHandler.registerOscHandler(M,B)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let M=!1;const B=this.optionsService.rawOptions.windowsPty;B&&B.buildNumber!==void 0&&B.buildNumber!==void 0?M=B.backend==="conpty"&&B.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(M=!0),M?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const M=[];M.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},()=>((0,v.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)(()=>{for(const B of M)B.dispose()})}}}a.CoreTerminal=b},8460:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===u)return void this._listeners.splice(f,1)}}})),this._event}fire(u,f){const g=[];for(let d=0;d<this._listeners.length;d++)g.push(this._listeners[d]);for(let d=0;d<g.length;d++)g[d].call(void 0,u,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(u,f){return u(g=>f.fire(g))},a.runAndSubscribe=function(u,f){return f(void 0),u(g=>f(g))}},5435:function(m,a,u){var f=this&&this.__decorate||function(j,E,D,P){var O,W=arguments.length,V=W<3?E:P===null?P=Object.getOwnPropertyDescriptor(E,D):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(j,E,D,P);else for(var J=j.length-1;J>=0;J--)(O=j[J])&&(V=(W<3?O(V):W>3?O(E,D,V):O(E,D))||V);return W>3&&V&&Object.defineProperty(E,D,V),V},g=this&&this.__param||function(j,E){return function(D,P){E(D,P,j)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const d=u(2584),p=u(7116),S=u(2015),w=u(844),_=u(482),c=u(8437),o=u(8460),s=u(643),l=u(511),v=u(3734),C=u(2585),x=u(1480),k=u(6242),y=u(6351),b=u(5941),R={"(":0,")":1,"*":2,"+":3,"-":1,".":2},M=131072;function B(j,E){if(j>24)return E.setWinLines||!1;switch(j){case 1:return!!E.restoreWin;case 2:return!!E.minimizeWin;case 3:return!!E.setWinPosition;case 4:return!!E.setWinSizePixels;case 5:return!!E.raiseWin;case 6:return!!E.lowerWin;case 7:return!!E.refreshWin;case 8:return!!E.setWinSizeChars;case 9:return!!E.maximizeWin;case 10:return!!E.fullscreenWin;case 11:return!!E.getWinState;case 13:return!!E.getWinPosition;case 14:return!!E.getWinSizePixels;case 15:return!!E.getScreenSizePixels;case 16:return!!E.getCellSizePixels;case 18:return!!E.getWinSizeChars;case 19:return!!E.getScreenSizeChars;case 20:return!!E.getIconTitle;case 21:return!!E.getWinTitle;case 22:return!!E.pushTitle;case 23:return!!E.popTitle;case 24:return!!E.setWinLines}return!1}var T;(function(j){j[j.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",j[j.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T||(a.WindowsOptionsReportType=T={}));let N=0;class F extends w.Disposable{getAttrData(){return this._curAttrData}constructor(E,D,P,O,W,V,J,Z,I=new S.EscapeSequenceParser){super(),this._bufferService=E,this._charsetService=D,this._coreService=P,this._logService=O,this._optionsService=W,this._oscLinkService=V,this._coreMouseService=J,this._unicodeService=Z,this._parser=I,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.Utf8ToUtf32,this._workCell=new l.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=c.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=c.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new o.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new o.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new o.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new o.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new o.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new o.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new o.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new o.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new o.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new o.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new o.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,H)=>{this._logService.debug("Unknown OSC code: ",{identifier:L,action:U,data:H})}),this._parser.setDcsHandlerFallback((L,U,H)=>{U==="HOOK"&&(H=H.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(L),action:U,payload:H})}),this._parser.setPrintHandler((L,U,H)=>this.print(L,U,H)),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 k.OscHandler(L=>(this.setTitle(L),this.setIconName(L),!0))),this._parser.registerOscHandler(1,new k.OscHandler(L=>this.setIconName(L))),this._parser.registerOscHandler(2,new k.OscHandler(L=>this.setTitle(L))),this._parser.registerOscHandler(4,new k.OscHandler(L=>this.setOrReportIndexedColor(L))),this._parser.registerOscHandler(8,new k.OscHandler(L=>this.setHyperlink(L))),this._parser.registerOscHandler(10,new k.OscHandler(L=>this.setOrReportFgColor(L))),this._parser.registerOscHandler(11,new k.OscHandler(L=>this.setOrReportBgColor(L))),this._parser.registerOscHandler(12,new k.OscHandler(L=>this.setOrReportCursorColor(L))),this._parser.registerOscHandler(104,new k.OscHandler(L=>this.restoreIndexedColor(L))),this._parser.registerOscHandler(110,new k.OscHandler(L=>this.restoreFgColor(L))),this._parser.registerOscHandler(111,new k.OscHandler(L=>this.restoreBgColor(L))),this._parser.registerOscHandler(112,new k.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 p.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(E,D,P,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=E,this._parseStack.cursorStartY=D,this._parseStack.decodedLength=P,this._parseStack.position=O}_logSlowResolvingAsync(E){this._logService.logLevel<=C.LogLevelEnum.WARN&&Promise.race([E,new Promise((D,P)=>setTimeout(()=>P("#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(E,D){let P,O=this._activeBuffer.x,W=this._activeBuffer.y,V=0;const J=this._parseStack.paused;if(J){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,D))return this._logSlowResolvingAsync(P),P;O=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,E.length>M&&(V=this._parseStack.position+M)}if(this._logService.logLevel<=C.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof E=="string"?` "${E}"`:` "${Array.prototype.map.call(E,L=>String.fromCharCode(L)).join("")}"`),typeof E=="string"?E.split("").map(L=>L.charCodeAt(0)):E),this._parseBuffer.length<E.length&&this._parseBuffer.length<M&&(this._parseBuffer=new Uint32Array(Math.min(E.length,M))),J||this._dirtyRowTracker.clearRange(),E.length>M)for(let L=V;L<E.length;L+=M){const U=L+M<E.length?L+M:E.length,H=typeof E=="string"?this._stringDecoder.decode(E.substring(L,U),this._parseBuffer):this._utf8Decoder.decode(E.subarray(L,U),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,H))return this._preserveStack(O,W,H,L),this._logSlowResolvingAsync(P),P}else if(!J){const L=typeof E=="string"?this._stringDecoder.decode(E,this._parseBuffer):this._utf8Decoder.decode(E,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,L))return this._preserveStack(O,W,L,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===O&&this._activeBuffer.y===W||this._onCursorMove.fire();const Z=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(Z,this._bufferService.rows-1))}print(E,D,P){let O,W;const V=this._charsetService.charset,J=this._optionsService.rawOptions.screenReaderMode,Z=this._bufferService.cols,I=this._coreService.decPrivateModes.wraparound,L=this._coreService.modes.insertMode,U=this._curAttrData;let H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-D>0&&H.getWidth(this._activeBuffer.x-1)===2&&H.setCellFromCodepoint(this._activeBuffer.x-1,0,1,U);let X=this._parser.precedingJoinState;for(let G=D;G<P;++G){if(O=E[G],O<127&&V){const ne=V[String.fromCharCode(O)];ne&&(O=ne.charCodeAt(0))}const se=this._unicodeService.charProperties(O,X);W=x.UnicodeService.extractWidth(se);const z=x.UnicodeService.extractShouldJoin(se),te=z?x.UnicodeService.extractWidth(X):0;if(X=se,J&&this._onA11yChar.fire((0,_.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-te>Z){if(I){const ne=H;let ee=this._activeBuffer.x-te;for(this._activeBuffer.x=te,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),H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),te>0&&H instanceof c.BufferLine&&H.copyCellsFrom(ne,ee,0,te,!1);ee<Z;)ne.setCellFromCodepoint(ee++,0,1,U)}else if(this._activeBuffer.x=Z-1,W===2)continue}if(z&&this._activeBuffer.x){const ne=H.getWidth(this._activeBuffer.x-1)?1:2;H.addCodepointToCell(this._activeBuffer.x-ne,O,W);for(let ee=W-te;--ee>=0;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,U)}else if(L&&(H.insertCells(this._activeBuffer.x,W-te,this._activeBuffer.getNullCell(U)),H.getWidth(Z-1)===2&&H.setCellFromCodepoint(Z-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,U)),H.setCellFromCodepoint(this._activeBuffer.x++,O,W,U),W>0)for(;--W;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,U)}this._parser.precedingJoinState=X,this._activeBuffer.x<Z&&P-D>0&&H.getWidth(this._activeBuffer.x)===0&&!H.hasContent(this._activeBuffer.x)&&H.setCellFromCodepoint(this._activeBuffer.x,0,1,U),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(E,D){return E.final!=="t"||E.prefix||E.intermediates?this._parser.registerCsiHandler(E,D):this._parser.registerCsiHandler(E,P=>!B(P.params[0],this._optionsService.rawOptions.windowOptions)||D(P))}registerDcsHandler(E,D){return this._parser.registerDcsHandler(E,new y.DcsHandler(D))}registerEscHandler(E,D){return this._parser.registerEscHandler(E,D)}registerOscHandler(E,D){return this._parser.registerOscHandler(E,new k.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 E;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&&((E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&E.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 E=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-E),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(E=this._bufferService.cols-1){this._activeBuffer.x=Math.min(E,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(E,D){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=E,this._activeBuffer.y=this._activeBuffer.scrollTop+D):(this._activeBuffer.x=E,this._activeBuffer.y=D),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(E,D){this._restrictCursor(),this._setCursor(this._activeBuffer.x+E,this._activeBuffer.y+D)}cursorUp(E){const D=this._activeBuffer.y-this._activeBuffer.scrollTop;return D>=0?this._moveCursor(0,-Math.min(D,E.params[0]||1)):this._moveCursor(0,-(E.params[0]||1)),!0}cursorDown(E){const D=this._activeBuffer.scrollBottom-this._activeBuffer.y;return D>=0?this._moveCursor(0,Math.min(D,E.params[0]||1)):this._moveCursor(0,E.params[0]||1),!0}cursorForward(E){return this._moveCursor(E.params[0]||1,0),!0}cursorBackward(E){return this._moveCursor(-(E.params[0]||1),0),!0}cursorNextLine(E){return this.cursorDown(E),this._activeBuffer.x=0,!0}cursorPrecedingLine(E){return this.cursorUp(E),this._activeBuffer.x=0,!0}cursorCharAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(E){return this._setCursor(E.length>=2?(E.params[1]||1)-1:0,(E.params[0]||1)-1),!0}charPosAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(E){return this._moveCursor(E.params[0]||1,0),!0}linePosAbsolute(E){return this._setCursor(this._activeBuffer.x,(E.params[0]||1)-1),!0}vPositionRelative(E){return this._moveCursor(0,E.params[0]||1),!0}hVPosition(E){return this.cursorPosition(E),!0}tabClear(E){const D=E.params[0];return D===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:D===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=E.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=E.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(E){const D=E.params[0];return D===1&&(this._curAttrData.bg|=536870912),D!==2&&D!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(E,D,P,O=!1,W=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);V.replaceCells(D,P,this._activeBuffer.getNullCell(this._eraseAttrData()),W),O&&(V.isWrapped=!1)}_resetBufferLine(E,D=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),D),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+E),P.isWrapped=!1)}eraseInDisplay(E,D=!1){let P;switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);P<this._bufferService.rows;P++)this._resetBufferLine(P,D);this._dirtyRowTracker.markDirty(P);break;case 1:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P,0,this._activeBuffer.x+1,!0,D),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,D);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,D);this._dirtyRowTracker.markDirty(0);break;case 3:const O=this._activeBuffer.lines.length-this._bufferService.rows;O>0&&(this._activeBuffer.lines.trimStart(O),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-O,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-O,0),this._onScroll.fire(0))}return!0}eraseInLine(E,D=!1){switch(this._restrictCursor(this._bufferService.cols),E.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(E){this._restrictCursor();let D=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;D--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(E){this._restrictCursor();let D=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y;let O;for(O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-O;D--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.insertCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.deleteCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(E){let D=E.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(E){let D=E.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(c.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);O.deleteCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);O.insertCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);O.insertCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);O.deleteCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(E.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(E){const D=this._parser.precedingJoinState;if(!D)return!0;const P=E.params[0]||1,O=x.UnicodeService.extractWidth(D),W=this._activeBuffer.x-O,V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),J=new Uint32Array(V.length*P);let Z=0;for(let L=0;L<V.length;){const U=V.codePointAt(L)||0;J[Z++]=U,L+=U>65535?2:1}let I=Z;for(let L=1;L<P;++L)J.copyWithin(I,0,Z),I+=Z;return this.print(J,0,I),!0}sendDeviceAttributesPrimary(E){return E.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(E){return E.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(E.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(E){return(this._optionsService.rawOptions.termName+"").indexOf(E)===0}setMode(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(E){for(let D=0;D<E.length;D++)switch(E.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(),E.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(E,D){const P=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:W}=this._coreMouseService,V=this._coreService,{buffers:J,cols:Z}=this._bufferService,{active:I,alt:L}=J,U=this._optionsService.rawOptions,H=z=>z?1:2,X=E.params[0];return G=X,se=D?X===2?4:X===4?H(V.modes.insertMode):X===12?3:X===20?H(U.convertEol):0:X===1?H(P.applicationCursorKeys):X===3?U.windowOptions.setWinLines?Z===80?2:Z===132?1:0:0:X===6?H(P.origin):X===7?H(P.wraparound):X===8?3:X===9?H(O==="X10"):X===12?H(U.cursorBlink):X===25?H(!V.isCursorHidden):X===45?H(P.reverseWraparound):X===66?H(P.applicationKeypad):X===67?4:X===1e3?H(O==="VT200"):X===1002?H(O==="DRAG"):X===1003?H(O==="ANY"):X===1004?H(P.sendFocus):X===1005?4:X===1006?H(W==="SGR"):X===1015?4:X===1016?H(W==="SGR_PIXELS"):X===1048?1:X===47||X===1047||X===1049?H(I===L):X===2004?H(P.bracketedPasteMode):0,V.triggerDataEvent(`${d.C0.ESC}[${D?"":"?"}${G};${se}$y`),!0;var G,se}_updateAttrColor(E,D,P,O,W){return D===2?(E|=50331648,E&=-16777216,E|=v.AttributeData.fromColorRGB([P,O,W])):D===5&&(E&=-50331904,E|=33554432|255&P),E}_extractColor(E,D,P){const O=[0,0,-1,0,0,0];let W=0,V=0;do{if(O[V+W]=E.params[D+V],E.hasSubParams(D+V)){const J=E.getSubParams(D+V);let Z=0;do O[1]===5&&(W=1),O[V+Z+1+W]=J[Z];while(++Z<J.length&&Z+V+1+W<O.length);break}if(O[1]===5&&V+W>=2||O[1]===2&&V+W>=5)break;O[1]&&(W=1)}while(++V+D<E.length&&V+W<O.length);for(let J=2;J<O.length;++J)O[J]===-1&&(O[J]=0);switch(O[0]){case 38:P.fg=this._updateAttrColor(P.fg,O[1],O[3],O[4],O[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,O[1],O[3],O[4],O[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,O[1],O[3],O[4],O[5])}return V}_processUnderline(E,D){D.extended=D.extended.clone(),(!~E||E>5)&&(E=1),D.extended.underlineStyle=E,D.fg|=268435456,E===0&&(D.fg&=-268435457),D.updateExtended()}_processSGR0(E){E.fg=c.DEFAULT_ATTR_DATA.fg,E.bg=c.DEFAULT_ATTR_DATA.bg,E.extended=E.extended.clone(),E.extended.underlineStyle=0,E.extended.underlineColor&=-67108864,E.updateExtended()}charAttributes(E){if(E.length===1&&E.params[0]===0)return this._processSGR0(this._curAttrData),!0;const D=E.length;let P;const O=this._curAttrData;for(let W=0;W<D;W++)P=E.params[W],P>=30&&P<=37?(O.fg&=-50331904,O.fg|=16777216|P-30):P>=40&&P<=47?(O.bg&=-50331904,O.bg|=16777216|P-40):P>=90&&P<=97?(O.fg&=-50331904,O.fg|=16777224|P-90):P>=100&&P<=107?(O.bg&=-50331904,O.bg|=16777224|P-100):P===0?this._processSGR0(O):P===1?O.fg|=134217728:P===3?O.bg|=67108864:P===4?(O.fg|=268435456,this._processUnderline(E.hasSubParams(W)?E.getSubParams(W)[0]:1,O)):P===5?O.fg|=536870912:P===7?O.fg|=67108864:P===8?O.fg|=1073741824:P===9?O.fg|=2147483648:P===2?O.bg|=134217728:P===21?this._processUnderline(2,O):P===22?(O.fg&=-134217729,O.bg&=-134217729):P===23?O.bg&=-67108865:P===24?(O.fg&=-268435457,this._processUnderline(0,O)):P===25?O.fg&=-536870913:P===27?O.fg&=-67108865:P===28?O.fg&=-1073741825:P===29?O.fg&=2147483647:P===39?(O.fg&=-67108864,O.fg|=16777215&c.DEFAULT_ATTR_DATA.fg):P===49?(O.bg&=-67108864,O.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?W+=this._extractColor(E,W,O):P===53?O.bg|=1073741824:P===55?O.bg&=-1073741825:P===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):P===100?(O.fg&=-67108864,O.fg|=16777215&c.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(E){switch(E.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const D=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${D};${P}R`)}return!0}deviceStatusPrivate(E){if(E.params[0]===6){const D=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${D};${P}R`)}return!0}softReset(E){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=c.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(E){const D=E.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 P=D%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(E){const D=E.params[0]||1;let P;return(E.length<2||(P=E.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>D&&(this._activeBuffer.scrollTop=D-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(E){if(!B(E.params[0],this._optionsService.rawOptions.windowOptions))return!0;const D=E.length>1?E.params[1]:0;switch(E.params[0]){case 14:D!==2&&this._onRequestWindowsOptionsReport.fire(T.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(T.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(E){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(E){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(E){return this._windowTitle=E,this._onTitleChange.fire(E),!0}setIconName(E){return this._iconName=E,!0}setOrReportIndexedColor(E){const D=[],P=E.split(";");for(;P.length>1;){const O=P.shift(),W=P.shift();if(/^\d+$/.exec(O)){const V=parseInt(O);if(q(V))if(W==="?")D.push({type:0,index:V});else{const J=(0,b.parseColor)(W);J&&D.push({type:1,index:V,color:J})}}}return D.length&&this._onColor.fire(D),!0}setHyperlink(E){const D=E.split(";");return!(D.length<2)&&(D[1]?this._createHyperlink(D[0],D[1]):!D[0]&&this._finishHyperlink())}_createHyperlink(E,D){this._getCurrentLinkId()&&this._finishHyperlink();const P=E.split(":");let O;const W=P.findIndex(V=>V.startsWith("id="));return W!==-1&&(O=P[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,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(E,D){const P=E.split(";");for(let O=0;O<P.length&&!(D>=this._specialColors.length);++O,++D)if(P[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[D]}]);else{const W=(0,b.parseColor)(P[O]);W&&this._onColor.fire([{type:1,index:this._specialColors[D],color:W}])}return!0}setOrReportFgColor(E){return this._setOrReportSpecialColor(E,0)}setOrReportBgColor(E){return this._setOrReportSpecialColor(E,1)}setOrReportCursorColor(E){return this._setOrReportSpecialColor(E,2)}restoreIndexedColor(E){if(!E)return this._onColor.fire([{type:2}]),!0;const D=[],P=E.split(";");for(let O=0;O<P.length;++O)if(/^\d+$/.exec(P[O])){const W=parseInt(P[O]);q(W)&&D.push({type:2,index:W})}return D.length&&this._onColor.fire(D),!0}restoreFgColor(E){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(E){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(E){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),!0}selectCharset(E){return E.length!==2?(this.selectDefaultCharset(),!0):(E[0]==="/"||this._charsetService.setgCharset(R[E[0]],p.CHARSETS[E[1]]||p.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const E=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,E,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=c.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=c.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(E){return this._charsetService.setgLevel(E),!0}screenAlignmentPattern(){const E=new l.CellData;E.content=4194373,E.fg=this._curAttrData.fg,E.bg=this._curAttrData.bg,this._setCursor(0,0);for(let D=0;D<this._bufferService.rows;++D){const P=this._activeBuffer.ybase+this._activeBuffer.y+D,O=this._activeBuffer.lines.get(P);O&&(O.fill(E),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(E,D){const P=this._bufferService.buffer,O=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${W}${d.C0.ESC}\\`),!0))(E==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:E==='"p'?'P1$r61;1"p':E==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:E==="m"?"P1$r0m":E===" q"?`P1$r${{block:2,underline:4,bar:6}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(E,D){this._dirtyRowTracker.markRangeDirty(E,D)}}a.InputHandler=F;let K=class{constructor(j){this._bufferService=j,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(j){j<this.start?this.start=j:j>this.end&&(this.end=j)}markRangeDirty(j,E){j>E&&(N=j,j=E,E=N),j<this.start&&(this.start=j),E>this.end&&(this.end=E)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function q(j){return 0<=j&&j<256}K=f([g(0,C.IBufferService)],K)},844:(m,a)=>{function u(f){for(const g of f)g.dispose();f.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.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 g=this._disposables.indexOf(f);g!==-1&&this._disposables.splice(g,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var g;this._isDisposed||f===this._value||((g=this._value)==null||g.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}},a.toDisposable=function(f){return{dispose:f}},a.disposeArray=u,a.getDisposeArrayDisposable=function(f){return{dispose:()=>u(f)}}},1505:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(g,d,p){this._data[g]||(this._data[g]={}),this._data[g][d]=p}get(g,d){return this._data[g]?this._data[g][d]:void 0}clear(){this._data={}}}a.TwoKeyMap=u,a.FourKeyMap=class{constructor(){this._data=new u}set(f,g,d,p,S){this._data.get(f,g)||this._data.set(f,g,new u),this._data.get(f,g).set(d,p,S)}get(f,g,d,p){var S;return(S=this._data.get(f,g))==null?void 0:S.get(d,p)}clear(){this._data.clear()}}},6114:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const u=a.isNode?"node":navigator.userAgent,f=a.isNode?"node":navigator.platform;a.isFirefox=u.includes("Firefox"),a.isLegacyEdge=u.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(u),a.getSafariVersion=function(){if(!a.isSafari)return 0;const g=u.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),a.isIpad=f==="iPad",a.isIphone=f==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),a.isLinux=f.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(u)},6106:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let u=0;a.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(u=this._search(this._getKey(f)),this._array.splice(u,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const g=this._getKey(f);if(g===void 0||(u=this._search(g),u===-1)||this._getKey(this._array[u])!==g)return!1;do if(this._array[u]===f)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===g);return!1}*getKeyIterator(f){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===f)}forEachByKey(f,g){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do g(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===f)}values(){return[...this._array].values()}_search(f){let g=0,d=this._array.length-1;for(;d>=g;){let p=g+d>>1;const S=this._getKey(this._array[p]);if(S>f)d=p-1;else{if(!(S<f)){for(;p>0&&this._getKey(this._array[p-1])===f;)p--;return p}g=p+1}}return g}}},7226:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const f=u(6114);class g{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,_=0,c=S.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),_=Math.max(w,_),o=S.timeRemaining(),1.5*_>o)return c-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(c-w))}ms`),void this._start();c=o}this.clear()}}class d extends g{_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())}}}a.PriorityTaskQueue=d,a.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:d,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const f=u(643);a.updateWindowsModeWrappedState=function(g){const d=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),p=d==null?void 0:d.get(g.cols-1),S=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);S&&p&&(S.isWrapped=p[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&p[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class u{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 u;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}}a.AttributeData=u;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,p=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=p}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=f},9092:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const f=u(6349),g=u(7226),d=u(3734),p=u(8437),S=u(4634),w=u(511),_=u(643),c=u(4863),o=u(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(s,l,v){this._hasScrollback=s,this._optionsService=l,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=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=o.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.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,l){return new p.BufferLine(this._bufferService.cols,this.getNullCell(s),l)}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 l=s+this._optionsService.rawOptions.scrollback;return l>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:l}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=p.DEFAULT_ATTR_DATA);let l=this._rows;for(;l--;)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,l){const v=this.getNullCell(p.DEFAULT_ATTR_DATA);let C=0;const x=this._getCorrectBufferLength(l);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 k=0;if(this._rows<l)for(let y=this._rows;y<l;y++)this.lines.length<l+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(s,v)):this.ybase>0&&this.lines.length<=this.ybase+this.y+k+1?(this.ybase--,k++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(s,v)));else for(let y=this._rows;y>l;y--)this.lines.length>l+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,l-1),k&&(this.y+=k),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=l-1,this._isReflowEnabled&&(this._reflow(s,l),this._cols>s))for(let k=0;k<this.lines.length;k++)C+=+this.lines.get(k).resize(s,v);this._cols=s,this._rows=l,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 l=0;for(;this._memoryCleanupPosition<this.lines.length;)if(l+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),l>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,l){this._cols!==s&&(s>this._cols?this._reflowLarger(s,l):this._reflowSmaller(s,l))}_reflowLarger(s,l){const v=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(p.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,l,C.countRemoved)}}_reflowLargerAdjustViewport(s,l,v){const C=this.getNullCell(p.DEFAULT_ATTR_DATA);let x=v;for(;x-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<l&&this.lines.push(new p.BufferLine(s,C))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-v,0)}_reflowSmaller(s,l){const v=this.getNullCell(p.DEFAULT_ATTR_DATA),C=[];let x=0;for(let k=this.lines.length-1;k>=0;k--){let y=this.lines.get(k);if(!y||!y.isWrapped&&y.getTrimmedLength()<=s)continue;const b=[y];for(;y.isWrapped&&k>0;)y=this.lines.get(--k),b.unshift(y);const R=this.ybase+this.y;if(R>=k&&R<k+b.length)continue;const M=b[b.length-1].getTrimmedLength(),B=(0,S.reflowSmallerGetNewLineLengths)(b,this._cols,s),T=B.length-b.length;let N;N=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+T):Math.max(0,this.lines.length-this.lines.maxLength+T);const F=[];for(let P=0;P<T;P++){const O=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);F.push(O)}F.length>0&&(C.push({start:k+b.length+x,newLines:F}),x+=F.length),b.push(...F);let K=B.length-1,q=B[K];q===0&&(K--,q=B[K]);let j=b.length-T-1,E=M;for(;j>=0;){const P=Math.min(E,q);if(b[K]===void 0)break;if(b[K].copyCellsFrom(b[j],E-P,q-P,P,!0),q-=P,q===0&&(K--,q=B[K]),E-=P,E===0){j--;const O=Math.max(j,0);E=(0,S.getWrappedLineTrimmedLength)(b,O,this._cols)}}for(let P=0;P<b.length;P++)B[P]<s&&b[P].setCell(B[P],v);let D=T-N;for(;D-- >0;)this.ybase===0?this.y<l-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+x)-l&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+T,this.ybase+l-1)}if(C.length>0){const k=[],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,M=0,B=C[M];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+x);let T=0;for(let K=Math.min(this.lines.maxLength-1,b+x-1);K>=0;K--)if(B&&B.start>R+T){for(let q=B.newLines.length-1;q>=0;q--)this.lines.set(K--,B.newLines[q]);K++,k.push({index:R+1,amount:B.newLines.length}),T+=B.newLines.length,B=C[++M]}else this.lines.set(K,y[R--]);let N=0;for(let K=k.length-1;K>=0;K--)k[K].index+=N,this.lines.onInsertEmitter.fire(k[K]),N+=k[K].amount;const F=Math.max(0,b+x-this.lines.maxLength);F>0&&this.lines.onTrimEmitter.fire(F)}}translateBufferLineToString(s,l,v=0,C){const x=this.lines.get(s);return x?x.translateToString(l,v,C):""}getWrappedRangeForLine(s){let l=s,v=s;for(;l>0&&this.lines.get(l).isWrapped;)l--;for(;v+1<this.lines.length&&this.lines.get(v+1).isWrapped;)v++;return{first:l,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 l=0;l<this.markers.length;l++)this.markers[l].line===s&&(this.markers[l].dispose(),this.markers.splice(l--,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 l=new c.Marker(s);return this.markers.push(l),l.register(this.lines.onTrim(v=>{l.line-=v,l.line<0&&l.dispose()})),l.register(this.lines.onInsert(v=>{l.line>=v.index&&(l.line+=v.amount)})),l.register(this.lines.onDelete(v=>{l.line>=v.index&&l.line<v.index+v.amount&&l.dispose(),l.line>v.index&&(l.line-=v.amount)})),l.register(l.onDispose(()=>this._removeMarker(l))),l}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const f=u(3734),g=u(511),d=u(643),p=u(482);a.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let S=0;class w{constructor(c,o,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*c);const l=o||g.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let v=0;v<c;++v)this.setCell(v,l);this.length=c}get(c){const o=this._data[3*c+0],s=2097151&o;return[this._data[3*c+1],2097152&o?this._combined[c]:s?(0,p.stringFromCodePoint)(s):"",o>>22,2097152&o?this._combined[c].charCodeAt(this._combined[c].length-1):s]}set(c,o){this._data[3*c+1]=o[d.CHAR_DATA_ATTR_INDEX],o[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[c]=o[1],this._data[3*c+0]=2097152|c|o[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*c+0]=o[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(c){return this._data[3*c+0]>>22}hasWidth(c){return 12582912&this._data[3*c+0]}getFg(c){return this._data[3*c+1]}getBg(c){return this._data[3*c+2]}hasContent(c){return 4194303&this._data[3*c+0]}getCodePoint(c){const o=this._data[3*c+0];return 2097152&o?this._combined[c].charCodeAt(this._combined[c].length-1):2097151&o}isCombined(c){return 2097152&this._data[3*c+0]}getString(c){const o=this._data[3*c+0];return 2097152&o?this._combined[c]:2097151&o?(0,p.stringFromCodePoint)(2097151&o):""}isProtected(c){return 536870912&this._data[3*c+2]}loadCell(c,o){return S=3*c,o.content=this._data[S+0],o.fg=this._data[S+1],o.bg=this._data[S+2],2097152&o.content&&(o.combinedData=this._combined[c]),268435456&o.bg&&(o.extended=this._extendedAttrs[c]),o}setCell(c,o){2097152&o.content&&(this._combined[c]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[c]=o.extended),this._data[3*c+0]=o.content,this._data[3*c+1]=o.fg,this._data[3*c+2]=o.bg}setCellFromCodepoint(c,o,s,l){268435456&l.bg&&(this._extendedAttrs[c]=l.extended),this._data[3*c+0]=o|s<<22,this._data[3*c+1]=l.fg,this._data[3*c+2]=l.bg}addCodepointToCell(c,o,s){let l=this._data[3*c+0];2097152&l?this._combined[c]+=(0,p.stringFromCodePoint)(o):2097151&l?(this._combined[c]=(0,p.stringFromCodePoint)(2097151&l)+(0,p.stringFromCodePoint)(o),l&=-2097152,l|=2097152):l=o|4194304,s&&(l&=-12582913,l|=s<<22),this._data[3*c+0]=l}insertCells(c,o,s){if((c%=this.length)&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,s),o<this.length-c){const l=new g.CellData;for(let v=this.length-c-o-1;v>=0;--v)this.setCell(c+o+v,this.loadCell(c+v,l));for(let v=0;v<o;++v)this.setCell(c+v,s)}else for(let l=c;l<this.length;++l)this.setCell(l,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(c,o,s){if(c%=this.length,o<this.length-c){const l=new g.CellData;for(let v=0;v<this.length-c-o;++v)this.setCell(c+v,this.loadCell(c+o+v,l));for(let v=this.length-o;v<this.length;++v)this.setCell(v,s)}else for(let l=c;l<this.length;++l)this.setCell(l,s);c&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,s),this.getWidth(c)!==0||this.hasContent(c)||this.setCellFromCodepoint(c,0,1,s)}replaceCells(c,o,s,l=!1){if(l)for(c&&this.getWidth(c-1)===2&&!this.isProtected(c-1)&&this.setCellFromCodepoint(c-1,0,1,s),o<this.length&&this.getWidth(o-1)===2&&!this.isProtected(o)&&this.setCellFromCodepoint(o,0,1,s);c<o&&c<this.length;)this.isProtected(c)||this.setCell(c,s),c++;else for(c&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,s),o<this.length&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o,0,1,s);c<o&&c<this.length;)this.setCell(c++,s)}resize(c,o){if(c===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*c;if(c>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const l=new Uint32Array(s);l.set(this._data),this._data=l}for(let l=this.length;l<c;++l)this.setCell(l,o)}else{this._data=this._data.subarray(0,s);const l=Object.keys(this._combined);for(let C=0;C<l.length;C++){const x=parseInt(l[C],10);x>=c&&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>=c&&delete this._extendedAttrs[x]}}return this.length=c,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const c=new Uint32Array(this._data.length);return c.set(this._data),this._data=c,1}return 0}fill(c,o=!1){if(o)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,c);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,c)}}copyFrom(c){this.length!==c.length?this._data=new Uint32Array(c._data):this._data.set(c._data),this.length=c.length,this._combined={};for(const o in c._combined)this._combined[o]=c._combined[o];this._extendedAttrs={};for(const o in c._extendedAttrs)this._extendedAttrs[o]=c._extendedAttrs[o];this.isWrapped=c.isWrapped}clone(){const c=new w(0);c._data=new Uint32Array(this._data),c.length=this.length;for(const o in this._combined)c._combined[o]=this._combined[o];for(const o in this._extendedAttrs)c._extendedAttrs[o]=this._extendedAttrs[o];return c.isWrapped=this.isWrapped,c}getTrimmedLength(){for(let c=this.length-1;c>=0;--c)if(4194303&this._data[3*c+0])return c+(this._data[3*c+0]>>22);return 0}getNoBgTrimmedLength(){for(let c=this.length-1;c>=0;--c)if(4194303&this._data[3*c+0]||50331648&this._data[3*c+2])return c+(this._data[3*c+0]>>22);return 0}copyCellsFrom(c,o,s,l,v){const C=c._data;if(v)for(let k=l-1;k>=0;k--){for(let y=0;y<3;y++)this._data[3*(s+k)+y]=C[3*(o+k)+y];268435456&C[3*(o+k)+2]&&(this._extendedAttrs[s+k]=c._extendedAttrs[o+k])}else for(let k=0;k<l;k++){for(let y=0;y<3;y++)this._data[3*(s+k)+y]=C[3*(o+k)+y];268435456&C[3*(o+k)+2]&&(this._extendedAttrs[s+k]=c._extendedAttrs[o+k])}const x=Object.keys(c._combined);for(let k=0;k<x.length;k++){const y=parseInt(x[k],10);y>=o&&(this._combined[y-o+s]=c._combined[y])}}translateToString(c,o,s,l){o=o??0,s=s??this.length,c&&(s=Math.min(s,this.getTrimmedLength())),l&&(l.length=0);let v="";for(;o<s;){const C=this._data[3*o+0],x=2097151&C,k=2097152&C?this._combined[o]:x?(0,p.stringFromCodePoint)(x):d.WHITESPACE_CELL_CHAR;if(v+=k,l)for(let y=0;y<k.length;++y)l.push(o);o+=C>>22||1}return l&&l.push(o),v}}a.BufferLine=w},4841:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(u,f){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return f*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(m,a)=>{function u(f,g,d){if(g===f.length-1)return f[g].getTrimmedLength();const p=!f[g].hasContent(d-1)&&f[g].getWidth(d-1)===1,S=f[g+1].getWidth(0)===2;return p&&S?d-1:d}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(f,g,d,p,S){const w=[];for(let _=0;_<f.length-1;_++){let c=_,o=f.get(++c);if(!o.isWrapped)continue;const s=[f.get(_)];for(;c<f.length&&o.isWrapped;)s.push(o),o=f.get(++c);if(p>=_&&p<c){_+=s.length-1;continue}let l=0,v=u(s,l,g),C=1,x=0;for(;C<s.length;){const y=u(s,C,g),b=y-x,R=d-v,M=Math.min(b,R);s[l].copyCellsFrom(s[C],x,v,M,!1),v+=M,v===d&&(l++,v=0),x+=M,x===y&&(C++,x=0),v===0&&l!==0&&s[l-1].getWidth(d-1)===2&&(s[l].copyCellsFrom(s[l-1],d-1,v++,1,!1),s[l-1].setCell(d-1,S))}s[l].replaceCells(v,d,S);let k=0;for(let y=s.length-1;y>0&&(y>l||s[y].getTrimmedLength()===0);y--)k++;k>0&&(w.push(_+s.length-k),w.push(k)),_+=s.length-1}return w},a.reflowLargerCreateNewLayout=function(f,g){const d=[];let p=0,S=g[p],w=0;for(let _=0;_<f.length;_++)if(S===_){const c=g[++p];f.onDeleteEmitter.fire({index:_-w,amount:c}),_+=c-1,w+=c,S=g[++p]}else d.push(_);return{layout:d,countRemoved:w}},a.reflowLargerApplyNewLayout=function(f,g){const d=[];for(let p=0;p<g.length;p++)d.push(f.get(g[p]));for(let p=0;p<d.length;p++)f.set(p,d[p]);f.length=g.length},a.reflowSmallerGetNewLineLengths=function(f,g,d){const p=[],S=f.map((o,s)=>u(f,s,g)).reduce((o,s)=>o+s);let w=0,_=0,c=0;for(;c<S;){if(S-c<d){p.push(S-c);break}w+=d;const o=u(f,_,g);w>o&&(w-=o,_++);const s=f[_].getWidth(w-1)===2;s&&w--;const l=s?d-1:d;p.push(l),c+=l}return p},a.getWrappedLineTrimmedLength=u},5295:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const f=u(8460),g=u(844),d=u(9092);class p extends g.Disposable{constructor(w,_){super(),this._optionsService=w,this._bufferService=_,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,_){this._normal.resize(w,_),this._alt.resize(w,_),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}a.BufferSet=p},511:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const f=u(482),g=u(643),d=u(3734);class p 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 _=new p;return _.setFromCharData(w),_}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[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(w[g.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(w[g.CHAR_DATA_CHAR_INDEX].length===2){const c=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=c&&c<=56319){const o=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(c-55296)+o-56320+65536|w[g.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[g.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=w[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=p},643:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const f=u(8460),g=u(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,g.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}a.Marker=d,d._nextId=1},7116:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.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:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(m,a)=>{var u,f,g;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.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=""}(u||(a.C0=u={})),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||(a.C1=f={})),function(d){d.ST=`${u.ESC}\\`}(g||(a.C1_ESCAPED=g={}))},7399:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const f=u(2584),g={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:["'",'"']};a.evaluateKeyboardEvent=function(d,p,S,w){const _={type:0,cancel:!1,key:void 0},c=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?_.key=p?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?_.key=p?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?_.key=p?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(_.key=p?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:_.key=d.ctrlKey?"\b":f.C0.DEL,d.altKey&&(_.key=f.C0.ESC+_.key);break;case 9:if(d.shiftKey){_.key=f.C0.ESC+"[Z";break}_.key=f.C0.HT,_.cancel=!0;break;case 13:_.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,_.cancel=!0;break;case 27:_.key=f.C0.ESC,d.altKey&&(_.key=f.C0.ESC+f.C0.ESC),_.cancel=!0;break;case 37:if(d.metaKey)break;c?(_.key=f.C0.ESC+"[1;"+(c+1)+"D",_.key===f.C0.ESC+"[1;3D"&&(_.key=f.C0.ESC+(S?"b":"[1;5D"))):_.key=p?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;c?(_.key=f.C0.ESC+"[1;"+(c+1)+"C",_.key===f.C0.ESC+"[1;3C"&&(_.key=f.C0.ESC+(S?"f":"[1;5C"))):_.key=p?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;c?(_.key=f.C0.ESC+"[1;"+(c+1)+"A",S||_.key!==f.C0.ESC+"[1;3A"||(_.key=f.C0.ESC+"[1;5A")):_.key=p?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;c?(_.key=f.C0.ESC+"[1;"+(c+1)+"B",S||_.key!==f.C0.ESC+"[1;3B"||(_.key=f.C0.ESC+"[1;5B")):_.key=p?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(_.key=f.C0.ESC+"[2~");break;case 46:_.key=c?f.C0.ESC+"[3;"+(c+1)+"~":f.C0.ESC+"[3~";break;case 36:_.key=c?f.C0.ESC+"[1;"+(c+1)+"H":p?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:_.key=c?f.C0.ESC+"[1;"+(c+1)+"F":p?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?_.type=2:d.ctrlKey?_.key=f.C0.ESC+"[5;"+(c+1)+"~":_.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?_.type=3:d.ctrlKey?_.key=f.C0.ESC+"[6;"+(c+1)+"~":_.key=f.C0.ESC+"[6~";break;case 112:_.key=c?f.C0.ESC+"[1;"+(c+1)+"P":f.C0.ESC+"OP";break;case 113:_.key=c?f.C0.ESC+"[1;"+(c+1)+"Q":f.C0.ESC+"OQ";break;case 114:_.key=c?f.C0.ESC+"[1;"+(c+1)+"R":f.C0.ESC+"OR";break;case 115:_.key=c?f.C0.ESC+"[1;"+(c+1)+"S":f.C0.ESC+"OS";break;case 116:_.key=c?f.C0.ESC+"[15;"+(c+1)+"~":f.C0.ESC+"[15~";break;case 117:_.key=c?f.C0.ESC+"[17;"+(c+1)+"~":f.C0.ESC+"[17~";break;case 118:_.key=c?f.C0.ESC+"[18;"+(c+1)+"~":f.C0.ESC+"[18~";break;case 119:_.key=c?f.C0.ESC+"[19;"+(c+1)+"~":f.C0.ESC+"[19~";break;case 120:_.key=c?f.C0.ESC+"[20;"+(c+1)+"~":f.C0.ESC+"[20~";break;case 121:_.key=c?f.C0.ESC+"[21;"+(c+1)+"~":f.C0.ESC+"[21~";break;case 122:_.key=c?f.C0.ESC+"[23;"+(c+1)+"~":f.C0.ESC+"[23~";break;case 123:_.key=c?f.C0.ESC+"[24;"+(c+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?_.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(_.key=f.C0.US),d.key==="@"&&(_.key=f.C0.NUL)):d.keyCode===65&&(_.type=1);else{const o=g[d.keyCode],s=o==null?void 0:o[d.shiftKey?1:0];if(s)_.key=f.C0.ESC+s;else if(d.keyCode>=65&&d.keyCode<=90){const l=d.ctrlKey?d.keyCode-64:d.keyCode+32;let v=String.fromCharCode(l);d.shiftKey&&(v=v.toUpperCase()),_.key=f.C0.ESC+v}else if(d.keyCode===32)_.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let l=d.code.slice(3,4);d.shiftKey||(l=l.toLowerCase()),_.key=f.C0.ESC+l,_.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?_.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?_.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?_.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?_.key=f.C0.DEL:d.keyCode===219?_.key=f.C0.ESC:d.keyCode===220?_.key=f.C0.FS:d.keyCode===221&&(_.key=f.C0.GS)}return _}},482:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},a.utf32ToString=function(u,f=0,g=u.length){let d="";for(let p=f;p<g;++p){let S=u[p];S>65535?(S-=65536,d+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):d+=String.fromCharCode(S)}return d},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,f){const g=u.length;if(!g)return 0;let d=0,p=0;if(this._interim){const S=u.charCodeAt(p++);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=p;S<g;++S){const w=u.charCodeAt(S);if(55296<=w&&w<=56319){if(++S>=g)return this._interim=w,d;const _=u.charCodeAt(S);56320<=_&&_<=57343?f[d++]=1024*(w-55296)+_-56320+65536:(f[d++]=w,f[d++]=_)}else w!==65279&&(f[d++]=w)}return d}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,f){const g=u.length;if(!g)return 0;let d,p,S,w,_=0,c=0,o=0;if(this.interim[0]){let v=!1,C=this.interim[0];C&=(224&C)==192?31:(240&C)==224?15:7;let x,k=0;for(;(x=63&this.interim[++k])&&k<4;)C<<=6,C|=x;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,b=y-k;for(;o<b;){if(o>=g)return 0;if(x=u[o++],(192&x)!=128){o--,v=!0;break}this.interim[k++]=x,C<<=6,C|=63&x}v||(y===2?C<128?o--:f[_++]=C:y===3?C<2048||C>=55296&&C<=57343||C===65279||(f[_++]=C):C<65536||C>1114111||(f[_++]=C)),this.interim.fill(0)}const s=g-4;let l=o;for(;l<g;){for(;!(!(l<s)||128&(d=u[l])||128&(p=u[l+1])||128&(S=u[l+2])||128&(w=u[l+3]));)f[_++]=d,f[_++]=p,f[_++]=S,f[_++]=w,l+=4;if(d=u[l++],d<128)f[_++]=d;else if((224&d)==192){if(l>=g)return this.interim[0]=d,_;if(p=u[l++],(192&p)!=128){l--;continue}if(c=(31&d)<<6|63&p,c<128){l--;continue}f[_++]=c}else if((240&d)==224){if(l>=g)return this.interim[0]=d,_;if(p=u[l++],(192&p)!=128){l--;continue}if(l>=g)return this.interim[0]=d,this.interim[1]=p,_;if(S=u[l++],(192&S)!=128){l--;continue}if(c=(15&d)<<12|(63&p)<<6|63&S,c<2048||c>=55296&&c<=57343||c===65279)continue;f[_++]=c}else if((248&d)==240){if(l>=g)return this.interim[0]=d,_;if(p=u[l++],(192&p)!=128){l--;continue}if(l>=g)return this.interim[0]=d,this.interim[1]=p,_;if(S=u[l++],(192&S)!=128){l--;continue}if(l>=g)return this.interim[0]=d,this.interim[1]=p,this.interim[2]=S,_;if(w=u[l++],(192&w)!=128){l--;continue}if(c=(7&d)<<18|(63&p)<<12|(63&S)<<6|63&w,c<65536||c>1114111)continue;f[_++]=c}}return _}}},225:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const f=u(1480),g=[[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 p;a.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let S=0;S<g.length;++S)p.fill(0,g[S][0],g[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?p[S]:function(w,_){let c,o=0,s=_.length-1;if(w<_[0][0]||w>_[s][1])return!1;for(;s>=o;)if(c=o+s>>1,w>_[c][1])o=c+1;else{if(!(w<_[c][0]))return!0;s=c-1}return!1}(S,d)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,w){let _=this.wcwidth(S),c=_===0&&w!==0;if(c){const o=f.UnicodeService.extractWidth(w);o===0?c=!1:o>_&&(_=o)}return f.UnicodeService.createPropertyValue(0,_,c)}}},5981:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const f=u(8460),g=u(844);class d extends g.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 _;for(this._isSyncWriting=!0;_=this._writeBuffer.shift();){this._action(_);const c=this._callbacks.shift();c&&c()}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 _=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const c=this._writeBuffer[this._bufferOffset],o=this._action(c,w);if(o){const l=v=>Date.now()-_>=12?setTimeout(()=>this._innerWrite(0,v)):this._innerWrite(_,v);return void o.catch(v=>(queueMicrotask(()=>{throw v}),Promise.resolve(!1))).then(l)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=c.length,Date.now()-_>=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()}}a.WriteBuffer=d},5941:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const u=/^([\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 g(d,p){const S=d.toString(16),w=S.length<2?"0"+S:S;switch(p){case 4:return S[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}a.parseColor=function(d){if(!d)return;let p=d.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const S=u.exec(p);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(p.indexOf("#")===0&&(p=p.slice(1),f.exec(p)&&[3,6,9,12].includes(p.length))){const S=p.length/3,w=[0,0,0];for(let _=0;_<3;++_){const c=parseInt(p.slice(S*_,S*_+S),16);w[_]=S===1?c<<4:S===2?c:S===3?c>>4:c>>8}return w}},a.toRgbString=function(d,p=16){const[S,w,_]=d;return`rgb:${g(S,p)}/${g(w,p)}/${g(_,p)}`}},5770:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const f=u(482),g=u(8742),d=u(5770),p=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(w,_){this._handlers[w]===void 0&&(this._handlers[w]=[]);const c=this._handlers[w];return c.push(_),{dispose:()=>{const o=c.indexOf(_);o!==-1&&c.splice(o,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=p,this._ident=0}hook(w,_){if(this.reset(),this._ident=w,this._active=this._handlers[w]||p,this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].hook(_);else this._handlerFb(this._ident,"HOOK",_)}put(w,_,c){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(w,_,c);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(w,_,c))}unhook(w,_=!0){if(this._active.length){let c=!1,o=this._active.length-1,s=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,c=_,s=this._stack.fallThrough,this._stack.paused=!1),!s&&c===!1){for(;o>=0&&(c=this._active[o].unhook(w),c!==!0);o--)if(c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,c;o--}for(;o>=0;o--)if(c=this._active[o].unhook(!1),c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,c}else this._handlerFb(this._ident,"UNHOOK",w);this._active=p,this._ident=0}};const S=new g.Params;S.addParam(0),a.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,_,c){this._hitLimit||(this._data+=(0,f.utf32ToString)(w,_,c),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let _=!1;if(this._hitLimit)_=!1;else if(w&&(_=this._handler(this._data,this._params),_ instanceof Promise))return _.then(c=>(this._params=S,this._data="",this._hitLimit=!1,c));return this._params=S,this._data="",this._hitLimit=!1,_}}},2015:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const f=u(844),g=u(8742),d=u(6242),p=u(6351);class S{constructor(o){this.table=new Uint8Array(o)}setDefault(o,s){this.table.fill(o<<4|s)}add(o,s,l,v){this.table[s<<8|o]=l<<4|v}addMany(o,s,l,v){for(let C=0;C<o.length;C++)this.table[s<<8|o[C]]=l<<4|v}}a.TransitionTable=S;const w=160;a.VT500_TRANSITION_TABLE=function(){const c=new S(4095),o=Array.apply(null,Array(256)).map((k,y)=>y),s=(k,y)=>o.slice(k,y),l=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 c.setDefault(1,0),c.addMany(l,0,2,0),C)c.addMany([24,26,153,154],x,3,0),c.addMany(s(128,144),x,3,0),c.addMany(s(144,152),x,3,0),c.add(156,x,0,0),c.add(27,x,11,1),c.add(157,x,4,8),c.addMany([152,158,159],x,0,7),c.add(155,x,11,3),c.add(144,x,11,9);return c.addMany(v,0,3,0),c.addMany(v,1,3,1),c.add(127,1,0,1),c.addMany(v,8,0,8),c.addMany(v,3,3,3),c.add(127,3,0,3),c.addMany(v,4,3,4),c.add(127,4,0,4),c.addMany(v,6,3,6),c.addMany(v,5,3,5),c.add(127,5,0,5),c.addMany(v,2,3,2),c.add(127,2,0,2),c.add(93,1,4,8),c.addMany(l,8,5,8),c.add(127,8,5,8),c.addMany([156,27,24,26,7],8,6,0),c.addMany(s(28,32),8,0,8),c.addMany([88,94,95],1,0,7),c.addMany(l,7,0,7),c.addMany(v,7,0,7),c.add(156,7,0,0),c.add(127,7,0,7),c.add(91,1,11,3),c.addMany(s(64,127),3,7,0),c.addMany(s(48,60),3,8,4),c.addMany([60,61,62,63],3,9,4),c.addMany(s(48,60),4,8,4),c.addMany(s(64,127),4,7,0),c.addMany([60,61,62,63],4,0,6),c.addMany(s(32,64),6,0,6),c.add(127,6,0,6),c.addMany(s(64,127),6,0,0),c.addMany(s(32,48),3,9,5),c.addMany(s(32,48),5,9,5),c.addMany(s(48,64),5,0,6),c.addMany(s(64,127),5,7,0),c.addMany(s(32,48),4,9,5),c.addMany(s(32,48),1,9,2),c.addMany(s(32,48),2,9,2),c.addMany(s(48,127),2,10,0),c.addMany(s(48,80),1,10,0),c.addMany(s(81,88),1,10,0),c.addMany([89,90,92],1,10,0),c.addMany(s(96,127),1,10,0),c.add(80,1,11,9),c.addMany(v,9,0,9),c.add(127,9,0,9),c.addMany(s(28,32),9,0,9),c.addMany(s(32,48),9,9,12),c.addMany(s(48,60),9,8,10),c.addMany([60,61,62,63],9,9,10),c.addMany(v,11,0,11),c.addMany(s(32,128),11,0,11),c.addMany(s(28,32),11,0,11),c.addMany(v,10,0,10),c.add(127,10,0,10),c.addMany(s(28,32),10,0,10),c.addMany(s(48,60),10,8,10),c.addMany([60,61,62,63],10,0,11),c.addMany(s(32,48),10,9,12),c.addMany(v,12,0,12),c.add(127,12,0,12),c.addMany(s(28,32),12,0,12),c.addMany(s(32,48),12,9,12),c.addMany(s(48,64),12,0,11),c.addMany(s(64,127),12,12,13),c.addMany(s(64,127),10,12,13),c.addMany(s(64,127),9,12,13),c.addMany(v,13,13,13),c.addMany(l,13,13,13),c.add(127,13,0,13),c.addMany([27,156,24,26],13,14,0),c.add(w,0,2,0),c.add(w,8,5,8),c.add(w,6,0,6),c.add(w,11,0,11),c.add(w,13,13,13),c}();class _ extends f.Disposable{constructor(o=a.VT500_TRANSITION_TABLE){super(),this._transitions=o,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(s,l,v)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,l)=>{},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 p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(o,s=[64,126]){let l=0;if(o.prefix){if(o.prefix.length>1)throw new Error("only one byte as prefix supported");if(l=o.prefix.charCodeAt(0),l&&60>l||l>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(o.intermediates){if(o.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let C=0;C<o.intermediates.length;++C){const x=o.intermediates.charCodeAt(C);if(32>x||x>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");l<<=8,l|=x}}if(o.final.length!==1)throw new Error("final must be a single byte");const v=o.final.charCodeAt(0);if(s[0]>v||v>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return l<<=8,l|=v,l}identToString(o){const s=[];for(;o;)s.push(String.fromCharCode(255&o)),o>>=8;return s.reverse().join("")}setPrintHandler(o){this._printHandler=o}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(o,s){const l=this._identifier(o,[48,126]);this._escHandlers[l]===void 0&&(this._escHandlers[l]=[]);const v=this._escHandlers[l];return v.push(s),{dispose:()=>{const C=v.indexOf(s);C!==-1&&v.splice(C,1)}}}clearEscHandler(o){this._escHandlers[this._identifier(o,[48,126])]&&delete this._escHandlers[this._identifier(o,[48,126])]}setEscHandlerFallback(o){this._escHandlerFb=o}setExecuteHandler(o,s){this._executeHandlers[o.charCodeAt(0)]=s}clearExecuteHandler(o){this._executeHandlers[o.charCodeAt(0)]&&delete this._executeHandlers[o.charCodeAt(0)]}setExecuteHandlerFallback(o){this._executeHandlerFb=o}registerCsiHandler(o,s){const l=this._identifier(o);this._csiHandlers[l]===void 0&&(this._csiHandlers[l]=[]);const v=this._csiHandlers[l];return v.push(s),{dispose:()=>{const C=v.indexOf(s);C!==-1&&v.splice(C,1)}}}clearCsiHandler(o){this._csiHandlers[this._identifier(o)]&&delete this._csiHandlers[this._identifier(o)]}setCsiHandlerFallback(o){this._csiHandlerFb=o}registerDcsHandler(o,s){return this._dcsParser.registerHandler(this._identifier(o),s)}clearDcsHandler(o){this._dcsParser.clearHandler(this._identifier(o))}setDcsHandlerFallback(o){this._dcsParser.setHandlerFallback(o)}registerOscHandler(o,s){return this._oscParser.registerHandler(o,s)}clearOscHandler(o){this._oscParser.clearHandler(o)}setOscHandlerFallback(o){this._oscParser.setHandlerFallback(o)}setErrorHandler(o){this._errorHandler=o}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(o,s,l,v,C){this._parseStack.state=o,this._parseStack.handlers=s,this._parseStack.handlerPos=l,this._parseStack.transition=v,this._parseStack.chunkPos=C}parse(o,s,l){let v,C=0,x=0,k=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,k=this._parseStack.chunkPos+1;else{if(l===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(l===!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(l===!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=o[this._parseStack.chunkPos],v=this._dcsParser.unhook(C!==24&&C!==26,l),v)return v;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(C=o[this._parseStack.chunkPos],v=this._oscParser.end(C!==24&&C!==26,l),v)return v;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,k=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let y=k;y<s;++y){switch(C=o[y],x=this._transitions.table[this.currentState<<8|(C<160?C:w)],x>>4){case 2:for(let T=y+1;;++T){if(T>=s||(C=o[T])<32||C>126&&C<w){this._printHandler(o,y,T),y=T-1;break}if(++T>=s||(C=o[T])<32||C>126&&C<w){this._printHandler(o,y,T),y=T-1;break}if(++T>=s||(C=o[T])<32||C>126&&C<w){this._printHandler(o,y,T),y=T-1;break}if(++T>=s||(C=o[T])<32||C>126&&C<w){this._printHandler(o,y,T),y=T-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=o[y])>47&&C<60);y--;break;case 9:this._collect<<=8,this._collect|=C;break;case 10:const M=this._escHandlers[this._collect<<8|C];let B=M?M.length-1:-1;for(;B>=0&&(v=M[B](),v!==!0);B--)if(v instanceof Promise)return this._preserveStack(4,M,B,x,y),v;B<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 T=y+1;;++T)if(T>=s||(C=o[T])===24||C===26||C===27||C>127&&C<w){this._dcsParser.put(o,y,T),y=T-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 T=y+1;;T++)if(T>=s||(C=o[T])<32||C>127&&C<w){this._oscParser.put(o,y,T),y=T-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}}}a.EscapeSequenceParser=_},6242:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const f=u(5770),g=u(482),d=[];a.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(p,S){this._handlers[p]===void 0&&(this._handlers[p]=[]);const w=this._handlers[p];return w.push(S),{dispose:()=>{const _=w.indexOf(S);_!==-1&&w.splice(_,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,S,w){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(p,S,w);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(p,S,w))}start(){this.reset(),this._state=1}put(p,S,w){if(this._state!==3){if(this._state===1)for(;S<w;){const _=p[S++];if(_===59){this._state=2,this._start();break}if(_<48||57<_)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+_-48}this._state===2&&w-S>0&&this._put(p,S,w)}}end(p,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,_=this._active.length-1,c=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,w=S,c=this._stack.fallThrough,this._stack.paused=!1),!c&&w===!1){for(;_>=0&&(w=this._active[_].end(p),w!==!0);_--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,w;_--}for(;_>=0;_--)if(w=this._active[_].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",p);this._active=d,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,S,w){this._hitLimit||(this._data+=(0,g.utf32ToString)(p,S,w),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let S=!1;if(this._hitLimit)S=!1;else if(p&&(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:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const u=2147483647;class f{static fromArray(d){const p=new f;if(!d.length)return p;for(let S=Array.isArray(d[0])?1:0;S<d.length;++S){const w=d[S];if(Array.isArray(w))for(let _=0;_<w.length;++_)p.addSubParam(w[_]);else p.addParam(w)}return p}constructor(d=32,p=32){if(this.maxLength=d,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(p),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 p=0;p<this.length;++p){d.push(this.params[p]);const S=this._subParamsIdx[p]>>8,w=255&this._subParamsIdx[p];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>u?u: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>u?u:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const p=this._subParamsIdx[d]>>8,S=255&this._subParamsIdx[d];return S-p>0?this._subParams.subarray(p,S):null}getSubParamsAll(){const d={};for(let p=0;p<this.length;++p){const S=this._subParamsIdx[p]>>8,w=255&this._subParamsIdx[p];w-S>0&&(d[p]=this._subParams.slice(S,w))}return d}addDigit(d){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,w=S[p-1];S[p-1]=~w?Math.min(10*w+d,u):d}}a.Params=f},5741:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,f){const g={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(g),f.dispose=()=>this._wrappedAddonDispose(g),f.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let f=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===u){f=g;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(f,1)}}},8771:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const f=u(3785),g=u(511);a.BufferApiView=class{constructor(d,p){this._buffer=d,this.type=p}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 p=this._buffer.lines.get(d);if(p)return new f.BufferLineApiView(p)}getNullCell(){return new g.CellData}}},3785:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const f=u(511);a.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,d){if(!(g<0||g>=this._line.length))return d?(this._line.loadCell(g,d),d):this._line.loadCell(g,new f.CellData)}translateToString(g,d,p){return this._line.translateToString(g,d,p)}}},8285:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const f=u(8771),g=u(8460),d=u(844);class p extends d.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new g.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)}}a.BufferNamespaceApi=p},7975:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,f){return this._core.registerCsiHandler(u,g=>f(g.toArray()))}addCsiHandler(u,f){return this.registerCsiHandler(u,f)}registerDcsHandler(u,f){return this._core.registerDcsHandler(u,(g,d)=>f(g,d.toArray()))}addDcsHandler(u,f){return this.registerDcsHandler(u,f)}registerEscHandler(u,f){return this._core.registerEscHandler(u,f)}addEscHandler(u,f){return this.registerEscHandler(u,f)}registerOscHandler(u,f){return this._core.registerOscHandler(u,f)}addOscHandler(u,f){return this.registerOscHandler(u,f)}}},7090:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(m,a,u){var f=this&&this.__decorate||function(c,o,s,l){var v,C=arguments.length,x=C<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,o,s,l);else for(var k=c.length-1;k>=0;k--)(v=c[k])&&(x=(C<3?v(x):C>3?v(o,s,x):v(o,s))||x);return C>3&&x&&Object.defineProperty(o,s,x),x},g=this&&this.__param||function(c,o){return function(s,l){o(s,l,c)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const d=u(8460),p=u(844),S=u(5295),w=u(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let _=a.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(c){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(c.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(c.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(c,this))}resize(c,o){this.cols=c,this.rows=o,this.buffers.resize(c,o),this._onResize.fire({cols:c,rows:o})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(c,o=!1){const s=this.buffer;let l;l=this._cachedBlankLine,l&&l.length===this.cols&&l.getFg(0)===c.fg&&l.getBg(0)===c.bg||(l=s.getBlankLine(c,o),this._cachedBlankLine=l),l.isWrapped=o;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(l):s.lines.push(l.clone()):s.lines.splice(C+1,0,l.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,l.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(c,o,s){const l=this.buffer;if(c<0){if(l.ydisp===0)return;this.isUserScrolling=!0}else c+l.ydisp>=l.ybase&&(this.isUserScrolling=!1);const v=l.ydisp;l.ydisp=Math.max(Math.min(l.ydisp+c,l.ybase),0),v!==l.ydisp&&(o||this._onScroll.fire(l.ydisp))}};a.BufferService=_=f([g(0,w.IOptionsService)],_)},7994:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,f){this._charsets[u]=f,this.glevel===u&&(this.charset=f)}}},1753:function(m,a,u){var f=this&&this.__decorate||function(l,v,C,x){var k,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(l,v,C,x);else for(var R=l.length-1;R>=0;R--)(k=l[R])&&(b=(y<3?k(b):y>3?k(v,C,b):k(v,C))||b);return y>3&&b&&Object.defineProperty(v,C,b),b},g=this&&this.__param||function(l,v){return function(C,x){v(C,x,l)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const d=u(2585),p=u(8460),S=u(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:l=>l.button!==4&&l.action===1&&(l.ctrl=!1,l.alt=!1,l.shift=!1,!0)},VT200:{events:19,restrict:l=>l.action!==32},DRAG:{events:23,restrict:l=>l.action!==32||l.button!==3},ANY:{events:31,restrict:l=>!0}};function _(l,v){let C=(l.ctrl?16:0)|(l.shift?4:0)|(l.alt?8:0);return l.button===4?(C|=64,C|=l.action):(C|=3&l.button,4&l.button&&(C|=64),8&l.button&&(C|=128),l.action===32?C|=32:l.action!==0||v||(C|=3)),C}const c=String.fromCharCode,o={DEFAULT:l=>{const v=[_(l,!1)+32,l.col+32,l.row+32];return v[0]>255||v[1]>255||v[2]>255?"":`\x1B[M${c(v[0])}${c(v[1])}${c(v[2])}`},SGR:l=>{const v=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${_(l,!0)};${l.col};${l.row}${v}`},SGR_PIXELS:l=>{const v=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${_(l,!0)};${l.x};${l.y}${v}`}};let s=a.CoreMouseService=class extends S.Disposable{constructor(l,v){super(),this._bufferService=l,this._coreService=v,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const C of Object.keys(w))this.addProtocol(C,w[C]);for(const C of Object.keys(o))this.addEncoding(C,o[C]);this.reset()}addProtocol(l,v){this._protocols[l]=v}addEncoding(l,v){this._encodings[l]=v}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(l){if(!this._protocols[l])throw new Error(`unknown protocol "${l}"`);this._activeProtocol=l,this._onProtocolChange.fire(this._protocols[l].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(l){if(!this._encodings[l])throw new Error(`unknown encoding "${l}"`);this._activeEncoding=l}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(l){if(l.col<0||l.col>=this._bufferService.cols||l.row<0||l.row>=this._bufferService.rows||l.button===4&&l.action===32||l.button===3&&l.action!==32||l.button!==4&&(l.action===2||l.action===3)||(l.col++,l.row++,l.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,l,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(l))return!1;const v=this._encodings[this._activeEncoding](l);return v&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(v):this._coreService.triggerDataEvent(v,!0)),this._lastEvent=l,!0}explainEvents(l){return{down:!!(1&l),up:!!(2&l),drag:!!(4&l),move:!!(8&l),wheel:!!(16&l)}}_equalEvents(l,v,C){if(C){if(l.x!==v.x||l.y!==v.y)return!1}else if(l.col!==v.col||l.row!==v.row)return!1;return l.button===v.button&&l.action===v.action&&l.ctrl===v.ctrl&&l.alt===v.alt&&l.shift===v.shift}};a.CoreMouseService=s=f([g(0,d.IBufferService),g(1,d.ICoreService)],s)},6975:function(m,a,u){var f=this&&this.__decorate||function(s,l,v,C){var x,k=arguments.length,y=k<3?l:C===null?C=Object.getOwnPropertyDescriptor(l,v):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,l,v,C);else for(var b=s.length-1;b>=0;b--)(x=s[b])&&(y=(k<3?x(y):k>3?x(l,v,y):x(l,v))||y);return k>3&&y&&Object.defineProperty(l,v,y),y},g=this&&this.__param||function(s,l){return function(v,C){l(v,C,s)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const d=u(1439),p=u(8460),S=u(844),w=u(2585),_=Object.freeze({insertMode:!1}),c=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let o=a.CoreService=class extends S.Disposable{constructor(s,l,v){super(),this._bufferService=s,this._logService=l,this._optionsService=v,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(_),this.decPrivateModes=(0,d.clone)(c)}reset(){this.modes=(0,d.clone)(_),this.decPrivateModes=(0,d.clone)(c)}triggerDataEvent(s,l=!1){if(this._optionsService.rawOptions.disableStdin)return;const v=this._bufferService.buffer;l&&this._optionsService.rawOptions.scrollOnUserInput&&v.ybase!==v.ydisp&&this._onRequestScrollToBottom.fire(),l&&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(l=>l.charCodeAt(0))),this._onBinary.fire(s))}};a.CoreService=o=f([g(0,w.IBufferService),g(1,w.ILogService),g(2,w.IOptionsService)],o)},9074:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const f=u(8055),g=u(8460),d=u(844),p=u(6106);let S=0,w=0;class _ extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList(s=>s==null?void 0:s.marker.line),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>this.reset()))}registerDecoration(s){if(s.marker.isDisposed)return;const l=new c(s);if(l){const v=l.marker.onDispose(()=>l.dispose());l.onDispose(()=>{l&&(this._decorations.delete(l)&&this._onDecorationRemoved.fire(l),v.dispose())}),this._decorations.insert(l),this._onDecorationRegistered.fire(l)}return l}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,l,v){let C=0,x=0;for(const k of this._decorations.getKeyIterator(l))C=k.options.x??0,x=C+(k.options.width??1),s>=C&&s<x&&(!v||(k.options.layer??"bottom")===v)&&(yield k)}forEachDecorationAtCell(s,l,v,C){this._decorations.forEachByKey(l,x=>{S=x.options.x??0,w=S+(x.options.width??1),s>=S&&s<w&&(!v||(x.options.layer??"bottom")===v)&&C(x)})}}a.DecorationService=_;class c 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 g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.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:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const f=u(2585),g=u(8343);class d{constructor(...S){this._entries=new Map;for(const[w,_]of S)this.set(w,_)}set(S,w){const _=this._entries.get(S);return this._entries.set(S,w),_}forEach(S){for(const[w,_]of this._entries.entries())S(w,_)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}a.ServiceCollection=d,a.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(p,S){this._services.set(p,S)}getService(p){return this._services.get(p)}createInstance(p,...S){const w=(0,g.getServiceDependencies)(p).sort((o,s)=>o.index-s.index),_=[];for(const o of w){const s=this._services.get(o.id);if(!s)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${o.id}.`);_.push(s)}const c=w.length>0?w[0].index:S.length;if(S.length!==c)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${c+1} conflicts with ${S.length} static arguments`);return new p(...S,..._)}}},7866:function(m,a,u){var f=this&&this.__decorate||function(c,o,s,l){var v,C=arguments.length,x=C<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,o,s,l);else for(var k=c.length-1;k>=0;k--)(v=c[k])&&(x=(C<3?v(x):C>3?v(o,s,x):v(o,s))||x);return C>3&&x&&Object.defineProperty(o,s,x),x},g=this&&this.__param||function(c,o){return function(s,l){o(s,l,c)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const d=u(844),p=u(2585),S={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let w,_=a.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(c){super(),this._optionsService=c,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),w=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(c){for(let o=0;o<c.length;o++)typeof c[o]=="function"&&(c[o]=c[o]())}_log(c,o,s){this._evalLazyOptionalParams(s),c.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...s)}trace(c,...o){var s;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,c,o)}debug(c,...o){var s;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,c,o)}info(c,...o){var s;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,c,o)}warn(c,...o){var s;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,c,o)}error(c,...o){var s;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,c,o)}};a.LogService=_=f([g(0,p.IOptionsService)],_),a.setTraceLogger=function(c){w=c},a.traceCall=function(c,o,s){if(typeof s.value!="function")throw new Error("not supported");const l=s.value;s.value=function(...v){if(w.logLevel!==p.LogLevelEnum.TRACE)return l.apply(this,v);w.trace(`GlyphRenderer#${l.name}(${v.map(x=>JSON.stringify(x)).join(", ")})`);const C=l.apply(this,v);return w.trace(`GlyphRenderer#${l.name} return`,C),C}}},7302:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const f=u(8460),g=u(844),d=u(6114);a.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 p=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends g.Disposable{constructor(_){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const c={...a.DEFAULT_OPTIONS};for(const o in _)if(o in c)try{const s=_[o];c[o]=this._sanitizeAndValidateOption(o,s)}catch(s){console.error(s)}this.rawOptions=c,this.options={...c},this._setupOptions(),this.register((0,g.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(_,c){return this.onOptionChange(o=>{o===_&&c(this.rawOptions[_])})}onMultipleOptionChange(_,c){return this.onOptionChange(o=>{_.indexOf(o)!==-1&&c()})}_setupOptions(){const _=o=>{if(!(o in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);return this.rawOptions[o]},c=(o,s)=>{if(!(o in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);s=this._sanitizeAndValidateOption(o,s),this.rawOptions[o]!==s&&(this.rawOptions[o]=s,this._onOptionChange.fire(o))};for(const o in this.rawOptions){const s={get:_.bind(this,o),set:c.bind(this,o)};Object.defineProperty(this.options,o,s)}}_sanitizeAndValidateOption(_,c){switch(_){case"cursorStyle":if(c||(c=a.DEFAULT_OPTIONS[_]),!function(o){return o==="block"||o==="underline"||o==="bar"}(c))throw new Error(`"${c}" is not a valid value for ${_}`);break;case"wordSeparator":c||(c=a.DEFAULT_OPTIONS[_]);break;case"fontWeight":case"fontWeightBold":if(typeof c=="number"&&1<=c&&c<=1e3)break;c=p.includes(c)?c:a.DEFAULT_OPTIONS[_];break;case"cursorWidth":c=Math.floor(c);case"lineHeight":case"tabStopWidth":if(c<1)throw new Error(`${_} cannot be less than 1, value: ${c}`);break;case"minimumContrastRatio":c=Math.max(1,Math.min(21,Math.round(10*c)/10));break;case"scrollback":if((c=Math.min(c,4294967295))<0)throw new Error(`${_} cannot be less than 0, value: ${c}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(c<=0)throw new Error(`${_} cannot be less than or equal to 0, value: ${c}`);break;case"rows":case"cols":if(!c&&c!==0)throw new Error(`${_} must be numeric, value: ${c}`);break;case"windowsPty":c=c??{}}return c}}a.OptionsService=S},2660:function(m,a,u){var f=this&&this.__decorate||function(S,w,_,c){var o,s=arguments.length,l=s<3?w:c===null?c=Object.getOwnPropertyDescriptor(w,_):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(S,w,_,c);else for(var v=S.length-1;v>=0;v--)(o=S[v])&&(l=(s<3?o(l):s>3?o(w,_,l):o(w,_))||l);return s>3&&l&&Object.defineProperty(w,_,l),l},g=this&&this.__param||function(S,w){return function(_,c){w(_,c,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const d=u(2585);let p=a.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 _=S,c=this._getEntryIdKey(_),o=this._entriesWithId.get(c);if(o)return this.addLineToLink(o.id,w.ybase+w.y),o.id;const s=w.addMarker(w.ybase+w.y),l={id:this._nextId++,key:this._getEntryIdKey(_),data:_,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(l,s)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(S,w){const _=this._dataByLinkId.get(S);if(_&&_.lines.every(c=>c.line!==w)){const c=this._bufferService.buffer.addMarker(w);_.lines.push(c),c.onDispose(()=>this._removeMarkerFromLink(_,c))}}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 _=S.lines.indexOf(w);_!==-1&&(S.lines.splice(_,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};a.OscLinkService=p=f([g(0,d.IBufferService)],p)},8343:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const u="di$target",f="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(g){return g[f]||[]},a.createDecorator=function(g){if(a.serviceRegistry.has(g))return a.serviceRegistry.get(g);const d=function(p,S,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,c,o){c[u]===c?c[f].push({id:_,index:o}):(c[f]=[{id:_,index:o}],c[u]=c)})(d,p,w)};return d.toString=()=>g,a.serviceRegistry.set(g,d),d}},2585:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const f=u(8343);var g;a.IBufferService=(0,f.createDecorator)("BufferService"),a.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),a.ICoreService=(0,f.createDecorator)("CoreService"),a.ICharsetService=(0,f.createDecorator)("CharsetService"),a.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"}(g||(a.LogLevelEnum=g={})),a.ILogService=(0,f.createDecorator)("LogService"),a.IOptionsService=(0,f.createDecorator)("OptionsService"),a.IOscLinkService=(0,f.createDecorator)("OscLinkService"),a.IUnicodeService=(0,f.createDecorator)("UnicodeService"),a.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const f=u(8460),g=u(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,_=!1){return(16777215&S)<<3|(3&w)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const S=new g.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,_=0;const c=S.length;for(let o=0;o<c;++o){let s=S.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=c)return w+this.wcwidth(s);const C=S.charCodeAt(o);56320<=C&&C<=57343?s=1024*(s-55296)+C-56320+65536:w+=this.wcwidth(C)}const l=this.charProperties(s,_);let v=d.extractWidth(l);d.extractShouldJoin(l)&&(v-=d.extractWidth(_)),w+=v,_=l}return w}charProperties(S,w){return this._activeProvider.charProperties(S,w)}}a.UnicodeService=d}},i={};function n(m){var a=i[m];if(a!==void 0)return a.exports;var u=i[m]={exports:{}};return r[m].call(u.exports,u,u.exports,n),u.exports}var h={};return(()=>{var m=h;Object.defineProperty(m,"__esModule",{value:!0}),m.Terminal=void 0;const a=n(9042),u=n(3236),f=n(844),g=n(5741),d=n(8285),p=n(7975),S=n(7090),w=["cols","rows"];class _ extends f.Disposable{constructor(o){super(),this._core=this.register(new u.Terminal(o)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const s=v=>this._core.options[v],l=(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:l.bind(this,v)};Object.defineProperty(this._publicOptions,v,C)}}_checkReadonlyOptions(o){if(w.includes(o))throw new Error(`Option "${o}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new 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 o=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:o.applicationCursorKeys,applicationKeypadMode:o.applicationKeypad,bracketedPasteMode:o.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:o.origin,reverseWraparoundMode:o.reverseWraparound,sendFocusMode:o.sendFocus,wraparoundMode:o.wraparound}}get options(){return this._publicOptions}set options(o){for(const s in o)this._publicOptions[s]=o[s]}blur(){this._core.blur()}focus(){this._core.focus()}input(o,s=!0){this._core.input(o,s)}resize(o,s){this._verifyIntegers(o,s),this._core.resize(o,s)}open(o){this._core.open(o)}attachCustomKeyEventHandler(o){this._core.attachCustomKeyEventHandler(o)}attachCustomWheelEventHandler(o){this._core.attachCustomWheelEventHandler(o)}registerLinkProvider(o){return this._core.registerLinkProvider(o)}registerCharacterJoiner(o){return this._checkProposedApi(),this._core.registerCharacterJoiner(o)}deregisterCharacterJoiner(o){this._checkProposedApi(),this._core.deregisterCharacterJoiner(o)}registerMarker(o=0){return this._verifyIntegers(o),this._core.registerMarker(o)}registerDecoration(o){return this._checkProposedApi(),this._verifyPositiveIntegers(o.x??0,o.width??0,o.height??0),this._core.registerDecoration(o)}hasSelection(){return this._core.hasSelection()}select(o,s,l){this._verifyIntegers(o,s,l),this._core.select(o,s,l)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(o,s){this._verifyIntegers(o,s),this._core.selectLines(o,s)}dispose(){super.dispose()}scrollLines(o){this._verifyIntegers(o),this._core.scrollLines(o)}scrollPages(o){this._verifyIntegers(o),this._core.scrollPages(o)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(o){this._verifyIntegers(o),this._core.scrollToLine(o)}clear(){this._core.clear()}write(o,s){this._core.write(o,s)}writeln(o,s){this._core.write(o),this._core.write(`\r
64
+ `,s)}paste(o){this._core.paste(o)}refresh(o,s){this._verifyIntegers(o,s),this._core.refresh(o,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(o){this._addonManager.loadAddon(this,o)}static get strings(){return a}_verifyIntegers(...o){for(const s of o)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...o){for(const s of o)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}m.Terminal=_})(),h})())})(bh);var Qp=bh.exports,Dh={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 m=this._terminal.options.scrollback===0?0:n.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(a.getPropertyValue("height")),f=Math.max(0,parseInt(a.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),d=u-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),p=f-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-m;return{cols:Math.max(2,Math.floor(p/h.css.cell.width)),rows:Math.max(1,Math.floor(d/h.css.cell.height))}}}})(),r})())})(Dh);var tc=Dh.exports,Rh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(m,a)=>{function u(g){try{const d=new URL(g),p=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 g.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(g,d,p,S={}){this._terminal=g,this._regex=d,this._handler=p,this._options=S}provideLinks(g,d){const p=f.computeLink(g,this._regex,this._terminal,this._handler);d(this._addCallbacks(p))}_addCallbacks(g){return g.map(d=>(d.leave=this._options.leave,d.hover=(p,S)=>{if(this._options.hover){const{range:w}=d;this._options.hover(p,S,w)}},d))}};class f{static computeLink(d,p,S,w){const _=new RegExp(p.source,(p.flags||"")+"g"),[c,o]=f._getWindowedLineStrings(d-1,S),s=c.join("");let l;const v=[];for(;l=_.exec(s);){const C=l[0];if(!u(C))continue;const[x,k]=f._mapStrIdx(S,o,0,l.index),[y,b]=f._mapStrIdx(S,x,k,C.length);if(x===-1||k===-1||y===-1||b===-1)continue;const R={start:{x:k+1,y:x+1},end:{x:b,y:y+1}};v.push({range:R,text:C,activate:w})}return v}static _getWindowedLineStrings(d,p){let S,w=d,_=d,c=0,o="";const s=[];if(S=p.buffer.active.getLine(d)){const l=S.translateToString(!0);if(S.isWrapped&&l[0]!==" "){for(c=0;(S=p.buffer.active.getLine(--w))&&c<2048&&(o=S.translateToString(!0),c+=o.length,s.push(o),S.isWrapped&&o.indexOf(" ")===-1););s.reverse()}for(s.push(l),c=0;(S=p.buffer.active.getLine(++_))&&S.isWrapped&&c<2048&&(o=S.translateToString(!0),c+=o.length,s.push(o),o.indexOf(" ")===-1););}return[s,w]}static _mapStrIdx(d,p,S,w){const _=d.buffer.active,c=_.getNullCell();let o=S;for(;w;){const s=_.getLine(p);if(!s)return[-1,-1];for(let l=o;l<s.length;++l){s.getCell(l,c);const v=c.getChars();if(c.getWidth()&&(w-=v.length||1,l===s.length-1&&v==="")){const C=_.getLine(p+1);C&&C.isWrapped&&(C.getCell(0,c),c.getWidth()===2&&(w+=1))}if(w<0)return[p,l]}p++,o=0}return[p,o]}}a.LinkComputer=f}},i={};function n(m){var a=i[m];if(a!==void 0)return a.exports;var u=i[m]={exports:{}};return r[m](u,u.exports,n),u.exports}var h={};return(()=>{var m=h;Object.defineProperty(m,"__esModule",{value:!0}),m.WebLinksAddon=void 0;const a=n(6),u=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(g,d){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}m.WebLinksAddon=class{constructor(g=f,d={}){this._handler=g,this._options=d}activate(g){this._terminal=g;const d=this._options,p=d.urlRegex||u;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,p,this._handler,d))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),h})())})(Rh);var Yp=Rh.exports;function rc(){const e=re.getState().theme;return Xp(e)==="light"?Kp:$p}const Ho=new Set,Fo=new Map,zo=new Map;function Jp(e,t){zo.set(e,t)}function Zp(e){const t=zo.get(e);return t!==void 0?(zo.delete(e),t):null}function e_({terminalId:e,projectId:t,cwd:r}){const i=Q.useRef(null),n=Q.useRef(null),h=Q.useRef(null),m=Q.useRef(null),a=De(p=>p.setTerminalInstance),u=De(p=>p.createSession),f=re(p=>p.setFocusedTerminal);Q.useEffect(()=>{const p=i.current;if(!p)return;p.innerHTML="";const S=De.getState().sessions[e],w=Fo.get(e);if(S!=null&&S.terminal&&w){const s=S.terminal;n.current=s,p.appendChild(w);const l=new tc.FitAddon;return s.loadAddon(l),h.current=l,requestAnimationFrame(()=>{try{l.fit();const{cols:v,rows:C}=s;m.current={cols:v,rows:C},ze({type:"pty:resize",terminalId:e,cols:v,rows:C})}catch{}}),()=>{}}const _=new Qp.Terminal({theme:rc(),fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', 'Menlo', monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"block",allowProposedApi:!0,scrollback:1e4}),c=new tc.FitAddon,o=new Yp.WebLinksAddon;return _.loadAddon(c),_.loadAddon(o),_.open(p),n.current=_,h.current=c,_.element&&Fo.set(e,_.element),u(e,t),a(e,_),_.attachCustomKeyEventHandler(s=>s.key==="Enter"&&s.shiftKey?(s.type==="keydown"&&ze({type:"pty:input",terminalId:e,data:`
65
+ `}),!1):!0),_.onData(s=>{ze({type:"pty:input",terminalId:e,data:s})}),_.onTitleChange(s=>{De.getState().setTitle(e,s)}),Ho.has(e)||(Ho.add(e),requestAnimationFrame(()=>{try{c.fit()}catch{}ze({type:"pty:spawn",terminalId:e,projectId:t,cwd:r}),ze({type:"pty:resize",terminalId:e,cols:_.cols,rows:_.rows}),m.current={cols:_.cols,rows:_.rows},_.focus(),f(e)})),()=>{}},[e,t,r,u,a]),Q.useEffect(()=>{const p=()=>{const o=n.current;o&&(o.options.theme=rc())};let S=re.getState().theme;const w=re.subscribe(o=>{o.theme!==S&&(S=o.theme,p())}),_=window.matchMedia("(prefers-color-scheme: light)"),c=()=>{re.getState().theme==="system"&&p()};return _.addEventListener("change",c),()=>{w(),_.removeEventListener("change",c)}},[]);const g=Q.useCallback(()=>{const p=h.current,S=n.current;if(!(!p||!S))try{p.fit();const{cols:w,rows:_}=S,c=m.current;(!c||c.cols!==w||c.rows!==_)&&(m.current={cols:w,rows:_},ze({type:"pty:resize",terminalId:e,cols:w,rows:_}))}catch{}},[e]),d=Q.useCallback(()=>{var p;(p=n.current)==null||p.focus(),f(e)},[e,f]);return{containerRef:i,fit:g,focus:d,terminalRef:n}}function an(e){Ho.delete(e),Fo.delete(e)}let Ze=null;function t_(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function ze(e){(Ze==null?void 0:Ze.readyState)===WebSocket.OPEN&&Ze.send(JSON.stringify(e))}function r_(){const e=re(h=>h.setConnectionStatus),t=ve(h=>h.addProject),r=ve(h=>h.setActiveProject),i=Q.useRef(),n=Q.useCallback(()=>{if((Ze==null?void 0:Ze.readyState)===WebSocket.OPEN||(Ze==null?void 0:Ze.readyState)===WebSocket.CONNECTING)return;e("connecting");const h=new WebSocket(t_());Ze=h,h.onopen=()=>{e("connected")},h.onmessage=m=>{var a,u,f;try{const g=JSON.parse(m.data);if(g.type==="pty:output"){const d=De.getState().sessions[g.terminalId];(a=d==null?void 0:d.terminal)==null||a.write(g.data);const p=Zp(g.terminalId);p&&ze({type:"pty:input",terminalId:g.terminalId,data:p});return}if(g.type==="pty:exit"){const d=g.terminalId,p=De.getState().sessions[d],S=p==null?void 0:p.projectId;if((u=p==null?void 0:p.terminal)==null||u.dispose(),De.getState().removeSession(d),an(d),S){oe.getState().removePaneFromProject(S,d),ve.getState().removeTerminalFromProject(S,d);const w=ye(oe.getState().getLayout(S)),_=re.getState().focusedTerminalId;if(_===d&&w.length>0){const c=w[0];re.getState().setFocusedTerminal(c);const o=De.getState().sessions[c];(f=o==null?void 0:o.terminal)==null||f.focus()}else _===d&&re.getState().setFocusedTerminal(null)}return}if(g.type==="project:spawned"){const d=Object.values(ve.getState().projects).find(p=>p.cwd===g.cwd);d?r(d.id):(t({id:g.projectId,name:g.name,cwd:g.cwd,terminalIds:[]}),r(g.projectId));return}if(g.type==="editor:active"){if(!re.getState().editorSyncEnabled)return;const{projects:d,activeProjectId:p}=ve.getState(),S=Object.values(d).find(w=>{const _=w.cwd.replace(/\/$/,"").split("/").pop();return w.name===g.projectName||_===g.projectName});S&&S.id!==p&&r(S.id)}}catch{}},h.onclose=()=>{e("disconnected"),Ze=null,i.current=setTimeout(n,2e3)},h.onerror=()=>{h.close()}},[e,t,r]);Q.useEffect(()=>(n(),()=>{clearTimeout(i.current)}),[n])}const i_=new Set(["n","w","t","d","r"]);function s_(){const e=re(r=>r.toggleSidebar),t=re(r=>r.setFocusedTerminal);Q.useEffect(()=>{const r=i=>{var p,S,w;const n=i.key.toLowerCase();if(i.altKey&&!i.metaKey&&!i.ctrlKey&&["arrowleft","arrowright","arrowup","arrowdown"].includes(n)){i.preventDefault(),i.stopPropagation();const _=ve.getState().activeProjectId;if(!_)return;const c=oe.getState().getLayout(_),o=re.getState().focusedTerminalId;if(!o||!c)return;const l=Nn(c,o,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");l&&oe.getState().swapPanesInProject(_,o,l);return}if(!(navigator.platform.startsWith("Mac")?i.metaKey:i.ctrlKey))return;(i_.has(n)||n>="1"&&n<="9"||["arrowleft","arrowright","arrowup","arrowdown"].includes(n))&&(i.preventDefault(),i.stopPropagation());const a=ve.getState().activeProjectId;if(!a)return;const u=oe.getState().getLayout(a),f=re.getState().focusedTerminalId,g=ve.getState().projects[a];if(n==="d"&&!i.shiftKey){e();return}if(n==="n"){if(!g)return;const _=crypto.randomUUID(),c=ye(u);if(c.length>0){const o=f??c[c.length-1],s=i.shiftKey?"horizontal":"vertical";oe.getState().addPaneToProject(a,o,_,s)}else oe.getState().setLayout(a,{type:"leaf",terminalId:_});ve.getState().addTerminalToProject(a,_),t(_);return}if(n==="w"&&!i.shiftKey){if(!f||!u)return;ze({type:"pty:kill",terminalId:f}),oe.getState().removePaneFromProject(a,f),ve.getState().removeTerminalFromProject(a,f);const _=De.getState().sessions[f];(p=_==null?void 0:_.terminal)==null||p.dispose(),De.getState().removeSession(f),an(f);const c=ye(oe.getState().getLayout(a));t(c[0]??null);return}if(n==="t"&&!i.shiftKey){if(!g)return;const _=ye(u);_.length>0&&oe.getState().cyclePreset(a,_);return}if(n==="r"&&!i.shiftKey){const _=ye(u);if(_.length===0)return;let c;_.length<=2?c="even-vertical":_.length===3?c="main-left":c="grid";const o=Ai(_,c);o&&oe.getState().setLayout(a,o);return}if(["arrowleft","arrowright","arrowup","arrowdown"].includes(n)&&!i.shiftKey){if(!f||!u)return;const c=Nn(u,f,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");if(c){t(c);const o=De.getState().sessions[c];(S=o==null?void 0:o.terminal)==null||S.focus()}return}if(["arrowleft","arrowright","arrowup","arrowdown"].includes(n)&&i.shiftKey){if(!f||!u)return;const c=Nn(u,f,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");c&&oe.getState().swapPanesInProject(a,f,c);return}const d=parseInt(n);if(d>=1&&d<=9){const c=ye(u)[d-1];if(c){t(c);const o=De.getState().sessions[c];(w=o==null?void 0:o.terminal)==null||w.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 n_=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Th=(...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 o_={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 a_=Q.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:n="",children:h,iconNode:m,...a},u)=>Q.createElement("svg",{ref:u,...o_,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:Th("lucide",n),...a},[...m.map(([f,g])=>Q.createElement(f,g)),...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 ce=(e,t)=>{const r=Q.forwardRef(({className:i,...n},h)=>Q.createElement(a_,{ref:h,iconNode:t,className:Th(`lucide-${n_(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 l_=ce("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 c_=ce("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 u_=ce("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
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 h_=ce("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"}]]);/**
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 ja=ce("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/**
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 d_=ce("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"}]]);/**
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 Ph=ce("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"}]]);/**
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 f_=ce("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"}]]);/**
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 p_=ce("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
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 __=ce("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"}]]);/**
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 v_=ce("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
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 g_=ce("MonitorSmartphone",[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]]);/**
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 m_=ce("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
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 S_=ce("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
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 y_=ce("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"}]]);/**
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 w_=ce("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"}]]);/**
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 Mh=ce("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
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 Ah=ce("PanelTop",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]]);/**
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 C_=ce("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"}]]);/**
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 x_=ce("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
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 Na=ce("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 Ha=ce("Rows2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]]);/**
196
+ * @license lucide-react v0.400.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const Oh=ce("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"}]]);/**
201
+ * @license lucide-react v0.400.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const k_=ce("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
206
+ * @license lucide-react v0.400.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const Fa=ce("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
211
+ * @license lucide-react v0.400.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const za=ce("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"}]]);/**
216
+ * @license lucide-react v0.400.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const E_=ce("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"}]]);/**
221
+ * @license lucide-react v0.400.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const Fi=ce("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),si=Hi()(kh(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 ic(e){const t=oe.getState().getLayout(e);ye(t).forEach(i=>{var h;const n=De.getState().sessions[i];(h=n==null?void 0:n.terminal)==null||h.dispose(),De.getState().removeSession(i),an(i)}),ze({type:"project:kill",projectId:e}),oe.getState().setLayout(e,null),ve.getState().clearProjectTerminals(e)}function b_({project:e,isActive:t,onClick:r,onKill:i,onRemove:n}){const h=e.terminalIds.length;return A.jsxs("div",{onClick:r,className:`
226
+ group flex items-center gap-2 px-3 py-2 mx-2 rounded-lg cursor-pointer
227
+ transition-colors duration-100
228
+ ${t?"bg-accent/10 text-[var(--text-primary)]":"text-[var(--text-secondary)] hover:bg-[var(--surface-2)] hover:text-[var(--text-primary)]"}
229
+ `,children:[A.jsx(d_,{size:14,className:t?"text-accent":"text-[var(--text-muted)]"}),A.jsxs("div",{className:"flex-1 min-w-0",children:[A.jsx("div",{className:"text-xs font-medium truncate",children:e.name}),A.jsx("div",{className:"text-[10px] text-[var(--text-muted)] truncate font-mono",children:e.cwd})]}),h>0&&A.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:[A.jsx(Fa,{size:8}),h]}),A.jsxs("div",{className:"hidden group-hover:flex items-center gap-0.5",children:[h>0&&A.jsx("button",{onClick:m=>{m.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:A.jsx(h_,{size:12})}),A.jsx("button",{onClick:m=>{m.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:A.jsx(za,{size:12})})]})]})}function L_({open:e,onClose:t,onCreate:r,initialName:i,initialCwd:n}){const[h,m]=Q.useState(""),[a,u]=Q.useState("~"),[f,g]=Q.useState(null),[d,p]=Q.useState(!1),S=Q.useRef(null);Q.useEffect(()=>{e&&(m(i??""),u(n??"~"),g(null),setTimeout(()=>{var _;return(_=S.current)==null?void 0:_.focus()},50))},[e,i,n]);const w=Q.useCallback(async _=>{if(_.preventDefault(),!h.trim())return;const c=a.trim()||"~",s=Object.values(ve.getState().projects).find(l=>l.cwd===c);if(s){g(`Project "${s.name}" already uses this directory`);return}p(!0),g(null);try{const l=await fetch("/api/validate-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:c})}),{valid:v}=await l.json();if(!v){g("Directory does not exist"),p(!1);return}}catch{g("Could not validate path"),p(!1);return}p(!1),r(h.trim(),c),t()},[h,a,r,t]);return e?A.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:A.jsxs("div",{className:"bg-[var(--surface-1)] border border-[var(--border)] rounded-xl w-[400px] shadow-2xl animate-fade-in",onClick:_=>_.stopPropagation(),children:[A.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[A.jsx("h3",{className:"text-sm font-medium text-[var(--text-primary)]",children:"New Project"}),A.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:A.jsx(Fi,{size:14})})]}),A.jsxs("form",{onSubmit:w,className:"p-4 space-y-4",children:[A.jsxs("div",{children:[A.jsx("label",{className:"block text-xs text-[var(--text-secondary)] mb-1.5",children:"Project Name"}),A.jsx("input",{ref:S,value:h,onChange:_=>m(_.target.value),placeholder:"my-project",className:`
230
+ w-full px-3 py-2 text-sm
231
+ bg-[var(--surface-0)] border border-[var(--border)]
232
+ text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
233
+ rounded-lg outline-none
234
+ focus:border-accent focus:ring-1 focus:ring-accent/30
235
+ transition-colors
236
+ `})]}),A.jsxs("div",{children:[A.jsx("label",{className:"block text-xs text-[var(--text-secondary)] mb-1.5",children:"Working Directory"}),A.jsx("input",{value:a,onChange:_=>{u(_.target.value),g(null)},placeholder:"/path/to/project",className:`
237
+ w-full px-3 py-2 text-sm font-mono
238
+ bg-[var(--surface-0)] border
239
+ text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
240
+ rounded-lg outline-none
241
+ transition-colors
242
+ ${f?"border-[var(--danger)] focus:border-[var(--danger)] focus:ring-1 focus:ring-[var(--danger)]/30":"border-[var(--border)] focus:border-accent focus:ring-1 focus:ring-accent/30"}
243
+ `}),f&&A.jsx("p",{className:"mt-1.5 text-[11px] text-[var(--danger)]",children:f})]}),A.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[A.jsx("button",{type:"button",onClick:t,className:`
244
+ px-3 py-1.5 text-xs text-[var(--text-secondary)]
245
+ hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)]
246
+ rounded-lg transition-colors
247
+ `,children:"Cancel"}),A.jsx("button",{type:"submit",disabled:!h.trim()||d,className:`
248
+ px-3 py-1.5 text-xs font-medium
249
+ bg-accent hover:bg-accent/80
250
+ disabled:opacity-40 disabled:cursor-not-allowed
251
+ text-white rounded-lg transition-colors
252
+ `,children:d?"Checking...":"Create"})]})]})]})}):null}const D_={"even-horizontal":"Rows","even-vertical":"Columns","main-left":"Main + Stack","main-top":"Main + Row",grid:"Grid"};function R_({favourite:e,onLaunch:t,onEdit:r,onDelete:i}){const n=`${D_[e.preset]??e.preset}, ${e.slots.length} terminal${e.slots.length!==1?"s":""}`;return A.jsxs("div",{className:`
253
+ group flex items-center gap-2 px-3 py-2 mx-2 rounded-lg cursor-pointer
254
+ text-[var(--text-secondary)] hover:bg-[var(--surface-2)] hover:text-[var(--text-primary)]
255
+ transition-colors duration-100
256
+ `,onClick:t,children:[A.jsx(Oh,{size:14,className:"text-[var(--text-muted)] flex-shrink-0"}),A.jsxs("div",{className:"flex-1 min-w-0",children:[A.jsx("div",{className:"text-xs font-medium truncate",children:e.name}),A.jsxs("div",{className:"text-[10px] text-[var(--text-muted)] truncate flex items-center gap-0.5",children:[A.jsx(Fa,{size:8}),n]})]}),A.jsxs("div",{className:"hidden group-hover:flex items-center gap-0.5",children:[A.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:A.jsx(x_,{size:12})}),A.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:A.jsx(C_,{size:12})}),A.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:A.jsx(za,{size:12})})]})]})}function T_({favourites:e,onLaunch:t,onEdit:r,onDelete:i}){const[n,h]=Q.useState(!1);return e.length===0?null:A.jsxs("div",{children:[A.jsxs("button",{onClick:()=>h(!n),className:`
257
+ flex items-center gap-1 w-full px-4 py-1.5
258
+ text-[10px] font-semibold uppercase tracking-wider
259
+ text-[var(--text-muted)] hover:text-[var(--text-secondary)]
260
+ transition-colors
261
+ `,children:[n?A.jsx(c_,{size:10}):A.jsx(l_,{size:10}),"Favourites"]}),!n&&A.jsx("div",{children:e.map(m=>A.jsx(R_,{favourite:m,onLaunch:()=>t(m),onEdit:()=>r(m),onDelete:()=>i(m.id)},m.id))})]})}const P_={"even-horizontal":A.jsx(Ha,{size:16}),"even-vertical":A.jsx(ja,{size:16}),"main-left":A.jsx(Mh,{size:16}),"main-top":A.jsx(Ah,{size:16}),grid:A.jsx(Ph,{size:16})},sc={"even-horizontal":"Rows","even-vertical":"Columns","main-left":"Main + Stack","main-top":"Main + Row",grid:"Grid"};function Bh({open:e,onClose:t,onSave:r,editingFavourite:i,defaultPreset:n,defaultSlotCount:h}){const[m,a]=Q.useState(""),[u,f]=Q.useState("even-horizontal"),[g,d]=Q.useState([{label:"",command:""}]),p=Q.useRef(null);if(Q.useEffect(()=>{if(e){if(i)a(i.name),f(i.preset),d(i.slots.map(o=>({...o})));else{a(""),f(n??"even-horizontal");const o=h??1;d(Array.from({length:o},()=>({label:"",command:""})))}setTimeout(()=>{var o;return(o=p.current)==null?void 0:o.focus()},50)}},[e,i,n,h]),!e)return null;const S=o=>{o.preventDefault(),!(!m.trim()||g.length===0)&&(r(m.trim(),u,g),t())},w=()=>{d([...g,{label:"",command:""}])},_=o=>{g.length<=1||d(g.filter((s,l)=>l!==o))},c=(o,s,l)=>{d(g.map((v,C)=>C===o?{...v,[s]:l}:v))};return A.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:A.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:o=>o.stopPropagation(),children:[A.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[A.jsx("h3",{className:"text-sm font-medium text-[var(--text-primary)]",children:i?"Edit Favourite":"Save Favourite"}),A.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:A.jsx(Fi,{size:14})})]}),A.jsxs("form",{onSubmit:S,className:"p-4 space-y-4 overflow-y-auto",children:[A.jsxs("div",{children:[A.jsx("label",{className:"block text-xs text-[var(--text-secondary)] mb-1.5",children:"Name"}),A.jsx("input",{ref:p,value:m,onChange:o=>a(o.target.value),placeholder:"My Workspace",className:`
262
+ w-full px-3 py-2 text-sm
263
+ bg-[var(--surface-0)] border border-[var(--border)]
264
+ text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
265
+ rounded-lg outline-none
266
+ focus:border-accent focus:ring-1 focus:ring-accent/30
267
+ transition-colors
268
+ `})]}),A.jsxs("div",{children:[A.jsx("label",{className:"block text-xs text-[var(--text-secondary)] mb-1.5",children:"Layout"}),A.jsx("div",{className:"flex gap-1",children:pi.map(o=>A.jsxs("button",{type:"button",onClick:()=>f(o),className:`
269
+ flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs transition-colors
270
+ ${u===o?"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"}
271
+ `,title:sc[o],children:[P_[o],A.jsx("span",{className:"hidden sm:inline",children:sc[o]})]},o))})]}),A.jsxs("div",{children:[A.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[A.jsx("label",{className:"text-xs text-[var(--text-secondary)]",children:"Terminal Slots"}),A.jsxs("button",{type:"button",onClick:w,className:"flex items-center gap-0.5 text-[10px] text-accent hover:text-accent/80 transition-colors",children:[A.jsx(Na,{size:10}),"Add"]})]}),A.jsx("div",{className:"space-y-2",children:g.map((o,s)=>A.jsxs("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-[var(--surface-0)] border border-[var(--border)]",children:[A.jsxs("div",{className:"flex-1 space-y-1.5",children:[A.jsx("input",{value:o.label,onChange:l=>c(s,"label",l.target.value),placeholder:`Terminal ${s+1}`,className:`
272
+ w-full px-2 py-1 text-xs
273
+ bg-transparent border border-[var(--border)]
274
+ text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
275
+ rounded outline-none
276
+ focus:border-accent focus:ring-1 focus:ring-accent/30
277
+ transition-colors
278
+ `}),A.jsx("input",{value:o.command,onChange:l=>c(s,"command",l.target.value),placeholder:"Command (optional)",className:`
279
+ w-full px-2 py-1 text-xs font-mono
280
+ bg-transparent border border-[var(--border)]
281
+ text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
282
+ rounded outline-none
283
+ focus:border-accent focus:ring-1 focus:ring-accent/30
284
+ transition-colors
285
+ `})]}),g.length>1&&A.jsx("button",{type:"button",onClick:()=>_(s),className:"p-1 mt-0.5 rounded text-[var(--text-muted)] hover:text-[var(--danger)] hover:bg-[var(--danger-dim)] transition-colors",children:A.jsx(za,{size:12})})]},s))})]}),A.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[A.jsx("button",{type:"button",onClick:t,className:`
286
+ px-3 py-1.5 text-xs text-[var(--text-secondary)]
287
+ hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)]
288
+ rounded-lg transition-colors
289
+ `,children:"Cancel"}),A.jsx("button",{type:"submit",disabled:!m.trim()||g.length===0,className:`
290
+ px-3 py-1.5 text-xs font-medium
291
+ bg-accent hover:bg-accent/80
292
+ disabled:opacity-40 disabled:cursor-not-allowed
293
+ text-white rounded-lg transition-colors
294
+ `,children:i?"Update":"Save"})]})]})]})})}function M_({open:e,onClose:t,onConfirm:r,terminalCount:i,favouriteName:n}){return e?A.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:A.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:[A.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[A.jsx("h3",{className:"text-sm font-medium text-[var(--text-primary)]",children:"Launch Favourite"}),A.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:A.jsx(Fi,{size:14})})]}),A.jsxs("div",{className:"p-4 space-y-4",children:[A.jsxs("div",{className:"flex items-start gap-3",children:[A.jsx("div",{className:"p-2 rounded-lg bg-yellow-500/10",children:A.jsx(E_,{size:16,className:"text-yellow-500"})}),A.jsxs("div",{className:"text-sm text-[var(--text-secondary)]",children:["Launching ",A.jsx("span",{className:"font-medium text-[var(--text-primary)]",children:n})," will close ",i," existing terminal",i!==1?"s":"",". Continue?"]})]}),A.jsxs("div",{className:"flex justify-end gap-2",children:[A.jsx("button",{onClick:t,className:`
295
+ px-3 py-1.5 text-xs text-[var(--text-secondary)]
296
+ hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)]
297
+ rounded-lg transition-colors
298
+ `,children:"Cancel"}),A.jsx("button",{onClick:()=>{r(),t()},className:`
299
+ px-3 py-1.5 text-xs font-medium
300
+ bg-accent hover:bg-accent/80
301
+ text-white rounded-lg transition-colors
302
+ `,children:"Launch"})]})]})]})}):null}function A_(){const[e,t]=Q.useState(!1),[r,i]=Q.useState(!1),[n,h]=Q.useState(!1),[m,a]=Q.useState(null),[u,f]=Q.useState(null),[g,d]=Q.useState(null),[p,S]=Q.useState(!1),[w,_]=Q.useState(null);Q.useEffect(()=>{fetch("/api/version").then(z=>z.json()).then(z=>{z.latest&&O_(z.latest,z.current)&&_({current:z.current,latest:z.latest})}).catch(()=>{})},[]);const c=ve(z=>z.projects),o=ve(z=>z.activeProjectId),s=ve(z=>z.setActiveProject),l=ve(z=>z.addProject),v=ve(z=>z.removeProject),C=ve(z=>z.addTerminalToProject),x=re(z=>z.sidebarOpen),k=re(z=>z.sidebarWidth),y=re(z=>z.setSidebarWidth),b=re(z=>z.toggleSidebar),R=re(z=>z.connectionStatus),M=Q.useRef(!1),B=re(z=>z.editorSyncEnabled),T=re(z=>z.toggleEditorSync),N=re(z=>z.theme),F=re(z=>z.cycleTheme),K=si(z=>z.favourites);si(z=>z.addFavourite);const q=si(z=>z.updateFavourite),j=si(z=>z.removeFavourite),E=(z,te)=>{const ne=Object.values(c).find(He=>He.cwd===te);if(ne){s(ne.id);return}const ee=crypto.randomUUID();l({id:ee,name:z,cwd:te,terminalIds:[]}),ze({type:"project:create",projectId:ee,name:z,cwd:te}),s(ee)},D=z=>{ic(z)},P=z=>{D(z),ze({type:"project:remove",projectId:z}),oe.getState().removeProjectLayout(z),v(z)},O=z=>{if(!o||!c[o])return;ic(o);const ne=z.slots.map(()=>crypto.randomUUID());z.slots.forEach((He,Wr)=>{He.command.trim()&&Jp(ne[Wr],He.command+`
303
+ `)});const ee=Ai(ne,z.preset);oe.getState().setLayout(o,ee),ne.forEach(He=>{C(o,He)}),ne.length>0&&re.getState().setFocusedTerminal(ne[0])},W=z=>{if(!o)return;const te=oe.getState().getLayout(o);ye(te).length>0?(f(z),h(!0)):O(z)},V=z=>{a(z),i(!0)},J=(z,te,ne)=>{m&&q(m.id,{name:z,preset:te,slots:ne}),a(null)},Z=Q.useCallback(z=>{z.dataTransfer.types.includes("Files")&&(z.preventDefault(),z.dataTransfer.dropEffect="copy",S(!0))},[]),I=Q.useCallback(z=>{z.currentTarget.contains(z.relatedTarget)||S(!1)},[]),L=Q.useCallback(z=>{z.preventDefault(),M.current=!0;const te=ee=>{y(ee.clientX)},ne=()=>{M.current=!1,window.removeEventListener("mousemove",te),window.removeEventListener("mouseup",ne),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("mousemove",te),window.addEventListener("mouseup",ne)},[y]),U=Q.useCallback(z=>{if(S(!1),!z.dataTransfer.types.includes("Files")||z.dataTransfer.files.length===0)return;z.preventDefault(),z.stopPropagation();const te=z.dataTransfer.files[0];fetch("/api/resolve-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:te.name,size:te.size,lastModified:te.lastModified})}).then(ne=>ne.json()).then(ne=>{if(!ne.path||!ne.isDirectory)return;const ee=ne.path,He=ee.split("/").pop()||te.name;d({name:He,cwd:ee}),t(!0)}).catch(()=>{})},[]);if(!x)return null;const H=Object.values(c),X=Object.values(K),se=(o?c[o]:null)?ye(oe.getState().getLayout(o)).length:0;return A.jsxs("div",{className:`relative flex-shrink-0 bg-[var(--surface-1)] border-r border-[var(--border)] flex flex-col h-full ${p?"ring-2 ring-inset ring-[var(--accent)]":""}`,style:{width:k},onDragOver:Z,onDragLeave:I,onDrop:U,children:[A.jsx("div",{className:"absolute top-0 right-0 w-1 h-full cursor-col-resize z-10 hover:bg-[var(--accent)] active:bg-[var(--accent)] opacity-0 hover:opacity-40 active:opacity-60 transition-opacity",onMouseDown:L}),A.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx("span",{className:"text-sm font-semibold tracking-tight text-[var(--text-primary)]",children:"Paneful"}),A.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${R==="connected"?"bg-[var(--success)]":R==="connecting"?"bg-yellow-500 animate-pulse":"bg-[var(--danger)]"}`,title:R})]}),A.jsxs("div",{className:"flex items-center gap-1",children:[A.jsx("button",{onClick:F,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:`Theme: ${N}. Click to cycle.`,children:N==="light"?A.jsx(k_,{size:14}):N==="dark"?A.jsx(S_,{size:14}):A.jsx(m_,{size:14})}),A.jsx("button",{onClick:T,className:`p-1 rounded transition-colors ${B?"text-[var(--accent)] hover:bg-[var(--surface-3)]":"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)]"}`,title:B?"Editor sync ON — auto-switches project based on your active editor. Click to disable.":"Editor sync OFF — click to enable. Requires: (1) Terminal app in System Settings → Accessibility, (2) Editor window title includes folder name (default in VS Code/Cursor).",children:A.jsx(g_,{size:14})}),A.jsx("button",{onClick:b,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Hide sidebar",children:A.jsx(y_,{size:14})})]})]}),A.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:H.length===0&&X.length===0?A.jsx("div",{className:"px-4 py-8 text-center",children:A.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"No projects yet"})}):A.jsxs(A.Fragment,{children:[H.map(z=>A.jsx(b_,{project:z,isActive:z.id===o,onClick:()=>s(z.id),onKill:()=>D(z.id),onRemove:()=>P(z.id)},z.id)),A.jsx(T_,{favourites:X,onLaunch:W,onEdit:V,onDelete:j})]})}),A.jsxs("div",{className:"mx-3 mb-2 px-3 py-2.5 rounded-lg bg-[var(--surface-2)] text-[10px] text-[var(--text-muted)] leading-relaxed flex flex-col items-center gap-1.5 text-center",children:[A.jsx(v_,{size:12,className:"text-yellow-400"}),"Drag a folder into this sidebar to create a project"]}),A.jsx("div",{className:"p-2 border-t border-[var(--border)]",children:A.jsxs("button",{onClick:()=>t(!0),className:`
304
+ w-full flex items-center justify-center gap-1.5
305
+ px-3 py-2 text-xs
306
+ text-[var(--text-secondary)] hover:text-[var(--text-primary)]
307
+ bg-[var(--surface-2)] hover:bg-[var(--surface-3)]
308
+ rounded-lg transition-colors
309
+ `,children:[A.jsx(Na,{size:14}),"New Project"]})}),w&&A.jsxs("div",{className:"px-4 py-3 border-t border-[var(--border)]",children:[A.jsxs("a",{href:"https://www.npmjs.com/package/paneful",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-xs text-[var(--accent)] hover:underline",children:[A.jsx(u_,{size:14}),A.jsxs("span",{children:["v",w.latest," available (current: v",w.current,")"]})]}),A.jsx("p",{className:"text-[10px] text-[var(--text-muted)] mt-1",children:"npm update -g paneful"})]}),A.jsx(L_,{open:e,onClose:()=>{t(!1),d(null)},onCreate:E,initialName:g==null?void 0:g.name,initialCwd:g==null?void 0:g.cwd}),A.jsx(Bh,{open:r,onClose:()=>{i(!1),a(null)},onSave:J,editingFavourite:m}),A.jsx(M_,{open:n,onClose:()=>{h(!1),f(null)},onConfirm:()=>{u&&O(u)},terminalCount:se,favouriteName:(u==null?void 0:u.name)??""})]})}function O_(e,t){const r=e.split(".").map(Number),i=t.split(".").map(Number);for(let n=0;n<3;n++){if((r[n]||0)>(i[n]||0))return!0;if((r[n]||0)<(i[n]||0))return!1}return!1}const B_="border border-[var(--border)] rounded-md px-1.5 py-0.5 bg-[var(--surface-0)] text-[11px] font-mono min-w-[24px] text-center inline-flex items-center justify-center shadow-[0_1px_0_var(--border)]",I_=[{keys:["⌘","N"],action:"New pane (vertical)"},{keys:["⌘","⇧","N"],action:"New pane (horizontal)"},{keys:["⌘","W"],action:"Close pane"},{keys:["⌘","D"],action:"Toggle sidebar"},{keys:["⌘","T"],action:"Cycle layout"},{keys:["⌘","R"],action:"Auto reorganize"},{keys:["⌘","1-9"],action:"Focus pane by number"},{keys:["⌘","←→↑↓"],action:"Move focus"},{keys:["⌘","⇧","←→↑↓"],action:"Swap panes"},{keys:["⌥","←→↑↓"],action:"Swap panes"},{keys:["Shift","Enter"],action:"Insert new line"}];function j_({open:e,onClose:t}){return e?A.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:A.jsxs("div",{className:"bg-[var(--surface-1)] border border-[var(--border)] rounded-xl w-[440px] shadow-2xl animate-fade-in",onClick:r=>r.stopPropagation(),children:[A.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[A.jsx("h3",{className:"text-sm font-medium text-[var(--text-primary)]",children:"Keyboard Shortcuts"}),A.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:A.jsx(Fi,{size:14})})]}),A.jsx("div",{className:"p-4 space-y-2",children:I_.map((r,i)=>A.jsxs("div",{className:"flex items-center justify-between py-1",children:[A.jsx("div",{className:"flex items-center gap-1",children:r.keys.map((n,h)=>A.jsx("kbd",{className:B_,children:n},h))}),A.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:r.action})]},i))})]})}):null}const N_={"even-horizontal":A.jsx(Ha,{size:14}),"even-vertical":A.jsx(ja,{size:14}),"main-left":A.jsx(Mh,{size:14}),"main-top":A.jsx(Ah,{size:14}),grid:A.jsx(Ph,{size:14})},H_={"even-horizontal":"Rows","even-vertical":"Columns","main-left":"Main + Stack","main-top":"Main + Row",grid:"Grid"};function F_({onNewPane:e}){const[t,r]=Q.useState(!1),[i,n]=Q.useState(!1),h=re(c=>c.sidebarOpen),m=re(c=>c.toggleSidebar),a=ve(c=>c.activeProjectId),u=oe(c=>c.currentPresetIndex),f=oe(c=>c.cyclePreset),g=si(c=>c.addFavourite),d=()=>{if(!a)return;const c=oe.getState().getLayout(a),o=ye(c);o.length>0&&f(a,o)},p=()=>{if(!a)return;const c=oe.getState().getLayout(a),o=ye(c);if(o.length===0)return;let s;o.length<=2?s="even-vertical":o.length===3?s="main-left":s="grid";const l=Ai(o,s);l&&oe.getState().setLayout(a,l)},S=(c,o,s)=>{g({id:crypto.randomUUID(),name:c,preset:o,slots:s})},w=pi[u],_=a?ye(oe.getState().getLayout(a)).length:0;return A.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:[!h&&A.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:"Show sidebar (Cmd+D)",children:A.jsx(w_,{size:14})}),A.jsx("div",{className:"w-px h-4 bg-[var(--border)] mx-1"}),A.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:A.jsx(ja,{size:14})}),A.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:A.jsx(Ha,{size:14})}),A.jsx("div",{className:"w-px h-4 bg-[var(--border)] mx-1"}),A.jsxs("button",{onClick:d,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:[N_[w],A.jsx("span",{className:"hidden sm:inline",children:H_[w]})]}),A.jsx("button",{onClick:p,className:"p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Auto reorganize (Cmd+R)",children:A.jsx(__,{size:14})}),A.jsx("div",{className:"w-px h-4 bg-[var(--border)] mx-1"}),A.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:A.jsx(Oh,{size:14})}),A.jsx("div",{className:"flex-1"}),A.jsx("button",{onClick:()=>n(!0),className:"p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Keyboard shortcuts",children:A.jsx(p_,{size:14})}),A.jsx(Bh,{open:t,onClose:()=>r(!1),onSave:S,defaultPreset:w,defaultSlotCount:Math.max(_,1)}),A.jsx(j_,{open:i,onClose:()=>n(!1)})]})}function z_(e,t){const r=Q.useRef();Q.useEffect(()=>{const i=e.current;if(!i)return;const n=new ResizeObserver(()=>{clearTimeout(r.current),r.current=setTimeout(t,Up)});return n.observe(i),()=>{n.disconnect(),clearTimeout(r.current)}},[e,t])}function W_(e,t){const r=re(p=>p.setDragging),i=re(p=>p.setDropTarget),n=re(p=>p.draggingTerminalId),h=oe(p=>p.movePaneInProject),m=oe(p=>p.swapPanesInProject),a=Q.useCallback(p=>{p.dataTransfer.setData("text/plain",e),p.dataTransfer.effectAllowed="move",r(e)},[e,r]),u=Q.useCallback(()=>{r(null),i(null)},[r,i]),f=Q.useCallback(p=>{if(p.preventDefault(),p.dataTransfer.dropEffect="move",!n||n===e){i(null);return}const S=p.currentTarget.getBoundingClientRect(),w=(p.clientX-S.left)/S.width,_=(p.clientY-S.top)/S.height;let c="center";const o=.2;w<o?c="left":w>1-o?c="right":_<o?c="top":_>1-o&&(c="bottom"),i({terminalId:e,edge:c})},[e,n,i]),g=Q.useCallback(()=>{i(null)},[i]),d=Q.useCallback(p=>{p.preventDefault();const S=p.dataTransfer.getData("text/plain");if(!S||S===e)return;const w=re.getState().dropTarget;w&&(w.edge==="center"?m(t,S,e):h(t,S,e,w.edge),r(null),i(null))},[e,t,h,m,r,i]);return{onDragStart:a,onDragEnd:u,onDragOver:f,onDragLeave:g,onDrop:d}}function U_({terminalId:e,projectId:t,isFocused:r,onClose:i,dragProps:n}){const h=De(d=>d.sessions[e]),m=(h==null?void 0:h.title)??"Terminal",a=(h==null?void 0:h.alive)??!0,u=oe(d=>d.getLayout(t)),g=ye(u).indexOf(e)+1;return A.jsxs("div",{draggable:!0,onDragStart:n.onDragStart,onDragEnd:n.onDragEnd,className:`
310
+ flex items-center h-7 px-2 gap-1.5 flex-shrink-0
311
+ border-b transition-colors duration-100
312
+ select-none cursor-grab active:cursor-grabbing
313
+ ${r?"bg-[var(--surface-3)] border-[var(--accent)]":"bg-[var(--surface-2)] border-[var(--border)]"}
314
+ `,children:[A.jsx("div",{className:"text-[var(--text-muted)]",children:A.jsx(f_,{size:12})}),A.jsx("span",{className:"text-[10px] font-medium text-[var(--text-muted)] tabular-nums",children:g}),A.jsx("span",{className:"text-xs text-[var(--text-secondary)] truncate flex-1",children:m}),!a&&A.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--danger)]"}),A.jsx("button",{onClick:d=>{d.stopPropagation(),i()},onMouseDown:d=>d.stopPropagation(),draggable:!1,className:`
315
+ p-0.5 rounded text-[var(--text-muted)]
316
+ hover:text-[var(--danger)] hover:bg-[var(--danger-dim)]
317
+ transition-colors
318
+ `,children:A.jsx(Fi,{size:12})})]})}function $_({terminalId:e}){const t=re(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 A.jsx("div",{className:`
319
+ absolute ${n[r]??"inset-0"}
320
+ pointer-events-none z-20
321
+ ${i?"bg-accent/15 border-2 border-accent/40":"bg-accent/20 border-2 border-accent/50"}
322
+ rounded-sm transition-all duration-100
323
+ `})}function K_({terminalId:e,projectId:t,cwd:r}){const i=re(w=>w.focusedTerminalId),n=re(w=>w.draggingTerminalId),h=i===e,m=n===e,{containerRef:a,fit:u,focus:f}=e_({terminalId:e,projectId:t,cwd:r}),g=W_(e,t);z_(a,u);const d=Q.useCallback(()=>{var c;ze({type:"pty:kill",terminalId:e}),oe.getState().removePaneFromProject(t,e),ve.getState().removeTerminalFromProject(t,e);const w=De.getState().sessions[e];(c=w==null?void 0:w.terminal)==null||c.dispose(),De.getState().removeSession(e),an(e);const _=ye(oe.getState().getLayout(t));re.getState().setFocusedTerminal(_[0]??null)},[e,t]),p=Q.useCallback(w=>{if(!(re.getState().draggingTerminalId!=null)&&(w.dataTransfer.types.includes("codefiles")||w.dataTransfer.types.includes("text/plain"))){const c=w.dataTransfer.getData("codefiles");let o=[];if(c)try{o=JSON.parse(c)}catch{}if(o.length===0){const s=w.dataTransfer.getData("text/plain").trim();s&&s.startsWith("/")&&(o=s.split(`
324
+ `).map(l=>l.trim()).filter(Boolean))}if(o.length>0&&!w.dataTransfer.types.includes("Files")){w.preventDefault(),w.stopPropagation();const s=o.map(l=>/[ ()'"]/.test(l)?`'${l.replace(/'/g,"'\\''")}'`:l);ze({type:"pty:input",terminalId:e,data:s.join(" ")}),f();return}}if(w.dataTransfer.types.includes("Files")&&w.dataTransfer.files.length>0){w.preventDefault(),w.stopPropagation();const c=Array.from(w.dataTransfer.files);Promise.all(c.map(o=>fetch("/api/resolve-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:o.name,size:o.size,lastModified:o.lastModified})}).then(s=>s.json()).then(s=>s.path).catch(()=>null))).then(o=>{const s=o.filter(Boolean);if(s.length>0){const l=s.map(v=>/[ ()'"]/.test(v)?`'${v.replace(/'/g,"'\\''")}'`:v);ze({type:"pty:input",terminalId:e,data:l.join(" ")}),f()}});return}g.onDrop(w)},[e,g,f]),S=Q.useCallback(w=>{if(re.getState().draggingTerminalId!=null){g.onDragOver(w);return}if(w.dataTransfer.types.includes("Files")||w.dataTransfer.types.includes("codefiles")||w.dataTransfer.types.includes("text/plain")){w.preventDefault(),w.dataTransfer.dropEffect="copy";return}g.onDragOver(w)},[g]);return A.jsxs("div",{style:{borderColor:h?"var(--accent)":"transparent"},className:`
325
+ flex flex-col h-full w-full relative border
326
+ ${m?"opacity-40":""}
327
+ transition-colors duration-100
328
+ `,onClick:f,onDragOver:S,onDragLeave:g.onDragLeave,onDrop:p,children:[A.jsx(U_,{terminalId:e,projectId:t,isFocused:h,onClose:d,dragProps:{onDragStart:g.onDragStart,onDragEnd:g.onDragEnd}}),A.jsx("div",{ref:a,className:"flex-1 min-h-0 min-w-0 overflow-hidden"}),A.jsx($_,{terminalId:e})]})}function V_({projectId:e,path:t,direction:r}){const i=oe(m=>m.resizePaneInProject),n=Q.useRef(null);return{onMouseDown:Q.useCallback(m=>{var p;m.preventDefault(),m.stopPropagation();const a=(p=n.current)==null?void 0:p.parentElement;if(!a)return;const u=a.getBoundingClientRect();r==="vertical"?m.clientX:m.clientY;const f=r==="vertical"?u.width:u.height,g=S=>{const w=r==="vertical"?S.clientX:S.clientY,_=r==="vertical"?u.left:u.top,c=(w-_)/f;i(e,t,c)},d=()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",d),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",g),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 q_({projectId:e,path:t,direction:r}){const{onMouseDown:i,containerRef:n}=V_({projectId:e,path:t,direction:r}),h=r==="vertical";return A.jsxs("div",{ref:n,className:`
329
+ relative z-10 flex-shrink-0
330
+ ${h?"w-[4px] cursor-col-resize":"h-[4px] cursor-row-resize"}
331
+ group
332
+ `,onMouseDown:i,children:[A.jsx("div",{className:`
333
+ absolute
334
+ ${h?"inset-y-0 -left-[2px] w-[8px]":"inset-x-0 -top-[2px] h-[8px]"}
335
+ transition-colors duration-150
336
+ hover:bg-accent/40
337
+ group-active:bg-accent/60
338
+ `}),A.jsx("div",{className:`
339
+ ${h?"w-full h-full":"h-full w-full"}
340
+ bg-[var(--border)]
341
+ transition-colors duration-150
342
+ group-hover:bg-accent/60
343
+ group-active:bg-accent
344
+ `})]})}function Wo({node:e,projectId:t,cwd:r,path:i=[]}){if(e.type==="leaf")return A.jsx(K_,{terminalId:e.terminalId,projectId:t,cwd:r});const n=e.direction==="vertical",h=`${e.ratio*100}%`,m=`${(1-e.ratio)*100}%`;return A.jsxs("div",{className:`flex ${n?"flex-row":"flex-col"} h-full w-full`,children:[A.jsx("div",{style:{flexBasis:h,minWidth:0,minHeight:0,overflow:"hidden"},className:"flex",children:A.jsx(Wo,{node:e.first,projectId:t,cwd:r,path:[...i,0]})}),A.jsx(q_,{projectId:t,path:i,direction:e.direction}),A.jsx("div",{style:{flexBasis:m,minWidth:0,minHeight:0,overflow:"hidden"},className:"flex",children:A.jsx(Wo,{node:e.second,projectId:t,cwd:r,path:[...i,1]})})]})}function G_(){const[e,t]=Q.useState(null);return Q.useEffect(()=>{let r=!1;return Math.random()<.5?fetch("https://dummyjson.com/quotes/random").then(n=>n.json()).then(n=>{!r&&(n!=null&&n.quote)&&t({text:n.quote,attribution:n.author})}).catch(()=>{}):fetch("https://uselessfacts.jsph.pl/api/v2/facts/random?language=en").then(n=>n.json()).then(n=>{!r&&(n!=null&&n.text)&&t({text:n.text})}).catch(()=>{}),()=>{r=!0}},[]),e}function X_({onNewTerminal:e,projectName:t}){const r=G_();return A.jsx("div",{className:"h-full w-full flex items-center justify-center bg-[var(--surface-0)]",children:A.jsxs("div",{className:"flex flex-col items-center gap-6 text-center max-w-lg px-8",children:[A.jsx("div",{className:"w-16 h-16 rounded-2xl bg-[var(--surface-2)] border border-[var(--border)] flex items-center justify-center",children:A.jsx(Fa,{size:28,className:"text-[var(--text-muted)]"})}),A.jsxs("div",{children:[A.jsx("h2",{className:"text-lg font-medium text-[var(--text-primary)] mb-1",children:t??"No project selected"}),A.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:t?"This project has no active terminals.":"Create a project to get started."})]}),t&&A.jsxs("button",{onClick:e,className:`
345
+ flex items-center gap-2 px-4 py-2
346
+ bg-accent hover:bg-accent/80
347
+ text-white text-sm font-medium
348
+ rounded-lg transition-colors
349
+ `,children:[A.jsx(Na,{size:16}),"New Terminal"]}),r&&A.jsxs("div",{className:"mt-4 max-w-sm",children:[A.jsxs("p",{className:"text-sm italic text-[var(--text-muted)] leading-relaxed",children:['"',r.text,'"']}),r.attribution&&A.jsxs("p",{className:"text-xs text-[var(--text-muted)]/60 mt-2",children:["— ",r.attribution]})]})]})})}function Q_(){r_(),s_();const e=ve(u=>u.activeProjectId),t=ve(u=>u.activeProjectId?u.projects[u.activeProjectId]:null),r=oe(u=>e?u.getLayout(e):null),i=re(u=>u.focusedTerminalId),n=re(u=>u.setFocusedTerminal),h=ve(u=>u.addTerminalToProject),m=Q.useCallback(u=>{if(!e||!t)return;const f=crypto.randomUUID(),g=ye(r),d=i??g[0];d?oe.getState().addPaneToProject(e,d,f,u):oe.getState().setLayout(e,{type:"leaf",terminalId:f}),h(e,f),n(f)},[e,t,r,i,h,n]),a=Q.useCallback(()=>{m("vertical")},[m]);return A.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-[var(--surface-0)]",children:[A.jsx(A_,{}),A.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[A.jsx(F_,{onNewPane:m}),A.jsx("div",{className:"flex-1 min-h-0 min-w-0",children:r?A.jsx(Wo,{node:r,projectId:e,cwd:(t==null?void 0:t.cwd)??"/"},e):A.jsx(X_,{onNewTerminal:a,projectName:t==null?void 0:t.name})})]})]})}Hn.createRoot(document.getElementById("root")).render(A.jsx(vc.StrictMode,{children:A.jsx(Q_,{})}));