deckide 3.5.14 → 3.5.16

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,122 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))i(h);new MutationObserver(h=>{for(const _ of h)if(_.type==="childList")for(const C of _.addedNodes)C.tagName==="LINK"&&C.rel==="modulepreload"&&i(C)}).observe(document,{childList:!0,subtree:!0});function r(h){const _={};return h.integrity&&(_.integrity=h.integrity),h.referrerPolicy&&(_.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?_.credentials="include":h.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function i(h){if(h.ep)return;h.ep=!0;const _=r(h);fetch(h.href,_)}})();var df=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ff(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ic={exports:{}},fn={},Nc={exports:{}},le={};/**
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 Qi=Symbol.for("react.element"),_f=Symbol.for("react.portal"),pf=Symbol.for("react.fragment"),vf=Symbol.for("react.strict_mode"),gf=Symbol.for("react.profiler"),mf=Symbol.for("react.provider"),yf=Symbol.for("react.context"),Cf=Symbol.for("react.forward_ref"),Sf=Symbol.for("react.suspense"),wf=Symbol.for("react.memo"),xf=Symbol.for("react.lazy"),ia=Symbol.iterator;function bf(e){return e===null||typeof e!="object"?null:(e=ia&&e[ia]||e["@@iterator"],typeof e=="function"?e:null)}var Fc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},jc=Object.assign,Hc={};function ni(e,t,r){this.props=e,this.context=t,this.refs=Hc,this.updater=r||Fc}ni.prototype.isReactComponent={};ni.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")};ni.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function $c(){}$c.prototype=ni.prototype;function ol(e,t,r){this.props=e,this.context=t,this.refs=Hc,this.updater=r||Fc}var ll=ol.prototype=new $c;ll.constructor=ol;jc(ll,ni.prototype);ll.isPureReactComponent=!0;var sa=Array.isArray,zc=Object.prototype.hasOwnProperty,al={current:null},Uc={key:!0,ref:!0,__self:!0,__source:!0};function Wc(e,t,r){var i,h={},_=null,C=null;if(t!=null)for(i in t.ref!==void 0&&(C=t.ref),t.key!==void 0&&(_=""+t.key),t)zc.call(t,i)&&!Uc.hasOwnProperty(i)&&(h[i]=t[i]);var s=arguments.length-2;if(s===1)h.children=r;else if(1<s){for(var a=Array(s),d=0;d<s;d++)a[d]=arguments[d+2];h.children=a}if(e&&e.defaultProps)for(i in s=e.defaultProps,s)h[i]===void 0&&(h[i]=s[i]);return{$$typeof:Qi,type:e,key:_,ref:C,props:h,_owner:al.current}}function Ef(e,t){return{$$typeof:Qi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function cl(e){return typeof e=="object"&&e!==null&&e.$$typeof===Qi}function Lf(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var na=/\/+/g;function Mn(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Lf(""+e.key):t.toString(36)}function Ls(e,t,r,i,h){var _=typeof e;(_==="undefined"||_==="boolean")&&(e=null);var C=!1;if(e===null)C=!0;else switch(_){case"string":case"number":C=!0;break;case"object":switch(e.$$typeof){case Qi:case _f:C=!0}}if(C)return C=e,h=h(C),e=i===""?"."+Mn(C,0):i,sa(h)?(r="",e!=null&&(r=e.replace(na,"$&/")+"/"),Ls(h,t,r,"",function(d){return d})):h!=null&&(cl(h)&&(h=Ef(h,r+(!h.key||C&&C.key===h.key?"":(""+h.key).replace(na,"$&/")+"/")+e)),t.push(h)),1;if(C=0,i=i===""?".":i+":",sa(e))for(var s=0;s<e.length;s++){_=e[s];var a=i+Mn(_,s);C+=Ls(_,t,r,a,h)}else if(a=bf(e),typeof a=="function")for(e=a.call(e),s=0;!(_=e.next()).done;)_=_.value,a=i+Mn(_,s++),C+=Ls(_,t,r,a,h);else if(_==="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 C}function os(e,t,r){if(e==null)return e;var i=[],h=0;return Ls(e,i,"","",function(_){return t.call(r,_,h++)}),i}function kf(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 Xe={current:null},ks={transition:null},Rf={ReactCurrentDispatcher:Xe,ReactCurrentBatchConfig:ks,ReactCurrentOwner:al};function Vc(){throw Error("act(...) is not supported in production builds of React.")}le.Children={map:os,forEach:function(e,t,r){os(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return os(e,function(){t++}),t},toArray:function(e){return os(e,function(t){return t})||[]},only:function(e){if(!cl(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};le.Component=ni;le.Fragment=pf;le.Profiler=gf;le.PureComponent=ol;le.StrictMode=vf;le.Suspense=Sf;le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Rf;le.act=Vc;le.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=jc({},e.props),h=e.key,_=e.ref,C=e._owner;if(t!=null){if(t.ref!==void 0&&(_=t.ref,C=al.current),t.key!==void 0&&(h=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(a in t)zc.call(t,a)&&!Uc.hasOwnProperty(a)&&(i[a]=t[a]===void 0&&s!==void 0?s[a]:t[a])}var a=arguments.length-2;if(a===1)i.children=r;else if(1<a){s=Array(a);for(var d=0;d<a;d++)s[d]=arguments[d+2];i.children=s}return{$$typeof:Qi,type:e.type,key:h,ref:_,props:i,_owner:C}};le.createContext=function(e){return e={$$typeof:yf,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:mf,_context:e},e.Consumer=e};le.createElement=Wc;le.createFactory=function(e){var t=Wc.bind(null,e);return t.type=e,t};le.createRef=function(){return{current:null}};le.forwardRef=function(e){return{$$typeof:Cf,render:e}};le.isValidElement=cl;le.lazy=function(e){return{$$typeof:xf,_payload:{_status:-1,_result:e},_init:kf}};le.memo=function(e,t){return{$$typeof:wf,type:e,compare:t===void 0?null:t}};le.startTransition=function(e){var t=ks.transition;ks.transition={};try{e()}finally{ks.transition=t}};le.unstable_act=Vc;le.useCallback=function(e,t){return Xe.current.useCallback(e,t)};le.useContext=function(e){return Xe.current.useContext(e)};le.useDebugValue=function(){};le.useDeferredValue=function(e){return Xe.current.useDeferredValue(e)};le.useEffect=function(e,t){return Xe.current.useEffect(e,t)};le.useId=function(){return Xe.current.useId()};le.useImperativeHandle=function(e,t,r){return Xe.current.useImperativeHandle(e,t,r)};le.useInsertionEffect=function(e,t){return Xe.current.useInsertionEffect(e,t)};le.useLayoutEffect=function(e,t){return Xe.current.useLayoutEffect(e,t)};le.useMemo=function(e,t){return Xe.current.useMemo(e,t)};le.useReducer=function(e,t,r){return Xe.current.useReducer(e,t,r)};le.useRef=function(e){return Xe.current.useRef(e)};le.useState=function(e){return Xe.current.useState(e)};le.useSyncExternalStore=function(e,t,r){return Xe.current.useSyncExternalStore(e,t,r)};le.useTransition=function(){return Xe.current.useTransition()};le.version="18.3.1";Nc.exports=le;var $=Nc.exports;const mr=ff($);/**
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 Df=$,Af=Symbol.for("react.element"),Tf=Symbol.for("react.fragment"),Mf=Object.prototype.hasOwnProperty,Pf=Df.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Bf={key:!0,ref:!0,__self:!0,__source:!0};function Kc(e,t,r){var i,h={},_=null,C=null;r!==void 0&&(_=""+r),t.key!==void 0&&(_=""+t.key),t.ref!==void 0&&(C=t.ref);for(i in t)Mf.call(t,i)&&!Bf.hasOwnProperty(i)&&(h[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)h[i]===void 0&&(h[i]=t[i]);return{$$typeof:Af,type:e,key:_,ref:C,props:h,_owner:Pf.current}}fn.Fragment=Tf;fn.jsx=Kc;fn.jsxs=Kc;Ic.exports=fn;var M=Ic.exports,ho={},Gc={exports:{}},ut={},qc={exports:{}},Xc={};/**
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(L,T){var P=L.length;L.push(T);e:for(;0<P;){var I=P-1>>>1,z=L[I];if(0<h(z,T))L[I]=T,L[P]=z,P=I;else break e}}function r(L){return L.length===0?null:L[0]}function i(L){if(L.length===0)return null;var T=L[0],P=L.pop();if(P!==T){L[0]=P;e:for(var I=0,z=L.length,V=z>>>1;I<V;){var G=2*(I+1)-1,K=L[G],Z=G+1,A=L[Z];if(0>h(K,P))Z<z&&0>h(A,K)?(L[I]=A,L[Z]=P,I=Z):(L[I]=K,L[G]=P,I=G);else if(Z<z&&0>h(A,P))L[I]=A,L[Z]=P,I=Z;else break e}}return T}function h(L,T){var P=L.sortIndex-T.sortIndex;return P!==0?P:L.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var _=performance;e.unstable_now=function(){return _.now()}}else{var C=Date,s=C.now();e.unstable_now=function(){return C.now()-s}}var a=[],d=[],g=1,u=null,v=3,w=!1,S=!1,f=!1,n=typeof setTimeout=="function"?setTimeout:null,o=typeof clearTimeout=="function"?clearTimeout:null,l=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function c(L){for(var T=r(d);T!==null;){if(T.callback===null)i(d);else if(T.startTime<=L)i(d),T.sortIndex=T.expirationTime,t(a,T);else break;T=r(d)}}function m(L){if(f=!1,c(L),!S)if(r(a)!==null)S=!0,N(y);else{var T=r(d);T!==null&&H(m,T.startTime-L)}}function y(L,T){S=!1,f&&(f=!1,o(p),p=-1),w=!0;var P=v;try{for(c(T),u=r(a);u!==null&&(!(u.expirationTime>T)||L&&!R());){var I=u.callback;if(typeof I=="function"){u.callback=null,v=u.priorityLevel;var z=I(u.expirationTime<=T);T=e.unstable_now(),typeof z=="function"?u.callback=z:u===r(a)&&i(a),c(T)}else i(a);u=r(a)}if(u!==null)var V=!0;else{var G=r(d);G!==null&&H(m,G.startTime-T),V=!1}return V}finally{u=null,v=P,w=!1}}var b=!1,E=null,p=-1,x=5,D=-1;function R(){return!(e.unstable_now()-D<x)}function k(){if(E!==null){var L=e.unstable_now();D=L;var T=!0;try{T=E(!0,L)}finally{T?B():(b=!1,E=null)}}else b=!1}var B;if(typeof l=="function")B=function(){l(k)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,F=O.port2;O.port1.onmessage=k,B=function(){F.postMessage(null)}}else B=function(){n(k,0)};function N(L){E=L,b||(b=!0,B())}function H(L,T){p=n(function(){L(e.unstable_now())},T)}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(L){L.callback=null},e.unstable_continueExecution=function(){S||w||(S=!0,N(y))},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):x=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return r(a)},e.unstable_next=function(L){switch(v){case 1:case 2:case 3:var T=3;break;default:T=v}var P=v;v=T;try{return L()}finally{v=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,T){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var P=v;v=L;try{return T()}finally{v=P}},e.unstable_scheduleCallback=function(L,T,P){var I=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?I+P:I):P=I,L){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=P+z,L={id:g++,callback:T,priorityLevel:L,startTime:P,expirationTime:z,sortIndex:-1},P>I?(L.sortIndex=P,t(d,L),r(a)===null&&L===r(d)&&(f?(o(p),p=-1):f=!0,H(m,P-I))):(L.sortIndex=z,t(a,L),S||w||(S=!0,N(y))),L},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(L){var T=v;return function(){var P=v;v=T;try{return L.apply(this,arguments)}finally{v=P}}}})(Xc);qc.exports=Xc;var Of=qc.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 If=$,ht=Of;function Y(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 Yc=new Set,Pi={};function Lr(e,t){Jr(e,t),Jr(e+"Capture",t)}function Jr(e,t){for(Pi[e]=t,e=0;e<t.length;e++)Yc.add(t[e])}var Ht=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),uo=Object.prototype.hasOwnProperty,Nf=/^[: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]*$/,oa={},la={};function Ff(e){return uo.call(la,e)?!0:uo.call(oa,e)?!1:Nf.test(e)?la[e]=!0:(oa[e]=!0,!1)}function jf(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 Hf(e,t,r,i){if(t===null||typeof t>"u"||jf(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 Ye(e,t,r,i,h,_,C){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=h,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=_,this.removeEmptyString=C}var He={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){He[e]=new Ye(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];He[t]=new Ye(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){He[e]=new Ye(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){He[e]=new Ye(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){He[e]=new Ye(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){He[e]=new Ye(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){He[e]=new Ye(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){He[e]=new Ye(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){He[e]=new Ye(e,5,!1,e.toLowerCase(),null,!1,!1)});var hl=/[\-:]([a-z])/g;function ul(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(hl,ul);He[t]=new Ye(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(hl,ul);He[t]=new Ye(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(hl,ul);He[t]=new Ye(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){He[e]=new Ye(e,1,!1,e.toLowerCase(),null,!1,!1)});He.xlinkHref=new Ye("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){He[e]=new Ye(e,1,!1,e.toLowerCase(),null,!0,!0)});function dl(e,t,r,i){var h=He.hasOwnProperty(t)?He[t]:null;(h!==null?h.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Hf(t,r,h,i)&&(r=null),i||h===null?Ff(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):h.mustUseProperty?e[h.propertyName]=r===null?h.type===3?!1:"":r:(t=h.attributeName,i=h.attributeNamespace,r===null?e.removeAttribute(t):(h=h.type,r=h===3||h===4&&r===!0?"":""+r,i?e.setAttributeNS(i,t,r):e.setAttribute(t,r))))}var Wt=If.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ls=Symbol.for("react.element"),Pr=Symbol.for("react.portal"),Br=Symbol.for("react.fragment"),fl=Symbol.for("react.strict_mode"),fo=Symbol.for("react.profiler"),Qc=Symbol.for("react.provider"),Jc=Symbol.for("react.context"),_l=Symbol.for("react.forward_ref"),_o=Symbol.for("react.suspense"),po=Symbol.for("react.suspense_list"),pl=Symbol.for("react.memo"),Kt=Symbol.for("react.lazy"),Zc=Symbol.for("react.offscreen"),aa=Symbol.iterator;function ai(e){return e===null||typeof e!="object"?null:(e=aa&&e[aa]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Object.assign,Pn;function gi(e){if(Pn===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Pn=t&&t[1]||""}return`
34
+ `+Pn+e}var Bn=!1;function On(e,t){if(!e||Bn)return"";Bn=!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(d){var i=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){i=d}e.call(t.prototype)}else{try{throw Error()}catch(d){i=d}e()}}catch(d){if(d&&i&&typeof d.stack=="string"){for(var h=d.stack.split(`
35
+ `),_=i.stack.split(`
36
+ `),C=h.length-1,s=_.length-1;1<=C&&0<=s&&h[C]!==_[s];)s--;for(;1<=C&&0<=s;C--,s--)if(h[C]!==_[s]){if(C!==1||s!==1)do if(C--,s--,0>s||h[C]!==_[s]){var a=`
37
+ `+h[C].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=C&&0<=s);break}}}finally{Bn=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?gi(e):""}function $f(e){switch(e.tag){case 5:return gi(e.type);case 16:return gi("Lazy");case 13:return gi("Suspense");case 19:return gi("SuspenseList");case 0:case 2:case 15:return e=On(e.type,!1),e;case 11:return e=On(e.type.render,!1),e;case 1:return e=On(e.type,!0),e;default:return""}}function vo(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 Br:return"Fragment";case Pr:return"Portal";case fo:return"Profiler";case fl:return"StrictMode";case _o:return"Suspense";case po:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Jc:return(e.displayName||"Context")+".Consumer";case Qc:return(e._context.displayName||"Context")+".Provider";case _l:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case pl:return t=e.displayName||null,t!==null?t:vo(e.type)||"Memo";case Kt:t=e._payload,e=e._init;try{return vo(e(t))}catch{}}return null}function zf(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 vo(t);case 8:return t===fl?"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 lr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function eh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Uf(e){var t=eh(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 h=r.get,_=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return h.call(this)},set:function(C){i=""+C,_.call(this,C)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(C){i=""+C},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function as(e){e._valueTracker||(e._valueTracker=Uf(e))}function th(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=eh(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function Fs(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 go(e,t){var r=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function ca(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=lr(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 rh(e,t){t=t.checked,t!=null&&dl(e,"checked",t,!1)}function mo(e,t){rh(e,t);var r=lr(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")?yo(e,t.type,r):t.hasOwnProperty("defaultValue")&&yo(e,t.type,lr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ha(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 yo(e,t,r){(t!=="number"||Fs(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var mi=Array.isArray;function Kr(e,t,r,i){if(e=e.options,t){t={};for(var h=0;h<r.length;h++)t["$"+r[h]]=!0;for(r=0;r<e.length;r++)h=t.hasOwnProperty("$"+e[r].value),e[r].selected!==h&&(e[r].selected=h),h&&i&&(e[r].defaultSelected=!0)}else{for(r=""+lr(r),t=null,h=0;h<e.length;h++){if(e[h].value===r){e[h].selected=!0,i&&(e[h].defaultSelected=!0);return}t!==null||e[h].disabled||(t=e[h])}t!==null&&(t.selected=!0)}}function Co(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Y(91));return Ee({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ua(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(Y(92));if(mi(r)){if(1<r.length)throw Error(Y(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:lr(r)}}function ih(e,t){var r=lr(t.value),i=lr(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 da(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function sh(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 So(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?sh(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var cs,nh=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,h){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,h)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(cs=cs||document.createElement("div"),cs.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=cs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Bi(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var xi={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},Wf=["Webkit","ms","Moz","O"];Object.keys(xi).forEach(function(e){Wf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xi[t]=xi[e]})});function oh(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||xi.hasOwnProperty(e)&&xi[e]?(""+t).trim():t+"px"}function lh(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,h=oh(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,h):e[r]=h}}var Vf=Ee({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 wo(e,t){if(t){if(Vf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Y(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Y(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Y(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Y(62))}}function xo(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 bo=null;function vl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Eo=null,Gr=null,qr=null;function fa(e){if(e=es(e)){if(typeof Eo!="function")throw Error(Y(280));var t=e.stateNode;t&&(t=mn(t),Eo(e.stateNode,e.type,t))}}function ah(e){Gr?qr?qr.push(e):qr=[e]:Gr=e}function ch(){if(Gr){var e=Gr,t=qr;if(qr=Gr=null,fa(e),t)for(e=0;e<t.length;e++)fa(t[e])}}function hh(e,t){return e(t)}function uh(){}var In=!1;function dh(e,t,r){if(In)return e(t,r);In=!0;try{return hh(e,t,r)}finally{In=!1,(Gr!==null||qr!==null)&&(uh(),ch())}}function Oi(e,t){var r=e.stateNode;if(r===null)return null;var i=mn(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(Y(231,t,typeof r));return r}var Lo=!1;if(Ht)try{var ci={};Object.defineProperty(ci,"passive",{get:function(){Lo=!0}}),window.addEventListener("test",ci,ci),window.removeEventListener("test",ci,ci)}catch{Lo=!1}function Kf(e,t,r,i,h,_,C,s,a){var d=Array.prototype.slice.call(arguments,3);try{t.apply(r,d)}catch(g){this.onError(g)}}var bi=!1,js=null,Hs=!1,ko=null,Gf={onError:function(e){bi=!0,js=e}};function qf(e,t,r,i,h,_,C,s,a){bi=!1,js=null,Kf.apply(Gf,arguments)}function Xf(e,t,r,i,h,_,C,s,a){if(qf.apply(this,arguments),bi){if(bi){var d=js;bi=!1,js=null}else throw Error(Y(198));Hs||(Hs=!0,ko=d)}}function kr(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 fh(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 _a(e){if(kr(e)!==e)throw Error(Y(188))}function Yf(e){var t=e.alternate;if(!t){if(t=kr(e),t===null)throw Error(Y(188));return t!==e?null:e}for(var r=e,i=t;;){var h=r.return;if(h===null)break;var _=h.alternate;if(_===null){if(i=h.return,i!==null){r=i;continue}break}if(h.child===_.child){for(_=h.child;_;){if(_===r)return _a(h),e;if(_===i)return _a(h),t;_=_.sibling}throw Error(Y(188))}if(r.return!==i.return)r=h,i=_;else{for(var C=!1,s=h.child;s;){if(s===r){C=!0,r=h,i=_;break}if(s===i){C=!0,i=h,r=_;break}s=s.sibling}if(!C){for(s=_.child;s;){if(s===r){C=!0,r=_,i=h;break}if(s===i){C=!0,i=_,r=h;break}s=s.sibling}if(!C)throw Error(Y(189))}}if(r.alternate!==i)throw Error(Y(190))}if(r.tag!==3)throw Error(Y(188));return r.stateNode.current===r?e:t}function _h(e){return e=Yf(e),e!==null?ph(e):null}function ph(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ph(e);if(t!==null)return t;e=e.sibling}return null}var vh=ht.unstable_scheduleCallback,pa=ht.unstable_cancelCallback,Qf=ht.unstable_shouldYield,Jf=ht.unstable_requestPaint,ke=ht.unstable_now,Zf=ht.unstable_getCurrentPriorityLevel,gl=ht.unstable_ImmediatePriority,gh=ht.unstable_UserBlockingPriority,$s=ht.unstable_NormalPriority,e_=ht.unstable_LowPriority,mh=ht.unstable_IdlePriority,_n=null,Tt=null;function t_(e){if(Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(_n,e,void 0,(e.current.flags&128)===128)}catch{}}var bt=Math.clz32?Math.clz32:s_,r_=Math.log,i_=Math.LN2;function s_(e){return e>>>=0,e===0?32:31-(r_(e)/i_|0)|0}var hs=64,us=4194304;function yi(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 zs(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,h=e.suspendedLanes,_=e.pingedLanes,C=r&268435455;if(C!==0){var s=C&~h;s!==0?i=yi(s):(_&=C,_!==0&&(i=yi(_)))}else C=r&~h,C!==0?i=yi(C):_!==0&&(i=yi(_));if(i===0)return 0;if(t!==0&&t!==i&&!(t&h)&&(h=i&-i,_=t&-t,h>=_||h===16&&(_&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-bt(t),h=1<<r,i|=e[r],t&=~h;return i}function n_(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 o_(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,h=e.expirationTimes,_=e.pendingLanes;0<_;){var C=31-bt(_),s=1<<C,a=h[C];a===-1?(!(s&r)||s&i)&&(h[C]=n_(s,t)):a<=t&&(e.expiredLanes|=s),_&=~s}}function Ro(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function yh(){var e=hs;return hs<<=1,!(hs&4194240)&&(hs=64),e}function Nn(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ji(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-bt(t),e[t]=r}function l_(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 h=31-bt(r),_=1<<h;t[h]=0,i[h]=-1,e[h]=-1,r&=~_}}function ml(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-bt(r),h=1<<i;h&t|e[i]&t&&(e[i]|=t),r&=~h}}var pe=0;function Ch(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Sh,yl,wh,xh,bh,Do=!1,ds=[],Jt=null,Zt=null,er=null,Ii=new Map,Ni=new Map,qt=[],a_="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 va(e,t){switch(e){case"focusin":case"focusout":Jt=null;break;case"dragenter":case"dragleave":Zt=null;break;case"mouseover":case"mouseout":er=null;break;case"pointerover":case"pointerout":Ii.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ni.delete(t.pointerId)}}function hi(e,t,r,i,h,_){return e===null||e.nativeEvent!==_?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:_,targetContainers:[h]},t!==null&&(t=es(t),t!==null&&yl(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,h!==null&&t.indexOf(h)===-1&&t.push(h),e)}function c_(e,t,r,i,h){switch(t){case"focusin":return Jt=hi(Jt,e,t,r,i,h),!0;case"dragenter":return Zt=hi(Zt,e,t,r,i,h),!0;case"mouseover":return er=hi(er,e,t,r,i,h),!0;case"pointerover":var _=h.pointerId;return Ii.set(_,hi(Ii.get(_)||null,e,t,r,i,h)),!0;case"gotpointercapture":return _=h.pointerId,Ni.set(_,hi(Ni.get(_)||null,e,t,r,i,h)),!0}return!1}function Eh(e){var t=pr(e.target);if(t!==null){var r=kr(t);if(r!==null){if(t=r.tag,t===13){if(t=fh(r),t!==null){e.blockedOn=t,bh(e.priority,function(){wh(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 Rs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Ao(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);bo=i,r.target.dispatchEvent(i),bo=null}else return t=es(r),t!==null&&yl(t),e.blockedOn=r,!1;t.shift()}return!0}function ga(e,t,r){Rs(e)&&r.delete(t)}function h_(){Do=!1,Jt!==null&&Rs(Jt)&&(Jt=null),Zt!==null&&Rs(Zt)&&(Zt=null),er!==null&&Rs(er)&&(er=null),Ii.forEach(ga),Ni.forEach(ga)}function ui(e,t){e.blockedOn===t&&(e.blockedOn=null,Do||(Do=!0,ht.unstable_scheduleCallback(ht.unstable_NormalPriority,h_)))}function Fi(e){function t(h){return ui(h,e)}if(0<ds.length){ui(ds[0],e);for(var r=1;r<ds.length;r++){var i=ds[r];i.blockedOn===e&&(i.blockedOn=null)}}for(Jt!==null&&ui(Jt,e),Zt!==null&&ui(Zt,e),er!==null&&ui(er,e),Ii.forEach(t),Ni.forEach(t),r=0;r<qt.length;r++)i=qt[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<qt.length&&(r=qt[0],r.blockedOn===null);)Eh(r),r.blockedOn===null&&qt.shift()}var Xr=Wt.ReactCurrentBatchConfig,Us=!0;function u_(e,t,r,i){var h=pe,_=Xr.transition;Xr.transition=null;try{pe=1,Cl(e,t,r,i)}finally{pe=h,Xr.transition=_}}function d_(e,t,r,i){var h=pe,_=Xr.transition;Xr.transition=null;try{pe=4,Cl(e,t,r,i)}finally{pe=h,Xr.transition=_}}function Cl(e,t,r,i){if(Us){var h=Ao(e,t,r,i);if(h===null)Gn(e,t,i,Ws,r),va(e,i);else if(c_(h,e,t,r,i))i.stopPropagation();else if(va(e,i),t&4&&-1<a_.indexOf(e)){for(;h!==null;){var _=es(h);if(_!==null&&Sh(_),_=Ao(e,t,r,i),_===null&&Gn(e,t,i,Ws,r),_===h)break;h=_}h!==null&&i.stopPropagation()}else Gn(e,t,i,null,r)}}var Ws=null;function Ao(e,t,r,i){if(Ws=null,e=vl(i),e=pr(e),e!==null)if(t=kr(e),t===null)e=null;else if(r=t.tag,r===13){if(e=fh(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ws=e,null}function Lh(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(Zf()){case gl:return 1;case gh:return 4;case $s:case e_:return 16;case mh:return 536870912;default:return 16}default:return 16}}var Yt=null,Sl=null,Ds=null;function kh(){if(Ds)return Ds;var e,t=Sl,r=t.length,i,h="value"in Yt?Yt.value:Yt.textContent,_=h.length;for(e=0;e<r&&t[e]===h[e];e++);var C=r-e;for(i=1;i<=C&&t[r-i]===h[_-i];i++);return Ds=h.slice(e,1<i?1-i:void 0)}function As(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 fs(){return!0}function ma(){return!1}function dt(e){function t(r,i,h,_,C){this._reactName=r,this._targetInst=h,this.type=i,this.nativeEvent=_,this.target=C,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(r=e[s],this[s]=r?r(_):_[s]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?fs:ma,this.isPropagationStopped=ma,this}return Ee(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=fs)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=fs)},persist:function(){},isPersistent:fs}),t}var oi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wl=dt(oi),Zi=Ee({},oi,{view:0,detail:0}),f_=dt(Zi),Fn,jn,di,pn=Ee({},Zi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xl,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!==di&&(di&&e.type==="mousemove"?(Fn=e.screenX-di.screenX,jn=e.screenY-di.screenY):jn=Fn=0,di=e),Fn)},movementY:function(e){return"movementY"in e?e.movementY:jn}}),ya=dt(pn),__=Ee({},pn,{dataTransfer:0}),p_=dt(__),v_=Ee({},Zi,{relatedTarget:0}),Hn=dt(v_),g_=Ee({},oi,{animationName:0,elapsedTime:0,pseudoElement:0}),m_=dt(g_),y_=Ee({},oi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),C_=dt(y_),S_=Ee({},oi,{data:0}),Ca=dt(S_),w_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},x_={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"},b_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function E_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=b_[e])?!!t[e]:!1}function xl(){return E_}var L_=Ee({},Zi,{key:function(e){if(e.key){var t=w_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=As(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?x_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xl,charCode:function(e){return e.type==="keypress"?As(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?As(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),k_=dt(L_),R_=Ee({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sa=dt(R_),D_=Ee({},Zi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xl}),A_=dt(D_),T_=Ee({},oi,{propertyName:0,elapsedTime:0,pseudoElement:0}),M_=dt(T_),P_=Ee({},pn,{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}),B_=dt(P_),O_=[9,13,27,32],bl=Ht&&"CompositionEvent"in window,Ei=null;Ht&&"documentMode"in document&&(Ei=document.documentMode);var I_=Ht&&"TextEvent"in window&&!Ei,Rh=Ht&&(!bl||Ei&&8<Ei&&11>=Ei),wa=" ",xa=!1;function Dh(e,t){switch(e){case"keyup":return O_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ah(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Or=!1;function N_(e,t){switch(e){case"compositionend":return Ah(t);case"keypress":return t.which!==32?null:(xa=!0,wa);case"textInput":return e=t.data,e===wa&&xa?null:e;default:return null}}function F_(e,t){if(Or)return e==="compositionend"||!bl&&Dh(e,t)?(e=kh(),Ds=Sl=Yt=null,Or=!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 Rh&&t.locale!=="ko"?null:t.data;default:return null}}var j_={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 ba(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!j_[e.type]:t==="textarea"}function Th(e,t,r,i){ah(i),t=Vs(t,"onChange"),0<t.length&&(r=new wl("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var Li=null,ji=null;function H_(e){zh(e,0)}function vn(e){var t=Fr(e);if(th(t))return e}function $_(e,t){if(e==="change")return t}var Mh=!1;if(Ht){var $n;if(Ht){var zn="oninput"in document;if(!zn){var Ea=document.createElement("div");Ea.setAttribute("oninput","return;"),zn=typeof Ea.oninput=="function"}$n=zn}else $n=!1;Mh=$n&&(!document.documentMode||9<document.documentMode)}function La(){Li&&(Li.detachEvent("onpropertychange",Ph),ji=Li=null)}function Ph(e){if(e.propertyName==="value"&&vn(ji)){var t=[];Th(t,ji,e,vl(e)),dh(H_,t)}}function z_(e,t,r){e==="focusin"?(La(),Li=t,ji=r,Li.attachEvent("onpropertychange",Ph)):e==="focusout"&&La()}function U_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return vn(ji)}function W_(e,t){if(e==="click")return vn(t)}function V_(e,t){if(e==="input"||e==="change")return vn(t)}function K_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Lt=typeof Object.is=="function"?Object.is:K_;function Hi(e,t){if(Lt(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 h=r[i];if(!uo.call(t,h)||!Lt(e[h],t[h]))return!1}return!0}function ka(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ra(e,t){var r=ka(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=ka(r)}}function Bh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Oh(){for(var e=window,t=Fs();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Fs(e.document)}return t}function El(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 G_(e){var t=Oh(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Bh(r.ownerDocument.documentElement,r)){if(i!==null&&El(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 h=r.textContent.length,_=Math.min(i.start,h);i=i.end===void 0?_:Math.min(i.end,h),!e.extend&&_>i&&(h=i,i=_,_=h),h=Ra(r,_);var C=Ra(r,i);h&&C&&(e.rangeCount!==1||e.anchorNode!==h.node||e.anchorOffset!==h.offset||e.focusNode!==C.node||e.focusOffset!==C.offset)&&(t=t.createRange(),t.setStart(h.node,h.offset),e.removeAllRanges(),_>i?(e.addRange(t),e.extend(C.node,C.offset)):(t.setEnd(C.node,C.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 q_=Ht&&"documentMode"in document&&11>=document.documentMode,Ir=null,To=null,ki=null,Mo=!1;function Da(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Mo||Ir==null||Ir!==Fs(i)||(i=Ir,"selectionStart"in i&&El(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}),ki&&Hi(ki,i)||(ki=i,i=Vs(To,"onSelect"),0<i.length&&(t=new wl("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=Ir)))}function _s(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Nr={animationend:_s("Animation","AnimationEnd"),animationiteration:_s("Animation","AnimationIteration"),animationstart:_s("Animation","AnimationStart"),transitionend:_s("Transition","TransitionEnd")},Un={},Ih={};Ht&&(Ih=document.createElement("div").style,"AnimationEvent"in window||(delete Nr.animationend.animation,delete Nr.animationiteration.animation,delete Nr.animationstart.animation),"TransitionEvent"in window||delete Nr.transitionend.transition);function gn(e){if(Un[e])return Un[e];if(!Nr[e])return e;var t=Nr[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Ih)return Un[e]=t[r];return e}var Nh=gn("animationend"),Fh=gn("animationiteration"),jh=gn("animationstart"),Hh=gn("transitionend"),$h=new Map,Aa="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 cr(e,t){$h.set(e,t),Lr(t,[e])}for(var Wn=0;Wn<Aa.length;Wn++){var Vn=Aa[Wn],X_=Vn.toLowerCase(),Y_=Vn[0].toUpperCase()+Vn.slice(1);cr(X_,"on"+Y_)}cr(Nh,"onAnimationEnd");cr(Fh,"onAnimationIteration");cr(jh,"onAnimationStart");cr("dblclick","onDoubleClick");cr("focusin","onFocus");cr("focusout","onBlur");cr(Hh,"onTransitionEnd");Jr("onMouseEnter",["mouseout","mouseover"]);Jr("onMouseLeave",["mouseout","mouseover"]);Jr("onPointerEnter",["pointerout","pointerover"]);Jr("onPointerLeave",["pointerout","pointerover"]);Lr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Lr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Lr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Lr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Lr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Lr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ci="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(" "),Q_=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ci));function Ta(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,Xf(i,t,void 0,e),e.currentTarget=null}function zh(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],h=i.event;i=i.listeners;e:{var _=void 0;if(t)for(var C=i.length-1;0<=C;C--){var s=i[C],a=s.instance,d=s.currentTarget;if(s=s.listener,a!==_&&h.isPropagationStopped())break e;Ta(h,s,d),_=a}else for(C=0;C<i.length;C++){if(s=i[C],a=s.instance,d=s.currentTarget,s=s.listener,a!==_&&h.isPropagationStopped())break e;Ta(h,s,d),_=a}}}if(Hs)throw e=ko,Hs=!1,ko=null,e}function Ce(e,t){var r=t[No];r===void 0&&(r=t[No]=new Set);var i=e+"__bubble";r.has(i)||(Uh(t,e,2,!1),r.add(i))}function Kn(e,t,r){var i=0;t&&(i|=4),Uh(r,e,i,t)}var ps="_reactListening"+Math.random().toString(36).slice(2);function $i(e){if(!e[ps]){e[ps]=!0,Yc.forEach(function(r){r!=="selectionchange"&&(Q_.has(r)||Kn(r,!1,e),Kn(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ps]||(t[ps]=!0,Kn("selectionchange",!1,t))}}function Uh(e,t,r,i){switch(Lh(t)){case 1:var h=u_;break;case 4:h=d_;break;default:h=Cl}r=h.bind(null,t,r,e),h=void 0,!Lo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(h=!0),i?h!==void 0?e.addEventListener(t,r,{capture:!0,passive:h}):e.addEventListener(t,r,!0):h!==void 0?e.addEventListener(t,r,{passive:h}):e.addEventListener(t,r,!1)}function Gn(e,t,r,i,h){var _=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var C=i.tag;if(C===3||C===4){var s=i.stateNode.containerInfo;if(s===h||s.nodeType===8&&s.parentNode===h)break;if(C===4)for(C=i.return;C!==null;){var a=C.tag;if((a===3||a===4)&&(a=C.stateNode.containerInfo,a===h||a.nodeType===8&&a.parentNode===h))return;C=C.return}for(;s!==null;){if(C=pr(s),C===null)return;if(a=C.tag,a===5||a===6){i=_=C;continue e}s=s.parentNode}}i=i.return}dh(function(){var d=_,g=vl(r),u=[];e:{var v=$h.get(e);if(v!==void 0){var w=wl,S=e;switch(e){case"keypress":if(As(r)===0)break e;case"keydown":case"keyup":w=k_;break;case"focusin":S="focus",w=Hn;break;case"focusout":S="blur",w=Hn;break;case"beforeblur":case"afterblur":w=Hn;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":w=ya;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":w=p_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":w=A_;break;case Nh:case Fh:case jh:w=m_;break;case Hh:w=M_;break;case"scroll":w=f_;break;case"wheel":w=B_;break;case"copy":case"cut":case"paste":w=C_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":w=Sa}var f=(t&4)!==0,n=!f&&e==="scroll",o=f?v!==null?v+"Capture":null:v;f=[];for(var l=d,c;l!==null;){c=l;var m=c.stateNode;if(c.tag===5&&m!==null&&(c=m,o!==null&&(m=Oi(l,o),m!=null&&f.push(zi(l,m,c)))),n)break;l=l.return}0<f.length&&(v=new w(v,S,null,r,g),u.push({event:v,listeners:f}))}}if(!(t&7)){e:{if(v=e==="mouseover"||e==="pointerover",w=e==="mouseout"||e==="pointerout",v&&r!==bo&&(S=r.relatedTarget||r.fromElement)&&(pr(S)||S[$t]))break e;if((w||v)&&(v=g.window===g?g:(v=g.ownerDocument)?v.defaultView||v.parentWindow:window,w?(S=r.relatedTarget||r.toElement,w=d,S=S?pr(S):null,S!==null&&(n=kr(S),S!==n||S.tag!==5&&S.tag!==6)&&(S=null)):(w=null,S=d),w!==S)){if(f=ya,m="onMouseLeave",o="onMouseEnter",l="mouse",(e==="pointerout"||e==="pointerover")&&(f=Sa,m="onPointerLeave",o="onPointerEnter",l="pointer"),n=w==null?v:Fr(w),c=S==null?v:Fr(S),v=new f(m,l+"leave",w,r,g),v.target=n,v.relatedTarget=c,m=null,pr(g)===d&&(f=new f(o,l+"enter",S,r,g),f.target=c,f.relatedTarget=n,m=f),n=m,w&&S)t:{for(f=w,o=S,l=0,c=f;c;c=Tr(c))l++;for(c=0,m=o;m;m=Tr(m))c++;for(;0<l-c;)f=Tr(f),l--;for(;0<c-l;)o=Tr(o),c--;for(;l--;){if(f===o||o!==null&&f===o.alternate)break t;f=Tr(f),o=Tr(o)}f=null}else f=null;w!==null&&Ma(u,v,w,f,!1),S!==null&&n!==null&&Ma(u,n,S,f,!0)}}e:{if(v=d?Fr(d):window,w=v.nodeName&&v.nodeName.toLowerCase(),w==="select"||w==="input"&&v.type==="file")var y=$_;else if(ba(v))if(Mh)y=V_;else{y=U_;var b=z_}else(w=v.nodeName)&&w.toLowerCase()==="input"&&(v.type==="checkbox"||v.type==="radio")&&(y=W_);if(y&&(y=y(e,d))){Th(u,y,r,g);break e}b&&b(e,v,d),e==="focusout"&&(b=v._wrapperState)&&b.controlled&&v.type==="number"&&yo(v,"number",v.value)}switch(b=d?Fr(d):window,e){case"focusin":(ba(b)||b.contentEditable==="true")&&(Ir=b,To=d,ki=null);break;case"focusout":ki=To=Ir=null;break;case"mousedown":Mo=!0;break;case"contextmenu":case"mouseup":case"dragend":Mo=!1,Da(u,r,g);break;case"selectionchange":if(q_)break;case"keydown":case"keyup":Da(u,r,g)}var E;if(bl)e:{switch(e){case"compositionstart":var p="onCompositionStart";break e;case"compositionend":p="onCompositionEnd";break e;case"compositionupdate":p="onCompositionUpdate";break e}p=void 0}else Or?Dh(e,r)&&(p="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(p="onCompositionStart");p&&(Rh&&r.locale!=="ko"&&(Or||p!=="onCompositionStart"?p==="onCompositionEnd"&&Or&&(E=kh()):(Yt=g,Sl="value"in Yt?Yt.value:Yt.textContent,Or=!0)),b=Vs(d,p),0<b.length&&(p=new Ca(p,e,null,r,g),u.push({event:p,listeners:b}),E?p.data=E:(E=Ah(r),E!==null&&(p.data=E)))),(E=I_?N_(e,r):F_(e,r))&&(d=Vs(d,"onBeforeInput"),0<d.length&&(g=new Ca("onBeforeInput","beforeinput",null,r,g),u.push({event:g,listeners:d}),g.data=E))}zh(u,t)})}function zi(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Vs(e,t){for(var r=t+"Capture",i=[];e!==null;){var h=e,_=h.stateNode;h.tag===5&&_!==null&&(h=_,_=Oi(e,r),_!=null&&i.unshift(zi(e,_,h)),_=Oi(e,t),_!=null&&i.push(zi(e,_,h))),e=e.return}return i}function Tr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ma(e,t,r,i,h){for(var _=t._reactName,C=[];r!==null&&r!==i;){var s=r,a=s.alternate,d=s.stateNode;if(a!==null&&a===i)break;s.tag===5&&d!==null&&(s=d,h?(a=Oi(r,_),a!=null&&C.unshift(zi(r,a,s))):h||(a=Oi(r,_),a!=null&&C.push(zi(r,a,s)))),r=r.return}C.length!==0&&e.push({event:t,listeners:C})}var J_=/\r\n?/g,Z_=/\u0000|\uFFFD/g;function Pa(e){return(typeof e=="string"?e:""+e).replace(J_,`
38
+ `).replace(Z_,"")}function vs(e,t,r){if(t=Pa(t),Pa(e)!==t&&r)throw Error(Y(425))}function Ks(){}var Po=null,Bo=null;function Oo(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 Io=typeof setTimeout=="function"?setTimeout:void 0,ep=typeof clearTimeout=="function"?clearTimeout:void 0,Ba=typeof Promise=="function"?Promise:void 0,tp=typeof queueMicrotask=="function"?queueMicrotask:typeof Ba<"u"?function(e){return Ba.resolve(null).then(e).catch(rp)}:Io;function rp(e){setTimeout(function(){throw e})}function qn(e,t){var r=t,i=0;do{var h=r.nextSibling;if(e.removeChild(r),h&&h.nodeType===8)if(r=h.data,r==="/$"){if(i===0){e.removeChild(h),Fi(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=h}while(r);Fi(t)}function tr(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 Oa(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 li=Math.random().toString(36).slice(2),At="__reactFiber$"+li,Ui="__reactProps$"+li,$t="__reactContainer$"+li,No="__reactEvents$"+li,ip="__reactListeners$"+li,sp="__reactHandles$"+li;function pr(e){var t=e[At];if(t)return t;for(var r=e.parentNode;r;){if(t=r[$t]||r[At]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Oa(e);e!==null;){if(r=e[At])return r;e=Oa(e)}return t}e=r,r=e.parentNode}return null}function es(e){return e=e[At]||e[$t],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Fr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Y(33))}function mn(e){return e[Ui]||null}var Fo=[],jr=-1;function hr(e){return{current:e}}function Se(e){0>jr||(e.current=Fo[jr],Fo[jr]=null,jr--)}function me(e,t){jr++,Fo[jr]=e.current,e.current=t}var ar={},Ve=hr(ar),tt=hr(!1),Sr=ar;function Zr(e,t){var r=e.type.contextTypes;if(!r)return ar;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var h={},_;for(_ in r)h[_]=t[_];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=h),h}function rt(e){return e=e.childContextTypes,e!=null}function Gs(){Se(tt),Se(Ve)}function Ia(e,t,r){if(Ve.current!==ar)throw Error(Y(168));me(Ve,t),me(tt,r)}function Wh(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var h in i)if(!(h in t))throw Error(Y(108,zf(e)||"Unknown",h));return Ee({},r,i)}function qs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ar,Sr=Ve.current,me(Ve,e),me(tt,tt.current),!0}function Na(e,t,r){var i=e.stateNode;if(!i)throw Error(Y(169));r?(e=Wh(e,t,Sr),i.__reactInternalMemoizedMergedChildContext=e,Se(tt),Se(Ve),me(Ve,e)):Se(tt),me(tt,r)}var It=null,yn=!1,Xn=!1;function Vh(e){It===null?It=[e]:It.push(e)}function np(e){yn=!0,Vh(e)}function ur(){if(!Xn&&It!==null){Xn=!0;var e=0,t=pe;try{var r=It;for(pe=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}It=null,yn=!1}catch(h){throw It!==null&&(It=It.slice(e+1)),vh(gl,ur),h}finally{pe=t,Xn=!1}}return null}var Hr=[],$r=0,Xs=null,Ys=0,ft=[],_t=0,wr=null,Nt=1,Ft="";function fr(e,t){Hr[$r++]=Ys,Hr[$r++]=Xs,Xs=e,Ys=t}function Kh(e,t,r){ft[_t++]=Nt,ft[_t++]=Ft,ft[_t++]=wr,wr=e;var i=Nt;e=Ft;var h=32-bt(i)-1;i&=~(1<<h),r+=1;var _=32-bt(t)+h;if(30<_){var C=h-h%5;_=(i&(1<<C)-1).toString(32),i>>=C,h-=C,Nt=1<<32-bt(t)+h|r<<h|i,Ft=_+e}else Nt=1<<_|r<<h|i,Ft=e}function Ll(e){e.return!==null&&(fr(e,1),Kh(e,1,0))}function kl(e){for(;e===Xs;)Xs=Hr[--$r],Hr[$r]=null,Ys=Hr[--$r],Hr[$r]=null;for(;e===wr;)wr=ft[--_t],ft[_t]=null,Ft=ft[--_t],ft[_t]=null,Nt=ft[--_t],ft[_t]=null}var ct=null,at=null,we=!1,xt=null;function Gh(e,t){var r=pt(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 Fa(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,ct=e,at=tr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ct=e,at=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=wr!==null?{id:Nt,overflow:Ft}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=pt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,ct=e,at=null,!0):!1;default:return!1}}function jo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ho(e){if(we){var t=at;if(t){var r=t;if(!Fa(e,t)){if(jo(e))throw Error(Y(418));t=tr(r.nextSibling);var i=ct;t&&Fa(e,t)?Gh(i,r):(e.flags=e.flags&-4097|2,we=!1,ct=e)}}else{if(jo(e))throw Error(Y(418));e.flags=e.flags&-4097|2,we=!1,ct=e}}}function ja(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ct=e}function gs(e){if(e!==ct)return!1;if(!we)return ja(e),we=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Oo(e.type,e.memoizedProps)),t&&(t=at)){if(jo(e))throw qh(),Error(Y(418));for(;t;)Gh(e,t),t=tr(t.nextSibling)}if(ja(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Y(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){at=tr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}at=null}}else at=ct?tr(e.stateNode.nextSibling):null;return!0}function qh(){for(var e=at;e;)e=tr(e.nextSibling)}function ei(){at=ct=null,we=!1}function Rl(e){xt===null?xt=[e]:xt.push(e)}var op=Wt.ReactCurrentBatchConfig;function fi(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(Y(309));var i=r.stateNode}if(!i)throw Error(Y(147,e));var h=i,_=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===_?t.ref:(t=function(C){var s=h.refs;C===null?delete s[_]:s[_]=C},t._stringRef=_,t)}if(typeof e!="string")throw Error(Y(284));if(!r._owner)throw Error(Y(290,e))}return e}function ms(e,t){throw e=Object.prototype.toString.call(t),Error(Y(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ha(e){var t=e._init;return t(e._payload)}function Xh(e){function t(o,l){if(e){var c=o.deletions;c===null?(o.deletions=[l],o.flags|=16):c.push(l)}}function r(o,l){if(!e)return null;for(;l!==null;)t(o,l),l=l.sibling;return null}function i(o,l){for(o=new Map;l!==null;)l.key!==null?o.set(l.key,l):o.set(l.index,l),l=l.sibling;return o}function h(o,l){return o=nr(o,l),o.index=0,o.sibling=null,o}function _(o,l,c){return o.index=c,e?(c=o.alternate,c!==null?(c=c.index,c<l?(o.flags|=2,l):c):(o.flags|=2,l)):(o.flags|=1048576,l)}function C(o){return e&&o.alternate===null&&(o.flags|=2),o}function s(o,l,c,m){return l===null||l.tag!==6?(l=ro(c,o.mode,m),l.return=o,l):(l=h(l,c),l.return=o,l)}function a(o,l,c,m){var y=c.type;return y===Br?g(o,l,c.props.children,m,c.key):l!==null&&(l.elementType===y||typeof y=="object"&&y!==null&&y.$$typeof===Kt&&Ha(y)===l.type)?(m=h(l,c.props),m.ref=fi(o,l,c),m.return=o,m):(m=Ns(c.type,c.key,c.props,null,o.mode,m),m.ref=fi(o,l,c),m.return=o,m)}function d(o,l,c,m){return l===null||l.tag!==4||l.stateNode.containerInfo!==c.containerInfo||l.stateNode.implementation!==c.implementation?(l=io(c,o.mode,m),l.return=o,l):(l=h(l,c.children||[]),l.return=o,l)}function g(o,l,c,m,y){return l===null||l.tag!==7?(l=Cr(c,o.mode,m,y),l.return=o,l):(l=h(l,c),l.return=o,l)}function u(o,l,c){if(typeof l=="string"&&l!==""||typeof l=="number")return l=ro(""+l,o.mode,c),l.return=o,l;if(typeof l=="object"&&l!==null){switch(l.$$typeof){case ls:return c=Ns(l.type,l.key,l.props,null,o.mode,c),c.ref=fi(o,null,l),c.return=o,c;case Pr:return l=io(l,o.mode,c),l.return=o,l;case Kt:var m=l._init;return u(o,m(l._payload),c)}if(mi(l)||ai(l))return l=Cr(l,o.mode,c,null),l.return=o,l;ms(o,l)}return null}function v(o,l,c,m){var y=l!==null?l.key:null;if(typeof c=="string"&&c!==""||typeof c=="number")return y!==null?null:s(o,l,""+c,m);if(typeof c=="object"&&c!==null){switch(c.$$typeof){case ls:return c.key===y?a(o,l,c,m):null;case Pr:return c.key===y?d(o,l,c,m):null;case Kt:return y=c._init,v(o,l,y(c._payload),m)}if(mi(c)||ai(c))return y!==null?null:g(o,l,c,m,null);ms(o,c)}return null}function w(o,l,c,m,y){if(typeof m=="string"&&m!==""||typeof m=="number")return o=o.get(c)||null,s(l,o,""+m,y);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case ls:return o=o.get(m.key===null?c:m.key)||null,a(l,o,m,y);case Pr:return o=o.get(m.key===null?c:m.key)||null,d(l,o,m,y);case Kt:var b=m._init;return w(o,l,c,b(m._payload),y)}if(mi(m)||ai(m))return o=o.get(c)||null,g(l,o,m,y,null);ms(l,m)}return null}function S(o,l,c,m){for(var y=null,b=null,E=l,p=l=0,x=null;E!==null&&p<c.length;p++){E.index>p?(x=E,E=null):x=E.sibling;var D=v(o,E,c[p],m);if(D===null){E===null&&(E=x);break}e&&E&&D.alternate===null&&t(o,E),l=_(D,l,p),b===null?y=D:b.sibling=D,b=D,E=x}if(p===c.length)return r(o,E),we&&fr(o,p),y;if(E===null){for(;p<c.length;p++)E=u(o,c[p],m),E!==null&&(l=_(E,l,p),b===null?y=E:b.sibling=E,b=E);return we&&fr(o,p),y}for(E=i(o,E);p<c.length;p++)x=w(E,o,p,c[p],m),x!==null&&(e&&x.alternate!==null&&E.delete(x.key===null?p:x.key),l=_(x,l,p),b===null?y=x:b.sibling=x,b=x);return e&&E.forEach(function(R){return t(o,R)}),we&&fr(o,p),y}function f(o,l,c,m){var y=ai(c);if(typeof y!="function")throw Error(Y(150));if(c=y.call(c),c==null)throw Error(Y(151));for(var b=y=null,E=l,p=l=0,x=null,D=c.next();E!==null&&!D.done;p++,D=c.next()){E.index>p?(x=E,E=null):x=E.sibling;var R=v(o,E,D.value,m);if(R===null){E===null&&(E=x);break}e&&E&&R.alternate===null&&t(o,E),l=_(R,l,p),b===null?y=R:b.sibling=R,b=R,E=x}if(D.done)return r(o,E),we&&fr(o,p),y;if(E===null){for(;!D.done;p++,D=c.next())D=u(o,D.value,m),D!==null&&(l=_(D,l,p),b===null?y=D:b.sibling=D,b=D);return we&&fr(o,p),y}for(E=i(o,E);!D.done;p++,D=c.next())D=w(E,o,p,D.value,m),D!==null&&(e&&D.alternate!==null&&E.delete(D.key===null?p:D.key),l=_(D,l,p),b===null?y=D:b.sibling=D,b=D);return e&&E.forEach(function(k){return t(o,k)}),we&&fr(o,p),y}function n(o,l,c,m){if(typeof c=="object"&&c!==null&&c.type===Br&&c.key===null&&(c=c.props.children),typeof c=="object"&&c!==null){switch(c.$$typeof){case ls:e:{for(var y=c.key,b=l;b!==null;){if(b.key===y){if(y=c.type,y===Br){if(b.tag===7){r(o,b.sibling),l=h(b,c.props.children),l.return=o,o=l;break e}}else if(b.elementType===y||typeof y=="object"&&y!==null&&y.$$typeof===Kt&&Ha(y)===b.type){r(o,b.sibling),l=h(b,c.props),l.ref=fi(o,b,c),l.return=o,o=l;break e}r(o,b);break}else t(o,b);b=b.sibling}c.type===Br?(l=Cr(c.props.children,o.mode,m,c.key),l.return=o,o=l):(m=Ns(c.type,c.key,c.props,null,o.mode,m),m.ref=fi(o,l,c),m.return=o,o=m)}return C(o);case Pr:e:{for(b=c.key;l!==null;){if(l.key===b)if(l.tag===4&&l.stateNode.containerInfo===c.containerInfo&&l.stateNode.implementation===c.implementation){r(o,l.sibling),l=h(l,c.children||[]),l.return=o,o=l;break e}else{r(o,l);break}else t(o,l);l=l.sibling}l=io(c,o.mode,m),l.return=o,o=l}return C(o);case Kt:return b=c._init,n(o,l,b(c._payload),m)}if(mi(c))return S(o,l,c,m);if(ai(c))return f(o,l,c,m);ms(o,c)}return typeof c=="string"&&c!==""||typeof c=="number"?(c=""+c,l!==null&&l.tag===6?(r(o,l.sibling),l=h(l,c),l.return=o,o=l):(r(o,l),l=ro(c,o.mode,m),l.return=o,o=l),C(o)):r(o,l)}return n}var ti=Xh(!0),Yh=Xh(!1),Qs=hr(null),Js=null,zr=null,Dl=null;function Al(){Dl=zr=Js=null}function Tl(e){var t=Qs.current;Se(Qs),e._currentValue=t}function $o(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 Yr(e,t){Js=e,Dl=zr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(et=!0),e.firstContext=null)}function gt(e){var t=e._currentValue;if(Dl!==e)if(e={context:e,memoizedValue:t,next:null},zr===null){if(Js===null)throw Error(Y(308));zr=e,Js.dependencies={lanes:0,firstContext:e}}else zr=zr.next=e;return t}var vr=null;function Ml(e){vr===null?vr=[e]:vr.push(e)}function Qh(e,t,r,i){var h=t.interleaved;return h===null?(r.next=r,Ml(t)):(r.next=h.next,h.next=r),t.interleaved=r,zt(e,i)}function zt(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 Gt=!1;function Pl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Jh(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 jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function rr(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,de&2){var h=i.pending;return h===null?t.next=t:(t.next=h.next,h.next=t),i.pending=t,zt(e,r)}return h=i.interleaved,h===null?(t.next=t,Ml(i)):(t.next=h.next,h.next=t),i.interleaved=t,zt(e,r)}function Ts(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,ml(e,r)}}function $a(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var h=null,_=null;if(r=r.firstBaseUpdate,r!==null){do{var C={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};_===null?h=_=C:_=_.next=C,r=r.next}while(r!==null);_===null?h=_=t:_=_.next=t}else h=_=t;r={baseState:i.baseState,firstBaseUpdate:h,lastBaseUpdate:_,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 Zs(e,t,r,i){var h=e.updateQueue;Gt=!1;var _=h.firstBaseUpdate,C=h.lastBaseUpdate,s=h.shared.pending;if(s!==null){h.shared.pending=null;var a=s,d=a.next;a.next=null,C===null?_=d:C.next=d,C=a;var g=e.alternate;g!==null&&(g=g.updateQueue,s=g.lastBaseUpdate,s!==C&&(s===null?g.firstBaseUpdate=d:s.next=d,g.lastBaseUpdate=a))}if(_!==null){var u=h.baseState;C=0,g=d=a=null,s=_;do{var v=s.lane,w=s.eventTime;if((i&v)===v){g!==null&&(g=g.next={eventTime:w,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var S=e,f=s;switch(v=t,w=r,f.tag){case 1:if(S=f.payload,typeof S=="function"){u=S.call(w,u,v);break e}u=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=f.payload,v=typeof S=="function"?S.call(w,u,v):S,v==null)break e;u=Ee({},u,v);break e;case 2:Gt=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,v=h.effects,v===null?h.effects=[s]:v.push(s))}else w={eventTime:w,lane:v,tag:s.tag,payload:s.payload,callback:s.callback,next:null},g===null?(d=g=w,a=u):g=g.next=w,C|=v;if(s=s.next,s===null){if(s=h.shared.pending,s===null)break;v=s,s=v.next,v.next=null,h.lastBaseUpdate=v,h.shared.pending=null}}while(!0);if(g===null&&(a=u),h.baseState=a,h.firstBaseUpdate=d,h.lastBaseUpdate=g,t=h.shared.interleaved,t!==null){h=t;do C|=h.lane,h=h.next;while(h!==t)}else _===null&&(h.shared.lanes=0);br|=C,e.lanes=C,e.memoizedState=u}}function za(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],h=i.callback;if(h!==null){if(i.callback=null,i=r,typeof h!="function")throw Error(Y(191,h));h.call(i)}}}var ts={},Mt=hr(ts),Wi=hr(ts),Vi=hr(ts);function gr(e){if(e===ts)throw Error(Y(174));return e}function Bl(e,t){switch(me(Vi,t),me(Wi,e),me(Mt,ts),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:So(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=So(t,e)}Se(Mt),me(Mt,t)}function ri(){Se(Mt),Se(Wi),Se(Vi)}function Zh(e){gr(Vi.current);var t=gr(Mt.current),r=So(t,e.type);t!==r&&(me(Wi,e),me(Mt,r))}function Ol(e){Wi.current===e&&(Se(Mt),Se(Wi))}var xe=hr(0);function en(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 Yn=[];function Il(){for(var e=0;e<Yn.length;e++)Yn[e]._workInProgressVersionPrimary=null;Yn.length=0}var Ms=Wt.ReactCurrentDispatcher,Qn=Wt.ReactCurrentBatchConfig,xr=0,be=null,Ae=null,Me=null,tn=!1,Ri=!1,Ki=0,lp=0;function ze(){throw Error(Y(321))}function Nl(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Lt(e[r],t[r]))return!1;return!0}function Fl(e,t,r,i,h,_){if(xr=_,be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ms.current=e===null||e.memoizedState===null?up:dp,e=r(i,h),Ri){_=0;do{if(Ri=!1,Ki=0,25<=_)throw Error(Y(301));_+=1,Me=Ae=null,t.updateQueue=null,Ms.current=fp,e=r(i,h)}while(Ri)}if(Ms.current=rn,t=Ae!==null&&Ae.next!==null,xr=0,Me=Ae=be=null,tn=!1,t)throw Error(Y(300));return e}function jl(){var e=Ki!==0;return Ki=0,e}function Dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Me===null?be.memoizedState=Me=e:Me=Me.next=e,Me}function mt(){if(Ae===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=Ae.next;var t=Me===null?be.memoizedState:Me.next;if(t!==null)Me=t,Ae=e;else{if(e===null)throw Error(Y(310));Ae=e,e={memoizedState:Ae.memoizedState,baseState:Ae.baseState,baseQueue:Ae.baseQueue,queue:Ae.queue,next:null},Me===null?be.memoizedState=Me=e:Me=Me.next=e}return Me}function Gi(e,t){return typeof t=="function"?t(e):t}function Jn(e){var t=mt(),r=t.queue;if(r===null)throw Error(Y(311));r.lastRenderedReducer=e;var i=Ae,h=i.baseQueue,_=r.pending;if(_!==null){if(h!==null){var C=h.next;h.next=_.next,_.next=C}i.baseQueue=h=_,r.pending=null}if(h!==null){_=h.next,i=i.baseState;var s=C=null,a=null,d=_;do{var g=d.lane;if((xr&g)===g)a!==null&&(a=a.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),i=d.hasEagerState?d.eagerState:e(i,d.action);else{var u={lane:g,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};a===null?(s=a=u,C=i):a=a.next=u,be.lanes|=g,br|=g}d=d.next}while(d!==null&&d!==_);a===null?C=i:a.next=s,Lt(i,t.memoizedState)||(et=!0),t.memoizedState=i,t.baseState=C,t.baseQueue=a,r.lastRenderedState=i}if(e=r.interleaved,e!==null){h=e;do _=h.lane,be.lanes|=_,br|=_,h=h.next;while(h!==e)}else h===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Zn(e){var t=mt(),r=t.queue;if(r===null)throw Error(Y(311));r.lastRenderedReducer=e;var i=r.dispatch,h=r.pending,_=t.memoizedState;if(h!==null){r.pending=null;var C=h=h.next;do _=e(_,C.action),C=C.next;while(C!==h);Lt(_,t.memoizedState)||(et=!0),t.memoizedState=_,t.baseQueue===null&&(t.baseState=_),r.lastRenderedState=_}return[_,i]}function eu(){}function tu(e,t){var r=be,i=mt(),h=t(),_=!Lt(i.memoizedState,h);if(_&&(i.memoizedState=h,et=!0),i=i.queue,Hl(su.bind(null,r,i,e),[e]),i.getSnapshot!==t||_||Me!==null&&Me.memoizedState.tag&1){if(r.flags|=2048,qi(9,iu.bind(null,r,i,h,t),void 0,null),Be===null)throw Error(Y(349));xr&30||ru(r,t,h)}return h}function ru(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function iu(e,t,r,i){t.value=r,t.getSnapshot=i,nu(t)&&ou(e)}function su(e,t,r){return r(function(){nu(t)&&ou(e)})}function nu(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Lt(e,r)}catch{return!0}}function ou(e){var t=zt(e,1);t!==null&&Et(t,e,1,-1)}function Ua(e){var t=Dt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Gi,lastRenderedState:e},t.queue=e,e=e.dispatch=hp.bind(null,be,e),[t.memoizedState,e]}function qi(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.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 lu(){return mt().memoizedState}function Ps(e,t,r,i){var h=Dt();be.flags|=e,h.memoizedState=qi(1|t,r,void 0,i===void 0?null:i)}function Cn(e,t,r,i){var h=mt();i=i===void 0?null:i;var _=void 0;if(Ae!==null){var C=Ae.memoizedState;if(_=C.destroy,i!==null&&Nl(i,C.deps)){h.memoizedState=qi(t,r,_,i);return}}be.flags|=e,h.memoizedState=qi(1|t,r,_,i)}function Wa(e,t){return Ps(8390656,8,e,t)}function Hl(e,t){return Cn(2048,8,e,t)}function au(e,t){return Cn(4,2,e,t)}function cu(e,t){return Cn(4,4,e,t)}function hu(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 uu(e,t,r){return r=r!=null?r.concat([e]):null,Cn(4,4,hu.bind(null,t,e),r)}function $l(){}function du(e,t){var r=mt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Nl(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function fu(e,t){var r=mt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Nl(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function _u(e,t,r){return xr&21?(Lt(r,t)||(r=yh(),be.lanes|=r,br|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,et=!0),e.memoizedState=r)}function ap(e,t){var r=pe;pe=r!==0&&4>r?r:4,e(!0);var i=Qn.transition;Qn.transition={};try{e(!1),t()}finally{pe=r,Qn.transition=i}}function pu(){return mt().memoizedState}function cp(e,t,r){var i=sr(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},vu(e))gu(t,r);else if(r=Qh(e,t,r,i),r!==null){var h=qe();Et(r,e,i,h),mu(r,t,i)}}function hp(e,t,r){var i=sr(e),h={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(vu(e))gu(t,h);else{var _=e.alternate;if(e.lanes===0&&(_===null||_.lanes===0)&&(_=t.lastRenderedReducer,_!==null))try{var C=t.lastRenderedState,s=_(C,r);if(h.hasEagerState=!0,h.eagerState=s,Lt(s,C)){var a=t.interleaved;a===null?(h.next=h,Ml(t)):(h.next=a.next,a.next=h),t.interleaved=h;return}}catch{}finally{}r=Qh(e,t,h,i),r!==null&&(h=qe(),Et(r,e,i,h),mu(r,t,i))}}function vu(e){var t=e.alternate;return e===be||t!==null&&t===be}function gu(e,t){Ri=tn=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function mu(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,ml(e,r)}}var rn={readContext:gt,useCallback:ze,useContext:ze,useEffect:ze,useImperativeHandle:ze,useInsertionEffect:ze,useLayoutEffect:ze,useMemo:ze,useReducer:ze,useRef:ze,useState:ze,useDebugValue:ze,useDeferredValue:ze,useTransition:ze,useMutableSource:ze,useSyncExternalStore:ze,useId:ze,unstable_isNewReconciler:!1},up={readContext:gt,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:Wa,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ps(4194308,4,hu.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ps(4,2,e,t)},useMemo:function(e,t){var r=Dt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=Dt();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=cp.bind(null,be,e),[i.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:Ua,useDebugValue:$l,useDeferredValue:function(e){return Dt().memoizedState=e},useTransition:function(){var e=Ua(!1),t=e[0];return e=ap.bind(null,e[1]),Dt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=be,h=Dt();if(we){if(r===void 0)throw Error(Y(407));r=r()}else{if(r=t(),Be===null)throw Error(Y(349));xr&30||ru(i,t,r)}h.memoizedState=r;var _={value:r,getSnapshot:t};return h.queue=_,Wa(su.bind(null,i,_,e),[e]),i.flags|=2048,qi(9,iu.bind(null,i,_,r,t),void 0,null),r},useId:function(){var e=Dt(),t=Be.identifierPrefix;if(we){var r=Ft,i=Nt;r=(i&~(1<<32-bt(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ki++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=lp++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},dp={readContext:gt,useCallback:du,useContext:gt,useEffect:Hl,useImperativeHandle:uu,useInsertionEffect:au,useLayoutEffect:cu,useMemo:fu,useReducer:Jn,useRef:lu,useState:function(){return Jn(Gi)},useDebugValue:$l,useDeferredValue:function(e){var t=mt();return _u(t,Ae.memoizedState,e)},useTransition:function(){var e=Jn(Gi)[0],t=mt().memoizedState;return[e,t]},useMutableSource:eu,useSyncExternalStore:tu,useId:pu,unstable_isNewReconciler:!1},fp={readContext:gt,useCallback:du,useContext:gt,useEffect:Hl,useImperativeHandle:uu,useInsertionEffect:au,useLayoutEffect:cu,useMemo:fu,useReducer:Zn,useRef:lu,useState:function(){return Zn(Gi)},useDebugValue:$l,useDeferredValue:function(e){var t=mt();return Ae===null?t.memoizedState=e:_u(t,Ae.memoizedState,e)},useTransition:function(){var e=Zn(Gi)[0],t=mt().memoizedState;return[e,t]},useMutableSource:eu,useSyncExternalStore:tu,useId:pu,unstable_isNewReconciler:!1};function St(e,t){if(e&&e.defaultProps){t=Ee({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function zo(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:Ee({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Sn={isMounted:function(e){return(e=e._reactInternals)?kr(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=qe(),h=sr(e),_=jt(i,h);_.payload=t,r!=null&&(_.callback=r),t=rr(e,_,h),t!==null&&(Et(t,e,h,i),Ts(t,e,h))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=qe(),h=sr(e),_=jt(i,h);_.tag=1,_.payload=t,r!=null&&(_.callback=r),t=rr(e,_,h),t!==null&&(Et(t,e,h,i),Ts(t,e,h))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=qe(),i=sr(e),h=jt(r,i);h.tag=2,t!=null&&(h.callback=t),t=rr(e,h,i),t!==null&&(Et(t,e,i,r),Ts(t,e,i))}};function Va(e,t,r,i,h,_,C){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,_,C):t.prototype&&t.prototype.isPureReactComponent?!Hi(r,i)||!Hi(h,_):!0}function yu(e,t,r){var i=!1,h=ar,_=t.contextType;return typeof _=="object"&&_!==null?_=gt(_):(h=rt(t)?Sr:Ve.current,i=t.contextTypes,_=(i=i!=null)?Zr(e,h):ar),t=new t(r,_),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Sn,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=h,e.__reactInternalMemoizedMaskedChildContext=_),t}function Ka(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&&Sn.enqueueReplaceState(t,t.state,null)}function Uo(e,t,r,i){var h=e.stateNode;h.props=r,h.state=e.memoizedState,h.refs={},Pl(e);var _=t.contextType;typeof _=="object"&&_!==null?h.context=gt(_):(_=rt(t)?Sr:Ve.current,h.context=Zr(e,_)),h.state=e.memoizedState,_=t.getDerivedStateFromProps,typeof _=="function"&&(zo(e,t,_,r),h.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(t=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),t!==h.state&&Sn.enqueueReplaceState(h,h.state,null),Zs(e,r,h,i),h.state=e.memoizedState),typeof h.componentDidMount=="function"&&(e.flags|=4194308)}function ii(e,t){try{var r="",i=t;do r+=$f(i),i=i.return;while(i);var h=r}catch(_){h=`
39
+ Error generating stack: `+_.message+`
40
+ `+_.stack}return{value:e,source:t,stack:h,digest:null}}function eo(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Wo(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var _p=typeof WeakMap=="function"?WeakMap:Map;function Cu(e,t,r){r=jt(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){nn||(nn=!0,el=i),Wo(e,t)},r}function Su(e,t,r){r=jt(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var h=t.value;r.payload=function(){return i(h)},r.callback=function(){Wo(e,t)}}var _=e.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(r.callback=function(){Wo(e,t),typeof i!="function"&&(ir===null?ir=new Set([this]):ir.add(this));var C=t.stack;this.componentDidCatch(t.value,{componentStack:C!==null?C:""})}),r}function Ga(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new _p;var h=new Set;i.set(t,h)}else h=i.get(t),h===void 0&&(h=new Set,i.set(t,h));h.has(r)||(h.add(r),e=Rp.bind(null,e,t,r),t.then(e,e))}function qa(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 Xa(e,t,r,i,h){return e.mode&1?(e.flags|=65536,e.lanes=h,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=jt(-1,1),t.tag=2,rr(r,t,1))),r.lanes|=1),e)}var pp=Wt.ReactCurrentOwner,et=!1;function Ge(e,t,r,i){t.child=e===null?Yh(t,null,r,i):ti(t,e.child,r,i)}function Ya(e,t,r,i,h){r=r.render;var _=t.ref;return Yr(t,h),i=Fl(e,t,r,i,_,h),r=jl(),e!==null&&!et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~h,Ut(e,t,h)):(we&&r&&Ll(t),t.flags|=1,Ge(e,t,i,h),t.child)}function Qa(e,t,r,i,h){if(e===null){var _=r.type;return typeof _=="function"&&!Xl(_)&&_.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=_,wu(e,t,_,i,h)):(e=Ns(r.type,null,i,t,t.mode,h),e.ref=t.ref,e.return=t,t.child=e)}if(_=e.child,!(e.lanes&h)){var C=_.memoizedProps;if(r=r.compare,r=r!==null?r:Hi,r(C,i)&&e.ref===t.ref)return Ut(e,t,h)}return t.flags|=1,e=nr(_,i),e.ref=t.ref,e.return=t,t.child=e}function wu(e,t,r,i,h){if(e!==null){var _=e.memoizedProps;if(Hi(_,i)&&e.ref===t.ref)if(et=!1,t.pendingProps=i=_,(e.lanes&h)!==0)e.flags&131072&&(et=!0);else return t.lanes=e.lanes,Ut(e,t,h)}return Vo(e,t,r,i,h)}function xu(e,t,r){var i=t.pendingProps,h=i.children,_=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},me(Wr,ot),ot|=r;else{if(!(r&1073741824))return e=_!==null?_.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,me(Wr,ot),ot|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=_!==null?_.baseLanes:r,me(Wr,ot),ot|=i}else _!==null?(i=_.baseLanes|r,t.memoizedState=null):i=r,me(Wr,ot),ot|=i;return Ge(e,t,h,r),t.child}function bu(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Vo(e,t,r,i,h){var _=rt(r)?Sr:Ve.current;return _=Zr(t,_),Yr(t,h),r=Fl(e,t,r,i,_,h),i=jl(),e!==null&&!et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~h,Ut(e,t,h)):(we&&i&&Ll(t),t.flags|=1,Ge(e,t,r,h),t.child)}function Ja(e,t,r,i,h){if(rt(r)){var _=!0;qs(t)}else _=!1;if(Yr(t,h),t.stateNode===null)Bs(e,t),yu(t,r,i),Uo(t,r,i,h),i=!0;else if(e===null){var C=t.stateNode,s=t.memoizedProps;C.props=s;var a=C.context,d=r.contextType;typeof d=="object"&&d!==null?d=gt(d):(d=rt(r)?Sr:Ve.current,d=Zr(t,d));var g=r.getDerivedStateFromProps,u=typeof g=="function"||typeof C.getSnapshotBeforeUpdate=="function";u||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(s!==i||a!==d)&&Ka(t,C,i,d),Gt=!1;var v=t.memoizedState;C.state=v,Zs(t,i,C,h),a=t.memoizedState,s!==i||v!==a||tt.current||Gt?(typeof g=="function"&&(zo(t,r,g,i),a=t.memoizedState),(s=Gt||Va(t,r,s,i,v,a,d))?(u||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(t.flags|=4194308)):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=a),C.props=i,C.state=a,C.context=d,i=s):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{C=t.stateNode,Jh(e,t),s=t.memoizedProps,d=t.type===t.elementType?s:St(t.type,s),C.props=d,u=t.pendingProps,v=C.context,a=r.contextType,typeof a=="object"&&a!==null?a=gt(a):(a=rt(r)?Sr:Ve.current,a=Zr(t,a));var w=r.getDerivedStateFromProps;(g=typeof w=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(s!==u||v!==a)&&Ka(t,C,i,a),Gt=!1,v=t.memoizedState,C.state=v,Zs(t,i,C,h);var S=t.memoizedState;s!==u||v!==S||tt.current||Gt?(typeof w=="function"&&(zo(t,r,w,i),S=t.memoizedState),(d=Gt||Va(t,r,d,i,v,S,a)||!1)?(g||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(i,S,a),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(i,S,a)),typeof C.componentDidUpdate=="function"&&(t.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof C.componentDidUpdate!="function"||s===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=S),C.props=i,C.state=S,C.context=a,i=d):(typeof C.componentDidUpdate!="function"||s===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),i=!1)}return Ko(e,t,r,i,_,h)}function Ko(e,t,r,i,h,_){bu(e,t);var C=(t.flags&128)!==0;if(!i&&!C)return h&&Na(t,r,!1),Ut(e,t,_);i=t.stateNode,pp.current=t;var s=C&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&C?(t.child=ti(t,e.child,null,_),t.child=ti(t,null,s,_)):Ge(e,t,s,_),t.memoizedState=i.state,h&&Na(t,r,!0),t.child}function Eu(e){var t=e.stateNode;t.pendingContext?Ia(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ia(e,t.context,!1),Bl(e,t.containerInfo)}function Za(e,t,r,i,h){return ei(),Rl(h),t.flags|=256,Ge(e,t,r,i),t.child}var Go={dehydrated:null,treeContext:null,retryLane:0};function qo(e){return{baseLanes:e,cachePool:null,transitions:null}}function Lu(e,t,r){var i=t.pendingProps,h=xe.current,_=!1,C=(t.flags&128)!==0,s;if((s=C)||(s=e!==null&&e.memoizedState===null?!1:(h&2)!==0),s?(_=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(h|=1),me(xe,h&1),e===null)return Ho(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):(C=i.children,e=i.fallback,_?(i=t.mode,_=t.child,C={mode:"hidden",children:C},!(i&1)&&_!==null?(_.childLanes=0,_.pendingProps=C):_=bn(C,i,0,null),e=Cr(e,i,r,null),_.return=t,e.return=t,_.sibling=e,t.child=_,t.child.memoizedState=qo(r),t.memoizedState=Go,e):zl(t,C));if(h=e.memoizedState,h!==null&&(s=h.dehydrated,s!==null))return vp(e,t,C,i,s,h,r);if(_){_=i.fallback,C=t.mode,h=e.child,s=h.sibling;var a={mode:"hidden",children:i.children};return!(C&1)&&t.child!==h?(i=t.child,i.childLanes=0,i.pendingProps=a,t.deletions=null):(i=nr(h,a),i.subtreeFlags=h.subtreeFlags&14680064),s!==null?_=nr(s,_):(_=Cr(_,C,r,null),_.flags|=2),_.return=t,i.return=t,i.sibling=_,t.child=i,i=_,_=t.child,C=e.child.memoizedState,C=C===null?qo(r):{baseLanes:C.baseLanes|r,cachePool:null,transitions:C.transitions},_.memoizedState=C,_.childLanes=e.childLanes&~r,t.memoizedState=Go,i}return _=e.child,e=_.sibling,i=nr(_,{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 zl(e,t){return t=bn({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ys(e,t,r,i){return i!==null&&Rl(i),ti(t,e.child,null,r),e=zl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function vp(e,t,r,i,h,_,C){if(r)return t.flags&256?(t.flags&=-257,i=eo(Error(Y(422))),ys(e,t,C,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(_=i.fallback,h=t.mode,i=bn({mode:"visible",children:i.children},h,0,null),_=Cr(_,h,C,null),_.flags|=2,i.return=t,_.return=t,i.sibling=_,t.child=i,t.mode&1&&ti(t,e.child,null,C),t.child.memoizedState=qo(C),t.memoizedState=Go,_);if(!(t.mode&1))return ys(e,t,C,null);if(h.data==="$!"){if(i=h.nextSibling&&h.nextSibling.dataset,i)var s=i.dgst;return i=s,_=Error(Y(419)),i=eo(_,i,void 0),ys(e,t,C,i)}if(s=(C&e.childLanes)!==0,et||s){if(i=Be,i!==null){switch(C&-C){case 4:h=2;break;case 16:h=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:h=32;break;case 536870912:h=268435456;break;default:h=0}h=h&(i.suspendedLanes|C)?0:h,h!==0&&h!==_.retryLane&&(_.retryLane=h,zt(e,h),Et(i,e,h,-1))}return ql(),i=eo(Error(Y(421))),ys(e,t,C,i)}return h.data==="$?"?(t.flags|=128,t.child=e.child,t=Dp.bind(null,e),h._reactRetry=t,null):(e=_.treeContext,at=tr(h.nextSibling),ct=t,we=!0,xt=null,e!==null&&(ft[_t++]=Nt,ft[_t++]=Ft,ft[_t++]=wr,Nt=e.id,Ft=e.overflow,wr=t),t=zl(t,i.children),t.flags|=4096,t)}function ec(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),$o(e.return,t,r)}function to(e,t,r,i,h){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:h}:(_.isBackwards=t,_.rendering=null,_.renderingStartTime=0,_.last=i,_.tail=r,_.tailMode=h)}function ku(e,t,r){var i=t.pendingProps,h=i.revealOrder,_=i.tail;if(Ge(e,t,i.children,r),i=xe.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&&ec(e,r,t);else if(e.tag===19)ec(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(me(xe,i),!(t.mode&1))t.memoizedState=null;else switch(h){case"forwards":for(r=t.child,h=null;r!==null;)e=r.alternate,e!==null&&en(e)===null&&(h=r),r=r.sibling;r=h,r===null?(h=t.child,t.child=null):(h=r.sibling,r.sibling=null),to(t,!1,h,r,_);break;case"backwards":for(r=null,h=t.child,t.child=null;h!==null;){if(e=h.alternate,e!==null&&en(e)===null){t.child=h;break}e=h.sibling,h.sibling=r,r=h,h=e}to(t,!0,r,null,_);break;case"together":to(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Bs(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ut(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),br|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Y(153));if(t.child!==null){for(e=t.child,r=nr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=nr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function gp(e,t,r){switch(t.tag){case 3:Eu(t),ei();break;case 5:Zh(t);break;case 1:rt(t.type)&&qs(t);break;case 4:Bl(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,h=t.memoizedProps.value;me(Qs,i._currentValue),i._currentValue=h;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(me(xe,xe.current&1),t.flags|=128,null):r&t.child.childLanes?Lu(e,t,r):(me(xe,xe.current&1),e=Ut(e,t,r),e!==null?e.sibling:null);me(xe,xe.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return ku(e,t,r);t.flags|=128}if(h=t.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),me(xe,xe.current),i)break;return null;case 22:case 23:return t.lanes=0,xu(e,t,r)}return Ut(e,t,r)}var Ru,Xo,Du,Au;Ru=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}};Xo=function(){};Du=function(e,t,r,i){var h=e.memoizedProps;if(h!==i){e=t.stateNode,gr(Mt.current);var _=null;switch(r){case"input":h=go(e,h),i=go(e,i),_=[];break;case"select":h=Ee({},h,{value:void 0}),i=Ee({},i,{value:void 0}),_=[];break;case"textarea":h=Co(e,h),i=Co(e,i),_=[];break;default:typeof h.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=Ks)}wo(r,i);var C;r=null;for(d in h)if(!i.hasOwnProperty(d)&&h.hasOwnProperty(d)&&h[d]!=null)if(d==="style"){var s=h[d];for(C in s)s.hasOwnProperty(C)&&(r||(r={}),r[C]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Pi.hasOwnProperty(d)?_||(_=[]):(_=_||[]).push(d,null));for(d in i){var a=i[d];if(s=h!=null?h[d]:void 0,i.hasOwnProperty(d)&&a!==s&&(a!=null||s!=null))if(d==="style")if(s){for(C in s)!s.hasOwnProperty(C)||a&&a.hasOwnProperty(C)||(r||(r={}),r[C]="");for(C in a)a.hasOwnProperty(C)&&s[C]!==a[C]&&(r||(r={}),r[C]=a[C])}else r||(_||(_=[]),_.push(d,r)),r=a;else d==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,s=s?s.__html:void 0,a!=null&&s!==a&&(_=_||[]).push(d,a)):d==="children"?typeof a!="string"&&typeof a!="number"||(_=_||[]).push(d,""+a):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Pi.hasOwnProperty(d)?(a!=null&&d==="onScroll"&&Ce("scroll",e),_||s===a||(_=[])):(_=_||[]).push(d,a))}r&&(_=_||[]).push("style",r);var d=_;(t.updateQueue=d)&&(t.flags|=4)}};Au=function(e,t,r,i){r!==i&&(t.flags|=4)};function _i(e,t){if(!we)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 Ue(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var h=e.child;h!==null;)r|=h.lanes|h.childLanes,i|=h.subtreeFlags&14680064,i|=h.flags&14680064,h.return=e,h=h.sibling;else for(h=e.child;h!==null;)r|=h.lanes|h.childLanes,i|=h.subtreeFlags,i|=h.flags,h.return=e,h=h.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function mp(e,t,r){var i=t.pendingProps;switch(kl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ue(t),null;case 1:return rt(t.type)&&Gs(),Ue(t),null;case 3:return i=t.stateNode,ri(),Se(tt),Se(Ve),Il(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(gs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,xt!==null&&(il(xt),xt=null))),Xo(e,t),Ue(t),null;case 5:Ol(t);var h=gr(Vi.current);if(r=t.type,e!==null&&t.stateNode!=null)Du(e,t,r,i,h),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(Y(166));return Ue(t),null}if(e=gr(Mt.current),gs(t)){i=t.stateNode,r=t.type;var _=t.memoizedProps;switch(i[At]=t,i[Ui]=_,e=(t.mode&1)!==0,r){case"dialog":Ce("cancel",i),Ce("close",i);break;case"iframe":case"object":case"embed":Ce("load",i);break;case"video":case"audio":for(h=0;h<Ci.length;h++)Ce(Ci[h],i);break;case"source":Ce("error",i);break;case"img":case"image":case"link":Ce("error",i),Ce("load",i);break;case"details":Ce("toggle",i);break;case"input":ca(i,_),Ce("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!_.multiple},Ce("invalid",i);break;case"textarea":ua(i,_),Ce("invalid",i)}wo(r,_),h=null;for(var C in _)if(_.hasOwnProperty(C)){var s=_[C];C==="children"?typeof s=="string"?i.textContent!==s&&(_.suppressHydrationWarning!==!0&&vs(i.textContent,s,e),h=["children",s]):typeof s=="number"&&i.textContent!==""+s&&(_.suppressHydrationWarning!==!0&&vs(i.textContent,s,e),h=["children",""+s]):Pi.hasOwnProperty(C)&&s!=null&&C==="onScroll"&&Ce("scroll",i)}switch(r){case"input":as(i),ha(i,_,!0);break;case"textarea":as(i),da(i);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(i.onclick=Ks)}i=h,t.updateQueue=i,i!==null&&(t.flags|=4)}else{C=h.nodeType===9?h:h.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=sh(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=C.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=C.createElement(r,{is:i.is}):(e=C.createElement(r),r==="select"&&(C=e,i.multiple?C.multiple=!0:i.size&&(C.size=i.size))):e=C.createElementNS(e,r),e[At]=t,e[Ui]=i,Ru(e,t,!1,!1),t.stateNode=e;e:{switch(C=xo(r,i),r){case"dialog":Ce("cancel",e),Ce("close",e),h=i;break;case"iframe":case"object":case"embed":Ce("load",e),h=i;break;case"video":case"audio":for(h=0;h<Ci.length;h++)Ce(Ci[h],e);h=i;break;case"source":Ce("error",e),h=i;break;case"img":case"image":case"link":Ce("error",e),Ce("load",e),h=i;break;case"details":Ce("toggle",e),h=i;break;case"input":ca(e,i),h=go(e,i),Ce("invalid",e);break;case"option":h=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},h=Ee({},i,{value:void 0}),Ce("invalid",e);break;case"textarea":ua(e,i),h=Co(e,i),Ce("invalid",e);break;default:h=i}wo(r,h),s=h;for(_ in s)if(s.hasOwnProperty(_)){var a=s[_];_==="style"?lh(e,a):_==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&nh(e,a)):_==="children"?typeof a=="string"?(r!=="textarea"||a!=="")&&Bi(e,a):typeof a=="number"&&Bi(e,""+a):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(Pi.hasOwnProperty(_)?a!=null&&_==="onScroll"&&Ce("scroll",e):a!=null&&dl(e,_,a,C))}switch(r){case"input":as(e),ha(e,i,!1);break;case"textarea":as(e),da(e);break;case"option":i.value!=null&&e.setAttribute("value",""+lr(i.value));break;case"select":e.multiple=!!i.multiple,_=i.value,_!=null?Kr(e,!!i.multiple,_,!1):i.defaultValue!=null&&Kr(e,!!i.multiple,i.defaultValue,!0);break;default:typeof h.onClick=="function"&&(e.onclick=Ks)}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 Ue(t),null;case 6:if(e&&t.stateNode!=null)Au(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(Y(166));if(r=gr(Vi.current),gr(Mt.current),gs(t)){if(i=t.stateNode,r=t.memoizedProps,i[At]=t,(_=i.nodeValue!==r)&&(e=ct,e!==null))switch(e.tag){case 3:vs(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&vs(i.nodeValue,r,(e.mode&1)!==0)}_&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[At]=t,t.stateNode=i}return Ue(t),null;case 13:if(Se(xe),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(we&&at!==null&&t.mode&1&&!(t.flags&128))qh(),ei(),t.flags|=98560,_=!1;else if(_=gs(t),i!==null&&i.dehydrated!==null){if(e===null){if(!_)throw Error(Y(318));if(_=t.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(Y(317));_[At]=t}else ei(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ue(t),_=!1}else xt!==null&&(il(xt),xt=null),_=!0;if(!_)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||xe.current&1?Te===0&&(Te=3):ql())),t.updateQueue!==null&&(t.flags|=4),Ue(t),null);case 4:return ri(),Xo(e,t),e===null&&$i(t.stateNode.containerInfo),Ue(t),null;case 10:return Tl(t.type._context),Ue(t),null;case 17:return rt(t.type)&&Gs(),Ue(t),null;case 19:if(Se(xe),_=t.memoizedState,_===null)return Ue(t),null;if(i=(t.flags&128)!==0,C=_.rendering,C===null)if(i)_i(_,!1);else{if(Te!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(C=en(e),C!==null){for(t.flags|=128,_i(_,!1),i=C.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)_=r,e=i,_.flags&=14680066,C=_.alternate,C===null?(_.childLanes=0,_.lanes=e,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=C.childLanes,_.lanes=C.lanes,_.child=C.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=C.memoizedProps,_.memoizedState=C.memoizedState,_.updateQueue=C.updateQueue,_.type=C.type,e=C.dependencies,_.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return me(xe,xe.current&1|2),t.child}e=e.sibling}_.tail!==null&&ke()>si&&(t.flags|=128,i=!0,_i(_,!1),t.lanes=4194304)}else{if(!i)if(e=en(C),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),_i(_,!0),_.tail===null&&_.tailMode==="hidden"&&!C.alternate&&!we)return Ue(t),null}else 2*ke()-_.renderingStartTime>si&&r!==1073741824&&(t.flags|=128,i=!0,_i(_,!1),t.lanes=4194304);_.isBackwards?(C.sibling=t.child,t.child=C):(r=_.last,r!==null?r.sibling=C:t.child=C,_.last=C)}return _.tail!==null?(t=_.tail,_.rendering=t,_.tail=t.sibling,_.renderingStartTime=ke(),t.sibling=null,r=xe.current,me(xe,i?r&1|2:r&1),t):(Ue(t),null);case 22:case 23:return Gl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?ot&1073741824&&(Ue(t),t.subtreeFlags&6&&(t.flags|=8192)):Ue(t),null;case 24:return null;case 25:return null}throw Error(Y(156,t.tag))}function yp(e,t){switch(kl(t),t.tag){case 1:return rt(t.type)&&Gs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ri(),Se(tt),Se(Ve),Il(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ol(t),null;case 13:if(Se(xe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Y(340));ei()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Se(xe),null;case 4:return ri(),null;case 10:return Tl(t.type._context),null;case 22:case 23:return Gl(),null;case 24:return null;default:return null}}var Cs=!1,We=!1,Cp=typeof WeakSet=="function"?WeakSet:Set,J=null;function Ur(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){Le(e,t,i)}else r.current=null}function Yo(e,t,r){try{r()}catch(i){Le(e,t,i)}}var tc=!1;function Sp(e,t){if(Po=Us,e=Oh(),El(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 h=i.anchorOffset,_=i.focusNode;i=i.focusOffset;try{r.nodeType,_.nodeType}catch{r=null;break e}var C=0,s=-1,a=-1,d=0,g=0,u=e,v=null;t:for(;;){for(var w;u!==r||h!==0&&u.nodeType!==3||(s=C+h),u!==_||i!==0&&u.nodeType!==3||(a=C+i),u.nodeType===3&&(C+=u.nodeValue.length),(w=u.firstChild)!==null;)v=u,u=w;for(;;){if(u===e)break t;if(v===r&&++d===h&&(s=C),v===_&&++g===i&&(a=C),(w=u.nextSibling)!==null)break;u=v,v=u.parentNode}u=w}r=s===-1||a===-1?null:{start:s,end:a}}else r=null}r=r||{start:0,end:0}}else r=null;for(Bo={focusedElem:e,selectionRange:r},Us=!1,J=t;J!==null;)if(t=J,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,J=e;else for(;J!==null;){t=J;try{var S=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var f=S.memoizedProps,n=S.memoizedState,o=t.stateNode,l=o.getSnapshotBeforeUpdate(t.elementType===t.type?f:St(t.type,f),n);o.__reactInternalSnapshotBeforeUpdate=l}break;case 3:var c=t.stateNode.containerInfo;c.nodeType===1?c.textContent="":c.nodeType===9&&c.documentElement&&c.removeChild(c.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Y(163))}}catch(m){Le(t,t.return,m)}if(e=t.sibling,e!==null){e.return=t.return,J=e;break}J=t.return}return S=tc,tc=!1,S}function Di(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var h=i=i.next;do{if((h.tag&e)===e){var _=h.destroy;h.destroy=void 0,_!==void 0&&Yo(t,r,_)}h=h.next}while(h!==i)}}function wn(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 Qo(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 Tu(e){var t=e.alternate;t!==null&&(e.alternate=null,Tu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[At],delete t[Ui],delete t[No],delete t[ip],delete t[sp])),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 Mu(e){return e.tag===5||e.tag===3||e.tag===4}function rc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Mu(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 Jo(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=Ks));else if(i!==4&&(e=e.child,e!==null))for(Jo(e,t,r),e=e.sibling;e!==null;)Jo(e,t,r),e=e.sibling}function Zo(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(Zo(e,t,r),e=e.sibling;e!==null;)Zo(e,t,r),e=e.sibling}var Ne=null,wt=!1;function Vt(e,t,r){for(r=r.child;r!==null;)Pu(e,t,r),r=r.sibling}function Pu(e,t,r){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(_n,r)}catch{}switch(r.tag){case 5:We||Ur(r,t);case 6:var i=Ne,h=wt;Ne=null,Vt(e,t,r),Ne=i,wt=h,Ne!==null&&(wt?(e=Ne,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ne.removeChild(r.stateNode));break;case 18:Ne!==null&&(wt?(e=Ne,r=r.stateNode,e.nodeType===8?qn(e.parentNode,r):e.nodeType===1&&qn(e,r),Fi(e)):qn(Ne,r.stateNode));break;case 4:i=Ne,h=wt,Ne=r.stateNode.containerInfo,wt=!0,Vt(e,t,r),Ne=i,wt=h;break;case 0:case 11:case 14:case 15:if(!We&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){h=i=i.next;do{var _=h,C=_.destroy;_=_.tag,C!==void 0&&(_&2||_&4)&&Yo(r,t,C),h=h.next}while(h!==i)}Vt(e,t,r);break;case 1:if(!We&&(Ur(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(s){Le(r,t,s)}Vt(e,t,r);break;case 21:Vt(e,t,r);break;case 22:r.mode&1?(We=(i=We)||r.memoizedState!==null,Vt(e,t,r),We=i):Vt(e,t,r);break;default:Vt(e,t,r)}}function ic(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Cp),t.forEach(function(i){var h=Ap.bind(null,e,i);r.has(i)||(r.add(i),i.then(h,h))})}}function Ct(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var h=r[i];try{var _=e,C=t,s=C;e:for(;s!==null;){switch(s.tag){case 5:Ne=s.stateNode,wt=!1;break e;case 3:Ne=s.stateNode.containerInfo,wt=!0;break e;case 4:Ne=s.stateNode.containerInfo,wt=!0;break e}s=s.return}if(Ne===null)throw Error(Y(160));Pu(_,C,h),Ne=null,wt=!1;var a=h.alternate;a!==null&&(a.return=null),h.return=null}catch(d){Le(h,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Bu(t,e),t=t.sibling}function Bu(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ct(t,e),Rt(e),i&4){try{Di(3,e,e.return),wn(3,e)}catch(f){Le(e,e.return,f)}try{Di(5,e,e.return)}catch(f){Le(e,e.return,f)}}break;case 1:Ct(t,e),Rt(e),i&512&&r!==null&&Ur(r,r.return);break;case 5:if(Ct(t,e),Rt(e),i&512&&r!==null&&Ur(r,r.return),e.flags&32){var h=e.stateNode;try{Bi(h,"")}catch(f){Le(e,e.return,f)}}if(i&4&&(h=e.stateNode,h!=null)){var _=e.memoizedProps,C=r!==null?r.memoizedProps:_,s=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{s==="input"&&_.type==="radio"&&_.name!=null&&rh(h,_),xo(s,C);var d=xo(s,_);for(C=0;C<a.length;C+=2){var g=a[C],u=a[C+1];g==="style"?lh(h,u):g==="dangerouslySetInnerHTML"?nh(h,u):g==="children"?Bi(h,u):dl(h,g,u,d)}switch(s){case"input":mo(h,_);break;case"textarea":ih(h,_);break;case"select":var v=h._wrapperState.wasMultiple;h._wrapperState.wasMultiple=!!_.multiple;var w=_.value;w!=null?Kr(h,!!_.multiple,w,!1):v!==!!_.multiple&&(_.defaultValue!=null?Kr(h,!!_.multiple,_.defaultValue,!0):Kr(h,!!_.multiple,_.multiple?[]:"",!1))}h[Ui]=_}catch(f){Le(e,e.return,f)}}break;case 6:if(Ct(t,e),Rt(e),i&4){if(e.stateNode===null)throw Error(Y(162));h=e.stateNode,_=e.memoizedProps;try{h.nodeValue=_}catch(f){Le(e,e.return,f)}}break;case 3:if(Ct(t,e),Rt(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Fi(t.containerInfo)}catch(f){Le(e,e.return,f)}break;case 4:Ct(t,e),Rt(e);break;case 13:Ct(t,e),Rt(e),h=e.child,h.flags&8192&&(_=h.memoizedState!==null,h.stateNode.isHidden=_,!_||h.alternate!==null&&h.alternate.memoizedState!==null||(Vl=ke())),i&4&&ic(e);break;case 22:if(g=r!==null&&r.memoizedState!==null,e.mode&1?(We=(d=We)||g,Ct(t,e),We=d):Ct(t,e),Rt(e),i&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!g&&e.mode&1)for(J=e,g=e.child;g!==null;){for(u=J=g;J!==null;){switch(v=J,w=v.child,v.tag){case 0:case 11:case 14:case 15:Di(4,v,v.return);break;case 1:Ur(v,v.return);var S=v.stateNode;if(typeof S.componentWillUnmount=="function"){i=v,r=v.return;try{t=i,S.props=t.memoizedProps,S.state=t.memoizedState,S.componentWillUnmount()}catch(f){Le(i,r,f)}}break;case 5:Ur(v,v.return);break;case 22:if(v.memoizedState!==null){nc(u);continue}}w!==null?(w.return=v,J=w):nc(u)}g=g.sibling}e:for(g=null,u=e;;){if(u.tag===5){if(g===null){g=u;try{h=u.stateNode,d?(_=h.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(s=u.stateNode,a=u.memoizedProps.style,C=a!=null&&a.hasOwnProperty("display")?a.display:null,s.style.display=oh("display",C))}catch(f){Le(e,e.return,f)}}}else if(u.tag===6){if(g===null)try{u.stateNode.nodeValue=d?"":u.memoizedProps}catch(f){Le(e,e.return,f)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;g===u&&(g=null),u=u.return}g===u&&(g=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:Ct(t,e),Rt(e),i&4&&ic(e);break;case 21:break;default:Ct(t,e),Rt(e)}}function Rt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Mu(r)){var i=r;break e}r=r.return}throw Error(Y(160))}switch(i.tag){case 5:var h=i.stateNode;i.flags&32&&(Bi(h,""),i.flags&=-33);var _=rc(e);Zo(e,_,h);break;case 3:case 4:var C=i.stateNode.containerInfo,s=rc(e);Jo(e,s,C);break;default:throw Error(Y(161))}}catch(a){Le(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wp(e,t,r){J=e,Ou(e)}function Ou(e,t,r){for(var i=(e.mode&1)!==0;J!==null;){var h=J,_=h.child;if(h.tag===22&&i){var C=h.memoizedState!==null||Cs;if(!C){var s=h.alternate,a=s!==null&&s.memoizedState!==null||We;s=Cs;var d=We;if(Cs=C,(We=a)&&!d)for(J=h;J!==null;)C=J,a=C.child,C.tag===22&&C.memoizedState!==null?oc(h):a!==null?(a.return=C,J=a):oc(h);for(;_!==null;)J=_,Ou(_),_=_.sibling;J=h,Cs=s,We=d}sc(e)}else h.subtreeFlags&8772&&_!==null?(_.return=h,J=_):sc(e)}}function sc(e){for(;J!==null;){var t=J;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:We||wn(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!We)if(r===null)i.componentDidMount();else{var h=t.elementType===t.type?r.memoizedProps:St(t.type,r.memoizedProps);i.componentDidUpdate(h,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var _=t.updateQueue;_!==null&&za(t,_,i);break;case 3:var C=t.updateQueue;if(C!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}za(t,C,r)}break;case 5:var s=t.stateNode;if(r===null&&t.flags&4){r=s;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break;case"img":a.src&&(r.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var g=d.memoizedState;if(g!==null){var u=g.dehydrated;u!==null&&Fi(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Y(163))}We||t.flags&512&&Qo(t)}catch(v){Le(t,t.return,v)}}if(t===e){J=null;break}if(r=t.sibling,r!==null){r.return=t.return,J=r;break}J=t.return}}function nc(e){for(;J!==null;){var t=J;if(t===e){J=null;break}var r=t.sibling;if(r!==null){r.return=t.return,J=r;break}J=t.return}}function oc(e){for(;J!==null;){var t=J;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{wn(4,t)}catch(a){Le(t,r,a)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var h=t.return;try{i.componentDidMount()}catch(a){Le(t,h,a)}}var _=t.return;try{Qo(t)}catch(a){Le(t,_,a)}break;case 5:var C=t.return;try{Qo(t)}catch(a){Le(t,C,a)}}}catch(a){Le(t,t.return,a)}if(t===e){J=null;break}var s=t.sibling;if(s!==null){s.return=t.return,J=s;break}J=t.return}}var xp=Math.ceil,sn=Wt.ReactCurrentDispatcher,Ul=Wt.ReactCurrentOwner,vt=Wt.ReactCurrentBatchConfig,de=0,Be=null,Re=null,je=0,ot=0,Wr=hr(0),Te=0,Xi=null,br=0,xn=0,Wl=0,Ai=null,Ze=null,Vl=0,si=1/0,Ot=null,nn=!1,el=null,ir=null,Ss=!1,Qt=null,on=0,Ti=0,tl=null,Os=-1,Is=0;function qe(){return de&6?ke():Os!==-1?Os:Os=ke()}function sr(e){return e.mode&1?de&2&&je!==0?je&-je:op.transition!==null?(Is===0&&(Is=yh()),Is):(e=pe,e!==0||(e=window.event,e=e===void 0?16:Lh(e.type)),e):1}function Et(e,t,r,i){if(50<Ti)throw Ti=0,tl=null,Error(Y(185));Ji(e,r,i),(!(de&2)||e!==Be)&&(e===Be&&(!(de&2)&&(xn|=r),Te===4&&Xt(e,je)),it(e,i),r===1&&de===0&&!(t.mode&1)&&(si=ke()+500,yn&&ur()))}function it(e,t){var r=e.callbackNode;o_(e,t);var i=zs(e,e===Be?je:0);if(i===0)r!==null&&pa(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&pa(r),t===1)e.tag===0?np(lc.bind(null,e)):Vh(lc.bind(null,e)),tp(function(){!(de&6)&&ur()}),r=null;else{switch(Ch(i)){case 1:r=gl;break;case 4:r=gh;break;case 16:r=$s;break;case 536870912:r=mh;break;default:r=$s}r=Uu(r,Iu.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Iu(e,t){if(Os=-1,Is=0,de&6)throw Error(Y(327));var r=e.callbackNode;if(Qr()&&e.callbackNode!==r)return null;var i=zs(e,e===Be?je:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=ln(e,i);else{t=i;var h=de;de|=2;var _=Fu();(Be!==e||je!==t)&&(Ot=null,si=ke()+500,yr(e,t));do try{Lp();break}catch(s){Nu(e,s)}while(!0);Al(),sn.current=_,de=h,Re!==null?t=0:(Be=null,je=0,t=Te)}if(t!==0){if(t===2&&(h=Ro(e),h!==0&&(i=h,t=rl(e,h))),t===1)throw r=Xi,yr(e,0),Xt(e,i),it(e,ke()),r;if(t===6)Xt(e,i);else{if(h=e.current.alternate,!(i&30)&&!bp(h)&&(t=ln(e,i),t===2&&(_=Ro(e),_!==0&&(i=_,t=rl(e,_))),t===1))throw r=Xi,yr(e,0),Xt(e,i),it(e,ke()),r;switch(e.finishedWork=h,e.finishedLanes=i,t){case 0:case 1:throw Error(Y(345));case 2:_r(e,Ze,Ot);break;case 3:if(Xt(e,i),(i&130023424)===i&&(t=Vl+500-ke(),10<t)){if(zs(e,0)!==0)break;if(h=e.suspendedLanes,(h&i)!==i){qe(),e.pingedLanes|=e.suspendedLanes&h;break}e.timeoutHandle=Io(_r.bind(null,e,Ze,Ot),t);break}_r(e,Ze,Ot);break;case 4:if(Xt(e,i),(i&4194240)===i)break;for(t=e.eventTimes,h=-1;0<i;){var C=31-bt(i);_=1<<C,C=t[C],C>h&&(h=C),i&=~_}if(i=h,i=ke()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*xp(i/1960))-i,10<i){e.timeoutHandle=Io(_r.bind(null,e,Ze,Ot),i);break}_r(e,Ze,Ot);break;case 5:_r(e,Ze,Ot);break;default:throw Error(Y(329))}}}return it(e,ke()),e.callbackNode===r?Iu.bind(null,e):null}function rl(e,t){var r=Ai;return e.current.memoizedState.isDehydrated&&(yr(e,t).flags|=256),e=ln(e,t),e!==2&&(t=Ze,Ze=r,t!==null&&il(t)),e}function il(e){Ze===null?Ze=e:Ze.push.apply(Ze,e)}function bp(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 h=r[i],_=h.getSnapshot;h=h.value;try{if(!Lt(_(),h))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 Xt(e,t){for(t&=~Wl,t&=~xn,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-bt(t),i=1<<r;e[r]=-1,t&=~i}}function lc(e){if(de&6)throw Error(Y(327));Qr();var t=zs(e,0);if(!(t&1))return it(e,ke()),null;var r=ln(e,t);if(e.tag!==0&&r===2){var i=Ro(e);i!==0&&(t=i,r=rl(e,i))}if(r===1)throw r=Xi,yr(e,0),Xt(e,t),it(e,ke()),r;if(r===6)throw Error(Y(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,_r(e,Ze,Ot),it(e,ke()),null}function Kl(e,t){var r=de;de|=1;try{return e(t)}finally{de=r,de===0&&(si=ke()+500,yn&&ur())}}function Er(e){Qt!==null&&Qt.tag===0&&!(de&6)&&Qr();var t=de;de|=1;var r=vt.transition,i=pe;try{if(vt.transition=null,pe=1,e)return e()}finally{pe=i,vt.transition=r,de=t,!(de&6)&&ur()}}function Gl(){ot=Wr.current,Se(Wr)}function yr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,ep(r)),Re!==null)for(r=Re.return;r!==null;){var i=r;switch(kl(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Gs();break;case 3:ri(),Se(tt),Se(Ve),Il();break;case 5:Ol(i);break;case 4:ri();break;case 13:Se(xe);break;case 19:Se(xe);break;case 10:Tl(i.type._context);break;case 22:case 23:Gl()}r=r.return}if(Be=e,Re=e=nr(e.current,null),je=ot=t,Te=0,Xi=null,Wl=xn=br=0,Ze=Ai=null,vr!==null){for(t=0;t<vr.length;t++)if(r=vr[t],i=r.interleaved,i!==null){r.interleaved=null;var h=i.next,_=r.pending;if(_!==null){var C=_.next;_.next=h,i.next=C}r.pending=i}vr=null}return e}function Nu(e,t){do{var r=Re;try{if(Al(),Ms.current=rn,tn){for(var i=be.memoizedState;i!==null;){var h=i.queue;h!==null&&(h.pending=null),i=i.next}tn=!1}if(xr=0,Me=Ae=be=null,Ri=!1,Ki=0,Ul.current=null,r===null||r.return===null){Te=1,Xi=t,Re=null;break}e:{var _=e,C=r.return,s=r,a=t;if(t=je,s.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var d=a,g=s,u=g.tag;if(!(g.mode&1)&&(u===0||u===11||u===15)){var v=g.alternate;v?(g.updateQueue=v.updateQueue,g.memoizedState=v.memoizedState,g.lanes=v.lanes):(g.updateQueue=null,g.memoizedState=null)}var w=qa(C);if(w!==null){w.flags&=-257,Xa(w,C,s,_,t),w.mode&1&&Ga(_,d,t),t=w,a=d;var S=t.updateQueue;if(S===null){var f=new Set;f.add(a),t.updateQueue=f}else S.add(a);break e}else{if(!(t&1)){Ga(_,d,t),ql();break e}a=Error(Y(426))}}else if(we&&s.mode&1){var n=qa(C);if(n!==null){!(n.flags&65536)&&(n.flags|=256),Xa(n,C,s,_,t),Rl(ii(a,s));break e}}_=a=ii(a,s),Te!==4&&(Te=2),Ai===null?Ai=[_]:Ai.push(_),_=C;do{switch(_.tag){case 3:_.flags|=65536,t&=-t,_.lanes|=t;var o=Cu(_,a,t);$a(_,o);break e;case 1:s=a;var l=_.type,c=_.stateNode;if(!(_.flags&128)&&(typeof l.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(ir===null||!ir.has(c)))){_.flags|=65536,t&=-t,_.lanes|=t;var m=Su(_,s,t);$a(_,m);break e}}_=_.return}while(_!==null)}Hu(r)}catch(y){t=y,Re===r&&r!==null&&(Re=r=r.return);continue}break}while(!0)}function Fu(){var e=sn.current;return sn.current=rn,e===null?rn:e}function ql(){(Te===0||Te===3||Te===2)&&(Te=4),Be===null||!(br&268435455)&&!(xn&268435455)||Xt(Be,je)}function ln(e,t){var r=de;de|=2;var i=Fu();(Be!==e||je!==t)&&(Ot=null,yr(e,t));do try{Ep();break}catch(h){Nu(e,h)}while(!0);if(Al(),de=r,sn.current=i,Re!==null)throw Error(Y(261));return Be=null,je=0,Te}function Ep(){for(;Re!==null;)ju(Re)}function Lp(){for(;Re!==null&&!Qf();)ju(Re)}function ju(e){var t=zu(e.alternate,e,ot);e.memoizedProps=e.pendingProps,t===null?Hu(e):Re=t,Ul.current=null}function Hu(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=yp(r,t),r!==null){r.flags&=32767,Re=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Te=6,Re=null;return}}else if(r=mp(r,t,ot),r!==null){Re=r;return}if(t=t.sibling,t!==null){Re=t;return}Re=t=e}while(t!==null);Te===0&&(Te=5)}function _r(e,t,r){var i=pe,h=vt.transition;try{vt.transition=null,pe=1,kp(e,t,r,i)}finally{vt.transition=h,pe=i}return null}function kp(e,t,r,i){do Qr();while(Qt!==null);if(de&6)throw Error(Y(327));r=e.finishedWork;var h=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(Y(177));e.callbackNode=null,e.callbackPriority=0;var _=r.lanes|r.childLanes;if(l_(e,_),e===Be&&(Re=Be=null,je=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Ss||(Ss=!0,Uu($s,function(){return Qr(),null})),_=(r.flags&15990)!==0,r.subtreeFlags&15990||_){_=vt.transition,vt.transition=null;var C=pe;pe=1;var s=de;de|=4,Ul.current=null,Sp(e,r),Bu(r,e),G_(Bo),Us=!!Po,Bo=Po=null,e.current=r,wp(r),Jf(),de=s,pe=C,vt.transition=_}else e.current=r;if(Ss&&(Ss=!1,Qt=e,on=h),_=e.pendingLanes,_===0&&(ir=null),t_(r.stateNode),it(e,ke()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)h=t[r],i(h.value,{componentStack:h.stack,digest:h.digest});if(nn)throw nn=!1,e=el,el=null,e;return on&1&&e.tag!==0&&Qr(),_=e.pendingLanes,_&1?e===tl?Ti++:(Ti=0,tl=e):Ti=0,ur(),null}function Qr(){if(Qt!==null){var e=Ch(on),t=vt.transition,r=pe;try{if(vt.transition=null,pe=16>e?16:e,Qt===null)var i=!1;else{if(e=Qt,Qt=null,on=0,de&6)throw Error(Y(331));var h=de;for(de|=4,J=e.current;J!==null;){var _=J,C=_.child;if(J.flags&16){var s=_.deletions;if(s!==null){for(var a=0;a<s.length;a++){var d=s[a];for(J=d;J!==null;){var g=J;switch(g.tag){case 0:case 11:case 15:Di(8,g,_)}var u=g.child;if(u!==null)u.return=g,J=u;else for(;J!==null;){g=J;var v=g.sibling,w=g.return;if(Tu(g),g===d){J=null;break}if(v!==null){v.return=w,J=v;break}J=w}}}var S=_.alternate;if(S!==null){var f=S.child;if(f!==null){S.child=null;do{var n=f.sibling;f.sibling=null,f=n}while(f!==null)}}J=_}}if(_.subtreeFlags&2064&&C!==null)C.return=_,J=C;else e:for(;J!==null;){if(_=J,_.flags&2048)switch(_.tag){case 0:case 11:case 15:Di(9,_,_.return)}var o=_.sibling;if(o!==null){o.return=_.return,J=o;break e}J=_.return}}var l=e.current;for(J=l;J!==null;){C=J;var c=C.child;if(C.subtreeFlags&2064&&c!==null)c.return=C,J=c;else e:for(C=l;J!==null;){if(s=J,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:wn(9,s)}}catch(y){Le(s,s.return,y)}if(s===C){J=null;break e}var m=s.sibling;if(m!==null){m.return=s.return,J=m;break e}J=s.return}}if(de=h,ur(),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(_n,e)}catch{}i=!0}return i}finally{pe=r,vt.transition=t}}return!1}function ac(e,t,r){t=ii(r,t),t=Cu(e,t,1),e=rr(e,t,1),t=qe(),e!==null&&(Ji(e,1,t),it(e,t))}function Le(e,t,r){if(e.tag===3)ac(e,e,r);else for(;t!==null;){if(t.tag===3){ac(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(ir===null||!ir.has(i))){e=ii(r,e),e=Su(t,e,1),t=rr(t,e,1),e=qe(),t!==null&&(Ji(t,1,e),it(t,e));break}}t=t.return}}function Rp(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=qe(),e.pingedLanes|=e.suspendedLanes&r,Be===e&&(je&r)===r&&(Te===4||Te===3&&(je&130023424)===je&&500>ke()-Vl?yr(e,0):Wl|=r),it(e,t)}function $u(e,t){t===0&&(e.mode&1?(t=us,us<<=1,!(us&130023424)&&(us=4194304)):t=1);var r=qe();e=zt(e,t),e!==null&&(Ji(e,t,r),it(e,r))}function Dp(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),$u(e,r)}function Ap(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,h=e.memoizedState;h!==null&&(r=h.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(Y(314))}i!==null&&i.delete(t),$u(e,r)}var zu;zu=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||tt.current)et=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return et=!1,gp(e,t,r);et=!!(e.flags&131072)}else et=!1,we&&t.flags&1048576&&Kh(t,Ys,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Bs(e,t),e=t.pendingProps;var h=Zr(t,Ve.current);Yr(t,r),h=Fl(null,t,i,e,h,r);var _=jl();return t.flags|=1,typeof h=="object"&&h!==null&&typeof h.render=="function"&&h.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,rt(i)?(_=!0,qs(t)):_=!1,t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,Pl(t),h.updater=Sn,t.stateNode=h,h._reactInternals=t,Uo(t,i,e,r),t=Ko(null,t,i,!0,_,r)):(t.tag=0,we&&_&&Ll(t),Ge(null,t,h,r),t=t.child),t;case 16:i=t.elementType;e:{switch(Bs(e,t),e=t.pendingProps,h=i._init,i=h(i._payload),t.type=i,h=t.tag=Mp(i),e=St(i,e),h){case 0:t=Vo(null,t,i,e,r);break e;case 1:t=Ja(null,t,i,e,r);break e;case 11:t=Ya(null,t,i,e,r);break e;case 14:t=Qa(null,t,i,St(i.type,e),r);break e}throw Error(Y(306,i,""))}return t;case 0:return i=t.type,h=t.pendingProps,h=t.elementType===i?h:St(i,h),Vo(e,t,i,h,r);case 1:return i=t.type,h=t.pendingProps,h=t.elementType===i?h:St(i,h),Ja(e,t,i,h,r);case 3:e:{if(Eu(t),e===null)throw Error(Y(387));i=t.pendingProps,_=t.memoizedState,h=_.element,Jh(e,t),Zs(t,i,null,r);var C=t.memoizedState;if(i=C.element,_.isDehydrated)if(_={element:i,isDehydrated:!1,cache:C.cache,pendingSuspenseBoundaries:C.pendingSuspenseBoundaries,transitions:C.transitions},t.updateQueue.baseState=_,t.memoizedState=_,t.flags&256){h=ii(Error(Y(423)),t),t=Za(e,t,i,r,h);break e}else if(i!==h){h=ii(Error(Y(424)),t),t=Za(e,t,i,r,h);break e}else for(at=tr(t.stateNode.containerInfo.firstChild),ct=t,we=!0,xt=null,r=Yh(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ei(),i===h){t=Ut(e,t,r);break e}Ge(e,t,i,r)}t=t.child}return t;case 5:return Zh(t),e===null&&Ho(t),i=t.type,h=t.pendingProps,_=e!==null?e.memoizedProps:null,C=h.children,Oo(i,h)?C=null:_!==null&&Oo(i,_)&&(t.flags|=32),bu(e,t),Ge(e,t,C,r),t.child;case 6:return e===null&&Ho(t),null;case 13:return Lu(e,t,r);case 4:return Bl(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=ti(t,null,i,r):Ge(e,t,i,r),t.child;case 11:return i=t.type,h=t.pendingProps,h=t.elementType===i?h:St(i,h),Ya(e,t,i,h,r);case 7:return Ge(e,t,t.pendingProps,r),t.child;case 8:return Ge(e,t,t.pendingProps.children,r),t.child;case 12:return Ge(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,h=t.pendingProps,_=t.memoizedProps,C=h.value,me(Qs,i._currentValue),i._currentValue=C,_!==null)if(Lt(_.value,C)){if(_.children===h.children&&!tt.current){t=Ut(e,t,r);break e}}else for(_=t.child,_!==null&&(_.return=t);_!==null;){var s=_.dependencies;if(s!==null){C=_.child;for(var a=s.firstContext;a!==null;){if(a.context===i){if(_.tag===1){a=jt(-1,r&-r),a.tag=2;var d=_.updateQueue;if(d!==null){d=d.shared;var g=d.pending;g===null?a.next=a:(a.next=g.next,g.next=a),d.pending=a}}_.lanes|=r,a=_.alternate,a!==null&&(a.lanes|=r),$o(_.return,r,t),s.lanes|=r;break}a=a.next}}else if(_.tag===10)C=_.type===t.type?null:_.child;else if(_.tag===18){if(C=_.return,C===null)throw Error(Y(341));C.lanes|=r,s=C.alternate,s!==null&&(s.lanes|=r),$o(C,r,t),C=_.sibling}else C=_.child;if(C!==null)C.return=_;else for(C=_;C!==null;){if(C===t){C=null;break}if(_=C.sibling,_!==null){_.return=C.return,C=_;break}C=C.return}_=C}Ge(e,t,h.children,r),t=t.child}return t;case 9:return h=t.type,i=t.pendingProps.children,Yr(t,r),h=gt(h),i=i(h),t.flags|=1,Ge(e,t,i,r),t.child;case 14:return i=t.type,h=St(i,t.pendingProps),h=St(i.type,h),Qa(e,t,i,h,r);case 15:return wu(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,h=t.pendingProps,h=t.elementType===i?h:St(i,h),Bs(e,t),t.tag=1,rt(i)?(e=!0,qs(t)):e=!1,Yr(t,r),yu(t,i,h),Uo(t,i,h,r),Ko(null,t,i,!0,e,r);case 19:return ku(e,t,r);case 22:return xu(e,t,r)}throw Error(Y(156,t.tag))};function Uu(e,t){return vh(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 pt(e,t,r,i){return new Tp(e,t,r,i)}function Xl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mp(e){if(typeof e=="function")return Xl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_l)return 11;if(e===pl)return 14}return 2}function nr(e,t){var r=e.alternate;return r===null?(r=pt(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 Ns(e,t,r,i,h,_){var C=2;if(i=e,typeof e=="function")Xl(e)&&(C=1);else if(typeof e=="string")C=5;else e:switch(e){case Br:return Cr(r.children,h,_,t);case fl:C=8,h|=8;break;case fo:return e=pt(12,r,t,h|2),e.elementType=fo,e.lanes=_,e;case _o:return e=pt(13,r,t,h),e.elementType=_o,e.lanes=_,e;case po:return e=pt(19,r,t,h),e.elementType=po,e.lanes=_,e;case Zc:return bn(r,h,_,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Qc:C=10;break e;case Jc:C=9;break e;case _l:C=11;break e;case pl:C=14;break e;case Kt:C=16,i=null;break e}throw Error(Y(130,e==null?e:typeof e,""))}return t=pt(C,r,t,h),t.elementType=e,t.type=i,t.lanes=_,t}function Cr(e,t,r,i){return e=pt(7,e,i,t),e.lanes=r,e}function bn(e,t,r,i){return e=pt(22,e,i,t),e.elementType=Zc,e.lanes=r,e.stateNode={isHidden:!1},e}function ro(e,t,r){return e=pt(6,e,null,t),e.lanes=r,e}function io(e,t,r){return t=pt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Pp(e,t,r,i,h){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=Nn(0),this.expirationTimes=Nn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nn(0),this.identifierPrefix=i,this.onRecoverableError=h,this.mutableSourceEagerHydrationData=null}function Yl(e,t,r,i,h,_,C,s,a){return e=new Pp(e,t,r,s,a),t===1?(t=1,_===!0&&(t|=8)):t=0,_=pt(3,null,null,t),e.current=_,_.stateNode=e,_.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Pl(_),e}function Bp(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Pr,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function Wu(e){if(!e)return ar;e=e._reactInternals;e:{if(kr(e)!==e||e.tag!==1)throw Error(Y(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(rt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Y(171))}if(e.tag===1){var r=e.type;if(rt(r))return Wh(e,r,t)}return t}function Vu(e,t,r,i,h,_,C,s,a){return e=Yl(r,i,!0,e,h,_,C,s,a),e.context=Wu(null),r=e.current,i=qe(),h=sr(r),_=jt(i,h),_.callback=t??null,rr(r,_,h),e.current.lanes=h,Ji(e,h,i),it(e,i),e}function En(e,t,r,i){var h=t.current,_=qe(),C=sr(h);return r=Wu(r),t.context===null?t.context=r:t.pendingContext=r,t=jt(_,C),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=rr(h,t,C),e!==null&&(Et(e,h,C,_),Ts(e,h,C)),C}function an(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 cc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Ql(e,t){cc(e,t),(e=e.alternate)&&cc(e,t)}function Op(){return null}var Ku=typeof reportError=="function"?reportError:function(e){console.error(e)};function Jl(e){this._internalRoot=e}Ln.prototype.render=Jl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Y(409));En(e,t,null,null)};Ln.prototype.unmount=Jl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Er(function(){En(null,e,null,null)}),t[$t]=null}};function Ln(e){this._internalRoot=e}Ln.prototype.unstable_scheduleHydration=function(e){if(e){var t=xh();e={blockedOn:null,target:e,priority:t};for(var r=0;r<qt.length&&t!==0&&t<qt[r].priority;r++);qt.splice(r,0,e),r===0&&Eh(e)}};function Zl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function kn(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function hc(){}function Ip(e,t,r,i,h){if(h){if(typeof i=="function"){var _=i;i=function(){var d=an(C);_.call(d)}}var C=Vu(t,i,e,0,null,!1,!1,"",hc);return e._reactRootContainer=C,e[$t]=C.current,$i(e.nodeType===8?e.parentNode:e),Er(),C}for(;h=e.lastChild;)e.removeChild(h);if(typeof i=="function"){var s=i;i=function(){var d=an(a);s.call(d)}}var a=Yl(e,0,!1,null,null,!1,!1,"",hc);return e._reactRootContainer=a,e[$t]=a.current,$i(e.nodeType===8?e.parentNode:e),Er(function(){En(t,a,r,i)}),a}function Rn(e,t,r,i,h){var _=r._reactRootContainer;if(_){var C=_;if(typeof h=="function"){var s=h;h=function(){var a=an(C);s.call(a)}}En(t,C,e,h)}else C=Ip(r,t,e,h,i);return an(C)}Sh=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=yi(t.pendingLanes);r!==0&&(ml(t,r|1),it(t,ke()),!(de&6)&&(si=ke()+500,ur()))}break;case 13:Er(function(){var i=zt(e,1);if(i!==null){var h=qe();Et(i,e,1,h)}}),Ql(e,1)}};yl=function(e){if(e.tag===13){var t=zt(e,134217728);if(t!==null){var r=qe();Et(t,e,134217728,r)}Ql(e,134217728)}};wh=function(e){if(e.tag===13){var t=sr(e),r=zt(e,t);if(r!==null){var i=qe();Et(r,e,t,i)}Ql(e,t)}};xh=function(){return pe};bh=function(e,t){var r=pe;try{return pe=e,t()}finally{pe=r}};Eo=function(e,t,r){switch(t){case"input":if(mo(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 h=mn(i);if(!h)throw Error(Y(90));th(i),mo(i,h)}}}break;case"textarea":ih(e,r);break;case"select":t=r.value,t!=null&&Kr(e,!!r.multiple,t,!1)}};hh=Kl;uh=Er;var Np={usingClientEntryPoint:!1,Events:[es,Fr,mn,ah,ch,Kl]},pi={findFiberByHostInstance:pr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Fp={bundleType:pi.bundleType,version:pi.version,rendererPackageName:pi.rendererPackageName,rendererConfig:pi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Wt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=_h(e),e===null?null:e.stateNode},findFiberByHostInstance:pi.findFiberByHostInstance||Op,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 ws=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ws.isDisabled&&ws.supportsFiber)try{_n=ws.inject(Fp),Tt=ws}catch{}}ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Np;ut.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Zl(t))throw Error(Y(200));return Bp(e,t,null,r)};ut.createRoot=function(e,t){if(!Zl(e))throw Error(Y(299));var r=!1,i="",h=Ku;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=Yl(e,1,!1,null,null,r,!1,i,h),e[$t]=t.current,$i(e.nodeType===8?e.parentNode:e),new Jl(t)};ut.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(Y(188)):(e=Object.keys(e).join(","),Error(Y(268,e)));return e=_h(t),e=e===null?null:e.stateNode,e};ut.flushSync=function(e){return Er(e)};ut.hydrate=function(e,t,r){if(!kn(t))throw Error(Y(200));return Rn(null,e,t,!0,r)};ut.hydrateRoot=function(e,t,r){if(!Zl(e))throw Error(Y(405));var i=r!=null&&r.hydratedSources||null,h=!1,_="",C=Ku;if(r!=null&&(r.unstable_strictMode===!0&&(h=!0),r.identifierPrefix!==void 0&&(_=r.identifierPrefix),r.onRecoverableError!==void 0&&(C=r.onRecoverableError)),t=Vu(t,null,e,1,r??null,h,!1,_,C),e[$t]=t.current,$i(e),i)for(e=0;e<i.length;e++)r=i[e],h=r._getVersion,h=h(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,h]:t.mutableSourceEagerHydrationData.push(r,h);return new Ln(t)};ut.render=function(e,t,r){if(!kn(t))throw Error(Y(200));return Rn(null,e,t,!1,r)};ut.unmountComponentAtNode=function(e){if(!kn(e))throw Error(Y(40));return e._reactRootContainer?(Er(function(){Rn(null,null,e,!1,function(){e._reactRootContainer=null,e[$t]=null})}),!0):!1};ut.unstable_batchedUpdates=Kl;ut.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!kn(r))throw Error(Y(200));if(e==null||e._reactInternals===void 0)throw Error(Y(38));return Rn(e,t,r,!1,i)};ut.version="18.3.1-next-f1338f8080-20240426";function Gu(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Gu)}catch(e){console.error(e)}}Gu(),Gc.exports=ut;var jp=Gc.exports,uc=jp;ho.createRoot=uc.createRoot,ho.hydrateRoot=uc.hydrateRoot;function qu(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var h=e.length;for(t=0;t<h;t++)e[t]&&(r=qu(e[t]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function st(){for(var e,t,r=0,i="",h=arguments.length;r<h;r++)(e=arguments[r])&&(t=qu(e))&&(i&&(i+=" "),i+=t);return i}function Xu(e,t){const r=$.useRef(null);return $.useEffect(()=>{if(!e)return;const i=r.current;if(!i)return;const h=()=>Array.from(i.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])"));requestAnimationFrame(()=>{const C=h(),s=C.find(a=>a.tagName!=="BUTTON")??C[0];s==null||s.focus()});const _=C=>{if(C.key==="Escape"){C.preventDefault(),t();return}if(C.key!=="Tab")return;const s=h();if(s.length===0)return;const a=s[0],d=s[s.length-1];C.shiftKey?document.activeElement===a&&(C.preventDefault(),d.focus()):document.activeElement===d&&(C.preventDefault(),a.focus())};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[e,t]),r}const Hp=({isOpen:e,workspaces:t,onSubmit:r,onClose:i})=>{var v;const[h,_]=$.useState(((v=t[0])==null?void 0:v.id)||""),[C,s]=$.useState(""),[a,d]=$.useState(!1),g=Xu(e,i);$.useEffect(()=>{e&&t.length>0&&!h&&_(t[0].id)},[e,t,h]);const u=async w=>{if(w.preventDefault(),!a){d(!0);try{await r(C.trim(),h),s("")}finally{d(!1)}}};return e?M.jsx("div",{className:"fixed inset-0 bg-black/50 grid place-items-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"deck-modal-title",children:M.jsxs("form",{className:"modal",ref:g,onSubmit:u,children:[M.jsx("div",{className:"text-[14px] font-semibold mb-3",id:"deck-modal-title",children:"デッキ作成"}),M.jsxs("label",{className:"grid gap-1 text-xs",children:[M.jsx("span",{children:"デッキ名 (任意)"}),M.jsx("input",{type:"text",className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:C,placeholder:"空白のままでもOK",maxLength:100,onChange:w=>s(w.target.value)})]}),M.jsxs("label",{className:"grid gap-1 text-xs mt-3",children:[M.jsx("span",{children:"ワークスペース"}),M.jsx("select",{className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:h,onChange:w=>_(w.target.value),children:t.map(w=>M.jsx("option",{value:w.id,children:w.path},w.id))})]}),M.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[M.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:i,disabled:a,children:"キャンセル"}),M.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:a,children:a?"作成中...":"作成"})]})]})}):null};function $p({activeView:e,onSelect:t,theme:r,onToggleTheme:i,onOpenSettings:h}){return M.jsxs("nav",{className:"activity-bar",children:[M.jsxs("div",{className:"activity-bar-top",children:[M.jsx("button",{type:"button",className:st("activity-bar-item",e==="workspace"&&"active"),onClick:()=>t("workspace"),"aria-label":"Explorer",title:"Explorer (Ctrl+Shift+E)",children:M.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:M.jsx("path",{d:"M17.5 0h-9L7 1.5V6H2.5L1 7.5v15.07L2.5 24h12.07L16 22.57V18h4.7l1.3-1.43V4.5L17.5 0zm0 2.12l2.38 2.38H17.5V2.12zm-3 20.38h-12v-15H7v9.07L8.5 18h6v4.5zm6-6h-12v-15H16V6h4.5v10.5z",fill:"currentColor"})})}),M.jsx("button",{type:"button",className:st("activity-bar-item",e==="terminal"&&"active"),onClick:()=>t("terminal"),"aria-label":"Terminal",title:"Terminal (Ctrl+`)",children:M.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[M.jsx("path",{d:"M21 4H3a1 1 0 00-1 1v14a1 1 0 001 1h18a1 1 0 001-1V5a1 1 0 00-1-1zM4 18V6h16v12H4z",fill:"currentColor"}),M.jsx("path",{d:"M6.5 15.5L10 12 6.5 8.5 8 7l5 5-5 5-1.5-1.5z",fill:"currentColor"}),M.jsx("path",{d:"M13 14h5v2h-5z",fill:"currentColor"})]})})]}),M.jsxs("div",{className:"activity-bar-bottom",children:[M.jsx("button",{type:"button",className:"activity-bar-item",onClick:i,"aria-label":"Toggle Theme",title:r==="dark"?"Switch to Light Theme":"Switch to Dark Theme",children:r==="dark"?M.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:M.jsx("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58a.996.996 0 00-1.41 0 .996.996 0 000 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37a.996.996 0 00-1.41 0 .996.996 0 000 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 000-1.41l-1.06-1.06zm1.06-10.96a.996.996 0 000-1.41.996.996 0 00-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36a.996.996 0 000-1.41.996.996 0 00-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z",fill:"currentColor"})}):M.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:M.jsx("path",{d:"M12 3a9 9 0 109 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 01-4.4 2.26 5.403 5.403 0 01-3.14-9.8c-.44-.06-.9-.1-1.36-.1z",fill:"currentColor"})})}),M.jsx("button",{type:"button",className:"activity-bar-item",onClick:h,"aria-label":"Settings",title:"Settings",children:M.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:M.jsx("path",{d:"M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z",fill:"currentColor"})})})]})]})}const zp=({message:e})=>e?M.jsx("div",{className:"status-float",role:"status",children:e}):null;var Yu={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={4567:function(C,s,a){var d=this&&this.__decorate||function(c,m,y,b){var E,p=arguments.length,x=p<3?m:b===null?b=Object.getOwnPropertyDescriptor(m,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,m,y,b);else for(var D=c.length-1;D>=0;D--)(E=c[D])&&(x=(p<3?E(x):p>3?E(m,y,x):E(m,y))||x);return p>3&&x&&Object.defineProperty(m,y,x),x},g=this&&this.__param||function(c,m){return function(y,b){m(y,b,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const u=a(9042),v=a(6114),w=a(9924),S=a(844),f=a(5596),n=a(4725),o=a(3656);let l=s.AccessibilityManager=class extends S.Disposable{constructor(c,m){super(),this._terminal=c,this._renderService=m,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new w.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(y=>this._handleResize(y.rows))),this.register(this._terminal.onRender(y=>this._refreshRows(y.start,y.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(y=>this._handleChar(y))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
41
+ `))),this.register(this._terminal.onA11yTab(y=>this._handleTab(y))),this.register(this._terminal.onKey(y=>this._handleKey(y.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new f.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,o.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,S.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(c){for(let m=0;m<c;m++)this._handleChar(" ")}_handleChar(c){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==c&&(this._charsToAnnounce+=c):this._charsToAnnounce+=c,c===`
42
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)),v.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,v.isMac&&this._liveRegion.remove()}_handleKey(c){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(c)||this._charsToConsume.push(c)}_refreshRows(c,m){this._liveRegionDebouncer.refresh(c,m,this._terminal.rows)}_renderRows(c,m){const y=this._terminal.buffer,b=y.lines.length.toString();for(let E=c;E<=m;E++){const p=y.translateBufferLineToString(y.ydisp+E,!0),x=(y.ydisp+E+1).toString(),D=this._rowElements[E];D&&(p.length===0?D.innerText=" ":D.textContent=p,D.setAttribute("aria-posinset",x),D.setAttribute("aria-setsize",b))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(c,m){const y=c.target,b=this._rowElements[m===0?1:this._rowElements.length-2];if(y.getAttribute("aria-posinset")===(m===0?"1":`${this._terminal.buffer.lines.length}`)||c.relatedTarget!==b)return;let E,p;if(m===0?(E=y,p=this._rowElements.pop(),this._rowContainer.removeChild(p)):(E=this._rowElements.shift(),p=y,this._rowContainer.removeChild(E)),E.removeEventListener("focus",this._topBoundaryFocusListener),p.removeEventListener("focus",this._bottomBoundaryFocusListener),m===0){const x=this._createAccessibilityTreeNode();this._rowElements.unshift(x),this._rowContainer.insertAdjacentElement("afterbegin",x)}else{const x=this._createAccessibilityTreeNode();this._rowElements.push(x),this._rowContainer.appendChild(x)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(m===0?-1:1),this._rowElements[m===0?1:this._rowElements.length-2].focus(),c.preventDefault(),c.stopImmediatePropagation()}_handleResize(c){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let m=this._rowContainer.children.length;m<this._terminal.rows;m++)this._rowElements[m]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[m]);for(;this._rowElements.length>c;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const c=document.createElement("div");return c.setAttribute("role","listitem"),c.tabIndex=-1,this._refreshRowDimensions(c),c}_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 c=0;c<this._terminal.rows;c++)this._refreshRowDimensions(this._rowElements[c])}}_refreshRowDimensions(c){c.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=l=d([g(1,n.IRenderService)],l)},3614:(C,s)=>{function a(v){return v.replace(/\r?\n/g,"\r")}function d(v,w){return w?"\x1B[200~"+v+"\x1B[201~":v}function g(v,w,S,f){v=d(v=a(v),S.decPrivateModes.bracketedPasteMode&&f.rawOptions.ignoreBracketedPasteMode!==!0),S.triggerDataEvent(v,!0),w.value=""}function u(v,w,S){const f=S.getBoundingClientRect(),n=v.clientX-f.left-10,o=v.clientY-f.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${n}px`,w.style.top=`${o}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=a,s.bracketTextForPaste=d,s.copyHandler=function(v,w){v.clipboardData&&v.clipboardData.setData("text/plain",w.selectionText),v.preventDefault()},s.handlePasteEvent=function(v,w,S,f){v.stopPropagation(),v.clipboardData&&g(v.clipboardData.getData("text/plain"),w,S,f)},s.paste=g,s.moveTextAreaUnderMouseCursor=u,s.rightClickHandler=function(v,w,S,f,n){u(v,w,S),n&&f.rightClickSelect(v),w.value=f.selectionText,w.select()}},7239:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const d=a(1505);s.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(g,u,v){this._css.set(g,u,v)}getCss(g,u){return this._css.get(g,u)}setColor(g,u,v){this._color.set(g,u,v)}getColor(g,u){return this._color.get(g,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(a,d,g,u){a.addEventListener(d,g,u);let v=!1;return{dispose:()=>{v||(v=!0,a.removeEventListener(d,g,u))}}}},6465:function(C,s,a){var d=this&&this.__decorate||function(n,o,l,c){var m,y=arguments.length,b=y<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,o,l,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(o,l,b):m(o,l))||b);return y>3&&b&&Object.defineProperty(o,l,b),b},g=this&&this.__param||function(n,o){return function(l,c){o(l,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier2=void 0;const u=a(3656),v=a(8460),w=a(844),S=a(2585);let f=s.Linkifier2=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(n){super(),this._bufferService=n,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(n){return this._linkProviders.push(n),{dispose:()=>{const o=this._linkProviders.indexOf(n);o!==-1&&this._linkProviders.splice(o,1)}}}attachToDom(n,o,l){this._element=n,this._mouseService=o,this._renderService=l,this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(n){if(this._lastMouseEvent=n,!this._element||!this._mouseService)return;const o=this._positionFromMouseEvent(n,this._element,this._mouseService);if(!o)return;this._isMouseOut=!1;const l=n.composedPath();for(let c=0;c<l.length;c++){const m=l[c];if(m.classList.contains("xterm"))break;if(m.classList.contains("xterm-hover"))return}this._lastBufferCell&&o.x===this._lastBufferCell.x&&o.y===this._lastBufferCell.y||(this._handleHover(o),this._lastBufferCell=o)}_handleHover(n){if(this._activeLine!==n.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(n,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,n)||(this._clearCurrentLink(),this._askForLink(n,!0))}_askForLink(n,o){var l,c;this._activeProviderReplies&&o||((l=this._activeProviderReplies)===null||l===void 0||l.forEach(y=>{y==null||y.forEach(b=>{b.link.dispose&&b.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=n.y);let m=!1;for(const[y,b]of this._linkProviders.entries())o?!((c=this._activeProviderReplies)===null||c===void 0)&&c.get(y)&&(m=this._checkLinkProviderResult(y,n,m)):b.provideLinks(n.y,E=>{var p,x;if(this._isMouseOut)return;const D=E==null?void 0:E.map(R=>({link:R}));(p=this._activeProviderReplies)===null||p===void 0||p.set(y,D),m=this._checkLinkProviderResult(y,n,m),((x=this._activeProviderReplies)===null||x===void 0?void 0:x.size)===this._linkProviders.length&&this._removeIntersectingLinks(n.y,this._activeProviderReplies)})}_removeIntersectingLinks(n,o){const l=new Set;for(let c=0;c<o.size;c++){const m=o.get(c);if(m)for(let y=0;y<m.length;y++){const b=m[y],E=b.link.range.start.y<n?0:b.link.range.start.x,p=b.link.range.end.y>n?this._bufferService.cols:b.link.range.end.x;for(let x=E;x<=p;x++){if(l.has(x)){m.splice(y--,1);break}l.add(x)}}}}_checkLinkProviderResult(n,o,l){var c;if(!this._activeProviderReplies)return l;const m=this._activeProviderReplies.get(n);let y=!1;for(let b=0;b<n;b++)this._activeProviderReplies.has(b)&&!this._activeProviderReplies.get(b)||(y=!0);if(!y&&m){const b=m.find(E=>this._linkAtPosition(E.link,o));b&&(l=!0,this._handleNewLink(b))}if(this._activeProviderReplies.size===this._linkProviders.length&&!l)for(let b=0;b<this._activeProviderReplies.size;b++){const E=(c=this._activeProviderReplies.get(b))===null||c===void 0?void 0:c.find(p=>this._linkAtPosition(p.link,o));if(E){l=!0,this._handleNewLink(E);break}}return l}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(n){if(!this._element||!this._mouseService||!this._currentLink)return;const o=this._positionFromMouseEvent(n,this._element,this._mouseService);o&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,o)&&this._currentLink.link.activate(n,this._currentLink.link.text)}_clearCurrentLink(n,o){this._element&&this._currentLink&&this._lastMouseEvent&&(!n||!o||this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=o)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(n){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._linkAtPosition(n.link,o)&&(this._currentLink=n,this._currentLink.state={decorations:{underline:n.link.decorations===void 0||n.link.decorations.underline,pointerCursor:n.link.decorations===void 0||n.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,n.link,this._lastMouseEvent),n.link.decorations={},Object.defineProperties(n.link.decorations,{pointerCursor:{get:()=>{var l,c;return(c=(l=this._currentLink)===null||l===void 0?void 0:l.state)===null||c===void 0?void 0:c.decorations.pointerCursor},set:l=>{var c,m;!((c=this._currentLink)===null||c===void 0)&&c.state&&this._currentLink.state.decorations.pointerCursor!==l&&(this._currentLink.state.decorations.pointerCursor=l,this._currentLink.state.isHovered&&((m=this._element)===null||m===void 0||m.classList.toggle("xterm-cursor-pointer",l)))}},underline:{get:()=>{var l,c;return(c=(l=this._currentLink)===null||l===void 0?void 0:l.state)===null||c===void 0?void 0:c.decorations.underline},set:l=>{var c,m,y;!((c=this._currentLink)===null||c===void 0)&&c.state&&((y=(m=this._currentLink)===null||m===void 0?void 0:m.state)===null||y===void 0?void 0:y.decorations.underline)!==l&&(this._currentLink.state.decorations.underline=l,this._currentLink.state.isHovered&&this._fireUnderlineEvent(n.link,l))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(l=>{if(!this._currentLink)return;const c=l.start===0?0:l.start+1+this._bufferService.buffer.ydisp,m=this._bufferService.buffer.ydisp+1+l.end;if(this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=m&&(this._clearCurrentLink(c,m),this._lastMouseEvent&&this._element)){const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}})))}_linkHover(n,o,l){var c;!((c=this._currentLink)===null||c===void 0)&&c.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!0),this._currentLink.state.decorations.pointerCursor&&n.classList.add("xterm-cursor-pointer")),o.hover&&o.hover(l,o.text)}_fireUnderlineEvent(n,o){const l=n.range,c=this._bufferService.buffer.ydisp,m=this._createLinkUnderlineEvent(l.start.x-1,l.start.y-c-1,l.end.x,l.end.y-c-1,void 0);(o?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(m)}_linkLeave(n,o,l){var c;!((c=this._currentLink)===null||c===void 0)&&c.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!1),this._currentLink.state.decorations.pointerCursor&&n.classList.remove("xterm-cursor-pointer")),o.leave&&o.leave(l,o.text)}_linkAtPosition(n,o){const l=n.range.start.y*this._bufferService.cols+n.range.start.x,c=n.range.end.y*this._bufferService.cols+n.range.end.x,m=o.y*this._bufferService.cols+o.x;return l<=m&&m<=c}_positionFromMouseEvent(n,o,l){const c=l.getCoords(n,o,this._bufferService.cols,this._bufferService.rows);if(c)return{x:c[0],y:c[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(n,o,l,c,m){return{x1:n,y1:o,x2:l,y2:c,cols:this._bufferService.cols,fg:m}}};s.Linkifier2=f=d([g(0,S.IBufferService)],f)},9042:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(C,s,a){var d=this&&this.__decorate||function(f,n,o,l){var c,m=arguments.length,y=m<3?n:l===null?l=Object.getOwnPropertyDescriptor(n,o):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,n,o,l);else for(var b=f.length-1;b>=0;b--)(c=f[b])&&(y=(m<3?c(y):m>3?c(n,o,y):c(n,o))||y);return m>3&&y&&Object.defineProperty(n,o,y),y},g=this&&this.__param||function(f,n){return function(o,l){n(o,l,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const u=a(511),v=a(2585);let w=s.OscLinkProvider=class{constructor(f,n,o){this._bufferService=f,this._optionsService=n,this._oscLinkService=o}provideLinks(f,n){var o;const l=this._bufferService.buffer.lines.get(f-1);if(!l)return void n(void 0);const c=[],m=this._optionsService.rawOptions.linkHandler,y=new u.CellData,b=l.getTrimmedLength();let E=-1,p=-1,x=!1;for(let D=0;D<b;D++)if(p!==-1||l.hasContent(D)){if(l.loadCell(D,y),y.hasExtendedAttrs()&&y.extended.urlId){if(p===-1){p=D,E=y.extended.urlId;continue}x=y.extended.urlId!==E}else p!==-1&&(x=!0);if(x||p!==-1&&D===b-1){const R=(o=this._oscLinkService.getLinkData(E))===null||o===void 0?void 0:o.uri;if(R){const k={start:{x:p+1,y:f},end:{x:D+(x||D!==b-1?0:1),y:f}};let B=!1;if(!(m!=null&&m.allowNonHttpProtocols))try{const O=new URL(R);["http:","https:"].includes(O.protocol)||(B=!0)}catch{B=!0}B||c.push({text:R,range:k,activate:(O,F)=>m?m.activate(O,F,k):S(0,F),hover:(O,F)=>{var N;return(N=m==null?void 0:m.hover)===null||N===void 0?void 0:N.call(m,O,F,k)},leave:(O,F)=>{var N;return(N=m==null?void 0:m.leave)===null||N===void 0?void 0:N.call(m,O,F,k)}})}x=!1,y.hasExtendedAttrs()&&y.extended.urlId?(p=D,E=y.extended.urlId):(p=-1,E=-1)}}n(c)}};function S(f,n){if(confirm(`Do you want to navigate to ${n}?
43
+
44
+ WARNING: This link could potentially be dangerous`)){const o=window.open();if(o){try{o.opener=null}catch{}o.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=w=d([g(0,v.IBufferService),g(1,v.IOptionsService),g(2,v.IOscLinkService)],w)},6193:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(a,d){this._parentWindow=a,this._renderCallback=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,d,g){this._rowCount=g,a=a!==void 0?a:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},5596:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ScreenDprMonitor=void 0;const d=a(844);class g extends d.Disposable{constructor(v){super(),this._parentWindow=v,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,d.toDisposable)(()=>{this.clearListener()}))}setListener(v){this._listener&&this.clearListener(),this._listener=v,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)===null||v===void 0||v.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}s.ScreenDprMonitor=g},3236:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const d=a(3614),g=a(3656),u=a(6465),v=a(9042),w=a(3730),S=a(1680),f=a(3107),n=a(5744),o=a(2950),l=a(1296),c=a(428),m=a(4269),y=a(5114),b=a(8934),E=a(3230),p=a(9312),x=a(4725),D=a(6731),R=a(8055),k=a(8969),B=a(8460),O=a(844),F=a(6114),N=a(8437),H=a(2584),L=a(7399),T=a(5941),P=a(9074),I=a(2585),z=a(5435),V=a(4567),G=typeof window<"u"?window.document:null;class K extends k.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(A={}){super(A),this.browser=F,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new O.MutableDisposable),this._onCursorMove=this.register(new B.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new B.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new B.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new B.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new B.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new B.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new B.EventEmitter),this._onBlur=this.register(new B.EventEmitter),this._onA11yCharEmitter=this.register(new B.EventEmitter),this._onA11yTabEmitter=this.register(new B.EventEmitter),this._onWillOpen=this.register(new B.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(u.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(w.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(P.DecorationService),this._instantiationService.setService(I.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((j,W)=>this.refresh(j,W))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(j=>this._reportWindowsOptions(j))),this.register(this._inputHandler.onColor(j=>this._handleColorEvent(j))),this.register((0,B.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,B.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(j=>this._afterResize(j.cols,j.rows))),this.register((0,O.toDisposable)(()=>{var j,W;this._customKeyEventHandler=void 0,(W=(j=this.element)===null||j===void 0?void 0:j.parentNode)===null||W===void 0||W.removeChild(this.element)}))}_handleColorEvent(A){if(this._themeService)for(const j of A){let W,U="";switch(j.index){case 256:W="foreground",U="10";break;case 257:W="background",U="11";break;case 258:W="cursor",U="12";break;default:W="ansi",U="4;"+j.index}switch(j.type){case 0:const Q=R.color.toColorRGB(W==="ansi"?this._themeService.colors.ansi[j.index]:this._themeService.colors[W]);this.coreService.triggerDataEvent(`${H.C0.ESC}]${U};${(0,T.toRgbString)(Q)}${H.C1_ESCAPED.ST}`);break;case 1:if(W==="ansi")this._themeService.modifyColors(X=>X.ansi[j.index]=R.rgba.toColor(...j.color));else{const X=W;this._themeService.modifyColors(ie=>ie[X]=R.rgba.toColor(...j.color))}break;case 2:this._themeService.restoreColor(j.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(A){A?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(A){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(H.C0.ESC+"[I"),this.updateCursorStyle(A),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var A;return(A=this.textarea)===null||A===void 0?void 0:A.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(H.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const A=this.buffer.ybase+this.buffer.y,j=this.buffer.lines.get(A);if(!j)return;const W=Math.min(this.buffer.x,this.cols-1),U=this._renderService.dimensions.css.cell.height,Q=j.getWidth(W),X=this._renderService.dimensions.css.cell.width*Q,ie=this.buffer.y*this._renderService.dimensions.css.cell.height,fe=W*this._renderService.dimensions.css.cell.width;this.textarea.style.left=fe+"px",this.textarea.style.top=ie+"px",this.textarea.style.width=X+"px",this.textarea.style.height=U+"px",this.textarea.style.lineHeight=U+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",j=>{this.hasSelection()&&(0,d.copyHandler)(j,this._selectionService)}));const A=j=>(0,d.handlePasteEvent)(j,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",A)),this.register((0,g.addDisposableDomListener)(this.element,"paste",A)),F.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",j=>{j.button===2&&(0,d.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",j=>{(0,d.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),F.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",j=>{j.button===1&&(0,d.moveTextAreaUnderMouseCursor)(j,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",A=>this._keyUp(A),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",A=>this._keyDown(A),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",A=>this._keyPress(A),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",A=>this._compositionHelper.compositionupdate(A))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,g.addDisposableDomListener)(this.textarea,"input",A=>this._inputEvent(A),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(A){var j;if(!A)throw new Error("Terminal requires a parent element.");A.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=A.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),A.appendChild(this.element);const W=G.createDocumentFragment();this._viewportElement=G.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),W.appendChild(this._viewportElement),this._viewportScrollArea=G.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=G.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=G.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),W.appendChild(this.screenElement),this.textarea=G.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.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._instantiationService.createInstance(y.CoreBrowserService,this.textarea,(j=this._document.defaultView)!==null&&j!==void 0?j:window),this._instantiationService.setService(x.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",U=>this._handleTextAreaFocus(U))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(c.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(x.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(D.ThemeService),this._instantiationService.setService(x.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(m.CharacterJoinerService),this._instantiationService.setService(x.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(E.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(x.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(U=>this._onRender.fire(U))),this.onResize(U=>this._renderService.resize(U.cols,U.rows)),this._compositionView=G.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.element.appendChild(W);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(x.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(S.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(U=>this.scrollLines(U.amount,U.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(p.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(x.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(U=>this.scrollLines(U.amount,U.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(U=>this._renderService.handleSelectionChanged(U.start,U.end,U.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(U=>{this.textarea.value=U,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(U=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(f.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",U=>this._selectionService.handleMouseDown(U))),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(V.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",U=>this._handleScreenReaderModeOptionChange(U))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",U=>{!this._overviewRulerRenderer&&U&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(l.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const A=this,j=this.element;function W(X){const ie=A._mouseService.getMouseReportCoords(X,A.screenElement);if(!ie)return!1;let fe,_e;switch(X.overrideType||X.type){case"mousemove":_e=32,X.buttons===void 0?(fe=3,X.button!==void 0&&(fe=X.button<3?X.button:3)):fe=1&X.buttons?0:4&X.buttons?1:2&X.buttons?2:3;break;case"mouseup":_e=0,fe=X.button<3?X.button:3;break;case"mousedown":_e=1,fe=X.button<3?X.button:3;break;case"wheel":if(A.viewport.getLinesScrolled(X)===0)return!1;_e=X.deltaY<0?0:1,fe=4;break;default:return!1}return!(_e===void 0||fe===void 0||fe>4)&&A.coreMouseService.triggerMouseEvent({col:ie.col,row:ie.row,x:ie.x,y:ie.y,button:fe,action:_e,ctrl:X.ctrlKey,alt:X.altKey,shift:X.shiftKey})}const U={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Q={mouseup:X=>(W(X),X.buttons||(this._document.removeEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.removeEventListener("mousemove",U.mousedrag)),this.cancel(X)),wheel:X=>(W(X),this.cancel(X,!0)),mousedrag:X=>{X.buttons&&W(X)},mousemove:X=>{X.buttons||W(X)}};this.register(this.coreMouseService.onProtocolChange(X=>{X?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(X)),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&X?U.mousemove||(j.addEventListener("mousemove",Q.mousemove),U.mousemove=Q.mousemove):(j.removeEventListener("mousemove",U.mousemove),U.mousemove=null),16&X?U.wheel||(j.addEventListener("wheel",Q.wheel,{passive:!1}),U.wheel=Q.wheel):(j.removeEventListener("wheel",U.wheel),U.wheel=null),2&X?U.mouseup||(j.addEventListener("mouseup",Q.mouseup),U.mouseup=Q.mouseup):(this._document.removeEventListener("mouseup",U.mouseup),j.removeEventListener("mouseup",U.mouseup),U.mouseup=null),4&X?U.mousedrag||(U.mousedrag=Q.mousedrag):(this._document.removeEventListener("mousemove",U.mousedrag),U.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(j,"mousedown",X=>{if(X.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(X))return W(X),U.mouseup&&this._document.addEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.addEventListener("mousemove",U.mousedrag),this.cancel(X)})),this.register((0,g.addDisposableDomListener)(j,"wheel",X=>{if(!U.wheel){if(!this.buffer.hasScrollback){const ie=this.viewport.getLinesScrolled(X);if(ie===0)return;const fe=H.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(X.deltaY<0?"A":"B");let _e="";for(let ce=0;ce<Math.abs(ie);ce++)_e+=fe;return this.coreService.triggerDataEvent(_e,!0),this.cancel(X,!0)}return this.viewport.handleWheel(X)?this.cancel(X):void 0}},{passive:!1})),this.register((0,g.addDisposableDomListener)(j,"touchstart",X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(X),this.cancel(X)},{passive:!0})),this.register((0,g.addDisposableDomListener)(j,"touchmove",X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(X)?void 0:this.cancel(X)},{passive:!1}))}refresh(A,j){var W;(W=this._renderService)===null||W===void 0||W.refreshRows(A,j)}updateCursorStyle(A){var j;!((j=this._selectionService)===null||j===void 0)&&j.shouldColumnSelect(A)?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(A,j,W=0){var U;W===1?(super.scrollLines(A,j,W),this.refresh(0,this.rows-1)):(U=this.viewport)===null||U===void 0||U.scrollLines(A)}paste(A){(0,d.paste)(A,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(A){this._customKeyEventHandler=A}registerLinkProvider(A){return this.linkifier2.registerLinkProvider(A)}registerCharacterJoiner(A){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const j=this._characterJoinerService.register(A);return this.refresh(0,this.rows-1),j}deregisterCharacterJoiner(A){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(A)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(A){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+A)}registerDecoration(A){return this._decorationService.registerDecoration(A)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(A,j,W){this._selectionService.setSelection(A,j,W)}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 A;(A=this._selectionService)===null||A===void 0||A.clearSelection()}selectAll(){var A;(A=this._selectionService)===null||A===void 0||A.selectAll()}selectLines(A,j){var W;(W=this._selectionService)===null||W===void 0||W.selectLines(A,j)}_keyDown(A){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;const j=this.browser.isMac&&this.options.macOptionIsMeta&&A.altKey;if(!j&&!this._compositionHelper.keydown(A))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;j||A.key!=="Dead"&&A.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const W=(0,L.evaluateKeyboardEvent)(A,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(A),W.type===3||W.type===2){const U=this.rows-1;return this.scrollLines(W.type===2?-U:U),this.cancel(A,!0)}return W.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,A)||(W.cancel&&this.cancel(A,!0),!W.key||!!(A.key&&!A.ctrlKey&&!A.altKey&&!A.metaKey&&A.key.length===1&&A.key.charCodeAt(0)>=65&&A.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(W.key!==H.C0.ETX&&W.key!==H.C0.CR||(this.textarea.value=""),this._onKey.fire({key:W.key,domEvent:A}),this._showCursor(),this.coreService.triggerDataEvent(W.key,!0),!this.optionsService.rawOptions.screenReaderMode||A.altKey||A.ctrlKey?this.cancel(A,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(A,j){const W=A.isMac&&!this.options.macOptionIsMeta&&j.altKey&&!j.ctrlKey&&!j.metaKey||A.isWindows&&j.altKey&&j.ctrlKey&&!j.metaKey||A.isWindows&&j.getModifierState("AltGraph");return j.type==="keypress"?W:W&&(!j.keyCode||j.keyCode>47)}_keyUp(A){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1||(function(j){return j.keyCode===16||j.keyCode===17||j.keyCode===18}(A)||this.focus(),this.updateCursorStyle(A),this._keyPressHandled=!1)}_keyPress(A){let j;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;if(this.cancel(A),A.charCode)j=A.charCode;else if(A.which===null||A.which===void 0)j=A.keyCode;else{if(A.which===0||A.charCode===0)return!1;j=A.which}return!(!j||(A.altKey||A.ctrlKey||A.metaKey)&&!this._isThirdLevelShift(this.browser,A)||(j=String.fromCharCode(j),this._onKey.fire({key:j,domEvent:A}),this._showCursor(),this.coreService.triggerDataEvent(j,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(A){if(A.data&&A.inputType==="insertText"&&(!A.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const j=A.data;return this.coreService.triggerDataEvent(j,!0),this.cancel(A),!0}return!1}resize(A,j){A!==this.cols||j!==this.rows?super.resize(A,j):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(A,j){var W,U;(W=this._charSizeService)===null||W===void 0||W.measure(),(U=this.viewport)===null||U===void 0||U.syncScrollArea(!0)}clear(){var A;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let j=1;j<this.rows;j++)this.buffer.lines.push(this.buffer.getBlankLine(N.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(A=this.viewport)===null||A===void 0||A.reset(),this.refresh(0,this.rows-1)}}reset(){var A,j;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),(A=this._selectionService)===null||A===void 0||A.reset(),this._decorationService.reset(),(j=this.viewport)===null||j===void 0||j.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var A;(A=this._renderService)===null||A===void 0||A.clearTextureAtlas()}_reportFocus(){var A;!((A=this.element)===null||A===void 0)&&A.classList.contains("focus")?this.coreService.triggerDataEvent(H.C0.ESC+"[I"):this.coreService.triggerDataEvent(H.C0.ESC+"[O")}_reportWindowsOptions(A){if(this._renderService)switch(A){case z.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const j=this._renderService.dimensions.css.canvas.width.toFixed(0),W=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${H.C0.ESC}[4;${W};${j}t`);break;case z.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const U=this._renderService.dimensions.css.cell.width.toFixed(0),Q=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${H.C0.ESC}[6;${Q};${U}t`)}}cancel(A,j){if(this.options.cancelEvents||j)return A.preventDefault(),A.stopPropagation(),!1}}s.Terminal=K},9924:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(a,d=1e3){this._renderCallback=a,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,d,g){this._rowCount=g,a=a!==void 0?a:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=u-this._lastRefreshMs,w=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},w)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,d)}}},1680:function(C,s,a){var d=this&&this.__decorate||function(o,l,c,m){var y,b=arguments.length,E=b<3?l:m===null?m=Object.getOwnPropertyDescriptor(l,c):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(o,l,c,m);else for(var p=o.length-1;p>=0;p--)(y=o[p])&&(E=(b<3?y(E):b>3?y(l,c,E):y(l,c))||E);return b>3&&E&&Object.defineProperty(l,c,E),E},g=this&&this.__param||function(o,l){return function(c,m){l(c,m,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const u=a(3656),v=a(4725),w=a(8460),S=a(844),f=a(2585);let n=s.Viewport=class extends S.Disposable{constructor(o,l,c,m,y,b,E,p){super(),this._viewportElement=o,this._scrollArea=l,this._bufferService=c,this._optionsService=m,this._charSizeService=y,this._renderService=b,this._coreBrowserService=E,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(x=>this._activeBuffer=x.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(x=>this._renderDimensions=x)),this._handleThemeChange(p.colors),this.register(p.onChangeColors(x=>this._handleThemeChange(x))),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._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const l=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==l&&(this._lastRecordedBufferHeight=l,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 l=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:l,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,l){const c=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(l<0&&this._viewportElement.scrollTop!==0||l>0&&c<this._lastRecordedBufferHeight)||(o.cancelable&&o.preventDefault(),!1)}handleWheel(o){const l=this._getPixelsScrolled(o);return l!==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+l:this._smoothScrollState.target+=l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=l,this._bubbleScroll(o,l))}scrollLines(o){if(o!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const l=o*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+l,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 l=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_LINE?l*=this._currentRowHeight:o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._currentRowHeight*this._bufferService.rows),l}getBufferElements(o,l){var c;let m,y="";const b=[],E=l??this._bufferService.buffer.lines.length,p=this._bufferService.buffer.lines;for(let x=o;x<E;x++){const D=p.get(x);if(!D)continue;const R=(c=p.get(x+1))===null||c===void 0?void 0:c.isWrapped;if(y+=D.translateToString(!R),!R||x===p.length-1){const k=document.createElement("div");k.textContent=y,b.push(k),y.length>0&&(m=k),y=""}}return{bufferElements:b,cursorElement:m}}getLinesScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let l=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(l/=this._currentRowHeight+0,this._wheelPartialScroll+=l,l=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l}_applyScrollModifier(o,l){const c=this._optionsService.rawOptions.fastScrollModifier;return c==="alt"&&l.altKey||c==="ctrl"&&l.ctrlKey||c==="shift"&&l.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 l=this._lastTouchY-o.touches[0].pageY;return this._lastTouchY=o.touches[0].pageY,l!==0&&(this._viewportElement.scrollTop+=l,this._bubbleScroll(o,l))}};s.Viewport=n=d([g(2,f.IBufferService),g(3,f.IOptionsService),g(4,v.ICharSizeService),g(5,v.IRenderService),g(6,v.ICoreBrowserService),g(7,v.IThemeService)],n)},3107:function(C,s,a){var d=this&&this.__decorate||function(n,o,l,c){var m,y=arguments.length,b=y<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,o,l,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(o,l,b):m(o,l))||b);return y>3&&b&&Object.defineProperty(o,l,b),b},g=this&&this.__param||function(n,o){return function(l,c){o(l,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const u=a(3656),v=a(4725),w=a(844),S=a(2585);let f=s.BufferDecorationRenderer=class extends w.Disposable{constructor(n,o,l,c){super(),this._screenElement=n,this._bufferService=o,this._decorationService=l,this._renderService=c,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register((0,u.addDisposableDomListener)(window,"resize",()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(m=>this._removeDecoration(m))),this.register((0,w.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 n of this._decorationService.decorations)this._renderDecoration(n);this._dimensionsChanged=!1}_renderDecoration(n){this._refreshStyle(n),this._dimensionsChanged&&this._refreshXPosition(n)}_createElement(n){var o,l;const c=document.createElement("div");c.classList.add("xterm-decoration"),c.classList.toggle("xterm-decoration-top-layer",((o=n==null?void 0:n.options)===null||o===void 0?void 0:o.layer)==="top"),c.style.width=`${Math.round((n.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,c.style.height=(n.options.height||1)*this._renderService.dimensions.css.cell.height+"px",c.style.top=(n.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 m=(l=n.options.x)!==null&&l!==void 0?l:0;return m&&m>this._bufferService.cols&&(c.style.display="none"),this._refreshXPosition(n,c),c}_refreshStyle(n){const o=n.marker.line-this._bufferService.buffers.active.ydisp;if(o<0||o>=this._bufferService.rows)n.element&&(n.element.style.display="none",n.onRenderEmitter.fire(n.element));else{let l=this._decorationElements.get(n);l||(l=this._createElement(n),n.element=l,this._decorationElements.set(n,l),this._container.appendChild(l),n.onDispose(()=>{this._decorationElements.delete(n),l.remove()})),l.style.top=o*this._renderService.dimensions.css.cell.height+"px",l.style.display=this._altBufferIsActive?"none":"block",n.onRenderEmitter.fire(l)}}_refreshXPosition(n,o=n.element){var l;if(!o)return;const c=(l=n.options.x)!==null&&l!==void 0?l:0;(n.options.anchor||"left")==="right"?o.style.right=c?c*this._renderService.dimensions.css.cell.width+"px":"":o.style.left=c?c*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(n){var o;(o=this._decorationElements.get(n))===null||o===void 0||o.remove(),this._decorationElements.delete(n),n.dispose()}};s.BufferDecorationRenderer=f=d([g(1,S.IBufferService),g(2,S.IDecorationService),g(3,v.IRenderService)],f)},5871:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.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(a){if(a.options.overviewRulerOptions){for(const d of this._zones)if(d.color===a.options.overviewRulerOptions.color&&d.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,a.marker.line))return;if(this._lineAdjacentToZone(d,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(d,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,d){return d>=a.startBufferLine&&d<=a.endBufferLine}_lineAdjacentToZone(a,d,g){return d>=a.startBufferLine-this._linePadding[g||"full"]&&d<=a.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(a,d){a.startBufferLine=Math.min(a.startBufferLine,d),a.endBufferLine=Math.max(a.endBufferLine,d)}}},5744:function(C,s,a){var d=this&&this.__decorate||function(m,y,b,E){var p,x=arguments.length,D=x<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(m,y,b,E);else for(var R=m.length-1;R>=0;R--)(p=m[R])&&(D=(x<3?p(D):x>3?p(y,b,D):p(y,b))||D);return x>3&&D&&Object.defineProperty(y,b,D),D},g=this&&this.__param||function(m,y){return function(b,E){y(b,E,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const u=a(5871),v=a(3656),w=a(4725),S=a(844),f=a(2585),n={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0};let c=s.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(m,y,b,E,p,x,D){var R;super(),this._viewportElement=m,this._screenElement=y,this._bufferService=b,this._decorationService=E,this._renderService=p,this._optionsService=x,this._coreBrowseService=D,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(R=this._viewportElement.parentElement)===null||R===void 0||R.insertBefore(this._canvas,this._viewportElement);const k=this._canvas.getContext("2d");if(!k)throw new Error("Ctx cannot be null");this._ctx=k,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)(()=>{var B;(B=this._canvas)===null||B===void 0||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((0,v.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const m=Math.floor(this._canvas.width/3),y=Math.ceil(this._canvas.width/3);o.full=this._canvas.width,o.left=m,o.center=y,o.right=m,this._refreshDrawHeightConstants(),l.full=0,l.left=0,l.center=o.left,l.right=o.left+o.center}_refreshDrawHeightConstants(){n.full=Math.round(2*this._coreBrowseService.dpr);const m=this._canvas.height/this._bufferService.buffer.lines.length,y=Math.round(Math.max(Math.min(m,12),6)*this._coreBrowseService.dpr);n.left=y,n.center=y,n.right=y}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*n.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*n.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*n.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*n.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const y of this._decorationService.decorations)this._colorZoneStore.addDecoration(y);this._ctx.lineWidth=1;const m=this._colorZoneStore.zones;for(const y of m)y.position!=="full"&&this._renderColorZone(y);for(const y of m)y.position==="full"&&this._renderColorZone(y);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(m){this._ctx.fillStyle=m.color,this._ctx.fillRect(l[m.position||"full"],Math.round((this._canvas.height-1)*(m.startBufferLine/this._bufferService.buffers.active.lines.length)-n[m.position||"full"]/2),o[m.position||"full"],Math.round((this._canvas.height-1)*((m.endBufferLine-m.startBufferLine)/this._bufferService.buffers.active.lines.length)+n[m.position||"full"]))}_queueRefresh(m,y){this._shouldUpdateDimensions=m||this._shouldUpdateDimensions,this._shouldUpdateAnchor=y||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};s.OverviewRulerRenderer=c=d([g(2,f.IBufferService),g(3,f.IDecorationService),g(4,w.IRenderService),g(5,f.IOptionsService),g(6,w.ICoreBrowserService)],c)},2950:function(C,s,a){var d=this&&this.__decorate||function(f,n,o,l){var c,m=arguments.length,y=m<3?n:l===null?l=Object.getOwnPropertyDescriptor(n,o):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,n,o,l);else for(var b=f.length-1;b>=0;b--)(c=f[b])&&(y=(m<3?c(y):m>3?c(n,o,y):c(n,o))||y);return m>3&&y&&Object.defineProperty(n,o,y),y},g=this&&this.__param||function(f,n){return function(o,l){n(o,l,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const u=a(4725),v=a(2585),w=a(2584);let S=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(f,n,o,l,c,m){this._textarea=f,this._compositionView=n,this._bufferService=o,this._optionsService=l,this._coreService=c,this._renderService=m,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(f){this._compositionView.textContent=f.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(f){if(this._isComposing||this._isSendingComposition){if(f.keyCode===229||f.keyCode===16||f.keyCode===17||f.keyCode===18)return!1;this._finalizeComposition(!1)}return f.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(f){if(this._compositionView.classList.remove("active"),this._isComposing=!1,f){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let o;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,o=this._isComposing?this._textarea.value.substring(n.start,n.end):this._textarea.value.substring(n.start),o.length>0&&this._coreService.triggerDataEvent(o,!0)}},0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const f=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const n=this._textarea.value,o=n.replace(f,"");this._dataAlreadySent=o,n.length>f.length?this._coreService.triggerDataEvent(o,!0):n.length<f.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):n.length===f.length&&n!==f&&this._coreService.triggerDataEvent(n,!0)}},0)}updateCompositionElements(f){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),o=this._renderService.dimensions.css.cell.height,l=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,c=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=c+"px",this._compositionView.style.top=l+"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 m=this._compositionView.getBoundingClientRect();this._textarea.style.left=c+"px",this._textarea.style.top=l+"px",this._textarea.style.width=Math.max(m.width,1)+"px",this._textarea.style.height=Math.max(m.height,1)+"px",this._textarea.style.lineHeight=m.height+"px"}f||setTimeout(()=>this.updateCompositionElements(!0),0)}}};s.CompositionHelper=S=d([g(2,v.IBufferService),g(3,v.IOptionsService),g(4,v.ICoreService),g(5,u.IRenderService)],S)},9806:(C,s)=>{function a(d,g,u){const v=u.getBoundingClientRect(),w=d.getComputedStyle(u),S=parseInt(w.getPropertyValue("padding-left")),f=parseInt(w.getPropertyValue("padding-top"));return[g.clientX-v.left-S,g.clientY-v.top-f]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=a,s.getCoords=function(d,g,u,v,w,S,f,n,o){if(!S)return;const l=a(d,g,u);return l?(l[0]=Math.ceil((l[0]+(o?f/2:0))/f),l[1]=Math.ceil(l[1]/n),l[0]=Math.min(Math.max(l[0],1),v+(o?1:0)),l[1]=Math.min(Math.max(l[1],1),w),l):void 0}},9504:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const d=a(2584);function g(n,o,l,c){const m=n-u(n,l),y=o-u(o,l),b=Math.abs(m-y)-function(E,p,x){let D=0;const R=E-u(E,x),k=p-u(p,x);for(let B=0;B<Math.abs(R-k);B++){const O=v(E,p)==="A"?-1:1,F=x.buffer.lines.get(R+O*B);F!=null&&F.isWrapped&&D++}return D}(n,o,l);return f(b,S(v(n,o),c))}function u(n,o){let l=0,c=o.buffer.lines.get(n),m=c==null?void 0:c.isWrapped;for(;m&&n>=0&&n<o.rows;)l++,c=o.buffer.lines.get(--n),m=c==null?void 0:c.isWrapped;return l}function v(n,o){return n>o?"A":"B"}function w(n,o,l,c,m,y){let b=n,E=o,p="";for(;b!==l||E!==c;)b+=m?1:-1,m&&b>y.cols-1?(p+=y.buffer.translateBufferLineToString(E,!1,n,b),b=0,n=0,E++):!m&&b<0&&(p+=y.buffer.translateBufferLineToString(E,!1,0,n+1),b=y.cols-1,n=b,E--);return p+y.buffer.translateBufferLineToString(E,!1,n,b)}function S(n,o){const l=o?"O":"[";return d.C0.ESC+l+n}function f(n,o){n=Math.floor(n);let l="";for(let c=0;c<n;c++)l+=o;return l}s.moveToCellSequence=function(n,o,l,c){const m=l.buffer.x,y=l.buffer.y;if(!l.buffer.hasScrollback)return function(p,x,D,R,k,B){return g(x,R,k,B).length===0?"":f(w(p,x,p,x-u(x,k),!1,k).length,S("D",B))}(m,y,0,o,l,c)+g(y,o,l,c)+function(p,x,D,R,k,B){let O;O=g(x,R,k,B).length>0?R-u(R,k):x;const F=R,N=function(H,L,T,P,I,z){let V;return V=g(T,P,I,z).length>0?P-u(P,I):L,H<T&&V<=P||H>=T&&V<P?"C":"D"}(p,x,D,R,k,B);return f(w(p,O,D,F,N==="C",k).length,S(N,B))}(m,y,n,o,l,c);let b;if(y===o)return b=m>n?"D":"C",f(Math.abs(m-n),S(b,c));b=y>o?"D":"C";const E=Math.abs(y-o);return f(function(p,x){return x.cols-p}(y>o?n:m,l)+(E-1)*l.cols+1+((y>o?m:n)-1),S(b,c))}},1296:function(C,s,a){var d=this&&this.__decorate||function(k,B,O,F){var N,H=arguments.length,L=H<3?B:F===null?F=Object.getOwnPropertyDescriptor(B,O):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(k,B,O,F);else for(var T=k.length-1;T>=0;T--)(N=k[T])&&(L=(H<3?N(L):H>3?N(B,O,L):N(B,O))||L);return H>3&&L&&Object.defineProperty(B,O,L),L},g=this&&this.__param||function(k,B){return function(O,F){B(O,F,k)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const u=a(3787),v=a(2550),w=a(2223),S=a(6171),f=a(4725),n=a(8055),o=a(8460),l=a(844),c=a(2585),m="xterm-dom-renderer-owner-",y="xterm-rows",b="xterm-fg-",E="xterm-bg-",p="xterm-focus",x="xterm-selection";let D=1,R=s.DomRenderer=class extends l.Disposable{constructor(k,B,O,F,N,H,L,T,P,I){super(),this._element=k,this._screenElement=B,this._viewportElement=O,this._linkifier2=F,this._charSizeService=H,this._optionsService=L,this._bufferService=T,this._coreBrowserService=P,this._themeService=I,this._terminalClass=D++,this._rowElements=[],this.onRequestRedraw=this.register(new o.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(y),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(x),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,S.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=N.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(m+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(m+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new v.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const k=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*k,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*k),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/k),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/k),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 O of this._rowElements)O.style.width=`${this.dimensions.css.canvas.width}px`,O.style.height=`${this.dimensions.css.cell.height}px`,O.style.lineHeight=`${this.dimensions.css.cell.height}px`,O.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const B=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=B,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(k){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let B=`${this._terminalSelector} .${y} { color: ${k.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;B+=`${this._terminalSelector} .${y} .xterm-dim { color: ${n.color.multiplyOpacity(k.foreground,.5).css};}`,B+=`${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;}`,B+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",B+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${k.cursor.css}; color: ${k.cursorAccent.css}; } 50% { background-color: inherit; color: ${k.cursor.css}; }}`,B+=`${this._terminalSelector} .${y}.${p} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${y}.${p} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${k.cursor.css}; color: ${k.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${k.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${k.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${k.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,B+=`${this._terminalSelector} .${x} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${x} div { position: absolute; background-color: ${k.selectionBackgroundOpaque.css};}${this._terminalSelector} .${x} div { position: absolute; background-color: ${k.selectionInactiveBackgroundOpaque.css};}`;for(const[O,F]of k.ansi.entries())B+=`${this._terminalSelector} .${b}${O} { color: ${F.css}; }${this._terminalSelector} .${b}${O}.xterm-dim { color: ${n.color.multiplyOpacity(F,.5).css}; }${this._terminalSelector} .${E}${O} { background-color: ${F.css}; }`;B+=`${this._terminalSelector} .${b}${w.INVERTED_DEFAULT_COLOR} { color: ${n.color.opaque(k.background).css}; }${this._terminalSelector} .${b}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${n.color.multiplyOpacity(n.color.opaque(k.background),.5).css}; }${this._terminalSelector} .${E}${w.INVERTED_DEFAULT_COLOR} { background-color: ${k.foreground.css}; }`,this._themeStyleElement.textContent=B}_setDefaultSpacing(){const k=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${k}px`,this._rowFactory.defaultSpacing=k}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(k,B){for(let O=this._rowElements.length;O<=B;O++){const F=document.createElement("div");this._rowContainer.appendChild(F),this._rowElements.push(F)}for(;this._rowElements.length>B;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(k,B){this._refreshRowElements(k,B),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(p)}handleFocus(){this._rowContainer.classList.add(p),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(k,B,O){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(k,B,O),this.renderRows(0,this._bufferService.rows-1),!k||!B)return;const F=k[1]-this._bufferService.buffer.ydisp,N=B[1]-this._bufferService.buffer.ydisp,H=Math.max(F,0),L=Math.min(N,this._bufferService.rows-1);if(H>=this._bufferService.rows||L<0)return;const T=document.createDocumentFragment();if(O){const P=k[0]>B[0];T.appendChild(this._createSelectionElement(H,P?B[0]:k[0],P?k[0]:B[0],L-H+1))}else{const P=F===H?k[0]:0,I=H===N?B[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(H,P,I));const z=L-H-1;if(T.appendChild(this._createSelectionElement(H+1,0,this._bufferService.cols,z)),H!==L){const V=N===L?B[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(L,0,V))}}this._selectionContainer.appendChild(T)}_createSelectionElement(k,B,O,F=1){const N=document.createElement("div");return N.style.height=F*this.dimensions.css.cell.height+"px",N.style.top=k*this.dimensions.css.cell.height+"px",N.style.left=B*this.dimensions.css.cell.width+"px",N.style.width=this.dimensions.css.cell.width*(O-B)+"px",N}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 k of this._rowElements)k.replaceChildren()}renderRows(k,B){const O=this._bufferService.buffer,F=O.ybase+O.y,N=Math.min(O.x,this._bufferService.cols-1),H=this._optionsService.rawOptions.cursorBlink,L=this._optionsService.rawOptions.cursorStyle,T=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=k;P<=B;P++){const I=P+O.ydisp,z=this._rowElements[P],V=O.lines.get(I);if(!z||!V)break;z.replaceChildren(...this._rowFactory.createRow(V,I,I===F,L,T,N,H,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${m}${this._terminalClass}`}_handleLinkHover(k){this._setCellUnderline(k.x1,k.x2,k.y1,k.y2,k.cols,!0)}_handleLinkLeave(k){this._setCellUnderline(k.x1,k.x2,k.y1,k.y2,k.cols,!1)}_setCellUnderline(k,B,O,F,N,H){O<0&&(k=0),F<0&&(B=0);const L=this._bufferService.rows-1;O=Math.max(Math.min(O,L),0),F=Math.max(Math.min(F,L),0),N=Math.min(N,this._bufferService.cols);const T=this._bufferService.buffer,P=T.ybase+T.y,I=Math.min(T.x,N-1),z=this._optionsService.rawOptions.cursorBlink,V=this._optionsService.rawOptions.cursorStyle,G=this._optionsService.rawOptions.cursorInactiveStyle;for(let K=O;K<=F;++K){const Z=K+T.ydisp,A=this._rowElements[K],j=T.lines.get(Z);if(!A||!j)break;A.replaceChildren(...this._rowFactory.createRow(j,Z,Z===P,V,G,I,z,this.dimensions.css.cell.width,this._widthCache,H?K===O?k:0:-1,H?(K===F?B:N)-1:-1))}}};s.DomRenderer=R=d([g(4,c.IInstantiationService),g(5,f.ICharSizeService),g(6,c.IOptionsService),g(7,c.IBufferService),g(8,f.ICoreBrowserService),g(9,f.IThemeService)],R)},3787:function(C,s,a){var d=this&&this.__decorate||function(b,E,p,x){var D,R=arguments.length,k=R<3?E:x===null?x=Object.getOwnPropertyDescriptor(E,p):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(b,E,p,x);else for(var B=b.length-1;B>=0;B--)(D=b[B])&&(k=(R<3?D(k):R>3?D(E,p,k):D(E,p))||k);return R>3&&k&&Object.defineProperty(E,p,k),k},g=this&&this.__param||function(b,E){return function(p,x){E(p,x,b)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const u=a(2223),v=a(643),w=a(511),S=a(2585),f=a(8055),n=a(4725),o=a(4269),l=a(6171),c=a(3734);let m=s.DomRendererRowFactory=class{constructor(b,E,p,x,D,R,k){this._document=b,this._characterJoinerService=E,this._optionsService=p,this._coreBrowserService=x,this._coreService=D,this._decorationService=R,this._themeService=k,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(b,E,p){this._selectionStart=b,this._selectionEnd=E,this._columnSelectMode=p}createRow(b,E,p,x,D,R,k,B,O,F,N){const H=[],L=this._characterJoinerService.getJoinedCharacters(E),T=this._themeService.colors;let P,I=b.getNoBgTrimmedLength();p&&I<R+1&&(I=R+1);let z=0,V="",G=0,K=0,Z=0,A=!1,j=0,W=!1,U=0;const Q=[],X=F!==-1&&N!==-1;for(let ie=0;ie<I;ie++){b.loadCell(ie,this._workCell);let fe=this._workCell.getWidth();if(fe===0)continue;let _e=!1,ce=ie,se=this._workCell;if(L.length>0&&ie===L[0][0]){_e=!0;const ne=L.shift();se=new o.JoinedCellData(this._workCell,b.translateToString(!0,ne[0],ne[1]),ne[1]-ne[0]),ce=ne[1]-1,fe=se.getWidth()}const Qe=this._isCellInSelection(ie,E),Oe=p&&ie===R,kt=X&&ie>=F&&ie<=N;let Pt=!1;this._decorationService.forEachDecorationAtCell(ie,E,void 0,ne=>{Pt=!0});let he=se.getChars()||v.WHITESPACE_CELL_CHAR;if(he===" "&&(se.isUnderline()||se.isOverline())&&(he=" "),U=fe*B-O.get(he,se.isBold(),se.isItalic()),P){if(z&&(Qe&&W||!Qe&&!W&&se.bg===G)&&(Qe&&W&&T.selectionForeground||se.fg===K)&&se.extended.ext===Z&&kt===A&&U===j&&!Oe&&!_e&&!Pt){V+=he,z++;continue}z&&(P.textContent=V),P=this._document.createElement("span"),z=0,V=""}else P=this._document.createElement("span");if(G=se.bg,K=se.fg,Z=se.extended.ext,A=kt,j=U,W=Qe,_e&&R>=ie&&R<=ce&&(R=ie),!this._coreService.isCursorHidden&&Oe){if(Q.push("xterm-cursor"),this._coreBrowserService.isFocused)k&&Q.push("xterm-cursor-blink"),Q.push(x==="bar"?"xterm-cursor-bar":x==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(D)switch(D){case"outline":Q.push("xterm-cursor-outline");break;case"block":Q.push("xterm-cursor-block");break;case"bar":Q.push("xterm-cursor-bar");break;case"underline":Q.push("xterm-cursor-underline")}}if(se.isBold()&&Q.push("xterm-bold"),se.isItalic()&&Q.push("xterm-italic"),se.isDim()&&Q.push("xterm-dim"),V=se.isInvisible()?v.WHITESPACE_CELL_CHAR:se.getChars()||v.WHITESPACE_CELL_CHAR,se.isUnderline()&&(Q.push(`xterm-underline-${se.extended.underlineStyle}`),V===" "&&(V=" "),!se.isUnderlineColorDefault()))if(se.isUnderlineColorRGB())P.style.textDecorationColor=`rgb(${c.AttributeData.toColorRGB(se.getUnderlineColor()).join(",")})`;else{let ne=se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&se.isBold()&&ne<8&&(ne+=8),P.style.textDecorationColor=T.ansi[ne].css}se.isOverline()&&(Q.push("xterm-overline"),V===" "&&(V=" ")),se.isStrikethrough()&&Q.push("xterm-strikethrough"),kt&&(P.style.textDecoration="underline");let re=se.getFgColor(),oe=se.getFgColorMode(),te=se.getBgColor(),ue=se.getBgColorMode();const Ie=!!se.isInverse();if(Ie){const ne=re;re=te,te=ne;const Je=oe;oe=ue,ue=Je}let ve,yt,$e,De=!1;switch(this._decorationService.forEachDecorationAtCell(ie,E,void 0,ne=>{ne.options.layer!=="top"&&De||(ne.backgroundColorRGB&&(ue=50331648,te=ne.backgroundColorRGB.rgba>>8&16777215,ve=ne.backgroundColorRGB),ne.foregroundColorRGB&&(oe=50331648,re=ne.foregroundColorRGB.rgba>>8&16777215,yt=ne.foregroundColorRGB),De=ne.options.layer==="top")}),!De&&Qe&&(ve=this._coreBrowserService.isFocused?T.selectionBackgroundOpaque:T.selectionInactiveBackgroundOpaque,te=ve.rgba>>8&16777215,ue=50331648,De=!0,T.selectionForeground&&(oe=50331648,re=T.selectionForeground.rgba>>8&16777215,yt=T.selectionForeground)),De&&Q.push("xterm-decoration-top"),ue){case 16777216:case 33554432:$e=T.ansi[te],Q.push(`xterm-bg-${te}`);break;case 50331648:$e=f.rgba.toColor(te>>16,te>>8&255,255&te),this._addStyle(P,`background-color:#${y((te>>>0).toString(16),"0",6)}`);break;default:Ie?($e=T.foreground,Q.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):$e=T.background}switch(ve||se.isDim()&&(ve=f.color.multiplyOpacity($e,.5)),oe){case 16777216:case 33554432:se.isBold()&&re<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(re+=8),this._applyMinimumContrast(P,$e,T.ansi[re],se,ve,void 0)||Q.push(`xterm-fg-${re}`);break;case 50331648:const ne=f.rgba.toColor(re>>16&255,re>>8&255,255&re);this._applyMinimumContrast(P,$e,ne,se,ve,yt)||this._addStyle(P,`color:#${y(re.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(P,$e,T.foreground,se,ve,void 0)||Ie&&Q.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}Q.length&&(P.className=Q.join(" "),Q.length=0),Oe||_e||Pt?P.textContent=V:z++,U!==this.defaultSpacing&&(P.style.letterSpacing=`${U}px`),H.push(P),ie=ce}return P&&z&&(P.textContent=V),H}_applyMinimumContrast(b,E,p,x,D,R){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,l.excludeFromContrastRatioDemands)(x.getCode()))return!1;const k=this._getContrastCache(x);let B;if(D||R||(B=k.getColor(E.rgba,p.rgba)),B===void 0){const O=this._optionsService.rawOptions.minimumContrastRatio/(x.isDim()?2:1);B=f.color.ensureContrastRatio(D||E,R||p,O),k.setColor((D||E).rgba,(R||p).rgba,B??null)}return!!B&&(this._addStyle(b,`color:${B.css}`),!0)}_getContrastCache(b){return b.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(b,E){b.setAttribute("style",`${b.getAttribute("style")||""}${E};`)}_isCellInSelection(b,E){const p=this._selectionStart,x=this._selectionEnd;return!(!p||!x)&&(this._columnSelectMode?p[0]<=x[0]?b>=p[0]&&E>=p[1]&&b<x[0]&&E<=x[1]:b<p[0]&&E>=p[1]&&b>=x[0]&&E<=x[1]:E>p[1]&&E<x[1]||p[1]===x[1]&&E===p[1]&&b>=p[0]&&b<x[0]||p[1]<x[1]&&E===x[1]&&b<x[0]||p[1]<x[1]&&E===p[1]&&b>=p[0])}};function y(b,E,p){for(;b.length<p;)b=E+b;return b}s.DomRendererRowFactory=m=d([g(1,n.ICharacterJoinerService),g(2,S.IOptionsService),g(3,n.ICoreBrowserService),g(4,S.ICoreService),g(5,S.IDecorationService),g(6,n.IThemeService)],m)},2550:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(a){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const d=a.createElement("span"),g=a.createElement("span");g.style.fontWeight="bold";const u=a.createElement("span");u.style.fontStyle="italic";const v=a.createElement("span");v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[d,g,u,v],this._container.appendChild(d),this._container.appendChild(g),this._container.appendChild(u),this._container.appendChild(v),a.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(a,d,g,u){a===this._font&&d===this._fontSize&&g===this._weight&&u===this._weightBold||(this._font=a,this._fontSize=d,this._weight=g,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(a,d,g){let u=0;if(!d&&!g&&a.length===1&&(u=a.charCodeAt(0))<256)return this._flat[u]!==-9999?this._flat[u]:this._flat[u]=this._measure(a,0);let v=a;d&&(v+="B"),g&&(v+="I");let w=this._holey.get(v);if(w===void 0){let S=0;d&&(S|=1),g&&(S|=2),w=this._measure(a,S),this._holey.set(v,w)}return w}_measure(a,d){const g=this._measureElements[d];return g.textContent=a.repeat(32),g.offsetWidth/32}}},2223:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const d=a(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(C,s)=>{function a(d){return 57508<=d&&d<=57558}Object.defineProperty(s,"__esModule",{value:!0}),s.createRenderDimensions=s.excludeFromContrastRatioDemands=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},s.isPowerlineGlyph=a,s.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},s.excludeFromContrastRatioDemands=function(d){return a(d)||function(g){return 9472<=g&&g<=9631}(d)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(a){this._bufferService=a,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 a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,d=this.selectionEnd;return!(!a||!d)&&(a[1]>d[1]||a[1]===d[1]&&a[0]>d[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(C,s,a){var d=this&&this.__decorate||function(n,o,l,c){var m,y=arguments.length,b=y<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,o,l,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(o,l,b):m(o,l))||b);return y>3&&b&&Object.defineProperty(o,l,b),b},g=this&&this.__param||function(n,o){return function(l,c){o(l,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const u=a(2585),v=a(8460),w=a(844);let S=s.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(n,o,l){super(),this._optionsService=l,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new f(n,o,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const n=this._measureStrategy.measure();n.width===this.width&&n.height===this.height||(this.width=n.width,this.height=n.height,this._onCharSizeChange.fire())}};s.CharSizeService=S=d([g(2,u.IOptionsService)],S);class f{constructor(o,l,c){this._document=o,this._parentElement=l,this._optionsService=c,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const o={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return o.width!==0&&o.height!==0&&(this._result.width=o.width/32,this._result.height=Math.ceil(o.height)),this._result}}},4269:function(C,s,a){var d=this&&this.__decorate||function(o,l,c,m){var y,b=arguments.length,E=b<3?l:m===null?m=Object.getOwnPropertyDescriptor(l,c):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(o,l,c,m);else for(var p=o.length-1;p>=0;p--)(y=o[p])&&(E=(b<3?y(E):b>3?y(l,c,E):y(l,c))||E);return b>3&&E&&Object.defineProperty(l,c,E),E},g=this&&this.__param||function(o,l){return function(c,m){l(c,m,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const u=a(3734),v=a(643),w=a(511),S=a(2585);class f extends u.AttributeData{constructor(l,c,m){super(),this.content=0,this.combinedData="",this.fg=l.fg,this.bg=l.bg,this.combinedData=c,this._width=m}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(l){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=f;let n=s.CharacterJoinerService=class Qu{constructor(l){this._bufferService=l,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(l){const c={id:this._nextCharacterJoinerId++,handler:l};return this._characterJoiners.push(c),c.id}deregister(l){for(let c=0;c<this._characterJoiners.length;c++)if(this._characterJoiners[c].id===l)return this._characterJoiners.splice(c,1),!0;return!1}getJoinedCharacters(l){if(this._characterJoiners.length===0)return[];const c=this._bufferService.buffer.lines.get(l);if(!c||c.length===0)return[];const m=[],y=c.translateToString(!0);let b=0,E=0,p=0,x=c.getFg(0),D=c.getBg(0);for(let R=0;R<c.getTrimmedLength();R++)if(c.loadCell(R,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==x||this._workCell.bg!==D){if(R-b>1){const k=this._getJoinedRanges(y,p,E,c,b);for(let B=0;B<k.length;B++)m.push(k[B])}b=R,p=E,x=this._workCell.fg,D=this._workCell.bg}E+=this._workCell.getChars().length||v.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-b>1){const R=this._getJoinedRanges(y,p,E,c,b);for(let k=0;k<R.length;k++)m.push(R[k])}return m}_getJoinedRanges(l,c,m,y,b){const E=l.substring(c,m);let p=[];try{p=this._characterJoiners[0].handler(E)}catch(x){console.error(x)}for(let x=1;x<this._characterJoiners.length;x++)try{const D=this._characterJoiners[x].handler(E);for(let R=0;R<D.length;R++)Qu._mergeRanges(p,D[R])}catch(D){console.error(D)}return this._stringRangesToCellRanges(p,y,b),p}_stringRangesToCellRanges(l,c,m){let y=0,b=!1,E=0,p=l[y];if(p){for(let x=m;x<this._bufferService.cols;x++){const D=c.getWidth(x),R=c.getString(x).length||v.WHITESPACE_CELL_CHAR.length;if(D!==0){if(!b&&p[0]<=E&&(p[0]=x,b=!0),p[1]<=E){if(p[1]=x,p=l[++y],!p)break;p[0]<=E?(p[0]=x,b=!0):b=!1}E+=R}}p&&(p[1]=this._bufferService.cols)}}static _mergeRanges(l,c){let m=!1;for(let y=0;y<l.length;y++){const b=l[y];if(m){if(c[1]<=b[0])return l[y-1][1]=c[1],l;if(c[1]<=b[1])return l[y-1][1]=Math.max(c[1],b[1]),l.splice(y,1),l;l.splice(y,1),y--}else{if(c[1]<=b[0])return l.splice(y,0,c),l;if(c[1]<=b[1])return b[0]=Math.min(c[0],b[0]),l;c[0]<b[1]&&(b[0]=Math.min(c[0],b[0]),m=!0)}}return m?l[l.length-1][1]=c[1]:l.push(c),l}};s.CharacterJoinerService=n=d([g(0,S.IBufferService)],n)},5114:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0,s.CoreBrowserService=class{constructor(a,d){this._textarea=a,this.window=d,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}},8934:function(C,s,a){var d=this&&this.__decorate||function(S,f,n,o){var l,c=arguments.length,m=c<3?f:o===null?o=Object.getOwnPropertyDescriptor(f,n):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(S,f,n,o);else for(var y=S.length-1;y>=0;y--)(l=S[y])&&(m=(c<3?l(m):c>3?l(f,n,m):l(f,n))||m);return c>3&&m&&Object.defineProperty(f,n,m),m},g=this&&this.__param||function(S,f){return function(n,o){f(n,o,S)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const u=a(4725),v=a(9806);let w=s.MouseService=class{constructor(S,f){this._renderService=S,this._charSizeService=f}getCoords(S,f,n,o,l){return(0,v.getCoords)(window,S,f,n,o,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(S,f){const n=(0,v.getCoordsRelativeToElement)(window,S,f);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};s.MouseService=w=d([g(0,u.IRenderService),g(1,u.ICharSizeService)],w)},3230:function(C,s,a){var d=this&&this.__decorate||function(m,y,b,E){var p,x=arguments.length,D=x<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(m,y,b,E);else for(var R=m.length-1;R>=0;R--)(p=m[R])&&(D=(x<3?p(D):x>3?p(y,b,D):p(y,b))||D);return x>3&&D&&Object.defineProperty(y,b,D),D},g=this&&this.__param||function(m,y){return function(b,E){y(b,E,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const u=a(3656),v=a(6193),w=a(5596),S=a(4725),f=a(8460),n=a(844),o=a(7226),l=a(2585);let c=s.RenderService=class extends n.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(m,y,b,E,p,x,D,R){if(super(),this._rowCount=m,this._charSizeService=E,this._renderer=this.register(new n.MutableDisposable),this._pausedResizeTask=new o.DebouncedIdleTask,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new f.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new f.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new f.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new f.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new v.RenderDebouncer(D.window,(k,B)=>this._renderRows(k,B)),this.register(this._renderDebouncer),this._screenDprMonitor=new w.ScreenDprMonitor(D.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(x.onResize(()=>this._fullRefresh())),this.register(x.buffers.onBufferActivate(()=>{var k;return(k=this._renderer.value)===null||k===void 0?void 0:k.clear()})),this.register(b.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(p.onDecorationRegistered(()=>this._fullRefresh())),this.register(p.onDecorationRemoved(()=>this._fullRefresh())),this.register(b.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(x.cols,x.rows),this._fullRefresh()})),this.register(b.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(x.buffer.y,x.buffer.y,!0))),this.register((0,u.addDisposableDomListener)(D.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(R.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in D.window){const k=new D.window.IntersectionObserver(B=>this._handleIntersectionChange(B[B.length-1]),{threshold:0});k.observe(y),this.register({dispose:()=>k.disconnect()})}}_handleIntersectionChange(m){this._isPaused=m.isIntersecting===void 0?m.intersectionRatio===0:!m.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(m,y,b=!1){this._isPaused?this._needsFullRefresh=!0:(b||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(m,y,this._rowCount))}_renderRows(m,y){this._renderer.value&&(m=Math.min(m,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(m,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:m,end:y}),this._onRender.fire({start:m,end:y}),this._isNextRenderRedrawOnly=!0)}resize(m,y){this._rowCount=y,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(m){this._renderer.value=m,this._renderer.value.onRequestRedraw(y=>this.refreshRows(y.start,y.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(m){return this._renderDebouncer.addRefreshCallback(m)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var m,y;this._renderer.value&&((y=(m=this._renderer.value).clearTextureAtlas)===null||y===void 0||y.call(m),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(m,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(m,y)):this._renderer.value.handleResize(m,y),this._fullRefresh())}handleCharSizeChanged(){var m;(m=this._renderer.value)===null||m===void 0||m.handleCharSizeChanged()}handleBlur(){var m;(m=this._renderer.value)===null||m===void 0||m.handleBlur()}handleFocus(){var m;(m=this._renderer.value)===null||m===void 0||m.handleFocus()}handleSelectionChanged(m,y,b){var E;this._selectionState.start=m,this._selectionState.end=y,this._selectionState.columnSelectMode=b,(E=this._renderer.value)===null||E===void 0||E.handleSelectionChanged(m,y,b)}handleCursorMove(){var m;(m=this._renderer.value)===null||m===void 0||m.handleCursorMove()}clear(){var m;(m=this._renderer.value)===null||m===void 0||m.clear()}};s.RenderService=c=d([g(2,l.IOptionsService),g(3,S.ICharSizeService),g(4,l.IDecorationService),g(5,l.IBufferService),g(6,S.ICoreBrowserService),g(7,S.IThemeService)],c)},9312:function(C,s,a){var d=this&&this.__decorate||function(p,x,D,R){var k,B=arguments.length,O=B<3?x:R===null?R=Object.getOwnPropertyDescriptor(x,D):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(p,x,D,R);else for(var F=p.length-1;F>=0;F--)(k=p[F])&&(O=(B<3?k(O):B>3?k(x,D,O):k(x,D))||O);return B>3&&O&&Object.defineProperty(x,D,O),O},g=this&&this.__param||function(p,x){return function(D,R){x(D,R,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const u=a(9806),v=a(9504),w=a(456),S=a(4725),f=a(8460),n=a(844),o=a(6114),l=a(4841),c=a(511),m=a(2585),y=" ",b=new RegExp(y,"g");let E=s.SelectionService=class extends n.Disposable{constructor(p,x,D,R,k,B,O,F,N){super(),this._element=p,this._screenElement=x,this._linkifier=D,this._bufferService=R,this._coreService=k,this._mouseService=B,this._optionsService=O,this._renderService=F,this._coreBrowserService=N,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new c.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new f.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new f.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=H=>this._handleMouseMove(H),this._mouseUpListener=H=>this._handleMouseUp(H),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(H=>this._handleTrim(H)),this.register(this._bufferService.buffers.onBufferActivate(H=>this._handleBufferActivate(H))),this.enable(),this._model=new w.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,n.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 p=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;return!(!p||!x||p[0]===x[0]&&p[1]===x[1])}get selectionText(){const p=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;if(!p||!x)return"";const D=this._bufferService.buffer,R=[];if(this._activeSelectionMode===3){if(p[0]===x[0])return"";const k=p[0]<x[0]?p[0]:x[0],B=p[0]<x[0]?x[0]:p[0];for(let O=p[1];O<=x[1];O++){const F=D.translateBufferLineToString(O,!0,k,B);R.push(F)}}else{const k=p[1]===x[1]?x[0]:void 0;R.push(D.translateBufferLineToString(p[1],!0,p[0],k));for(let B=p[1]+1;B<=x[1]-1;B++){const O=D.lines.get(B),F=D.translateBufferLineToString(B,!0);O!=null&&O.isWrapped?R[R.length-1]+=F:R.push(F)}if(p[1]!==x[1]){const B=D.lines.get(x[1]),O=D.translateBufferLineToString(x[1],!0,0,x[0]);B&&B.isWrapped?R[R.length-1]+=O:R.push(O)}}return R.map(k=>k.replace(b," ")).join(o.isWindows?`\r
45
+ `:`
46
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(p){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),o.isLinux&&p&&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(p){const x=this._getMouseBufferCoords(p),D=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!!(D&&R&&x)&&this._areCoordsInSelection(x,D,R)}isCellInSelection(p,x){const D=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!D||!R)&&this._areCoordsInSelection([p,x],D,R)}_areCoordsInSelection(p,x,D){return p[1]>x[1]&&p[1]<D[1]||x[1]===D[1]&&p[1]===x[1]&&p[0]>=x[0]&&p[0]<D[0]||x[1]<D[1]&&p[1]===D[1]&&p[0]<D[0]||x[1]<D[1]&&p[1]===x[1]&&p[0]>=x[0]}_selectWordAtCursor(p,x){var D,R;const k=(R=(D=this._linkifier.currentLink)===null||D===void 0?void 0:D.link)===null||R===void 0?void 0:R.range;if(k)return this._model.selectionStart=[k.start.x-1,k.start.y-1],this._model.selectionStartLength=(0,l.getRangeLength)(k,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(p);return!!B&&(this._selectWordAt(B,x),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(p,x){this._model.clearSelection(),p=Math.max(p,0),x=Math.min(x,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,p],this._model.selectionEnd=[this._bufferService.cols,x],this.refresh(),this._onSelectionChange.fire()}_handleTrim(p){this._model.handleTrim(p)&&this.refresh()}_getMouseBufferCoords(p){const x=this._mouseService.getCoords(p,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(x)return x[0]--,x[1]--,x[1]+=this._bufferService.buffer.ydisp,x}_getMouseEventScrollAmount(p){let x=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,p,this._screenElement)[1];const D=this._renderService.dimensions.css.canvas.height;return x>=0&&x<=D?0:(x>D&&(x-=D),x=Math.min(Math.max(x,-50),50),x/=50,x/Math.abs(x)+Math.round(14*x))}shouldForceSelection(p){return o.isMac?p.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:p.shiftKey}handleMouseDown(p){if(this._mouseDownTimeStamp=p.timeStamp,(p.button!==2||!this.hasSelection)&&p.button===0){if(!this._enabled){if(!this.shouldForceSelection(p))return;p.stopPropagation()}p.preventDefault(),this._dragScrollAmount=0,this._enabled&&p.shiftKey?this._handleIncrementalClick(p):p.detail===1?this._handleSingleClick(p):p.detail===2?this._handleDoubleClick(p):p.detail===3&&this._handleTripleClick(p),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(p){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(p))}_handleSingleClick(p){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(p)?3:0,this._model.selectionStart=this._getMouseBufferCoords(p),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const x=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);x&&x.length!==this._model.selectionStart[0]&&x.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(p){this._selectWordAtCursor(p,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(p){const x=this._getMouseBufferCoords(p);x&&(this._activeSelectionMode=2,this._selectLineAt(x[1]))}shouldColumnSelect(p){return p.altKey&&!(o.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(p){if(p.stopImmediatePropagation(),!this._model.selectionStart)return;const x=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(p),!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(p),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const D=this._bufferService.buffer;if(this._model.selectionEnd[1]<D.lines.length){const R=D.lines.get(this._model.selectionEnd[1]);R&&R.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}x&&x[0]===this._model.selectionEnd[0]&&x[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 p=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(p.ydisp+this._bufferService.rows,p.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=p.ydisp),this.refresh()}}_handleMouseUp(p){const x=p.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&x<500&&p.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const D=this._mouseService.getCoords(p,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(D&&D[0]!==void 0&&D[1]!==void 0){const R=(0,v.moveToCellSequence)(D[0]-1,D[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(R,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const p=this._model.finalSelectionStart,x=this._model.finalSelectionEnd,D=!(!p||!x||p[0]===x[0]&&p[1]===x[1]);D?p&&x&&(this._oldSelectionStart&&this._oldSelectionEnd&&p[0]===this._oldSelectionStart[0]&&p[1]===this._oldSelectionStart[1]&&x[0]===this._oldSelectionEnd[0]&&x[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(p,x,D)):this._oldHasSelection&&this._fireOnSelectionChange(p,x,D)}_fireOnSelectionChange(p,x,D){this._oldSelectionStart=p,this._oldSelectionEnd=x,this._oldHasSelection=D,this._onSelectionChange.fire()}_handleBufferActivate(p){this.clearSelection(),this._trimListener.dispose(),this._trimListener=p.activeBuffer.lines.onTrim(x=>this._handleTrim(x))}_convertViewportColToCharacterIndex(p,x){let D=x;for(let R=0;x>=R;R++){const k=p.loadCell(R,this._workCell).getChars().length;this._workCell.getWidth()===0?D--:k>1&&x!==R&&(D+=k-1)}return D}setSelection(p,x,D){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[p,x],this._model.selectionStartLength=D,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(p){this._isClickInSelection(p)||(this._selectWordAtCursor(p,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(p,x,D=!0,R=!0){if(p[0]>=this._bufferService.cols)return;const k=this._bufferService.buffer,B=k.lines.get(p[1]);if(!B)return;const O=k.translateBufferLineToString(p[1],!1);let F=this._convertViewportColToCharacterIndex(B,p[0]),N=F;const H=p[0]-F;let L=0,T=0,P=0,I=0;if(O.charAt(F)===" "){for(;F>0&&O.charAt(F-1)===" ";)F--;for(;N<O.length&&O.charAt(N+1)===" ";)N++}else{let G=p[0],K=p[0];B.getWidth(G)===0&&(L++,G--),B.getWidth(K)===2&&(T++,K++);const Z=B.getString(K).length;for(Z>1&&(I+=Z-1,N+=Z-1);G>0&&F>0&&!this._isCharWordSeparator(B.loadCell(G-1,this._workCell));){B.loadCell(G-1,this._workCell);const A=this._workCell.getChars().length;this._workCell.getWidth()===0?(L++,G--):A>1&&(P+=A-1,F-=A-1),F--,G--}for(;K<B.length&&N+1<O.length&&!this._isCharWordSeparator(B.loadCell(K+1,this._workCell));){B.loadCell(K+1,this._workCell);const A=this._workCell.getChars().length;this._workCell.getWidth()===2?(T++,K++):A>1&&(I+=A-1,N+=A-1),N++,K++}}N++;let z=F+H-L+P,V=Math.min(this._bufferService.cols,N-F+L+T-P-I);if(x||O.slice(F,N).trim()!==""){if(D&&z===0&&B.getCodePoint(0)!==32){const G=k.lines.get(p[1]-1);if(G&&B.isWrapped&&G.getCodePoint(this._bufferService.cols-1)!==32){const K=this._getWordAt([this._bufferService.cols-1,p[1]-1],!1,!0,!1);if(K){const Z=this._bufferService.cols-K.start;z-=Z,V+=Z}}}if(R&&z+V===this._bufferService.cols&&B.getCodePoint(this._bufferService.cols-1)!==32){const G=k.lines.get(p[1]+1);if(G!=null&&G.isWrapped&&G.getCodePoint(0)!==32){const K=this._getWordAt([0,p[1]+1],!1,!1,!0);K&&(V+=K.length)}}return{start:z,length:V}}}_selectWordAt(p,x){const D=this._getWordAt(p,x);if(D){for(;D.start<0;)D.start+=this._bufferService.cols,p[1]--;this._model.selectionStart=[D.start,p[1]],this._model.selectionStartLength=D.length}}_selectToWordAt(p){const x=this._getWordAt(p,!0);if(x){let D=p[1];for(;x.start<0;)x.start+=this._bufferService.cols,D--;if(!this._model.areSelectionValuesReversed())for(;x.start+x.length>this._bufferService.cols;)x.length-=this._bufferService.cols,D++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?x.start:x.start+x.length,D]}}_isCharWordSeparator(p){return p.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(p.getChars())>=0}_selectLineAt(p){const x=this._bufferService.buffer.getWrappedRangeForLine(p),D={start:{x:0,y:x.first},end:{x:this._bufferService.cols-1,y:x.last}};this._model.selectionStart=[0,x.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,l.getRangeLength)(D,this._bufferService.cols)}};s.SelectionService=E=d([g(3,m.IBufferService),g(4,m.ICoreService),g(5,S.IMouseService),g(6,m.IOptionsService),g(7,S.IRenderService),g(8,S.ICoreBrowserService)],E)},4725:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const d=a(8343);s.ICharSizeService=(0,d.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),s.IMouseService=(0,d.createDecorator)("MouseService"),s.IRenderService=(0,d.createDecorator)("RenderService"),s.ISelectionService=(0,d.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,d.createDecorator)("ThemeService")},6731:function(C,s,a){var d=this&&this.__decorate||function(E,p,x,D){var R,k=arguments.length,B=k<3?p:D===null?D=Object.getOwnPropertyDescriptor(p,x):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(E,p,x,D);else for(var O=E.length-1;O>=0;O--)(R=E[O])&&(B=(k<3?R(B):k>3?R(p,x,B):R(p,x))||B);return k>3&&B&&Object.defineProperty(p,x,B),B},g=this&&this.__param||function(E,p){return function(x,D){p(x,D,E)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const u=a(7239),v=a(8055),w=a(8460),S=a(844),f=a(2585),n=v.css.toColor("#ffffff"),o=v.css.toColor("#000000"),l=v.css.toColor("#ffffff"),c=v.css.toColor("#000000"),m={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const E=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],p=[0,95,135,175,215,255];for(let x=0;x<216;x++){const D=p[x/36%6|0],R=p[x/6%6|0],k=p[x%6];E.push({css:v.channels.toCss(D,R,k),rgba:v.channels.toRgba(D,R,k)})}for(let x=0;x<24;x++){const D=8+10*x;E.push({css:v.channels.toCss(D,D,D),rgba:v.channels.toRgba(D,D,D)})}return E})());let y=s.ThemeService=class extends S.Disposable{get colors(){return this._colors}constructor(E){super(),this._optionsService=E,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:o,cursor:l,cursorAccent:c,selectionForeground:void 0,selectionBackgroundTransparent:m,selectionBackgroundOpaque:v.color.blend(o,m),selectionInactiveBackgroundTransparent:m,selectionInactiveBackgroundOpaque:v.color.blend(o,m),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(E={}){const p=this._colors;if(p.foreground=b(E.foreground,n),p.background=b(E.background,o),p.cursor=b(E.cursor,l),p.cursorAccent=b(E.cursorAccent,c),p.selectionBackgroundTransparent=b(E.selectionBackground,m),p.selectionBackgroundOpaque=v.color.blend(p.background,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundTransparent=b(E.selectionInactiveBackground,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundOpaque=v.color.blend(p.background,p.selectionInactiveBackgroundTransparent),p.selectionForeground=E.selectionForeground?b(E.selectionForeground,v.NULL_COLOR):void 0,p.selectionForeground===v.NULL_COLOR&&(p.selectionForeground=void 0),v.color.isOpaque(p.selectionBackgroundTransparent)&&(p.selectionBackgroundTransparent=v.color.opacity(p.selectionBackgroundTransparent,.3)),v.color.isOpaque(p.selectionInactiveBackgroundTransparent)&&(p.selectionInactiveBackgroundTransparent=v.color.opacity(p.selectionInactiveBackgroundTransparent,.3)),p.ansi=s.DEFAULT_ANSI_COLORS.slice(),p.ansi[0]=b(E.black,s.DEFAULT_ANSI_COLORS[0]),p.ansi[1]=b(E.red,s.DEFAULT_ANSI_COLORS[1]),p.ansi[2]=b(E.green,s.DEFAULT_ANSI_COLORS[2]),p.ansi[3]=b(E.yellow,s.DEFAULT_ANSI_COLORS[3]),p.ansi[4]=b(E.blue,s.DEFAULT_ANSI_COLORS[4]),p.ansi[5]=b(E.magenta,s.DEFAULT_ANSI_COLORS[5]),p.ansi[6]=b(E.cyan,s.DEFAULT_ANSI_COLORS[6]),p.ansi[7]=b(E.white,s.DEFAULT_ANSI_COLORS[7]),p.ansi[8]=b(E.brightBlack,s.DEFAULT_ANSI_COLORS[8]),p.ansi[9]=b(E.brightRed,s.DEFAULT_ANSI_COLORS[9]),p.ansi[10]=b(E.brightGreen,s.DEFAULT_ANSI_COLORS[10]),p.ansi[11]=b(E.brightYellow,s.DEFAULT_ANSI_COLORS[11]),p.ansi[12]=b(E.brightBlue,s.DEFAULT_ANSI_COLORS[12]),p.ansi[13]=b(E.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),p.ansi[14]=b(E.brightCyan,s.DEFAULT_ANSI_COLORS[14]),p.ansi[15]=b(E.brightWhite,s.DEFAULT_ANSI_COLORS[15]),E.extendedAnsi){const x=Math.min(p.ansi.length-16,E.extendedAnsi.length);for(let D=0;D<x;D++)p.ansi[D+16]=b(E.extendedAnsi[D],s.DEFAULT_ANSI_COLORS[D+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(E){this._restoreColor(E),this._onChangeColors.fire(this.colors)}_restoreColor(E){if(E!==void 0)switch(E){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[E]=this._restoreColors.ansi[E]}else for(let p=0;p<this._restoreColors.ansi.length;++p)this._colors.ansi[p]=this._restoreColors.ansi[p]}modifyColors(E){E(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function b(E,p){if(E!==void 0)try{return v.css.toColor(E)}catch{}return p}s.ThemeService=y=d([g(0,f.IOptionsService)],y)},6349:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const d=a(8460),g=a(844);class u extends g.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(w){if(this._maxLength===w)return;const S=new Array(w);for(let f=0;f<Math.min(w,this.length);f++)S[f]=this._array[this._getCyclicIndex(f)];this._array=S,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let S=this._length;S<w;S++)this._array[S]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,S){this._array[this._getCyclicIndex(w)]=S}push(w){this._array[this._getCyclicIndex(this._length)]=w,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(w,S,...f){if(S){for(let n=w;n<this._length-S;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+S)];this._length-=S,this.onDeleteEmitter.fire({index:w,amount:S})}for(let n=this._length-1;n>=w;n--)this._array[this._getCyclicIndex(n+f.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<f.length;n++)this._array[this._getCyclicIndex(w+n)]=f[n];if(f.length&&this.onInsertEmitter.fire({index:w,amount:f.length}),this._length+f.length>this._maxLength){const n=this._length+f.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=f.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,S,f){if(!(S<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+f<0)throw new Error("Cannot shift elements in list beyond index 0");if(f>0){for(let o=S-1;o>=0;o--)this.set(w+o+f,this.get(w+o));const n=w+S+f-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<S;n++)this.set(w+n+f,this.get(w+n))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}s.CircularList=u},1439:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function a(d,g=5){if(typeof d!="object")return d;const u=Array.isArray(d)?[]:{};for(const v in d)u[v]=g<=1?d[v]:d[v]&&a(d[v],g-1);return u}},8055:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;const d=a(6114);let g=0,u=0,v=0,w=0;var S,f,n,o,l;function c(y){const b=y.toString(16);return b.length<2?"0"+b:b}function m(y,b){return y<b?(b+.05)/(y+.05):(y+.05)/(b+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(y){y.toCss=function(b,E,p,x){return x!==void 0?`#${c(b)}${c(E)}${c(p)}${c(x)}`:`#${c(b)}${c(E)}${c(p)}`},y.toRgba=function(b,E,p,x=255){return(b<<24|E<<16|p<<8|x)>>>0}}(S||(s.channels=S={})),function(y){function b(E,p){return w=Math.round(255*p),[g,u,v]=l.toChannels(E.rgba),{css:S.toCss(g,u,v,w),rgba:S.toRgba(g,u,v,w)}}y.blend=function(E,p){if(w=(255&p.rgba)/255,w===1)return{css:p.css,rgba:p.rgba};const x=p.rgba>>24&255,D=p.rgba>>16&255,R=p.rgba>>8&255,k=E.rgba>>24&255,B=E.rgba>>16&255,O=E.rgba>>8&255;return g=k+Math.round((x-k)*w),u=B+Math.round((D-B)*w),v=O+Math.round((R-O)*w),{css:S.toCss(g,u,v),rgba:S.toRgba(g,u,v)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,p,x){const D=l.ensureContrastRatio(E.rgba,p.rgba,x);if(D)return l.toColor(D>>24&255,D>>16&255,D>>8&255)},y.opaque=function(E){const p=(255|E.rgba)>>>0;return[g,u,v]=l.toChannels(p),{css:S.toCss(g,u,v),rgba:p}},y.opacity=b,y.multiplyOpacity=function(E,p){return w=255&E.rgba,b(E,w*p/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}}(f||(s.color=f={})),function(y){let b,E;if(!d.isNode){const p=document.createElement("canvas");p.width=1,p.height=1;const x=p.getContext("2d",{willReadFrequently:!0});x&&(b=x,b.globalCompositeOperation="copy",E=b.createLinearGradient(0,0,1,1))}y.toColor=function(p){if(p.match(/#[\da-f]{3,8}/i))switch(p.length){case 4:return g=parseInt(p.slice(1,2).repeat(2),16),u=parseInt(p.slice(2,3).repeat(2),16),v=parseInt(p.slice(3,4).repeat(2),16),l.toColor(g,u,v);case 5:return g=parseInt(p.slice(1,2).repeat(2),16),u=parseInt(p.slice(2,3).repeat(2),16),v=parseInt(p.slice(3,4).repeat(2),16),w=parseInt(p.slice(4,5).repeat(2),16),l.toColor(g,u,v,w);case 7:return{css:p,rgba:(parseInt(p.slice(1),16)<<8|255)>>>0};case 9:return{css:p,rgba:parseInt(p.slice(1),16)>>>0}}const x=p.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(x)return g=parseInt(x[1]),u=parseInt(x[2]),v=parseInt(x[3]),w=Math.round(255*(x[5]===void 0?1:parseFloat(x[5]))),l.toColor(g,u,v,w);if(!b||!E)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=E,b.fillStyle=p,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[g,u,v,w]=b.getImageData(0,0,1,1).data,w!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(g,u,v,w),css:p}}}(n||(s.css=n={})),function(y){function b(E,p,x){const D=E/255,R=p/255,k=x/255;return .2126*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))}y.relativeLuminance=function(E){return b(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=b}(o||(s.rgb=o={})),function(y){function b(p,x,D){const R=p>>24&255,k=p>>16&255,B=p>>8&255;let O=x>>24&255,F=x>>16&255,N=x>>8&255,H=m(o.relativeLuminance2(O,F,N),o.relativeLuminance2(R,k,B));for(;H<D&&(O>0||F>0||N>0);)O-=Math.max(0,Math.ceil(.1*O)),F-=Math.max(0,Math.ceil(.1*F)),N-=Math.max(0,Math.ceil(.1*N)),H=m(o.relativeLuminance2(O,F,N),o.relativeLuminance2(R,k,B));return(O<<24|F<<16|N<<8|255)>>>0}function E(p,x,D){const R=p>>24&255,k=p>>16&255,B=p>>8&255;let O=x>>24&255,F=x>>16&255,N=x>>8&255,H=m(o.relativeLuminance2(O,F,N),o.relativeLuminance2(R,k,B));for(;H<D&&(O<255||F<255||N<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),F=Math.min(255,F+Math.ceil(.1*(255-F))),N=Math.min(255,N+Math.ceil(.1*(255-N))),H=m(o.relativeLuminance2(O,F,N),o.relativeLuminance2(R,k,B));return(O<<24|F<<16|N<<8|255)>>>0}y.ensureContrastRatio=function(p,x,D){const R=o.relativeLuminance(p>>8),k=o.relativeLuminance(x>>8);if(m(R,k)<D){if(k<R){const F=b(p,x,D),N=m(R,o.relativeLuminance(F>>8));if(N<D){const H=E(p,x,D);return N>m(R,o.relativeLuminance(H>>8))?F:H}return F}const B=E(p,x,D),O=m(R,o.relativeLuminance(B>>8));if(O<D){const F=b(p,x,D);return O>m(R,o.relativeLuminance(F>>8))?B:F}return B}},y.reduceLuminance=b,y.increaseLuminance=E,y.toChannels=function(p){return[p>>24&255,p>>16&255,p>>8&255,255&p]},y.toColor=function(p,x,D,R){return{css:S.toCss(p,x,D,R),rgba:S.toRgba(p,x,D,R)}}}(l||(s.rgba=l={})),s.toPaddedHex=c,s.contrastRatio=m},8969:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const d=a(844),g=a(2585),u=a(4348),v=a(7866),w=a(744),S=a(7302),f=a(6975),n=a(8460),o=a(1753),l=a(1480),c=a(7994),m=a(9282),y=a(5435),b=a(5981),E=a(2660);let p=!1;class x extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event(R=>{var k;(k=this._onScrollApi)===null||k===void 0||k.fire(R.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(R){for(const k in R)this.optionsService.options[k]=R[k]}constructor(R){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new n.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new n.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new S.OptionsService(R)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(f.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(l.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(c.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new y.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,n.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,n.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,n.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,n.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(k=>{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(k=>{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 b.WriteBuffer((k,B)=>this._inputHandler.parse(k,B))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(R,k){this._writeBuffer.write(R,k)}writeSync(R,k){this._logService.logLevel<=g.LogLevelEnum.WARN&&!p&&(this._logService.warn("writeSync is unreliable and will be removed soon."),p=!0),this._writeBuffer.writeSync(R,k)}resize(R,k){isNaN(R)||isNaN(k)||(R=Math.max(R,w.MINIMUM_COLS),k=Math.max(k,w.MINIMUM_ROWS),this._bufferService.resize(R,k))}scroll(R,k=!1){this._bufferService.scroll(R,k)}scrollLines(R,k,B){this._bufferService.scrollLines(R,k,B)}scrollPages(R){this.scrollLines(R*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(R){const k=R-this._bufferService.buffer.ydisp;k!==0&&this.scrollLines(k)}registerEscHandler(R,k){return this._inputHandler.registerEscHandler(R,k)}registerDcsHandler(R,k){return this._inputHandler.registerDcsHandler(R,k)}registerCsiHandler(R,k){return this._inputHandler.registerCsiHandler(R,k)}registerOscHandler(R,k){return this._inputHandler.registerOscHandler(R,k)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let R=!1;const k=this.optionsService.rawOptions.windowsPty;k&&k.buildNumber!==void 0&&k.buildNumber!==void 0?R=k.backend==="conpty"&&k.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(R=!0),R?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const R=[];R.push(this.onLineFeed(m.updateWindowsModeWrappedState.bind(null,this._bufferService))),R.push(this.registerCsiHandler({final:"H"},()=>((0,m.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)(()=>{for(const k of R)k.dispose()})}}}s.CoreTerminal=x},8460:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===a)return void this._listeners.splice(d,1)}}})),this._event}fire(a,d){const g=[];for(let u=0;u<this._listeners.length;u++)g.push(this._listeners[u]);for(let u=0;u<g.length;u++)g[u].call(void 0,a,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,d){return a(g=>d.fire(g))}},5435:function(C,s,a){var d=this&&this.__decorate||function(H,L,T,P){var I,z=arguments.length,V=z<3?L:P===null?P=Object.getOwnPropertyDescriptor(L,T):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(H,L,T,P);else for(var G=H.length-1;G>=0;G--)(I=H[G])&&(V=(z<3?I(V):z>3?I(L,T,V):I(L,T))||V);return z>3&&V&&Object.defineProperty(L,T,V),V},g=this&&this.__param||function(H,L){return function(T,P){L(T,P,H)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const u=a(2584),v=a(7116),w=a(2015),S=a(844),f=a(482),n=a(8437),o=a(8460),l=a(643),c=a(511),m=a(3734),y=a(2585),b=a(6242),E=a(6351),p=a(5941),x={"(":0,")":1,"*":2,"+":3,"-":1,".":2},D=131072;function R(H,L){if(H>24)return L.setWinLines||!1;switch(H){case 1:return!!L.restoreWin;case 2:return!!L.minimizeWin;case 3:return!!L.setWinPosition;case 4:return!!L.setWinSizePixels;case 5:return!!L.raiseWin;case 6:return!!L.lowerWin;case 7:return!!L.refreshWin;case 8:return!!L.setWinSizeChars;case 9:return!!L.maximizeWin;case 10:return!!L.fullscreenWin;case 11:return!!L.getWinState;case 13:return!!L.getWinPosition;case 14:return!!L.getWinSizePixels;case 15:return!!L.getScreenSizePixels;case 16:return!!L.getCellSizePixels;case 18:return!!L.getWinSizeChars;case 19:return!!L.getScreenSizeChars;case 20:return!!L.getIconTitle;case 21:return!!L.getWinTitle;case 22:return!!L.pushTitle;case 23:return!!L.popTitle;case 24:return!!L.setWinLines}return!1}var k;(function(H){H[H.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",H[H.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(k||(s.WindowsOptionsReportType=k={}));let B=0;class O extends S.Disposable{getAttrData(){return this._curAttrData}constructor(L,T,P,I,z,V,G,K,Z=new w.EscapeSequenceParser){super(),this._bufferService=L,this._charsetService=T,this._coreService=P,this._logService=I,this._optionsService=z,this._oscLinkService=V,this._coreMouseService=G,this._unicodeService=K,this._parser=Z,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new f.StringToUtf32,this._utf8Decoder=new f.Utf8ToUtf32,this._workCell=new c.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.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 F(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(A=>this._activeBuffer=A.activeBuffer)),this._parser.setCsiHandlerFallback((A,j)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(A),params:j.toArray()})}),this._parser.setEscHandlerFallback(A=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(A)})}),this._parser.setExecuteHandlerFallback(A=>{this._logService.debug("Unknown EXECUTE code: ",{code:A})}),this._parser.setOscHandlerFallback((A,j,W)=>{this._logService.debug("Unknown OSC code: ",{identifier:A,action:j,data:W})}),this._parser.setDcsHandlerFallback((A,j,W)=>{j==="HOOK"&&(W=W.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(A),action:j,payload:W})}),this._parser.setPrintHandler((A,j,W)=>this.print(A,j,W)),this._parser.registerCsiHandler({final:"@"},A=>this.insertChars(A)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},A=>this.scrollLeft(A)),this._parser.registerCsiHandler({final:"A"},A=>this.cursorUp(A)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},A=>this.scrollRight(A)),this._parser.registerCsiHandler({final:"B"},A=>this.cursorDown(A)),this._parser.registerCsiHandler({final:"C"},A=>this.cursorForward(A)),this._parser.registerCsiHandler({final:"D"},A=>this.cursorBackward(A)),this._parser.registerCsiHandler({final:"E"},A=>this.cursorNextLine(A)),this._parser.registerCsiHandler({final:"F"},A=>this.cursorPrecedingLine(A)),this._parser.registerCsiHandler({final:"G"},A=>this.cursorCharAbsolute(A)),this._parser.registerCsiHandler({final:"H"},A=>this.cursorPosition(A)),this._parser.registerCsiHandler({final:"I"},A=>this.cursorForwardTab(A)),this._parser.registerCsiHandler({final:"J"},A=>this.eraseInDisplay(A,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},A=>this.eraseInDisplay(A,!0)),this._parser.registerCsiHandler({final:"K"},A=>this.eraseInLine(A,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},A=>this.eraseInLine(A,!0)),this._parser.registerCsiHandler({final:"L"},A=>this.insertLines(A)),this._parser.registerCsiHandler({final:"M"},A=>this.deleteLines(A)),this._parser.registerCsiHandler({final:"P"},A=>this.deleteChars(A)),this._parser.registerCsiHandler({final:"S"},A=>this.scrollUp(A)),this._parser.registerCsiHandler({final:"T"},A=>this.scrollDown(A)),this._parser.registerCsiHandler({final:"X"},A=>this.eraseChars(A)),this._parser.registerCsiHandler({final:"Z"},A=>this.cursorBackwardTab(A)),this._parser.registerCsiHandler({final:"`"},A=>this.charPosAbsolute(A)),this._parser.registerCsiHandler({final:"a"},A=>this.hPositionRelative(A)),this._parser.registerCsiHandler({final:"b"},A=>this.repeatPrecedingCharacter(A)),this._parser.registerCsiHandler({final:"c"},A=>this.sendDeviceAttributesPrimary(A)),this._parser.registerCsiHandler({prefix:">",final:"c"},A=>this.sendDeviceAttributesSecondary(A)),this._parser.registerCsiHandler({final:"d"},A=>this.linePosAbsolute(A)),this._parser.registerCsiHandler({final:"e"},A=>this.vPositionRelative(A)),this._parser.registerCsiHandler({final:"f"},A=>this.hVPosition(A)),this._parser.registerCsiHandler({final:"g"},A=>this.tabClear(A)),this._parser.registerCsiHandler({final:"h"},A=>this.setMode(A)),this._parser.registerCsiHandler({prefix:"?",final:"h"},A=>this.setModePrivate(A)),this._parser.registerCsiHandler({final:"l"},A=>this.resetMode(A)),this._parser.registerCsiHandler({prefix:"?",final:"l"},A=>this.resetModePrivate(A)),this._parser.registerCsiHandler({final:"m"},A=>this.charAttributes(A)),this._parser.registerCsiHandler({final:"n"},A=>this.deviceStatus(A)),this._parser.registerCsiHandler({prefix:"?",final:"n"},A=>this.deviceStatusPrivate(A)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},A=>this.softReset(A)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},A=>this.setCursorStyle(A)),this._parser.registerCsiHandler({final:"r"},A=>this.setScrollRegion(A)),this._parser.registerCsiHandler({final:"s"},A=>this.saveCursor(A)),this._parser.registerCsiHandler({final:"t"},A=>this.windowOptions(A)),this._parser.registerCsiHandler({final:"u"},A=>this.restoreCursor(A)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},A=>this.insertColumns(A)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},A=>this.deleteColumns(A)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},A=>this.selectProtected(A)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},A=>this.requestMode(A,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},A=>this.requestMode(A,!1)),this._parser.setExecuteHandler(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new b.OscHandler(A=>(this.setTitle(A),this.setIconName(A),!0))),this._parser.registerOscHandler(1,new b.OscHandler(A=>this.setIconName(A))),this._parser.registerOscHandler(2,new b.OscHandler(A=>this.setTitle(A))),this._parser.registerOscHandler(4,new b.OscHandler(A=>this.setOrReportIndexedColor(A))),this._parser.registerOscHandler(8,new b.OscHandler(A=>this.setHyperlink(A))),this._parser.registerOscHandler(10,new b.OscHandler(A=>this.setOrReportFgColor(A))),this._parser.registerOscHandler(11,new b.OscHandler(A=>this.setOrReportBgColor(A))),this._parser.registerOscHandler(12,new b.OscHandler(A=>this.setOrReportCursorColor(A))),this._parser.registerOscHandler(104,new b.OscHandler(A=>this.restoreIndexedColor(A))),this._parser.registerOscHandler(110,new b.OscHandler(A=>this.restoreFgColor(A))),this._parser.registerOscHandler(111,new b.OscHandler(A=>this.restoreBgColor(A))),this._parser.registerOscHandler(112,new b.OscHandler(A=>this.restoreCursorColor(A))),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 A in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:A},()=>this.selectCharset("("+A)),this._parser.registerEscHandler({intermediates:")",final:A},()=>this.selectCharset(")"+A)),this._parser.registerEscHandler({intermediates:"*",final:A},()=>this.selectCharset("*"+A)),this._parser.registerEscHandler({intermediates:"+",final:A},()=>this.selectCharset("+"+A)),this._parser.registerEscHandler({intermediates:"-",final:A},()=>this.selectCharset("-"+A)),this._parser.registerEscHandler({intermediates:".",final:A},()=>this.selectCharset("."+A)),this._parser.registerEscHandler({intermediates:"/",final:A},()=>this.selectCharset("/"+A));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(A=>(this._logService.error("Parsing error: ",A),A)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler((A,j)=>this.requestStatusString(A,j)))}_preserveStack(L,T,P,I){this._parseStack.paused=!0,this._parseStack.cursorStartX=L,this._parseStack.cursorStartY=T,this._parseStack.decodedLength=P,this._parseStack.position=I}_logSlowResolvingAsync(L){this._logService.logLevel<=y.LogLevelEnum.WARN&&Promise.race([L,new Promise((T,P)=>setTimeout(()=>P("#SLOW_TIMEOUT"),5e3))]).catch(T=>{if(T!=="#SLOW_TIMEOUT")throw T;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(L,T){let P,I=this._activeBuffer.x,z=this._activeBuffer.y,V=0;const G=this._parseStack.paused;if(G){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,T))return this._logSlowResolvingAsync(P),P;I=this._parseStack.cursorStartX,z=this._parseStack.cursorStartY,this._parseStack.paused=!1,L.length>D&&(V=this._parseStack.position+D)}if(this._logService.logLevel<=y.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof L=="string"?` "${L}"`:` "${Array.prototype.map.call(L,K=>String.fromCharCode(K)).join("")}"`),typeof L=="string"?L.split("").map(K=>K.charCodeAt(0)):L),this._parseBuffer.length<L.length&&this._parseBuffer.length<D&&(this._parseBuffer=new Uint32Array(Math.min(L.length,D))),G||this._dirtyRowTracker.clearRange(),L.length>D)for(let K=V;K<L.length;K+=D){const Z=K+D<L.length?K+D:L.length,A=typeof L=="string"?this._stringDecoder.decode(L.substring(K,Z),this._parseBuffer):this._utf8Decoder.decode(L.subarray(K,Z),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,A))return this._preserveStack(I,z,A,K),this._logSlowResolvingAsync(P),P}else if(!G){const K=typeof L=="string"?this._stringDecoder.decode(L,this._parseBuffer):this._utf8Decoder.decode(L,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,K))return this._preserveStack(I,z,K,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===I&&this._activeBuffer.y===z||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(L,T,P){let I,z;const V=this._charsetService.charset,G=this._optionsService.rawOptions.screenReaderMode,K=this._bufferService.cols,Z=this._coreService.decPrivateModes.wraparound,A=this._coreService.modes.insertMode,j=this._curAttrData;let W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-T>0&&W.getWidth(this._activeBuffer.x-1)===2&&W.setCellFromCodePoint(this._activeBuffer.x-1,0,1,j.fg,j.bg,j.extended);for(let U=T;U<P;++U){if(I=L[U],z=this._unicodeService.wcwidth(I),I<127&&V){const Q=V[String.fromCharCode(I)];Q&&(I=Q.charCodeAt(0))}if(G&&this._onA11yChar.fire((0,f.stringFromCodePoint)(I)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),z||!this._activeBuffer.x){if(this._activeBuffer.x+z-1>=K){if(Z){for(;this._activeBuffer.x<K;)W.setCellFromCodePoint(this._activeBuffer.x++,0,1,j.fg,j.bg,j.extended);this._activeBuffer.x=0,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=K-1,z===2)continue}if(A&&(W.insertCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(j),j),W.getWidth(K-1)===2&&W.setCellFromCodePoint(K-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,j.fg,j.bg,j.extended)),W.setCellFromCodePoint(this._activeBuffer.x++,I,z,j.fg,j.bg,j.extended),z>0)for(;--z;)W.setCellFromCodePoint(this._activeBuffer.x++,0,0,j.fg,j.bg,j.extended)}else W.getWidth(this._activeBuffer.x-1)?W.addCodepointToCell(this._activeBuffer.x-1,I):W.addCodepointToCell(this._activeBuffer.x-2,I)}P-T>0&&(W.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<K&&P-T>0&&W.getWidth(this._activeBuffer.x)===0&&!W.hasContent(this._activeBuffer.x)&&W.setCellFromCodePoint(this._activeBuffer.x,0,1,j.fg,j.bg,j.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(L,T){return L.final!=="t"||L.prefix||L.intermediates?this._parser.registerCsiHandler(L,T):this._parser.registerCsiHandler(L,P=>!R(P.params[0],this._optionsService.rawOptions.windowOptions)||T(P))}registerDcsHandler(L,T){return this._parser.registerDcsHandler(L,new E.DcsHandler(T))}registerEscHandler(L,T){return this._parser.registerEscHandler(L,T)}registerOscHandler(L,T){return this._parser.registerOscHandler(L,new b.OscHandler(T))}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 L;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&&(!((L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||L===void 0)&&L.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);T.hasWidth(this._activeBuffer.x)&&!T.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const L=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-L),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(L=this._bufferService.cols-1){this._activeBuffer.x=Math.min(L,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(L,T){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=L,this._activeBuffer.y=this._activeBuffer.scrollTop+T):(this._activeBuffer.x=L,this._activeBuffer.y=T),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(L,T){this._restrictCursor(),this._setCursor(this._activeBuffer.x+L,this._activeBuffer.y+T)}cursorUp(L){const T=this._activeBuffer.y-this._activeBuffer.scrollTop;return T>=0?this._moveCursor(0,-Math.min(T,L.params[0]||1)):this._moveCursor(0,-(L.params[0]||1)),!0}cursorDown(L){const T=this._activeBuffer.scrollBottom-this._activeBuffer.y;return T>=0?this._moveCursor(0,Math.min(T,L.params[0]||1)):this._moveCursor(0,L.params[0]||1),!0}cursorForward(L){return this._moveCursor(L.params[0]||1,0),!0}cursorBackward(L){return this._moveCursor(-(L.params[0]||1),0),!0}cursorNextLine(L){return this.cursorDown(L),this._activeBuffer.x=0,!0}cursorPrecedingLine(L){return this.cursorUp(L),this._activeBuffer.x=0,!0}cursorCharAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(L){return this._setCursor(L.length>=2?(L.params[1]||1)-1:0,(L.params[0]||1)-1),!0}charPosAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(L){return this._moveCursor(L.params[0]||1,0),!0}linePosAbsolute(L){return this._setCursor(this._activeBuffer.x,(L.params[0]||1)-1),!0}vPositionRelative(L){return this._moveCursor(0,L.params[0]||1),!0}hVPosition(L){return this.cursorPosition(L),!0}tabClear(L){const T=L.params[0];return T===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:T===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=L.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=L.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(L){const T=L.params[0];return T===1&&(this._curAttrData.bg|=536870912),T!==2&&T!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(L,T,P,I=!1,z=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);V.replaceCells(T,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),z),I&&(V.isWrapped=!1)}_resetBufferLine(L,T=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),T),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+L),P.isWrapped=!1)}eraseInDisplay(L,T=!1){let P;switch(this._restrictCursor(this._bufferService.cols),L.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,T);P<this._bufferService.rows;P++)this._resetBufferLine(P,T);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,T),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,T);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,T);this._dirtyRowTracker.markDirty(0);break;case 3:const I=this._activeBuffer.lines.length-this._bufferService.rows;I>0&&(this._activeBuffer.lines.trimStart(I),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-I,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-I,0),this._onScroll.fire(0))}return!0}eraseInLine(L,T=!1){switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,T);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,T);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,T)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(L){this._restrictCursor();let T=L.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,I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,z=this._bufferService.rows-1+this._activeBuffer.ybase-I+1;for(;T--;)this._activeBuffer.lines.splice(z-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(L){this._restrictCursor();let T=L.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 I;for(I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-I;T--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(L){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.insertCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(L){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.deleteCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(L){let T=L.params[0]||1;for(;T--;)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(L){let T=L.params[0]||1;for(;T--;)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(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=L.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I.deleteCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=L.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I.insertCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=L.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I.insertCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=L.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I.deleteCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(L){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(L.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(L){if(!this._parser.precedingCodepoint)return!0;const T=L.params[0]||1,P=new Uint32Array(T);for(let I=0;I<T;++I)P[I]=this._parser.precedingCodepoint;return this.print(P,0,P.length),!0}sendDeviceAttributesPrimary(L){return L.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(L){return L.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(L.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(L){return(this._optionsService.rawOptions.termName+"").indexOf(L)===0}setMode(L){for(let T=0;T<L.length;T++)switch(L.params[T]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(L){for(let T=0;T<L.length;T++)switch(L.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.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(L){for(let T=0;T<L.length;T++)switch(L.params[T]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(L){for(let T=0;T<L.length;T++)switch(L.params[T]){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(),L.params[T]===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(L,T){const P=this._coreService.decPrivateModes,{activeProtocol:I,activeEncoding:z}=this._coreMouseService,V=this._coreService,{buffers:G,cols:K}=this._bufferService,{active:Z,alt:A}=G,j=this._optionsService.rawOptions,W=ie=>ie?1:2,U=L.params[0];return Q=U,X=T?U===2?4:U===4?W(V.modes.insertMode):U===12?3:U===20?W(j.convertEol):0:U===1?W(P.applicationCursorKeys):U===3?j.windowOptions.setWinLines?K===80?2:K===132?1:0:0:U===6?W(P.origin):U===7?W(P.wraparound):U===8?3:U===9?W(I==="X10"):U===12?W(j.cursorBlink):U===25?W(!V.isCursorHidden):U===45?W(P.reverseWraparound):U===66?W(P.applicationKeypad):U===67?4:U===1e3?W(I==="VT200"):U===1002?W(I==="DRAG"):U===1003?W(I==="ANY"):U===1004?W(P.sendFocus):U===1005?4:U===1006?W(z==="SGR"):U===1015?4:U===1016?W(z==="SGR_PIXELS"):U===1048?1:U===47||U===1047||U===1049?W(Z===A):U===2004?W(P.bracketedPasteMode):0,V.triggerDataEvent(`${u.C0.ESC}[${T?"":"?"}${Q};${X}$y`),!0;var Q,X}_updateAttrColor(L,T,P,I,z){return T===2?(L|=50331648,L&=-16777216,L|=m.AttributeData.fromColorRGB([P,I,z])):T===5&&(L&=-50331904,L|=33554432|255&P),L}_extractColor(L,T,P){const I=[0,0,-1,0,0,0];let z=0,V=0;do{if(I[V+z]=L.params[T+V],L.hasSubParams(T+V)){const G=L.getSubParams(T+V);let K=0;do I[1]===5&&(z=1),I[V+K+1+z]=G[K];while(++K<G.length&&K+V+1+z<I.length);break}if(I[1]===5&&V+z>=2||I[1]===2&&V+z>=5)break;I[1]&&(z=1)}while(++V+T<L.length&&V+z<I.length);for(let G=2;G<I.length;++G)I[G]===-1&&(I[G]=0);switch(I[0]){case 38:P.fg=this._updateAttrColor(P.fg,I[1],I[3],I[4],I[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,I[1],I[3],I[4],I[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,I[1],I[3],I[4],I[5])}return V}_processUnderline(L,T){T.extended=T.extended.clone(),(!~L||L>5)&&(L=1),T.extended.underlineStyle=L,T.fg|=268435456,L===0&&(T.fg&=-268435457),T.updateExtended()}_processSGR0(L){L.fg=n.DEFAULT_ATTR_DATA.fg,L.bg=n.DEFAULT_ATTR_DATA.bg,L.extended=L.extended.clone(),L.extended.underlineStyle=0,L.extended.underlineColor&=-67108864,L.updateExtended()}charAttributes(L){if(L.length===1&&L.params[0]===0)return this._processSGR0(this._curAttrData),!0;const T=L.length;let P;const I=this._curAttrData;for(let z=0;z<T;z++)P=L.params[z],P>=30&&P<=37?(I.fg&=-50331904,I.fg|=16777216|P-30):P>=40&&P<=47?(I.bg&=-50331904,I.bg|=16777216|P-40):P>=90&&P<=97?(I.fg&=-50331904,I.fg|=16777224|P-90):P>=100&&P<=107?(I.bg&=-50331904,I.bg|=16777224|P-100):P===0?this._processSGR0(I):P===1?I.fg|=134217728:P===3?I.bg|=67108864:P===4?(I.fg|=268435456,this._processUnderline(L.hasSubParams(z)?L.getSubParams(z)[0]:1,I)):P===5?I.fg|=536870912:P===7?I.fg|=67108864:P===8?I.fg|=1073741824:P===9?I.fg|=2147483648:P===2?I.bg|=134217728:P===21?this._processUnderline(2,I):P===22?(I.fg&=-134217729,I.bg&=-134217729):P===23?I.bg&=-67108865:P===24?(I.fg&=-268435457,this._processUnderline(0,I)):P===25?I.fg&=-536870913:P===27?I.fg&=-67108865:P===28?I.fg&=-1073741825:P===29?I.fg&=2147483647:P===39?(I.fg&=-67108864,I.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):P===49?(I.bg&=-67108864,I.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?z+=this._extractColor(L,z,I):P===53?I.bg|=1073741824:P===55?I.bg&=-1073741825:P===59?(I.extended=I.extended.clone(),I.extended.underlineColor=-1,I.updateExtended()):P===100?(I.fg&=-67108864,I.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,I.bg&=-67108864,I.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(L){switch(L.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const T=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${T};${P}R`)}return!0}deviceStatusPrivate(L){if(L.params[0]===6){const T=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${T};${P}R`)}return!0}softReset(L){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.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(L){const T=L.params[0]||1;switch(T){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=T%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(L){const T=L.params[0]||1;let P;return(L.length<2||(P=L.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>T&&(this._activeBuffer.scrollTop=T-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(L){if(!R(L.params[0],this._optionsService.rawOptions.windowOptions))return!0;const T=L.length>1?L.params[1]:0;switch(L.params[0]){case 14:T!==2&&this._onRequestWindowsOptionsReport.fire(k.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(k.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:T!==0&&T!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),T!==0&&T!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:T!==0&&T!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),T!==0&&T!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(L){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(L){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(L){return this._windowTitle=L,this._onTitleChange.fire(L),!0}setIconName(L){return this._iconName=L,!0}setOrReportIndexedColor(L){const T=[],P=L.split(";");for(;P.length>1;){const I=P.shift(),z=P.shift();if(/^\d+$/.exec(I)){const V=parseInt(I);if(N(V))if(z==="?")T.push({type:0,index:V});else{const G=(0,p.parseColor)(z);G&&T.push({type:1,index:V,color:G})}}}return T.length&&this._onColor.fire(T),!0}setHyperlink(L){const T=L.split(";");return!(T.length<2)&&(T[1]?this._createHyperlink(T[0],T[1]):!T[0]&&this._finishHyperlink())}_createHyperlink(L,T){this._getCurrentLinkId()&&this._finishHyperlink();const P=L.split(":");let I;const z=P.findIndex(V=>V.startsWith("id="));return z!==-1&&(I=P[z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:I,uri:T}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(L,T){const P=L.split(";");for(let I=0;I<P.length&&!(T>=this._specialColors.length);++I,++T)if(P[I]==="?")this._onColor.fire([{type:0,index:this._specialColors[T]}]);else{const z=(0,p.parseColor)(P[I]);z&&this._onColor.fire([{type:1,index:this._specialColors[T],color:z}])}return!0}setOrReportFgColor(L){return this._setOrReportSpecialColor(L,0)}setOrReportBgColor(L){return this._setOrReportSpecialColor(L,1)}setOrReportCursorColor(L){return this._setOrReportSpecialColor(L,2)}restoreIndexedColor(L){if(!L)return this._onColor.fire([{type:2}]),!0;const T=[],P=L.split(";");for(let I=0;I<P.length;++I)if(/^\d+$/.exec(P[I])){const z=parseInt(P[I]);N(z)&&T.push({type:2,index:z})}return T.length&&this._onColor.fire(T),!0}restoreFgColor(L){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(L){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(L){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,v.DEFAULT_CHARSET),!0}selectCharset(L){return L.length!==2?(this.selectDefaultCharset(),!0):(L[0]==="/"||this._charsetService.setgCharset(x[L[0]],v.CHARSETS[L[1]]||v.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 L=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,L,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=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(L){return this._charsetService.setgLevel(L),!0}screenAlignmentPattern(){const L=new c.CellData;L.content=4194373,L.fg=this._curAttrData.fg,L.bg=this._curAttrData.bg,this._setCursor(0,0);for(let T=0;T<this._bufferService.rows;++T){const P=this._activeBuffer.ybase+this._activeBuffer.y+T,I=this._activeBuffer.lines.get(P);I&&(I.fill(L),I.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(L,T){const P=this._bufferService.buffer,I=this._optionsService.rawOptions;return(z=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${z}${u.C0.ESC}\\`),!0))(L==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:L==='"p'?'P1$r61;1"p':L==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:L==="m"?"P1$r0m":L===" q"?`P1$r${{block:2,underline:4,bar:6}[I.cursorStyle]-(I.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(L,T){this._dirtyRowTracker.markRangeDirty(L,T)}}s.InputHandler=O;let F=class{constructor(H){this._bufferService=H,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(H){H<this.start?this.start=H:H>this.end&&(this.end=H)}markRangeDirty(H,L){H>L&&(B=H,H=L,L=B),H<this.start&&(this.start=H),L>this.end&&(this.end=L)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function N(H){return 0<=H&&H<256}F=d([g(0,y.IBufferService)],F)},844:(C,s)=>{function a(d){for(const g of d)g.dispose();d.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)===null||g===void 0||g.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}},s.toDisposable=function(d){return{dispose:d}},s.disposeArray=a,s.getDisposeArrayDisposable=function(d){return{dispose:()=>a(d)}}},1505:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(g,u,v){this._data[g]||(this._data[g]={}),this._data[g][u]=v}get(g,u){return this._data[g]?this._data[g][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(d,g,u,v,w){this._data.get(d,g)||this._data.set(d,g,new a),this._data.get(d,g).set(u,v,w)}get(d,g,u,v){var w;return(w=this._data.get(d,g))===null||w===void 0?void 0:w.get(u,v)}clear(){this._data.clear()}}},6114:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof navigator>"u";const a=s.isNode?"node":navigator.userAgent,d=s.isNode?"node":navigator.platform;s.isFirefox=a.includes("Firefox"),s.isLegacyEdge=a.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(a),s.getSafariVersion=function(){if(!s.isSafari)return 0;const g=a.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),s.isIpad=d==="iPad",s.isIphone=d==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),s.isLinux=d.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(a)},6106:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let a=0;s.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(a=this._search(this._getKey(d)),this._array.splice(a,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const g=this._getKey(d);if(g===void 0||(a=this._search(g),a===-1)||this._getKey(this._array[a])!==g)return!1;do if(this._array[a]===d)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===g);return!1}*getKeyIterator(d){if(this._array.length!==0&&(a=this._search(d),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===d))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===d)}forEachByKey(d,g){if(this._array.length!==0&&(a=this._search(d),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===d))do g(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===d)}values(){return[...this._array].values()}_search(d){let g=0,u=this._array.length-1;for(;u>=g;){let v=g+u>>1;const w=this._getKey(this._array[v]);if(w>d)u=v-1;else{if(!(w<d)){for(;v>0&&this._getKey(this._array[v-1])===d;)v--;return v}g=v+1}}return g}}},7226:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const d=a(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),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(w){this._idleCallback=void 0;let S=0,f=0,n=w.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(S=Date.now(),this._tasks[this._i]()||this._i++,S=Math.max(1,Date.now()-S),f=Math.max(S,f),o=w.timeRemaining(),1.5*f>o)return n-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-S))}ms`),void this._start();n=o}this.clear()}}class u extends g{_requestCallback(w){return setTimeout(()=>w(this._createDeadline(16)))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const S=Date.now()+w;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const d=a(643);s.updateWindowsModeWrappedState=function(g){const u=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),v=u==null?void 0:u.get(g.cols-1),w=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);w&&v&&(w.isWrapped=v[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&v[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new a;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}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}}s.AttributeData=a;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}constructor(u=0,v=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=v}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=d},9092:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const d=a(6349),g=a(7226),u=a(3734),v=a(8437),w=a(4634),S=a(511),f=a(643),n=a(4863),o=a(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(l,c,m){this._hasScrollback=l,this._optionsService=c,this._bufferService=m,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=o.DEFAULT_CHARSET,this.markers=[],this._nullCell=S.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]),this._whitespaceCell=S.CellData.fromCharData([0,f.WHITESPACE_CELL_CHAR,f.WHITESPACE_CELL_WIDTH,f.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 d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(l){return l?(this._nullCell.fg=l.fg,this._nullCell.bg=l.bg,this._nullCell.extended=l.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(l){return l?(this._whitespaceCell.fg=l.fg,this._whitespaceCell.bg=l.bg,this._whitespaceCell.extended=l.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(l,c){return new v.BufferLine(this._bufferService.cols,this.getNullCell(l),c)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const l=this.ybase+this.y-this.ydisp;return l>=0&&l<this._rows}_getCorrectBufferLength(l){if(!this._hasScrollback)return l;const c=l+this._optionsService.rawOptions.scrollback;return c>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:c}fillViewportRows(l){if(this.lines.length===0){l===void 0&&(l=v.DEFAULT_ATTR_DATA);let c=this._rows;for(;c--;)this.lines.push(this.getBlankLine(l))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(l,c){const m=this.getNullCell(v.DEFAULT_ATTR_DATA);let y=0;const b=this._getCorrectBufferLength(c);if(b>this.lines.maxLength&&(this.lines.maxLength=b),this.lines.length>0){if(this._cols<l)for(let p=0;p<this.lines.length;p++)y+=+this.lines.get(p).resize(l,m);let E=0;if(this._rows<c)for(let p=this._rows;p<c;p++)this.lines.length<c+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(l,m)):this.ybase>0&&this.lines.length<=this.ybase+this.y+E+1?(this.ybase--,E++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(l,m)));else for(let p=this._rows;p>c;p--)this.lines.length>c+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(b<this.lines.maxLength){const p=this.lines.length-b;p>0&&(this.lines.trimStart(p),this.ybase=Math.max(this.ybase-p,0),this.ydisp=Math.max(this.ydisp-p,0),this.savedY=Math.max(this.savedY-p,0)),this.lines.maxLength=b}this.x=Math.min(this.x,l-1),this.y=Math.min(this.y,c-1),E&&(this.y+=E),this.savedX=Math.min(this.savedX,l-1),this.scrollTop=0}if(this.scrollBottom=c-1,this._isReflowEnabled&&(this._reflow(l,c),this._cols>l))for(let E=0;E<this.lines.length;E++)y+=+this.lines.get(E).resize(l,m);this._cols=l,this._rows=c,this._memoryCleanupQueue.clear(),y>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let l=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,l=!1);let c=0;for(;this._memoryCleanupPosition<this.lines.length;)if(c+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),c>100)return!0;return l}get _isReflowEnabled(){const l=this._optionsService.rawOptions.windowsPty;return l&&l.buildNumber?this._hasScrollback&&l.backend==="conpty"&&l.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(l,c){this._cols!==l&&(l>this._cols?this._reflowLarger(l,c):this._reflowSmaller(l,c))}_reflowLarger(l,c){const m=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,l,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(m.length>0){const y=(0,w.reflowLargerCreateNewLayout)(this.lines,m);(0,w.reflowLargerApplyNewLayout)(this.lines,y.layout),this._reflowLargerAdjustViewport(l,c,y.countRemoved)}}_reflowLargerAdjustViewport(l,c,m){const y=this.getNullCell(v.DEFAULT_ATTR_DATA);let b=m;for(;b-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<c&&this.lines.push(new v.BufferLine(l,y))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-m,0)}_reflowSmaller(l,c){const m=this.getNullCell(v.DEFAULT_ATTR_DATA),y=[];let b=0;for(let E=this.lines.length-1;E>=0;E--){let p=this.lines.get(E);if(!p||!p.isWrapped&&p.getTrimmedLength()<=l)continue;const x=[p];for(;p.isWrapped&&E>0;)p=this.lines.get(--E),x.unshift(p);const D=this.ybase+this.y;if(D>=E&&D<E+x.length)continue;const R=x[x.length-1].getTrimmedLength(),k=(0,w.reflowSmallerGetNewLineLengths)(x,this._cols,l),B=k.length-x.length;let O;O=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+B):Math.max(0,this.lines.length-this.lines.maxLength+B);const F=[];for(let I=0;I<B;I++){const z=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);F.push(z)}F.length>0&&(y.push({start:E+x.length+b,newLines:F}),b+=F.length),x.push(...F);let N=k.length-1,H=k[N];H===0&&(N--,H=k[N]);let L=x.length-B-1,T=R;for(;L>=0;){const I=Math.min(T,H);if(x[N]===void 0)break;if(x[N].copyCellsFrom(x[L],T-I,H-I,I,!0),H-=I,H===0&&(N--,H=k[N]),T-=I,T===0){L--;const z=Math.max(L,0);T=(0,w.getWrappedLineTrimmedLength)(x,z,this._cols)}}for(let I=0;I<x.length;I++)k[I]<l&&x[I].setCell(k[I],m);let P=B-O;for(;P-- >0;)this.ybase===0?this.y<c-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+b)-c&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+B,this.ybase+c-1)}if(y.length>0){const E=[],p=[];for(let N=0;N<this.lines.length;N++)p.push(this.lines.get(N));const x=this.lines.length;let D=x-1,R=0,k=y[R];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+b);let B=0;for(let N=Math.min(this.lines.maxLength-1,x+b-1);N>=0;N--)if(k&&k.start>D+B){for(let H=k.newLines.length-1;H>=0;H--)this.lines.set(N--,k.newLines[H]);N++,E.push({index:D+1,amount:k.newLines.length}),B+=k.newLines.length,k=y[++R]}else this.lines.set(N,p[D--]);let O=0;for(let N=E.length-1;N>=0;N--)E[N].index+=O,this.lines.onInsertEmitter.fire(E[N]),O+=E[N].amount;const F=Math.max(0,x+b-this.lines.maxLength);F>0&&this.lines.onTrimEmitter.fire(F)}}translateBufferLineToString(l,c,m=0,y){const b=this.lines.get(l);return b?b.translateToString(c,m,y):""}getWrappedRangeForLine(l){let c=l,m=l;for(;c>0&&this.lines.get(c).isWrapped;)c--;for(;m+1<this.lines.length&&this.lines.get(m+1).isWrapped;)m++;return{first:c,last:m}}setupTabStops(l){for(l!=null?this.tabs[l]||(l=this.prevStop(l)):(this.tabs={},l=0);l<this._cols;l+=this._optionsService.rawOptions.tabStopWidth)this.tabs[l]=!0}prevStop(l){for(l==null&&(l=this.x);!this.tabs[--l]&&l>0;);return l>=this._cols?this._cols-1:l<0?0:l}nextStop(l){for(l==null&&(l=this.x);!this.tabs[++l]&&l<this._cols;);return l>=this._cols?this._cols-1:l<0?0:l}clearMarkers(l){this._isClearing=!0;for(let c=0;c<this.markers.length;c++)this.markers[c].line===l&&(this.markers[c].dispose(),this.markers.splice(c--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].dispose(),this.markers.splice(l--,1);this._isClearing=!1}addMarker(l){const c=new n.Marker(l);return this.markers.push(c),c.register(this.lines.onTrim(m=>{c.line-=m,c.line<0&&c.dispose()})),c.register(this.lines.onInsert(m=>{c.line>=m.index&&(c.line+=m.amount)})),c.register(this.lines.onDelete(m=>{c.line>=m.index&&c.line<m.index+m.amount&&c.dispose(),c.line>m.index&&(c.line-=m.amount)})),c.register(c.onDispose(()=>this._removeMarker(c))),c}_removeMarker(l){this._isClearing||this.markers.splice(this.markers.indexOf(l),1)}}},8437:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const d=a(3734),g=a(511),u=a(643),v=a(482);s.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let w=0;class S{constructor(n,o,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const c=o||g.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let m=0;m<n;++m)this.setCell(m,c);this.length=n}get(n){const o=this._data[3*n+0],l=2097151&o;return[this._data[3*n+1],2097152&o?this._combined[n]:l?(0,v.stringFromCodePoint)(l):"",o>>22,2097152&o?this._combined[n].charCodeAt(this._combined[n].length-1):l]}set(n,o){this._data[3*n+1]=o[u.CHAR_DATA_ATTR_INDEX],o[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=o[1],this._data[3*n+0]=2097152|n|o[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=o[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const o=this._data[3*n+0];return 2097152&o?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&o}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const o=this._data[3*n+0];return 2097152&o?this._combined[n]:2097151&o?(0,v.stringFromCodePoint)(2097151&o):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,o){return w=3*n,o.content=this._data[w+0],o.fg=this._data[w+1],o.bg=this._data[w+2],2097152&o.content&&(o.combinedData=this._combined[n]),268435456&o.bg&&(o.extended=this._extendedAttrs[n]),o}setCell(n,o){2097152&o.content&&(this._combined[n]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[n]=o.extended),this._data[3*n+0]=o.content,this._data[3*n+1]=o.fg,this._data[3*n+2]=o.bg}setCellFromCodePoint(n,o,l,c,m,y){268435456&m&&(this._extendedAttrs[n]=y),this._data[3*n+0]=o|l<<22,this._data[3*n+1]=c,this._data[3*n+2]=m}addCodepointToCell(n,o){let l=this._data[3*n+0];2097152&l?this._combined[n]+=(0,v.stringFromCodePoint)(o):(2097151&l?(this._combined[n]=(0,v.stringFromCodePoint)(2097151&l)+(0,v.stringFromCodePoint)(o),l&=-2097152,l|=2097152):l=o|4194304,this._data[3*n+0]=l)}insertCells(n,o,l,c){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodePoint(n-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),o<this.length-n){const m=new g.CellData;for(let y=this.length-n-o-1;y>=0;--y)this.setCell(n+o+y,this.loadCell(n+y,m));for(let y=0;y<o;++y)this.setCell(n+y,l)}else for(let m=n;m<this.length;++m)this.setCell(m,l);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs)}deleteCells(n,o,l,c){if(n%=this.length,o<this.length-n){const m=new g.CellData;for(let y=0;y<this.length-n-o;++y)this.setCell(n+y,this.loadCell(n+o+y,m));for(let y=this.length-o;y<this.length;++y)this.setCell(y,l)}else for(let m=n;m<this.length;++m)this.setCell(m,l);n&&this.getWidth(n-1)===2&&this.setCellFromCodePoint(n-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodePoint(n,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs)}replaceCells(n,o,l,c,m=!1){if(m)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodePoint(n-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),o<this.length&&this.getWidth(o-1)===2&&!this.isProtected(o)&&this.setCellFromCodePoint(o,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs);n<o&&n<this.length;)this.isProtected(n)||this.setCell(n,l),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodePoint(n-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),o<this.length&&this.getWidth(o-1)===2&&this.setCellFromCodePoint(o,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs);n<o&&n<this.length;)this.setCell(n++,l)}resize(n,o){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const l=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*l)this._data=new Uint32Array(this._data.buffer,0,l);else{const c=new Uint32Array(l);c.set(this._data),this._data=c}for(let c=this.length;c<n;++c)this.setCell(c,o)}else{this._data=this._data.subarray(0,l);const c=Object.keys(this._combined);for(let y=0;y<c.length;y++){const b=parseInt(c[y],10);b>=n&&delete this._combined[b]}const m=Object.keys(this._extendedAttrs);for(let y=0;y<m.length;y++){const b=parseInt(m[y],10);b>=n&&delete this._extendedAttrs[b]}}return this.length=n,4*l*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,o=!1){if(o)for(let l=0;l<this.length;++l)this.isProtected(l)||this.setCell(l,n);else{this._combined={},this._extendedAttrs={};for(let l=0;l<this.length;++l)this.setCell(l,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const o in n._combined)this._combined[o]=n._combined[o];this._extendedAttrs={};for(const o in n._extendedAttrs)this._extendedAttrs[o]=n._extendedAttrs[o];this.isWrapped=n.isWrapped}clone(){const n=new S(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const o in this._combined)n._combined[o]=this._combined[o];for(const o in this._extendedAttrs)n._extendedAttrs[o]=this._extendedAttrs[o];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,o,l,c,m){const y=n._data;if(m)for(let E=c-1;E>=0;E--){for(let p=0;p<3;p++)this._data[3*(l+E)+p]=y[3*(o+E)+p];268435456&y[3*(o+E)+2]&&(this._extendedAttrs[l+E]=n._extendedAttrs[o+E])}else for(let E=0;E<c;E++){for(let p=0;p<3;p++)this._data[3*(l+E)+p]=y[3*(o+E)+p];268435456&y[3*(o+E)+2]&&(this._extendedAttrs[l+E]=n._extendedAttrs[o+E])}const b=Object.keys(n._combined);for(let E=0;E<b.length;E++){const p=parseInt(b[E],10);p>=o&&(this._combined[p-o+l]=n._combined[p])}}translateToString(n=!1,o=0,l=this.length){n&&(l=Math.min(l,this.getTrimmedLength()));let c="";for(;o<l;){const m=this._data[3*o+0],y=2097151&m;c+=2097152&m?this._combined[o]:y?(0,v.stringFromCodePoint)(y):u.WHITESPACE_CELL_CHAR,o+=m>>22||1}return c}}s.BufferLine=S},4841:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(a,d){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return d*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(C,s)=>{function a(d,g,u){if(g===d.length-1)return d[g].getTrimmedLength();const v=!d[g].hasContent(u-1)&&d[g].getWidth(u-1)===1,w=d[g+1].getWidth(0)===2;return v&&w?u-1:u}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(d,g,u,v,w){const S=[];for(let f=0;f<d.length-1;f++){let n=f,o=d.get(++n);if(!o.isWrapped)continue;const l=[d.get(f)];for(;n<d.length&&o.isWrapped;)l.push(o),o=d.get(++n);if(v>=f&&v<n){f+=l.length-1;continue}let c=0,m=a(l,c,g),y=1,b=0;for(;y<l.length;){const p=a(l,y,g),x=p-b,D=u-m,R=Math.min(x,D);l[c].copyCellsFrom(l[y],b,m,R,!1),m+=R,m===u&&(c++,m=0),b+=R,b===p&&(y++,b=0),m===0&&c!==0&&l[c-1].getWidth(u-1)===2&&(l[c].copyCellsFrom(l[c-1],u-1,m++,1,!1),l[c-1].setCell(u-1,w))}l[c].replaceCells(m,u,w);let E=0;for(let p=l.length-1;p>0&&(p>c||l[p].getTrimmedLength()===0);p--)E++;E>0&&(S.push(f+l.length-E),S.push(E)),f+=l.length-1}return S},s.reflowLargerCreateNewLayout=function(d,g){const u=[];let v=0,w=g[v],S=0;for(let f=0;f<d.length;f++)if(w===f){const n=g[++v];d.onDeleteEmitter.fire({index:f-S,amount:n}),f+=n-1,S+=n,w=g[++v]}else u.push(f);return{layout:u,countRemoved:S}},s.reflowLargerApplyNewLayout=function(d,g){const u=[];for(let v=0;v<g.length;v++)u.push(d.get(g[v]));for(let v=0;v<u.length;v++)d.set(v,u[v]);d.length=g.length},s.reflowSmallerGetNewLineLengths=function(d,g,u){const v=[],w=d.map((o,l)=>a(d,l,g)).reduce((o,l)=>o+l);let S=0,f=0,n=0;for(;n<w;){if(w-n<u){v.push(w-n);break}S+=u;const o=a(d,f,g);S>o&&(S-=o,f++);const l=d[f].getWidth(S-1)===2;l&&S--;const c=l?u-1:u;v.push(c),n+=c}return v},s.getWrappedLineTrimmedLength=a},5295:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const d=a(8460),g=a(844),u=a(9092);class v extends g.Disposable{constructor(S,f){super(),this._optionsService=S,this._bufferService=f,this._onBufferActivate=this.register(new d.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.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(S){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(S),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(S,f){this._normal.resize(S,f),this._alt.resize(S,f),this.setupTabStops(S)}setupTabStops(S){this._normal.setupTabStops(S),this._alt.setupTabStops(S)}}s.BufferSet=v},511:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const d=a(482),g=a(643),u=a(3734);class v extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(S){const f=new v;return f.setFromCharData(S),f}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(S[g.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(S[g.CHAR_DATA_CHAR_INDEX].length===2){const n=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const o=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(n-55296)+o-56320+65536|S[g.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[g.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=S[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=v},643:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const d=a(8460),g=a(844);class u{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}s.Marker=u,u._nextId=1},7116:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.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:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(C,s)=>{var a,d,g;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
47
+ `,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""}(a||(s.C0=a={})),function(u){u.PAD="€",u.HOP="",u.BPH="‚",u.NBH="ƒ",u.IND="„",u.NEL="…",u.SSA="†",u.ESA="‡",u.HTS="ˆ",u.HTJ="‰",u.VTS="Š",u.PLD="‹",u.PLU="Œ",u.RI="",u.SS2="Ž",u.SS3="",u.DCS="",u.PU1="‘",u.PU2="’",u.STS="“",u.CCH="”",u.MW="•",u.SPA="–",u.EPA="—",u.SOS="˜",u.SGCI="™",u.SCI="š",u.CSI="›",u.ST="œ",u.OSC="",u.PM="ž",u.APC="Ÿ"}(d||(s.C1=d={})),function(u){u.ST=`${a.ESC}\\`}(g||(s.C1_ESCAPED=g={}))},7399:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const d=a(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:["'",'"']};s.evaluateKeyboardEvent=function(u,v,w,S){const f={type:0,cancel:!1,key:void 0},n=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?f.key=v?d.C0.ESC+"OA":d.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?f.key=v?d.C0.ESC+"OD":d.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?f.key=v?d.C0.ESC+"OC":d.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(f.key=v?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:if(u.altKey){f.key=d.C0.ESC+d.C0.DEL;break}f.key=d.C0.DEL;break;case 9:if(u.shiftKey){f.key=d.C0.ESC+"[Z";break}f.key=d.C0.HT,f.cancel=!0;break;case 13:f.key=u.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,f.cancel=!0;break;case 27:f.key=d.C0.ESC,u.altKey&&(f.key=d.C0.ESC+d.C0.ESC),f.cancel=!0;break;case 37:if(u.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"D",f.key===d.C0.ESC+"[1;3D"&&(f.key=d.C0.ESC+(w?"b":"[1;5D"))):f.key=v?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(u.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"C",f.key===d.C0.ESC+"[1;3C"&&(f.key=d.C0.ESC+(w?"f":"[1;5C"))):f.key=v?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(u.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"A",w||f.key!==d.C0.ESC+"[1;3A"||(f.key=d.C0.ESC+"[1;5A")):f.key=v?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(u.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"B",w||f.key!==d.C0.ESC+"[1;3B"||(f.key=d.C0.ESC+"[1;5B")):f.key=v?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(f.key=d.C0.ESC+"[2~");break;case 46:f.key=n?d.C0.ESC+"[3;"+(n+1)+"~":d.C0.ESC+"[3~";break;case 36:f.key=n?d.C0.ESC+"[1;"+(n+1)+"H":v?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:f.key=n?d.C0.ESC+"[1;"+(n+1)+"F":v?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:u.shiftKey?f.type=2:u.ctrlKey?f.key=d.C0.ESC+"[5;"+(n+1)+"~":f.key=d.C0.ESC+"[5~";break;case 34:u.shiftKey?f.type=3:u.ctrlKey?f.key=d.C0.ESC+"[6;"+(n+1)+"~":f.key=d.C0.ESC+"[6~";break;case 112:f.key=n?d.C0.ESC+"[1;"+(n+1)+"P":d.C0.ESC+"OP";break;case 113:f.key=n?d.C0.ESC+"[1;"+(n+1)+"Q":d.C0.ESC+"OQ";break;case 114:f.key=n?d.C0.ESC+"[1;"+(n+1)+"R":d.C0.ESC+"OR";break;case 115:f.key=n?d.C0.ESC+"[1;"+(n+1)+"S":d.C0.ESC+"OS";break;case 116:f.key=n?d.C0.ESC+"[15;"+(n+1)+"~":d.C0.ESC+"[15~";break;case 117:f.key=n?d.C0.ESC+"[17;"+(n+1)+"~":d.C0.ESC+"[17~";break;case 118:f.key=n?d.C0.ESC+"[18;"+(n+1)+"~":d.C0.ESC+"[18~";break;case 119:f.key=n?d.C0.ESC+"[19;"+(n+1)+"~":d.C0.ESC+"[19~";break;case 120:f.key=n?d.C0.ESC+"[20;"+(n+1)+"~":d.C0.ESC+"[20~";break;case 121:f.key=n?d.C0.ESC+"[21;"+(n+1)+"~":d.C0.ESC+"[21~";break;case 122:f.key=n?d.C0.ESC+"[23;"+(n+1)+"~":d.C0.ESC+"[23~";break;case 123:f.key=n?d.C0.ESC+"[24;"+(n+1)+"~":d.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(w&&!S||!u.altKey||u.metaKey)!w||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?f.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(f.key=d.C0.US),u.key==="@"&&(f.key=d.C0.NUL)):u.keyCode===65&&(f.type=1);else{const o=g[u.keyCode],l=o==null?void 0:o[u.shiftKey?1:0];if(l)f.key=d.C0.ESC+l;else if(u.keyCode>=65&&u.keyCode<=90){const c=u.ctrlKey?u.keyCode-64:u.keyCode+32;let m=String.fromCharCode(c);u.shiftKey&&(m=m.toUpperCase()),f.key=d.C0.ESC+m}else if(u.keyCode===32)f.key=d.C0.ESC+(u.ctrlKey?d.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let c=u.code.slice(3,4);u.shiftKey||(c=c.toLowerCase()),f.key=d.C0.ESC+c,f.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?f.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?f.key=d.C0.NUL:u.keyCode>=51&&u.keyCode<=55?f.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?f.key=d.C0.DEL:u.keyCode===219?f.key=d.C0.ESC:u.keyCode===220?f.key=d.C0.FS:u.keyCode===221&&(f.key=d.C0.GS)}return f}},482:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},s.utf32ToString=function(a,d=0,g=a.length){let u="";for(let v=d;v<g;++v){let w=a[v];w>65535?(w-=65536,u+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):u+=String.fromCharCode(w)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,d){const g=a.length;if(!g)return 0;let u=0,v=0;if(this._interim){const w=a.charCodeAt(v++);56320<=w&&w<=57343?d[u++]=1024*(this._interim-55296)+w-56320+65536:(d[u++]=this._interim,d[u++]=w),this._interim=0}for(let w=v;w<g;++w){const S=a.charCodeAt(w);if(55296<=S&&S<=56319){if(++w>=g)return this._interim=S,u;const f=a.charCodeAt(w);56320<=f&&f<=57343?d[u++]=1024*(S-55296)+f-56320+65536:(d[u++]=S,d[u++]=f)}else S!==65279&&(d[u++]=S)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,d){const g=a.length;if(!g)return 0;let u,v,w,S,f=0,n=0,o=0;if(this.interim[0]){let m=!1,y=this.interim[0];y&=(224&y)==192?31:(240&y)==224?15:7;let b,E=0;for(;(b=63&this.interim[++E])&&E<4;)y<<=6,y|=b;const p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,x=p-E;for(;o<x;){if(o>=g)return 0;if(b=a[o++],(192&b)!=128){o--,m=!0;break}this.interim[E++]=b,y<<=6,y|=63&b}m||(p===2?y<128?o--:d[f++]=y:p===3?y<2048||y>=55296&&y<=57343||y===65279||(d[f++]=y):y<65536||y>1114111||(d[f++]=y)),this.interim.fill(0)}const l=g-4;let c=o;for(;c<g;){for(;!(!(c<l)||128&(u=a[c])||128&(v=a[c+1])||128&(w=a[c+2])||128&(S=a[c+3]));)d[f++]=u,d[f++]=v,d[f++]=w,d[f++]=S,c+=4;if(u=a[c++],u<128)d[f++]=u;else if((224&u)==192){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(n=(31&u)<<6|63&v,n<128){c--;continue}d[f++]=n}else if((240&u)==224){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,f;if(w=a[c++],(192&w)!=128){c--;continue}if(n=(15&u)<<12|(63&v)<<6|63&w,n<2048||n>=55296&&n<=57343||n===65279)continue;d[f++]=n}else if((248&u)==240){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,f;if(w=a[c++],(192&w)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,this.interim[2]=w,f;if(S=a[c++],(192&S)!=128){c--;continue}if(n=(7&u)<<18|(63&v)<<12|(63&w)<<6|63&S,n<65536||n>1114111)continue;d[f++]=n}}return f}}},225:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const a=[[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 g;s.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let u=0;u<a.length;++u)g.fill(0,a[u][0],a[u][1]+1)}}wcwidth(u){return u<32?0:u<127?1:u<65536?g[u]:function(v,w){let S,f=0,n=w.length-1;if(v<w[0][0]||v>w[n][1])return!1;for(;n>=f;)if(S=f+n>>1,v>w[S][1])f=S+1;else{if(!(v<w[S][0]))return!0;n=S-1}return!1}(u,d)?0:u>=131072&&u<=196605||u>=196608&&u<=262141?2:1}}},5981:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const d=a(8460),g=a(844);class u extends g.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,S){if(S!==void 0&&this._syncCalls>S)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let f;for(this._isSyncWriting=!0;f=this._writeBuffer.shift();){this._action(f);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,S){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+=w.length,this._writeBuffer.push(w),this._callbacks.push(S),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(S)}_innerWrite(w=0,S=!0){const f=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],o=this._action(n,S);if(o){const c=m=>Date.now()-f>=12?setTimeout(()=>this._innerWrite(0,m)):this._innerWrite(f,m);return void o.catch(m=>(queueMicrotask(()=>{throw m}),Promise.resolve(!1))).then(c)}const l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-f>=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()}}s.WriteBuffer=u},5941:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,d=/^[\da-f]+$/;function g(u,v){const w=u.toString(16),S=w.length<2?"0"+w:w;switch(v){case 4:return w[0];case 8:return S;case 12:return(S+S).slice(0,3);default:return S+S}}s.parseColor=function(u){if(!u)return;let v=u.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const w=a.exec(v);if(w){const S=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/S*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/S*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/S*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),d.exec(v)&&[3,6,9,12].includes(v.length))){const w=v.length/3,S=[0,0,0];for(let f=0;f<3;++f){const n=parseInt(v.slice(w*f,w*f+w),16);S[f]=w===1?n<<4:w===2?n:w===3?n>>4:n>>8}return S}},s.toRgbString=function(u,v=16){const[w,S,f]=u;return`rgb:${g(w,v)}/${g(S,v)}/${g(f,v)}`}},5770:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const d=a(482),g=a(8742),u=a(5770),v=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(S,f){this._handlers[S]===void 0&&(this._handlers[S]=[]);const n=this._handlers[S];return n.push(f),{dispose:()=>{const o=n.indexOf(f);o!==-1&&n.splice(o,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}reset(){if(this._active.length)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(S,f){if(this.reset(),this._ident=S,this._active=this._handlers[S]||v,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(f);else this._handlerFb(this._ident,"HOOK",f)}put(S,f,n){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(S,f,n);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(S,f,n))}unhook(S,f=!0){if(this._active.length){let n=!1,o=this._active.length-1,l=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,n=f,l=this._stack.fallThrough,this._stack.paused=!1),!l&&n===!1){for(;o>=0&&(n=this._active[o].unhook(S),n!==!0);o--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,n;o--}for(;o>=0;o--)if(n=this._active[o].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",S);this._active=v,this._ident=0}};const w=new g.Params;w.addParam(0),s.DcsHandler=class{constructor(S){this._handler=S,this._data="",this._params=w,this._hitLimit=!1}hook(S){this._params=S.length>1||S.params[0]?S.clone():w,this._data="",this._hitLimit=!1}put(S,f,n){this._hitLimit||(this._data+=(0,d.utf32ToString)(S,f,n),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(S){let f=!1;if(this._hitLimit)f=!1;else if(S&&(f=this._handler(this._data,this._params),f instanceof Promise))return f.then(n=>(this._params=w,this._data="",this._hitLimit=!1,n));return this._params=w,this._data="",this._hitLimit=!1,f}}},2015:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const d=a(844),g=a(8742),u=a(6242),v=a(6351);class w{constructor(o){this.table=new Uint8Array(o)}setDefault(o,l){this.table.fill(o<<4|l)}add(o,l,c,m){this.table[l<<8|o]=c<<4|m}addMany(o,l,c,m){for(let y=0;y<o.length;y++)this.table[l<<8|o[y]]=c<<4|m}}s.TransitionTable=w;const S=160;s.VT500_TRANSITION_TABLE=function(){const n=new w(4095),o=Array.apply(null,Array(256)).map((E,p)=>p),l=(E,p)=>o.slice(E,p),c=l(32,127),m=l(0,24);m.push(25),m.push.apply(m,l(28,32));const y=l(0,14);let b;for(b in n.setDefault(1,0),n.addMany(c,0,2,0),y)n.addMany([24,26,153,154],b,3,0),n.addMany(l(128,144),b,3,0),n.addMany(l(144,152),b,3,0),n.add(156,b,0,0),n.add(27,b,11,1),n.add(157,b,4,8),n.addMany([152,158,159],b,0,7),n.add(155,b,11,3),n.add(144,b,11,9);return n.addMany(m,0,3,0),n.addMany(m,1,3,1),n.add(127,1,0,1),n.addMany(m,8,0,8),n.addMany(m,3,3,3),n.add(127,3,0,3),n.addMany(m,4,3,4),n.add(127,4,0,4),n.addMany(m,6,3,6),n.addMany(m,5,3,5),n.add(127,5,0,5),n.addMany(m,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(c,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(l(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(c,7,0,7),n.addMany(m,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(l(64,127),3,7,0),n.addMany(l(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(l(48,60),4,8,4),n.addMany(l(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(l(32,64),6,0,6),n.add(127,6,0,6),n.addMany(l(64,127),6,0,0),n.addMany(l(32,48),3,9,5),n.addMany(l(32,48),5,9,5),n.addMany(l(48,64),5,0,6),n.addMany(l(64,127),5,7,0),n.addMany(l(32,48),4,9,5),n.addMany(l(32,48),1,9,2),n.addMany(l(32,48),2,9,2),n.addMany(l(48,127),2,10,0),n.addMany(l(48,80),1,10,0),n.addMany(l(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(l(96,127),1,10,0),n.add(80,1,11,9),n.addMany(m,9,0,9),n.add(127,9,0,9),n.addMany(l(28,32),9,0,9),n.addMany(l(32,48),9,9,12),n.addMany(l(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(m,11,0,11),n.addMany(l(32,128),11,0,11),n.addMany(l(28,32),11,0,11),n.addMany(m,10,0,10),n.add(127,10,0,10),n.addMany(l(28,32),10,0,10),n.addMany(l(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(l(32,48),10,9,12),n.addMany(m,12,0,12),n.add(127,12,0,12),n.addMany(l(28,32),12,0,12),n.addMany(l(32,48),12,9,12),n.addMany(l(48,64),12,0,11),n.addMany(l(64,127),12,12,13),n.addMany(l(64,127),10,12,13),n.addMany(l(64,127),9,12,13),n.addMany(m,13,13,13),n.addMany(c,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(S,0,2,0),n.add(S,8,5,8),n.add(S,6,0,6),n.add(S,11,0,11),n.add(S,13,13,13),n}();class f extends d.Disposable{constructor(o=s.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.precedingCodepoint=0,this._printHandlerFb=(l,c,m)=>{},this._executeHandlerFb=l=>{},this._csiHandlerFb=(l,c)=>{},this._escHandlerFb=l=>{},this._errorHandlerFb=l=>l,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(o,l=[64,126]){let c=0;if(o.prefix){if(o.prefix.length>1)throw new Error("only one byte as prefix supported");if(c=o.prefix.charCodeAt(0),c&&60>c||c>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 y=0;y<o.intermediates.length;++y){const b=o.intermediates.charCodeAt(y);if(32>b||b>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=b}}if(o.final.length!==1)throw new Error("final must be a single byte");const m=o.final.charCodeAt(0);if(l[0]>m||m>l[1])throw new Error(`final must be in range ${l[0]} .. ${l[1]}`);return c<<=8,c|=m,c}identToString(o){const l=[];for(;o;)l.push(String.fromCharCode(255&o)),o>>=8;return l.reverse().join("")}setPrintHandler(o){this._printHandler=o}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(o,l){const c=this._identifier(o,[48,126]);this._escHandlers[c]===void 0&&(this._escHandlers[c]=[]);const m=this._escHandlers[c];return m.push(l),{dispose:()=>{const y=m.indexOf(l);y!==-1&&m.splice(y,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,l){this._executeHandlers[o.charCodeAt(0)]=l}clearExecuteHandler(o){this._executeHandlers[o.charCodeAt(0)]&&delete this._executeHandlers[o.charCodeAt(0)]}setExecuteHandlerFallback(o){this._executeHandlerFb=o}registerCsiHandler(o,l){const c=this._identifier(o);this._csiHandlers[c]===void 0&&(this._csiHandlers[c]=[]);const m=this._csiHandlers[c];return m.push(l),{dispose:()=>{const y=m.indexOf(l);y!==-1&&m.splice(y,1)}}}clearCsiHandler(o){this._csiHandlers[this._identifier(o)]&&delete this._csiHandlers[this._identifier(o)]}setCsiHandlerFallback(o){this._csiHandlerFb=o}registerDcsHandler(o,l){return this._dcsParser.registerHandler(this._identifier(o),l)}clearDcsHandler(o){this._dcsParser.clearHandler(this._identifier(o))}setDcsHandlerFallback(o){this._dcsParser.setHandlerFallback(o)}registerOscHandler(o,l){return this._oscParser.registerHandler(o,l)}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.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(o,l,c,m,y){this._parseStack.state=o,this._parseStack.handlers=l,this._parseStack.handlerPos=c,this._parseStack.transition=m,this._parseStack.chunkPos=y}parse(o,l,c){let m,y=0,b=0,E=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,E=this._parseStack.chunkPos+1;else{if(c===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const p=this._parseStack.handlers;let x=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&x>-1){for(;x>=0&&(m=p[x](this._params),m!==!0);x--)if(m instanceof Promise)return this._parseStack.handlerPos=x,m}this._parseStack.handlers=[];break;case 4:if(c===!1&&x>-1){for(;x>=0&&(m=p[x](),m!==!0);x--)if(m instanceof Promise)return this._parseStack.handlerPos=x,m}this._parseStack.handlers=[];break;case 6:if(y=o[this._parseStack.chunkPos],m=this._dcsParser.unhook(y!==24&&y!==26,c),m)return m;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(y=o[this._parseStack.chunkPos],m=this._oscParser.end(y!==24&&y!==26,c),m)return m;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,E=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let p=E;p<l;++p){switch(y=o[p],b=this._transitions.table[this.currentState<<8|(y<160?y:S)],b>>4){case 2:for(let B=p+1;;++B){if(B>=l||(y=o[B])<32||y>126&&y<S){this._printHandler(o,p,B),p=B-1;break}if(++B>=l||(y=o[B])<32||y>126&&y<S){this._printHandler(o,p,B),p=B-1;break}if(++B>=l||(y=o[B])<32||y>126&&y<S){this._printHandler(o,p,B),p=B-1;break}if(++B>=l||(y=o[B])<32||y>126&&y<S){this._printHandler(o,p,B),p=B-1;break}}break;case 3:this._executeHandlers[y]?this._executeHandlers[y]():this._executeHandlerFb(y),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:p,code:y,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const x=this._csiHandlers[this._collect<<8|y];let D=x?x.length-1:-1;for(;D>=0&&(m=x[D](this._params),m!==!0);D--)if(m instanceof Promise)return this._preserveStack(3,x,D,b,p),m;D<0&&this._csiHandlerFb(this._collect<<8|y,this._params),this.precedingCodepoint=0;break;case 8:do switch(y){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(y-48)}while(++p<l&&(y=o[p])>47&&y<60);p--;break;case 9:this._collect<<=8,this._collect|=y;break;case 10:const R=this._escHandlers[this._collect<<8|y];let k=R?R.length-1:-1;for(;k>=0&&(m=R[k](),m!==!0);k--)if(m instanceof Promise)return this._preserveStack(4,R,k,b,p),m;k<0&&this._escHandlerFb(this._collect<<8|y),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|y,this._params);break;case 13:for(let B=p+1;;++B)if(B>=l||(y=o[B])===24||y===26||y===27||y>127&&y<S){this._dcsParser.put(o,p,B),p=B-1;break}break;case 14:if(m=this._dcsParser.unhook(y!==24&&y!==26),m)return this._preserveStack(6,[],0,b,p),m;y===27&&(b|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let B=p+1;;B++)if(B>=l||(y=o[B])<32||y>127&&y<S){this._oscParser.put(o,p,B),p=B-1;break}break;case 6:if(m=this._oscParser.end(y!==24&&y!==26),m)return this._preserveStack(5,[],0,b,p),m;y===27&&(b|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&b}}}s.EscapeSequenceParser=f},6242:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const d=a(5770),g=a(482),u=[];s.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,w){this._handlers[v]===void 0&&(this._handlers[v]=[]);const S=this._handlers[v];return S.push(w),{dispose:()=>{const f=S.indexOf(w);f!==-1&&S.splice(f,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,w,S){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(v,w,S);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(v,w,S))}start(){this.reset(),this._state=1}put(v,w,S){if(this._state!==3){if(this._state===1)for(;w<S;){const f=v[w++];if(f===59){this._state=2,this._start();break}if(f<48||57<f)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+f-48}this._state===2&&S-w>0&&this._put(v,w,S)}}end(v,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let S=!1,f=this._active.length-1,n=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,S=w,n=this._stack.fallThrough,this._stack.paused=!1),!n&&S===!1){for(;f>=0&&(S=this._active[f].end(v),S!==!0);f--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,S;f--}for(;f>=0;f--)if(S=this._active[f].end(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,S}else this._handlerFb(this._id,"END",v);this._active=u,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,w,S){this._hitLimit||(this._data+=(0,g.utf32ToString)(v,w,S),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let w=!1;if(this._hitLimit)w=!1;else if(v&&(w=this._handler(this._data),w instanceof Promise))return w.then(S=>(this._data="",this._hitLimit=!1,S));return this._data="",this._hitLimit=!1,w}}},8742:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const a=2147483647;class d{static fromArray(u){const v=new d;if(!u.length)return v;for(let w=Array.isArray(u[0])?1:0;w<u.length;++w){const S=u[w];if(Array.isArray(S))for(let f=0;f<S.length;++f)v.addSubParam(S[f]);else v.addParam(S)}return v}constructor(u=32,v=32){if(this.maxLength=u,this.maxSubParamsLength=v,v>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new d(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let v=0;v<this.length;++v){u.push(this.params[v]);const w=this._subParamsIdx[v]>>8,S=255&this._subParamsIdx[v];S-w>0&&u.push(Array.prototype.slice.call(this._subParams,w,S))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>a?a:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>a?a:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const v=this._subParamsIdx[u]>>8,w=255&this._subParamsIdx[u];return w-v>0?this._subParams.subarray(v,w):null}getSubParamsAll(){const u={};for(let v=0;v<this.length;++v){const w=this._subParamsIdx[v]>>8,S=255&this._subParamsIdx[v];S-w>0&&(u[v]=this._subParams.slice(w,S))}return u}addDigit(u){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,S=w[v-1];w[v-1]=~S?Math.min(10*S+u,a):u}}s.Params=d},5741:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,d){const g={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(g),d.dispose=()=>this._wrappedAddonDispose(g),d.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let d=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===a){d=g;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(d,1)}}},8771:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const d=a(3785),g=a(511);s.BufferApiView=class{constructor(u,v){this._buffer=u,this.type=v}init(u){return this._buffer=u,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(u){const v=this._buffer.lines.get(u);if(v)return new d.BufferLineApiView(v)}getNullCell(){return new g.CellData}}},3785:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const d=a(511);s.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,u){if(!(g<0||g>=this._line.length))return u?(this._line.loadCell(g,u),u):this._line.loadCell(g,new d.CellData)}translateToString(g,u,v){return this._line.translateToString(g,u,v)}}},8285:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const d=a(8771),g=a(8460),u=a(844);class v extends u.Disposable{constructor(S){super(),this._core=S,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}s.BufferNamespaceApi=v},7975:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,d){return this._core.registerCsiHandler(a,g=>d(g.toArray()))}addCsiHandler(a,d){return this.registerCsiHandler(a,d)}registerDcsHandler(a,d){return this._core.registerDcsHandler(a,(g,u)=>d(g,u.toArray()))}addDcsHandler(a,d){return this.registerDcsHandler(a,d)}registerEscHandler(a,d){return this._core.registerEscHandler(a,d)}addEscHandler(a,d){return this.registerEscHandler(a,d)}registerOscHandler(a,d){return this._core.registerOscHandler(a,d)}addOscHandler(a,d){return this.registerOscHandler(a,d)}}},7090:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(C,s,a){var d=this&&this.__decorate||function(n,o,l,c){var m,y=arguments.length,b=y<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,o,l,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(o,l,b):m(o,l))||b);return y>3&&b&&Object.defineProperty(o,l,b),b},g=this&&this.__param||function(n,o){return function(l,c){o(l,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const u=a(8460),v=a(844),w=a(5295),S=a(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let f=s.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(n.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(n,this))}resize(n,o){this.cols=n,this.rows=o,this.buffers.resize(n,o),this._onResize.fire({cols:n,rows:o})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,o=!1){const l=this.buffer;let c;c=this._cachedBlankLine,c&&c.length===this.cols&&c.getFg(0)===n.fg&&c.getBg(0)===n.bg||(c=l.getBlankLine(n,o),this._cachedBlankLine=c),c.isWrapped=o;const m=l.ybase+l.scrollTop,y=l.ybase+l.scrollBottom;if(l.scrollTop===0){const b=l.lines.isFull;y===l.lines.length-1?b?l.lines.recycle().copyFrom(c):l.lines.push(c.clone()):l.lines.splice(y+1,0,c.clone()),b?this.isUserScrolling&&(l.ydisp=Math.max(l.ydisp-1,0)):(l.ybase++,this.isUserScrolling||l.ydisp++)}else{const b=y-m+1;l.lines.shiftElements(m+1,b-1,-1),l.lines.set(y,c.clone())}this.isUserScrolling||(l.ydisp=l.ybase),this._onScroll.fire(l.ydisp)}scrollLines(n,o,l){const c=this.buffer;if(n<0){if(c.ydisp===0)return;this.isUserScrolling=!0}else n+c.ydisp>=c.ybase&&(this.isUserScrolling=!1);const m=c.ydisp;c.ydisp=Math.max(Math.min(c.ydisp+n,c.ybase),0),m!==c.ydisp&&(o||this._onScroll.fire(c.ydisp))}};s.BufferService=f=d([g(0,S.IOptionsService)],f)},7994:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,d){this._charsets[a]=d,this.glevel===a&&(this.charset=d)}}},1753:function(C,s,a){var d=this&&this.__decorate||function(c,m,y,b){var E,p=arguments.length,x=p<3?m:b===null?b=Object.getOwnPropertyDescriptor(m,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,m,y,b);else for(var D=c.length-1;D>=0;D--)(E=c[D])&&(x=(p<3?E(x):p>3?E(m,y,x):E(m,y))||x);return p>3&&x&&Object.defineProperty(m,y,x),x},g=this&&this.__param||function(c,m){return function(y,b){m(y,b,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const u=a(2585),v=a(8460),w=a(844),S={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:c=>c.button!==4&&c.action===1&&(c.ctrl=!1,c.alt=!1,c.shift=!1,!0)},VT200:{events:19,restrict:c=>c.action!==32},DRAG:{events:23,restrict:c=>c.action!==32||c.button!==3},ANY:{events:31,restrict:c=>!0}};function f(c,m){let y=(c.ctrl?16:0)|(c.shift?4:0)|(c.alt?8:0);return c.button===4?(y|=64,y|=c.action):(y|=3&c.button,4&c.button&&(y|=64),8&c.button&&(y|=128),c.action===32?y|=32:c.action!==0||m||(y|=3)),y}const n=String.fromCharCode,o={DEFAULT:c=>{const m=[f(c,!1)+32,c.col+32,c.row+32];return m[0]>255||m[1]>255||m[2]>255?"":`\x1B[M${n(m[0])}${n(m[1])}${n(m[2])}`},SGR:c=>{const m=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${f(c,!0)};${c.col};${c.row}${m}`},SGR_PIXELS:c=>{const m=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${f(c,!0)};${c.x};${c.y}${m}`}};let l=s.CoreMouseService=class extends w.Disposable{constructor(c,m){super(),this._bufferService=c,this._coreService=m,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const y of Object.keys(S))this.addProtocol(y,S[y]);for(const y of Object.keys(o))this.addEncoding(y,o[y]);this.reset()}addProtocol(c,m){this._protocols[c]=m}addEncoding(c,m){this._encodings[c]=m}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(c){if(!this._protocols[c])throw new Error(`unknown protocol "${c}"`);this._activeProtocol=c,this._onProtocolChange.fire(this._protocols[c].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(c){if(!this._encodings[c])throw new Error(`unknown encoding "${c}"`);this._activeEncoding=c}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(c){if(c.col<0||c.col>=this._bufferService.cols||c.row<0||c.row>=this._bufferService.rows||c.button===4&&c.action===32||c.button===3&&c.action!==32||c.button!==4&&(c.action===2||c.action===3)||(c.col++,c.row++,c.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,c,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(c))return!1;const m=this._encodings[this._activeEncoding](c);return m&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(m):this._coreService.triggerDataEvent(m,!0)),this._lastEvent=c,!0}explainEvents(c){return{down:!!(1&c),up:!!(2&c),drag:!!(4&c),move:!!(8&c),wheel:!!(16&c)}}_equalEvents(c,m,y){if(y){if(c.x!==m.x||c.y!==m.y)return!1}else if(c.col!==m.col||c.row!==m.row)return!1;return c.button===m.button&&c.action===m.action&&c.ctrl===m.ctrl&&c.alt===m.alt&&c.shift===m.shift}};s.CoreMouseService=l=d([g(0,u.IBufferService),g(1,u.ICoreService)],l)},6975:function(C,s,a){var d=this&&this.__decorate||function(l,c,m,y){var b,E=arguments.length,p=E<3?c:y===null?y=Object.getOwnPropertyDescriptor(c,m):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(l,c,m,y);else for(var x=l.length-1;x>=0;x--)(b=l[x])&&(p=(E<3?b(p):E>3?b(c,m,p):b(c,m))||p);return E>3&&p&&Object.defineProperty(c,m,p),p},g=this&&this.__param||function(l,c){return function(m,y){c(m,y,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const u=a(1439),v=a(8460),w=a(844),S=a(2585),f=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let o=s.CoreService=class extends w.Disposable{constructor(l,c,m){super(),this._bufferService=l,this._logService=c,this._optionsService=m,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(f),this.decPrivateModes=(0,u.clone)(n)}reset(){this.modes=(0,u.clone)(f),this.decPrivateModes=(0,u.clone)(n)}triggerDataEvent(l,c=!1){if(this._optionsService.rawOptions.disableStdin)return;const m=this._bufferService.buffer;c&&this._optionsService.rawOptions.scrollOnUserInput&&m.ybase!==m.ydisp&&this._onRequestScrollToBottom.fire(),c&&this._onUserInput.fire(),this._logService.debug(`sending data "${l}"`,()=>l.split("").map(y=>y.charCodeAt(0))),this._onData.fire(l)}triggerBinaryEvent(l){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${l}"`,()=>l.split("").map(c=>c.charCodeAt(0))),this._onBinary.fire(l))}};s.CoreService=o=d([g(0,S.IBufferService),g(1,S.ILogService),g(2,S.IOptionsService)],o)},9074:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const d=a(8055),g=a(8460),u=a(844),v=a(6106);let w=0,S=0;class f extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList(l=>l==null?void 0:l.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,u.toDisposable)(()=>this.reset()))}registerDecoration(l){if(l.marker.isDisposed)return;const c=new n(l);if(c){const m=c.marker.onDispose(()=>c.dispose());c.onDispose(()=>{c&&(this._decorations.delete(c)&&this._onDecorationRemoved.fire(c),m.dispose())}),this._decorations.insert(c),this._onDecorationRegistered.fire(c)}return c}reset(){for(const l of this._decorations.values())l.dispose();this._decorations.clear()}*getDecorationsAtCell(l,c,m){var y,b,E;let p=0,x=0;for(const D of this._decorations.getKeyIterator(c))p=(y=D.options.x)!==null&&y!==void 0?y:0,x=p+((b=D.options.width)!==null&&b!==void 0?b:1),l>=p&&l<x&&(!m||((E=D.options.layer)!==null&&E!==void 0?E:"bottom")===m)&&(yield D)}forEachDecorationAtCell(l,c,m,y){this._decorations.forEachByKey(c,b=>{var E,p,x;w=(E=b.options.x)!==null&&E!==void 0?E:0,S=w+((p=b.options.width)!==null&&p!==void 0?p:1),l>=w&&l<S&&(!m||((x=b.options.layer)!==null&&x!==void 0?x:"bottom")===m)&&y(b)})}}s.DecorationService=f;class n extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(l){super(),this.options=l,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=l.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const d=a(2585),g=a(8343);class u{constructor(...w){this._entries=new Map;for(const[S,f]of w)this.set(S,f)}set(w,S){const f=this._entries.get(w);return this._entries.set(w,S),f}forEach(w){for(const[S,f]of this._entries.entries())w(S,f)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}s.ServiceCollection=u,s.InstantiationService=class{constructor(){this._services=new u,this._services.set(d.IInstantiationService,this)}setService(v,w){this._services.set(v,w)}getService(v){return this._services.get(v)}createInstance(v,...w){const S=(0,g.getServiceDependencies)(v).sort((o,l)=>o.index-l.index),f=[];for(const o of S){const l=this._services.get(o.id);if(!l)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${o.id}.`);f.push(l)}const n=S.length>0?S[0].index:w.length;if(w.length!==n)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${n+1} conflicts with ${w.length} static arguments`);return new v(...w,...f)}}},7866:function(C,s,a){var d=this&&this.__decorate||function(n,o,l,c){var m,y=arguments.length,b=y<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,o,l,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(o,l,b):m(o,l))||b);return y>3&&b&&Object.defineProperty(o,l,b),b},g=this&&this.__param||function(n,o){return function(l,c){o(l,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=a(844),v=a(2585),w={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let S,f=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),S=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let o=0;o<n.length;o++)typeof n[o]=="function"&&(n[o]=n[o]())}_log(n,o,l){this._evalLazyOptionalParams(l),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...l)}trace(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.TRACE&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.trace.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,n,o)}debug(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.debug.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,n,o)}info(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.INFO&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.info.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.info,n,o)}warn(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.WARN&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.warn.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.warn,n,o)}error(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.ERROR&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.error.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.error,n,o)}};s.LogService=f=d([g(0,v.IOptionsService)],f),s.setTraceLogger=function(n){S=n},s.traceCall=function(n,o,l){if(typeof l.value!="function")throw new Error("not supported");const c=l.value;l.value=function(...m){if(S.logLevel!==v.LogLevelEnum.TRACE)return c.apply(this,m);S.trace(`GlyphRenderer#${c.name}(${m.map(b=>JSON.stringify(b)).join(", ")})`);const y=c.apply(this,m);return S.trace(`GlyphRenderer#${c.name} return`,y),y}}},7302:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const d=a(8460),g=a(844),u=a(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends g.Disposable{constructor(f){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n=Object.assign({},s.DEFAULT_OPTIONS);for(const o in f)if(o in n)try{const l=f[o];n[o]=this._sanitizeAndValidateOption(o,l)}catch(l){console.error(l)}this.rawOptions=n,this.options=Object.assign({},n),this._setupOptions()}onSpecificOptionChange(f,n){return this.onOptionChange(o=>{o===f&&n(this.rawOptions[f])})}onMultipleOptionChange(f,n){return this.onOptionChange(o=>{f.indexOf(o)!==-1&&n()})}_setupOptions(){const f=o=>{if(!(o in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);return this.rawOptions[o]},n=(o,l)=>{if(!(o in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);l=this._sanitizeAndValidateOption(o,l),this.rawOptions[o]!==l&&(this.rawOptions[o]=l,this._onOptionChange.fire(o))};for(const o in this.rawOptions){const l={get:f.bind(this,o),set:n.bind(this,o)};Object.defineProperty(this.options,o,l)}}_sanitizeAndValidateOption(f,n){switch(f){case"cursorStyle":if(n||(n=s.DEFAULT_OPTIONS[f]),!function(o){return o==="block"||o==="underline"||o==="bar"}(n))throw new Error(`"${n}" is not a valid value for ${f}`);break;case"wordSeparator":n||(n=s.DEFAULT_OPTIONS[f]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=v.includes(n)?n:s.DEFAULT_OPTIONS[f];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${f} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${f} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${f} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${f} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}s.OptionsService=w},2660:function(C,s,a){var d=this&&this.__decorate||function(w,S,f,n){var o,l=arguments.length,c=l<3?S:n===null?n=Object.getOwnPropertyDescriptor(S,f):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(w,S,f,n);else for(var m=w.length-1;m>=0;m--)(o=w[m])&&(c=(l<3?o(c):l>3?o(S,f,c):o(S,f))||c);return l>3&&c&&Object.defineProperty(S,f,c),c},g=this&&this.__param||function(w,S){return function(f,n){S(f,n,w)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const u=a(2585);let v=s.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const S=this._bufferService.buffer;if(w.id===void 0){const m=S.addMarker(S.ybase+S.y),y={data:w,id:this._nextId++,lines:[m]};return m.onDispose(()=>this._removeMarkerFromLink(y,m)),this._dataByLinkId.set(y.id,y),y.id}const f=w,n=this._getEntryIdKey(f),o=this._entriesWithId.get(n);if(o)return this.addLineToLink(o.id,S.ybase+S.y),o.id;const l=S.addMarker(S.ybase+S.y),c={id:this._nextId++,key:this._getEntryIdKey(f),data:f,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(c,l)),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(w,S){const f=this._dataByLinkId.get(w);if(f&&f.lines.every(n=>n.line!==S)){const n=this._bufferService.buffer.addMarker(S);f.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(f,n))}}getLinkData(w){var S;return(S=this._dataByLinkId.get(w))===null||S===void 0?void 0:S.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,S){const f=w.lines.indexOf(S);f!==-1&&(w.lines.splice(f,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};s.OscLinkService=v=d([g(0,u.IBufferService)],v)},8343:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const a="di$target",d="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[d]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const u=function(v,w,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,n,o){n[a]===n?n[d].push({id:f,index:o}):(n[d]=[{id:f,index:o}],n[a]=n)})(u,v,S)};return u.toString=()=>g,s.serviceRegistry.set(g,u),u}},2585:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const d=a(8343);var g;s.IBufferService=(0,d.createDecorator)("BufferService"),s.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),s.ICoreService=(0,d.createDecorator)("CoreService"),s.ICharsetService=(0,d.createDecorator)("CharsetService"),s.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(g||(s.LogLevelEnum=g={})),s.ILogService=(0,d.createDecorator)("LogService"),s.IOptionsService=(0,d.createDecorator)("OptionsService"),s.IOscLinkService=(0,d.createDecorator)("OscLinkService"),s.IUnicodeService=(0,d.createDecorator)("UnicodeService"),s.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const d=a(8460),g=a(225);s.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const u=new g.UnicodeV6;this.register(u),this._active=u.version,this._activeProvider=u}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(u){if(!this._providers[u])throw new Error(`unknown Unicode version "${u}"`);this._active=u,this._activeProvider=this._providers[u],this._onChange.fire(u)}register(u){this._providers[u.version]=u}wcwidth(u){return this._activeProvider.wcwidth(u)}getStringCellWidth(u){let v=0;const w=u.length;for(let S=0;S<w;++S){let f=u.charCodeAt(S);if(55296<=f&&f<=56319){if(++S>=w)return v+this.wcwidth(f);const n=u.charCodeAt(S);56320<=n&&n<=57343?f=1024*(f-55296)+n-56320+65536:v+=this.wcwidth(n)}v+=this.wcwidth(f)}return v}}}},i={};function h(C){var s=i[C];if(s!==void 0)return s.exports;var a=i[C]={exports:{}};return r[C].call(a.exports,a,a.exports,h),a.exports}var _={};return(()=>{var C=_;Object.defineProperty(C,"__esModule",{value:!0}),C.Terminal=void 0;const s=h(9042),a=h(3236),d=h(844),g=h(5741),u=h(8285),v=h(7975),w=h(7090),S=["cols","rows"];class f extends d.Disposable{constructor(o){super(),this._core=this.register(new a.Terminal(o)),this._addonManager=this.register(new g.AddonManager),this._publicOptions=Object.assign({},this._core.options);const l=m=>this._core.options[m],c=(m,y)=>{this._checkReadonlyOptions(m),this._core.options[m]=y};for(const m in this._core.options){const y={get:l.bind(this,m),set:c.bind(this,m)};Object.defineProperty(this._publicOptions,m,y)}}_checkReadonlyOptions(o){if(S.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 v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new w.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 u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const o=this._core.coreService.decPrivateModes;let l="none";switch(this._core.coreMouseService.activeProtocol){case"X10":l="x10";break;case"VT200":l="vt200";break;case"DRAG":l="drag";break;case"ANY":l="any"}return{applicationCursorKeysMode:o.applicationCursorKeys,applicationKeypadMode:o.applicationKeypad,bracketedPasteMode:o.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:o.origin,reverseWraparoundMode:o.reverseWraparound,sendFocusMode:o.sendFocus,wraparoundMode:o.wraparound}}get options(){return this._publicOptions}set options(o){for(const l in o)this._publicOptions[l]=o[l]}blur(){this._core.blur()}focus(){this._core.focus()}resize(o,l){this._verifyIntegers(o,l),this._core.resize(o,l)}open(o){this._core.open(o)}attachCustomKeyEventHandler(o){this._core.attachCustomKeyEventHandler(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){var l,c,m;return this._checkProposedApi(),this._verifyPositiveIntegers((l=o.x)!==null&&l!==void 0?l:0,(c=o.width)!==null&&c!==void 0?c:0,(m=o.height)!==null&&m!==void 0?m:0),this._core.registerDecoration(o)}hasSelection(){return this._core.hasSelection()}select(o,l,c){this._verifyIntegers(o,l,c),this._core.select(o,l,c)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(o,l){this._verifyIntegers(o,l),this._core.selectLines(o,l)}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,l){this._core.write(o,l)}writeln(o,l){this._core.write(o),this._core.write(`\r
48
+ `,l)}paste(o){this._core.paste(o)}refresh(o,l){this._verifyIntegers(o,l),this._core.refresh(o,l)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(o){this._addonManager.loadAddon(this,o)}static get strings(){return s}_verifyIntegers(...o){for(const l of o)if(l===1/0||isNaN(l)||l%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...o){for(const l of o)if(l&&(l===1/0||isNaN(l)||l%1!=0||l<0))throw new Error("This API only accepts positive integers")}}C.Terminal=f})(),_})())})(Yu);var Up=Yu.exports,Ju={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(h){this._terminal=h}dispose(){}fit(){const h=this.proposeDimensions();if(!h||!this._terminal||isNaN(h.cols)||isNaN(h.rows))return;const _=this._terminal._core;this._terminal.rows===h.rows&&this._terminal.cols===h.cols||(_._renderService.clear(),this._terminal.resize(h.cols,h.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const h=this._terminal._core,_=h._renderService.dimensions;if(_.css.cell.width===0||_.css.cell.height===0)return;const C=this._terminal.options.scrollback===0?0:h.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(s.getPropertyValue("height")),d=Math.max(0,parseInt(s.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),u=a-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),v=d-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-C;return{cols:Math.max(2,Math.floor(v/_.css.cell.width)),rows:Math.max(1,Math.floor(u/_.css.cell.height))}}}})(),r})())})(Ju);var Wp=Ju.exports,Zu={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(df,()=>(()=>{var r={433:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV11=void 0;const a=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],d=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],g=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],u=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let v;function w(S,f){let n,o=0,l=f.length-1;if(S<f[0][0]||S>f[l][1])return!1;for(;l>=o;)if(n=o+l>>1,S>f[n][1])o=n+1;else{if(!(S<f[n][0]))return!0;l=n-1}return!1}s.UnicodeV11=class{constructor(){if(this.version="11",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160);for(let S=0;S<a.length;++S)v.fill(0,a[S][0],a[S][1]+1);for(let S=0;S<g.length;++S)v.fill(2,g[S][0],g[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?v[S]:w(S,d)?0:w(S,u)?2:1}}}},i={};function h(C){var s=i[C];if(s!==void 0)return s.exports;var a=i[C]={exports:{}};return r[C](a,a.exports,h),a.exports}var _={};return(()=>{var C=_;Object.defineProperty(C,"__esModule",{value:!0}),C.Unicode11Addon=void 0;const s=h(433);C.Unicode11Addon=class{activate(a){a.unicode.register(new s.UnicodeV11)}dispose(){}}})(),_})())})(Zu);var Vp=Zu.exports,ed={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(d,g,u,v={}){this._terminal=d,this._regex=g,this._handler=u,this._options=v}provideLinks(d,g){const u=a.computeLink(d,this._regex,this._terminal,this._handler);g(this._addCallbacks(u))}_addCallbacks(d){return d.map(g=>(g.leave=this._options.leave,g.hover=(u,v)=>{if(this._options.hover){const{range:w}=g;this._options.hover(u,v,w)}},g))}};class a{static computeLink(g,u,v,w){const S=new RegExp(u.source,(u.flags||"")+"g"),[f,n]=a._getWindowedLineStrings(g-1,v),o=f.join("");let l;const c=[];for(;l=S.exec(o);){const m=l[0];try{const D=new URL(m),R=decodeURI(D.toString());if(m!==R&&m+"/"!==R)continue}catch{continue}const[y,b]=a._mapStrIdx(v,n,0,l.index),[E,p]=a._mapStrIdx(v,y,b,m.length);if(y===-1||b===-1||E===-1||p===-1)continue;const x={start:{x:b+1,y:y+1},end:{x:p,y:E+1}};c.push({range:x,text:m,activate:w})}return c}static _getWindowedLineStrings(g,u){let v,w=g,S=g,f=0,n="";const o=[];if(v=u.buffer.active.getLine(g)){const l=v.translateToString(!0);if(v.isWrapped&&l[0]!==" "){for(f=0;(v=u.buffer.active.getLine(--w))&&f<2048&&(n=v.translateToString(!0),f+=n.length,o.push(n),v.isWrapped&&n.indexOf(" ")===-1););o.reverse()}for(o.push(l),f=0;(v=u.buffer.active.getLine(++S))&&v.isWrapped&&f<2048&&(n=v.translateToString(!0),f+=n.length,o.push(n),n.indexOf(" ")===-1););}return[o,w]}static _mapStrIdx(g,u,v,w){const S=g.buffer.active,f=S.getNullCell();let n=v;for(;w;){const o=S.getLine(u);if(!o)return[-1,-1];for(let l=n;l<o.length;++l){o.getCell(l,f);const c=f.getChars();if(f.getWidth()&&(w-=c.length||1,l===o.length-1&&c==="")){const m=S.getLine(u+1);m&&m.isWrapped&&(m.getCell(0,f),f.getWidth()===2&&(w+=1))}if(w<0)return[u,l]}u++,n=0}return[u,n]}}s.LinkComputer=a}},i={};function h(C){var s=i[C];if(s!==void 0)return s.exports;var a=i[C]={exports:{}};return r[C](a,a.exports,h),a.exports}var _={};return(()=>{var C=_;Object.defineProperty(C,"__esModule",{value:!0}),C.WebLinksAddon=void 0;const s=h(6),a=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(g,u){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}C.WebLinksAddon=class{constructor(g=d,u={}){this._handler=g,this._options=u}activate(g){this._terminal=g;const u=this._options,v=u.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,v,this._handler,u))}dispose(){var g;(g=this._linkProvider)===null||g===void 0||g.dispose()}}})(),_})())})(ed);var Kp=ed.exports,td={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={965:function(C,s,a){var d=this&&this.__decorate||function(E,p,x,D){var R,k=arguments.length,B=k<3?p:D===null?D=Object.getOwnPropertyDescriptor(p,x):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(E,p,x,D);else for(var O=E.length-1;O>=0;O--)(R=E[O])&&(B=(k<3?R(B):k>3?R(p,x,B):R(p,x))||B);return k>3&&B&&Object.defineProperty(p,x,B),B};Object.defineProperty(s,"__esModule",{value:!0}),s.GlyphRenderer=void 0;const g=a(374),u=a(509),v=a(855),w=a(859),S=a(776),f=a(381),n=11,o=n*Float32Array.BYTES_PER_ELEMENT;let l,c=0,m=0,y=0;class b extends w.Disposable{constructor(p,x,D){super(),this._terminal=p,this._gl=x,this._dimensions=D,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const R=this._gl;u.TextureAtlas.maxAtlasPages===void 0&&(u.TextureAtlas.maxAtlasPages=Math.min(32,(0,g.throwIfFalsy)(R.getParameter(R.MAX_TEXTURE_IMAGE_UNITS))),u.TextureAtlas.maxTextureSize=(0,g.throwIfFalsy)(R.getParameter(R.MAX_TEXTURE_SIZE))),this._program=(0,g.throwIfFalsy)((0,f.createProgram)(R,`#version 300 es
49
+ layout (location = 0) in vec2 a_unitquad;
50
+ layout (location = 1) in vec2 a_cellpos;
51
+ layout (location = 2) in vec2 a_offset;
52
+ layout (location = 3) in vec2 a_size;
53
+ layout (location = 4) in float a_texpage;
54
+ layout (location = 5) in vec2 a_texcoord;
55
+ layout (location = 6) in vec2 a_texsize;
56
+
57
+ uniform mat4 u_projection;
58
+ uniform vec2 u_resolution;
59
+
60
+ out vec2 v_texcoord;
61
+ flat out int v_texpage;
62
+
63
+ void main() {
64
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
65
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
66
+ v_texpage = int(a_texpage);
67
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
68
+ }`,function(H){let L="";for(let T=1;T<H;T++)L+=` else if (v_texpage == ${T}) { outColor = texture(u_texture[${T}], v_texcoord); }`;return`#version 300 es
69
+ precision lowp float;
70
+
71
+ in vec2 v_texcoord;
72
+ flat in int v_texpage;
73
+
74
+ uniform sampler2D u_texture[${H}];
75
+
76
+ out vec4 outColor;
77
+
78
+ void main() {
79
+ if (v_texpage == 0) {
80
+ outColor = texture(u_texture[0], v_texcoord);
81
+ } ${L}
82
+ }`}(u.TextureAtlas.maxAtlasPages))),this.register((0,w.toDisposable)(()=>R.deleteProgram(this._program))),this._projectionLocation=(0,g.throwIfFalsy)(R.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,g.throwIfFalsy)(R.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,g.throwIfFalsy)(R.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=R.createVertexArray(),R.bindVertexArray(this._vertexArrayObject);const k=new Float32Array([0,0,1,0,0,1,1,1]),B=R.createBuffer();this.register((0,w.toDisposable)(()=>R.deleteBuffer(B))),R.bindBuffer(R.ARRAY_BUFFER,B),R.bufferData(R.ARRAY_BUFFER,k,R.STATIC_DRAW),R.enableVertexAttribArray(0),R.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const O=new Uint8Array([0,1,2,3]),F=R.createBuffer();this.register((0,w.toDisposable)(()=>R.deleteBuffer(F))),R.bindBuffer(R.ELEMENT_ARRAY_BUFFER,F),R.bufferData(R.ELEMENT_ARRAY_BUFFER,O,R.STATIC_DRAW),this._attributesBuffer=(0,g.throwIfFalsy)(R.createBuffer()),this.register((0,w.toDisposable)(()=>R.deleteBuffer(this._attributesBuffer))),R.bindBuffer(R.ARRAY_BUFFER,this._attributesBuffer),R.enableVertexAttribArray(2),R.vertexAttribPointer(2,2,R.FLOAT,!1,o,0),R.vertexAttribDivisor(2,1),R.enableVertexAttribArray(3),R.vertexAttribPointer(3,2,R.FLOAT,!1,o,2*Float32Array.BYTES_PER_ELEMENT),R.vertexAttribDivisor(3,1),R.enableVertexAttribArray(4),R.vertexAttribPointer(4,1,R.FLOAT,!1,o,4*Float32Array.BYTES_PER_ELEMENT),R.vertexAttribDivisor(4,1),R.enableVertexAttribArray(5),R.vertexAttribPointer(5,2,R.FLOAT,!1,o,5*Float32Array.BYTES_PER_ELEMENT),R.vertexAttribDivisor(5,1),R.enableVertexAttribArray(6),R.vertexAttribPointer(6,2,R.FLOAT,!1,o,7*Float32Array.BYTES_PER_ELEMENT),R.vertexAttribDivisor(6,1),R.enableVertexAttribArray(1),R.vertexAttribPointer(1,2,R.FLOAT,!1,o,9*Float32Array.BYTES_PER_ELEMENT),R.vertexAttribDivisor(1,1),R.useProgram(this._program);const N=new Int32Array(u.TextureAtlas.maxAtlasPages);for(let H=0;H<u.TextureAtlas.maxAtlasPages;H++)N[H]=H;R.uniform1iv(this._textureLocation,N),R.uniformMatrix4fv(this._projectionLocation,!1,f.PROJECTION_MATRIX),this._atlasTextures=[];for(let H=0;H<u.TextureAtlas.maxAtlasPages;H++){const L=new f.GLTexture((0,g.throwIfFalsy)(R.createTexture()));this.register((0,w.toDisposable)(()=>R.deleteTexture(L.texture))),R.activeTexture(R.TEXTURE0+H),R.bindTexture(R.TEXTURE_2D,L.texture),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,R.CLAMP_TO_EDGE),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,R.CLAMP_TO_EDGE),R.texImage2D(R.TEXTURE_2D,0,R.RGBA,1,1,0,R.RGBA,R.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[H]=L}R.enable(R.BLEND),R.blendFunc(R.SRC_ALPHA,R.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(p,x,D,R,k,B,O,F){this._updateCell(this._vertices.attributes,p,x,D,R,k,B,O,F)}_updateCell(p,x,D,R,k,B,O,F,N){c=(D*this._terminal.cols+x)*n,R!==v.NULL_CELL_CODE&&R!==void 0?this._atlas&&(l=F&&F.length>1?this._atlas.getRasterizedGlyphCombinedChar(F,k,B,O,!1):this._atlas.getRasterizedGlyph(R,k,B,O,!1),m=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),k!==N&&l.offset.x>m?(y=l.offset.x-m,p[c]=-(l.offset.x-y)+this._dimensions.device.char.left,p[c+1]=-l.offset.y+this._dimensions.device.char.top,p[c+2]=(l.size.x-y)/this._dimensions.device.canvas.width,p[c+3]=l.size.y/this._dimensions.device.canvas.height,p[c+4]=l.texturePage,p[c+5]=l.texturePositionClipSpace.x+y/this._atlas.pages[l.texturePage].canvas.width,p[c+6]=l.texturePositionClipSpace.y,p[c+7]=l.sizeClipSpace.x-y/this._atlas.pages[l.texturePage].canvas.width,p[c+8]=l.sizeClipSpace.y):(p[c]=-l.offset.x+this._dimensions.device.char.left,p[c+1]=-l.offset.y+this._dimensions.device.char.top,p[c+2]=l.size.x/this._dimensions.device.canvas.width,p[c+3]=l.size.y/this._dimensions.device.canvas.height,p[c+4]=l.texturePage,p[c+5]=l.texturePositionClipSpace.x,p[c+6]=l.texturePositionClipSpace.y,p[c+7]=l.sizeClipSpace.x,p[c+8]=l.sizeClipSpace.y)):p.fill(0,c,c+n-1-2)}clear(){const p=this._terminal,x=p.cols*p.rows*n;this._vertices.count!==x?this._vertices.attributes=new Float32Array(x):this._vertices.attributes.fill(0);let D=0;for(;D<this._vertices.attributesBuffers.length;D++)this._vertices.count!==x?this._vertices.attributesBuffers[D]=new Float32Array(x):this._vertices.attributesBuffers[D].fill(0);this._vertices.count=x,D=0;for(let R=0;R<p.rows;R++)for(let k=0;k<p.cols;k++)this._vertices.attributes[D+9]=k/p.cols,this._vertices.attributes[D+10]=R/p.rows,D+=n}handleResize(){const p=this._gl;p.useProgram(this._program),p.viewport(0,0,p.canvas.width,p.canvas.height),p.uniform2f(this._resolutionLocation,p.canvas.width,p.canvas.height),this.clear()}render(p){if(!this._atlas)return;const x=this._gl;x.useProgram(this._program),x.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const D=this._vertices.attributesBuffers[this._activeBuffer];let R=0;for(let k=0;k<p.lineLengths.length;k++){const B=k*this._terminal.cols*n,O=this._vertices.attributes.subarray(B,B+p.lineLengths[k]*n);D.set(O,R),R+=O.length}x.bindBuffer(x.ARRAY_BUFFER,this._attributesBuffer),x.bufferData(x.ARRAY_BUFFER,D.subarray(0,R),x.STREAM_DRAW);for(let k=0;k<this._atlas.pages.length;k++)this._atlas.pages[k].version!==this._atlasTextures[k].version&&this._bindAtlasPageTexture(x,this._atlas,k);x.drawElementsInstanced(x.TRIANGLE_STRIP,4,x.UNSIGNED_BYTE,0,R/n)}setAtlas(p){this._atlas=p;for(const x of this._atlasTextures)x.version=-1}_bindAtlasPageTexture(p,x,D){p.activeTexture(p.TEXTURE0+D),p.bindTexture(p.TEXTURE_2D,this._atlasTextures[D].texture),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texImage2D(p.TEXTURE_2D,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,x.pages[D].canvas),p.generateMipmap(p.TEXTURE_2D),this._atlasTextures[D].version=x.pages[D].version}setDimensions(p){this._dimensions=p}}s.GlyphRenderer=b,d([S.traceCall],b.prototype,"updateCell",null)},742:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RectangleRenderer=void 0;const d=a(374),g=a(859),u=a(310),v=a(381),w=8*Float32Array.BYTES_PER_ELEMENT;class S{constructor(){this.attributes=new Float32Array(160),this.count=0}}let f=0,n=0,o=0,l=0,c=0,m=0,y=0;class b extends g.Disposable{constructor(p,x,D,R){super(),this._terminal=p,this._gl=x,this._dimensions=D,this._themeService=R,this._vertices=new S,this._verticesCursor=new S;const k=this._gl;this._program=(0,d.throwIfFalsy)((0,v.createProgram)(k,`#version 300 es
83
+ layout (location = 0) in vec2 a_position;
84
+ layout (location = 1) in vec2 a_size;
85
+ layout (location = 2) in vec4 a_color;
86
+ layout (location = 3) in vec2 a_unitquad;
87
+
88
+ uniform mat4 u_projection;
89
+
90
+ out vec4 v_color;
91
+
92
+ void main() {
93
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
94
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
95
+ v_color = a_color;
96
+ }`,`#version 300 es
97
+ precision lowp float;
98
+
99
+ in vec4 v_color;
100
+
101
+ out vec4 outColor;
102
+
103
+ void main() {
104
+ outColor = v_color;
105
+ }`)),this.register((0,g.toDisposable)(()=>k.deleteProgram(this._program))),this._projectionLocation=(0,d.throwIfFalsy)(k.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=k.createVertexArray(),k.bindVertexArray(this._vertexArrayObject);const B=new Float32Array([0,0,1,0,0,1,1,1]),O=k.createBuffer();this.register((0,g.toDisposable)(()=>k.deleteBuffer(O))),k.bindBuffer(k.ARRAY_BUFFER,O),k.bufferData(k.ARRAY_BUFFER,B,k.STATIC_DRAW),k.enableVertexAttribArray(3),k.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const F=new Uint8Array([0,1,2,3]),N=k.createBuffer();this.register((0,g.toDisposable)(()=>k.deleteBuffer(N))),k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,N),k.bufferData(k.ELEMENT_ARRAY_BUFFER,F,k.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(k.createBuffer()),this.register((0,g.toDisposable)(()=>k.deleteBuffer(this._attributesBuffer))),k.bindBuffer(k.ARRAY_BUFFER,this._attributesBuffer),k.enableVertexAttribArray(0),k.vertexAttribPointer(0,2,k.FLOAT,!1,w,0),k.vertexAttribDivisor(0,1),k.enableVertexAttribArray(1),k.vertexAttribPointer(1,2,k.FLOAT,!1,w,2*Float32Array.BYTES_PER_ELEMENT),k.vertexAttribDivisor(1,1),k.enableVertexAttribArray(2),k.vertexAttribPointer(2,4,k.FLOAT,!1,w,4*Float32Array.BYTES_PER_ELEMENT),k.vertexAttribDivisor(2,1),this._updateCachedColors(R.colors),this.register(this._themeService.onChangeColors(H=>{this._updateCachedColors(H),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(p){const x=this._gl;x.useProgram(this._program),x.bindVertexArray(this._vertexArrayObject),x.uniformMatrix4fv(this._projectionLocation,!1,v.PROJECTION_MATRIX),x.bindBuffer(x.ARRAY_BUFFER,this._attributesBuffer),x.bufferData(x.ARRAY_BUFFER,p.attributes,x.DYNAMIC_DRAW),x.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,x.UNSIGNED_BYTE,0,p.count)}handleResize(){this._updateViewportRectangle()}setDimensions(p){this._dimensions=p}_updateCachedColors(p){this._bgFloat=this._colorToFloat32Array(p.background),this._cursorFloat=this._colorToFloat32Array(p.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(p){const x=this._terminal,D=this._vertices;let R,k,B,O,F,N,H,L,T,P,I,z=1;for(R=0;R<x.rows;R++){for(B=-1,O=0,F=0,N=!1,k=0;k<x.cols;k++)H=(R*x.cols+k)*u.RENDER_MODEL_INDICIES_PER_CELL,L=p.cells[H+u.RENDER_MODEL_BG_OFFSET],T=p.cells[H+u.RENDER_MODEL_FG_OFFSET],P=!!(67108864&T),(L!==O||T!==F&&(N||P))&&((O!==0||N&&F!==0)&&(I=8*z++,this._updateRectangle(D,I,F,O,B,k,R)),B=k,O=L,F=T,N=P);(O!==0||N&&F!==0)&&(I=8*z++,this._updateRectangle(D,I,F,O,B,x.cols,R))}D.count=z}updateCursor(p){const x=this._verticesCursor,D=p.cursor;if(!D||D.style==="block")return void(x.count=0);let R,k=0;D.style!=="bar"&&D.style!=="outline"||(R=8*k++,this._addRectangleFloat(x.attributes,R,D.x*this._dimensions.device.cell.width,D.y*this._dimensions.device.cell.height,D.style==="bar"?D.dpr*D.cursorWidth:D.dpr,this._dimensions.device.cell.height,this._cursorFloat)),D.style!=="underline"&&D.style!=="outline"||(R=8*k++,this._addRectangleFloat(x.attributes,R,D.x*this._dimensions.device.cell.width,(D.y+1)*this._dimensions.device.cell.height-D.dpr,D.width*this._dimensions.device.cell.width,D.dpr,this._cursorFloat)),D.style==="outline"&&(R=8*k++,this._addRectangleFloat(x.attributes,R,D.x*this._dimensions.device.cell.width,D.y*this._dimensions.device.cell.height,D.width*this._dimensions.device.cell.width,D.dpr,this._cursorFloat),R=8*k++,this._addRectangleFloat(x.attributes,R,(D.x+D.width)*this._dimensions.device.cell.width-D.dpr,D.y*this._dimensions.device.cell.height,D.dpr,this._dimensions.device.cell.height,this._cursorFloat)),x.count=k}_updateRectangle(p,x,D,R,k,B,O){if(67108864&D)switch(50331648&D){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&D].rgba;break;case 50331648:f=(16777215&D)<<8;break;default:f=this._themeService.colors.foreground.rgba}else switch(50331648&R){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&R].rgba;break;case 50331648:f=(16777215&R)<<8;break;default:f=this._themeService.colors.background.rgba}p.attributes.length<x+4&&(p.attributes=(0,v.expandFloat32Array)(p.attributes,this._terminal.rows*this._terminal.cols*8)),n=k*this._dimensions.device.cell.width,o=O*this._dimensions.device.cell.height,l=(f>>24&255)/255,c=(f>>16&255)/255,m=(f>>8&255)/255,y=1,this._addRectangle(p.attributes,x,n,o,(B-k)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,l,c,m,y)}_addRectangle(p,x,D,R,k,B,O,F,N,H){p[x]=D/this._dimensions.device.canvas.width,p[x+1]=R/this._dimensions.device.canvas.height,p[x+2]=k/this._dimensions.device.canvas.width,p[x+3]=B/this._dimensions.device.canvas.height,p[x+4]=O,p[x+5]=F,p[x+6]=N,p[x+7]=H}_addRectangleFloat(p,x,D,R,k,B,O){p[x]=D/this._dimensions.device.canvas.width,p[x+1]=R/this._dimensions.device.canvas.height,p[x+2]=k/this._dimensions.device.canvas.width,p[x+3]=B/this._dimensions.device.canvas.height,p[x+4]=O[0],p[x+5]=O[1],p[x+6]=O[2],p[x+7]=O[3]}_colorToFloat32Array(p){return new Float32Array([(p.rgba>>24&255)/255,(p.rgba>>16&255)/255,(p.rgba>>8&255)/255,(255&p.rgba)/255])}}s.RectangleRenderer=b},310:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderModel=s.COMBINED_CHAR_BIT_MASK=s.RENDER_MODEL_EXT_OFFSET=s.RENDER_MODEL_FG_OFFSET=s.RENDER_MODEL_BG_OFFSET=s.RENDER_MODEL_INDICIES_PER_CELL=void 0;const d=a(296);s.RENDER_MODEL_INDICIES_PER_CELL=4,s.RENDER_MODEL_BG_OFFSET=1,s.RENDER_MODEL_FG_OFFSET=2,s.RENDER_MODEL_EXT_OFFSET=3,s.COMBINED_CHAR_BIT_MASK=2147483648,s.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,d.createSelectionRenderModel)()}resize(g,u){const v=g*u*s.RENDER_MODEL_INDICIES_PER_CELL;v!==this.cells.length&&(this.cells=new Uint32Array(v),this.lineLengths=new Uint32Array(u))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:function(C,s,a){var d=this&&this.__decorate||function(B,O,F,N){var H,L=arguments.length,T=L<3?O:N===null?N=Object.getOwnPropertyDescriptor(O,F):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(B,O,F,N);else for(var P=B.length-1;P>=0;P--)(H=B[P])&&(T=(L<3?H(T):L>3?H(O,F,T):H(O,F))||T);return L>3&&T&&Object.defineProperty(O,F,T),T};Object.defineProperty(s,"__esModule",{value:!0}),s.JoinedCellData=s.WebglRenderer=void 0;const g=a(820),u=a(274),v=a(627),w=a(457),S=a(56),f=a(374),n=a(345),o=a(859),l=a(147),c=a(782),m=a(855),y=a(776),b=a(965),E=a(742),p=a(310),x=a(733);class D extends o.Disposable{constructor(O,F,N,H,L,T,P,I,z){super(),this._terminal=O,this._characterJoinerService=F,this._charSizeService=N,this._coreBrowserService=H,this._coreService=L,this._decorationService=T,this._optionsService=P,this._themeService=I,this._cursorBlinkStateManager=new o.MutableDisposable,this._charAtlasDisposable=this.register(new o.MutableDisposable),this._model=new p.RenderModel,this._workCell=new c.CellData,this._rectangleRenderer=this.register(new o.MutableDisposable),this._glyphRenderer=this.register(new o.MutableDisposable),this._onChangeTextureAtlas=this.register(new n.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new n.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new n.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new n.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new n.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new u.CellColorResolver(this._terminal,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new x.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier2,this._coreBrowserService,P,this._themeService)],this.dimensions=(0,f.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(P.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=document.createElement("canvas");const V={antialias:!1,depth:!1,preserveDrawingBuffer:z};if(this._gl=this._canvas.getContext("webgl2",V),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextlost",G=>{console.log("webglcontextlost event received"),G.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(G)},3e3)})),this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextrestored",G=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,v.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this.register((0,S.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(G,K)=>this._setCanvasDevicePixelDimensions(G,K))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,o.toDisposable)(()=>{var G;for(const K of this._renderLayers)K.dispose();(G=this._canvas.parentElement)===null||G===void 0||G.removeChild(this._canvas),(0,v.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){var O;return(O=this._charAtlas)===null||O===void 0?void 0:O.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(O,F){var N,H,L,T;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const P of this._renderLayers)P.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(N=this._rectangleRenderer.value)===null||N===void 0||N.setDimensions(this.dimensions),(H=this._rectangleRenderer.value)===null||H===void 0||H.handleResize(),(L=this._glyphRenderer.value)===null||L===void 0||L.setDimensions(this.dimensions),(T=this._glyphRenderer.value)===null||T===void 0||T.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var O;for(const F of this._renderLayers)F.handleBlur(this._terminal);(O=this._cursorBlinkStateManager.value)===null||O===void 0||O.pause(),this._requestRedrawViewport()}handleFocus(){var O;for(const F of this._renderLayers)F.handleFocus(this._terminal);(O=this._cursorBlinkStateManager.value)===null||O===void 0||O.resume(),this._requestRedrawViewport()}handleSelectionChanged(O,F,N){for(const H of this._renderLayers)H.handleSelectionChanged(this._terminal,O,F,N);this._model.selection.update(this._terminal,O,F,N),this._requestRedrawViewport()}handleCursorMove(){var O;for(const F of this._renderLayers)F.handleCursorMove(this._terminal);(O=this._cursorBlinkStateManager.value)===null||O===void 0||O.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new E.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new b.GlyphRenderer(this._terminal,this._gl,this.dimensions),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var O;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const F=(0,v.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==F&&(this._onChangeTextureAtlas.fire(F.pages[0].canvas),this._charAtlasDisposable.value=(0,o.getDisposeArrayDisposable)([(0,n.forwardEvent)(F.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,n.forwardEvent)(F.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=F,this._charAtlas.warmUp(),(O=this._glyphRenderer.value)===null||O===void 0||O.setAtlas(this._charAtlas)}_clearModel(O){var F;this._model.clear(),O&&((F=this._glyphRenderer.value)===null||F===void 0||F.clear())}clearTextureAtlas(){var O;(O=this._charAtlas)===null||O===void 0||O.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var O;this._clearModel(!0);for(const F of this._renderLayers)F.reset(this._terminal);(O=this._cursorBlinkStateManager.value)===null||O===void 0||O.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(O){return-1}deregisterCharacterJoiner(O){return!1}renderRows(O,F){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const N of this._renderLayers)N.handleGridChanged(this._terminal,O,F);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(O,F),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new w.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(O,F){const N=this._core;let H,L,T,P,I,z,V,G,K,Z,A,j,W,U=this._workCell;O=k(O,N.rows-1,0),F=k(F,N.rows-1,0);const Q=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,X=Math.min(this._terminal.buffer.active.cursorX,N.cols-1);let ie=-1;const fe=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let _e=!1;for(L=O;L<=F;L++)for(T=L+N.buffer.ydisp,P=N.buffer.lines.get(T),this._model.lineLengths[L]=0,I=this._characterJoinerService.getJoinedCharacters(T),j=0;j<N.cols;j++)if(H=this._cellColorResolver.result.bg,P.loadCell(j,U),j===0&&(H=this._cellColorResolver.result.bg),z=!1,V=j,I.length>0&&j===I[0][0]&&(z=!0,G=I.shift(),U=new R(U,P.translateToString(!0,G[0],G[1]),G[1]-G[0]),V=G[1]-1),K=U.getChars(),Z=U.getCode(),A=(L*N.cols+j)*p.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(U,j,T),fe&&T===Q&&(j===X&&(this._model.cursor={x:X,y:this._terminal.buffer.active.cursorY,width:U.getWidth(),style:this._coreBrowserService.isFocused?N.options.cursorStyle||"block":N.options.cursorInactiveStyle,cursorWidth:N.options.cursorWidth,dpr:this._devicePixelRatio},ie=X+U.getWidth()-1),j>=X&&j<=ie&&(this._coreBrowserService.isFocused&&(N.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&N.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),Z!==m.NULL_CELL_CODE&&(this._model.lineLengths[L]=j+1),(this._model.cells[A]!==Z||this._model.cells[A+p.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[A+p.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[A+p.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(_e=!0,K.length>1&&(Z|=p.COMBINED_CHAR_BIT_MASK),this._model.cells[A]=Z,this._model.cells[A+p.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[A+p.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[A+p.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,this._glyphRenderer.value.updateCell(j,L,Z,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,K,H),z))for(U=this._workCell,j++;j<V;j++)W=(L*N.cols+j)*p.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(j,L,m.NULL_CELL_CODE,0,0,0,m.NULL_CELL_CHAR,0),this._model.cells[W]=m.NULL_CELL_CODE,this._model.cells[W+p.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[W+p.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[W+p.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;_e&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(O,F){this._canvas.width===O&&this._canvas.height===F||(this._canvas.width=O,this._canvas.height=F,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const O=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:O,end:O})}}s.WebglRenderer=D,d([y.traceCall],D.prototype,"renderRows",null);class R extends l.AttributeData{constructor(O,F,N){super(),this.content=0,this.combinedData="",this.fg=O.fg,this.bg=O.bg,this.combinedData=F,this._width=N}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(O){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function k(B,O,F=0){return Math.max(Math.min(B,O),F)}s.JoinedCellData=R},381:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GLTexture=s.expandFloat32Array=s.createShader=s.createProgram=s.PROJECTION_MATRIX=void 0;const d=a(374);function g(u,v,w){const S=(0,d.throwIfFalsy)(u.createShader(v));if(u.shaderSource(S,w),u.compileShader(S),u.getShaderParameter(S,u.COMPILE_STATUS))return S;console.error(u.getShaderInfoLog(S)),u.deleteShader(S)}s.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),s.createProgram=function(u,v,w){const S=(0,d.throwIfFalsy)(u.createProgram());if(u.attachShader(S,(0,d.throwIfFalsy)(g(u,u.VERTEX_SHADER,v))),u.attachShader(S,(0,d.throwIfFalsy)(g(u,u.FRAGMENT_SHADER,w))),u.linkProgram(S),u.getProgramParameter(S,u.LINK_STATUS))return S;console.error(u.getProgramInfoLog(S)),u.deleteProgram(S)},s.createShader=g,s.expandFloat32Array=function(u,v){const w=Math.min(2*u.length,v),S=new Float32Array(w);for(let f=0;f<u.length;f++)S[f]=u[f];return S},s.GLTexture=class{constructor(u){this.texture=u,this.version=-1}}},592:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BaseRenderLayer=void 0;const d=a(627),g=a(237),u=a(374),v=a(859);class w extends v.Disposable{constructor(f,n,o,l,c,m,y,b){super(),this._container=n,this._alpha=c,this._coreBrowserService=m,this._optionsService=y,this._themeService=b,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add(`xterm-${o}-layer`),this._canvas.style.zIndex=l.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(E=>{this._refreshCharAtlas(f,E),this.reset(f)})),this.register((0,v.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,u.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(f){}handleFocus(f){}handleCursorMove(f){}handleGridChanged(f,n,o){}handleSelectionChanged(f,n,o,l=!1){}_setTransparency(f,n){if(n===this._alpha)return;const o=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,o),this._refreshCharAtlas(f,this._themeService.colors),this.handleGridChanged(f,0,f.rows-1)}_refreshCharAtlas(f,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,d.acquireTextureAtlas)(f,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(f,n){this._deviceCellWidth=n.device.cell.width,this._deviceCellHeight=n.device.cell.height,this._deviceCharWidth=n.device.char.width,this._deviceCharHeight=n.device.char.height,this._deviceCharLeft=n.device.char.left,this._deviceCharTop=n.device.char.top,this._canvas.width=n.device.canvas.width,this._canvas.height=n.device.canvas.height,this._canvas.style.width=`${n.css.canvas.width}px`,this._canvas.style.height=`${n.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(f,this._themeService.colors)}_fillBottomLineAtCells(f,n,o=1){this._ctx.fillRect(f*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,o*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(f,n,o,l){this._alpha?this._ctx.clearRect(f*this._deviceCellWidth,n*this._deviceCellHeight,o*this._deviceCellWidth,l*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(f*this._deviceCellWidth,n*this._deviceCellHeight,o*this._deviceCellWidth,l*this._deviceCellHeight))}_fillCharTrueColor(f,n,o,l){this._ctx.font=this._getFont(f,!1,!1),this._ctx.textBaseline=g.TEXT_BASELINE,this._clipCell(o,l,n.getWidth()),this._ctx.fillText(n.getChars(),o*this._deviceCellWidth+this._deviceCharLeft,l*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(f,n,o){this._ctx.beginPath(),this._ctx.rect(f*this._deviceCellWidth,n*this._deviceCellHeight,o*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(f,n,o){return`${o?"italic":""} ${n?f.options.fontWeightBold:f.options.fontWeight} ${f.options.fontSize*this._coreBrowserService.dpr}px ${f.options.fontFamily}`}}s.BaseRenderLayer=w},733:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkRenderLayer=void 0;const d=a(197),g=a(237),u=a(592);class v extends u.BaseRenderLayer{constructor(S,f,n,o,l,c,m){super(n,S,"link",f,!0,l,c,m),this.register(o.onShowLinkUnderline(y=>this._handleShowLinkUnderline(y))),this.register(o.onHideLinkUnderline(y=>this._handleHideLinkUnderline(y)))}resize(S,f){super.resize(S,f),this._state=void 0}reset(S){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const S=this._state.y2-this._state.y1-1;S>0&&this._clearCells(0,this._state.y1+1,this._state.cols,S),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(S){if(S.fg===g.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:S.fg!==void 0&&(0,d.is256Color)(S.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[S.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,S.y1===S.y2)this._fillBottomLineAtCells(S.x1,S.y1,S.x2-S.x1);else{this._fillBottomLineAtCells(S.x1,S.y1,S.cols-S.x1);for(let f=S.y1+1;f<S.y2;f++)this._fillBottomLineAtCells(0,f,S.cols);this._fillBottomLineAtCells(0,S.y2,S.x2)}this._state=S}_handleHideLinkUnderline(S){this._clearCurrentLink()}}s.LinkRenderLayer=v},820:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(a,d,g,u){a.addEventListener(d,g,u);let v=!1;return{dispose:()=>{v||(v=!0,a.removeEventListener(d,g,u))}}}},274:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellColorResolver=void 0;let a,d=0,g=0,u=!1,v=!1,w=!1;s.CellColorResolver=class{constructor(S,f,n,o,l){this._terminal=S,this._selectionRenderModel=f,this._decorationService=n,this._coreBrowserService=o,this._themeService=l,this.result={fg:0,bg:0,ext:0}}resolve(S,f,n){this.result.bg=S.bg,this.result.fg=S.fg,this.result.ext=268435456&S.bg?S.extended.ext:0,g=0,d=0,v=!1,u=!1,w=!1,a=this._themeService.colors,this._decorationService.forEachDecorationAtCell(f,n,"bottom",o=>{o.backgroundColorRGB&&(g=o.backgroundColorRGB.rgba>>8&16777215,v=!0),o.foregroundColorRGB&&(d=o.foregroundColorRGB.rgba>>8&16777215,u=!0)}),w=this._selectionRenderModel.isCellSelected(this._terminal,f,n),w&&(g=(this._coreBrowserService.isFocused?a.selectionBackgroundOpaque:a.selectionInactiveBackgroundOpaque).rgba>>8&16777215,v=!0,a.selectionForeground&&(d=a.selectionForeground.rgba>>8&16777215,u=!0)),this._decorationService.forEachDecorationAtCell(f,n,"top",o=>{o.backgroundColorRGB&&(g=o.backgroundColorRGB.rgba>>8&16777215,v=!0),o.foregroundColorRGB&&(d=o.foregroundColorRGB.rgba>>8&16777215,u=!0)}),v&&(g=w?-16777216&S.bg&-134217729|g|50331648:-16777216&S.bg|g|50331648),u&&(d=-16777216&S.fg&-67108865|d|50331648),67108864&this.result.fg&&(v&&!u&&(d=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&a.background.rgba>>8|50331648,u=!0),!v&&u&&(g=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&a.foreground.rgba>>8|50331648,v=!0)),a=void 0,this.result.bg=v?g:this.result.bg,this.result.fg=u?d:this.result.fg}}},627:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.removeTerminalFromCache=s.acquireTextureAtlas=void 0;const d=a(509),g=a(197),u=[];s.acquireTextureAtlas=function(v,w,S,f,n,o,l,c){const m=(0,g.generateConfig)(f,n,o,l,w,S,c);for(let E=0;E<u.length;E++){const p=u[E],x=p.ownedBy.indexOf(v);if(x>=0){if((0,g.configEquals)(p.config,m))return p.atlas;p.ownedBy.length===1?(p.atlas.dispose(),u.splice(E,1)):p.ownedBy.splice(x,1);break}}for(let E=0;E<u.length;E++){const p=u[E];if((0,g.configEquals)(p.config,m))return p.ownedBy.push(v),p.atlas}const y=v._core,b={atlas:new d.TextureAtlas(document,m,y.unicodeService),config:m,ownedBy:[v]};return u.push(b),b.atlas},s.removeTerminalFromCache=function(v){for(let w=0;w<u.length;w++){const S=u[w].ownedBy.indexOf(v);if(S!==-1){u[w].ownedBy.length===1?(u[w].atlas.dispose(),u.splice(w,1)):u[w].ownedBy.splice(S,1);break}}}},197:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.is256Color=s.configEquals=s.generateConfig=void 0;const d=a(160);s.generateConfig=function(g,u,v,w,S,f,n){const o={foreground:f.foreground,background:f.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:f.ansi.slice(),contrastCache:f.contrastCache,halfContrastCache:f.halfContrastCache};return{customGlyphs:S.customGlyphs,devicePixelRatio:n,letterSpacing:S.letterSpacing,lineHeight:S.lineHeight,deviceCellWidth:g,deviceCellHeight:u,deviceCharWidth:v,deviceCharHeight:w,fontFamily:S.fontFamily,fontSize:S.fontSize,fontWeight:S.fontWeight,fontWeightBold:S.fontWeightBold,allowTransparency:S.allowTransparency,drawBoldTextInBrightColors:S.drawBoldTextInBrightColors,minimumContrastRatio:S.minimumContrastRatio,colors:o}},s.configEquals=function(g,u){for(let v=0;v<g.colors.ansi.length;v++)if(g.colors.ansi[v].rgba!==u.colors.ansi[v].rgba)return!1;return g.devicePixelRatio===u.devicePixelRatio&&g.customGlyphs===u.customGlyphs&&g.lineHeight===u.lineHeight&&g.letterSpacing===u.letterSpacing&&g.fontFamily===u.fontFamily&&g.fontSize===u.fontSize&&g.fontWeight===u.fontWeight&&g.fontWeightBold===u.fontWeightBold&&g.allowTransparency===u.allowTransparency&&g.deviceCharWidth===u.deviceCharWidth&&g.deviceCharHeight===u.deviceCharHeight&&g.drawBoldTextInBrightColors===u.drawBoldTextInBrightColors&&g.minimumContrastRatio===u.minimumContrastRatio&&g.colors.foreground.rgba===u.colors.foreground.rgba&&g.colors.background.rgba===u.colors.background.rgba},s.is256Color=function(g){return(50331648&g)==16777216||(50331648&g)==33554432}},237:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const d=a(399);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorBlinkStateManager=void 0,s.CursorBlinkStateManager=class{constructor(a,d){this._renderCallback=a,this._coreBrowserService=d,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(a=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},a)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tryDrawCustomChar=s.powerlineDefinitions=s.boxDrawingDefinitions=s.blockElementDefinitions=void 0;const d=a(374);s.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const g={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};s.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╒":{1:(f,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(f,n)=>`M${.5-f},1 L${.5-f},.5 L1,.5 M${.5+f},.5 L${.5+f},1`},"╔":{1:(f,n)=>`M1,${.5-n} L${.5-f},${.5-n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1`},"╕":{1:(f,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(f,n)=>`M${.5+f},1 L${.5+f},.5 L0,.5 M${.5-f},.5 L${.5-f},1`},"╗":{1:(f,n)=>`M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M0,${.5-n} L${.5+f},${.5-n} L${.5+f},1`},"╘":{1:(f,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(f,n)=>`M1,.5 L${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╚":{1:(f,n)=>`M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0 M1,${.5+n} L${.5-f},${.5+n} L${.5-f},0`},"╛":{1:(f,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(f,n)=>`M0,.5 L${.5+f},.5 L${.5+f},0 M${.5-f},.5 L${.5-f},0`},"╝":{1:(f,n)=>`M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M0,${.5+n} L${.5+f},${.5+n} L${.5+f},0`},"╞":{1:(f,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1 M${.5+f},.5 L1,.5`},"╠":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0`},"╡":{1:(f,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(f,n)=>`M0,.5 L${.5-f},.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╣":{1:(f,n)=>`M${.5+f},0 L${.5+f},1 M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0`},"╤":{1:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},1 M${.5+f},.5 L${.5+f},1`},"╦":{1:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1`},"╧":{1:(f,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╩":{1:(f,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0`},"╪":{1:(f,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╬":{1:(f,n)=>`M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1 M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(f,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(f,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(f,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(f,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,1,.5`}},s.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.tryDrawCustomChar=function(f,n,o,l,c,m,y,b){const E=s.blockElementDefinitions[n];if(E)return function(R,k,B,O,F,N){for(let H=0;H<k.length;H++){const L=k[H],T=F/8,P=N/8;R.fillRect(B+L.x*T,O+L.y*P,L.w*T,L.h*P)}}(f,E,o,l,c,m),!0;const p=g[n];if(p)return function(R,k,B,O,F,N){let H=u.get(k);H||(H=new Map,u.set(k,H));const L=R.fillStyle;if(typeof L!="string")throw new Error(`Unexpected fillStyle type "${L}"`);let T=H.get(L);if(!T){const P=k[0].length,I=k.length,z=document.createElement("canvas");z.width=P,z.height=I;const V=(0,d.throwIfFalsy)(z.getContext("2d")),G=new ImageData(P,I);let K,Z,A,j;if(L.startsWith("#"))K=parseInt(L.slice(1,3),16),Z=parseInt(L.slice(3,5),16),A=parseInt(L.slice(5,7),16),j=L.length>7&&parseInt(L.slice(7,9),16)||1;else{if(!L.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${L}" when drawing pattern glyph`);[K,Z,A,j]=L.substring(5,L.length-1).split(",").map(W=>parseFloat(W))}for(let W=0;W<I;W++)for(let U=0;U<P;U++)G.data[4*(W*P+U)]=K,G.data[4*(W*P+U)+1]=Z,G.data[4*(W*P+U)+2]=A,G.data[4*(W*P+U)+3]=k[W][U]*(255*j);V.putImageData(G,0,0),T=(0,d.throwIfFalsy)(R.createPattern(z,null)),H.set(L,T)}R.fillStyle=T,R.fillRect(B,O,F,N)}(f,p,o,l,c,m),!0;const x=s.boxDrawingDefinitions[n];if(x)return function(R,k,B,O,F,N,H){R.strokeStyle=R.fillStyle;for(const[L,T]of Object.entries(k)){let P;R.beginPath(),R.lineWidth=H*Number.parseInt(L),P=typeof T=="function"?T(.15,.15/N*F):T;for(const I of P.split(" ")){const z=I[0],V=w[z];if(!V){console.error(`Could not find drawing instructions for "${z}"`);continue}const G=I.substring(1).split(",");G[0]&&G[1]&&V(R,S(G,F,N,B,O,!0,H))}R.stroke(),R.closePath()}}(f,x,o,l,c,m,b),!0;const D=s.powerlineDefinitions[n];return!!D&&(function(R,k,B,O,F,N,H,L){var T,P;const I=new Path2D;I.rect(B,O,F,N),R.clip(I),R.beginPath();const z=H/12;R.lineWidth=L*z;for(const V of k.d.split(" ")){const G=V[0],K=w[G];if(!K){console.error(`Could not find drawing instructions for "${G}"`);continue}const Z=V.substring(1).split(",");Z[0]&&Z[1]&&K(R,S(Z,F,N,B,O,!1,L,((T=k.leftPadding)!==null&&T!==void 0?T:0)*(z/2),((P=k.rightPadding)!==null&&P!==void 0?P:0)*(z/2)))}k.type===1?(R.strokeStyle=R.fillStyle,R.stroke()):R.fill(),R.closePath()}(f,D,o,l,c,m,y,b),!0)};const u=new Map;function v(f,n,o=0){return Math.max(Math.min(f,n),o)}const w={C:(f,n)=>f.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(f,n)=>f.lineTo(n[0],n[1]),M:(f,n)=>f.moveTo(n[0],n[1])};function S(f,n,o,l,c,m,y,b=0,E=0){const p=f.map(x=>parseFloat(x)||parseInt(x));if(p.length<2)throw new Error("Too few arguments for instruction");for(let x=0;x<p.length;x+=2)p[x]*=n-b*y-E*y,m&&p[x]!==0&&(p[x]=v(Math.round(p[x]+.5)-.5,n,0)),p[x]+=l+b*y;for(let x=1;x<p.length;x+=2)p[x]*=o,m&&p[x]!==0&&(p[x]=v(Math.round(p[x]+.5)-.5,o,0)),p[x]+=c;return p}},56:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.observeDevicePixelDimensions=void 0;const d=a(859);s.observeDevicePixelDimensions=function(g,u,v){let w=new u.ResizeObserver(S=>{const f=S.find(l=>l.target===g);if(!f)return;if(!("devicePixelContentBoxSize"in f))return w==null||w.disconnect(),void(w=void 0);const n=f.devicePixelContentBoxSize[0].inlineSize,o=f.devicePixelContentBoxSize[0].blockSize;n>0&&o>0&&v(n,o)});try{w.observe(g,{box:["device-pixel-content-box"]})}catch{w.disconnect(),w=void 0}return(0,d.toDisposable)(()=>w==null?void 0:w.disconnect())}},374:(C,s)=>{function a(d){return 57508<=d&&d<=57558}Object.defineProperty(s,"__esModule",{value:!0}),s.createRenderDimensions=s.excludeFromContrastRatioDemands=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},s.isPowerlineGlyph=a,s.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},s.excludeFromContrastRatioDemands=function(d){return a(d)||function(g){return 9472<=g&&g<=9631}(d)},s.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}}}}},296:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class a{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,u,v,w=!1){if(this.selectionStart=u,this.selectionEnd=v,!u||!v||u[0]===v[0]&&u[1]===v[1])return void this.clear();const S=u[1]-g.buffer.active.viewportY,f=v[1]-g.buffer.active.viewportY,n=Math.max(S,0),o=Math.min(f,g.rows-1);n>=g.rows||o<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=S,this.viewportEndRow=f,this.viewportCappedStartRow=n,this.viewportCappedEndRow=o,this.startCol=u[0],this.endCol=v[0])}isCellSelected(g,u,v){return!!this.hasSelection&&(v-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&v>=this.viewportCappedStartRow&&u<this.endCol&&v<=this.viewportCappedEndRow:u<this.startCol&&v>=this.viewportCappedStartRow&&u>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol)}}s.createSelectionRenderModel=function(){return new a}},509:function(C,s,a){var d=this&&this.__decorate||function(D,R,k,B){var O,F=arguments.length,N=F<3?R:B===null?B=Object.getOwnPropertyDescriptor(R,k):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(D,R,k,B);else for(var H=D.length-1;H>=0;H--)(O=D[H])&&(N=(F<3?O(N):F>3?O(R,k,N):O(R,k))||N);return F>3&&N&&Object.defineProperty(R,k,N),N};Object.defineProperty(s,"__esModule",{value:!0}),s.TextureAtlas=void 0;const g=a(237),u=a(860),v=a(374),w=a(160),S=a(345),f=a(485),n=a(385),o=a(147),l=a(855),c=a(776),m={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let y;class b{get pages(){return this._pages}constructor(R,k,B){this._document=R,this._config=k,this._unicodeService=B,this._didWarmUp=!1,this._cacheMap=new f.FourKeyMap,this._cacheMapCombined=new f.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new o.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new S.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new S.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=x(R,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,v.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const R of this.pages)R.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const R=new n.IdleTaskQueue;for(let k=33;k<126;k++)R.enqueue(()=>{if(!this._cacheMap.get(k,l.DEFAULT_COLOR,l.DEFAULT_COLOR,l.DEFAULT_EXT)){const B=this._drawToCache(k,l.DEFAULT_COLOR,l.DEFAULT_COLOR,l.DEFAULT_EXT);this._cacheMap.set(k,l.DEFAULT_COLOR,l.DEFAULT_COLOR,l.DEFAULT_EXT,B)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const R of this._pages)R.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(b.maxAtlasPages&&this._pages.length>=Math.max(4,b.maxAtlasPages)){const k=this._pages.filter(T=>2*T.canvas.width<=(b.maxTextureSize||4096)).sort((T,P)=>P.canvas.width!==T.canvas.width?P.canvas.width-T.canvas.width:P.percentageUsed-T.percentageUsed);let B=-1,O=0;for(let T=0;T<k.length;T++)if(k[T].canvas.width!==O)B=T,O=k[T].canvas.width;else if(T-B==3)break;const F=k.slice(B,B+4),N=F.map(T=>T.glyphs[0].texturePage).sort((T,P)=>T>P?1:-1),H=this.pages.length-F.length,L=this._mergePages(F,H);L.version++;for(let T=N.length-1;T>=0;T--)this._deletePage(N[T]);this.pages.push(L),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(L.canvas)}const R=new E(this._document,this._textureSize);return this._pages.push(R),this._activePages.push(R),this._onAddTextureAtlasCanvas.fire(R.canvas),R}_mergePages(R,k){const B=2*R[0].canvas.width,O=new E(this._document,B,R);for(const[F,N]of R.entries()){const H=F*N.canvas.width%B,L=Math.floor(F/2)*N.canvas.height;O.ctx.drawImage(N.canvas,H,L);for(const P of N.glyphs)P.texturePage=k,P.sizeClipSpace.x=P.size.x/B,P.sizeClipSpace.y=P.size.y/B,P.texturePosition.x+=H,P.texturePosition.y+=L,P.texturePositionClipSpace.x=P.texturePosition.x/B,P.texturePositionClipSpace.y=P.texturePosition.y/B;this._onRemoveTextureAtlasCanvas.fire(N.canvas);const T=this._activePages.indexOf(N);T!==-1&&this._activePages.splice(T,1)}return O}_deletePage(R){this._pages.splice(R,1);for(let k=R;k<this._pages.length;k++){const B=this._pages[k];for(const O of B.glyphs)O.texturePage--;B.version++}}getRasterizedGlyphCombinedChar(R,k,B,O,F){return this._getFromCacheMap(this._cacheMapCombined,R,k,B,O,F)}getRasterizedGlyph(R,k,B,O,F){return this._getFromCacheMap(this._cacheMap,R,k,B,O,F)}_getFromCacheMap(R,k,B,O,F,N=!1){return y=R.get(k,B,O,F),y||(y=this._drawToCache(k,B,O,F,N),R.set(k,B,O,F,y)),y}_getColorFromAnsiIndex(R){if(R>=this._config.colors.ansi.length)throw new Error("No color found for idx "+R);return this._config.colors.ansi[R]}_getBackgroundColor(R,k,B,O){if(this._config.allowTransparency)return w.NULL_COLOR;let F;switch(R){case 16777216:case 33554432:F=this._getColorFromAnsiIndex(k);break;case 50331648:const N=o.AttributeData.toColorRGB(k);F=w.rgba.toColor(N[0],N[1],N[2]);break;default:F=B?w.color.opaque(this._config.colors.foreground):this._config.colors.background}return F}_getForegroundColor(R,k,B,O,F,N,H,L,T,P){const I=this._getMinimumContrastColor(R,k,B,O,F,N,!1,T,L,P);if(I)return I;let z;switch(F){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&T&&N<8&&(N+=8),z=this._getColorFromAnsiIndex(N);break;case 50331648:const V=o.AttributeData.toColorRGB(N);z=w.rgba.toColor(V[0],V[1],V[2]);break;default:z=H?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(z=w.color.opaque(z)),L&&(z=w.color.multiplyOpacity(z,g.DIM_OPACITY)),z}_resolveBackgroundRgba(R,k,B){switch(R){case 16777216:case 33554432:return this._getColorFromAnsiIndex(k).rgba;case 50331648:return k<<8;default:return B?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(R,k,B,O){switch(R){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&O&&k<8&&(k+=8),this._getColorFromAnsiIndex(k).rgba;case 50331648:return k<<8;default:return B?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(R,k,B,O,F,N,H,L,T,P){if(this._config.minimumContrastRatio===1||P)return;const I=this._getContrastCache(T),z=I.getColor(R,O);if(z!==void 0)return z||void 0;const V=this._resolveBackgroundRgba(k,B,H),G=this._resolveForegroundRgba(F,N,H,L),K=w.rgba.ensureContrastRatio(V,G,this._config.minimumContrastRatio/(T?2:1));if(!K)return void I.setColor(R,O,null);const Z=w.rgba.toColor(K>>24&255,K>>16&255,K>>8&255);return I.setColor(R,O,Z),Z}_getContrastCache(R){return R?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(R,k,B,O,F=!1){const N=typeof R=="number"?String.fromCharCode(R):R,H=Math.min(this._config.deviceCellWidth*Math.max(N.length,2)+4,this._textureSize);this._tmpCanvas.width<H&&(this._tmpCanvas.width=H);const L=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<L&&(this._tmpCanvas.height=L),this._tmpCtx.save(),this._workAttributeData.fg=B,this._workAttributeData.bg=k,this._workAttributeData.extended.ext=O,this._workAttributeData.isInvisible())return m;const T=!!this._workAttributeData.isBold(),P=!!this._workAttributeData.isInverse(),I=!!this._workAttributeData.isDim(),z=!!this._workAttributeData.isItalic(),V=!!this._workAttributeData.isUnderline(),G=!!this._workAttributeData.isStrikethrough(),K=!!this._workAttributeData.isOverline();let Z=this._workAttributeData.getFgColor(),A=this._workAttributeData.getFgColorMode(),j=this._workAttributeData.getBgColor(),W=this._workAttributeData.getBgColorMode();if(P){const te=Z;Z=j,j=te;const ue=A;A=W,W=ue}const U=this._getBackgroundColor(W,j,P,I);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=U.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const Q=T?this._config.fontWeightBold:this._config.fontWeight,X=z?"italic":"";this._tmpCtx.font=`${X} ${Q} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=g.TEXT_BASELINE;const ie=N.length===1&&(0,v.isPowerlineGlyph)(N.charCodeAt(0)),fe=N.length===1&&(0,v.isRestrictedPowerlineGlyph)(N.charCodeAt(0)),_e=this._getForegroundColor(k,W,j,B,A,Z,P,I,T,(0,v.excludeFromContrastRatioDemands)(N.charCodeAt(0)));this._tmpCtx.fillStyle=_e.css;const ce=fe?0:4;let se=!1;this._config.customGlyphs!==!1&&(se=(0,u.tryDrawCustomChar)(this._tmpCtx,N,ce,ce,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let Qe,Oe=!ie;if(Qe=typeof R=="number"?this._unicodeService.wcwidth(R):this._unicodeService.getStringCellWidth(R),V){this._tmpCtx.save();const te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ue=te%2==1?.5:0;if(this._tmpCtx.lineWidth=te,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())Oe=!1,this._tmpCtx.strokeStyle=`rgb(${o.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{Oe=!1;let De=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&De<8&&(De+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(De).css}this._tmpCtx.beginPath();const Ie=ce,ve=Math.ceil(ce+this._config.deviceCharHeight)-ue-(F?2*te:0),yt=ve+te,$e=ve+2*te;for(let De=0;De<Qe;De++){this._tmpCtx.save();const ne=Ie+De*this._config.deviceCellWidth,Je=Ie+(De+1)*this._config.deviceCellWidth,dr=ne+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ne,ve),this._tmpCtx.lineTo(Je,ve),this._tmpCtx.moveTo(ne,$e),this._tmpCtx.lineTo(Je,$e);break;case 3:const Rr=te<=1?$e:Math.ceil(ce+this._config.deviceCharHeight-te/2)-ue,Dr=te<=1?ve:Math.ceil(ce+this._config.deviceCharHeight+te/2)-ue,ss=new Path2D;ss.rect(ne,ve,this._config.deviceCellWidth,$e-ve),this._tmpCtx.clip(ss),this._tmpCtx.moveTo(ne-this._config.deviceCellWidth/2,yt),this._tmpCtx.bezierCurveTo(ne-this._config.deviceCellWidth/2,Dr,ne,Dr,ne,yt),this._tmpCtx.bezierCurveTo(ne,Rr,dr,Rr,dr,yt),this._tmpCtx.bezierCurveTo(dr,Dr,Je,Dr,Je,yt),this._tmpCtx.bezierCurveTo(Je,Rr,Je+this._config.deviceCellWidth/2,Rr,Je+this._config.deviceCellWidth/2,yt);break;case 4:this._tmpCtx.setLineDash([Math.round(te),Math.round(te)]),this._tmpCtx.moveTo(ne,ve),this._tmpCtx.lineTo(Je,ve);break;case 5:this._tmpCtx.setLineDash([4*this._config.devicePixelRatio,3*this._config.devicePixelRatio]),this._tmpCtx.moveTo(ne,ve),this._tmpCtx.lineTo(Je,ve);break;default:this._tmpCtx.moveTo(ne,ve),this._tmpCtx.lineTo(Je,ve)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!se&&this._config.fontSize>=12&&!this._config.allowTransparency&&N!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const De=this._tmpCtx.measureText(N);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in De&&De.actualBoundingBoxDescent>0){this._tmpCtx.save();const ne=new Path2D;ne.rect(Ie,ve-Math.ceil(te/2),this._config.deviceCellWidth*Qe,$e-ve+Math.ceil(te/2)),this._tmpCtx.clip(ne),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=U.css,this._tmpCtx.strokeText(N,ce,ce+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(K){const te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ue=te%2==1?.5:0;this._tmpCtx.lineWidth=te,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ce,ce+ue),this._tmpCtx.lineTo(ce+this._config.deviceCharWidth*Qe,ce+ue),this._tmpCtx.stroke()}if(se||this._tmpCtx.fillText(N,ce,ce+this._config.deviceCharHeight),N==="_"&&!this._config.allowTransparency){let te=p(this._tmpCtx.getImageData(ce,ce,this._config.deviceCellWidth,this._config.deviceCellHeight),U,_e,Oe);if(te)for(let ue=1;ue<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=U.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(N,ce,ce+this._config.deviceCharHeight-ue),te=p(this._tmpCtx.getImageData(ce,ce,this._config.deviceCellWidth,this._config.deviceCellHeight),U,_e,Oe),te);ue++);}if(G){const te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ue=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=te,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ce,ce+Math.floor(this._config.deviceCharHeight/2)-ue),this._tmpCtx.lineTo(ce+this._config.deviceCharWidth*Qe,ce+Math.floor(this._config.deviceCharHeight/2)-ue),this._tmpCtx.stroke()}this._tmpCtx.restore();const kt=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Pt;if(Pt=this._config.allowTransparency?function(te){for(let ue=0;ue<te.data.length;ue+=4)if(te.data[ue+3]>0)return!1;return!0}(kt):p(kt,U,_e,Oe),Pt)return m;const he=this._findGlyphBoundingBox(kt,this._workBoundingBox,H,fe,se,ce);let re,oe;for(;;){if(this._activePages.length===0){const te=this._createNewPage();re=te,oe=te.currentRow,oe.height=he.size.y;break}re=this._activePages[this._activePages.length-1],oe=re.currentRow;for(const te of this._activePages)he.size.y<=te.currentRow.height&&(re=te,oe=te.currentRow);for(let te=this._activePages.length-1;te>=0;te--)for(const ue of this._activePages[te].fixedRows)ue.height<=oe.height&&he.size.y<=ue.height&&(re=this._activePages[te],oe=ue);if(oe.y+he.size.y>=re.canvas.height||oe.height>he.size.y+2){let te=!1;if(re.currentRow.y+re.currentRow.height+he.size.y>=re.canvas.height){let ue;for(const Ie of this._activePages)if(Ie.currentRow.y+Ie.currentRow.height+he.size.y<Ie.canvas.height){ue=Ie;break}if(ue)re=ue;else if(b.maxAtlasPages&&this._pages.length>=b.maxAtlasPages&&oe.y+he.size.y<=re.canvas.height&&oe.height>=he.size.y&&oe.x+he.size.x<=re.canvas.width)te=!0;else{const Ie=this._createNewPage();re=Ie,oe=Ie.currentRow,oe.height=he.size.y,te=!0}}te||(re.currentRow.height>0&&re.fixedRows.push(re.currentRow),oe={x:0,y:re.currentRow.y+re.currentRow.height,height:he.size.y},re.fixedRows.push(oe),re.currentRow={x:0,y:oe.y+oe.height,height:0})}if(oe.x+he.size.x<=re.canvas.width)break;oe===re.currentRow?(oe.x=0,oe.y+=oe.height,oe.height=0):re.fixedRows.splice(re.fixedRows.indexOf(oe),1)}return he.texturePage=this._pages.indexOf(re),he.texturePosition.x=oe.x,he.texturePosition.y=oe.y,he.texturePositionClipSpace.x=oe.x/re.canvas.width,he.texturePositionClipSpace.y=oe.y/re.canvas.height,he.sizeClipSpace.x/=re.canvas.width,he.sizeClipSpace.y/=re.canvas.height,oe.height=Math.max(oe.height,he.size.y),oe.x+=he.size.x,re.ctx.putImageData(kt,he.texturePosition.x-this._workBoundingBox.left,he.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,he.size.x,he.size.y),re.addGlyph(he),re.version++,he}_findGlyphBoundingBox(R,k,B,O,F,N){k.top=0;const H=O?this._config.deviceCellHeight:this._tmpCanvas.height,L=O?this._config.deviceCellWidth:B;let T=!1;for(let P=0;P<H;P++){for(let I=0;I<L;I++){const z=P*this._tmpCanvas.width*4+4*I+3;if(R.data[z]!==0){k.top=P,T=!0;break}}if(T)break}k.left=0,T=!1;for(let P=0;P<N+L;P++){for(let I=0;I<H;I++){const z=I*this._tmpCanvas.width*4+4*P+3;if(R.data[z]!==0){k.left=P,T=!0;break}}if(T)break}k.right=L,T=!1;for(let P=N+L-1;P>=N;P--){for(let I=0;I<H;I++){const z=I*this._tmpCanvas.width*4+4*P+3;if(R.data[z]!==0){k.right=P,T=!0;break}}if(T)break}k.bottom=H,T=!1;for(let P=H-1;P>=0;P--){for(let I=0;I<L;I++){const z=P*this._tmpCanvas.width*4+4*I+3;if(R.data[z]!==0){k.bottom=P,T=!0;break}}if(T)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:k.right-k.left+1,y:k.bottom-k.top+1},sizeClipSpace:{x:k.right-k.left+1,y:k.bottom-k.top+1},offset:{x:-k.left+N+(O||F?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-k.top+N+(O||F?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}s.TextureAtlas=b,d([c.traceCall],b.prototype,"_drawToCache",null);class E{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(R){this._glyphs.push(R),this._usedPixels+=R.size.x*R.size.y}constructor(R,k,B){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],B)for(const O of B)this._glyphs.push(...O.glyphs),this._usedPixels+=O._usedPixels;this.canvas=x(R,k,k),this.ctx=(0,v.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function p(D,R,k,B){const O=R.rgba>>>24,F=R.rgba>>>16&255,N=R.rgba>>>8&255,H=k.rgba>>>24,L=k.rgba>>>16&255,T=k.rgba>>>8&255,P=Math.floor((Math.abs(O-H)+Math.abs(F-L)+Math.abs(N-T))/12);let I=!0;for(let z=0;z<D.data.length;z+=4)D.data[z]===O&&D.data[z+1]===F&&D.data[z+2]===N||B&&Math.abs(D.data[z]-O)+Math.abs(D.data[z+1]-F)+Math.abs(D.data[z+2]-N)<P?D.data[z+3]=0:I=!1;return I}function x(D,R,k){const B=D.createElement("canvas");return B.width=R,B.height=k,B}},160:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;const d=a(399);let g=0,u=0,v=0,w=0;var S,f,n,o,l;function c(y){const b=y.toString(16);return b.length<2?"0"+b:b}function m(y,b){return y<b?(b+.05)/(y+.05):(y+.05)/(b+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(y){y.toCss=function(b,E,p,x){return x!==void 0?`#${c(b)}${c(E)}${c(p)}${c(x)}`:`#${c(b)}${c(E)}${c(p)}`},y.toRgba=function(b,E,p,x=255){return(b<<24|E<<16|p<<8|x)>>>0}}(S||(s.channels=S={})),function(y){function b(E,p){return w=Math.round(255*p),[g,u,v]=l.toChannels(E.rgba),{css:S.toCss(g,u,v,w),rgba:S.toRgba(g,u,v,w)}}y.blend=function(E,p){if(w=(255&p.rgba)/255,w===1)return{css:p.css,rgba:p.rgba};const x=p.rgba>>24&255,D=p.rgba>>16&255,R=p.rgba>>8&255,k=E.rgba>>24&255,B=E.rgba>>16&255,O=E.rgba>>8&255;return g=k+Math.round((x-k)*w),u=B+Math.round((D-B)*w),v=O+Math.round((R-O)*w),{css:S.toCss(g,u,v),rgba:S.toRgba(g,u,v)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,p,x){const D=l.ensureContrastRatio(E.rgba,p.rgba,x);if(D)return l.toColor(D>>24&255,D>>16&255,D>>8&255)},y.opaque=function(E){const p=(255|E.rgba)>>>0;return[g,u,v]=l.toChannels(p),{css:S.toCss(g,u,v),rgba:p}},y.opacity=b,y.multiplyOpacity=function(E,p){return w=255&E.rgba,b(E,w*p/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}}(f||(s.color=f={})),function(y){let b,E;if(!d.isNode){const p=document.createElement("canvas");p.width=1,p.height=1;const x=p.getContext("2d",{willReadFrequently:!0});x&&(b=x,b.globalCompositeOperation="copy",E=b.createLinearGradient(0,0,1,1))}y.toColor=function(p){if(p.match(/#[\da-f]{3,8}/i))switch(p.length){case 4:return g=parseInt(p.slice(1,2).repeat(2),16),u=parseInt(p.slice(2,3).repeat(2),16),v=parseInt(p.slice(3,4).repeat(2),16),l.toColor(g,u,v);case 5:return g=parseInt(p.slice(1,2).repeat(2),16),u=parseInt(p.slice(2,3).repeat(2),16),v=parseInt(p.slice(3,4).repeat(2),16),w=parseInt(p.slice(4,5).repeat(2),16),l.toColor(g,u,v,w);case 7:return{css:p,rgba:(parseInt(p.slice(1),16)<<8|255)>>>0};case 9:return{css:p,rgba:parseInt(p.slice(1),16)>>>0}}const x=p.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(x)return g=parseInt(x[1]),u=parseInt(x[2]),v=parseInt(x[3]),w=Math.round(255*(x[5]===void 0?1:parseFloat(x[5]))),l.toColor(g,u,v,w);if(!b||!E)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=E,b.fillStyle=p,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[g,u,v,w]=b.getImageData(0,0,1,1).data,w!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(g,u,v,w),css:p}}}(n||(s.css=n={})),function(y){function b(E,p,x){const D=E/255,R=p/255,k=x/255;return .2126*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))}y.relativeLuminance=function(E){return b(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=b}(o||(s.rgb=o={})),function(y){function b(p,x,D){const R=p>>24&255,k=p>>16&255,B=p>>8&255;let O=x>>24&255,F=x>>16&255,N=x>>8&255,H=m(o.relativeLuminance2(O,F,N),o.relativeLuminance2(R,k,B));for(;H<D&&(O>0||F>0||N>0);)O-=Math.max(0,Math.ceil(.1*O)),F-=Math.max(0,Math.ceil(.1*F)),N-=Math.max(0,Math.ceil(.1*N)),H=m(o.relativeLuminance2(O,F,N),o.relativeLuminance2(R,k,B));return(O<<24|F<<16|N<<8|255)>>>0}function E(p,x,D){const R=p>>24&255,k=p>>16&255,B=p>>8&255;let O=x>>24&255,F=x>>16&255,N=x>>8&255,H=m(o.relativeLuminance2(O,F,N),o.relativeLuminance2(R,k,B));for(;H<D&&(O<255||F<255||N<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),F=Math.min(255,F+Math.ceil(.1*(255-F))),N=Math.min(255,N+Math.ceil(.1*(255-N))),H=m(o.relativeLuminance2(O,F,N),o.relativeLuminance2(R,k,B));return(O<<24|F<<16|N<<8|255)>>>0}y.ensureContrastRatio=function(p,x,D){const R=o.relativeLuminance(p>>8),k=o.relativeLuminance(x>>8);if(m(R,k)<D){if(k<R){const F=b(p,x,D),N=m(R,o.relativeLuminance(F>>8));if(N<D){const H=E(p,x,D);return N>m(R,o.relativeLuminance(H>>8))?F:H}return F}const B=E(p,x,D),O=m(R,o.relativeLuminance(B>>8));if(O<D){const F=b(p,x,D);return O>m(R,o.relativeLuminance(F>>8))?B:F}return B}},y.reduceLuminance=b,y.increaseLuminance=E,y.toChannels=function(p){return[p>>24&255,p>>16&255,p>>8&255,255&p]},y.toColor=function(p,x,D,R){return{css:S.toCss(p,x,D,R),rgba:S.toRgba(p,x,D,R)}}}(l||(s.rgba=l={})),s.toPaddedHex=c,s.contrastRatio=m},345:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===a)return void this._listeners.splice(d,1)}}})),this._event}fire(a,d){const g=[];for(let u=0;u<this._listeners.length;u++)g.push(this._listeners[u]);for(let u=0;u<g.length;u++)g[u].call(void 0,a,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,d){return a(g=>d.fire(g))}},859:(C,s)=>{function a(d){for(const g of d)g.dispose();d.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)===null||g===void 0||g.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}},s.toDisposable=function(d){return{dispose:d}},s.disposeArray=a,s.getDisposeArrayDisposable=function(d){return{dispose:()=>a(d)}}},485:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(g,u,v){this._data[g]||(this._data[g]={}),this._data[g][u]=v}get(g,u){return this._data[g]?this._data[g][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(d,g,u,v,w){this._data.get(d,g)||this._data.set(d,g,new a),this._data.get(d,g).set(u,v,w)}get(d,g,u,v){var w;return(w=this._data.get(d,g))===null||w===void 0?void 0:w.get(u,v)}clear(){this._data.clear()}}},399:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof navigator>"u";const a=s.isNode?"node":navigator.userAgent,d=s.isNode?"node":navigator.platform;s.isFirefox=a.includes("Firefox"),s.isLegacyEdge=a.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(a),s.getSafariVersion=function(){if(!s.isSafari)return 0;const g=a.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),s.isIpad=d==="iPad",s.isIphone=d==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),s.isLinux=d.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(a)},385:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const d=a(399);class g{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),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(w){this._idleCallback=void 0;let S=0,f=0,n=w.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(S=Date.now(),this._tasks[this._i]()||this._i++,S=Math.max(1,Date.now()-S),f=Math.max(S,f),o=w.timeRemaining(),1.5*f>o)return n-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-S))}ms`),void this._start();n=o}this.clear()}}class u extends g{_requestCallback(w){return setTimeout(()=>w(this._createDeadline(16)))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const S=Date.now()+w;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},147:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new a;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}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}}s.AttributeData=a;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}constructor(u=0,v=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=v}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=d},782:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const d=a(133),g=a(855),u=a(147);class v extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(S){const f=new v;return f.setFromCharData(S),f}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(S[g.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(S[g.CHAR_DATA_CHAR_INDEX].length===2){const n=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const o=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(n-55296)+o-56320+65536|S[g.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[g.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=S[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=v},855:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},133:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},s.utf32ToString=function(a,d=0,g=a.length){let u="";for(let v=d;v<g;++v){let w=a[v];w>65535?(w-=65536,u+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):u+=String.fromCharCode(w)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,d){const g=a.length;if(!g)return 0;let u=0,v=0;if(this._interim){const w=a.charCodeAt(v++);56320<=w&&w<=57343?d[u++]=1024*(this._interim-55296)+w-56320+65536:(d[u++]=this._interim,d[u++]=w),this._interim=0}for(let w=v;w<g;++w){const S=a.charCodeAt(w);if(55296<=S&&S<=56319){if(++w>=g)return this._interim=S,u;const f=a.charCodeAt(w);56320<=f&&f<=57343?d[u++]=1024*(S-55296)+f-56320+65536:(d[u++]=S,d[u++]=f)}else S!==65279&&(d[u++]=S)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,d){const g=a.length;if(!g)return 0;let u,v,w,S,f=0,n=0,o=0;if(this.interim[0]){let m=!1,y=this.interim[0];y&=(224&y)==192?31:(240&y)==224?15:7;let b,E=0;for(;(b=63&this.interim[++E])&&E<4;)y<<=6,y|=b;const p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,x=p-E;for(;o<x;){if(o>=g)return 0;if(b=a[o++],(192&b)!=128){o--,m=!0;break}this.interim[E++]=b,y<<=6,y|=63&b}m||(p===2?y<128?o--:d[f++]=y:p===3?y<2048||y>=55296&&y<=57343||y===65279||(d[f++]=y):y<65536||y>1114111||(d[f++]=y)),this.interim.fill(0)}const l=g-4;let c=o;for(;c<g;){for(;!(!(c<l)||128&(u=a[c])||128&(v=a[c+1])||128&(w=a[c+2])||128&(S=a[c+3]));)d[f++]=u,d[f++]=v,d[f++]=w,d[f++]=S,c+=4;if(u=a[c++],u<128)d[f++]=u;else if((224&u)==192){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(n=(31&u)<<6|63&v,n<128){c--;continue}d[f++]=n}else if((240&u)==224){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,f;if(w=a[c++],(192&w)!=128){c--;continue}if(n=(15&u)<<12|(63&v)<<6|63&w,n<2048||n>=55296&&n<=57343||n===65279)continue;d[f++]=n}else if((248&u)==240){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,f;if(w=a[c++],(192&w)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,this.interim[2]=w,f;if(S=a[c++],(192&S)!=128){c--;continue}if(n=(7&u)<<18|(63&v)<<12|(63&w)<<6|63&S,n<65536||n>1114111)continue;d[f++]=n}}return f}}},776:function(C,s,a){var d=this&&this.__decorate||function(n,o,l,c){var m,y=arguments.length,b=y<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,o,l,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(o,l,b):m(o,l))||b);return y>3&&b&&Object.defineProperty(o,l,b),b},g=this&&this.__param||function(n,o){return function(l,c){o(l,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=a(859),v=a(97),w={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let S,f=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),S=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let o=0;o<n.length;o++)typeof n[o]=="function"&&(n[o]=n[o]())}_log(n,o,l){this._evalLazyOptionalParams(l),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...l)}trace(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.TRACE&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.trace.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,n,o)}debug(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.debug.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,n,o)}info(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.INFO&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.info.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.info,n,o)}warn(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.WARN&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.warn.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.warn,n,o)}error(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.ERROR&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.error.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.error,n,o)}};s.LogService=f=d([g(0,v.IOptionsService)],f),s.setTraceLogger=function(n){S=n},s.traceCall=function(n,o,l){if(typeof l.value!="function")throw new Error("not supported");const c=l.value;l.value=function(...m){if(S.logLevel!==v.LogLevelEnum.TRACE)return c.apply(this,m);S.trace(`GlyphRenderer#${c.name}(${m.map(b=>JSON.stringify(b)).join(", ")})`);const y=c.apply(this,m);return S.trace(`GlyphRenderer#${c.name} return`,y),y}}},726:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const a="di$target",d="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[d]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const u=function(v,w,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,n,o){n[a]===n?n[d].push({id:f,index:o}):(n[d]=[{id:f,index:o}],n[a]=n)})(u,v,S)};return u.toString=()=>g,s.serviceRegistry.set(g,u),u}},97:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const d=a(726);var g;s.IBufferService=(0,d.createDecorator)("BufferService"),s.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),s.ICoreService=(0,d.createDecorator)("CoreService"),s.ICharsetService=(0,d.createDecorator)("CharsetService"),s.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(g||(s.LogLevelEnum=g={})),s.ILogService=(0,d.createDecorator)("LogService"),s.IOptionsService=(0,d.createDecorator)("OptionsService"),s.IOscLinkService=(0,d.createDecorator)("OscLinkService"),s.IUnicodeService=(0,d.createDecorator)("UnicodeService"),s.IDecorationService=(0,d.createDecorator)("DecorationService")}},i={};function h(C){var s=i[C];if(s!==void 0)return s.exports;var a=i[C]={exports:{}};return r[C].call(a.exports,a,a.exports,h),a.exports}var _={};return(()=>{var C=_;Object.defineProperty(C,"__esModule",{value:!0}),C.WebglAddon=void 0;const s=h(345),a=h(859),d=h(399),g=h(666),u=h(776);class v extends a.Disposable{constructor(S){if(d.isSafari&&(0,d.getSafariVersion)()<16)throw new Error("Webgl2 is only supported on Safari 16 and above");super(),this._preserveDrawingBuffer=S,this._onChangeTextureAtlas=this.register(new s.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new s.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new s.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new s.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(S){const f=S._core;if(!S.element)return void this.register(f.onWillOpen(()=>this.activate(S)));this._terminal=S;const n=f.coreService,o=f.optionsService,l=f,c=l._renderService,m=l._characterJoinerService,y=l._charSizeService,b=l._coreBrowserService,E=l._decorationService,p=l._logService,x=l._themeService;(0,u.setTraceLogger)(p),this._renderer=this.register(new g.WebglRenderer(S,m,y,b,n,E,o,x,this._preserveDrawingBuffer)),this.register((0,s.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,s.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,s.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,s.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),c.setRenderer(this._renderer),this.register((0,a.toDisposable)(()=>{const D=this._terminal._core._renderService;D.setRenderer(this._terminal._core._createRenderer()),D.handleResize(S.cols,S.rows)}))}get textureAtlas(){var S;return(S=this._renderer)===null||S===void 0?void 0:S.textureAtlas}clearTextureAtlas(){var S;(S=this._renderer)===null||S===void 0||S.clearTextureAtlas()}}C.WebglAddon=v})(),_})())})(td);var Gp=td.exports;const qp="",Xp="",rd="保存しました。",Yp="デッキを作成する前にワークスペースを追加してください。",Qp="ワークスペースを選択してください。",Jp=2e3,id='"JetBrains Mono", monospace',sd=14,Zp='"Cascadia Code", "JetBrains Mono", "Consolas", "Menlo", monospace',ev=13,dc="#000000",fc="#ffffff",nd="deck-theme",tv=204;async function ae(e,t={}){const r=await fetch(`${qp}${e}`,{...t,credentials:"include"});if(!r.ok){const i=await r.text();throw new Error(i||`Request failed (${r.status})`)}return r.status===tv?null:r.json()}const Ke="application/json",nt="POST",od="PUT",rs="DELETE";function rv(){return window.location.origin.replace(/^http/,"ws")}function iv(){return ae("/api/ws-token")}function sv(){return ae("/api/workspaces")}function nv(){return ae("/api/config")}function ov(e){return ae("/api/workspaces",{method:nt,headers:{"Content-Type":Ke},body:JSON.stringify({path:e})})}function lv(e){return ae(`/api/workspaces/${e}`,{method:rs})}function av(){return ae("/api/decks")}function cv(e,t){return ae("/api/decks",{method:nt,headers:{"Content-Type":Ke},body:JSON.stringify({name:e,workspaceId:t})})}function hv(e){return ae(`/api/decks/${e}`,{method:rs})}function uv(e){return ae("/api/decks/order",{method:od,headers:{"Content-Type":Ke},body:JSON.stringify({deckIds:e})})}function _c(e,t=""){const r=new URLSearchParams({workspaceId:e,path:t});return ae(`/api/files?${r.toString()}`)}function pc(e,t=""){const r=new URLSearchParams({path:e,subpath:t});return ae(`/api/preview?${r.toString()}`)}function dv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ae(`/api/file?${r.toString()}`)}function fv(e,t,r){return ae("/api/file",{method:od,headers:{"Content-Type":Ke},body:JSON.stringify({workspaceId:e,path:t,contents:r})})}function _v(e,t,r=""){return ae("/api/file",{method:nt,headers:{"Content-Type":Ke},body:JSON.stringify({workspaceId:e,path:t,contents:r})})}function pv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ae(`/api/file?${r.toString()}`,{method:rs})}function vv(e,t){return ae("/api/dir",{method:nt,headers:{"Content-Type":Ke},body:JSON.stringify({workspaceId:e,path:t})})}function gv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ae(`/api/dir?${r.toString()}`,{method:rs})}function mv(e,t,r){return ae("/api/terminals",{method:nt,headers:{"Content-Type":Ke},body:JSON.stringify({deckId:e,title:t,command:r})})}function yv(e){const t=new URLSearchParams({deckId:e});return ae(`/api/terminals?${t.toString()}`)}function Cv(e){return ae(`/api/terminals/${e}`,{method:rs})}function ld(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ae(`/api/git/status?${i.toString()}`)}function Sv(e){const t=new URLSearchParams({workspaceId:e});return ae(`/api/git/repos?${t.toString()}`)}function ad(e,t,r){return ae("/api/git/stage",{method:nt,headers:{"Content-Type":Ke},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function cd(e,t,r){return ae("/api/git/unstage",{method:nt,headers:{"Content-Type":Ke},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function wv(e,t,r){return ae("/api/git/commit",{method:nt,headers:{"Content-Type":Ke},body:JSON.stringify({workspaceId:e,message:t,repoPath:r})})}function xv(e,t,r){return ae("/api/git/discard",{method:nt,headers:{"Content-Type":Ke},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function bv(e,t,r,i){const h={workspaceId:e,path:t,staged:r.toString()};i!==void 0&&(h.repoPath=i);const _=new URLSearchParams(h);return ae(`/api/git/diff?${_.toString()}`)}function Ev(e,t){return ae("/api/git/push",{method:nt,headers:{"Content-Type":Ke},body:JSON.stringify({workspaceId:e,repoPath:t})})}function Lv(e,t){return ae("/api/git/pull",{method:nt,headers:{"Content-Type":Ke},body:JSON.stringify({workspaceId:e,repoPath:t})})}function kv(e,t){return ae("/api/git/fetch",{method:nt,headers:{"Content-Type":Ke},body:JSON.stringify({workspaceId:e,repoPath:t})})}function hd(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ae(`/api/git/branch-status?${i.toString()}`)}function ud(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ae(`/api/git/remotes?${i.toString()}`)}function Rv(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ae(`/api/git/branches?${i.toString()}`)}function Dv(e,t,r){return ae("/api/git/checkout",{method:nt,headers:{"Content-Type":Ke},body:JSON.stringify({workspaceId:e,branchName:t,repoPath:r})})}function Av(e,t,r=!0,i){return ae("/api/git/create-branch",{method:nt,headers:{"Content-Type":Ke},body:JSON.stringify({workspaceId:e,branchName:t,checkout:r,repoPath:i})})}function Tv(e,t=50,r){const i={workspaceId:e,limit:String(t)};r!==void 0&&(i.repoPath=r);const h=new URLSearchParams(i);return ae(`/api/git/log?${h.toString()}`)}const Mv="接続が終了しました。",vc=5,gc=1e3,Pv=new Set(["Deck deleted","Terminal deleted","Terminal exited","Terminal not found"]),mc=new TextEncoder;function Bv(e){const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r)&255;return t}function Ov({session:e,wsUrl:t,onDelete:r,onExit:i}){const h=$.useRef(null),_=$.useRef(null),C=$.useRef(null),s=$.useRef(null),a=$.useRef(0);return $.useEffect(()=>{var Z;if(!h.current)return;a.current=0,h.current.innerHTML="";const d=new Up.Terminal({cursorBlink:!0,fontFamily:Zp,fontSize:ev,allowProposedApi:!0,scrollback:3e3,convertEol:!1,windowsMode:!1,theme:{background:dc,foreground:fc},windowOptions:{getWinSizePixels:!0,getCellSizePixels:!0,getWinSizeChars:!0}}),g=new Wp.FitAddon,u=new Vp.Unicode11Addon,v=new Kp.WebLinksAddon;d.loadAddon(g),d.loadAddon(u),d.loadAddon(v),d.unicode.activeVersion="11",_.current=g,d.open(h.current);try{const A=new Gp.WebglAddon;d.loadAddon(A),C.current=A,A.onContextLoss(()=>{console.warn("[WebGL] Context lost, disposing addon");try{A.dispose(),C.current=null}catch(j){console.error("[WebGL] Error disposing after context loss:",j)}})}catch(A){console.warn("[WebGL] Failed to load WebGL addon, using canvas renderer:",A),C.current=null}let w=!0,S=!1,f=0;const n=A=>{const j=s.current;j&&j.readyState===WebSocket.OPEN&&j.send(JSON.stringify(A))},o=A=>{if(w)return;const j=s.current;j&&j.readyState===WebSocket.OPEN&&j.send(mc.encode(A))};d.parser.registerCsiHandler({final:"n"},A=>{const j=A.length>0?A[0]:0;if(j===6){const W=d.buffer.active,U=W.cursorY+W.baseY+1,Q=W.cursorX+1;return o(`\x1B[${U};${Q}R`),!0}else if(j===5)return o("\x1B[0n"),!0;return!1}),d.parser.registerCsiHandler({final:"c"},A=>(o("\x1B[?62;1;6;22c"),!0)),d.parser.registerCsiHandler({prefix:">",final:"c"},A=>(o("\x1B[>1;500;0c"),!0)),d.parser.registerCsiHandler({prefix:"?",final:"p",intermediates:"$"},A=>{const j=A[0]||0,W=d.modes;let U=0;return j===1?U=W.applicationCursorKeysMode?1:2:j===25?U=1:j===1e3?U=W.mouseTrackingMode==="x10"?1:2:j===1002?U=W.mouseTrackingMode==="drag"?1:2:j===1003?U=W.mouseTrackingMode==="any"?1:2:j===1004?U=W.sendFocusMode?1:2:j===1006?U=W.mouseTrackingMode!=="none"?1:2:j===1049?U=d.buffer.active.type==="alternate"?1:2:j===2004?U=W.bracketedPasteMode?1:2:j===2026&&(U=2),o(`\x1B[?${j};${U}$y`),!0});const l=A=>(A*257).toString(16).padStart(4,"0");d.parser.registerOscHandler(10,A=>{if(A==="?"){const j=fc,W=parseInt(j.slice(1,3),16),U=parseInt(j.slice(3,5),16),Q=parseInt(j.slice(5,7),16);return o(`\x1B]10;rgb:${l(W)}/${l(U)}/${l(Q)}\x07`),!0}return!1}),d.parser.registerOscHandler(11,A=>{if(A==="?"){const j=dc,W=parseInt(j.slice(1,3),16),U=parseInt(j.slice(3,5),16),Q=parseInt(j.slice(5,7),16);return o(`\x1B]11;rgb:${l(W)}/${l(U)}/${l(Q)}\x07`),!0}return!1}),d.parser.registerOscHandler(12,A=>A==="?"?(o("\x1B]12;rgb:ffff/ffff/ffff\x07"),!0):!1),d.parser.registerOscHandler(4,A=>{const j=A.match(/^(\d+);?\?$/);if(j){const W=parseInt(j[1]),U=["0000/0000/0000","cdcb/0000/0000","0000/cdcb/0000","cdcb/cdcb/0000","1e1e/9090/ffff","cdcb/0000/cdcb","0000/cdcb/cdcb","e5e5/e5e5/e5e5"],Q=W<8?U[W]:"0000/0000/0000";return o(`\x1B]4;${W};rgb:${Q}\x07`),!0}return!1}),d.parser.registerOscHandler(52,A=>!!A.includes("?")),d.parser.registerCsiHandler({prefix:">",final:"q"},A=>(o("\x1BP>|xterm.js(5.0.0)\x1B\\"),!0)),d.parser.registerCsiHandler({prefix:"?",final:"u"},A=>!0),d.parser.registerCsiHandler({prefix:"?",final:"m"},A=>A[0]===4?(o("\x1B[>4;0m"),!0):!1),d.parser.registerCsiHandler({final:"t"},A=>{const j=A[0];return j===19?(o(`\x1B[9;${d.rows};${d.cols}t`),!0):j===20?(o("\x1B]LTerminal\x1B\\"),!0):j===21?(o("\x1B]lTerminal\x1B\\"),!0):!1}),d.parser.registerCsiHandler({prefix:"?",final:"S"},A=>!0),d.parser.registerDcsHandler({intermediates:"$",final:"q"},(A,j)=>A==="m"?(o("\x1BP1$rm\x1B\\"),!0):A==='"p'?(o('\x1BP1$r62;1"p\x1B\\'),!0):A==="r"?(o(`\x1BP1$r1;${d.rows}r\x1B\\`),!0):(o("\x1BP0$r\x1B\\"),!0)),d.parser.registerDcsHandler({intermediates:"+",final:"q"},(A,j)=>{try{const U=(A.match(/.{2}/g)||[]).map(X=>String.fromCharCode(parseInt(X,16))).join(""),Q={TN:"xterm-256color",Co:"256",RGB:"",Tc:"",colors:"256",setrgbf:"\x1B[38;2;%p1%d;%p2%d;%p3%dm",setrgbb:"\x1B[48;2;%p1%d;%p2%d;%p3%dm"};if(U in Q){const ie=Q[U].split("").map(fe=>fe.charCodeAt(0).toString(16).padStart(2,"0")).join("");return o(`\x1BP1+r${ie}\x1B\\`),!0}}catch(W){console.error("[XTGETTCAP] Failed to decode:",W)}return o("\x1BP0+r\x1B\\"),!0}),d.parser.registerCsiHandler({final:"b"},A=>{const j=A[0]||1;return j>65535?(console.warn(`[REP] Large repeat count ${j} clamped to 65535 for security`),!0):!1});let c=0,m=0,y=null,b=d.cols,E=d.rows;const p=()=>{const A=d.cols,j=d.rows;!A||!j||A===b&&j===E||(b=A,E=j,n({type:"resize",cols:A,rows:j}))},x=()=>{n({type:"claim"})},D=(A=!1)=>{const j=h.current;if(!j)return;const W=j.clientWidth,U=j.clientHeight;!W||!U||!A&&W===c&&U===m||(c=W,m=U,g.fit(),p())},R=(A=!1)=>{if(y!==null){if(!A)return;cancelAnimationFrame(y)}y=window.requestAnimationFrame(()=>{y=null,D(A)})},k=new ResizeObserver(()=>{R()});k.observe(h.current);const B=new IntersectionObserver(A=>{A[0].isIntersecting&&R(!0)},{threshold:.8});B.observe(h.current),R(!0);const O=typeof document<"u"?document.fonts:null,F=()=>{P||R(!0)};O==null||O.ready.then(F).catch(()=>{}),(Z=O==null?void 0:O.addEventListener)==null||Z.call(O,"loadingdone",F);let N=null,H=null,L=null,T=null,P=!1,I=0,z=null,V=!1,G=!1;const K=async(A=!1)=>{if(!P){w=!0,S=!1,f=0;try{const{token:j,authEnabled:W}=await iv();if(P)return;const U=W?`${t}?token=${j}`:t;let Q=U;if(A&&a.current>0){const X=U.includes("?")?"&":"?";Q=`${U}${X}bufferOffset=${a.current}`}if(A){const X=Q.includes("?")?"&":"?";Q=`${Q}${X}reconnect=1`}N=new WebSocket(Q),N.binaryType="arraybuffer",s.current=N,N.addEventListener("open",()=>{I=0,G=!0,b=-1,E=-1,R(!0)}),N.addEventListener("message",X=>{if(typeof X.data=="string"){try{const fe=JSON.parse(X.data);if(fe.type==="sync"){w=!0,S=!1,f=0,a.current=fe.offsetBase,fe.reset&&(d.reset(),R(!0));return}if(fe.type==="ready"){S=!0,f===0&&(w=!1);return}}catch{d.write(X.data)}return}const ie=X.data instanceof ArrayBuffer?new Uint8Array(X.data):X.data instanceof Blob?null:new Uint8Array(X.data);ie&&(f++,d.write(ie,()=>{a.current+=ie.byteLength,f=Math.max(0,f-1),S&&f===0&&(w=!1)}))}),N.addEventListener("close",X=>{if(!(P||V)){if(X.code===1e3&&Pv.has(X.reason)){i();return}if(I<vc){I++;const ie=gc*Math.pow(2,I-1);z=setTimeout(()=>K(!0),ie)}else d.write(`\r
106
+ \x1B[31m${Mv}\x1B[0m\r
107
+ `)}}),N.addEventListener("error",()=>{}),H&&H.dispose(),H=d.onData(X=>{N&&N.readyState===WebSocket.OPEN&&(x(),N.send(mc.encode(X)))}),L&&L.dispose(),L=d.onBinary(X=>{N&&N.readyState===WebSocket.OPEN&&(x(),N.send(Bv(X)))}),T||(T=d.onFocus(()=>{x(),R(!0)}))}catch(j){if(console.error("[Terminal] Failed to connect:",j),I<vc&&G){I++;const W=gc*Math.pow(2,I-1);z=setTimeout(()=>K(!0),W)}else d.write(`\r
108
+ \x1B[31m接続エラー: ${j instanceof Error?j.message:"Unknown error"}\x1B[0m\r
109
+ `)}}};return K(),()=>{var A;if(P=!0,V=!0,z&&clearTimeout(z),y!==null&&cancelAnimationFrame(y),k.disconnect(),B.disconnect(),(A=O==null?void 0:O.removeEventListener)==null||A.call(O,"loadingdone",F),H&&H.dispose(),L&&L.dispose(),T&&T.dispose(),N&&N.close(),s.current=null,C.current){try{C.current.dispose()}catch(j){console.error("[WebGL] Error disposing addon during cleanup:",j)}C.current=null}_.current=null,d.dispose()}},[i,e.id,e.title,t]),M.jsxs("div",{className:"terminal-tile",children:[M.jsxs("div",{className:"terminal-tile-header",children:[M.jsx("span",{children:e.title}),M.jsx("button",{type:"button",className:"terminal-close-btn",onClick:()=>{window.confirm("このターミナルを閉じますか?")&&r()},"aria-label":"ターミナルを閉じる",children:"×"})]}),M.jsx("div",{className:"terminal-tile-body",ref:h})]})}function Iv(e){if(e<=1)return{cols:1,rows:1};const t=Math.ceil(Math.sqrt(e)),r=Math.ceil(e/t);return{cols:t,rows:r}}function Nv({terminals:e,wsBase:t,onDeleteTerminal:r,onExitTerminal:i}){const{cols:h,rows:_}=Iv(e.length);return M.jsx("section",{className:"terminal-pane",children:e.length===0?M.jsx("div",{className:"terminal-empty",children:M.jsx("span",{className:"terminal-empty-text",children:"ターミナルを追加"})}):M.jsx("div",{className:"terminal-grid",style:{gridTemplateColumns:`repeat(${h}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${_}, minmax(0, 1fr))`},children:e.map(C=>M.jsx(Ov,{session:C,wsUrl:`${t}/api/terminals/${C.id}`,onDelete:()=>r(C.id),onExit:()=>i(C.id)},C.id))})})}const Fv="ワークスペースがありません。";function jv({workspaces:e,selectedWorkspaceId:t,onSelect:r,onDelete:i}){return M.jsx("div",{className:"w-full grid gap-2",children:e.length===0?M.jsx("div",{className:"flex items-center justify-center text-muted text-[13px] p-8",children:Fv}):e.map(h=>M.jsxs("div",{className:st("flex items-center gap-2 p-4 border border-border rounded bg-panel transition-colors hover:bg-list-hover",h.id===t&&"bg-list-active border-accent"),children:[M.jsxs("button",{type:"button",className:"flex-1 min-w-0 text-left bg-transparent border-0 p-0 cursor-pointer",onClick:()=>r(h.id),children:[M.jsx("div",{className:"font-semibold text-[15px] mb-1",children:h.name}),M.jsx("div",{className:"text-[12px] text-muted font-mono truncate",children:h.path})]}),M.jsx("button",{type:"button",className:"flex-shrink-0 w-7 h-7 flex items-center justify-center rounded bg-transparent border-0 text-muted cursor-pointer hover:bg-[rgba(0,0,0,0.08)] hover:text-ink transition-colors dark:hover:bg-[rgba(255,255,255,0.08)]",title:"\\u524a\\u9664",onClick:_=>{_.stopPropagation(),confirm(`「${h.name}」を削除しますか?`)&&i(h.id)},children:M.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[M.jsx("polyline",{points:"3 6 5 6 21 6"}),M.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]},h.id))})}function Hv({contextMenu:e,onNewFile:t,onNewFolder:r,onDelete:i}){var h;return M.jsxs("div",{className:"fixed z-[1000] min-w-[160px] py-1 bg-panel border border-border rounded-[6px] shadow-[0_4px_12px_rgba(0,0,0,0.15)]",style:{left:e.x,top:e.y},onClick:_=>_.stopPropagation(),children:[(e.isRoot||((h=e.node)==null?void 0:h.type)==="dir")&&M.jsxs(M.Fragment,{children:[M.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-ink cursor-pointer hover:bg-list-hover",onClick:()=>{var _;return t(((_=e.node)==null?void 0:_.path)||"",e.node?1:0)},children:"新規ファイル"}),M.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-ink cursor-pointer hover:bg-list-hover",onClick:()=>{var _;return r(((_=e.node)==null?void 0:_.path)||"",e.node?1:0)},children:"新規フォルダ"})]}),e.node&&!e.isRoot&&M.jsxs(M.Fragment,{children:[e.node.type==="dir"&&M.jsx("div",{className:"h-px my-1 bg-border"}),M.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-[#f14c4c] cursor-pointer hover:bg-[rgba(241,76,76,0.1)]",onClick:()=>i(e.node),children:"削除"})]})]})}const yc="読み込み中...",$v="ファイル",zv="更新",Uv="ファイルが見つかりません。",Wv="戻る";function Vv(e,t){if(!t)return"";const r=t.find(i=>i.path===e||e.endsWith(i.path));return r?`git-tree-${r.status}`:""}const Kv=()=>M.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-chevron-icon",children:M.jsx("path",{d:"M9 6l6 6-6 6",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),Cc=()=>M.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-svg",children:M.jsx("path",{d:"M3.5 7.5h6l2 2h9a1 1 0 0 1 1 1V18a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V7.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})}),Sc=()=>M.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-svg",children:[M.jsx("path",{d:"M6 3.5h8l4 4V20a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V5A1.5 1.5 0 0 1 6 3.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),M.jsx("path",{d:"M14 3.5V8h4",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})]});function dd({root:e,entries:t=[],loading:r,error:i,mode:h="tree",canBack:_,onBack:C,onToggleDir:s,onOpenFile:a,onRefresh:d,onCreateFile:g,onCreateDirectory:u,onDeleteFile:v,onDeleteDirectory:w,gitFiles:S}){const[f,n]=$.useState(null),[o,l]=$.useState(null),[c,m]=$.useState(""),y=$.useRef(null),b=$.useRef(null),E=t??[];$.useEffect(()=>{const N=()=>n(null);if(f)return document.addEventListener("click",N),()=>document.removeEventListener("click",N)},[f]),$.useEffect(()=>{o&&y.current&&y.current.focus()},[o]);const p=$.useCallback((N,H,L=!1)=>{N.preventDefault(),N.stopPropagation();const T=180,P=150,I=Math.min(N.clientX,window.innerWidth-T-4),z=Math.min(N.clientY,window.innerHeight-P-4);n({x:I,y:z,node:H,isRoot:L})},[]),x=$.useCallback((N,H)=>{n(null),l({parentPath:N,type:"file",depth:H}),m("")},[]),D=$.useCallback((N,H)=>{n(null),l({parentPath:N,type:"dir",depth:H}),m("")},[]),R=$.useCallback(N=>{n(null),N.type==="dir"?window.confirm(`フォルダ "${N.name}" を削除しますか?
110
+ 中のファイルも全て削除されます。`)&&(w==null||w(N.path)):window.confirm(`ファイル "${N.name}" を削除しますか?`)&&(v==null||v(N.path))},[v,w]),k=$.useCallback(()=>{if(!o||!c.trim()){l(null);return}const N=c.trim();o.type==="file"?g==null||g(o.parentPath,N):u==null||u(o.parentPath,N),l(null),m("")},[o,c,g,u]),B=$.useCallback(N=>{N.key==="Enter"?k():N.key==="Escape"&&l(null)},[k]),O=N=>!o||o.depth!==N?null:M.jsxs("div",{className:"tree-row tree-input-row",style:{paddingLeft:12+N*16},children:[M.jsx("span",{className:"tree-icon","aria-hidden":"true",children:o.type==="dir"?M.jsx(Cc,{}):M.jsx(Sc,{})}),M.jsx("input",{ref:y,type:"text",className:"tree-input",value:c,onChange:H=>m(H.target.value),onKeyDown:B,onBlur:k,placeholder:o.type==="dir"?"フォルダ名":"ファイル名"})]}),F=(N,H)=>N.map(L=>{const T=L.type==="file"?Vv(L.path,S):"";return M.jsxs("div",{children:[M.jsxs("button",{type:"button",className:st("tree-row",L.type==="dir"&&"is-dir",h==="tree"&&L.expanded&&"is-open",T),style:{paddingLeft:12+H*16},onClick:()=>L.type==="dir"?s(L):a(L),onContextMenu:P=>p(P,L),"aria-expanded":L.type==="dir"&&h==="tree"?L.expanded:void 0,title:L.path,children:[M.jsx("span",{className:"tree-chevron","aria-hidden":"true",children:L.type==="dir"?M.jsx(Kv,{}):null}),M.jsx("span",{className:`tree-icon ${L.type}`,"aria-hidden":"true",children:L.type==="dir"?M.jsx(Cc,{}):M.jsx(Sc,{})}),M.jsx("span",{className:"tree-label",children:L.name}),L.loading?M.jsx("span",{className:"tree-meta",children:yc}):null]}),h==="tree"&&L.expanded&&L.type==="dir"&&M.jsxs(M.Fragment,{children:[(o==null?void 0:o.parentPath)===L.path&&O(H+1),L.children&&L.children.length>0&&F(L.children,H+1)]})]},L.path)});return M.jsxs("section",{className:"panel file-tree",ref:b,children:[M.jsxs("div",{className:"panel-header",children:[M.jsxs("div",{children:[M.jsx("div",{className:"panel-title",children:$v}),M.jsx("div",{className:"panel-subtitle",children:e})]}),M.jsxs("div",{className:"tree-actions",children:[C?M.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:C,disabled:_===!1,children:Wv}):null,M.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:d,children:zv})]})]}),M.jsxs("div",{className:"panel-body tree-body",onContextMenu:N=>p(N,null,!0),children:[r?M.jsx("div",{className:"tree-state",children:yc}):null,i?M.jsx("div",{className:"tree-state text-[#f14c4c]",children:i}):null,E.length===0&&!r?M.jsx("div",{className:"tree-state",children:Uv}):null,(o==null?void 0:o.parentPath)===""&&O(0),F(E,0)]}),f&&M.jsx(Hv,{contextMenu:f,onNewFile:x,onNewFolder:D,onDelete:R})]})}function cn(){return{files:[],activeFileId:null,tree:[],treeLoading:!1,treeError:null}}function hn(){return{terminals:[]}}function Gv(e){const t=e.lastIndexOf(".");return t===-1||t===0?"":e.slice(t+1).toLowerCase()}function qv(e){const t=Gv(e);return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",json:"json",html:"html",css:"css",scss:"scss",sass:"sass",less:"less",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",c:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",h:"c",hpp:"cpp",sh:"shell",bash:"shell",zsh:"shell",fish:"shell",xml:"xml",yaml:"yaml",yml:"yaml",toml:"toml",sql:"sql",graphql:"graphql",vue:"vue",svelte:"svelte",php:"php",r:"r",swift:"swift",kt:"kotlin",dart:"dart",lua:"lua",dockerfile:"dockerfile"}[t]||"plaintext"}function Pe(e){return e instanceof Error?e.message:String(e)}function un(e){return e.map(t=>({...t,expanded:!1,loading:!1,children:t.type==="dir"?[]:void 0}))}function fd(e){return qv(e)}function sl(e,t,r){return t?e.map(i=>{if(i.path===t&&i.type==="dir"){const _=[...i.children||[],r].sort((C,s)=>C.type!==s.type?C.type==="dir"?-1:1:C.name.localeCompare(s.name));return{...i,children:_,expanded:!0}}return i.children?{...i,children:sl(i.children,t,r)}:i}):[...e,r].sort((h,_)=>h.type!==_.type?h.type==="dir"?-1:1:h.name.localeCompare(_.name))}function nl(e,t){return e.filter(r=>r.path===t?!1:(r.children&&(r.children=nl(r.children,t)),!0))}function Mr(e,t,r){return e.map(i=>i.path===t?r(i):i.children?{...i,children:Mr(i.children,t,r)}:i)}function wc(e){return e.trim().replace(/[\\/]+$/,"").replace(/\\/g,"/").toLowerCase()}function Xv(e){return e.includes("\\")?"\\":"/"}function Yv(e,t){const r=Xv(e),i=e.replace(/[\\/]+$/,"");return i?`${i}${r}${t}`:t}function xc(e){const t=e.replace(/[\\/]+$/,"");if(!t)return e;if(/^[A-Za-z]:$/.test(t))return`${t}\\`;if(t==="/")return"/";const r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));if(t.startsWith("/")&&r===0)return"/";if(r<=0)return t;const i=t.slice(0,r);return/^[A-Za-z]:$/.test(i)?`${i}\\`:i}function _d(){if(typeof window>"u")return{view:"terminal",workspaceId:null,deckIds:[],workspaceMode:"list"};const e=new URLSearchParams(window.location.search),t=e.get("view"),r=e.get("mode"),i=e.get("decks")||e.get("deck"),h=i?i.split(",").filter(Boolean):[];return{view:t==="workspace"?"workspace":"terminal",workspaceId:e.get("workspace"),deckIds:h,workspaceMode:r==="editor"?"editor":"list"}}function Qv(){if(typeof window>"u")return"light";const e=window.localStorage.getItem(nd);return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Fe(e,t=1e4){return Promise.race([e,new Promise((r,i)=>setTimeout(()=>i(new Error("Request timeout")),t))])}const Jv=({isOpen:e,defaultRoot:t,onSubmit:r,onClose:i})=>{const[h,_]=$.useState(""),[C,s]=$.useState([]),[a,d]=$.useState(!1),[g,u]=$.useState(null),[v,w]=$.useState(!1),S=Xu(e,i),f=h.trim()||t,n=$.useMemo(()=>f?xc(f)!==f:!1,[f]);$.useEffect(()=>{if(!e){s([]),d(!1),u(null);return}let y=!0;return d(!0),u(null),pc(f,"").then(b=>{y&&(s(un(b)),d(!1))}).catch(b=>{y&&(u(Pe(b)),d(!1))}),()=>{y=!1}},[e,f]),$.useEffect(()=>{e&&(h.trim()||t&&_(t))},[t,e,h]);const o=()=>{e&&(d(!0),u(null),pc(f,"").then(y=>{s(un(y)),d(!1)}).catch(y=>{u(Pe(y)),d(!1)}))},l=y=>{if(y.type!=="dir")return;const b=Yv(f,y.name);_(b)},c=()=>{if(!f)return;const y=xc(f);y&&y!==f&&_(y)},m=async y=>{if(y.preventDefault(),!v){w(!0);try{await r(h),_("")}finally{w(!1)}}};return e?M.jsx("div",{className:"fixed inset-0 bg-black/50 grid place-items-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"workspace-modal-title",children:M.jsxs("form",{className:"modal flex flex-col !overflow-hidden",ref:S,onSubmit:m,children:[M.jsx("div",{className:"text-[14px] font-semibold mb-3 shrink-0",id:"workspace-modal-title",children:"ワークスペース追加"}),M.jsxs("label",{className:"grid gap-1 text-xs shrink-0",children:[M.jsx("span",{children:"パス"}),M.jsx("input",{type:"text",className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:h,placeholder:t||"",required:!0,maxLength:500,onChange:y=>_(y.target.value)})]}),M.jsx("div",{className:"flex-1 min-h-0 mt-3",children:M.jsx(dd,{root:f,entries:C,loading:a,error:g,mode:"navigator",canBack:n,onBack:c,onToggleDir:l,onOpenFile:()=>{},onRefresh:o})}),M.jsxs("div",{className:"flex justify-end gap-2 mt-4 shrink-0",children:[M.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:i,disabled:v,children:"キャンセル"}),M.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:v,children:v?"追加中...":"追加"})]})]})}):null},Zv="ステージ",eg="アンステージ",tg="変更を破棄",rg="差分を表示",ig={modified:"M",staged:"A",untracked:"U",deleted:"D",renamed:"R",conflicted:"C"};function bc({file:e,onStage:t,onUnstage:r,onDiscard:i,onShowDiff:h}){const _=`git-${e.status}`,C=ig[e.status];return M.jsxs("div",{className:"git-file-row",children:[M.jsxs("button",{type:"button",className:"git-file-main",onClick:()=>h(e),title:rg,children:[M.jsx("span",{className:`git-status-badge ${_}`,children:C}),M.jsx("span",{className:"git-file-path",children:e.path})]}),M.jsx("div",{className:"git-file-actions",children:e.staged?M.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>r(e.path),title:eg,children:M.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:M.jsx("path",{d:"M19 13H5v-2h14v2z"})})}):M.jsxs(M.Fragment,{children:[M.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>i(e.path),title:tg,children:M.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:M.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})}),M.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>t(e.path),title:Zv,children:M.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:M.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})]})})]})}const sg="ステージ済みの変更",ng="変更",og="コミット",lg="コミットメッセージを入力...",ag="変更はありません",cg="すべてステージ",hg="すべてアンステージ",Ec="Push",Lc="Pull",ug="Pushing...",dg="Pulling...";function fg({status:e,branchStatus:t,hasRemote:r,pushing:i,pulling:h,commitMessage:_,onCommitMessageChange:C,onCommit:s,onStageFile:a,onUnstageFile:d,onStageAll:g,onUnstageAll:u,onDiscardFile:v,onShowDiff:w,onPush:S,onPull:f}){const n=e.files.filter(y=>y.staged),o=e.files.filter(y=>!y.staged),l=e.files.length>0,c=n.length>0,m=$.useCallback(y=>{y.key==="Enter"&&(y.ctrlKey||y.metaKey)&&(y.preventDefault(),s())},[s]);return M.jsxs(M.Fragment,{children:[M.jsxs("div",{className:"flex flex-col gap-2 px-3",children:[M.jsx("textarea",{className:"border border-border rounded-[2px] p-2 text-[13px] font-[inherit] bg-panel text-ink resize-y min-h-[50px] focus:outline-none focus:border-focus",placeholder:lg,value:_,onChange:y=>C(y.target.value),onKeyDown:m,rows:3}),M.jsx("button",{type:"button",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",onClick:s,disabled:!c||!_.trim(),children:og})]}),r&&M.jsxs("div",{className:"flex gap-2 px-3 py-2 border-b border-border",children:[M.jsxs("button",{type:"button",className:"flex-1 flex items-center justify-center gap-1.5 px-2.5 py-1.5 bg-transparent border border-border rounded-[2px] text-ink text-xs cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:f,disabled:h||i,title:t!=null&&t.behind?`${t.behind} commits behind`:Lc,children:[M.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24","aria-hidden":"true",children:M.jsx("path",{d:"M12 4v12m0 0l-4-4m4 4l4-4M4 20h16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),h?dg:Lc,t!=null&&t.behind?` (${t.behind})`:""]}),M.jsxs("button",{type:"button",className:"flex-1 flex items-center justify-center gap-1.5 px-2.5 py-1.5 bg-transparent border border-border rounded-[2px] text-ink text-xs cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:S,disabled:i||h,title:t!=null&&t.ahead?`${t.ahead} commits ahead`:Ec,children:[M.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24","aria-hidden":"true",children:M.jsx("path",{d:"M12 20V8m0 0l4 4m-4-4l-4 4M4 4h16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),i?ug:Ec,t!=null&&t.ahead?` (${t.ahead})`:""]})]}),l?M.jsxs(M.Fragment,{children:[n.length>0&&M.jsxs("div",{className:"flex flex-col",children:[M.jsxs("div",{className:"flex items-center justify-between px-3 py-1",children:[M.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted",children:[sg," (",n.length,")"]}),M.jsx("button",{type:"button",className:"w-[22px] h-[22px] p-0 border-0 rounded-[3px] bg-transparent text-ink-muted cursor-pointer flex items-center justify-center hover:bg-list-hover hover:text-ink",onClick:u,title:hg,children:M.jsx("svg",{className:"w-3.5 h-3.5 fill-current",viewBox:"0 0 24 24","aria-hidden":"true",children:M.jsx("path",{d:"M19 13H5v-2h14v2z"})})})]}),M.jsx("div",{className:"flex flex-col",children:n.map(y=>M.jsx(bc,{file:y,onStage:a,onUnstage:d,onDiscard:v,onShowDiff:w},y.path))})]}),o.length>0&&M.jsxs("div",{className:"flex flex-col",children:[M.jsxs("div",{className:"flex items-center justify-between px-3 py-1",children:[M.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted",children:[ng," (",o.length,")"]}),M.jsx("button",{type:"button",className:"w-[22px] h-[22px] p-0 border-0 rounded-[3px] bg-transparent text-ink-muted cursor-pointer flex items-center justify-center hover:bg-list-hover hover:text-ink",onClick:g,title:cg,children:M.jsx("svg",{className:"w-3.5 h-3.5 fill-current",viewBox:"0 0 24 24","aria-hidden":"true",children:M.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})]}),M.jsx("div",{className:"flex flex-col",children:o.map(y=>M.jsx(bc,{file:y,onStage:a,onUnstage:d,onDiscard:v,onShowDiff:w},y.path))})]})]}):M.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:ag})]})}const _g="読み込み中...",pg="新規ブランチ",vg="作成",gg="キャンセル";function mg({branches:e,branchesLoading:t,onCheckoutBranch:r,onCreateBranch:i}){const[h,_]=$.useState(!1),[C,s]=$.useState(""),a=$.useCallback(()=>{C.trim()&&(i(C.trim()),s(""),_(!1))},[C,i]),d=$.useCallback(g=>{g.key==="Enter"?(g.preventDefault(),a()):g.key==="Escape"&&(_(!1),s(""))},[a]);return M.jsxs("div",{className:"flex flex-col gap-2",children:[M.jsx("div",{className:"px-3 py-2 border-b border-border",children:h?M.jsxs("div",{className:"flex gap-1.5 items-center",children:[M.jsx("input",{type:"text",className:"flex-1 px-2 py-1 text-xs border border-border rounded-[2px] bg-panel text-ink font-mono focus:outline-none focus:border-focus",placeholder:"ブランチ名...",value:C,onChange:g=>s(g.target.value),onKeyDown:d,autoFocus:!0}),M.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:a,disabled:!C.trim(),children:vg}),M.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>{_(!1),s("")},children:gg})]}):M.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>_(!0),children:pg})}),t?M.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:_g}):M.jsx("div",{className:"flex flex-col",children:e.map(g=>M.jsxs("button",{type:"button",className:st("flex items-center gap-2 px-3 py-1.5 bg-transparent border-0 text-ink text-[13px] cursor-pointer text-left transition-colors hover:bg-list-hover disabled:cursor-default",g.current&&"bg-list-active cursor-default"),onClick:()=>!g.current&&r(g.name),disabled:g.current,children:[M.jsxs("svg",{className:"w-4 h-4 flex-shrink-0 text-ink-muted",viewBox:"0 0 24 24","aria-hidden":"true",children:[M.jsx("path",{d:"M6 3v12M18 9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zM6 21a3 3 0 1 1 0-6 3 3 0 0 1 0 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),M.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),M.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono",children:g.name}),g.current&&M.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 bg-accent text-white rounded-[3px]",children:"現在"})]},g.name))})]})}const yg="読み込み中...";function Cg({logs:e,logsLoading:t}){return M.jsx("div",{className:"flex flex-col",children:t?M.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:yg}):e.length===0?M.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:"コミット履歴がありません"}):M.jsx("div",{className:"flex flex-col",children:e.map(r=>M.jsxs("div",{className:"flex flex-col gap-0.5 px-3 py-2 border-b border-border hover:bg-list-hover transition-colors",children:[M.jsxs("div",{className:"flex items-center gap-2",children:[M.jsx("span",{className:"font-mono text-xs text-accent font-semibold",children:r.hashShort}),M.jsx("span",{className:"text-xs text-ink-muted",children:r.author})]}),M.jsx("div",{className:"text-[13px] text-ink overflow-hidden text-ellipsis whitespace-nowrap",children:r.message}),M.jsx("div",{className:"text-[11px] text-muted",children:new Date(r.date).toLocaleString()})]},r.hash))})})}const vi="ソースコントロール",Sg="Gitリポジトリではありません",wg="ワークスペースを選択してください",xg="読み込み中...",so="更新",bg="変更",Eg="ブランチ",Lg="履歴",no="border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",oo="flex items-center justify-center h-full text-muted text-[13px] p-5";function kg({status:e,loading:t,error:r,workspaceId:i,branchStatus:h,hasRemote:_,pushing:C,pulling:s,branches:a,branchesLoading:d,logs:g,logsLoading:u,repos:v,selectedRepoPath:w,onSelectRepo:S,onRefresh:f,onStageFile:n,onUnstageFile:o,onStageAll:l,onUnstageAll:c,onCommit:m,onDiscardFile:y,onShowDiff:b,onPush:E,onPull:p,onLoadBranches:x,onCheckoutBranch:D,onCreateBranch:R,onLoadLogs:k}){const[B,O]=$.useState(""),[F,N]=$.useState("changes"),H=$.useCallback(()=>{B.trim()&&(m(B.trim()),O(""))},[B,m]),L=$.useCallback(I=>{N(I),I==="branches"?x():I==="history"&&k()},[x,k]);if(!i)return M.jsxs("section",{className:"panel",children:[M.jsx("div",{className:"panel-header",children:M.jsx("div",{className:"panel-title",children:vi})}),M.jsx("div",{className:"panel-body",children:M.jsx("div",{className:oo,children:wg})})]});if(t)return M.jsxs("section",{className:"panel",children:[M.jsx("div",{className:"panel-header",children:M.jsx("div",{className:"panel-title",children:vi})}),M.jsx("div",{className:"panel-body",children:M.jsx("div",{className:oo,children:xg})})]});if(r)return M.jsxs("section",{className:"panel",children:[M.jsxs("div",{className:"panel-header",children:[M.jsx("div",{className:"panel-title",children:vi}),M.jsx("button",{type:"button",className:no,onClick:f,children:so})]}),M.jsx("div",{className:"panel-body",children:M.jsx("div",{className:"flex items-center justify-center h-full text-[#f14c4c] text-[13px] p-5",children:r})})]});if(!(e!=null&&e.isGitRepo))return M.jsxs("section",{className:"panel",children:[M.jsxs("div",{className:"panel-header",children:[M.jsx("div",{className:"panel-title",children:vi}),M.jsx("button",{type:"button",className:no,onClick:f,children:so})]}),M.jsx("div",{className:"panel-body",children:M.jsx("div",{className:oo,children:Sg})})]});const T=e.files.length>0,P=v.length>1;return M.jsxs("section",{className:"panel",children:[M.jsxs("div",{className:"panel-header",children:[M.jsxs("div",{children:[M.jsx("div",{className:"panel-title",children:vi}),M.jsxs("div",{className:"panel-subtitle flex items-center gap-1.5",children:[M.jsxs("svg",{viewBox:"0 0 24 24",className:"w-3.5 h-3.5 flex-shrink-0","aria-hidden":"true",children:[M.jsx("path",{d:"M6 3v12M18 9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zM6 21a3 3 0 1 1 0-6 3 3 0 0 1 0 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),M.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),e.branch]})]}),M.jsx("button",{type:"button",className:no,onClick:f,children:so})]}),P&&M.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border bg-sidebar text-xs",children:[M.jsx("svg",{className:"w-3.5 h-3.5 text-muted flex-shrink-0",viewBox:"0 0 24 24","aria-hidden":"true",children:M.jsx("path",{d:"M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-6l-2-2H5a2 2 0 0 0-2 2z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),M.jsx("select",{className:"flex-1 min-w-0 bg-panel border border-border rounded-[2px] px-2 py-1 text-[12px] font-mono text-ink focus:outline-none focus:border-focus",value:w||"",onChange:I=>S(I.target.value),children:v.map(I=>M.jsxs("option",{value:I.path,children:[I.name," (",I.branch,") ",I.fileCount>0?`• ${I.fileCount}`:""]},I.path))}),M.jsxs("span",{className:"text-[11px] text-muted font-mono flex-shrink-0",children:[v.length," repos"]})]}),M.jsxs("div",{className:"git-tabs",children:[M.jsxs("button",{type:"button",className:st("git-tab",F==="changes"&&"active"),onClick:()=>L("changes"),children:[bg,T&&M.jsx("span",{className:"text-[10px] font-semibold bg-accent/20 text-accent rounded-full px-1.5 py-0.5 leading-none",children:e.files.length})]}),M.jsx("button",{type:"button",className:st("git-tab",F==="branches"&&"active"),onClick:()=>L("branches"),children:Eg}),M.jsx("button",{type:"button",className:st("git-tab",F==="history"&&"active"),onClick:()=>L("history"),children:Lg})]}),M.jsxs("div",{className:"panel-body",children:[F==="changes"&&M.jsx(fg,{status:e,branchStatus:h,hasRemote:_,pushing:C,pulling:s,commitMessage:B,onCommitMessageChange:O,onCommit:H,onStageFile:n,onUnstageFile:o,onStageAll:l,onUnstageAll:c,onDiscardFile:y,onShowDiff:b,onPush:E,onPull:p}),F==="branches"&&M.jsx(mg,{branches:a,branchesLoading:d,onCheckoutBranch:D,onCreateBranch:R}),F==="history"&&M.jsx(Cg,{logs:g,logsLoading:u})]})]})}function kc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function Rg(e){if(Array.isArray(e))return e}function Dg(e,t,r){return(t=Ig(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ag(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,h,_,C,s=[],a=!0,d=!1;try{if(_=(r=r.call(e)).next,t!==0)for(;!(a=(i=_.call(r)).done)&&(s.push(i.value),s.length!==t);a=!0);}catch(g){d=!0,h=g}finally{try{if(!a&&r.return!=null&&(C=r.return(),Object(C)!==C))return}finally{if(d)throw h}}return s}}function Tg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
111
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(h){return Object.getOwnPropertyDescriptor(e,h).enumerable})),r.push.apply(r,i)}return r}function Dc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rc(Object(r),!0).forEach(function(i){Dg(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rc(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Mg(e,t){if(e==null)return{};var r,i,h=Pg(e,t);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(e);for(i=0;i<_.length;i++)r=_[i],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(h[r]=e[r])}return h}function Pg(e,t){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(t.indexOf(i)!==-1)continue;r[i]=e[i]}return r}function Bg(e,t){return Rg(e)||Ag(e,t)||Ng(e,t)||Tg()}function Og(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ig(e){var t=Og(e,"string");return typeof t=="symbol"?t:t+""}function Ng(e,t){if(e){if(typeof e=="string")return kc(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?kc(e,t):void 0}}function Fg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ac(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(h){return Object.getOwnPropertyDescriptor(e,h).enumerable})),r.push.apply(r,i)}return r}function Tc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ac(Object(r),!0).forEach(function(i){Fg(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ac(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function jg(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(i){return t.reduceRight(function(h,_){return _(h)},i)}}function Si(e){return function t(){for(var r=this,i=arguments.length,h=new Array(i),_=0;_<i;_++)h[_]=arguments[_];return h.length>=e.length?e.apply(this,h):function(){for(var C=arguments.length,s=new Array(C),a=0;a<C;a++)s[a]=arguments[a];return t.apply(r,[].concat(h,s))}}}function dn(e){return{}.toString.call(e).includes("Object")}function Hg(e){return!Object.keys(e).length}function Yi(e){return typeof e=="function"}function $g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function zg(e,t){return dn(t)||or("changeType"),Object.keys(t).some(function(r){return!$g(e,r)})&&or("changeField"),t}function Ug(e){Yi(e)||or("selectorType")}function Wg(e){Yi(e)||dn(e)||or("handlerType"),dn(e)&&Object.values(e).some(function(t){return!Yi(t)})&&or("handlersType")}function Vg(e){e||or("initialIsRequired"),dn(e)||or("initialType"),Hg(e)&&or("initialContent")}function Kg(e,t){throw new Error(e[t]||e.default)}var Gg={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},or=Si(Kg)(Gg),xs={changes:zg,selector:Ug,handler:Wg,initial:Vg};function qg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};xs.initial(e),xs.handler(t);var r={current:e},i=Si(Qg)(r,t),h=Si(Yg)(r),_=Si(xs.changes)(e),C=Si(Xg)(r);function s(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(g){return g};return xs.selector(d),d(r.current)}function a(d){jg(i,h,_,C)(d)}return[s,a]}function Xg(e,t){return Yi(t)?t(e.current):t}function Yg(e,t){return e.current=Tc(Tc({},e.current),t),t}function Qg(e,t,r){return Yi(t)?t(e.current):Object.keys(r).forEach(function(i){var h;return(h=t[i])===null||h===void 0?void 0:h.call(t,e.current[i])}),r}var Jg={create:qg},Zg={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function e0(e){return function t(){for(var r=this,i=arguments.length,h=new Array(i),_=0;_<i;_++)h[_]=arguments[_];return h.length>=e.length?e.apply(this,h):function(){for(var C=arguments.length,s=new Array(C),a=0;a<C;a++)s[a]=arguments[a];return t.apply(r,[].concat(h,s))}}}function t0(e){return{}.toString.call(e).includes("Object")}function r0(e){return e||Mc("configIsRequired"),t0(e)||Mc("configType"),e.urls?(i0(),{paths:{vs:e.urls.monacoBase}}):e}function i0(){console.warn(pd.deprecation)}function s0(e,t){throw new Error(e[t]||e.default)}var pd={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
112
+ You are using deprecated way of configuration.
113
+
114
+ Instead of using
115
+ monaco.config({ urls: { monacoBase: '...' } })
116
+ use
117
+ monaco.config({ paths: { vs: '...' } })
118
+
119
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
120
+ `},Mc=e0(s0)(pd),n0={config:r0},o0=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return function(h){return r.reduceRight(function(_,C){return C(_)},h)}};function vd(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],vd(e[r],t[r]))}),Dc(Dc({},e),t)}var l0={type:"cancelation",msg:"operation is manually canceled"};function lo(e){var t=!1,r=new Promise(function(i,h){e.then(function(_){return t?h(l0):i(_)}),e.catch(h)});return r.cancel=function(){return t=!0},r}var a0=["monaco"],c0=Jg.create({config:Zg,isInitialized:!1,resolve:null,reject:null,monaco:null}),gd=Bg(c0,2),is=gd[0],Dn=gd[1];function h0(e){var t=n0.config(e),r=t.monaco,i=Mg(t,a0);Dn(function(h){return{config:vd(h.config,i),monaco:r}})}function u0(){var e=is(function(t){var r=t.monaco,i=t.isInitialized,h=t.resolve;return{monaco:r,isInitialized:i,resolve:h}});if(!e.isInitialized){if(Dn({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),lo(ao);if(window.monaco&&window.monaco.editor)return md(window.monaco),e.resolve(window.monaco),lo(ao);o0(d0,_0)(p0)}return lo(ao)}function d0(e){return document.body.appendChild(e)}function f0(e){var t=document.createElement("script");return e&&(t.src=e),t}function _0(e){var t=is(function(i){var h=i.config,_=i.reject;return{config:h,reject:_}}),r=f0("".concat(t.config.paths.vs,"/loader.js"));return r.onload=function(){return e()},r.onerror=t.reject,r}function p0(){var e=is(function(r){var i=r.config,h=r.resolve,_=r.reject;return{config:i,resolve:h,reject:_}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(r){var i=r.m||r;md(i),e.resolve(i)},function(r){e.reject(r)})}function md(e){is().monaco||Dn({monaco:e})}function v0(){return is(function(e){var t=e.monaco;return t})}var ao=new Promise(function(e,t){return Dn({resolve:e,reject:t})}),yd={config:h0,init:u0,__getMonacoInstance:v0},g0={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},co=g0,m0={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},y0=m0;function C0({children:e}){return mr.createElement("div",{style:y0.container},e)}var S0=C0,w0=S0;function x0({width:e,height:t,isEditorReady:r,loading:i,_ref:h,className:_,wrapperProps:C}){return mr.createElement("section",{style:{...co.wrapper,width:e,height:t},...C},!r&&mr.createElement(w0,null,i),mr.createElement("div",{ref:h,style:{...co.fullWidth,...!r&&co.hide},className:_}))}var b0=x0,Cd=$.memo(b0);function E0(e){$.useEffect(e,[])}var Sd=E0;function L0(e,t,r=!0){let i=$.useRef(!0);$.useEffect(i.current||!r?()=>{i.current=!1}:e,t)}var lt=L0;function Mi(){}function Vr(e,t,r,i){return k0(e,i)||R0(e,t,r,i)}function k0(e,t){return e.editor.getModel(wd(e,t))}function R0(e,t,r,i){return e.editor.createModel(t,r,i?wd(e,i):void 0)}function wd(e,t){return e.Uri.parse(t)}function D0({original:e,modified:t,language:r,originalLanguage:i,modifiedLanguage:h,originalModelPath:_,modifiedModelPath:C,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:a=!1,theme:d="light",loading:g="Loading...",options:u={},height:v="100%",width:w="100%",className:S,wrapperProps:f={},beforeMount:n=Mi,onMount:o=Mi}){let[l,c]=$.useState(!1),[m,y]=$.useState(!0),b=$.useRef(null),E=$.useRef(null),p=$.useRef(null),x=$.useRef(o),D=$.useRef(n),R=$.useRef(!1);Sd(()=>{let F=yd.init();return F.then(N=>(E.current=N)&&y(!1)).catch(N=>(N==null?void 0:N.type)!=="cancelation"&&console.error("Monaco initialization: error:",N)),()=>b.current?O():F.cancel()}),lt(()=>{if(b.current&&E.current){let F=b.current.getOriginalEditor(),N=Vr(E.current,e||"",i||r||"text",_||"");N!==F.getModel()&&F.setModel(N)}},[_],l),lt(()=>{if(b.current&&E.current){let F=b.current.getModifiedEditor(),N=Vr(E.current,t||"",h||r||"text",C||"");N!==F.getModel()&&F.setModel(N)}},[C],l),lt(()=>{let F=b.current.getModifiedEditor();F.getOption(E.current.editor.EditorOption.readOnly)?F.setValue(t||""):t!==F.getValue()&&(F.executeEdits("",[{range:F.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),F.pushUndoStop())},[t],l),lt(()=>{var F,N;(N=(F=b.current)==null?void 0:F.getModel())==null||N.original.setValue(e||"")},[e],l),lt(()=>{let{original:F,modified:N}=b.current.getModel();E.current.editor.setModelLanguage(F,i||r||"text"),E.current.editor.setModelLanguage(N,h||r||"text")},[r,i,h],l),lt(()=>{var F;(F=E.current)==null||F.editor.setTheme(d)},[d],l),lt(()=>{var F;(F=b.current)==null||F.updateOptions(u)},[u],l);let k=$.useCallback(()=>{var H;if(!E.current)return;D.current(E.current);let F=Vr(E.current,e||"",i||r||"text",_||""),N=Vr(E.current,t||"",h||r||"text",C||"");(H=b.current)==null||H.setModel({original:F,modified:N})},[r,t,h,e,i,_,C]),B=$.useCallback(()=>{var F;!R.current&&p.current&&(b.current=E.current.editor.createDiffEditor(p.current,{automaticLayout:!0,...u}),k(),(F=E.current)==null||F.editor.setTheme(d),c(!0),R.current=!0)},[u,d,k]);$.useEffect(()=>{l&&x.current(b.current,E.current)},[l]),$.useEffect(()=>{!m&&!l&&B()},[m,l,B]);function O(){var N,H,L,T;let F=(N=b.current)==null?void 0:N.getModel();s||((H=F==null?void 0:F.original)==null||H.dispose()),a||((L=F==null?void 0:F.modified)==null||L.dispose()),(T=b.current)==null||T.dispose()}return mr.createElement(Cd,{width:w,height:v,isEditorReady:l,loading:g,_ref:p,className:S,wrapperProps:f})}var A0=D0,T0=$.memo(A0);function M0(e){let t=$.useRef();return $.useEffect(()=>{t.current=e},[e]),t.current}var P0=M0,bs=new Map;function B0({defaultValue:e,defaultLanguage:t,defaultPath:r,value:i,language:h,path:_,theme:C="light",line:s,loading:a="Loading...",options:d={},overrideServices:g={},saveViewState:u=!0,keepCurrentModel:v=!1,width:w="100%",height:S="100%",className:f,wrapperProps:n={},beforeMount:o=Mi,onMount:l=Mi,onChange:c,onValidate:m=Mi}){let[y,b]=$.useState(!1),[E,p]=$.useState(!0),x=$.useRef(null),D=$.useRef(null),R=$.useRef(null),k=$.useRef(l),B=$.useRef(o),O=$.useRef(),F=$.useRef(i),N=P0(_),H=$.useRef(!1),L=$.useRef(!1);Sd(()=>{let I=yd.init();return I.then(z=>(x.current=z)&&p(!1)).catch(z=>(z==null?void 0:z.type)!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>D.current?P():I.cancel()}),lt(()=>{var z,V,G,K;let I=Vr(x.current,e||i||"",t||h||"",_||r||"");I!==((z=D.current)==null?void 0:z.getModel())&&(u&&bs.set(N,(V=D.current)==null?void 0:V.saveViewState()),(G=D.current)==null||G.setModel(I),u&&((K=D.current)==null||K.restoreViewState(bs.get(_))))},[_],y),lt(()=>{var I;(I=D.current)==null||I.updateOptions(d)},[d],y),lt(()=>{!D.current||i===void 0||(D.current.getOption(x.current.editor.EditorOption.readOnly)?D.current.setValue(i):i!==D.current.getValue()&&(L.current=!0,D.current.executeEdits("",[{range:D.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),D.current.pushUndoStop(),L.current=!1))},[i],y),lt(()=>{var z,V;let I=(z=D.current)==null?void 0:z.getModel();I&&h&&((V=x.current)==null||V.editor.setModelLanguage(I,h))},[h],y),lt(()=>{var I;s!==void 0&&((I=D.current)==null||I.revealLine(s))},[s],y),lt(()=>{var I;(I=x.current)==null||I.editor.setTheme(C)},[C],y);let T=$.useCallback(()=>{var I;if(!(!R.current||!x.current)&&!H.current){B.current(x.current);let z=_||r,V=Vr(x.current,i||e||"",t||h||"",z||"");D.current=(I=x.current)==null?void 0:I.editor.create(R.current,{model:V,automaticLayout:!0,...d},g),u&&D.current.restoreViewState(bs.get(z)),x.current.editor.setTheme(C),s!==void 0&&D.current.revealLine(s),b(!0),H.current=!0}},[e,t,r,i,h,_,d,g,u,C,s]);$.useEffect(()=>{y&&k.current(D.current,x.current)},[y]),$.useEffect(()=>{!E&&!y&&T()},[E,y,T]),F.current=i,$.useEffect(()=>{var I,z;y&&c&&((I=O.current)==null||I.dispose(),O.current=(z=D.current)==null?void 0:z.onDidChangeModelContent(V=>{L.current||c(D.current.getValue(),V)}))},[y,c]),$.useEffect(()=>{if(y){let I=x.current.editor.onDidChangeMarkers(z=>{var G;let V=(G=D.current.getModel())==null?void 0:G.uri;if(V&&z.find(K=>K.path===V.path)){let K=x.current.editor.getModelMarkers({resource:V});m==null||m(K)}});return()=>{I==null||I.dispose()}}return()=>{}},[y,m]);function P(){var I,z;(I=O.current)==null||I.dispose(),v?u&&bs.set(_,D.current.saveViewState()):(z=D.current.getModel())==null||z.dispose(),D.current.dispose()}return mr.createElement(Cd,{width:w,height:S,isEditorReady:y,loading:a,_ref:R,className:f,wrapperProps:n})}var O0=B0,I0=$.memo(O0),N0=I0;const Pc="ファイルを選択してください",F0="vs-dark",j0="vs";function H0(e){var i;const t=((i=e.split(".").pop())==null?void 0:i.toLowerCase())||"";return{ts:{icon:"TS",color:"#3178c6"},tsx:{icon:"TSX",color:"#3178c6"},js:{icon:"JS",color:"#f7df1e"},jsx:{icon:"JSX",color:"#61dafb"},json:{icon:"{ }",color:"#cbcb41"},html:{icon:"<>",color:"#e34c26"},css:{icon:"#",color:"#264de4"},scss:{icon:"S",color:"#cc6699"},md:{icon:"M↓",color:"#083fa1"},py:{icon:"PY",color:"#3776ab"},go:{icon:"GO",color:"#00add8"},rs:{icon:"RS",color:"#dea584"},java:{icon:"J",color:"#b07219"},sql:{icon:"SQL",color:"#e38c00"},yml:{icon:"Y",color:"#cb171e"},yaml:{icon:"Y",color:"#cb171e"},sh:{icon:"$",color:"#89e051"},bash:{icon:"$",color:"#89e051"},txt:{icon:"TXT",color:"#6a737d"}}[t]||{icon:"📄",color:"var(--ink-muted)"}}function $0(e){return{typescript:"TypeScript",typescriptreact:"TypeScript React",javascript:"JavaScript",javascriptreact:"JavaScript React",json:"JSON",html:"HTML",css:"CSS",scss:"SCSS",markdown:"Markdown",python:"Python",go:"Go",rust:"Rust",java:"Java",sql:"SQL",yaml:"YAML",shell:"Shell",plaintext:"Plain Text"}[e]||e}function z0({files:e,activeFileId:t,onSelectFile:r,onCloseFile:i,onChangeFile:h,onSaveFile:_,savingFileId:C,theme:s}){const a=e.find(f=>f.id===t),d=$.useRef(null),[g,u]=$.useState({line:1,column:1}),v=$.useCallback(f=>{d.current=f,f.onDidChangeCursorPosition(n=>{u({line:n.position.lineNumber,column:n.position.column})})},[]);$.useEffect(()=>{const f=n=>{!t||!((n.ctrlKey||n.metaKey)&&n.key.toLowerCase()==="s")||(n.preventDefault(),_==null||_(t))};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[t,_]);const w=(f,n)=>{f.stopPropagation(),i(n)},S=(f,n)=>{f.button===1&&(f.preventDefault(),i(n))};return e.length===0?M.jsx("div",{className:"editor-container editor-empty",children:M.jsxs("div",{className:"editor-welcome",children:[M.jsx("div",{className:"editor-welcome-icon",children:M.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[M.jsx("path",{d:"M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),M.jsx("polyline",{points:"13 2 13 9 20 9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),M.jsx("div",{className:"editor-welcome-text",children:Pc}),M.jsx("div",{className:"editor-welcome-hint",children:"左のファイルツリーからファイルを選択"})]})}):M.jsxs("div",{className:"editor-container",children:[M.jsx("div",{className:"editor-tabs",children:M.jsx("div",{className:"editor-tabs-list",children:e.map(f=>{const{icon:n,color:o}=H0(f.name),l=f.id===t,c=C===f.id;return M.jsxs("div",{className:st("editor-tab",l&&"active",f.dirty&&"dirty"),onClick:()=>r(f.id),onMouseDown:m=>S(m,f.id),role:"tab","aria-selected":l,tabIndex:0,children:[M.jsx("span",{className:"editor-tab-icon",style:{color:o},children:n}),M.jsx("span",{className:"editor-tab-name",children:f.name}),f.dirty&&!c&&M.jsx("span",{className:"editor-tab-dirty","aria-label":"未保存",children:"●"}),c&&M.jsx("span",{className:"editor-tab-saving","aria-label":"保存中",children:M.jsx("svg",{viewBox:"0 0 24 24",className:"spin",children:M.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeDasharray:"30 70"})})}),M.jsx("button",{type:"button",className:"editor-tab-close",onClick:m=>w(m,f.id),"aria-label":"閉じる",children:M.jsx("svg",{viewBox:"0 0 24 24",children:M.jsx("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]},f.id)})})}),a&&M.jsx("div",{className:"editor-breadcrumb",children:M.jsx("span",{className:"editor-breadcrumb-path",children:a.path})}),M.jsx("div",{className:"editor-content",children:a?M.jsx(N0,{height:"100%",theme:s==="dark"?F0:j0,language:a.language,value:a.contents,onChange:f=>h(a.id,f??""),onMount:v,options:{fontFamily:id,fontSize:sd,fontLigatures:!0,minimap:{enabled:!0,scale:1,showSlider:"mouseover"},smoothScrolling:!0,cursorBlinking:"smooth",cursorSmoothCaretAnimation:"on",renderLineHighlight:"all",scrollBeyondLastLine:!1,automaticLayout:!0,padding:{top:8,bottom:8},lineNumbers:"on",renderWhitespace:"selection",bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0}}}):M.jsx("div",{className:"editor-no-file",children:M.jsx("span",{children:Pc})})}),a&&M.jsxs("div",{className:"editor-statusbar",children:[M.jsx("div",{className:"editor-statusbar-left",children:M.jsxs("span",{className:"editor-status-item",children:[M.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[M.jsx("path",{d:"M6 3v12M18 9a3 3 0 110 6 3 3 0 010-6zM6 21a3 3 0 110-6 3 3 0 010 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),M.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),"main"]})}),M.jsxs("div",{className:"editor-statusbar-right",children:[M.jsxs("span",{className:"editor-status-item",children:["Ln ",g.line,", Col ",g.column]}),M.jsx("span",{className:"editor-status-item",children:"UTF-8"}),M.jsx("span",{className:"editor-status-item",children:$0(a.language)})]})]})]})}const U0="差分ビューア",W0="読み込み中...",V0="閉じる",K0="vs-dark",G0="vs";function q0({diff:e,loading:t,theme:r,onClose:i}){const h=e?fd(e.path):"plaintext";return M.jsxs("div",{className:"fixed inset-0 bg-bg z-50 grid grid-rows-[35px_minmax(0,1fr)]",children:[M.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 bg-title-bar border-b border-border",children:[M.jsxs("div",{children:[M.jsx("div",{className:"text-[13px] font-medium",children:U0}),e&&M.jsx("div",{className:"text-xs text-muted font-mono",children:e.path})]}),M.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:i,children:V0})]}),M.jsx("div",{className:"min-h-0 overflow-hidden",children:t?M.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:W0}):e?M.jsx(T0,{height:"100%",theme:r==="dark"?K0:G0,language:h,original:e.original,modified:e.modified,options:{fontFamily:id,fontSize:sd,readOnly:!0,renderSideBySide:!0,minimap:{enabled:!1},smoothScrolling:!0}}):null})]})}function X0({activeWorkspace:e,defaultRoot:t,activeWorkspaceState:r,editorWorkspaceId:i,gitState:h,theme:_,savingFileId:C,onCloseWorkspaceEditor:s,onToggleDir:a,onOpenFile:d,onRefreshTree:g,onCreateFile:u,onCreateDirectory:v,onDeleteFile:w,onDeleteDirectory:S,onRefreshGit:f,onSelectRepo:n,onStageFile:o,onUnstageFile:l,onStageAll:c,onUnstageAll:m,onCommit:y,onDiscardFile:b,onShowDiff:E,onCloseDiff:p,onPush:x,onPull:D,onLoadBranches:R,onCheckoutBranch:k,onCreateBranch:B,onLoadLogs:O,onSelectFile:F,onCloseFile:N,onChangeFile:H,onSaveFile:L}){var K,Z;const[T,P]=$.useState(!1),[I,z]=$.useState("files"),V=$.useCallback(A=>{d(A),P(!1)},[d]),G=((K=h.status)==null?void 0:K.files.length)??0;return M.jsxs("div",{className:st("workspace-editor-overlay",T&&"drawer-open"),children:[M.jsxs("div",{className:"workspace-editor-header",children:[M.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:s,children:"一覧に戻る"}),M.jsx("button",{type:"button",className:"sidebar-toggle-btn bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover min-h-[44px] min-w-[44px]",onClick:()=>P(A=>!A),"aria-label":"\\u30b5\\u30a4\\u30c9\\u30d0\\u30fc",children:M.jsx("svg",{viewBox:"0 0 24 24",width:"18",height:"18","aria-hidden":"true",children:M.jsx("path",{d:"M3 12h18M3 6h18M3 18h18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}),M.jsx("div",{className:"workspace-meta",children:e?e.path:null})]}),M.jsxs("div",{className:"workspace-editor-grid",children:[M.jsxs("div",{className:"activity-bar",children:[M.jsx("button",{type:"button",className:st("activity-bar-item",I==="files"&&"active"),onClick:()=>z("files"),title:"エクスプローラー",children:M.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:M.jsx("path",{d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),M.jsxs("button",{type:"button",className:st("activity-bar-item",I==="git"&&"active"),onClick:()=>{z("git"),f()},title:"ソースコントロール",children:[M.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[M.jsx("path",{d:"M6 3v12M18 9a3 3 0 110 6 3 3 0 010-6zM6 21a3 3 0 110-6 3 3 0 010 6z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),M.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]}),G>0&&M.jsx("span",{className:"activity-bar-badge",children:G})]})]}),M.jsx("div",{className:"sidebar-panel",children:M.jsx("div",{className:"sidebar-content",children:I==="files"?M.jsx(dd,{root:(e==null?void 0:e.path)||t||"",entries:r.tree,loading:r.treeLoading,error:r.treeError,onToggleDir:a,onOpenFile:V,onRefresh:g,onCreateFile:u,onCreateDirectory:v,onDeleteFile:w,onDeleteDirectory:S,gitFiles:(Z=h.status)==null?void 0:Z.files}):M.jsx(kg,{status:h.status,loading:h.loading,error:h.error,workspaceId:i,branchStatus:h.branchStatus,hasRemote:h.hasRemote,pushing:h.pushing,pulling:h.pulling,branches:h.branches,branchesLoading:h.branchesLoading,logs:h.logs,logsLoading:h.logsLoading,repos:h.repos,selectedRepoPath:h.selectedRepoPath,onSelectRepo:n,onRefresh:f,onStageFile:o,onUnstageFile:l,onStageAll:c,onUnstageAll:m,onCommit:y,onDiscardFile:b,onShowDiff:E,onPush:x,onPull:D,onLoadBranches:R,onCheckoutBranch:k,onCreateBranch:B,onLoadLogs:O})})}),M.jsx(z0,{files:r.files,activeFileId:r.activeFileId,onSelectFile:F,onCloseFile:N,onChangeFile:H,onSaveFile:L,savingFileId:C,theme:_})]}),M.jsx("div",{className:"sidebar-overlay",onClick:()=>P(!1),"aria-hidden":"true"}),h.diffPath&&M.jsx(q0,{diff:h.diff,loading:h.diffLoading,theme:_,onClose:p})]})}const Y0="設定",Q0="サーバー設定",J0="ポート番号",Z0="Basic認証",em="Basic認証を有効にする",tm="ユーザー名",rm="パスワード",im="※ 12文字以上推奨",sm="キャンセル",nm="保存",om="※ 設定を保存すると、サーバーが再起動されます",lm="WebSocket設定",am="接続数上限 (IP毎)",cm="現在の接続数",hm="全接続をクリア",um="適用",Es="bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus";function dm({isOpen:e,onClose:t,onSave:r}){const[i,h]=$.useState(8787),[_,C]=$.useState(!1),[s,a]=$.useState(""),[d,g]=$.useState(""),[u,v]=$.useState(!1),[w,S]=$.useState(1e3),[f,n]=$.useState(null),[o,l]=$.useState(!1),c=()=>{fetch("/api/ws/stats").then(E=>E.json()).then(E=>{n(E),S(E.limit)}).catch(E=>{console.error("Failed to load WS stats:",E)})};$.useEffect(()=>{if(!e)return;const E=p=>{p.key==="Escape"&&(p.preventDefault(),t())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[e,t]),$.useEffect(()=>{e&&(fetch("/api/settings").then(E=>E.json()).then(E=>{h(E.port),C(E.basicAuthEnabled),a(E.basicAuthUser),g(E.basicAuthPassword)}).catch(E=>{console.error("Failed to load settings:",E)}),c())},[e]);const m=async()=>{try{await fetch("/api/ws/limit",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({limit:w})}),c()}catch(E){console.error("Failed to set WS limit:",E)}},y=async()=>{l(!0);try{await fetch("/api/ws/clear",{method:"POST"}),c()}catch(E){console.error("Failed to clear WS connections:",E)}finally{l(!1)}},b=async E=>{E.preventDefault(),v(!0);try{await r({port:i,basicAuthEnabled:_,basicAuthUser:s,basicAuthPassword:d}),t()}catch(p){console.error("Failed to save settings:",p),alert("設定の保存に失敗しました")}finally{v(!1)}};return e?M.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"settings-modal-title",onClick:t,children:M.jsxs("div",{className:"modal w-[500px]",onClick:E=>E.stopPropagation(),children:[M.jsxs("div",{className:"flex items-center justify-between mb-4",children:[M.jsx("h2",{className:"m-0 text-[14px] font-semibold",id:"settings-modal-title",children:Y0}),M.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"閉じる",children:"×"})]}),M.jsxs("form",{onSubmit:b,children:[M.jsxs("div",{className:"flex flex-col gap-4",children:[M.jsxs("section",{className:"flex flex-col gap-3",children:[M.jsx("h3",{className:"m-0 text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted border-b border-border pb-2",children:Q0}),M.jsxs("div",{className:"flex flex-col gap-1",children:[M.jsx("label",{htmlFor:"port",className:"text-xs text-ink-muted",children:J0}),M.jsx("input",{type:"number",id:"port",className:Es,value:i,onChange:E=>h(Number(E.target.value)),min:1024,max:65535,required:!0})]}),M.jsxs("div",{className:"flex flex-col gap-1",children:[M.jsx("h4",{className:"m-0 text-xs font-semibold text-ink-muted",children:Z0}),M.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[M.jsx("input",{type:"checkbox",checked:_,onChange:E=>C(E.target.checked)}),M.jsx("span",{children:em})]})]}),_&&M.jsxs(M.Fragment,{children:[M.jsxs("div",{className:"flex flex-col gap-1",children:[M.jsx("label",{htmlFor:"username",className:"text-xs text-ink-muted",children:tm}),M.jsx("input",{type:"text",id:"username",className:Es,value:s,onChange:E=>a(E.target.value),required:_,autoComplete:"username"})]}),M.jsxs("div",{className:"flex flex-col gap-1",children:[M.jsx("label",{htmlFor:"password",className:"text-xs text-ink-muted",children:rm}),M.jsx("input",{type:"password",id:"password",className:Es,value:d,onChange:E=>g(E.target.value),required:_,minLength:12,autoComplete:"new-password"}),M.jsx("p",{className:"m-0 text-[11px] text-muted",children:im})]})]})]}),M.jsxs("section",{className:"flex flex-col gap-3",children:[M.jsx("h3",{className:"m-0 text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted border-b border-border pb-2",children:lm}),M.jsxs("div",{className:"flex flex-col gap-1",children:[M.jsx("label",{htmlFor:"wsLimit",className:"text-xs text-ink-muted",children:am}),M.jsxs("div",{className:"flex gap-2 items-center",children:[M.jsx("input",{type:"number",id:"wsLimit",className:`flex-1 ${Es}`,value:w,onChange:E=>S(Number(E.target.value)),min:1,max:1e4}),M.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:m,children:um})]})]}),M.jsxs("div",{className:"flex flex-col gap-1",children:[M.jsx("label",{className:"text-xs text-ink-muted",children:cm}),M.jsx("div",{className:"border border-border rounded-[2px] p-2 text-xs bg-bg min-h-[40px] flex flex-col gap-1",children:f&&f.connections.length>0?f.connections.map(({ip:E,count:p})=>M.jsxs("div",{className:"flex justify-between items-center",children:[M.jsx("span",{className:"font-mono text-ink",children:E}),M.jsx("span",{className:"font-semibold text-ink-muted",children:p})]},E)):M.jsx("div",{className:"text-muted text-center",children:"接続なし"})})]}),M.jsx("div",{className:"flex flex-col gap-1",children:M.jsx("button",{type:"button",className:"bg-[#f14c4c] text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",onClick:y,disabled:o,children:o?"クリア中...":hm})})]}),M.jsx("p",{className:"m-0 text-[11px] text-muted italic",children:om})]}),M.jsxs("div",{className:"flex justify-end gap-2 mt-4 border-t border-border pt-4",children:[M.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:t,disabled:u,children:sm}),M.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:u,children:u?"保存中...":nm})]})]})]})}):null}const fm=()=>{const[e,t]=$.useState({}),r=$.useCallback((h,_)=>{t(C=>{const s=C[h]||cn();return{...C,[h]:_(s)}})},[]),i=$.useCallback(h=>{t(_=>{const C={..._};return h.forEach(s=>{C[s]||(C[s]=cn())}),C})},[]);return{workspaceStates:e,setWorkspaceStates:t,updateWorkspaceState:r,initializeWorkspaceStates:i}},_m=()=>{const[e,t]=$.useState({}),r=$.useCallback((h,_)=>{t(C=>{const s=C[h]||hn();return{...C,[h]:_(s)}})},[]),i=$.useCallback(h=>{t(_=>{const C={..._};return h.forEach(s=>{C[s]||(C[s]=hn())}),C})},[]);return{deckStates:e,setDeckStates:t,updateDeckState:r,initializeDeckStates:i}},pm=({setStatusMessage:e,defaultRoot:t,initializeWorkspaceStates:r,setWorkspaceStates:i})=>{const[h,_]=$.useState([]),[C,s]=$.useState(null);$.useEffect(()=>{let g=!0;return sv().then(u=>{g&&(_(u),s(v=>v&&u.some(w=>w.id===v)?v:null),r(u.map(v=>v.id)))}).catch(u=>{g&&e(`ワークスペースを取得できませんでした: ${Pe(u)}`)}),()=>{g=!1}},[e,r]);const a=$.useCallback(async g=>{const v=g.trim()||t;if(!v)return e("パスを入力してください。"),null;const w=wc(v);if(h.some(f=>wc(f.path)===w))return e("同じパスのワークスペースは追加できません。"),null;try{const f=await ov(v);return _(n=>[...n,f]),s(f.id),i(n=>({...n,[f.id]:cn()})),f}catch(f){return e(`ワークスペースを追加できませんでした: ${Pe(f)}`),null}},[h,t,e,i]),d=$.useCallback(async g=>{try{await lv(g),_(u=>u.filter(v=>v.id!==g)),s(u=>u===g?null:u),i(u=>{const v={...u};return delete v[g],v})}catch(u){e(`ワークスペースを削除できませんでした: ${Pe(u)}`)}},[e,i]);return{workspaces:h,editorWorkspaceId:C,setEditorWorkspaceId:s,handleCreateWorkspace:a,handleDeleteWorkspace:d}},vm=({setStatusMessage:e,initializeDeckStates:t,updateDeckState:r,setDeckStates:i,initialDeckIds:h})=>{const[_,C]=$.useState([]),[s,a]=$.useState(h??[]);$.useEffect(()=>{let f=!0;return av().then(n=>{f&&(C(n),t(n.map(o=>o.id)),n.forEach(o=>{yv(o.id).then(l=>{f&&r(o.id,c=>({...c,terminals:l}))}).catch(()=>{})}))}).catch(n=>{f&&e(`デッキを取得できませんでした: ${Pe(n)}`)}),()=>{f=!1}},[e,t,r]),$.useEffect(()=>{if(_.length===0)return;const f=s.filter(n=>_.some(o=>o.id===n));f.length===s.length&&f.length>0||(f.length>0?a(f):_[0]&&a([_[0].id]))},[_,s]);const d=$.useCallback(async(f,n)=>{try{const o=await cv(f,n);return C(l=>[...l,o]),a(l=>[...l.filter(c=>c!==o.id),o.id]),i(l=>({...l,[o.id]:hn()})),o}catch(o){return e(`デッキの作成に失敗しました: ${Pe(o)}`),null}},[e,i]),g=$.useCallback(async f=>{try{await hv(f),C(n=>n.filter(o=>o.id!==f)),a(n=>n.filter(o=>o!==f)),i(n=>{const o={...n};return delete o[f],o})}catch(n){e(`デッキの削除に失敗しました: ${Pe(n)}`)}},[e,i]),u=$.useCallback(f=>{C(n=>{const o=f(n);return uv(o.map(l=>l.id)).catch(()=>{}),o})},[]),v=$.useCallback(async(f,n,o,l)=>{try{const c=await mv(f,l,o);r(f,m=>({...m,terminals:[...m.terminals,{id:c.id,title:c.title}]}))}catch(c){e(`ターミナルを起動できませんでした: ${Pe(c)}`)}},[r,e]),w=$.useCallback(async(f,n)=>{try{await Cv(n),r(f,o=>({...o,terminals:o.terminals.filter(l=>l.id!==n)}))}catch(o){e(`ターミナルを削除できませんでした: ${Pe(o)}`)}},[r,e]),S=$.useCallback((f,n)=>{r(f,o=>({...o,terminals:o.terminals.filter(l=>l.id!==n)}))},[r]);return{decks:_,activeDeckIds:s,setActiveDeckIds:a,handleCreateDeck:d,handleDeleteDeck:g,handleReorderDecks:u,handleCreateTerminal:v,handleDeleteTerminal:w,handleRemoveTerminalLocal:S}},gm=({editorWorkspaceId:e,activeWorkspaceState:t,updateWorkspaceState:r,setStatusMessage:i})=>{const[h,_]=$.useState(null),C=$.useCallback(()=>{e&&(r(e,n=>({...n,treeLoading:!0,treeError:null})),Fe(_c(e,""),15e3).then(n=>{r(e,o=>({...o,tree:un(n),treeLoading:!1}))}).catch(n=>{r(e,o=>({...o,treeLoading:!1,treeError:Pe(n)}))}))},[e,r]),s=$.useCallback(n=>{if(!(!e||n.type!=="dir")){if(n.expanded){r(e,o=>({...o,tree:Mr(o.tree,n.path,l=>({...l,expanded:!1}))}));return}if(n.children&&n.children.length>0){r(e,o=>({...o,tree:Mr(o.tree,n.path,l=>({...l,expanded:!0}))}));return}r(e,o=>({...o,tree:Mr(o.tree,n.path,l=>({...l,loading:!0}))})),Fe(_c(e,n.path),15e3).then(o=>{r(e,l=>({...l,tree:Mr(l.tree,n.path,c=>({...c,expanded:!0,loading:!1,children:un(o)}))}))}).catch(o=>{r(e,l=>({...l,treeError:Pe(o),tree:Mr(l.tree,n.path,c=>({...c,loading:!1}))}))})}},[e,r]),a=$.useCallback(n=>{if(!e||n.type!=="file")return;const o=t.files.find(m=>m.path===n.path);if(o){r(e,m=>({...m,activeFileId:o.id}));return}const l=crypto.randomUUID(),c={id:l,name:n.name,path:n.path,language:fd(n.path),contents:"",dirty:!1};r(e,m=>({...m,files:[...m.files,{...c,contents:"読み込み中..."}],activeFileId:l})),Fe(dv(e,n.path),15e3).then(m=>{r(e,y=>({...y,files:y.files.map(b=>b.id===l?{...b,contents:m.contents}:b)}))}).catch(m=>{r(e,y=>({...y,files:y.files.filter(b=>b.id!==l),activeFileId:y.files.length>1?y.files[0].id:null})),i(`ファイルを開けませんでした: ${Pe(m)}`)})},[e,t.files,r,i]),d=$.useCallback((n,o)=>{e&&r(e,l=>({...l,files:l.files.map(c=>c.id===n?{...c,contents:o,dirty:!0}:c)}))},[e,r]),g=$.useCallback(async n=>{if(!e)return;const o=t.files.find(l=>l.id===n);if(o){_(n);try{await Fe(fv(e,o.path,o.contents),15e3),r(e,l=>({...l,files:l.files.map(c=>c.id===n?{...c,dirty:!1}:c)})),i(rd)}catch(l){i(`保存に失敗しました: ${Pe(l)}`)}finally{_(null)}}},[e,t.files,r,i]),u=$.useCallback(n=>{e&&r(e,o=>{const l=o.files.findIndex(y=>y.id===n),c=o.files.filter(y=>y.id!==n);let m=o.activeFileId;return o.activeFileId===n&&(c.length===0?m=null:l>=c.length?m=c[c.length-1].id:m=c[l].id),{...o,files:c,activeFileId:m}})},[e,r]),v=$.useCallback(async(n,o)=>{if(!e)return;const l=n?`${n}/${o}`:o;try{await Fe(_v(e,l),15e3);const c={name:o,path:l,type:"file",expanded:!1,loading:!1};r(e,m=>({...m,tree:sl(m.tree,n,c)})),i(`ファイルを作成しました: ${o}`)}catch(c){i(`ファイル作成に失敗しました: ${Pe(c)}`)}},[e,r,i]),w=$.useCallback(async(n,o)=>{if(!e)return;const l=n?`${n}/${o}`:o;try{await Fe(vv(e,l),15e3);const c={name:o,path:l,type:"dir",expanded:!1,loading:!1,children:[]};r(e,m=>({...m,tree:sl(m.tree,n,c)})),i(`フォルダを作成しました: ${o}`)}catch(c){i(`フォルダ作成に失敗しました: ${Pe(c)}`)}},[e,r,i]),S=$.useCallback(async n=>{if(e)try{await Fe(pv(e,n),15e3),r(e,o=>{const l=o.files.filter(y=>y.path!==n);let c=o.activeFileId;const m=o.files.find(y=>y.path===n);return m&&o.activeFileId===m.id&&(c=l.length>0?l[0].id:null),{...o,files:l,activeFileId:c,tree:nl(o.tree,n)}}),i("ファイルを削除しました")}catch(o){i(`ファイル削除に失敗しました: ${Pe(o)}`)}},[e,r,i]),f=$.useCallback(async n=>{if(e)try{await Fe(gv(e,n),15e3),r(e,o=>{const l=o.files.filter(y=>!y.path.startsWith(n+"/")&&y.path!==n);let c=o.activeFileId;const m=o.files.find(y=>y.id===o.activeFileId);return m&&(m.path.startsWith(n+"/")||m.path===n)&&(c=l.length>0?l[0].id:null),{...o,files:l,activeFileId:c,tree:nl(o.tree,n)}}),i("フォルダを削除しました")}catch(o){i(`フォルダ削除に失敗しました: ${Pe(o)}`)}},[e,r,i]);return{savingFileId:h,handleRefreshTree:C,handleToggleDir:s,handleOpenFile:a,handleFileChange:d,handleSaveFile:g,handleCloseFile:u,handleCreateFile:v,handleCreateDirectory:w,handleDeleteFile:S,handleDeleteDirectory:f}};async function mm(e,t,r,i){if(!i.current[e]){i.current[e]=!0,t(e,h=>({...h,loading:!0,reposLoading:!0,error:null}));try{const _=(await Fe(Sv(e)).catch(()=>({repos:[]}))).repos;t(e,u=>({...u,repos:_,reposLoading:!1,selectedRepoPath:u.selectedRepoPath??(_.length>0?_[0].path:null)}));const s=(r.current[e]||wi()).selectedRepoPath??(_.length>0?_[0].path:void 0),[a,d,g]=await Promise.all([Fe(ld(e,s||void 0)),Fe(hd(e,s||void 0)).catch(()=>({ahead:0,behind:0,hasUpstream:!1})),Fe(ud(e,s||void 0)).catch(()=>({hasRemote:!1,remotes:[]}))]);t(e,u=>({...u,status:a,branchStatus:d,hasRemote:g.hasRemote,loading:!1,error:null}))}catch(h){const _=h instanceof Error?h.message:"Failed to get git status";t(e,C=>({...C,status:null,loading:!1,reposLoading:!1,error:_}))}finally{i.current[e]=!1}}}async function ym(e,t,r,i){r(e,h=>({...h,selectedRepoPath:t,loading:!0}));try{const[h,_,C]=await Promise.all([Fe(ld(e,t||void 0)),Fe(hd(e,t||void 0)).catch(()=>({ahead:0,behind:0,hasUpstream:!1})),Fe(ud(e,t||void 0)).catch(()=>({hasRemote:!1,remotes:[]}))]);r(e,s=>({...s,status:h,branchStatus:_,hasRemote:C.hasRemote,loading:!1,branches:[],logs:[]}))}catch(h){const _=h instanceof Error?h.message:"Failed to get git status";i(_),r(e,C=>({...C,loading:!1}))}}async function Cm(e,t,r,i,h){try{await ad(e,[t],r),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to stage file")}}async function Sm(e,t,r,i,h){try{await cd(e,[t],r),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to unstage file")}}async function wm(e,t,r,i,h){if(t.length!==0)try{await ad(e,t,r),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to stage files")}}async function xm(e,t,r,i,h){if(t.length!==0)try{await cd(e,t,r),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to unstage files")}}async function bm(e,t,r,i,h){try{const _=await wv(e,t.trim(),r);i(`Committed: ${_.summary.changes} changes, +${_.summary.insertions} -${_.summary.deletions}`),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to commit")}}async function Em(e,t,r,i,h){try{await xv(e,[t],r),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to discard changes")}}async function Lm(e,t,r,i,h){i(e,_=>({..._,diffPath:t.path,diffLoading:!0,diff:null}));try{const _=await bv(e,t.path,t.staged,r);i(e,C=>({...C,diff:_,diffLoading:!1}))}catch(_){h(_ instanceof Error?_.message:"Failed to get diff"),i(e,C=>({...C,diffPath:null,diff:null,diffLoading:!1}))}}async function km(e,t,r,i,h){r(e,_=>({..._,pushing:!0}));try{const _=await Ev(e,t);i(`Pushed to ${_.branch}`),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to push")}finally{r(e,_=>({..._,pushing:!1}))}}async function Rm(e,t,r,i,h){r(e,_=>({..._,pulling:!0}));try{const _=await Lv(e,t);_.summary.changes>0?i(`Pulled: ${_.summary.changes} changes, +${_.summary.insertions} -${_.summary.deletions}`):i("Already up to date"),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to pull")}finally{r(e,_=>({..._,pulling:!1}))}}async function Dm(e,t,r,i){try{await kv(e,t),r("Fetched from remote"),await i()}catch(h){r(h instanceof Error?h.message:"Failed to fetch")}}async function Am(e,t,r,i){r(e,h=>({...h,branchesLoading:!0}));try{const h=await Fe(Rv(e,t));r(e,_=>({..._,branches:h.branches,branchesLoading:!1}))}catch(h){i(h instanceof Error?h.message:"Failed to load branches"),r(e,_=>({..._,branchesLoading:!1}))}}async function Tm(e,t,r,i,h,_){try{await Dv(e,t,r),i(`Switched to branch '${t}'`),await h(),await _()}catch(C){i(C instanceof Error?C.message:"Failed to checkout branch")}}async function Mm(e,t,r,i,h,_,C){try{await Av(e,t,r,i),h(`Created branch '${t}'${r?" and switched to it":""}`),await _(),await C()}catch(s){h(s instanceof Error?s.message:"Failed to create branch")}}async function Pm(e,t,r,i,h){i(e,_=>({..._,logsLoading:!0}));try{const _=await Fe(Tv(e,t,r));i(e,C=>({...C,logs:_.logs,logsLoading:!1}))}catch(_){h(_ instanceof Error?_.message:"Failed to load git log"),i(e,C=>({...C,logsLoading:!1}))}}const wi=()=>({status:null,loading:!1,error:null,diffPath:null,diff:null,diffLoading:!1,branchStatus:null,hasRemote:!1,pushing:!1,pulling:!1,branches:[],branchesLoading:!1,logs:[],logsLoading:!1,repos:[],reposLoading:!1,selectedRepoPath:null}),Bm=(e,t)=>{const[r,i]=$.useState({}),h=$.useRef({}),_=$.useRef(r);_.current=r;const C=e&&r[e]||wi(),s=$.useCallback((k,B)=>{i(O=>({...O,[k]:B(O[k]||wi())}))},[]),a=$.useCallback(async k=>{const B=k||e;B&&await mm(B,s,_,h)},[e,s]),d=$.useCallback(async k=>{e&&await ym(e,k,s,t)},[e,s,t]),g=$.useCallback(async()=>{const k=Object.keys(_.current);await Promise.all(k.map(B=>a(B)))},[a]),u=$.useCallback(()=>{if(!e)return;const k=_.current[e];return(k==null?void 0:k.selectedRepoPath)||void 0},[e]),v=$.useCallback(async k=>{e&&await Cm(e,k,u(),t,a)},[e,u,t,a]),w=$.useCallback(async k=>{e&&await Sm(e,k,u(),t,a)},[e,u,t,a]),S=$.useCallback(async()=>{if(!e||!C.status)return;const k=C.status.files.filter(B=>!B.staged).map(B=>B.path);await wm(e,k,u(),t,a)},[e,C.status,u,t,a]),f=$.useCallback(async()=>{if(!e||!C.status)return;const k=C.status.files.filter(B=>B.staged).map(B=>B.path);await xm(e,k,u(),t,a)},[e,C.status,u,t,a]),n=$.useCallback(async k=>{!e||!k.trim()||await bm(e,k,u(),t,a)},[e,u,t,a]),o=$.useCallback(async k=>{e&&await Em(e,k,u(),t,a)},[e,u,t,a]),l=$.useCallback(async k=>{e&&await Lm(e,k,u(),s,t)},[e,u,s,t]),c=$.useCallback(()=>{e&&s(e,k=>({...k,diffPath:null,diff:null,diffLoading:!1}))},[e,s]),m=$.useCallback(async()=>{e&&await km(e,u(),s,t,a)},[e,u,s,t,a]),y=$.useCallback(async()=>{e&&await Rm(e,u(),s,t,a)},[e,u,s,t,a]),b=$.useCallback(async()=>{e&&await Dm(e,u(),t,a)},[e,u,t,a]),E=$.useCallback(async()=>{e&&await Am(e,u(),s,t)},[e,u,s,t]),p=$.useCallback(async k=>{e&&await Tm(e,k,u(),t,a,E)},[e,u,t,a,E]),x=$.useCallback(async(k,B=!0)=>{e&&await Mm(e,k,B,u(),t,a,E)},[e,u,t,a,E]),D=$.useCallback(async(k=50)=>{e&&await Pm(e,k,u(),s,t)},[e,u,s,t]),R=$.useCallback(k=>r[k]||wi(),[r]);return{gitState:C,gitStates:r,refreshGitStatus:a,refreshAllGitStatuses:g,getGitStateForWorkspace:R,handleSelectRepo:d,handleStageFile:v,handleUnstageFile:w,handleStageAll:S,handleUnstageAll:f,handleCommit:n,handleDiscardFile:o,handleShowDiff:l,handleCloseDiff:c,handlePush:m,handlePull:y,handleFetch:b,handleLoadBranches:E,handleCheckoutBranch:p,handleCreateBranch:x,handleLoadLogs:D}};function Om(){const[e,t]=$.useState(Qv);$.useEffect(()=>{if(!(typeof document>"u")){document.documentElement.dataset.theme=e;try{window.localStorage.setItem(nd,e)}catch{}}},[e]);const r=$.useCallback(()=>{t(i=>i==="dark"?"light":"dark")},[]);return{theme:e,handleToggleTheme:r}}function Im({view:e,editorWorkspaceId:t,activeDeckIds:r,workspaceMode:i,setView:h,setEditorWorkspaceId:_,setActiveDeckIds:C,setWorkspaceMode:s}){$.useEffect(()=>{const a=()=>{const d=_d();h(d.view),_(d.workspaceId??null),C(d.deckIds),s(d.workspaceMode)};return window.addEventListener("popstate",a),()=>window.removeEventListener("popstate",a)},[h,_,C,s]),$.useEffect(()=>{const a=new URLSearchParams;a.set("view",e),e==="workspace"&&t&&a.set("workspace",t),r.length>0&&a.set("decks",r.join(",")),e==="workspace"&&i==="editor"&&t&&a.set("mode","editor");const d=a.toString(),g=d?`${window.location.pathname}?${d}`:window.location.pathname;window.history.replaceState(null,"",g)},[e,t,r,i])}function Nm(){const[e,t]=$.useState(!1),[r,i]=$.useState(!1),[h,_]=$.useState(!1),C=$.useCallback(()=>t(!0),[]),s=$.useCallback(()=>t(!1),[]),a=$.useCallback(()=>i(!0),[]),d=$.useCallback(()=>i(!1),[]),g=$.useCallback(()=>_(!0),[]),u=$.useCallback(()=>_(!1),[]);return{isWorkspaceModalOpen:e,openWorkspaceModal:C,closeWorkspaceModal:s,isDeckModalOpen:r,openDeckModal:a,closeDeckModal:d,isSettingsModalOpen:h,openSettingsModal:g,closeSettingsModal:u}}const Bc=3;function Oc(e,t,r){const i=e.indexOf(t),h=e.indexOf(r);if(i<0||h<0||i===h)return e;const _=[...e];_.splice(i,1);const C=_.indexOf(r);return _.splice(C,0,t),_}function Fm(){const e=_d(),t=$.useRef(null),r=$.useRef(!1),[i,h]=$.useState(e.view),[_,C]=$.useState(e.workspaceMode),[s,a]=$.useState(Xp),[d,g]=$.useState(""),[u,v]=$.useState(null),[w,S]=$.useState(null),[f,n]=$.useState(!1),[o,l]=$.useState(!1),[c,m]=$.useState(null),{theme:y,handleToggleTheme:b}=Om(),{isWorkspaceModalOpen:E,openWorkspaceModal:p,closeWorkspaceModal:x,isDeckModalOpen:D,openDeckModal:R,closeDeckModal:k,isSettingsModalOpen:B,openSettingsModal:O,closeSettingsModal:F}=Nm(),{workspaceStates:N,setWorkspaceStates:H,updateWorkspaceState:L,initializeWorkspaceStates:T}=fm(),{deckStates:P,setDeckStates:I,updateDeckState:z,initializeDeckStates:V}=_m(),{workspaces:G,editorWorkspaceId:K,setEditorWorkspaceId:Z,handleCreateWorkspace:A,handleDeleteWorkspace:j}=pm({setStatusMessage:g,defaultRoot:s,initializeWorkspaceStates:T,setWorkspaceStates:H}),{decks:W,activeDeckIds:U,setActiveDeckIds:Q,handleCreateDeck:X,handleDeleteDeck:ie,handleReorderDecks:fe,handleCreateTerminal:_e,handleDeleteTerminal:ce,handleRemoveTerminalLocal:se}=vm({setStatusMessage:g,initializeDeckStates:V,updateDeckState:z,setDeckStates:I,initialDeckIds:e.deckIds}),Qe=$.useMemo(()=>cn(),[]),Oe=$.useMemo(()=>hn(),[]),kt=G.find(q=>q.id===K)||null,Pt=K&&N[K]||Qe,{savingFileId:he,handleRefreshTree:re,handleToggleDir:oe,handleOpenFile:te,handleFileChange:ue,handleSaveFile:Ie,handleCloseFile:ve,handleCreateFile:yt,handleCreateDirectory:$e,handleDeleteFile:De,handleDeleteDirectory:ne}=gm({editorWorkspaceId:K,activeWorkspaceState:Pt,updateWorkspaceState:L,setStatusMessage:g}),{gitState:Je,refreshGitStatus:dr,handleSelectRepo:Rr,handleStageFile:Dr,handleUnstageFile:ss,handleStageAll:xd,handleUnstageAll:bd,handleCommit:Ed,handleDiscardFile:Ld,handleShowDiff:kd,handleCloseDiff:Rd,handlePush:Dd,handlePull:Ad,handleLoadBranches:Td,handleCheckoutBranch:Md,handleCreateBranch:Pd,handleLoadLogs:Bd}=Bm(K,g);Im({view:i,editorWorkspaceId:K,activeDeckIds:U,workspaceMode:_,setView:h,setEditorWorkspaceId:Z,setActiveDeckIds:Q,setWorkspaceMode:C});const Od=rv(),ea=$.useMemo(()=>new Map(G.map(q=>[q.id,q])),[G]),An=W;$.useEffect(()=>{let q=!0;return nv().then(ee=>{q&&ee!=null&&ee.defaultRoot&&a(ee.defaultRoot)}).catch(()=>{}),()=>{q=!1}},[]),$.useEffect(()=>{if(d!==rd)return;const q=setTimeout(()=>g(""),Jp);return()=>clearTimeout(q)},[d]),$.useEffect(()=>{_==="editor"&&!K&&C("list")},[_,K]),$.useEffect(()=>{if(typeof window>"u")return;const q=window.matchMedia("(pointer: fine) and (min-width: 721px)"),ee=()=>l(q.matches);return ee(),q.addEventListener("change",ee),()=>q.removeEventListener("change",ee)},[]);const Bt=$.useCallback(()=>{v(null),S(null),n(!1)},[]),ns=$.useCallback(()=>{r.current=!0,window.setTimeout(()=>{r.current=!1},100)},[]);$.useEffect(()=>{o||Bt()},[o,Bt]);const Tn=$.useRef(null);$.useEffect(()=>{if(_!=="editor"||!K){Tn.current=null;return}Tn.current!==K&&(Tn.current=K,re(),dr())},[_,K,re,dr]);const Id=$.useCallback(()=>{if(G.length===0){g(Yp);return}R()},[G.length,R]),Nd=$.useCallback(async(q,ee)=>{if(!ee){g(Qp);return}await X(q,ee)&&k()},[X,k]),Fd=$.useCallback(async q=>{try{const ee=await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(q)});if(!ee.ok){const ye=await ee.text();throw new Error(ye||"Failed to save settings")}await ee.json(),g("設定を保存しました。ブラウザをリロードしてください。"),setTimeout(()=>{window.location.reload()},2e3)}catch(ee){throw console.error("Failed to save settings:",ee),ee}},[]),jd=$.useCallback(q=>{Z(q),C("editor")},[Z]),Hd=$.useCallback(()=>{C("list")},[]),$d=$.useCallback(async q=>{await A(q)&&x()},[A,x]),zd=$.useCallback(q=>{const ee=P[q]||Oe;_e(q,ee.terminals.length)},[P,Oe,_e]),Ud=$.useCallback(q=>{const ee=P[q]||Oe;_e(q,ee.terminals.length,"claude","Claude Code")},[P,Oe,_e]),Wd=$.useCallback(q=>{const ee=P[q]||Oe;_e(q,ee.terminals.length,"codex","Codex")},[P,Oe,_e]),Vd=$.useCallback((q,ee)=>{ce(q,ee)},[ce]),Kd=$.useCallback((q,ee)=>{se(q,ee)},[se]),Gd=$.useCallback(q=>{if(r.current){r.current=!1;return}Q([q])},[Q]),ta=$.useCallback(q=>{Q(ee=>{const ye=[...ee.filter(ge=>ge!==q),q];return ye.length<=Bc?ye:ye.slice(ye.length-Bc)})},[Q]),qd=$.useCallback(q=>{Q(ee=>{if(ee.length<=1){const ye=An.find(ge=>ge.id!==q);return ye?[ye.id]:ee}return ee.filter(ye=>ye!==q)})},[An,Q]),Xd=$.useCallback((q,ee)=>{q.preventDefault(),q.stopPropagation(),m({deckId:ee,x:q.clientX,y:q.clientY})},[]),Yd=$.useCallback(()=>{if(!c)return;const{deckId:q}=c;m(null),window.confirm(`このデッキを完全に削除しますか?
121
+ ターミナルもすべて削除されます。`)&&ie(q)},[c,ie]),ra=$.useCallback(()=>{m(null)},[]),Qd=$.useCallback((q,ee)=>{if(!o){q.preventDefault();return}q.dataTransfer.effectAllowed="move",q.dataTransfer.setData("text/plain",ee),v(ee),S(null),n(!1)},[o]),Jd=$.useCallback((q,ee)=>{!o||!u||u===ee||(q.preventDefault(),q.dataTransfer.dropEffect="move",S(ee),n(!1))},[o,u]),Zd=$.useCallback((q,ee)=>{q.currentTarget.contains(q.relatedTarget)||S(ye=>ye===ee?null:ye)},[]),ef=$.useCallback((q,ee)=>{if(!o)return;q.preventDefault();const ye=u||q.dataTransfer.getData("text/plain");if(!ye||ye===ee){Bt();return}fe(ge=>{const cf=ge.map(Ar=>Ar.id),hf=Oc(cf,ye,ee),uf=new Map(ge.map(Ar=>[Ar.id,Ar]));return hf.map(Ar=>uf.get(Ar))}),Q(ge=>Oc(ge,ye,ee)),ns(),Bt()},[u,o,Bt,Q,ns,fe]),tf=$.useCallback(q=>{!o||!u||(q.preventDefault(),q.dataTransfer.dropEffect="move",n(!0))},[o,u]),rf=$.useCallback(q=>{q.currentTarget.contains(q.relatedTarget)||n(!1)},[]),sf=$.useCallback(q=>{if(!o)return;q.preventDefault();const ee=u||q.dataTransfer.getData("text/plain");if(!ee){Bt();return}ta(ee),ns(),Bt()},[u,ta,o,Bt,ns]),nf=$.useCallback(q=>{K&&L(K,ee=>({...ee,activeFileId:q}))},[K,L]),of=_==="editor"&&!!K,lf=M.jsxs("div",{className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:[M.jsxs("div",{className:"flex flex-col items-center gap-4 p-6 flex-shrink-0",children:[M.jsx("button",{type:"button",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90",onClick:p,children:"ワークスペース追加"}),M.jsx(jv,{workspaces:G,selectedWorkspaceId:K,onSelect:jd,onDelete:j})]}),of&&M.jsx(X0,{activeWorkspace:kt,defaultRoot:s,activeWorkspaceState:Pt,editorWorkspaceId:K,gitState:Je,theme:y,savingFileId:he,onCloseWorkspaceEditor:Hd,onToggleDir:oe,onOpenFile:te,onRefreshTree:re,onCreateFile:yt,onCreateDirectory:$e,onDeleteFile:De,onDeleteDirectory:ne,onRefreshGit:dr,onSelectRepo:Rr,onStageFile:Dr,onUnstageFile:ss,onStageAll:xd,onUnstageAll:bd,onCommit:Ed,onDiscardFile:Ld,onShowDiff:kd,onCloseDiff:Rd,onPush:Dd,onPull:Ad,onLoadBranches:Td,onCheckoutBranch:Md,onCreateBranch:Pd,onLoadLogs:Bd,onSelectFile:nf,onCloseFile:ve,onChangeFile:ue,onSaveFile:Ie})]}),af=M.jsxs("div",{className:"terminal-layout",children:[M.jsx("div",{className:"terminal-topbar",children:M.jsx("div",{className:"topbar-left",children:M.jsxs("div",{className:"deck-tabs",children:[An.map(q=>{var ee,ye;return M.jsxs("button",{type:"button",className:st("deck-tab",U.includes(q.id)&&"active",u===q.id&&"is-dragging",w===q.id&&"is-drag-over"),onClick:()=>Gd(q.id),onContextMenu:ge=>Xd(ge,q.id),draggable:o,onDragStart:ge=>Qd(ge,q.id),onDragOver:ge=>Jd(ge,q.id),onDragLeave:ge=>Zd(ge,q.id),onDrop:ge=>ef(ge,q.id),onDragEnd:Bt,title:o?`${((ee=ea.get(q.workspaceId))==null?void 0:ee.path)||q.root}
122
+ ドラッグで並び替え / メインにドロップで分割表示`:`${((ye=ea.get(q.workspaceId))==null?void 0:ye.path)||q.root}`,children:[M.jsx("span",{className:"deck-tab-name",children:q.name}),M.jsx("span",{className:"deck-tab-close",role:"button","aria-label":"閉じる",onClick:ge=>{ge.stopPropagation(),qd(q.id)},children:"×"})]},q.id)}),M.jsx("button",{type:"button",className:"deck-tab deck-tab-add",onClick:Id,title:"デッキ作成",children:"+"})]})})}),M.jsx("div",{className:st("terminal-split-container",f&&"is-drop-target"),ref:t,style:{gridTemplateColumns:`repeat(${U.length}, 1fr)`},onDragOver:tf,onDragLeave:rf,onDrop:sf,children:U.length===0?M.jsx("div",{className:"panel flex items-center justify-center text-muted text-[13px] p-5",children:"デッキを作成してください。"}):U.map(q=>{const ee=W.find(ge=>ge.id===q),ye=P[q]||Oe;return ee?M.jsxs("div",{className:"deck-split-pane",children:[M.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b border-border bg-sidebar gap-2 min-h-[28px]",children:[U.length>1&&M.jsx("span",{className:"flex-1 min-w-0 text-[11px] font-semibold text-ink-muted overflow-hidden text-ellipsis whitespace-nowrap",children:ee.name}),M.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[M.jsx("button",{type:"button",className:"topbar-btn-sm",onClick:()=>zd(q),title:"ターミナル追加",children:"+"}),M.jsx("button",{type:"button",className:"topbar-btn-sm topbar-btn-claude",onClick:()=>Ud(q),title:"Claude",children:"C"}),M.jsx("button",{type:"button",className:"topbar-btn-sm topbar-btn-codex",onClick:()=>Wd(q),title:"Codex",children:"X"})]})]}),M.jsx(Nv,{terminals:ye.terminals,wsBase:Od,onDeleteTerminal:ge=>Vd(q,ge),onExitTerminal:ge=>Kd(q,ge)})]},q):null})})]});return M.jsxs("div",{className:"app","data-view":i,children:[M.jsx($p,{activeView:i,onSelect:h,theme:y,onToggleTheme:b,onOpenSettings:O}),M.jsxs("main",{className:"main",children:[i==="workspace"&&lf,i==="terminal"&&af]}),M.jsx(zp,{message:d}),M.jsx(Jv,{isOpen:E,defaultRoot:s,onSubmit:$d,onClose:x}),M.jsx(Hp,{isOpen:D,workspaces:G,onSubmit:Nd,onClose:k}),M.jsx(dm,{isOpen:B,onClose:F,onSave:Fd}),c&&M.jsxs(M.Fragment,{children:[M.jsx("div",{className:"fixed inset-0 z-[999]",onClick:ra,onContextMenu:q=>{q.preventDefault(),ra()}}),M.jsx("div",{className:"fixed z-[1000] bg-panel border border-border shadow-lg rounded-[2px] py-1 min-w-[140px]",style:{left:c.x,top:c.y},children:M.jsx("button",{type:"button",className:"w-full text-left px-3 py-1.5 text-[13px] text-red-400 bg-transparent border-0 cursor-pointer hover:bg-list-hover",onClick:Yd,children:"デッキを削除"})})]})]})}class jm extends $.Component{constructor(t){super(t),this.handleReload=()=>{window.location.reload()},this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("Application error:",t),console.error("Component stack:",r.componentStack)}render(){return this.state.hasError?M.jsx("div",{className:"flex items-center justify-center min-h-screen p-8 bg-bg",children:M.jsxs("div",{className:"max-w-[500px] p-8 bg-panel border border-border text-center",children:[M.jsx("h1",{className:"m-0 mb-4 text-xl text-[#f14c4c]",children:"Something went wrong"}),M.jsx("p",{className:"m-0 mb-6 text-muted",children:"The application encountered an unexpected error."}),this.state.error&&!1,M.jsx("button",{onClick:this.handleReload,className:"px-4 py-2 bg-accent text-white border-0 rounded-[2px] font-medium cursor-pointer hover:opacity-90",children:"Reload Application"})]})}):this.props.children}}ho.createRoot(document.getElementById("root")).render(M.jsx(mr.StrictMode,{children:M.jsx(jm,{children:M.jsx(Fm,{})})}));