deckide 3.5.40 → 3.5.42

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,178 @@
1
+ (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const p of document.querySelectorAll('link[rel="modulepreload"]'))_(p);new MutationObserver(p=>{for(const L of p)if(L.type==="childList")for(const R of L.addedNodes)R.tagName==="LINK"&&R.rel==="modulepreload"&&_(R)}).observe(document,{childList:!0,subtree:!0});function n(p){const L={};return p.integrity&&(L.integrity=p.integrity),p.referrerPolicy&&(L.referrerPolicy=p.referrerPolicy),p.crossOrigin==="use-credentials"?L.credentials="include":p.crossOrigin==="anonymous"?L.credentials="omit":L.credentials="same-origin",L}function _(p){if(p.ep)return;p.ep=!0;const L=n(p);fetch(p.href,L)}})();function Nf(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ec={exports:{}},wn={},tc={exports:{}},je={};/**
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 Sd;function Mv(){if(Sd)return je;Sd=1;var r=Symbol.for("react.element"),i=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),R=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),f=Symbol.iterator;function C(P){return P===null||typeof P!="object"?null:(P=f&&P[f]||P["@@iterator"],typeof P=="function"?P:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,w={};function c(P,H,J){this.props=P,this.context=H,this.refs=w,this.updater=J||b}c.prototype.isReactComponent={},c.prototype.setState=function(P,H){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,H,"setState")},c.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function h(){}h.prototype=c.prototype;function l(P,H,J){this.props=P,this.context=H,this.refs=w,this.updater=J||b}var u=l.prototype=new h;u.constructor=l,M(u,c.prototype),u.isPureReactComponent=!0;var g=Array.isArray,S=Object.prototype.hasOwnProperty,E={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function k(P,H,J){var ie,ae={},ue=null,X=null;if(H!=null)for(ie in H.ref!==void 0&&(X=H.ref),H.key!==void 0&&(ue=""+H.key),H)S.call(H,ie)&&!T.hasOwnProperty(ie)&&(ae[ie]=H[ie]);var j=arguments.length-2;if(j===1)ae.children=J;else if(1<j){for(var se=Array(j),te=0;te<j;te++)se[te]=arguments[te+2];ae.children=se}if(P&&P.defaultProps)for(ie in j=P.defaultProps,j)ae[ie]===void 0&&(ae[ie]=j[ie]);return{$$typeof:r,type:P,key:ue,ref:X,props:ae,_owner:E.current}}function N(P,H){return{$$typeof:r,type:P.type,key:H,ref:P.ref,props:P.props,_owner:P._owner}}function V(P){return typeof P=="object"&&P!==null&&P.$$typeof===r}function K(P){var H={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(J){return H[J]})}var O=/\/+/g;function B(P,H){return typeof P=="object"&&P!==null&&P.key!=null?K(""+P.key):H.toString(36)}function U(P,H,J,ie,ae){var ue=typeof P;(ue==="undefined"||ue==="boolean")&&(P=null);var X=!1;if(P===null)X=!0;else switch(ue){case"string":case"number":X=!0;break;case"object":switch(P.$$typeof){case r:case i:X=!0}}if(X)return X=P,ae=ae(X),P=ie===""?"."+B(X,0):ie,g(ae)?(J="",P!=null&&(J=P.replace(O,"$&/")+"/"),U(ae,H,J,"",function(te){return te})):ae!=null&&(V(ae)&&(ae=N(ae,J+(!ae.key||X&&X.key===ae.key?"":(""+ae.key).replace(O,"$&/")+"/")+P)),H.push(ae)),1;if(X=0,ie=ie===""?".":ie+":",g(P))for(var j=0;j<P.length;j++){ue=P[j];var se=ie+B(ue,j);X+=U(ue,H,J,se,ae)}else if(se=C(P),typeof se=="function")for(P=se.call(P),j=0;!(ue=P.next()).done;)ue=ue.value,se=ie+B(ue,j++),X+=U(ue,H,J,se,ae);else if(ue==="object")throw H=String(P),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.");return X}function z(P,H,J){if(P==null)return P;var ie=[],ae=0;return U(P,ie,"","",function(ue){return H.call(J,ue,ae++)}),ie}function q(P){if(P._status===-1){var H=P._result;H=H(),H.then(function(J){(P._status===0||P._status===-1)&&(P._status=1,P._result=J)},function(J){(P._status===0||P._status===-1)&&(P._status=2,P._result=J)}),P._status===-1&&(P._status=0,P._result=H)}if(P._status===1)return P._result.default;throw P._result}var Y={current:null},W={transition:null},A={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:W,ReactCurrentOwner:E};function I(){throw Error("act(...) is not supported in production builds of React.")}return je.Children={map:z,forEach:function(P,H,J){z(P,function(){H.apply(this,arguments)},J)},count:function(P){var H=0;return z(P,function(){H++}),H},toArray:function(P){return z(P,function(H){return H})||[]},only:function(P){if(!V(P))throw Error("React.Children.only expected to receive a single React element child.");return P}},je.Component=c,je.Fragment=n,je.Profiler=p,je.PureComponent=l,je.StrictMode=_,je.Suspense=d,je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=A,je.act=I,je.cloneElement=function(P,H,J){if(P==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+P+".");var ie=M({},P.props),ae=P.key,ue=P.ref,X=P._owner;if(H!=null){if(H.ref!==void 0&&(ue=H.ref,X=E.current),H.key!==void 0&&(ae=""+H.key),P.type&&P.type.defaultProps)var j=P.type.defaultProps;for(se in H)S.call(H,se)&&!T.hasOwnProperty(se)&&(ie[se]=H[se]===void 0&&j!==void 0?j[se]:H[se])}var se=arguments.length-2;if(se===1)ie.children=J;else if(1<se){j=Array(se);for(var te=0;te<se;te++)j[te]=arguments[te+2];ie.children=j}return{$$typeof:r,type:P.type,key:ae,ref:ue,props:ie,_owner:X}},je.createContext=function(P){return P={$$typeof:R,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},P.Provider={$$typeof:L,_context:P},P.Consumer=P},je.createElement=k,je.createFactory=function(P){var H=k.bind(null,P);return H.type=P,H},je.createRef=function(){return{current:null}},je.forwardRef=function(P){return{$$typeof:o,render:P}},je.isValidElement=V,je.lazy=function(P){return{$$typeof:y,_payload:{_status:-1,_result:P},_init:q}},je.memo=function(P,H){return{$$typeof:v,type:P,compare:H===void 0?null:H}},je.startTransition=function(P){var H=W.transition;W.transition={};try{P()}finally{W.transition=H}},je.unstable_act=I,je.useCallback=function(P,H){return Y.current.useCallback(P,H)},je.useContext=function(P){return Y.current.useContext(P)},je.useDebugValue=function(){},je.useDeferredValue=function(P){return Y.current.useDeferredValue(P)},je.useEffect=function(P,H){return Y.current.useEffect(P,H)},je.useId=function(){return Y.current.useId()},je.useImperativeHandle=function(P,H,J){return Y.current.useImperativeHandle(P,H,J)},je.useInsertionEffect=function(P,H){return Y.current.useInsertionEffect(P,H)},je.useLayoutEffect=function(P,H){return Y.current.useLayoutEffect(P,H)},je.useMemo=function(P,H){return Y.current.useMemo(P,H)},je.useReducer=function(P,H,J){return Y.current.useReducer(P,H,J)},je.useRef=function(P){return Y.current.useRef(P)},je.useState=function(P){return Y.current.useState(P)},je.useSyncExternalStore=function(P,H,J){return Y.current.useSyncExternalStore(P,H,J)},je.useTransition=function(){return Y.current.useTransition()},je.version="18.3.1",je}var Cd;function qc(){return Cd||(Cd=1,tc.exports=Mv()),tc.exports}/**
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 xd;function Dv(){if(xd)return wn;xd=1;var r=qc(),i=Symbol.for("react.element"),n=Symbol.for("react.fragment"),_=Object.prototype.hasOwnProperty,p=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,L={key:!0,ref:!0,__self:!0,__source:!0};function R(o,d,v){var y,f={},C=null,b=null;v!==void 0&&(C=""+v),d.key!==void 0&&(C=""+d.key),d.ref!==void 0&&(b=d.ref);for(y in d)_.call(d,y)&&!L.hasOwnProperty(y)&&(f[y]=d[y]);if(o&&o.defaultProps)for(y in d=o.defaultProps,d)f[y]===void 0&&(f[y]=d[y]);return{$$typeof:i,type:o,key:C,ref:b,props:f,_owner:p.current}}return wn.Fragment=n,wn.jsx=R,wn.jsxs=R,wn}var bd;function Av(){return bd||(bd=1,ec.exports=Dv()),ec.exports}var D=Av(),$=qc();const es=Nf($);var Wo={},rc={exports:{}},pr={},ic={exports:{}},sc={};/**
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
+ */var Ed;function Bv(){return Ed||(Ed=1,(function(r){function i(W,A){var I=W.length;W.push(A);e:for(;0<I;){var P=I-1>>>1,H=W[P];if(0<p(H,A))W[P]=A,W[I]=H,I=P;else break e}}function n(W){return W.length===0?null:W[0]}function _(W){if(W.length===0)return null;var A=W[0],I=W.pop();if(I!==A){W[0]=I;e:for(var P=0,H=W.length,J=H>>>1;P<J;){var ie=2*(P+1)-1,ae=W[ie],ue=ie+1,X=W[ue];if(0>p(ae,I))ue<H&&0>p(X,ae)?(W[P]=X,W[ue]=I,P=ue):(W[P]=ae,W[ie]=I,P=ie);else if(ue<H&&0>p(X,I))W[P]=X,W[ue]=I,P=ue;else break e}}return A}function p(W,A){var I=W.sortIndex-A.sortIndex;return I!==0?I:W.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var L=performance;r.unstable_now=function(){return L.now()}}else{var R=Date,o=R.now();r.unstable_now=function(){return R.now()-o}}var d=[],v=[],y=1,f=null,C=3,b=!1,M=!1,w=!1,c=typeof setTimeout=="function"?setTimeout:null,h=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 u(W){for(var A=n(v);A!==null;){if(A.callback===null)_(v);else if(A.startTime<=W)_(v),A.sortIndex=A.expirationTime,i(d,A);else break;A=n(v)}}function g(W){if(w=!1,u(W),!M)if(n(d)!==null)M=!0,q(S);else{var A=n(v);A!==null&&Y(g,A.startTime-W)}}function S(W,A){M=!1,w&&(w=!1,h(k),k=-1),b=!0;var I=C;try{for(u(A),f=n(d);f!==null&&(!(f.expirationTime>A)||W&&!K());){var P=f.callback;if(typeof P=="function"){f.callback=null,C=f.priorityLevel;var H=P(f.expirationTime<=A);A=r.unstable_now(),typeof H=="function"?f.callback=H:f===n(d)&&_(d),u(A)}else _(d);f=n(d)}if(f!==null)var J=!0;else{var ie=n(v);ie!==null&&Y(g,ie.startTime-A),J=!1}return J}finally{f=null,C=I,b=!1}}var E=!1,T=null,k=-1,N=5,V=-1;function K(){return!(r.unstable_now()-V<N)}function O(){if(T!==null){var W=r.unstable_now();V=W;var A=!0;try{A=T(!0,W)}finally{A?B():(E=!1,T=null)}}else E=!1}var B;if(typeof l=="function")B=function(){l(O)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,z=U.port2;U.port1.onmessage=O,B=function(){z.postMessage(null)}}else B=function(){c(O,0)};function q(W){T=W,E||(E=!0,B())}function Y(W,A){k=c(function(){W(r.unstable_now())},A)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(W){W.callback=null},r.unstable_continueExecution=function(){M||b||(M=!0,q(S))},r.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<W?Math.floor(1e3/W):5},r.unstable_getCurrentPriorityLevel=function(){return C},r.unstable_getFirstCallbackNode=function(){return n(d)},r.unstable_next=function(W){switch(C){case 1:case 2:case 3:var A=3;break;default:A=C}var I=C;C=A;try{return W()}finally{C=I}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(W,A){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var I=C;C=W;try{return A()}finally{C=I}},r.unstable_scheduleCallback=function(W,A,I){var P=r.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?P+I:P):I=P,W){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=I+H,W={id:y++,callback:A,priorityLevel:W,startTime:I,expirationTime:H,sortIndex:-1},I>P?(W.sortIndex=I,i(v,W),n(d)===null&&W===n(v)&&(w?(h(k),k=-1):w=!0,Y(g,I-P))):(W.sortIndex=H,i(d,W),M||b||(M=!0,q(S))),W},r.unstable_shouldYield=K,r.unstable_wrapCallback=function(W){var A=C;return function(){var I=C;C=A;try{return W.apply(this,arguments)}finally{C=I}}}})(sc)),sc}var kd;function Pv(){return kd||(kd=1,ic.exports=Bv()),ic.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 Ld;function Ov(){if(Ld)return pr;Ld=1;var r=qc(),i=Pv();function n(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s]);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 _=new Set,p={};function L(e,t){R(e,t),R(e+"Capture",t)}function R(e,t){for(p[e]=t,e=0;e<t.length;e++)_.add(t[e])}var o=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,v=/^[: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]*$/,y={},f={};function C(e){return d.call(f,e)?!0:d.call(y,e)?!1:v.test(e)?f[e]=!0:(y[e]=!0,!1)}function b(e,t,s,a){if(s!==null&&s.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return a?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function M(e,t,s,a){if(t===null||typeof t>"u"||b(e,t,s,a))return!0;if(a)return!1;if(s!==null)switch(s.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 w(e,t,s,a,m,x,F){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=a,this.attributeNamespace=m,this.mustUseProperty=s,this.propertyName=e,this.type=t,this.sanitizeURL=x,this.removeEmptyString=F}var c={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){c[e]=new w(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];c[t]=new w(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){c[e]=new w(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){c[e]=new w(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){c[e]=new w(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){c[e]=new w(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){c[e]=new w(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){c[e]=new w(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){c[e]=new w(e,5,!1,e.toLowerCase(),null,!1,!1)});var h=/[\-:]([a-z])/g;function l(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(h,l);c[t]=new w(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(h,l);c[t]=new w(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(h,l);c[t]=new w(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){c[e]=new w(e,1,!1,e.toLowerCase(),null,!1,!1)}),c.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){c[e]=new w(e,1,!1,e.toLowerCase(),null,!0,!0)});function u(e,t,s,a){var m=c.hasOwnProperty(t)?c[t]:null;(m!==null?m.type!==0:a||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(M(t,s,m,a)&&(s=null),a||m===null?C(t)&&(s===null?e.removeAttribute(t):e.setAttribute(t,""+s)):m.mustUseProperty?e[m.propertyName]=s===null?m.type===3?!1:"":s:(t=m.attributeName,a=m.attributeNamespace,s===null?e.removeAttribute(t):(m=m.type,s=m===3||m===4&&s===!0?"":""+s,a?e.setAttributeNS(a,t,s):e.setAttribute(t,s))))}var g=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for("react.element"),E=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),V=Symbol.for("react.provider"),K=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),W=Symbol.iterator;function A(e){return e===null||typeof e!="object"?null:(e=W&&e[W]||e["@@iterator"],typeof e=="function"?e:null)}var I=Object.assign,P;function H(e){if(P===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);P=t&&t[1]||""}return`
34
+ `+P+e}var J=!1;function ie(e,t){if(!e||J)return"";J=!0;var s=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(ne){var a=ne}Reflect.construct(e,[],t)}else{try{t.call()}catch(ne){a=ne}e.call(t.prototype)}else{try{throw Error()}catch(ne){a=ne}e()}}catch(ne){if(ne&&a&&typeof ne.stack=="string"){for(var m=ne.stack.split(`
35
+ `),x=a.stack.split(`
36
+ `),F=m.length-1,G=x.length-1;1<=F&&0<=G&&m[F]!==x[G];)G--;for(;1<=F&&0<=G;F--,G--)if(m[F]!==x[G]){if(F!==1||G!==1)do if(F--,G--,0>G||m[F]!==x[G]){var Q=`
37
+ `+m[F].replace(" at new "," at ");return e.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",e.displayName)),Q}while(1<=F&&0<=G);break}}}finally{J=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?H(e):""}function ae(e){switch(e.tag){case 5:return H(e.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("SuspenseList");case 0:case 2:case 15:return e=ie(e.type,!1),e;case 11:return e=ie(e.type.render,!1),e;case 1:return e=ie(e.type,!0),e;default:return""}}function ue(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 T:return"Fragment";case E:return"Portal";case N:return"Profiler";case k:return"StrictMode";case B:return"Suspense";case U:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case K:return(e.displayName||"Context")+".Consumer";case V:return(e._context.displayName||"Context")+".Provider";case O:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case q:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}function X(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 ue(t);case 8:return t===k?"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 j(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function se(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function te(e){var t=se(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),a=""+e[t];if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var m=s.get,x=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return m.call(this)},set:function(F){a=""+F,x.call(this,F)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(F){a=""+F},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ce(e){e._valueTracker||(e._valueTracker=te(e))}function _e(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),a="";return e&&(a=se(e)?e.checked?"true":"false":e.value),e=a,e!==s?(t.setValue(e),!0):!1}function Le(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 ke(e,t){var s=t.checked;return I({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function Ie(e,t){var s=t.defaultValue==null?"":t.defaultValue,a=t.checked!=null?t.checked:t.defaultChecked;s=j(t.value!=null?t.value:s),e._wrapperState={initialChecked:a,initialValue:s,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ne(e,t){t=t.checked,t!=null&&u(e,"checked",t,!1)}function ge(e,t){Ne(e,t);var s=j(t.value),a=t.type;if(s!=null)a==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(a==="submit"||a==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?kt(e,t.type,s):t.hasOwnProperty("defaultValue")&&kt(e,t.type,j(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Xe(e,t,s){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var a=t.type;if(!(a!=="submit"&&a!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,s||t===e.value||(e.value=t),e.defaultValue=t}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function kt(e,t,s){(t!=="number"||Le(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var yt=Array.isArray;function Je(e,t,s,a){if(e=e.options,t){t={};for(var m=0;m<s.length;m++)t["$"+s[m]]=!0;for(s=0;s<e.length;s++)m=t.hasOwnProperty("$"+e[s].value),e[s].selected!==m&&(e[s].selected=m),m&&a&&(e[s].defaultSelected=!0)}else{for(s=""+j(s),t=null,m=0;m<e.length;m++){if(e[m].value===s){e[m].selected=!0,a&&(e[m].defaultSelected=!0);return}t!==null||e[m].disabled||(t=e[m])}t!==null&&(t.selected=!0)}}function Qe(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(n(91));return I({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ze(e,t){var s=t.value;if(s==null){if(s=t.children,t=t.defaultValue,s!=null){if(t!=null)throw Error(n(92));if(yt(s)){if(1<s.length)throw Error(n(93));s=s[0]}t=s}t==null&&(t=""),s=t}e._wrapperState={initialValue:j(s)}}function Vt(e,t){var s=j(t.value),a=j(t.defaultValue);s!=null&&(s=""+s,s!==e.value&&(e.value=s),t.defaultValue==null&&e.defaultValue!==s&&(e.defaultValue=s)),a!=null&&(e.defaultValue=""+a)}function wt(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function at(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 St(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?at(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ft,or=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,s,a,m){MSApp.execUnsafeLocalFunction(function(){return e(t,s,a,m)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ft=ft||document.createElement("div"),ft.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ft.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ct(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var Ot={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},ze=["Webkit","ms","Moz","O"];Object.keys(Ot).forEach(function(e){ze.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ot[t]=Ot[e]})});function Br(e,t,s){return t==null||typeof t=="boolean"||t===""?"":s||typeof t!="number"||t===0||Ot.hasOwnProperty(e)&&Ot[e]?(""+t).trim():t+"px"}function Se(e,t){e=e.style;for(var s in t)if(t.hasOwnProperty(s)){var a=s.indexOf("--")===0,m=Br(s,t[s],a);s==="float"&&(s="cssFloat"),a?e.setProperty(s,m):e[s]=m}}var Re=I({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 Ke(e,t){if(t){if(Re[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(n(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(n(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(n(61))}if(t.style!=null&&typeof t.style!="object")throw Error(n(62))}}function Ge(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 Tt=null;function He(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pt=null,Ye=null,oe=null;function he(e){if(e=nn(e)){if(typeof pt!="function")throw Error(n(280));var t=e.stateNode;t&&(t=so(t),pt(e.stateNode,e.type,t))}}function Ce(e){Ye?oe?oe.push(e):oe=[e]:Ye=e}function De(){if(Ye){var e=Ye,t=oe;if(oe=Ye=null,he(e),t)for(e=0;e<t.length;e++)he(t[e])}}function Ue(e,t){return e(t)}function We(){}var ar=!1;function xt(e,t,s){if(ar)return e(t,s);ar=!0;try{return Ue(e,t,s)}finally{ar=!1,(Ye!==null||oe!==null)&&(We(),De())}}function _t(e,t){var s=e.stateNode;if(s===null)return null;var a=so(s);if(a===null)return null;s=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(n(231,t,typeof s));return s}var et=!1;if(o)try{var Be={};Object.defineProperty(Be,"passive",{get:function(){et=!0}}),window.addEventListener("test",Be,Be),window.removeEventListener("test",Be,Be)}catch{et=!1}function ht(e,t,s,a,m,x,F,G,Q){var ne=Array.prototype.slice.call(arguments,3);try{t.apply(s,ne)}catch(fe){this.onError(fe)}}var rt=!1,di=null,lr=!1,fi=null,Fs={onError:function(e){rt=!0,di=e}};function fa(e,t,s,a,m,x,F,G,Q){rt=!1,di=null,ht.apply(Fs,arguments)}function pa(e,t,s,a,m,x,F,G,Q){if(fa.apply(this,arguments),rt){if(rt){var ne=di;rt=!1,di=null}else throw Error(n(198));lr||(lr=!0,fi=ne)}}function Jr(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function On(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 Nn(e){if(Jr(e)!==e)throw Error(n(188))}function _a(e){var t=e.alternate;if(!t){if(t=Jr(e),t===null)throw Error(n(188));return t!==e?null:e}for(var s=e,a=t;;){var m=s.return;if(m===null)break;var x=m.alternate;if(x===null){if(a=m.return,a!==null){s=a;continue}break}if(m.child===x.child){for(x=m.child;x;){if(x===s)return Nn(m),e;if(x===a)return Nn(m),t;x=x.sibling}throw Error(n(188))}if(s.return!==a.return)s=m,a=x;else{for(var F=!1,G=m.child;G;){if(G===s){F=!0,s=m,a=x;break}if(G===a){F=!0,a=m,s=x;break}G=G.sibling}if(!F){for(G=x.child;G;){if(G===s){F=!0,s=x,a=m;break}if(G===a){F=!0,a=x,s=m;break}G=G.sibling}if(!F)throw Error(n(189))}}if(s.alternate!==a)throw Error(n(190))}if(s.tag!==3)throw Error(n(188));return s.stateNode.current===s?e:t}function In(e){return e=_a(e),e!==null?jn(e):null}function jn(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=jn(e);if(t!==null)return t;e=e.sibling}return null}var Fn=i.unstable_scheduleCallback,Hn=i.unstable_cancelCallback,va=i.unstable_shouldYield,ga=i.unstable_requestPaint,lt=i.unstable_now,ma=i.unstable_getCurrentPriorityLevel,Hs=i.unstable_ImmediatePriority,$n=i.unstable_UserBlockingPriority,ji=i.unstable_NormalPriority,ya=i.unstable_LowPriority,zn=i.unstable_IdlePriority,is=null,Cr=null;function wa(e){if(Cr&&typeof Cr.onCommitFiberRoot=="function")try{Cr.onCommitFiberRoot(is,e,void 0,(e.current.flags&128)===128)}catch{}}var vr=Math.clz32?Math.clz32:xa,Sa=Math.log,Ca=Math.LN2;function xa(e){return e>>>=0,e===0?32:31-(Sa(e)/Ca|0)|0}var ss=64,ns=4194304;function Fi(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 os(e,t){var s=e.pendingLanes;if(s===0)return 0;var a=0,m=e.suspendedLanes,x=e.pingedLanes,F=s&268435455;if(F!==0){var G=F&~m;G!==0?a=Fi(G):(x&=F,x!==0&&(a=Fi(x)))}else F=s&~m,F!==0?a=Fi(F):x!==0&&(a=Fi(x));if(a===0)return 0;if(t!==0&&t!==a&&(t&m)===0&&(m=a&-a,x=t&-t,m>=x||m===16&&(x&4194240)!==0))return t;if((a&4)!==0&&(a|=s&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=a;0<t;)s=31-vr(t),m=1<<s,a|=e[s],t&=~m;return a}function le(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 me(e,t){for(var s=e.suspendedLanes,a=e.pingedLanes,m=e.expirationTimes,x=e.pendingLanes;0<x;){var F=31-vr(x),G=1<<F,Q=m[F];Q===-1?((G&s)===0||(G&a)!==0)&&(m[F]=le(G,t)):Q<=t&&(e.expiredLanes|=G),x&=~G}}function Pe(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Fe(){var e=ss;return ss<<=1,(ss&4194240)===0&&(ss=64),e}function xr(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function zr(e,t,s){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-vr(t),e[t]=s}function $s(e,t){var s=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 a=e.eventTimes;for(e=e.expirationTimes;0<s;){var m=31-vr(s),x=1<<m;t[m]=0,a[m]=-1,e[m]=-1,s&=~x}}function Ur(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var a=31-vr(s),m=1<<a;m&t|e[a]&t&&(e[a]|=t),s&=~m}}var qe=0;function Zc(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var eh,ba,th,rh,ih,Ea=!1,Un=[],pi=null,_i=null,vi=null,zs=new Map,Us=new Map,gi=[],Qp="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 sh(e,t){switch(e){case"focusin":case"focusout":pi=null;break;case"dragenter":case"dragleave":_i=null;break;case"mouseover":case"mouseout":vi=null;break;case"pointerover":case"pointerout":zs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Us.delete(t.pointerId)}}function Ws(e,t,s,a,m,x){return e===null||e.nativeEvent!==x?(e={blockedOn:t,domEventName:s,eventSystemFlags:a,nativeEvent:x,targetContainers:[m]},t!==null&&(t=nn(t),t!==null&&ba(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,m!==null&&t.indexOf(m)===-1&&t.push(m),e)}function Zp(e,t,s,a,m){switch(t){case"focusin":return pi=Ws(pi,e,t,s,a,m),!0;case"dragenter":return _i=Ws(_i,e,t,s,a,m),!0;case"mouseover":return vi=Ws(vi,e,t,s,a,m),!0;case"pointerover":var x=m.pointerId;return zs.set(x,Ws(zs.get(x)||null,e,t,s,a,m)),!0;case"gotpointercapture":return x=m.pointerId,Us.set(x,Ws(Us.get(x)||null,e,t,s,a,m)),!0}return!1}function nh(e){var t=Hi(e.target);if(t!==null){var s=Jr(t);if(s!==null){if(t=s.tag,t===13){if(t=On(s),t!==null){e.blockedOn=t,ih(e.priority,function(){th(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Wn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=La(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(s===null){s=e.nativeEvent;var a=new s.constructor(s.type,s);Tt=a,s.target.dispatchEvent(a),Tt=null}else return t=nn(s),t!==null&&ba(t),e.blockedOn=s,!1;t.shift()}return!0}function oh(e,t,s){Wn(e)&&s.delete(t)}function e_(){Ea=!1,pi!==null&&Wn(pi)&&(pi=null),_i!==null&&Wn(_i)&&(_i=null),vi!==null&&Wn(vi)&&(vi=null),zs.forEach(oh),Us.forEach(oh)}function Vs(e,t){e.blockedOn===t&&(e.blockedOn=null,Ea||(Ea=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,e_)))}function Ks(e){function t(m){return Vs(m,e)}if(0<Un.length){Vs(Un[0],e);for(var s=1;s<Un.length;s++){var a=Un[s];a.blockedOn===e&&(a.blockedOn=null)}}for(pi!==null&&Vs(pi,e),_i!==null&&Vs(_i,e),vi!==null&&Vs(vi,e),zs.forEach(t),Us.forEach(t),s=0;s<gi.length;s++)a=gi[s],a.blockedOn===e&&(a.blockedOn=null);for(;0<gi.length&&(s=gi[0],s.blockedOn===null);)nh(s),s.blockedOn===null&&gi.shift()}var as=g.ReactCurrentBatchConfig,Vn=!0;function t_(e,t,s,a){var m=qe,x=as.transition;as.transition=null;try{qe=1,ka(e,t,s,a)}finally{qe=m,as.transition=x}}function r_(e,t,s,a){var m=qe,x=as.transition;as.transition=null;try{qe=4,ka(e,t,s,a)}finally{qe=m,as.transition=x}}function ka(e,t,s,a){if(Vn){var m=La(e,t,s,a);if(m===null)Wa(e,t,a,Kn,s),sh(e,a);else if(Zp(m,e,t,s,a))a.stopPropagation();else if(sh(e,a),t&4&&-1<Qp.indexOf(e)){for(;m!==null;){var x=nn(m);if(x!==null&&eh(x),x=La(e,t,s,a),x===null&&Wa(e,t,a,Kn,s),x===m)break;m=x}m!==null&&a.stopPropagation()}else Wa(e,t,a,null,s)}}var Kn=null;function La(e,t,s,a){if(Kn=null,e=He(a),e=Hi(e),e!==null)if(t=Jr(e),t===null)e=null;else if(s=t.tag,s===13){if(e=On(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Kn=e,null}function ah(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(ma()){case Hs:return 1;case $n:return 4;case ji:case ya:return 16;case zn:return 536870912;default:return 16}default:return 16}}var mi=null,Ra=null,qn=null;function lh(){if(qn)return qn;var e,t=Ra,s=t.length,a,m="value"in mi?mi.value:mi.textContent,x=m.length;for(e=0;e<s&&t[e]===m[e];e++);var F=s-e;for(a=1;a<=F&&t[s-a]===m[x-a];a++);return qn=m.slice(e,1<a?1-a:void 0)}function Gn(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 Yn(){return!0}function ch(){return!1}function gr(e){function t(s,a,m,x,F){this._reactName=s,this._targetInst=m,this.type=a,this.nativeEvent=x,this.target=F,this.currentTarget=null;for(var G in e)e.hasOwnProperty(G)&&(s=e[G],this[G]=s?s(x):x[G]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Yn:ch,this.isPropagationStopped=ch,this}return I(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Yn)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Yn)},persist:function(){},isPersistent:Yn}),t}var ls={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ta=gr(ls),qs=I({},ls,{view:0,detail:0}),i_=gr(qs),Ma,Da,Gs,Xn=I({},qs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ba,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!==Gs&&(Gs&&e.type==="mousemove"?(Ma=e.screenX-Gs.screenX,Da=e.screenY-Gs.screenY):Da=Ma=0,Gs=e),Ma)},movementY:function(e){return"movementY"in e?e.movementY:Da}}),hh=gr(Xn),s_=I({},Xn,{dataTransfer:0}),n_=gr(s_),o_=I({},qs,{relatedTarget:0}),Aa=gr(o_),a_=I({},ls,{animationName:0,elapsedTime:0,pseudoElement:0}),l_=gr(a_),c_=I({},ls,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),h_=gr(c_),u_=I({},ls,{data:0}),uh=gr(u_),d_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},f_={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"},p_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function __(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=p_[e])?!!t[e]:!1}function Ba(){return __}var v_=I({},qs,{key:function(e){if(e.key){var t=d_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Gn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?f_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ba,charCode:function(e){return e.type==="keypress"?Gn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Gn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),g_=gr(v_),m_=I({},Xn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dh=gr(m_),y_=I({},qs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ba}),w_=gr(y_),S_=I({},ls,{propertyName:0,elapsedTime:0,pseudoElement:0}),C_=gr(S_),x_=I({},Xn,{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_=gr(x_),E_=[9,13,27,32],Pa=o&&"CompositionEvent"in window,Ys=null;o&&"documentMode"in document&&(Ys=document.documentMode);var k_=o&&"TextEvent"in window&&!Ys,fh=o&&(!Pa||Ys&&8<Ys&&11>=Ys),ph=" ",_h=!1;function vh(e,t){switch(e){case"keyup":return E_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cs=!1;function L_(e,t){switch(e){case"compositionend":return gh(t);case"keypress":return t.which!==32?null:(_h=!0,ph);case"textInput":return e=t.data,e===ph&&_h?null:e;default:return null}}function R_(e,t){if(cs)return e==="compositionend"||!Pa&&vh(e,t)?(e=lh(),qn=Ra=mi=null,cs=!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 fh&&t.locale!=="ko"?null:t.data;default:return null}}var T_={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 mh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!T_[e.type]:t==="textarea"}function yh(e,t,s,a){Ce(a),t=to(t,"onChange"),0<t.length&&(s=new Ta("onChange","change",null,s,a),e.push({event:s,listeners:t}))}var Xs=null,Js=null;function M_(e){Ih(e,0)}function Jn(e){var t=ps(e);if(_e(t))return e}function D_(e,t){if(e==="change")return t}var wh=!1;if(o){var Oa;if(o){var Na="oninput"in document;if(!Na){var Sh=document.createElement("div");Sh.setAttribute("oninput","return;"),Na=typeof Sh.oninput=="function"}Oa=Na}else Oa=!1;wh=Oa&&(!document.documentMode||9<document.documentMode)}function Ch(){Xs&&(Xs.detachEvent("onpropertychange",xh),Js=Xs=null)}function xh(e){if(e.propertyName==="value"&&Jn(Js)){var t=[];yh(t,Js,e,He(e)),xt(M_,t)}}function A_(e,t,s){e==="focusin"?(Ch(),Xs=t,Js=s,Xs.attachEvent("onpropertychange",xh)):e==="focusout"&&Ch()}function B_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Jn(Js)}function P_(e,t){if(e==="click")return Jn(t)}function O_(e,t){if(e==="input"||e==="change")return Jn(t)}function N_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pr=typeof Object.is=="function"?Object.is:N_;function Qs(e,t){if(Pr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),a=Object.keys(t);if(s.length!==a.length)return!1;for(a=0;a<s.length;a++){var m=s[a];if(!d.call(t,m)||!Pr(e[m],t[m]))return!1}return!0}function bh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Eh(e,t){var s=bh(e);e=0;for(var a;s;){if(s.nodeType===3){if(a=e+s.textContent.length,e<=t&&a>=t)return{node:s,offset:t-e};e=a}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=bh(s)}}function kh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lh(){for(var e=window,t=Le();t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Le(e.document)}return t}function Ia(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 I_(e){var t=Lh(),s=e.focusedElem,a=e.selectionRange;if(t!==s&&s&&s.ownerDocument&&kh(s.ownerDocument.documentElement,s)){if(a!==null&&Ia(s)){if(t=a.start,e=a.end,e===void 0&&(e=t),"selectionStart"in s)s.selectionStart=t,s.selectionEnd=Math.min(e,s.value.length);else if(e=(t=s.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var m=s.textContent.length,x=Math.min(a.start,m);a=a.end===void 0?x:Math.min(a.end,m),!e.extend&&x>a&&(m=a,a=x,x=m),m=Eh(s,x);var F=Eh(s,a);m&&F&&(e.rangeCount!==1||e.anchorNode!==m.node||e.anchorOffset!==m.offset||e.focusNode!==F.node||e.focusOffset!==F.offset)&&(t=t.createRange(),t.setStart(m.node,m.offset),e.removeAllRanges(),x>a?(e.addRange(t),e.extend(F.node,F.offset)):(t.setEnd(F.node,F.offset),e.addRange(t)))}}for(t=[],e=s;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<t.length;s++)e=t[s],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var j_=o&&"documentMode"in document&&11>=document.documentMode,hs=null,ja=null,Zs=null,Fa=!1;function Rh(e,t,s){var a=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Fa||hs==null||hs!==Le(a)||(a=hs,"selectionStart"in a&&Ia(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Zs&&Qs(Zs,a)||(Zs=a,a=to(ja,"onSelect"),0<a.length&&(t=new Ta("onSelect","select",null,t,s),e.push({event:t,listeners:a}),t.target=hs)))}function Qn(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var us={animationend:Qn("Animation","AnimationEnd"),animationiteration:Qn("Animation","AnimationIteration"),animationstart:Qn("Animation","AnimationStart"),transitionend:Qn("Transition","TransitionEnd")},Ha={},Th={};o&&(Th=document.createElement("div").style,"AnimationEvent"in window||(delete us.animationend.animation,delete us.animationiteration.animation,delete us.animationstart.animation),"TransitionEvent"in window||delete us.transitionend.transition);function Zn(e){if(Ha[e])return Ha[e];if(!us[e])return e;var t=us[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Th)return Ha[e]=t[s];return e}var Mh=Zn("animationend"),Dh=Zn("animationiteration"),Ah=Zn("animationstart"),Bh=Zn("transitionend"),Ph=new Map,Oh="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 yi(e,t){Ph.set(e,t),L(t,[e])}for(var $a=0;$a<Oh.length;$a++){var za=Oh[$a],F_=za.toLowerCase(),H_=za[0].toUpperCase()+za.slice(1);yi(F_,"on"+H_)}yi(Mh,"onAnimationEnd"),yi(Dh,"onAnimationIteration"),yi(Ah,"onAnimationStart"),yi("dblclick","onDoubleClick"),yi("focusin","onFocus"),yi("focusout","onBlur"),yi(Bh,"onTransitionEnd"),R("onMouseEnter",["mouseout","mouseover"]),R("onMouseLeave",["mouseout","mouseover"]),R("onPointerEnter",["pointerout","pointerover"]),R("onPointerLeave",["pointerout","pointerover"]),L("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),L("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),L("onBeforeInput",["compositionend","keypress","textInput","paste"]),L("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),L("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),L("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var en="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(" "),$_=new Set("cancel close invalid load scroll toggle".split(" ").concat(en));function Nh(e,t,s){var a=e.type||"unknown-event";e.currentTarget=s,pa(a,t,void 0,e),e.currentTarget=null}function Ih(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var a=e[s],m=a.event;a=a.listeners;e:{var x=void 0;if(t)for(var F=a.length-1;0<=F;F--){var G=a[F],Q=G.instance,ne=G.currentTarget;if(G=G.listener,Q!==x&&m.isPropagationStopped())break e;Nh(m,G,ne),x=Q}else for(F=0;F<a.length;F++){if(G=a[F],Q=G.instance,ne=G.currentTarget,G=G.listener,Q!==x&&m.isPropagationStopped())break e;Nh(m,G,ne),x=Q}}}if(lr)throw e=fi,lr=!1,fi=null,e}function it(e,t){var s=t[Xa];s===void 0&&(s=t[Xa]=new Set);var a=e+"__bubble";s.has(a)||(jh(t,e,2,!1),s.add(a))}function Ua(e,t,s){var a=0;t&&(a|=4),jh(s,e,a,t)}var eo="_reactListening"+Math.random().toString(36).slice(2);function tn(e){if(!e[eo]){e[eo]=!0,_.forEach(function(s){s!=="selectionchange"&&($_.has(s)||Ua(s,!1,e),Ua(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[eo]||(t[eo]=!0,Ua("selectionchange",!1,t))}}function jh(e,t,s,a){switch(ah(t)){case 1:var m=t_;break;case 4:m=r_;break;default:m=ka}s=m.bind(null,t,s,e),m=void 0,!et||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(m=!0),a?m!==void 0?e.addEventListener(t,s,{capture:!0,passive:m}):e.addEventListener(t,s,!0):m!==void 0?e.addEventListener(t,s,{passive:m}):e.addEventListener(t,s,!1)}function Wa(e,t,s,a,m){var x=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var F=a.tag;if(F===3||F===4){var G=a.stateNode.containerInfo;if(G===m||G.nodeType===8&&G.parentNode===m)break;if(F===4)for(F=a.return;F!==null;){var Q=F.tag;if((Q===3||Q===4)&&(Q=F.stateNode.containerInfo,Q===m||Q.nodeType===8&&Q.parentNode===m))return;F=F.return}for(;G!==null;){if(F=Hi(G),F===null)return;if(Q=F.tag,Q===5||Q===6){a=x=F;continue e}G=G.parentNode}}a=a.return}xt(function(){var ne=x,fe=He(s),pe=[];e:{var de=Ph.get(e);if(de!==void 0){var ye=Ta,xe=e;switch(e){case"keypress":if(Gn(s)===0)break e;case"keydown":case"keyup":ye=g_;break;case"focusin":xe="focus",ye=Aa;break;case"focusout":xe="blur",ye=Aa;break;case"beforeblur":case"afterblur":ye=Aa;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=hh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=n_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=w_;break;case Mh:case Dh:case Ah:ye=l_;break;case Bh:ye=C_;break;case"scroll":ye=i_;break;case"wheel":ye=b_;break;case"copy":case"cut":case"paste":ye=h_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=dh}var be=(t&4)!==0,bt=!be&&e==="scroll",ee=be?de!==null?de+"Capture":null:de;be=[];for(var Z=ne,re;Z!==null;){re=Z;var ve=re.stateNode;if(re.tag===5&&ve!==null&&(re=ve,ee!==null&&(ve=_t(Z,ee),ve!=null&&be.push(rn(Z,ve,re)))),bt)break;Z=Z.return}0<be.length&&(de=new ye(de,xe,null,s,fe),pe.push({event:de,listeners:be}))}}if((t&7)===0){e:{if(de=e==="mouseover"||e==="pointerover",ye=e==="mouseout"||e==="pointerout",de&&s!==Tt&&(xe=s.relatedTarget||s.fromElement)&&(Hi(xe)||xe[Qr]))break e;if((ye||de)&&(de=fe.window===fe?fe:(de=fe.ownerDocument)?de.defaultView||de.parentWindow:window,ye?(xe=s.relatedTarget||s.toElement,ye=ne,xe=xe?Hi(xe):null,xe!==null&&(bt=Jr(xe),xe!==bt||xe.tag!==5&&xe.tag!==6)&&(xe=null)):(ye=null,xe=ne),ye!==xe)){if(be=hh,ve="onMouseLeave",ee="onMouseEnter",Z="mouse",(e==="pointerout"||e==="pointerover")&&(be=dh,ve="onPointerLeave",ee="onPointerEnter",Z="pointer"),bt=ye==null?de:ps(ye),re=xe==null?de:ps(xe),de=new be(ve,Z+"leave",ye,s,fe),de.target=bt,de.relatedTarget=re,ve=null,Hi(fe)===ne&&(be=new be(ee,Z+"enter",xe,s,fe),be.target=re,be.relatedTarget=bt,ve=be),bt=ve,ye&&xe)t:{for(be=ye,ee=xe,Z=0,re=be;re;re=ds(re))Z++;for(re=0,ve=ee;ve;ve=ds(ve))re++;for(;0<Z-re;)be=ds(be),Z--;for(;0<re-Z;)ee=ds(ee),re--;for(;Z--;){if(be===ee||ee!==null&&be===ee.alternate)break t;be=ds(be),ee=ds(ee)}be=null}else be=null;ye!==null&&Fh(pe,de,ye,be,!1),xe!==null&&bt!==null&&Fh(pe,bt,xe,be,!0)}}e:{if(de=ne?ps(ne):window,ye=de.nodeName&&de.nodeName.toLowerCase(),ye==="select"||ye==="input"&&de.type==="file")var Ee=D_;else if(mh(de))if(wh)Ee=O_;else{Ee=B_;var Te=A_}else(ye=de.nodeName)&&ye.toLowerCase()==="input"&&(de.type==="checkbox"||de.type==="radio")&&(Ee=P_);if(Ee&&(Ee=Ee(e,ne))){yh(pe,Ee,s,fe);break e}Te&&Te(e,de,ne),e==="focusout"&&(Te=de._wrapperState)&&Te.controlled&&de.type==="number"&&kt(de,"number",de.value)}switch(Te=ne?ps(ne):window,e){case"focusin":(mh(Te)||Te.contentEditable==="true")&&(hs=Te,ja=ne,Zs=null);break;case"focusout":Zs=ja=hs=null;break;case"mousedown":Fa=!0;break;case"contextmenu":case"mouseup":case"dragend":Fa=!1,Rh(pe,s,fe);break;case"selectionchange":if(j_)break;case"keydown":case"keyup":Rh(pe,s,fe)}var Me;if(Pa)e:{switch(e){case"compositionstart":var Ae="onCompositionStart";break e;case"compositionend":Ae="onCompositionEnd";break e;case"compositionupdate":Ae="onCompositionUpdate";break e}Ae=void 0}else cs?vh(e,s)&&(Ae="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Ae="onCompositionStart");Ae&&(fh&&s.locale!=="ko"&&(cs||Ae!=="onCompositionStart"?Ae==="onCompositionEnd"&&cs&&(Me=lh()):(mi=fe,Ra="value"in mi?mi.value:mi.textContent,cs=!0)),Te=to(ne,Ae),0<Te.length&&(Ae=new uh(Ae,e,null,s,fe),pe.push({event:Ae,listeners:Te}),Me?Ae.data=Me:(Me=gh(s),Me!==null&&(Ae.data=Me)))),(Me=k_?L_(e,s):R_(e,s))&&(ne=to(ne,"onBeforeInput"),0<ne.length&&(fe=new uh("onBeforeInput","beforeinput",null,s,fe),pe.push({event:fe,listeners:ne}),fe.data=Me))}Ih(pe,t)})}function rn(e,t,s){return{instance:e,listener:t,currentTarget:s}}function to(e,t){for(var s=t+"Capture",a=[];e!==null;){var m=e,x=m.stateNode;m.tag===5&&x!==null&&(m=x,x=_t(e,s),x!=null&&a.unshift(rn(e,x,m)),x=_t(e,t),x!=null&&a.push(rn(e,x,m))),e=e.return}return a}function ds(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Fh(e,t,s,a,m){for(var x=t._reactName,F=[];s!==null&&s!==a;){var G=s,Q=G.alternate,ne=G.stateNode;if(Q!==null&&Q===a)break;G.tag===5&&ne!==null&&(G=ne,m?(Q=_t(s,x),Q!=null&&F.unshift(rn(s,Q,G))):m||(Q=_t(s,x),Q!=null&&F.push(rn(s,Q,G)))),s=s.return}F.length!==0&&e.push({event:t,listeners:F})}var z_=/\r\n?/g,U_=/\u0000|\uFFFD/g;function Hh(e){return(typeof e=="string"?e:""+e).replace(z_,`
38
+ `).replace(U_,"")}function ro(e,t,s){if(t=Hh(t),Hh(e)!==t&&s)throw Error(n(425))}function io(){}var Va=null,Ka=null;function qa(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 Ga=typeof setTimeout=="function"?setTimeout:void 0,W_=typeof clearTimeout=="function"?clearTimeout:void 0,$h=typeof Promise=="function"?Promise:void 0,V_=typeof queueMicrotask=="function"?queueMicrotask:typeof $h<"u"?function(e){return $h.resolve(null).then(e).catch(K_)}:Ga;function K_(e){setTimeout(function(){throw e})}function Ya(e,t){var s=t,a=0;do{var m=s.nextSibling;if(e.removeChild(s),m&&m.nodeType===8)if(s=m.data,s==="/$"){if(a===0){e.removeChild(m),Ks(t);return}a--}else s!=="$"&&s!=="$?"&&s!=="$!"||a++;s=m}while(s);Ks(t)}function wi(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 zh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"){if(t===0)return e;t--}else s==="/$"&&t++}e=e.previousSibling}return null}var fs=Math.random().toString(36).slice(2),Wr="__reactFiber$"+fs,sn="__reactProps$"+fs,Qr="__reactContainer$"+fs,Xa="__reactEvents$"+fs,q_="__reactListeners$"+fs,G_="__reactHandles$"+fs;function Hi(e){var t=e[Wr];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Qr]||s[Wr]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=zh(e);e!==null;){if(s=e[Wr])return s;e=zh(e)}return t}e=s,s=e.parentNode}return null}function nn(e){return e=e[Wr]||e[Qr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ps(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(n(33))}function so(e){return e[sn]||null}var Ja=[],_s=-1;function Si(e){return{current:e}}function st(e){0>_s||(e.current=Ja[_s],Ja[_s]=null,_s--)}function tt(e,t){_s++,Ja[_s]=e.current,e.current=t}var Ci={},Jt=Si(Ci),cr=Si(!1),$i=Ci;function vs(e,t){var s=e.type.contextTypes;if(!s)return Ci;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===t)return a.__reactInternalMemoizedMaskedChildContext;var m={},x;for(x in s)m[x]=t[x];return a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=m),m}function hr(e){return e=e.childContextTypes,e!=null}function no(){st(cr),st(Jt)}function Uh(e,t,s){if(Jt.current!==Ci)throw Error(n(168));tt(Jt,t),tt(cr,s)}function Wh(e,t,s){var a=e.stateNode;if(t=t.childContextTypes,typeof a.getChildContext!="function")return s;a=a.getChildContext();for(var m in a)if(!(m in t))throw Error(n(108,X(e)||"Unknown",m));return I({},s,a)}function oo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ci,$i=Jt.current,tt(Jt,e),tt(cr,cr.current),!0}function Vh(e,t,s){var a=e.stateNode;if(!a)throw Error(n(169));s?(e=Wh(e,t,$i),a.__reactInternalMemoizedMergedChildContext=e,st(cr),st(Jt),tt(Jt,e)):st(cr),tt(cr,s)}var Zr=null,ao=!1,Qa=!1;function Kh(e){Zr===null?Zr=[e]:Zr.push(e)}function Y_(e){ao=!0,Kh(e)}function xi(){if(!Qa&&Zr!==null){Qa=!0;var e=0,t=qe;try{var s=Zr;for(qe=1;e<s.length;e++){var a=s[e];do a=a(!0);while(a!==null)}Zr=null,ao=!1}catch(m){throw Zr!==null&&(Zr=Zr.slice(e+1)),Fn(Hs,xi),m}finally{qe=t,Qa=!1}}return null}var gs=[],ms=0,lo=null,co=0,br=[],Er=0,zi=null,ei=1,ti="";function Ui(e,t){gs[ms++]=co,gs[ms++]=lo,lo=e,co=t}function qh(e,t,s){br[Er++]=ei,br[Er++]=ti,br[Er++]=zi,zi=e;var a=ei;e=ti;var m=32-vr(a)-1;a&=~(1<<m),s+=1;var x=32-vr(t)+m;if(30<x){var F=m-m%5;x=(a&(1<<F)-1).toString(32),a>>=F,m-=F,ei=1<<32-vr(t)+m|s<<m|a,ti=x+e}else ei=1<<x|s<<m|a,ti=e}function Za(e){e.return!==null&&(Ui(e,1),qh(e,1,0))}function el(e){for(;e===lo;)lo=gs[--ms],gs[ms]=null,co=gs[--ms],gs[ms]=null;for(;e===zi;)zi=br[--Er],br[Er]=null,ti=br[--Er],br[Er]=null,ei=br[--Er],br[Er]=null}var mr=null,yr=null,ct=!1,Or=null;function Gh(e,t){var s=Tr(5,null,null,0);s.elementType="DELETED",s.stateNode=t,s.return=e,t=e.deletions,t===null?(e.deletions=[s],e.flags|=16):t.push(s)}function Yh(e,t){switch(e.tag){case 5:var s=e.type;return t=t.nodeType!==1||s.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,mr=e,yr=wi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,mr=e,yr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(s=zi!==null?{id:ei,overflow:ti}:null,e.memoizedState={dehydrated:t,treeContext:s,retryLane:1073741824},s=Tr(18,null,null,0),s.stateNode=t,s.return=e,e.child=s,mr=e,yr=null,!0):!1;default:return!1}}function tl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function rl(e){if(ct){var t=yr;if(t){var s=t;if(!Yh(e,t)){if(tl(e))throw Error(n(418));t=wi(s.nextSibling);var a=mr;t&&Yh(e,t)?Gh(a,s):(e.flags=e.flags&-4097|2,ct=!1,mr=e)}}else{if(tl(e))throw Error(n(418));e.flags=e.flags&-4097|2,ct=!1,mr=e}}}function Xh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;mr=e}function ho(e){if(e!==mr)return!1;if(!ct)return Xh(e),ct=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!qa(e.type,e.memoizedProps)),t&&(t=yr)){if(tl(e))throw Jh(),Error(n(418));for(;t;)Gh(e,t),t=wi(t.nextSibling)}if(Xh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(n(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"){if(t===0){yr=wi(e.nextSibling);break e}t--}else s!=="$"&&s!=="$!"&&s!=="$?"||t++}e=e.nextSibling}yr=null}}else yr=mr?wi(e.stateNode.nextSibling):null;return!0}function Jh(){for(var e=yr;e;)e=wi(e.nextSibling)}function ys(){yr=mr=null,ct=!1}function il(e){Or===null?Or=[e]:Or.push(e)}var X_=g.ReactCurrentBatchConfig;function on(e,t,s){if(e=s.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(n(309));var a=s.stateNode}if(!a)throw Error(n(147,e));var m=a,x=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===x?t.ref:(t=function(F){var G=m.refs;F===null?delete G[x]:G[x]=F},t._stringRef=x,t)}if(typeof e!="string")throw Error(n(284));if(!s._owner)throw Error(n(290,e))}return e}function uo(e,t){throw e=Object.prototype.toString.call(t),Error(n(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Qh(e){var t=e._init;return t(e._payload)}function Zh(e){function t(ee,Z){if(e){var re=ee.deletions;re===null?(ee.deletions=[Z],ee.flags|=16):re.push(Z)}}function s(ee,Z){if(!e)return null;for(;Z!==null;)t(ee,Z),Z=Z.sibling;return null}function a(ee,Z){for(ee=new Map;Z!==null;)Z.key!==null?ee.set(Z.key,Z):ee.set(Z.index,Z),Z=Z.sibling;return ee}function m(ee,Z){return ee=Di(ee,Z),ee.index=0,ee.sibling=null,ee}function x(ee,Z,re){return ee.index=re,e?(re=ee.alternate,re!==null?(re=re.index,re<Z?(ee.flags|=2,Z):re):(ee.flags|=2,Z)):(ee.flags|=1048576,Z)}function F(ee){return e&&ee.alternate===null&&(ee.flags|=2),ee}function G(ee,Z,re,ve){return Z===null||Z.tag!==6?(Z=Gl(re,ee.mode,ve),Z.return=ee,Z):(Z=m(Z,re),Z.return=ee,Z)}function Q(ee,Z,re,ve){var Ee=re.type;return Ee===T?fe(ee,Z,re.props.children,ve,re.key):Z!==null&&(Z.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===q&&Qh(Ee)===Z.type)?(ve=m(Z,re.props),ve.ref=on(ee,Z,re),ve.return=ee,ve):(ve=No(re.type,re.key,re.props,null,ee.mode,ve),ve.ref=on(ee,Z,re),ve.return=ee,ve)}function ne(ee,Z,re,ve){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==re.containerInfo||Z.stateNode.implementation!==re.implementation?(Z=Yl(re,ee.mode,ve),Z.return=ee,Z):(Z=m(Z,re.children||[]),Z.return=ee,Z)}function fe(ee,Z,re,ve,Ee){return Z===null||Z.tag!==7?(Z=Ji(re,ee.mode,ve,Ee),Z.return=ee,Z):(Z=m(Z,re),Z.return=ee,Z)}function pe(ee,Z,re){if(typeof Z=="string"&&Z!==""||typeof Z=="number")return Z=Gl(""+Z,ee.mode,re),Z.return=ee,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case S:return re=No(Z.type,Z.key,Z.props,null,ee.mode,re),re.ref=on(ee,null,Z),re.return=ee,re;case E:return Z=Yl(Z,ee.mode,re),Z.return=ee,Z;case q:var ve=Z._init;return pe(ee,ve(Z._payload),re)}if(yt(Z)||A(Z))return Z=Ji(Z,ee.mode,re,null),Z.return=ee,Z;uo(ee,Z)}return null}function de(ee,Z,re,ve){var Ee=Z!==null?Z.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return Ee!==null?null:G(ee,Z,""+re,ve);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case S:return re.key===Ee?Q(ee,Z,re,ve):null;case E:return re.key===Ee?ne(ee,Z,re,ve):null;case q:return Ee=re._init,de(ee,Z,Ee(re._payload),ve)}if(yt(re)||A(re))return Ee!==null?null:fe(ee,Z,re,ve,null);uo(ee,re)}return null}function ye(ee,Z,re,ve,Ee){if(typeof ve=="string"&&ve!==""||typeof ve=="number")return ee=ee.get(re)||null,G(Z,ee,""+ve,Ee);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case S:return ee=ee.get(ve.key===null?re:ve.key)||null,Q(Z,ee,ve,Ee);case E:return ee=ee.get(ve.key===null?re:ve.key)||null,ne(Z,ee,ve,Ee);case q:var Te=ve._init;return ye(ee,Z,re,Te(ve._payload),Ee)}if(yt(ve)||A(ve))return ee=ee.get(re)||null,fe(Z,ee,ve,Ee,null);uo(Z,ve)}return null}function xe(ee,Z,re,ve){for(var Ee=null,Te=null,Me=Z,Ae=Z=0,jt=null;Me!==null&&Ae<re.length;Ae++){Me.index>Ae?(jt=Me,Me=null):jt=Me.sibling;var Ve=de(ee,Me,re[Ae],ve);if(Ve===null){Me===null&&(Me=jt);break}e&&Me&&Ve.alternate===null&&t(ee,Me),Z=x(Ve,Z,Ae),Te===null?Ee=Ve:Te.sibling=Ve,Te=Ve,Me=jt}if(Ae===re.length)return s(ee,Me),ct&&Ui(ee,Ae),Ee;if(Me===null){for(;Ae<re.length;Ae++)Me=pe(ee,re[Ae],ve),Me!==null&&(Z=x(Me,Z,Ae),Te===null?Ee=Me:Te.sibling=Me,Te=Me);return ct&&Ui(ee,Ae),Ee}for(Me=a(ee,Me);Ae<re.length;Ae++)jt=ye(Me,ee,Ae,re[Ae],ve),jt!==null&&(e&&jt.alternate!==null&&Me.delete(jt.key===null?Ae:jt.key),Z=x(jt,Z,Ae),Te===null?Ee=jt:Te.sibling=jt,Te=jt);return e&&Me.forEach(function(Ai){return t(ee,Ai)}),ct&&Ui(ee,Ae),Ee}function be(ee,Z,re,ve){var Ee=A(re);if(typeof Ee!="function")throw Error(n(150));if(re=Ee.call(re),re==null)throw Error(n(151));for(var Te=Ee=null,Me=Z,Ae=Z=0,jt=null,Ve=re.next();Me!==null&&!Ve.done;Ae++,Ve=re.next()){Me.index>Ae?(jt=Me,Me=null):jt=Me.sibling;var Ai=de(ee,Me,Ve.value,ve);if(Ai===null){Me===null&&(Me=jt);break}e&&Me&&Ai.alternate===null&&t(ee,Me),Z=x(Ai,Z,Ae),Te===null?Ee=Ai:Te.sibling=Ai,Te=Ai,Me=jt}if(Ve.done)return s(ee,Me),ct&&Ui(ee,Ae),Ee;if(Me===null){for(;!Ve.done;Ae++,Ve=re.next())Ve=pe(ee,Ve.value,ve),Ve!==null&&(Z=x(Ve,Z,Ae),Te===null?Ee=Ve:Te.sibling=Ve,Te=Ve);return ct&&Ui(ee,Ae),Ee}for(Me=a(ee,Me);!Ve.done;Ae++,Ve=re.next())Ve=ye(Me,ee,Ae,Ve.value,ve),Ve!==null&&(e&&Ve.alternate!==null&&Me.delete(Ve.key===null?Ae:Ve.key),Z=x(Ve,Z,Ae),Te===null?Ee=Ve:Te.sibling=Ve,Te=Ve);return e&&Me.forEach(function(Tv){return t(ee,Tv)}),ct&&Ui(ee,Ae),Ee}function bt(ee,Z,re,ve){if(typeof re=="object"&&re!==null&&re.type===T&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case S:e:{for(var Ee=re.key,Te=Z;Te!==null;){if(Te.key===Ee){if(Ee=re.type,Ee===T){if(Te.tag===7){s(ee,Te.sibling),Z=m(Te,re.props.children),Z.return=ee,ee=Z;break e}}else if(Te.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===q&&Qh(Ee)===Te.type){s(ee,Te.sibling),Z=m(Te,re.props),Z.ref=on(ee,Te,re),Z.return=ee,ee=Z;break e}s(ee,Te);break}else t(ee,Te);Te=Te.sibling}re.type===T?(Z=Ji(re.props.children,ee.mode,ve,re.key),Z.return=ee,ee=Z):(ve=No(re.type,re.key,re.props,null,ee.mode,ve),ve.ref=on(ee,Z,re),ve.return=ee,ee=ve)}return F(ee);case E:e:{for(Te=re.key;Z!==null;){if(Z.key===Te)if(Z.tag===4&&Z.stateNode.containerInfo===re.containerInfo&&Z.stateNode.implementation===re.implementation){s(ee,Z.sibling),Z=m(Z,re.children||[]),Z.return=ee,ee=Z;break e}else{s(ee,Z);break}else t(ee,Z);Z=Z.sibling}Z=Yl(re,ee.mode,ve),Z.return=ee,ee=Z}return F(ee);case q:return Te=re._init,bt(ee,Z,Te(re._payload),ve)}if(yt(re))return xe(ee,Z,re,ve);if(A(re))return be(ee,Z,re,ve);uo(ee,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,Z!==null&&Z.tag===6?(s(ee,Z.sibling),Z=m(Z,re),Z.return=ee,ee=Z):(s(ee,Z),Z=Gl(re,ee.mode,ve),Z.return=ee,ee=Z),F(ee)):s(ee,Z)}return bt}var ws=Zh(!0),eu=Zh(!1),fo=Si(null),po=null,Ss=null,sl=null;function nl(){sl=Ss=po=null}function ol(e){var t=fo.current;st(fo),e._currentValue=t}function al(e,t,s){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===s)break;e=e.return}}function Cs(e,t){po=e,sl=Ss=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(ur=!0),e.firstContext=null)}function kr(e){var t=e._currentValue;if(sl!==e)if(e={context:e,memoizedValue:t,next:null},Ss===null){if(po===null)throw Error(n(308));Ss=e,po.dependencies={lanes:0,firstContext:e}}else Ss=Ss.next=e;return t}var Wi=null;function ll(e){Wi===null?Wi=[e]:Wi.push(e)}function tu(e,t,s,a){var m=t.interleaved;return m===null?(s.next=s,ll(t)):(s.next=m.next,m.next=s),t.interleaved=s,ri(e,a)}function ri(e,t){e.lanes|=t;var s=e.alternate;for(s!==null&&(s.lanes|=t),s=e,e=e.return;e!==null;)e.childLanes|=t,s=e.alternate,s!==null&&(s.childLanes|=t),s=e,e=e.return;return s.tag===3?s.stateNode:null}var bi=!1;function cl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ru(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 ii(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ei(e,t,s){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,($e&2)!==0){var m=a.pending;return m===null?t.next=t:(t.next=m.next,m.next=t),a.pending=t,ri(e,s)}return m=a.interleaved,m===null?(t.next=t,ll(a)):(t.next=m.next,m.next=t),a.interleaved=t,ri(e,s)}function _o(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194240)!==0)){var a=t.lanes;a&=e.pendingLanes,s|=a,t.lanes=s,Ur(e,s)}}function iu(e,t){var s=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,s===a)){var m=null,x=null;if(s=s.firstBaseUpdate,s!==null){do{var F={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};x===null?m=x=F:x=x.next=F,s=s.next}while(s!==null);x===null?m=x=t:x=x.next=t}else m=x=t;s={baseState:a.baseState,firstBaseUpdate:m,lastBaseUpdate:x,shared:a.shared,effects:a.effects},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}function vo(e,t,s,a){var m=e.updateQueue;bi=!1;var x=m.firstBaseUpdate,F=m.lastBaseUpdate,G=m.shared.pending;if(G!==null){m.shared.pending=null;var Q=G,ne=Q.next;Q.next=null,F===null?x=ne:F.next=ne,F=Q;var fe=e.alternate;fe!==null&&(fe=fe.updateQueue,G=fe.lastBaseUpdate,G!==F&&(G===null?fe.firstBaseUpdate=ne:G.next=ne,fe.lastBaseUpdate=Q))}if(x!==null){var pe=m.baseState;F=0,fe=ne=Q=null,G=x;do{var de=G.lane,ye=G.eventTime;if((a&de)===de){fe!==null&&(fe=fe.next={eventTime:ye,lane:0,tag:G.tag,payload:G.payload,callback:G.callback,next:null});e:{var xe=e,be=G;switch(de=t,ye=s,be.tag){case 1:if(xe=be.payload,typeof xe=="function"){pe=xe.call(ye,pe,de);break e}pe=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=be.payload,de=typeof xe=="function"?xe.call(ye,pe,de):xe,de==null)break e;pe=I({},pe,de);break e;case 2:bi=!0}}G.callback!==null&&G.lane!==0&&(e.flags|=64,de=m.effects,de===null?m.effects=[G]:de.push(G))}else ye={eventTime:ye,lane:de,tag:G.tag,payload:G.payload,callback:G.callback,next:null},fe===null?(ne=fe=ye,Q=pe):fe=fe.next=ye,F|=de;if(G=G.next,G===null){if(G=m.shared.pending,G===null)break;de=G,G=de.next,de.next=null,m.lastBaseUpdate=de,m.shared.pending=null}}while(!0);if(fe===null&&(Q=pe),m.baseState=Q,m.firstBaseUpdate=ne,m.lastBaseUpdate=fe,t=m.shared.interleaved,t!==null){m=t;do F|=m.lane,m=m.next;while(m!==t)}else x===null&&(m.shared.lanes=0);qi|=F,e.lanes=F,e.memoizedState=pe}}function su(e,t,s){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var a=e[t],m=a.callback;if(m!==null){if(a.callback=null,a=s,typeof m!="function")throw Error(n(191,m));m.call(a)}}}var an={},Vr=Si(an),ln=Si(an),cn=Si(an);function Vi(e){if(e===an)throw Error(n(174));return e}function hl(e,t){switch(tt(cn,t),tt(ln,e),tt(Vr,an),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:St(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=St(t,e)}st(Vr),tt(Vr,t)}function xs(){st(Vr),st(ln),st(cn)}function nu(e){Vi(cn.current);var t=Vi(Vr.current),s=St(t,e.type);t!==s&&(tt(ln,e),tt(Vr,s))}function ul(e){ln.current===e&&(st(Vr),st(ln))}var ut=Si(0);function go(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var dl=[];function fl(){for(var e=0;e<dl.length;e++)dl[e]._workInProgressVersionPrimary=null;dl.length=0}var mo=g.ReactCurrentDispatcher,pl=g.ReactCurrentBatchConfig,Ki=0,dt=null,Mt=null,Nt=null,yo=!1,hn=!1,un=0,J_=0;function Qt(){throw Error(n(321))}function _l(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!Pr(e[s],t[s]))return!1;return!0}function vl(e,t,s,a,m,x){if(Ki=x,dt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,mo.current=e===null||e.memoizedState===null?tv:rv,e=s(a,m),hn){x=0;do{if(hn=!1,un=0,25<=x)throw Error(n(301));x+=1,Nt=Mt=null,t.updateQueue=null,mo.current=iv,e=s(a,m)}while(hn)}if(mo.current=Co,t=Mt!==null&&Mt.next!==null,Ki=0,Nt=Mt=dt=null,yo=!1,t)throw Error(n(300));return e}function gl(){var e=un!==0;return un=0,e}function Kr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?dt.memoizedState=Nt=e:Nt=Nt.next=e,Nt}function Lr(){if(Mt===null){var e=dt.alternate;e=e!==null?e.memoizedState:null}else e=Mt.next;var t=Nt===null?dt.memoizedState:Nt.next;if(t!==null)Nt=t,Mt=e;else{if(e===null)throw Error(n(310));Mt=e,e={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},Nt===null?dt.memoizedState=Nt=e:Nt=Nt.next=e}return Nt}function dn(e,t){return typeof t=="function"?t(e):t}function ml(e){var t=Lr(),s=t.queue;if(s===null)throw Error(n(311));s.lastRenderedReducer=e;var a=Mt,m=a.baseQueue,x=s.pending;if(x!==null){if(m!==null){var F=m.next;m.next=x.next,x.next=F}a.baseQueue=m=x,s.pending=null}if(m!==null){x=m.next,a=a.baseState;var G=F=null,Q=null,ne=x;do{var fe=ne.lane;if((Ki&fe)===fe)Q!==null&&(Q=Q.next={lane:0,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),a=ne.hasEagerState?ne.eagerState:e(a,ne.action);else{var pe={lane:fe,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null};Q===null?(G=Q=pe,F=a):Q=Q.next=pe,dt.lanes|=fe,qi|=fe}ne=ne.next}while(ne!==null&&ne!==x);Q===null?F=a:Q.next=G,Pr(a,t.memoizedState)||(ur=!0),t.memoizedState=a,t.baseState=F,t.baseQueue=Q,s.lastRenderedState=a}if(e=s.interleaved,e!==null){m=e;do x=m.lane,dt.lanes|=x,qi|=x,m=m.next;while(m!==e)}else m===null&&(s.lanes=0);return[t.memoizedState,s.dispatch]}function yl(e){var t=Lr(),s=t.queue;if(s===null)throw Error(n(311));s.lastRenderedReducer=e;var a=s.dispatch,m=s.pending,x=t.memoizedState;if(m!==null){s.pending=null;var F=m=m.next;do x=e(x,F.action),F=F.next;while(F!==m);Pr(x,t.memoizedState)||(ur=!0),t.memoizedState=x,t.baseQueue===null&&(t.baseState=x),s.lastRenderedState=x}return[x,a]}function ou(){}function au(e,t){var s=dt,a=Lr(),m=t(),x=!Pr(a.memoizedState,m);if(x&&(a.memoizedState=m,ur=!0),a=a.queue,wl(hu.bind(null,s,a,e),[e]),a.getSnapshot!==t||x||Nt!==null&&Nt.memoizedState.tag&1){if(s.flags|=2048,fn(9,cu.bind(null,s,a,m,t),void 0,null),It===null)throw Error(n(349));(Ki&30)!==0||lu(s,t,m)}return m}function lu(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=dt.updateQueue,t===null?(t={lastEffect:null,stores:null},dt.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function cu(e,t,s,a){t.value=s,t.getSnapshot=a,uu(t)&&du(e)}function hu(e,t,s){return s(function(){uu(t)&&du(e)})}function uu(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!Pr(e,s)}catch{return!0}}function du(e){var t=ri(e,1);t!==null&&Fr(t,e,1,-1)}function fu(e){var t=Kr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:dn,lastRenderedState:e},t.queue=e,e=e.dispatch=ev.bind(null,dt,e),[t.memoizedState,e]}function fn(e,t,s,a){return e={tag:e,create:t,destroy:s,deps:a,next:null},t=dt.updateQueue,t===null?(t={lastEffect:null,stores:null},dt.updateQueue=t,t.lastEffect=e.next=e):(s=t.lastEffect,s===null?t.lastEffect=e.next=e:(a=s.next,s.next=e,e.next=a,t.lastEffect=e)),e}function pu(){return Lr().memoizedState}function wo(e,t,s,a){var m=Kr();dt.flags|=e,m.memoizedState=fn(1|t,s,void 0,a===void 0?null:a)}function So(e,t,s,a){var m=Lr();a=a===void 0?null:a;var x=void 0;if(Mt!==null){var F=Mt.memoizedState;if(x=F.destroy,a!==null&&_l(a,F.deps)){m.memoizedState=fn(t,s,x,a);return}}dt.flags|=e,m.memoizedState=fn(1|t,s,x,a)}function _u(e,t){return wo(8390656,8,e,t)}function wl(e,t){return So(2048,8,e,t)}function vu(e,t){return So(4,2,e,t)}function gu(e,t){return So(4,4,e,t)}function mu(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function yu(e,t,s){return s=s!=null?s.concat([e]):null,So(4,4,mu.bind(null,t,e),s)}function Sl(){}function wu(e,t){var s=Lr();t=t===void 0?null:t;var a=s.memoizedState;return a!==null&&t!==null&&_l(t,a[1])?a[0]:(s.memoizedState=[e,t],e)}function Su(e,t){var s=Lr();t=t===void 0?null:t;var a=s.memoizedState;return a!==null&&t!==null&&_l(t,a[1])?a[0]:(e=e(),s.memoizedState=[e,t],e)}function Cu(e,t,s){return(Ki&21)===0?(e.baseState&&(e.baseState=!1,ur=!0),e.memoizedState=s):(Pr(s,t)||(s=Fe(),dt.lanes|=s,qi|=s,e.baseState=!0),t)}function Q_(e,t){var s=qe;qe=s!==0&&4>s?s:4,e(!0);var a=pl.transition;pl.transition={};try{e(!1),t()}finally{qe=s,pl.transition=a}}function xu(){return Lr().memoizedState}function Z_(e,t,s){var a=Ti(e);if(s={lane:a,action:s,hasEagerState:!1,eagerState:null,next:null},bu(e))Eu(t,s);else if(s=tu(e,t,s,a),s!==null){var m=ir();Fr(s,e,a,m),ku(s,t,a)}}function ev(e,t,s){var a=Ti(e),m={lane:a,action:s,hasEagerState:!1,eagerState:null,next:null};if(bu(e))Eu(t,m);else{var x=e.alternate;if(e.lanes===0&&(x===null||x.lanes===0)&&(x=t.lastRenderedReducer,x!==null))try{var F=t.lastRenderedState,G=x(F,s);if(m.hasEagerState=!0,m.eagerState=G,Pr(G,F)){var Q=t.interleaved;Q===null?(m.next=m,ll(t)):(m.next=Q.next,Q.next=m),t.interleaved=m;return}}catch{}finally{}s=tu(e,t,m,a),s!==null&&(m=ir(),Fr(s,e,a,m),ku(s,t,a))}}function bu(e){var t=e.alternate;return e===dt||t!==null&&t===dt}function Eu(e,t){hn=yo=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function ku(e,t,s){if((s&4194240)!==0){var a=t.lanes;a&=e.pendingLanes,s|=a,t.lanes=s,Ur(e,s)}}var Co={readContext:kr,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useInsertionEffect:Qt,useLayoutEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useMutableSource:Qt,useSyncExternalStore:Qt,useId:Qt,unstable_isNewReconciler:!1},tv={readContext:kr,useCallback:function(e,t){return Kr().memoizedState=[e,t===void 0?null:t],e},useContext:kr,useEffect:_u,useImperativeHandle:function(e,t,s){return s=s!=null?s.concat([e]):null,wo(4194308,4,mu.bind(null,t,e),s)},useLayoutEffect:function(e,t){return wo(4194308,4,e,t)},useInsertionEffect:function(e,t){return wo(4,2,e,t)},useMemo:function(e,t){var s=Kr();return t=t===void 0?null:t,e=e(),s.memoizedState=[e,t],e},useReducer:function(e,t,s){var a=Kr();return t=s!==void 0?s(t):t,a.memoizedState=a.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},a.queue=e,e=e.dispatch=Z_.bind(null,dt,e),[a.memoizedState,e]},useRef:function(e){var t=Kr();return e={current:e},t.memoizedState=e},useState:fu,useDebugValue:Sl,useDeferredValue:function(e){return Kr().memoizedState=e},useTransition:function(){var e=fu(!1),t=e[0];return e=Q_.bind(null,e[1]),Kr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,s){var a=dt,m=Kr();if(ct){if(s===void 0)throw Error(n(407));s=s()}else{if(s=t(),It===null)throw Error(n(349));(Ki&30)!==0||lu(a,t,s)}m.memoizedState=s;var x={value:s,getSnapshot:t};return m.queue=x,_u(hu.bind(null,a,x,e),[e]),a.flags|=2048,fn(9,cu.bind(null,a,x,s,t),void 0,null),s},useId:function(){var e=Kr(),t=It.identifierPrefix;if(ct){var s=ti,a=ei;s=(a&~(1<<32-vr(a)-1)).toString(32)+s,t=":"+t+"R"+s,s=un++,0<s&&(t+="H"+s.toString(32)),t+=":"}else s=J_++,t=":"+t+"r"+s.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},rv={readContext:kr,useCallback:wu,useContext:kr,useEffect:wl,useImperativeHandle:yu,useInsertionEffect:vu,useLayoutEffect:gu,useMemo:Su,useReducer:ml,useRef:pu,useState:function(){return ml(dn)},useDebugValue:Sl,useDeferredValue:function(e){var t=Lr();return Cu(t,Mt.memoizedState,e)},useTransition:function(){var e=ml(dn)[0],t=Lr().memoizedState;return[e,t]},useMutableSource:ou,useSyncExternalStore:au,useId:xu,unstable_isNewReconciler:!1},iv={readContext:kr,useCallback:wu,useContext:kr,useEffect:wl,useImperativeHandle:yu,useInsertionEffect:vu,useLayoutEffect:gu,useMemo:Su,useReducer:yl,useRef:pu,useState:function(){return yl(dn)},useDebugValue:Sl,useDeferredValue:function(e){var t=Lr();return Mt===null?t.memoizedState=e:Cu(t,Mt.memoizedState,e)},useTransition:function(){var e=yl(dn)[0],t=Lr().memoizedState;return[e,t]},useMutableSource:ou,useSyncExternalStore:au,useId:xu,unstable_isNewReconciler:!1};function Nr(e,t){if(e&&e.defaultProps){t=I({},t),e=e.defaultProps;for(var s in e)t[s]===void 0&&(t[s]=e[s]);return t}return t}function Cl(e,t,s,a){t=e.memoizedState,s=s(a,t),s=s==null?t:I({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var xo={isMounted:function(e){return(e=e._reactInternals)?Jr(e)===e:!1},enqueueSetState:function(e,t,s){e=e._reactInternals;var a=ir(),m=Ti(e),x=ii(a,m);x.payload=t,s!=null&&(x.callback=s),t=Ei(e,x,m),t!==null&&(Fr(t,e,m,a),_o(t,e,m))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var a=ir(),m=Ti(e),x=ii(a,m);x.tag=1,x.payload=t,s!=null&&(x.callback=s),t=Ei(e,x,m),t!==null&&(Fr(t,e,m,a),_o(t,e,m))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=ir(),a=Ti(e),m=ii(s,a);m.tag=2,t!=null&&(m.callback=t),t=Ei(e,m,a),t!==null&&(Fr(t,e,a,s),_o(t,e,a))}};function Lu(e,t,s,a,m,x,F){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,x,F):t.prototype&&t.prototype.isPureReactComponent?!Qs(s,a)||!Qs(m,x):!0}function Ru(e,t,s){var a=!1,m=Ci,x=t.contextType;return typeof x=="object"&&x!==null?x=kr(x):(m=hr(t)?$i:Jt.current,a=t.contextTypes,x=(a=a!=null)?vs(e,m):Ci),t=new t(s,x),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=xo,e.stateNode=t,t._reactInternals=e,a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=m,e.__reactInternalMemoizedMaskedChildContext=x),t}function Tu(e,t,s,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,a),t.state!==e&&xo.enqueueReplaceState(t,t.state,null)}function xl(e,t,s,a){var m=e.stateNode;m.props=s,m.state=e.memoizedState,m.refs={},cl(e);var x=t.contextType;typeof x=="object"&&x!==null?m.context=kr(x):(x=hr(t)?$i:Jt.current,m.context=vs(e,x)),m.state=e.memoizedState,x=t.getDerivedStateFromProps,typeof x=="function"&&(Cl(e,t,x,s),m.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(t=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),t!==m.state&&xo.enqueueReplaceState(m,m.state,null),vo(e,s,m,a),m.state=e.memoizedState),typeof m.componentDidMount=="function"&&(e.flags|=4194308)}function bs(e,t){try{var s="",a=t;do s+=ae(a),a=a.return;while(a);var m=s}catch(x){m=`
39
+ Error generating stack: `+x.message+`
40
+ `+x.stack}return{value:e,source:t,stack:m,digest:null}}function bl(e,t,s){return{value:e,source:null,stack:s??null,digest:t??null}}function El(e,t){try{console.error(t.value)}catch(s){setTimeout(function(){throw s})}}var sv=typeof WeakMap=="function"?WeakMap:Map;function Mu(e,t,s){s=ii(-1,s),s.tag=3,s.payload={element:null};var a=t.value;return s.callback=function(){Mo||(Mo=!0,Hl=a),El(e,t)},s}function Du(e,t,s){s=ii(-1,s),s.tag=3;var a=e.type.getDerivedStateFromError;if(typeof a=="function"){var m=t.value;s.payload=function(){return a(m)},s.callback=function(){El(e,t)}}var x=e.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(s.callback=function(){El(e,t),typeof a!="function"&&(Li===null?Li=new Set([this]):Li.add(this));var F=t.stack;this.componentDidCatch(t.value,{componentStack:F!==null?F:""})}),s}function Au(e,t,s){var a=e.pingCache;if(a===null){a=e.pingCache=new sv;var m=new Set;a.set(t,m)}else m=a.get(t),m===void 0&&(m=new Set,a.set(t,m));m.has(s)||(m.add(s),e=mv.bind(null,e,t,s),t.then(e,e))}function Bu(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 Pu(e,t,s,a,m){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(t=ii(-1,1),t.tag=2,Ei(s,t,1))),s.lanes|=1),e):(e.flags|=65536,e.lanes=m,e)}var nv=g.ReactCurrentOwner,ur=!1;function rr(e,t,s,a){t.child=e===null?eu(t,null,s,a):ws(t,e.child,s,a)}function Ou(e,t,s,a,m){s=s.render;var x=t.ref;return Cs(t,m),a=vl(e,t,s,a,x,m),s=gl(),e!==null&&!ur?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~m,si(e,t,m)):(ct&&s&&Za(t),t.flags|=1,rr(e,t,a,m),t.child)}function Nu(e,t,s,a,m){if(e===null){var x=s.type;return typeof x=="function"&&!ql(x)&&x.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(t.tag=15,t.type=x,Iu(e,t,x,a,m)):(e=No(s.type,null,a,t,t.mode,m),e.ref=t.ref,e.return=t,t.child=e)}if(x=e.child,(e.lanes&m)===0){var F=x.memoizedProps;if(s=s.compare,s=s!==null?s:Qs,s(F,a)&&e.ref===t.ref)return si(e,t,m)}return t.flags|=1,e=Di(x,a),e.ref=t.ref,e.return=t,t.child=e}function Iu(e,t,s,a,m){if(e!==null){var x=e.memoizedProps;if(Qs(x,a)&&e.ref===t.ref)if(ur=!1,t.pendingProps=a=x,(e.lanes&m)!==0)(e.flags&131072)!==0&&(ur=!0);else return t.lanes=e.lanes,si(e,t,m)}return kl(e,t,s,a,m)}function ju(e,t,s){var a=t.pendingProps,m=a.children,x=e!==null?e.memoizedState:null;if(a.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},tt(ks,wr),wr|=s;else{if((s&1073741824)===0)return e=x!==null?x.baseLanes|s:s,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,tt(ks,wr),wr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},a=x!==null?x.baseLanes:s,tt(ks,wr),wr|=a}else x!==null?(a=x.baseLanes|s,t.memoizedState=null):a=s,tt(ks,wr),wr|=a;return rr(e,t,m,s),t.child}function Fu(e,t){var s=t.ref;(e===null&&s!==null||e!==null&&e.ref!==s)&&(t.flags|=512,t.flags|=2097152)}function kl(e,t,s,a,m){var x=hr(s)?$i:Jt.current;return x=vs(t,x),Cs(t,m),s=vl(e,t,s,a,x,m),a=gl(),e!==null&&!ur?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~m,si(e,t,m)):(ct&&a&&Za(t),t.flags|=1,rr(e,t,s,m),t.child)}function Hu(e,t,s,a,m){if(hr(s)){var x=!0;oo(t)}else x=!1;if(Cs(t,m),t.stateNode===null)Eo(e,t),Ru(t,s,a),xl(t,s,a,m),a=!0;else if(e===null){var F=t.stateNode,G=t.memoizedProps;F.props=G;var Q=F.context,ne=s.contextType;typeof ne=="object"&&ne!==null?ne=kr(ne):(ne=hr(s)?$i:Jt.current,ne=vs(t,ne));var fe=s.getDerivedStateFromProps,pe=typeof fe=="function"||typeof F.getSnapshotBeforeUpdate=="function";pe||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(G!==a||Q!==ne)&&Tu(t,F,a,ne),bi=!1;var de=t.memoizedState;F.state=de,vo(t,a,F,m),Q=t.memoizedState,G!==a||de!==Q||cr.current||bi?(typeof fe=="function"&&(Cl(t,s,fe,a),Q=t.memoizedState),(G=bi||Lu(t,s,G,a,de,Q,ne))?(pe||typeof F.UNSAFE_componentWillMount!="function"&&typeof F.componentWillMount!="function"||(typeof F.componentWillMount=="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount=="function"&&F.UNSAFE_componentWillMount()),typeof F.componentDidMount=="function"&&(t.flags|=4194308)):(typeof F.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=Q),F.props=a,F.state=Q,F.context=ne,a=G):(typeof F.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{F=t.stateNode,ru(e,t),G=t.memoizedProps,ne=t.type===t.elementType?G:Nr(t.type,G),F.props=ne,pe=t.pendingProps,de=F.context,Q=s.contextType,typeof Q=="object"&&Q!==null?Q=kr(Q):(Q=hr(s)?$i:Jt.current,Q=vs(t,Q));var ye=s.getDerivedStateFromProps;(fe=typeof ye=="function"||typeof F.getSnapshotBeforeUpdate=="function")||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(G!==pe||de!==Q)&&Tu(t,F,a,Q),bi=!1,de=t.memoizedState,F.state=de,vo(t,a,F,m);var xe=t.memoizedState;G!==pe||de!==xe||cr.current||bi?(typeof ye=="function"&&(Cl(t,s,ye,a),xe=t.memoizedState),(ne=bi||Lu(t,s,ne,a,de,xe,Q)||!1)?(fe||typeof F.UNSAFE_componentWillUpdate!="function"&&typeof F.componentWillUpdate!="function"||(typeof F.componentWillUpdate=="function"&&F.componentWillUpdate(a,xe,Q),typeof F.UNSAFE_componentWillUpdate=="function"&&F.UNSAFE_componentWillUpdate(a,xe,Q)),typeof F.componentDidUpdate=="function"&&(t.flags|=4),typeof F.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof F.componentDidUpdate!="function"||G===e.memoizedProps&&de===e.memoizedState||(t.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||G===e.memoizedProps&&de===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=xe),F.props=a,F.state=xe,F.context=Q,a=ne):(typeof F.componentDidUpdate!="function"||G===e.memoizedProps&&de===e.memoizedState||(t.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||G===e.memoizedProps&&de===e.memoizedState||(t.flags|=1024),a=!1)}return Ll(e,t,s,a,x,m)}function Ll(e,t,s,a,m,x){Fu(e,t);var F=(t.flags&128)!==0;if(!a&&!F)return m&&Vh(t,s,!1),si(e,t,x);a=t.stateNode,nv.current=t;var G=F&&typeof s.getDerivedStateFromError!="function"?null:a.render();return t.flags|=1,e!==null&&F?(t.child=ws(t,e.child,null,x),t.child=ws(t,null,G,x)):rr(e,t,G,x),t.memoizedState=a.state,m&&Vh(t,s,!0),t.child}function $u(e){var t=e.stateNode;t.pendingContext?Uh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Uh(e,t.context,!1),hl(e,t.containerInfo)}function zu(e,t,s,a,m){return ys(),il(m),t.flags|=256,rr(e,t,s,a),t.child}var Rl={dehydrated:null,treeContext:null,retryLane:0};function Tl(e){return{baseLanes:e,cachePool:null,transitions:null}}function Uu(e,t,s){var a=t.pendingProps,m=ut.current,x=!1,F=(t.flags&128)!==0,G;if((G=F)||(G=e!==null&&e.memoizedState===null?!1:(m&2)!==0),G?(x=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(m|=1),tt(ut,m&1),e===null)return rl(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(F=a.children,e=a.fallback,x?(a=t.mode,x=t.child,F={mode:"hidden",children:F},(a&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=F):x=Io(F,a,0,null),e=Ji(e,a,s,null),x.return=t,e.return=t,x.sibling=e,t.child=x,t.child.memoizedState=Tl(s),t.memoizedState=Rl,e):Ml(t,F));if(m=e.memoizedState,m!==null&&(G=m.dehydrated,G!==null))return ov(e,t,F,a,G,m,s);if(x){x=a.fallback,F=t.mode,m=e.child,G=m.sibling;var Q={mode:"hidden",children:a.children};return(F&1)===0&&t.child!==m?(a=t.child,a.childLanes=0,a.pendingProps=Q,t.deletions=null):(a=Di(m,Q),a.subtreeFlags=m.subtreeFlags&14680064),G!==null?x=Di(G,x):(x=Ji(x,F,s,null),x.flags|=2),x.return=t,a.return=t,a.sibling=x,t.child=a,a=x,x=t.child,F=e.child.memoizedState,F=F===null?Tl(s):{baseLanes:F.baseLanes|s,cachePool:null,transitions:F.transitions},x.memoizedState=F,x.childLanes=e.childLanes&~s,t.memoizedState=Rl,a}return x=e.child,e=x.sibling,a=Di(x,{mode:"visible",children:a.children}),(t.mode&1)===0&&(a.lanes=s),a.return=t,a.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=a,t.memoizedState=null,a}function Ml(e,t){return t=Io({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function bo(e,t,s,a){return a!==null&&il(a),ws(t,e.child,null,s),e=Ml(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ov(e,t,s,a,m,x,F){if(s)return t.flags&256?(t.flags&=-257,a=bl(Error(n(422))),bo(e,t,F,a)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(x=a.fallback,m=t.mode,a=Io({mode:"visible",children:a.children},m,0,null),x=Ji(x,m,F,null),x.flags|=2,a.return=t,x.return=t,a.sibling=x,t.child=a,(t.mode&1)!==0&&ws(t,e.child,null,F),t.child.memoizedState=Tl(F),t.memoizedState=Rl,x);if((t.mode&1)===0)return bo(e,t,F,null);if(m.data==="$!"){if(a=m.nextSibling&&m.nextSibling.dataset,a)var G=a.dgst;return a=G,x=Error(n(419)),a=bl(x,a,void 0),bo(e,t,F,a)}if(G=(F&e.childLanes)!==0,ur||G){if(a=It,a!==null){switch(F&-F){case 4:m=2;break;case 16:m=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:m=32;break;case 536870912:m=268435456;break;default:m=0}m=(m&(a.suspendedLanes|F))!==0?0:m,m!==0&&m!==x.retryLane&&(x.retryLane=m,ri(e,m),Fr(a,e,m,-1))}return Kl(),a=bl(Error(n(421))),bo(e,t,F,a)}return m.data==="$?"?(t.flags|=128,t.child=e.child,t=yv.bind(null,e),m._reactRetry=t,null):(e=x.treeContext,yr=wi(m.nextSibling),mr=t,ct=!0,Or=null,e!==null&&(br[Er++]=ei,br[Er++]=ti,br[Er++]=zi,ei=e.id,ti=e.overflow,zi=t),t=Ml(t,a.children),t.flags|=4096,t)}function Wu(e,t,s){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),al(e.return,t,s)}function Dl(e,t,s,a,m){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:s,tailMode:m}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=a,x.tail=s,x.tailMode=m)}function Vu(e,t,s){var a=t.pendingProps,m=a.revealOrder,x=a.tail;if(rr(e,t,a.children,s),a=ut.current,(a&2)!==0)a=a&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Wu(e,s,t);else if(e.tag===19)Wu(e,s,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}a&=1}if(tt(ut,a),(t.mode&1)===0)t.memoizedState=null;else switch(m){case"forwards":for(s=t.child,m=null;s!==null;)e=s.alternate,e!==null&&go(e)===null&&(m=s),s=s.sibling;s=m,s===null?(m=t.child,t.child=null):(m=s.sibling,s.sibling=null),Dl(t,!1,m,s,x);break;case"backwards":for(s=null,m=t.child,t.child=null;m!==null;){if(e=m.alternate,e!==null&&go(e)===null){t.child=m;break}e=m.sibling,m.sibling=s,s=m,m=e}Dl(t,!0,s,null,x);break;case"together":Dl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Eo(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function si(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),qi|=t.lanes,(s&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(n(153));if(t.child!==null){for(e=t.child,s=Di(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Di(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function av(e,t,s){switch(t.tag){case 3:$u(t),ys();break;case 5:nu(t);break;case 1:hr(t.type)&&oo(t);break;case 4:hl(t,t.stateNode.containerInfo);break;case 10:var a=t.type._context,m=t.memoizedProps.value;tt(fo,a._currentValue),a._currentValue=m;break;case 13:if(a=t.memoizedState,a!==null)return a.dehydrated!==null?(tt(ut,ut.current&1),t.flags|=128,null):(s&t.child.childLanes)!==0?Uu(e,t,s):(tt(ut,ut.current&1),e=si(e,t,s),e!==null?e.sibling:null);tt(ut,ut.current&1);break;case 19:if(a=(s&t.childLanes)!==0,(e.flags&128)!==0){if(a)return Vu(e,t,s);t.flags|=128}if(m=t.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),tt(ut,ut.current),a)break;return null;case 22:case 23:return t.lanes=0,ju(e,t,s)}return si(e,t,s)}var Ku,Al,qu,Gu;Ku=function(e,t){for(var s=t.child;s!==null;){if(s.tag===5||s.tag===6)e.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},Al=function(){},qu=function(e,t,s,a){var m=e.memoizedProps;if(m!==a){e=t.stateNode,Vi(Vr.current);var x=null;switch(s){case"input":m=ke(e,m),a=ke(e,a),x=[];break;case"select":m=I({},m,{value:void 0}),a=I({},a,{value:void 0}),x=[];break;case"textarea":m=Qe(e,m),a=Qe(e,a),x=[];break;default:typeof m.onClick!="function"&&typeof a.onClick=="function"&&(e.onclick=io)}Ke(s,a);var F;s=null;for(ne in m)if(!a.hasOwnProperty(ne)&&m.hasOwnProperty(ne)&&m[ne]!=null)if(ne==="style"){var G=m[ne];for(F in G)G.hasOwnProperty(F)&&(s||(s={}),s[F]="")}else ne!=="dangerouslySetInnerHTML"&&ne!=="children"&&ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&ne!=="autoFocus"&&(p.hasOwnProperty(ne)?x||(x=[]):(x=x||[]).push(ne,null));for(ne in a){var Q=a[ne];if(G=m!=null?m[ne]:void 0,a.hasOwnProperty(ne)&&Q!==G&&(Q!=null||G!=null))if(ne==="style")if(G){for(F in G)!G.hasOwnProperty(F)||Q&&Q.hasOwnProperty(F)||(s||(s={}),s[F]="");for(F in Q)Q.hasOwnProperty(F)&&G[F]!==Q[F]&&(s||(s={}),s[F]=Q[F])}else s||(x||(x=[]),x.push(ne,s)),s=Q;else ne==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,G=G?G.__html:void 0,Q!=null&&G!==Q&&(x=x||[]).push(ne,Q)):ne==="children"?typeof Q!="string"&&typeof Q!="number"||(x=x||[]).push(ne,""+Q):ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&(p.hasOwnProperty(ne)?(Q!=null&&ne==="onScroll"&&it("scroll",e),x||G===Q||(x=[])):(x=x||[]).push(ne,Q))}s&&(x=x||[]).push("style",s);var ne=x;(t.updateQueue=ne)&&(t.flags|=4)}},Gu=function(e,t,s,a){s!==a&&(t.flags|=4)};function pn(e,t){if(!ct)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var a=null;s!==null;)s.alternate!==null&&(a=s),s=s.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Zt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,a=0;if(t)for(var m=e.child;m!==null;)s|=m.lanes|m.childLanes,a|=m.subtreeFlags&14680064,a|=m.flags&14680064,m.return=e,m=m.sibling;else for(m=e.child;m!==null;)s|=m.lanes|m.childLanes,a|=m.subtreeFlags,a|=m.flags,m.return=e,m=m.sibling;return e.subtreeFlags|=a,e.childLanes=s,t}function lv(e,t,s){var a=t.pendingProps;switch(el(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zt(t),null;case 1:return hr(t.type)&&no(),Zt(t),null;case 3:return a=t.stateNode,xs(),st(cr),st(Jt),fl(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(ho(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Or!==null&&(Ul(Or),Or=null))),Al(e,t),Zt(t),null;case 5:ul(t);var m=Vi(cn.current);if(s=t.type,e!==null&&t.stateNode!=null)qu(e,t,s,a,m),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!a){if(t.stateNode===null)throw Error(n(166));return Zt(t),null}if(e=Vi(Vr.current),ho(t)){a=t.stateNode,s=t.type;var x=t.memoizedProps;switch(a[Wr]=t,a[sn]=x,e=(t.mode&1)!==0,s){case"dialog":it("cancel",a),it("close",a);break;case"iframe":case"object":case"embed":it("load",a);break;case"video":case"audio":for(m=0;m<en.length;m++)it(en[m],a);break;case"source":it("error",a);break;case"img":case"image":case"link":it("error",a),it("load",a);break;case"details":it("toggle",a);break;case"input":Ie(a,x),it("invalid",a);break;case"select":a._wrapperState={wasMultiple:!!x.multiple},it("invalid",a);break;case"textarea":Ze(a,x),it("invalid",a)}Ke(s,x),m=null;for(var F in x)if(x.hasOwnProperty(F)){var G=x[F];F==="children"?typeof G=="string"?a.textContent!==G&&(x.suppressHydrationWarning!==!0&&ro(a.textContent,G,e),m=["children",G]):typeof G=="number"&&a.textContent!==""+G&&(x.suppressHydrationWarning!==!0&&ro(a.textContent,G,e),m=["children",""+G]):p.hasOwnProperty(F)&&G!=null&&F==="onScroll"&&it("scroll",a)}switch(s){case"input":ce(a),Xe(a,x,!0);break;case"textarea":ce(a),wt(a);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(a.onclick=io)}a=m,t.updateQueue=a,a!==null&&(t.flags|=4)}else{F=m.nodeType===9?m:m.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=at(s)),e==="http://www.w3.org/1999/xhtml"?s==="script"?(e=F.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof a.is=="string"?e=F.createElement(s,{is:a.is}):(e=F.createElement(s),s==="select"&&(F=e,a.multiple?F.multiple=!0:a.size&&(F.size=a.size))):e=F.createElementNS(e,s),e[Wr]=t,e[sn]=a,Ku(e,t,!1,!1),t.stateNode=e;e:{switch(F=Ge(s,a),s){case"dialog":it("cancel",e),it("close",e),m=a;break;case"iframe":case"object":case"embed":it("load",e),m=a;break;case"video":case"audio":for(m=0;m<en.length;m++)it(en[m],e);m=a;break;case"source":it("error",e),m=a;break;case"img":case"image":case"link":it("error",e),it("load",e),m=a;break;case"details":it("toggle",e),m=a;break;case"input":Ie(e,a),m=ke(e,a),it("invalid",e);break;case"option":m=a;break;case"select":e._wrapperState={wasMultiple:!!a.multiple},m=I({},a,{value:void 0}),it("invalid",e);break;case"textarea":Ze(e,a),m=Qe(e,a),it("invalid",e);break;default:m=a}Ke(s,m),G=m;for(x in G)if(G.hasOwnProperty(x)){var Q=G[x];x==="style"?Se(e,Q):x==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,Q!=null&&or(e,Q)):x==="children"?typeof Q=="string"?(s!=="textarea"||Q!=="")&&Ct(e,Q):typeof Q=="number"&&Ct(e,""+Q):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(p.hasOwnProperty(x)?Q!=null&&x==="onScroll"&&it("scroll",e):Q!=null&&u(e,x,Q,F))}switch(s){case"input":ce(e),Xe(e,a,!1);break;case"textarea":ce(e),wt(e);break;case"option":a.value!=null&&e.setAttribute("value",""+j(a.value));break;case"select":e.multiple=!!a.multiple,x=a.value,x!=null?Je(e,!!a.multiple,x,!1):a.defaultValue!=null&&Je(e,!!a.multiple,a.defaultValue,!0);break;default:typeof m.onClick=="function"&&(e.onclick=io)}switch(s){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}}a&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Zt(t),null;case 6:if(e&&t.stateNode!=null)Gu(e,t,e.memoizedProps,a);else{if(typeof a!="string"&&t.stateNode===null)throw Error(n(166));if(s=Vi(cn.current),Vi(Vr.current),ho(t)){if(a=t.stateNode,s=t.memoizedProps,a[Wr]=t,(x=a.nodeValue!==s)&&(e=mr,e!==null))switch(e.tag){case 3:ro(a.nodeValue,s,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ro(a.nodeValue,s,(e.mode&1)!==0)}x&&(t.flags|=4)}else a=(s.nodeType===9?s:s.ownerDocument).createTextNode(a),a[Wr]=t,t.stateNode=a}return Zt(t),null;case 13:if(st(ut),a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ct&&yr!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Jh(),ys(),t.flags|=98560,x=!1;else if(x=ho(t),a!==null&&a.dehydrated!==null){if(e===null){if(!x)throw Error(n(318));if(x=t.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(n(317));x[Wr]=t}else ys(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Zt(t),x=!1}else Or!==null&&(Ul(Or),Or=null),x=!0;if(!x)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=s,t):(a=a!==null,a!==(e!==null&&e.memoizedState!==null)&&a&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(ut.current&1)!==0?Dt===0&&(Dt=3):Kl())),t.updateQueue!==null&&(t.flags|=4),Zt(t),null);case 4:return xs(),Al(e,t),e===null&&tn(t.stateNode.containerInfo),Zt(t),null;case 10:return ol(t.type._context),Zt(t),null;case 17:return hr(t.type)&&no(),Zt(t),null;case 19:if(st(ut),x=t.memoizedState,x===null)return Zt(t),null;if(a=(t.flags&128)!==0,F=x.rendering,F===null)if(a)pn(x,!1);else{if(Dt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(F=go(e),F!==null){for(t.flags|=128,pn(x,!1),a=F.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),t.subtreeFlags=0,a=s,s=t.child;s!==null;)x=s,e=a,x.flags&=14680066,F=x.alternate,F===null?(x.childLanes=0,x.lanes=e,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=F.childLanes,x.lanes=F.lanes,x.child=F.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=F.memoizedProps,x.memoizedState=F.memoizedState,x.updateQueue=F.updateQueue,x.type=F.type,e=F.dependencies,x.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),s=s.sibling;return tt(ut,ut.current&1|2),t.child}e=e.sibling}x.tail!==null&&lt()>Ls&&(t.flags|=128,a=!0,pn(x,!1),t.lanes=4194304)}else{if(!a)if(e=go(F),e!==null){if(t.flags|=128,a=!0,s=e.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),pn(x,!0),x.tail===null&&x.tailMode==="hidden"&&!F.alternate&&!ct)return Zt(t),null}else 2*lt()-x.renderingStartTime>Ls&&s!==1073741824&&(t.flags|=128,a=!0,pn(x,!1),t.lanes=4194304);x.isBackwards?(F.sibling=t.child,t.child=F):(s=x.last,s!==null?s.sibling=F:t.child=F,x.last=F)}return x.tail!==null?(t=x.tail,x.rendering=t,x.tail=t.sibling,x.renderingStartTime=lt(),t.sibling=null,s=ut.current,tt(ut,a?s&1|2:s&1),t):(Zt(t),null);case 22:case 23:return Vl(),a=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(t.flags|=8192),a&&(t.mode&1)!==0?(wr&1073741824)!==0&&(Zt(t),t.subtreeFlags&6&&(t.flags|=8192)):Zt(t),null;case 24:return null;case 25:return null}throw Error(n(156,t.tag))}function cv(e,t){switch(el(t),t.tag){case 1:return hr(t.type)&&no(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xs(),st(cr),st(Jt),fl(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return ul(t),null;case 13:if(st(ut),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(n(340));ys()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return st(ut),null;case 4:return xs(),null;case 10:return ol(t.type._context),null;case 22:case 23:return Vl(),null;case 24:return null;default:return null}}var ko=!1,er=!1,hv=typeof WeakSet=="function"?WeakSet:Set,we=null;function Es(e,t){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(a){vt(e,t,a)}else s.current=null}function Bl(e,t,s){try{s()}catch(a){vt(e,t,a)}}var Yu=!1;function uv(e,t){if(Va=Vn,e=Lh(),Ia(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var a=s.getSelection&&s.getSelection();if(a&&a.rangeCount!==0){s=a.anchorNode;var m=a.anchorOffset,x=a.focusNode;a=a.focusOffset;try{s.nodeType,x.nodeType}catch{s=null;break e}var F=0,G=-1,Q=-1,ne=0,fe=0,pe=e,de=null;t:for(;;){for(var ye;pe!==s||m!==0&&pe.nodeType!==3||(G=F+m),pe!==x||a!==0&&pe.nodeType!==3||(Q=F+a),pe.nodeType===3&&(F+=pe.nodeValue.length),(ye=pe.firstChild)!==null;)de=pe,pe=ye;for(;;){if(pe===e)break t;if(de===s&&++ne===m&&(G=F),de===x&&++fe===a&&(Q=F),(ye=pe.nextSibling)!==null)break;pe=de,de=pe.parentNode}pe=ye}s=G===-1||Q===-1?null:{start:G,end:Q}}else s=null}s=s||{start:0,end:0}}else s=null;for(Ka={focusedElem:e,selectionRange:s},Vn=!1,we=t;we!==null;)if(t=we,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,we=e;else for(;we!==null;){t=we;try{var xe=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(xe!==null){var be=xe.memoizedProps,bt=xe.memoizedState,ee=t.stateNode,Z=ee.getSnapshotBeforeUpdate(t.elementType===t.type?be:Nr(t.type,be),bt);ee.__reactInternalSnapshotBeforeUpdate=Z}break;case 3:var re=t.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ve){vt(t,t.return,ve)}if(e=t.sibling,e!==null){e.return=t.return,we=e;break}we=t.return}return xe=Yu,Yu=!1,xe}function _n(e,t,s){var a=t.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var m=a=a.next;do{if((m.tag&e)===e){var x=m.destroy;m.destroy=void 0,x!==void 0&&Bl(t,s,x)}m=m.next}while(m!==a)}}function Lo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var s=t=t.next;do{if((s.tag&e)===e){var a=s.create;s.destroy=a()}s=s.next}while(s!==t)}}function Pl(e){var t=e.ref;if(t!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof t=="function"?t(e):t.current=e}}function Xu(e){var t=e.alternate;t!==null&&(e.alternate=null,Xu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wr],delete t[sn],delete t[Xa],delete t[q_],delete t[G_])),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 Ju(e){return e.tag===5||e.tag===3||e.tag===4}function Qu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ju(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 Ol(e,t,s){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?s.nodeType===8?s.parentNode.insertBefore(e,t):s.insertBefore(e,t):(s.nodeType===8?(t=s.parentNode,t.insertBefore(e,s)):(t=s,t.appendChild(e)),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=io));else if(a!==4&&(e=e.child,e!==null))for(Ol(e,t,s),e=e.sibling;e!==null;)Ol(e,t,s),e=e.sibling}function Nl(e,t,s){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(a!==4&&(e=e.child,e!==null))for(Nl(e,t,s),e=e.sibling;e!==null;)Nl(e,t,s),e=e.sibling}var Kt=null,Ir=!1;function ki(e,t,s){for(s=s.child;s!==null;)Zu(e,t,s),s=s.sibling}function Zu(e,t,s){if(Cr&&typeof Cr.onCommitFiberUnmount=="function")try{Cr.onCommitFiberUnmount(is,s)}catch{}switch(s.tag){case 5:er||Es(s,t);case 6:var a=Kt,m=Ir;Kt=null,ki(e,t,s),Kt=a,Ir=m,Kt!==null&&(Ir?(e=Kt,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):Kt.removeChild(s.stateNode));break;case 18:Kt!==null&&(Ir?(e=Kt,s=s.stateNode,e.nodeType===8?Ya(e.parentNode,s):e.nodeType===1&&Ya(e,s),Ks(e)):Ya(Kt,s.stateNode));break;case 4:a=Kt,m=Ir,Kt=s.stateNode.containerInfo,Ir=!0,ki(e,t,s),Kt=a,Ir=m;break;case 0:case 11:case 14:case 15:if(!er&&(a=s.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){m=a=a.next;do{var x=m,F=x.destroy;x=x.tag,F!==void 0&&((x&2)!==0||(x&4)!==0)&&Bl(s,t,F),m=m.next}while(m!==a)}ki(e,t,s);break;case 1:if(!er&&(Es(s,t),a=s.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=s.memoizedProps,a.state=s.memoizedState,a.componentWillUnmount()}catch(G){vt(s,t,G)}ki(e,t,s);break;case 21:ki(e,t,s);break;case 22:s.mode&1?(er=(a=er)||s.memoizedState!==null,ki(e,t,s),er=a):ki(e,t,s);break;default:ki(e,t,s)}}function ed(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new hv),t.forEach(function(a){var m=wv.bind(null,e,a);s.has(a)||(s.add(a),a.then(m,m))})}}function jr(e,t){var s=t.deletions;if(s!==null)for(var a=0;a<s.length;a++){var m=s[a];try{var x=e,F=t,G=F;e:for(;G!==null;){switch(G.tag){case 5:Kt=G.stateNode,Ir=!1;break e;case 3:Kt=G.stateNode.containerInfo,Ir=!0;break e;case 4:Kt=G.stateNode.containerInfo,Ir=!0;break e}G=G.return}if(Kt===null)throw Error(n(160));Zu(x,F,m),Kt=null,Ir=!1;var Q=m.alternate;Q!==null&&(Q.return=null),m.return=null}catch(ne){vt(m,t,ne)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)td(t,e),t=t.sibling}function td(e,t){var s=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jr(t,e),qr(e),a&4){try{_n(3,e,e.return),Lo(3,e)}catch(be){vt(e,e.return,be)}try{_n(5,e,e.return)}catch(be){vt(e,e.return,be)}}break;case 1:jr(t,e),qr(e),a&512&&s!==null&&Es(s,s.return);break;case 5:if(jr(t,e),qr(e),a&512&&s!==null&&Es(s,s.return),e.flags&32){var m=e.stateNode;try{Ct(m,"")}catch(be){vt(e,e.return,be)}}if(a&4&&(m=e.stateNode,m!=null)){var x=e.memoizedProps,F=s!==null?s.memoizedProps:x,G=e.type,Q=e.updateQueue;if(e.updateQueue=null,Q!==null)try{G==="input"&&x.type==="radio"&&x.name!=null&&Ne(m,x),Ge(G,F);var ne=Ge(G,x);for(F=0;F<Q.length;F+=2){var fe=Q[F],pe=Q[F+1];fe==="style"?Se(m,pe):fe==="dangerouslySetInnerHTML"?or(m,pe):fe==="children"?Ct(m,pe):u(m,fe,pe,ne)}switch(G){case"input":ge(m,x);break;case"textarea":Vt(m,x);break;case"select":var de=m._wrapperState.wasMultiple;m._wrapperState.wasMultiple=!!x.multiple;var ye=x.value;ye!=null?Je(m,!!x.multiple,ye,!1):de!==!!x.multiple&&(x.defaultValue!=null?Je(m,!!x.multiple,x.defaultValue,!0):Je(m,!!x.multiple,x.multiple?[]:"",!1))}m[sn]=x}catch(be){vt(e,e.return,be)}}break;case 6:if(jr(t,e),qr(e),a&4){if(e.stateNode===null)throw Error(n(162));m=e.stateNode,x=e.memoizedProps;try{m.nodeValue=x}catch(be){vt(e,e.return,be)}}break;case 3:if(jr(t,e),qr(e),a&4&&s!==null&&s.memoizedState.isDehydrated)try{Ks(t.containerInfo)}catch(be){vt(e,e.return,be)}break;case 4:jr(t,e),qr(e);break;case 13:jr(t,e),qr(e),m=e.child,m.flags&8192&&(x=m.memoizedState!==null,m.stateNode.isHidden=x,!x||m.alternate!==null&&m.alternate.memoizedState!==null||(Fl=lt())),a&4&&ed(e);break;case 22:if(fe=s!==null&&s.memoizedState!==null,e.mode&1?(er=(ne=er)||fe,jr(t,e),er=ne):jr(t,e),qr(e),a&8192){if(ne=e.memoizedState!==null,(e.stateNode.isHidden=ne)&&!fe&&(e.mode&1)!==0)for(we=e,fe=e.child;fe!==null;){for(pe=we=fe;we!==null;){switch(de=we,ye=de.child,de.tag){case 0:case 11:case 14:case 15:_n(4,de,de.return);break;case 1:Es(de,de.return);var xe=de.stateNode;if(typeof xe.componentWillUnmount=="function"){a=de,s=de.return;try{t=a,xe.props=t.memoizedProps,xe.state=t.memoizedState,xe.componentWillUnmount()}catch(be){vt(a,s,be)}}break;case 5:Es(de,de.return);break;case 22:if(de.memoizedState!==null){sd(pe);continue}}ye!==null?(ye.return=de,we=ye):sd(pe)}fe=fe.sibling}e:for(fe=null,pe=e;;){if(pe.tag===5){if(fe===null){fe=pe;try{m=pe.stateNode,ne?(x=m.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(G=pe.stateNode,Q=pe.memoizedProps.style,F=Q!=null&&Q.hasOwnProperty("display")?Q.display:null,G.style.display=Br("display",F))}catch(be){vt(e,e.return,be)}}}else if(pe.tag===6){if(fe===null)try{pe.stateNode.nodeValue=ne?"":pe.memoizedProps}catch(be){vt(e,e.return,be)}}else if((pe.tag!==22&&pe.tag!==23||pe.memoizedState===null||pe===e)&&pe.child!==null){pe.child.return=pe,pe=pe.child;continue}if(pe===e)break e;for(;pe.sibling===null;){if(pe.return===null||pe.return===e)break e;fe===pe&&(fe=null),pe=pe.return}fe===pe&&(fe=null),pe.sibling.return=pe.return,pe=pe.sibling}}break;case 19:jr(t,e),qr(e),a&4&&ed(e);break;case 21:break;default:jr(t,e),qr(e)}}function qr(e){var t=e.flags;if(t&2){try{e:{for(var s=e.return;s!==null;){if(Ju(s)){var a=s;break e}s=s.return}throw Error(n(160))}switch(a.tag){case 5:var m=a.stateNode;a.flags&32&&(Ct(m,""),a.flags&=-33);var x=Qu(e);Nl(e,x,m);break;case 3:case 4:var F=a.stateNode.containerInfo,G=Qu(e);Ol(e,G,F);break;default:throw Error(n(161))}}catch(Q){vt(e,e.return,Q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function dv(e,t,s){we=e,rd(e)}function rd(e,t,s){for(var a=(e.mode&1)!==0;we!==null;){var m=we,x=m.child;if(m.tag===22&&a){var F=m.memoizedState!==null||ko;if(!F){var G=m.alternate,Q=G!==null&&G.memoizedState!==null||er;G=ko;var ne=er;if(ko=F,(er=Q)&&!ne)for(we=m;we!==null;)F=we,Q=F.child,F.tag===22&&F.memoizedState!==null?nd(m):Q!==null?(Q.return=F,we=Q):nd(m);for(;x!==null;)we=x,rd(x),x=x.sibling;we=m,ko=G,er=ne}id(e)}else(m.subtreeFlags&8772)!==0&&x!==null?(x.return=m,we=x):id(e)}}function id(e){for(;we!==null;){var t=we;if((t.flags&8772)!==0){var s=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:er||Lo(5,t);break;case 1:var a=t.stateNode;if(t.flags&4&&!er)if(s===null)a.componentDidMount();else{var m=t.elementType===t.type?s.memoizedProps:Nr(t.type,s.memoizedProps);a.componentDidUpdate(m,s.memoizedState,a.__reactInternalSnapshotBeforeUpdate)}var x=t.updateQueue;x!==null&&su(t,x,a);break;case 3:var F=t.updateQueue;if(F!==null){if(s=null,t.child!==null)switch(t.child.tag){case 5:s=t.child.stateNode;break;case 1:s=t.child.stateNode}su(t,F,s)}break;case 5:var G=t.stateNode;if(s===null&&t.flags&4){s=G;var Q=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":Q.autoFocus&&s.focus();break;case"img":Q.src&&(s.src=Q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var ne=t.alternate;if(ne!==null){var fe=ne.memoizedState;if(fe!==null){var pe=fe.dehydrated;pe!==null&&Ks(pe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}er||t.flags&512&&Pl(t)}catch(de){vt(t,t.return,de)}}if(t===e){we=null;break}if(s=t.sibling,s!==null){s.return=t.return,we=s;break}we=t.return}}function sd(e){for(;we!==null;){var t=we;if(t===e){we=null;break}var s=t.sibling;if(s!==null){s.return=t.return,we=s;break}we=t.return}}function nd(e){for(;we!==null;){var t=we;try{switch(t.tag){case 0:case 11:case 15:var s=t.return;try{Lo(4,t)}catch(Q){vt(t,s,Q)}break;case 1:var a=t.stateNode;if(typeof a.componentDidMount=="function"){var m=t.return;try{a.componentDidMount()}catch(Q){vt(t,m,Q)}}var x=t.return;try{Pl(t)}catch(Q){vt(t,x,Q)}break;case 5:var F=t.return;try{Pl(t)}catch(Q){vt(t,F,Q)}}}catch(Q){vt(t,t.return,Q)}if(t===e){we=null;break}var G=t.sibling;if(G!==null){G.return=t.return,we=G;break}we=t.return}}var fv=Math.ceil,Ro=g.ReactCurrentDispatcher,Il=g.ReactCurrentOwner,Rr=g.ReactCurrentBatchConfig,$e=0,It=null,Lt=null,qt=0,wr=0,ks=Si(0),Dt=0,vn=null,qi=0,To=0,jl=0,gn=null,dr=null,Fl=0,Ls=1/0,ni=null,Mo=!1,Hl=null,Li=null,Do=!1,Ri=null,Ao=0,mn=0,$l=null,Bo=-1,Po=0;function ir(){return($e&6)!==0?lt():Bo!==-1?Bo:Bo=lt()}function Ti(e){return(e.mode&1)===0?1:($e&2)!==0&&qt!==0?qt&-qt:X_.transition!==null?(Po===0&&(Po=Fe()),Po):(e=qe,e!==0||(e=window.event,e=e===void 0?16:ah(e.type)),e)}function Fr(e,t,s,a){if(50<mn)throw mn=0,$l=null,Error(n(185));zr(e,s,a),(($e&2)===0||e!==It)&&(e===It&&(($e&2)===0&&(To|=s),Dt===4&&Mi(e,qt)),fr(e,a),s===1&&$e===0&&(t.mode&1)===0&&(Ls=lt()+500,ao&&xi()))}function fr(e,t){var s=e.callbackNode;me(e,t);var a=os(e,e===It?qt:0);if(a===0)s!==null&&Hn(s),e.callbackNode=null,e.callbackPriority=0;else if(t=a&-a,e.callbackPriority!==t){if(s!=null&&Hn(s),t===1)e.tag===0?Y_(ad.bind(null,e)):Kh(ad.bind(null,e)),V_(function(){($e&6)===0&&xi()}),s=null;else{switch(Zc(a)){case 1:s=Hs;break;case 4:s=$n;break;case 16:s=ji;break;case 536870912:s=zn;break;default:s=ji}s=_d(s,od.bind(null,e))}e.callbackPriority=t,e.callbackNode=s}}function od(e,t){if(Bo=-1,Po=0,($e&6)!==0)throw Error(n(327));var s=e.callbackNode;if(Rs()&&e.callbackNode!==s)return null;var a=os(e,e===It?qt:0);if(a===0)return null;if((a&30)!==0||(a&e.expiredLanes)!==0||t)t=Oo(e,a);else{t=a;var m=$e;$e|=2;var x=cd();(It!==e||qt!==t)&&(ni=null,Ls=lt()+500,Yi(e,t));do try{vv();break}catch(G){ld(e,G)}while(!0);nl(),Ro.current=x,$e=m,Lt!==null?t=0:(It=null,qt=0,t=Dt)}if(t!==0){if(t===2&&(m=Pe(e),m!==0&&(a=m,t=zl(e,m))),t===1)throw s=vn,Yi(e,0),Mi(e,a),fr(e,lt()),s;if(t===6)Mi(e,a);else{if(m=e.current.alternate,(a&30)===0&&!pv(m)&&(t=Oo(e,a),t===2&&(x=Pe(e),x!==0&&(a=x,t=zl(e,x))),t===1))throw s=vn,Yi(e,0),Mi(e,a),fr(e,lt()),s;switch(e.finishedWork=m,e.finishedLanes=a,t){case 0:case 1:throw Error(n(345));case 2:Xi(e,dr,ni);break;case 3:if(Mi(e,a),(a&130023424)===a&&(t=Fl+500-lt(),10<t)){if(os(e,0)!==0)break;if(m=e.suspendedLanes,(m&a)!==a){ir(),e.pingedLanes|=e.suspendedLanes&m;break}e.timeoutHandle=Ga(Xi.bind(null,e,dr,ni),t);break}Xi(e,dr,ni);break;case 4:if(Mi(e,a),(a&4194240)===a)break;for(t=e.eventTimes,m=-1;0<a;){var F=31-vr(a);x=1<<F,F=t[F],F>m&&(m=F),a&=~x}if(a=m,a=lt()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*fv(a/1960))-a,10<a){e.timeoutHandle=Ga(Xi.bind(null,e,dr,ni),a);break}Xi(e,dr,ni);break;case 5:Xi(e,dr,ni);break;default:throw Error(n(329))}}}return fr(e,lt()),e.callbackNode===s?od.bind(null,e):null}function zl(e,t){var s=gn;return e.current.memoizedState.isDehydrated&&(Yi(e,t).flags|=256),e=Oo(e,t),e!==2&&(t=dr,dr=s,t!==null&&Ul(t)),e}function Ul(e){dr===null?dr=e:dr.push.apply(dr,e)}function pv(e){for(var t=e;;){if(t.flags&16384){var s=t.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var a=0;a<s.length;a++){var m=s[a],x=m.getSnapshot;m=m.value;try{if(!Pr(x(),m))return!1}catch{return!1}}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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 Mi(e,t){for(t&=~jl,t&=~To,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var s=31-vr(t),a=1<<s;e[s]=-1,t&=~a}}function ad(e){if(($e&6)!==0)throw Error(n(327));Rs();var t=os(e,0);if((t&1)===0)return fr(e,lt()),null;var s=Oo(e,t);if(e.tag!==0&&s===2){var a=Pe(e);a!==0&&(t=a,s=zl(e,a))}if(s===1)throw s=vn,Yi(e,0),Mi(e,t),fr(e,lt()),s;if(s===6)throw Error(n(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Xi(e,dr,ni),fr(e,lt()),null}function Wl(e,t){var s=$e;$e|=1;try{return e(t)}finally{$e=s,$e===0&&(Ls=lt()+500,ao&&xi())}}function Gi(e){Ri!==null&&Ri.tag===0&&($e&6)===0&&Rs();var t=$e;$e|=1;var s=Rr.transition,a=qe;try{if(Rr.transition=null,qe=1,e)return e()}finally{qe=a,Rr.transition=s,$e=t,($e&6)===0&&xi()}}function Vl(){wr=ks.current,st(ks)}function Yi(e,t){e.finishedWork=null,e.finishedLanes=0;var s=e.timeoutHandle;if(s!==-1&&(e.timeoutHandle=-1,W_(s)),Lt!==null)for(s=Lt.return;s!==null;){var a=s;switch(el(a),a.tag){case 1:a=a.type.childContextTypes,a!=null&&no();break;case 3:xs(),st(cr),st(Jt),fl();break;case 5:ul(a);break;case 4:xs();break;case 13:st(ut);break;case 19:st(ut);break;case 10:ol(a.type._context);break;case 22:case 23:Vl()}s=s.return}if(It=e,Lt=e=Di(e.current,null),qt=wr=t,Dt=0,vn=null,jl=To=qi=0,dr=gn=null,Wi!==null){for(t=0;t<Wi.length;t++)if(s=Wi[t],a=s.interleaved,a!==null){s.interleaved=null;var m=a.next,x=s.pending;if(x!==null){var F=x.next;x.next=m,a.next=F}s.pending=a}Wi=null}return e}function ld(e,t){do{var s=Lt;try{if(nl(),mo.current=Co,yo){for(var a=dt.memoizedState;a!==null;){var m=a.queue;m!==null&&(m.pending=null),a=a.next}yo=!1}if(Ki=0,Nt=Mt=dt=null,hn=!1,un=0,Il.current=null,s===null||s.return===null){Dt=1,vn=t,Lt=null;break}e:{var x=e,F=s.return,G=s,Q=t;if(t=qt,G.flags|=32768,Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var ne=Q,fe=G,pe=fe.tag;if((fe.mode&1)===0&&(pe===0||pe===11||pe===15)){var de=fe.alternate;de?(fe.updateQueue=de.updateQueue,fe.memoizedState=de.memoizedState,fe.lanes=de.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var ye=Bu(F);if(ye!==null){ye.flags&=-257,Pu(ye,F,G,x,t),ye.mode&1&&Au(x,ne,t),t=ye,Q=ne;var xe=t.updateQueue;if(xe===null){var be=new Set;be.add(Q),t.updateQueue=be}else xe.add(Q);break e}else{if((t&1)===0){Au(x,ne,t),Kl();break e}Q=Error(n(426))}}else if(ct&&G.mode&1){var bt=Bu(F);if(bt!==null){(bt.flags&65536)===0&&(bt.flags|=256),Pu(bt,F,G,x,t),il(bs(Q,G));break e}}x=Q=bs(Q,G),Dt!==4&&(Dt=2),gn===null?gn=[x]:gn.push(x),x=F;do{switch(x.tag){case 3:x.flags|=65536,t&=-t,x.lanes|=t;var ee=Mu(x,Q,t);iu(x,ee);break e;case 1:G=Q;var Z=x.type,re=x.stateNode;if((x.flags&128)===0&&(typeof Z.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(Li===null||!Li.has(re)))){x.flags|=65536,t&=-t,x.lanes|=t;var ve=Du(x,G,t);iu(x,ve);break e}}x=x.return}while(x!==null)}ud(s)}catch(Ee){t=Ee,Lt===s&&s!==null&&(Lt=s=s.return);continue}break}while(!0)}function cd(){var e=Ro.current;return Ro.current=Co,e===null?Co:e}function Kl(){(Dt===0||Dt===3||Dt===2)&&(Dt=4),It===null||(qi&268435455)===0&&(To&268435455)===0||Mi(It,qt)}function Oo(e,t){var s=$e;$e|=2;var a=cd();(It!==e||qt!==t)&&(ni=null,Yi(e,t));do try{_v();break}catch(m){ld(e,m)}while(!0);if(nl(),$e=s,Ro.current=a,Lt!==null)throw Error(n(261));return It=null,qt=0,Dt}function _v(){for(;Lt!==null;)hd(Lt)}function vv(){for(;Lt!==null&&!va();)hd(Lt)}function hd(e){var t=pd(e.alternate,e,wr);e.memoizedProps=e.pendingProps,t===null?ud(e):Lt=t,Il.current=null}function ud(e){var t=e;do{var s=t.alternate;if(e=t.return,(t.flags&32768)===0){if(s=lv(s,t,wr),s!==null){Lt=s;return}}else{if(s=cv(s,t),s!==null){s.flags&=32767,Lt=s;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Dt=6,Lt=null;return}}if(t=t.sibling,t!==null){Lt=t;return}Lt=t=e}while(t!==null);Dt===0&&(Dt=5)}function Xi(e,t,s){var a=qe,m=Rr.transition;try{Rr.transition=null,qe=1,gv(e,t,s,a)}finally{Rr.transition=m,qe=a}return null}function gv(e,t,s,a){do Rs();while(Ri!==null);if(($e&6)!==0)throw Error(n(327));s=e.finishedWork;var m=e.finishedLanes;if(s===null)return null;if(e.finishedWork=null,e.finishedLanes=0,s===e.current)throw Error(n(177));e.callbackNode=null,e.callbackPriority=0;var x=s.lanes|s.childLanes;if($s(e,x),e===It&&(Lt=It=null,qt=0),(s.subtreeFlags&2064)===0&&(s.flags&2064)===0||Do||(Do=!0,_d(ji,function(){return Rs(),null})),x=(s.flags&15990)!==0,(s.subtreeFlags&15990)!==0||x){x=Rr.transition,Rr.transition=null;var F=qe;qe=1;var G=$e;$e|=4,Il.current=null,uv(e,s),td(s,e),I_(Ka),Vn=!!Va,Ka=Va=null,e.current=s,dv(s),ga(),$e=G,qe=F,Rr.transition=x}else e.current=s;if(Do&&(Do=!1,Ri=e,Ao=m),x=e.pendingLanes,x===0&&(Li=null),wa(s.stateNode),fr(e,lt()),t!==null)for(a=e.onRecoverableError,s=0;s<t.length;s++)m=t[s],a(m.value,{componentStack:m.stack,digest:m.digest});if(Mo)throw Mo=!1,e=Hl,Hl=null,e;return(Ao&1)!==0&&e.tag!==0&&Rs(),x=e.pendingLanes,(x&1)!==0?e===$l?mn++:(mn=0,$l=e):mn=0,xi(),null}function Rs(){if(Ri!==null){var e=Zc(Ao),t=Rr.transition,s=qe;try{if(Rr.transition=null,qe=16>e?16:e,Ri===null)var a=!1;else{if(e=Ri,Ri=null,Ao=0,($e&6)!==0)throw Error(n(331));var m=$e;for($e|=4,we=e.current;we!==null;){var x=we,F=x.child;if((we.flags&16)!==0){var G=x.deletions;if(G!==null){for(var Q=0;Q<G.length;Q++){var ne=G[Q];for(we=ne;we!==null;){var fe=we;switch(fe.tag){case 0:case 11:case 15:_n(8,fe,x)}var pe=fe.child;if(pe!==null)pe.return=fe,we=pe;else for(;we!==null;){fe=we;var de=fe.sibling,ye=fe.return;if(Xu(fe),fe===ne){we=null;break}if(de!==null){de.return=ye,we=de;break}we=ye}}}var xe=x.alternate;if(xe!==null){var be=xe.child;if(be!==null){xe.child=null;do{var bt=be.sibling;be.sibling=null,be=bt}while(be!==null)}}we=x}}if((x.subtreeFlags&2064)!==0&&F!==null)F.return=x,we=F;else e:for(;we!==null;){if(x=we,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:_n(9,x,x.return)}var ee=x.sibling;if(ee!==null){ee.return=x.return,we=ee;break e}we=x.return}}var Z=e.current;for(we=Z;we!==null;){F=we;var re=F.child;if((F.subtreeFlags&2064)!==0&&re!==null)re.return=F,we=re;else e:for(F=Z;we!==null;){if(G=we,(G.flags&2048)!==0)try{switch(G.tag){case 0:case 11:case 15:Lo(9,G)}}catch(Ee){vt(G,G.return,Ee)}if(G===F){we=null;break e}var ve=G.sibling;if(ve!==null){ve.return=G.return,we=ve;break e}we=G.return}}if($e=m,xi(),Cr&&typeof Cr.onPostCommitFiberRoot=="function")try{Cr.onPostCommitFiberRoot(is,e)}catch{}a=!0}return a}finally{qe=s,Rr.transition=t}}return!1}function dd(e,t,s){t=bs(s,t),t=Mu(e,t,1),e=Ei(e,t,1),t=ir(),e!==null&&(zr(e,1,t),fr(e,t))}function vt(e,t,s){if(e.tag===3)dd(e,e,s);else for(;t!==null;){if(t.tag===3){dd(t,e,s);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Li===null||!Li.has(a))){e=bs(s,e),e=Du(t,e,1),t=Ei(t,e,1),e=ir(),t!==null&&(zr(t,1,e),fr(t,e));break}}t=t.return}}function mv(e,t,s){var a=e.pingCache;a!==null&&a.delete(t),t=ir(),e.pingedLanes|=e.suspendedLanes&s,It===e&&(qt&s)===s&&(Dt===4||Dt===3&&(qt&130023424)===qt&&500>lt()-Fl?Yi(e,0):jl|=s),fr(e,t)}function fd(e,t){t===0&&((e.mode&1)===0?t=1:(t=ns,ns<<=1,(ns&130023424)===0&&(ns=4194304)));var s=ir();e=ri(e,t),e!==null&&(zr(e,t,s),fr(e,s))}function yv(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),fd(e,s)}function wv(e,t){var s=0;switch(e.tag){case 13:var a=e.stateNode,m=e.memoizedState;m!==null&&(s=m.retryLane);break;case 19:a=e.stateNode;break;default:throw Error(n(314))}a!==null&&a.delete(t),fd(e,s)}var pd;pd=function(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps||cr.current)ur=!0;else{if((e.lanes&s)===0&&(t.flags&128)===0)return ur=!1,av(e,t,s);ur=(e.flags&131072)!==0}else ur=!1,ct&&(t.flags&1048576)!==0&&qh(t,co,t.index);switch(t.lanes=0,t.tag){case 2:var a=t.type;Eo(e,t),e=t.pendingProps;var m=vs(t,Jt.current);Cs(t,s),m=vl(null,t,a,e,m,s);var x=gl();return t.flags|=1,typeof m=="object"&&m!==null&&typeof m.render=="function"&&m.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,hr(a)?(x=!0,oo(t)):x=!1,t.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,cl(t),m.updater=xo,t.stateNode=m,m._reactInternals=t,xl(t,a,e,s),t=Ll(null,t,a,!0,x,s)):(t.tag=0,ct&&x&&Za(t),rr(null,t,m,s),t=t.child),t;case 16:a=t.elementType;e:{switch(Eo(e,t),e=t.pendingProps,m=a._init,a=m(a._payload),t.type=a,m=t.tag=Cv(a),e=Nr(a,e),m){case 0:t=kl(null,t,a,e,s);break e;case 1:t=Hu(null,t,a,e,s);break e;case 11:t=Ou(null,t,a,e,s);break e;case 14:t=Nu(null,t,a,Nr(a.type,e),s);break e}throw Error(n(306,a,""))}return t;case 0:return a=t.type,m=t.pendingProps,m=t.elementType===a?m:Nr(a,m),kl(e,t,a,m,s);case 1:return a=t.type,m=t.pendingProps,m=t.elementType===a?m:Nr(a,m),Hu(e,t,a,m,s);case 3:e:{if($u(t),e===null)throw Error(n(387));a=t.pendingProps,x=t.memoizedState,m=x.element,ru(e,t),vo(t,a,null,s);var F=t.memoizedState;if(a=F.element,x.isDehydrated)if(x={element:a,isDehydrated:!1,cache:F.cache,pendingSuspenseBoundaries:F.pendingSuspenseBoundaries,transitions:F.transitions},t.updateQueue.baseState=x,t.memoizedState=x,t.flags&256){m=bs(Error(n(423)),t),t=zu(e,t,a,s,m);break e}else if(a!==m){m=bs(Error(n(424)),t),t=zu(e,t,a,s,m);break e}else for(yr=wi(t.stateNode.containerInfo.firstChild),mr=t,ct=!0,Or=null,s=eu(t,null,a,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(ys(),a===m){t=si(e,t,s);break e}rr(e,t,a,s)}t=t.child}return t;case 5:return nu(t),e===null&&rl(t),a=t.type,m=t.pendingProps,x=e!==null?e.memoizedProps:null,F=m.children,qa(a,m)?F=null:x!==null&&qa(a,x)&&(t.flags|=32),Fu(e,t),rr(e,t,F,s),t.child;case 6:return e===null&&rl(t),null;case 13:return Uu(e,t,s);case 4:return hl(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=ws(t,null,a,s):rr(e,t,a,s),t.child;case 11:return a=t.type,m=t.pendingProps,m=t.elementType===a?m:Nr(a,m),Ou(e,t,a,m,s);case 7:return rr(e,t,t.pendingProps,s),t.child;case 8:return rr(e,t,t.pendingProps.children,s),t.child;case 12:return rr(e,t,t.pendingProps.children,s),t.child;case 10:e:{if(a=t.type._context,m=t.pendingProps,x=t.memoizedProps,F=m.value,tt(fo,a._currentValue),a._currentValue=F,x!==null)if(Pr(x.value,F)){if(x.children===m.children&&!cr.current){t=si(e,t,s);break e}}else for(x=t.child,x!==null&&(x.return=t);x!==null;){var G=x.dependencies;if(G!==null){F=x.child;for(var Q=G.firstContext;Q!==null;){if(Q.context===a){if(x.tag===1){Q=ii(-1,s&-s),Q.tag=2;var ne=x.updateQueue;if(ne!==null){ne=ne.shared;var fe=ne.pending;fe===null?Q.next=Q:(Q.next=fe.next,fe.next=Q),ne.pending=Q}}x.lanes|=s,Q=x.alternate,Q!==null&&(Q.lanes|=s),al(x.return,s,t),G.lanes|=s;break}Q=Q.next}}else if(x.tag===10)F=x.type===t.type?null:x.child;else if(x.tag===18){if(F=x.return,F===null)throw Error(n(341));F.lanes|=s,G=F.alternate,G!==null&&(G.lanes|=s),al(F,s,t),F=x.sibling}else F=x.child;if(F!==null)F.return=x;else for(F=x;F!==null;){if(F===t){F=null;break}if(x=F.sibling,x!==null){x.return=F.return,F=x;break}F=F.return}x=F}rr(e,t,m.children,s),t=t.child}return t;case 9:return m=t.type,a=t.pendingProps.children,Cs(t,s),m=kr(m),a=a(m),t.flags|=1,rr(e,t,a,s),t.child;case 14:return a=t.type,m=Nr(a,t.pendingProps),m=Nr(a.type,m),Nu(e,t,a,m,s);case 15:return Iu(e,t,t.type,t.pendingProps,s);case 17:return a=t.type,m=t.pendingProps,m=t.elementType===a?m:Nr(a,m),Eo(e,t),t.tag=1,hr(a)?(e=!0,oo(t)):e=!1,Cs(t,s),Ru(t,a,m),xl(t,a,m,s),Ll(null,t,a,!0,e,s);case 19:return Vu(e,t,s);case 22:return ju(e,t,s)}throw Error(n(156,t.tag))};function _d(e,t){return Fn(e,t)}function Sv(e,t,s,a){this.tag=e,this.key=s,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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tr(e,t,s,a){return new Sv(e,t,s,a)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Cv(e){if(typeof e=="function")return ql(e)?1:0;if(e!=null){if(e=e.$$typeof,e===O)return 11;if(e===z)return 14}return 2}function Di(e,t){var s=e.alternate;return s===null?(s=Tr(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&14680064,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function No(e,t,s,a,m,x){var F=2;if(a=e,typeof e=="function")ql(e)&&(F=1);else if(typeof e=="string")F=5;else e:switch(e){case T:return Ji(s.children,m,x,t);case k:F=8,m|=8;break;case N:return e=Tr(12,s,t,m|2),e.elementType=N,e.lanes=x,e;case B:return e=Tr(13,s,t,m),e.elementType=B,e.lanes=x,e;case U:return e=Tr(19,s,t,m),e.elementType=U,e.lanes=x,e;case Y:return Io(s,m,x,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case V:F=10;break e;case K:F=9;break e;case O:F=11;break e;case z:F=14;break e;case q:F=16,a=null;break e}throw Error(n(130,e==null?e:typeof e,""))}return t=Tr(F,s,t,m),t.elementType=e,t.type=a,t.lanes=x,t}function Ji(e,t,s,a){return e=Tr(7,e,a,t),e.lanes=s,e}function Io(e,t,s,a){return e=Tr(22,e,a,t),e.elementType=Y,e.lanes=s,e.stateNode={isHidden:!1},e}function Gl(e,t,s){return e=Tr(6,e,null,t),e.lanes=s,e}function Yl(e,t,s){return t=Tr(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function xv(e,t,s,a,m){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=xr(0),this.expirationTimes=xr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xr(0),this.identifierPrefix=a,this.onRecoverableError=m,this.mutableSourceEagerHydrationData=null}function Xl(e,t,s,a,m,x,F,G,Q){return e=new xv(e,t,s,G,Q),t===1?(t=1,x===!0&&(t|=8)):t=0,x=Tr(3,null,null,t),e.current=x,x.stateNode=e,x.memoizedState={element:a,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},cl(x),e}function bv(e,t,s){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:E,key:a==null?null:""+a,children:e,containerInfo:t,implementation:s}}function vd(e){if(!e)return Ci;e=e._reactInternals;e:{if(Jr(e)!==e||e.tag!==1)throw Error(n(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(hr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(n(171))}if(e.tag===1){var s=e.type;if(hr(s))return Wh(e,s,t)}return t}function gd(e,t,s,a,m,x,F,G,Q){return e=Xl(s,a,!0,e,m,x,F,G,Q),e.context=vd(null),s=e.current,a=ir(),m=Ti(s),x=ii(a,m),x.callback=t??null,Ei(s,x,m),e.current.lanes=m,zr(e,m,a),fr(e,a),e}function jo(e,t,s,a){var m=t.current,x=ir(),F=Ti(m);return s=vd(s),t.context===null?t.context=s:t.pendingContext=s,t=ii(x,F),t.payload={element:e},a=a===void 0?null:a,a!==null&&(t.callback=a),e=Ei(m,t,F),e!==null&&(Fr(e,m,F,x),_o(e,m,F)),F}function Fo(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 md(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Jl(e,t){md(e,t),(e=e.alternate)&&md(e,t)}function Ev(){return null}var yd=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ql(e){this._internalRoot=e}Ho.prototype.render=Ql.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(n(409));jo(e,t,null,null)},Ho.prototype.unmount=Ql.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Gi(function(){jo(null,e,null,null)}),t[Qr]=null}};function Ho(e){this._internalRoot=e}Ho.prototype.unstable_scheduleHydration=function(e){if(e){var t=rh();e={blockedOn:null,target:e,priority:t};for(var s=0;s<gi.length&&t!==0&&t<gi[s].priority;s++);gi.splice(s,0,e),s===0&&nh(e)}};function Zl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function $o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function wd(){}function kv(e,t,s,a,m){if(m){if(typeof a=="function"){var x=a;a=function(){var ne=Fo(F);x.call(ne)}}var F=gd(t,a,e,0,null,!1,!1,"",wd);return e._reactRootContainer=F,e[Qr]=F.current,tn(e.nodeType===8?e.parentNode:e),Gi(),F}for(;m=e.lastChild;)e.removeChild(m);if(typeof a=="function"){var G=a;a=function(){var ne=Fo(Q);G.call(ne)}}var Q=Xl(e,0,!1,null,null,!1,!1,"",wd);return e._reactRootContainer=Q,e[Qr]=Q.current,tn(e.nodeType===8?e.parentNode:e),Gi(function(){jo(t,Q,s,a)}),Q}function zo(e,t,s,a,m){var x=s._reactRootContainer;if(x){var F=x;if(typeof m=="function"){var G=m;m=function(){var Q=Fo(F);G.call(Q)}}jo(t,F,e,m)}else F=kv(s,t,e,m,a);return Fo(F)}eh=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var s=Fi(t.pendingLanes);s!==0&&(Ur(t,s|1),fr(t,lt()),($e&6)===0&&(Ls=lt()+500,xi()))}break;case 13:Gi(function(){var a=ri(e,1);if(a!==null){var m=ir();Fr(a,e,1,m)}}),Jl(e,1)}},ba=function(e){if(e.tag===13){var t=ri(e,134217728);if(t!==null){var s=ir();Fr(t,e,134217728,s)}Jl(e,134217728)}},th=function(e){if(e.tag===13){var t=Ti(e),s=ri(e,t);if(s!==null){var a=ir();Fr(s,e,t,a)}Jl(e,t)}},rh=function(){return qe},ih=function(e,t){var s=qe;try{return qe=e,t()}finally{qe=s}},pt=function(e,t,s){switch(t){case"input":if(ge(e,s),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<s.length;t++){var a=s[t];if(a!==e&&a.form===e.form){var m=so(a);if(!m)throw Error(n(90));_e(a),ge(a,m)}}}break;case"textarea":Vt(e,s);break;case"select":t=s.value,t!=null&&Je(e,!!s.multiple,t,!1)}},Ue=Wl,We=Gi;var Lv={usingClientEntryPoint:!1,Events:[nn,ps,so,Ce,De,Wl]},yn={findFiberByHostInstance:Hi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Rv={bundleType:yn.bundleType,version:yn.version,rendererPackageName:yn.rendererPackageName,rendererConfig:yn.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:g.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=In(e),e===null?null:e.stateNode},findFiberByHostInstance:yn.findFiberByHostInstance||Ev,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 Uo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Uo.isDisabled&&Uo.supportsFiber)try{is=Uo.inject(Rv),Cr=Uo}catch{}}return pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Lv,pr.createPortal=function(e,t){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Zl(t))throw Error(n(200));return bv(e,t,null,s)},pr.createRoot=function(e,t){if(!Zl(e))throw Error(n(299));var s=!1,a="",m=yd;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=Xl(e,1,!1,null,null,s,!1,a,m),e[Qr]=t.current,tn(e.nodeType===8?e.parentNode:e),new Ql(t)},pr.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(n(188)):(e=Object.keys(e).join(","),Error(n(268,e)));return e=In(t),e=e===null?null:e.stateNode,e},pr.flushSync=function(e){return Gi(e)},pr.hydrate=function(e,t,s){if(!$o(t))throw Error(n(200));return zo(null,e,t,!0,s)},pr.hydrateRoot=function(e,t,s){if(!Zl(e))throw Error(n(405));var a=s!=null&&s.hydratedSources||null,m=!1,x="",F=yd;if(s!=null&&(s.unstable_strictMode===!0&&(m=!0),s.identifierPrefix!==void 0&&(x=s.identifierPrefix),s.onRecoverableError!==void 0&&(F=s.onRecoverableError)),t=gd(t,null,e,1,s??null,m,!1,x,F),e[Qr]=t.current,tn(e),a)for(e=0;e<a.length;e++)s=a[e],m=s._getVersion,m=m(s._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[s,m]:t.mutableSourceEagerHydrationData.push(s,m);return new Ho(t)},pr.render=function(e,t,s){if(!$o(t))throw Error(n(200));return zo(null,e,t,!1,s)},pr.unmountComponentAtNode=function(e){if(!$o(e))throw Error(n(40));return e._reactRootContainer?(Gi(function(){zo(null,null,e,!1,function(){e._reactRootContainer=null,e[Qr]=null})}),!0):!1},pr.unstable_batchedUpdates=Wl,pr.unstable_renderSubtreeIntoContainer=function(e,t,s,a){if(!$o(s))throw Error(n(200));if(e==null||e._reactInternals===void 0)throw Error(n(38));return zo(e,t,s,!1,a)},pr.version="18.3.1-next-f1338f8080-20240426",pr}var Rd;function Nv(){if(Rd)return rc.exports;Rd=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(i){console.error(i)}}return r(),rc.exports=Ov(),rc.exports}var Td;function Iv(){if(Td)return Wo;Td=1;var r=Nv();return Wo.createRoot=r.createRoot,Wo.hydrateRoot=r.hydrateRoot,Wo}var jv=Iv();const Fv=Nf(jv);function If(r){var i,n,_="";if(typeof r=="string"||typeof r=="number")_+=r;else if(typeof r=="object")if(Array.isArray(r)){var p=r.length;for(i=0;i<p;i++)r[i]&&(n=If(r[i]))&&(_&&(_+=" "),_+=n)}else for(n in r)r[n]&&(_&&(_+=" "),_+=n);return _}function Et(){for(var r,i,n=0,_="",p=arguments.length;n<p;n++)(r=arguments[n])&&(i=If(r))&&(_&&(_+=" "),_+=i);return _}function jf(r,i){const n=$.useRef(null);return $.useEffect(()=>{if(!r)return;const _=n.current;if(!_)return;const p=()=>Array.from(_.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])"));requestAnimationFrame(()=>{const R=p(),o=R.find(d=>d.tagName!=="BUTTON")??R[0];o==null||o.focus()});const L=R=>{if(R.key==="Escape"){R.preventDefault(),i();return}if(R.key!=="Tab")return;const o=p();if(o.length===0)return;const d=o[0],v=o[o.length-1];R.shiftKey?document.activeElement===d&&(R.preventDefault(),v.focus()):document.activeElement===v&&(R.preventDefault(),d.focus())};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[r,i]),n}const Hv=({isOpen:r,workspaces:i,onSubmit:n,onClose:_})=>{var C;const[p,L]=$.useState(((C=i[0])==null?void 0:C.id)||""),[R,o]=$.useState(""),[d,v]=$.useState(!1),y=jf(r,_);$.useEffect(()=>{r&&i.length>0&&!p&&L(i[0].id)},[r,i,p]);const f=async b=>{if(b.preventDefault(),!d){v(!0);try{await n(R.trim(),p),o("")}finally{v(!1)}}};return r?D.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:D.jsxs("form",{className:"modal",ref:y,onSubmit:f,children:[D.jsx("div",{className:"text-[14px] font-semibold mb-3",id:"deck-modal-title",children:"デッキ作成"}),D.jsxs("label",{className:"grid gap-1 text-xs",children:[D.jsx("span",{children:"デッキ名 (任意)"}),D.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:R,placeholder:"空白のままでもOK",maxLength:100,onChange:b=>o(b.target.value)})]}),D.jsxs("label",{className:"grid gap-1 text-xs mt-3",children:[D.jsx("span",{children:"ワークスペース"}),D.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:p,onChange:b=>L(b.target.value),children:i.map(b=>D.jsx("option",{value:b.id,children:b.path},b.id))})]}),D.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[D.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:_,disabled:d,children:"キャンセル"}),D.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:d,children:d?"作成中...":"作成"})]})]})}):null};function $v({activeView:r,onSelect:i,theme:n,onToggleTheme:_,onOpenSettings:p}){return D.jsxs("nav",{className:"activity-bar",children:[D.jsxs("div",{className:"activity-bar-top",children:[D.jsx("button",{type:"button",className:Et("activity-bar-item",r==="workspace"&&"active"),onClick:()=>i("workspace"),"aria-label":"Explorer",title:"Explorer (Ctrl+Shift+E)",children:D.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:D.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"})})}),D.jsx("button",{type:"button",className:Et("activity-bar-item",r==="terminal"&&"active"),onClick:()=>i("terminal"),"aria-label":"Terminal",title:"Terminal (Ctrl+`)",children:D.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[D.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"}),D.jsx("path",{d:"M6.5 15.5L10 12 6.5 8.5 8 7l5 5-5 5-1.5-1.5z",fill:"currentColor"}),D.jsx("path",{d:"M13 14h5v2h-5z",fill:"currentColor"})]})}),D.jsx("button",{type:"button",className:Et("activity-bar-item",r==="browser"&&"active"),onClick:()=>i("browser"),"aria-label":"Browser",title:"Browser",children:D.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:D.jsx("path",{d:"M12 2a10 10 0 100 20 10 10 0 000-20zm6.93 9h-3.02a15.7 15.7 0 00-1.12-5.03A8.03 8.03 0 0118.93 11zM12 4c.64 0 1.58 1.19 2.03 3.5.2 1.02.33 2.2.37 3.5H9.6c.04-1.3.17-2.48.37-3.5C10.42 5.19 11.36 4 12 4zM4.07 13h3.02c.11 1.9.5 3.64 1.12 5.03A8.03 8.03 0 014.07 13zm3.02-2H4.07a8.03 8.03 0 014.14-5.03A15.7 15.7 0 007.09 11zM12 20c-.64 0-1.58-1.19-2.03-3.5A18.4 18.4 0 019.6 13h4.8a18.4 18.4 0 01-.37 3.5C13.58 18.81 12.64 20 12 20zm3.79-1.97c.62-1.39 1.01-3.13 1.12-5.03h3.02a8.03 8.03 0 01-4.14 5.03z",fill:"currentColor"})})})]}),D.jsxs("div",{className:"activity-bar-bottom",children:[D.jsx("button",{type:"button",className:"activity-bar-item",onClick:_,"aria-label":"Toggle Theme",title:n==="dark"?"Switch to Light Theme":"Switch to Dark Theme",children:n==="dark"?D.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:D.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"})}):D.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:D.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"})})}),D.jsx("button",{type:"button",className:"activity-bar-item",onClick:p,"aria-label":"Settings",title:"Settings",children:D.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:D.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 Ff=({message:r})=>r?D.jsx("div",{className:"status-float",role:"status",children:r}):null,Hf="",zv="",$f="保存しました。",Uv="デッキを作成する前にワークスペースを追加してください。",Wv="ワークスペースを選択してください。",Vv=2e3,zf='"JetBrains Mono", monospace',Uf=14,Kv='"Cascadia Code", "JetBrains Mono", "Consolas", "Menlo", "Noto Sans Mono CJK JP", "Source Han Mono", "MS Gothic", monospace',qv=13,Bc="#000000",Wf="#ffffff",Bt=["#1e1e1e","#f44747","#23d18b","#e5c07b","#4aa5f0","#c586c0","#29b8db","#d4d4d4","#666666","#ff6e6e","#5ff967","#f5f543","#6ab7ff","#d670d6","#62e8f5","#ffffff"],Gv="#ffffff",Yv="#264f78",Vf="deck-theme",Xv=204;async function Oe(r,i={}){const n=await fetch(`${Hf}${r}`,{...i,credentials:"include"});if(!n.ok){const _=await n.text();throw new Error(_||`Request failed (${n.status})`)}return n.status===Xv?null:n.json()}const Wt="application/json",Pt="POST",Kf="PUT",Bn="DELETE";function Jv(){return window.location.origin.replace(/^http/,"ws")}function Qo(){return Oe("/api/ws-token")}function qf(){return Oe("/api/workspaces")}function Qv(){return Oe("/api/config")}function Zv(r){return Oe("/api/workspaces",{method:Pt,headers:{"Content-Type":Wt},body:JSON.stringify({path:r})})}function eg(r){return Oe(`/api/workspaces/${r}`,{method:Bn})}function tg(){return Oe("/api/decks")}function rg(r,i){return Oe("/api/decks",{method:Pt,headers:{"Content-Type":Wt},body:JSON.stringify({name:r,workspaceId:i})})}function ig(r){return Oe(`/api/decks/${r}`,{method:Bn})}function sg(r){return Oe("/api/decks/order",{method:Kf,headers:{"Content-Type":Wt},body:JSON.stringify({deckIds:r})})}function Pc(r,i=""){const n=new URLSearchParams({workspaceId:r,path:i});return Oe(`/api/files?${n.toString()}`)}function Md(r,i=""){const n=new URLSearchParams({path:r,subpath:i});return Oe(`/api/preview?${n.toString()}`)}function ng(r,i){const n=new URLSearchParams({workspaceId:r,path:i});return Oe(`/api/file?${n.toString()}`)}function og(r,i,n){return Oe("/api/file",{method:Kf,headers:{"Content-Type":Wt},body:JSON.stringify({workspaceId:r,path:i,contents:n})})}function ag(r,i,n=""){return Oe("/api/file",{method:Pt,headers:{"Content-Type":Wt},body:JSON.stringify({workspaceId:r,path:i,contents:n})})}function Gf(r,i){const n=new URLSearchParams({workspaceId:r,path:i});return Oe(`/api/file?${n.toString()}`,{method:Bn})}function Yf(r,i){return Oe("/api/dir",{method:Pt,headers:{"Content-Type":Wt},body:JSON.stringify({workspaceId:r,path:i})})}function Xf(r,i){const n=new URLSearchParams({workspaceId:r,path:i});return Oe(`/api/dir?${n.toString()}`,{method:Bn})}function lg(r,i,n,_=!1){return Oe("/api/move",{method:Pt,headers:{"Content-Type":Wt},body:JSON.stringify({workspaceId:r,from:i,to:n,overwrite:_})})}async function cg(r,i,n){const _=new FormData;_.append("workspaceId",r),_.append("path",i);for(const L of n)_.append("file",L);const p=await fetch(`${Hf}/api/upload`,{method:Pt,body:_,credentials:"include"});if(!p.ok){const L=await p.text();throw new Error(L||`Upload failed (${p.status})`)}return p.json()}function hg(r,i,n){return Oe("/api/terminals",{method:Pt,headers:{"Content-Type":Wt},body:JSON.stringify({deckId:r,title:i,command:n})})}function ug(r){const i=new URLSearchParams({deckId:r});return Oe(`/api/terminals?${i.toString()}`)}function dg(r){return Oe(`/api/terminals/${r}`,{method:Bn})}function fg(){return Oe("/api/browser/status")}function pg(){return Oe("/api/browser/start",{method:Pt})}function _g(){return Oe("/api/browser/stop",{method:Pt})}function vg(r){return Oe("/api/browser/navigate",{method:Pt,headers:{"Content-Type":Wt},body:JSON.stringify({url:r})})}function Jf(r,i){const n={workspaceId:r};i!==void 0&&(n.repoPath=i);const _=new URLSearchParams(n);return Oe(`/api/git/status?${_.toString()}`)}function gg(r){const i=new URLSearchParams({workspaceId:r});return Oe(`/api/git/repos?${i.toString()}`)}function Qf(r,i,n){return Oe("/api/git/stage",{method:Pt,headers:{"Content-Type":Wt},body:JSON.stringify({workspaceId:r,paths:i,repoPath:n})})}function Zf(r,i,n){return Oe("/api/git/unstage",{method:Pt,headers:{"Content-Type":Wt},body:JSON.stringify({workspaceId:r,paths:i,repoPath:n})})}function mg(r,i,n){return Oe("/api/git/commit",{method:Pt,headers:{"Content-Type":Wt},body:JSON.stringify({workspaceId:r,message:i,repoPath:n})})}function yg(r,i,n){return Oe("/api/git/discard",{method:Pt,headers:{"Content-Type":Wt},body:JSON.stringify({workspaceId:r,paths:i,repoPath:n})})}function wg(r,i,n,_){const p={workspaceId:r,path:i,staged:n.toString()};_!==void 0&&(p.repoPath=_);const L=new URLSearchParams(p);return Oe(`/api/git/diff?${L.toString()}`)}function Sg(r,i){return Oe("/api/git/push",{method:Pt,headers:{"Content-Type":Wt},body:JSON.stringify({workspaceId:r,repoPath:i})})}function Cg(r,i){return Oe("/api/git/pull",{method:Pt,headers:{"Content-Type":Wt},body:JSON.stringify({workspaceId:r,repoPath:i})})}function xg(r,i){return Oe("/api/git/fetch",{method:Pt,headers:{"Content-Type":Wt},body:JSON.stringify({workspaceId:r,repoPath:i})})}function ep(r,i){const n={workspaceId:r};i!==void 0&&(n.repoPath=i);const _=new URLSearchParams(n);return Oe(`/api/git/branch-status?${_.toString()}`)}function tp(r,i){const n={workspaceId:r};i!==void 0&&(n.repoPath=i);const _=new URLSearchParams(n);return Oe(`/api/git/remotes?${_.toString()}`)}function bg(r,i){const n={workspaceId:r};i!==void 0&&(n.repoPath=i);const _=new URLSearchParams(n);return Oe(`/api/git/branches?${_.toString()}`)}function Eg(r,i,n){return Oe("/api/git/checkout",{method:Pt,headers:{"Content-Type":Wt},body:JSON.stringify({workspaceId:r,branchName:i,repoPath:n})})}function kg(r,i,n=!0,_){return Oe("/api/git/create-branch",{method:Pt,headers:{"Content-Type":Wt},body:JSON.stringify({workspaceId:r,branchName:i,checkout:n,repoPath:_})})}function Lg(r,i=50,n){const _={workspaceId:r,limit:String(i)};n!==void 0&&(_.repoPath=n);const p=new URLSearchParams(_);return Oe(`/api/git/log?${p.toString()}`)}const Rg='audio/webm; codecs="opus"',Tg=64;function Dd(r){let i=0;return r.altKey&&(i|=1),r.ctrlKey&&(i|=2),r.metaKey&&(i|=4),r.shiftKey&&(i|=8),i}function Sn(r){let i=0;return r.altKey&&(i|=1),r.ctrlKey&&(i|=2),r.metaKey&&(i|=4),r.shiftKey&&(i|=8),i}function Mg(r){return r===0?"left":r===1?"middle":r===2?"right":"none"}function Ad(r){return r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement||r instanceof HTMLElement&&r.isContentEditable}function Gc(r){return!r||r==="about:blank"}function Ts(r){return Gc(r)?null:r}function Bd(r){if(r.title.trim())return r.title.trim();if(r.url&&!Gc(r.url))try{return new URL(r.url).hostname||r.url}catch{return r.url}return"新しいタブ"}function Dg(r,i=2e3){return r.iceGatheringState==="complete"?Promise.resolve():new Promise(n=>{const _=()=>{r.removeEventListener("icegatheringstatechange",p),n()},p=()=>{r.iceGatheringState==="complete"&&_()};r.addEventListener("icegatheringstatechange",p),setTimeout(_,i)})}function Ag(){try{return new URLSearchParams(window.location.search).get("webrtc")==="1"}catch{return!1}}function rp({wsBase:r}){const i=$.useRef(null),n=$.useRef(null),_=$.useRef(null),p=$.useRef(null),L=$.useRef(null),R=$.useRef(null),o=$.useRef(null),d=$.useRef(null),v=$.useRef({width:0,height:0}),y=$.useRef(!1),f=$.useRef(null),C=$.useRef(!1),b=$.useRef(null),M=$.useRef(null),w=$.useRef(null),c=$.useRef(null),h=$.useRef([]),l=$.useRef({width:0,height:0}),u=$.useRef(!1),g=$.useRef("none"),S=$.useRef(null),E=$.useRef(0),T=$.useRef(null),k=$.useRef(null),[N,V]=$.useState(null),[K,O]=$.useState(""),[B,U]=$.useState(!1),[z,q]=$.useState(!1),[Y,W]=$.useState(!1),[A,I]=$.useState(!1),[P,H]=$.useState(!1),[J,ie]=$.useState(null),[ae,ue]=$.useState(!1),[X,j]=$.useState(null),[se,te]=$.useState(null),ce=$.useCallback(oe=>{const he=i.current;!he||he.readyState!==WebSocket.OPEN||he.send(JSON.stringify(oe))},[]),_e=$.useCallback(()=>{const{width:oe,height:he}=l.current;oe>0&&he>0&&ce({type:"resize",width:oe,height:he})},[ce]),Le=$.useCallback(()=>{C.current=!1,v.current={width:0,height:0},f.current=null,U(!1);const oe=o.current;oe&&d.current&&d.current.clearRect(0,0,oe.width,oe.height)},[]),ke=$.useCallback(oe=>{if(f.current=oe,y.current)return;const he=()=>{const Ce=f.current;Ce!==null&&(f.current=null,y.current=!0,createImageBitmap(new Blob([Ce],{type:"image/jpeg"})).then(De=>{const Ue=o.current;if(!Ue){De.close();return}d.current||(d.current=Ue.getContext("2d"));const We=d.current;if(!We){De.close();return}(Ue.width!==De.width||Ue.height!==De.height)&&(Ue.width=De.width,Ue.height=De.height),v.current={width:De.width,height:De.height},We.drawImage(De,0,0),De.close(),C.current||(C.current=!0,U(!0)),k.current&&(clearTimeout(k.current),k.current=null),q(!1)}).catch(()=>{}).finally(()=>{y.current=!1,f.current!==null&&he()}))};he()},[]);$.useEffect(()=>{let oe=!0;return fg().then(he=>{if(!oe)return;V(he),ie(he.audio),T.current=he.activeTabId;const Ce=Ts(he.pageUrl);Ce&&O(Ce),he.error&&j(he.error)}).catch(he=>{oe&&j(he instanceof Error?he.message:"Browser status failed")}),()=>{oe=!1}},[]),$.useEffect(()=>{const oe=R.current;if(!oe)return;const he=new ResizeObserver(([Ce])=>{const De=Math.floor(Ce.contentRect.width),Ue=Math.floor(Ce.contentRect.height);De<=0||Ue<=0||l.current.width===De&&l.current.height===Ue||(l.current={width:De,height:Ue},ce({type:"resize",width:De,height:Ue}))});return he.observe(oe),()=>he.disconnect()},[ce]),$.useEffect(()=>{let oe=!1;const he=()=>{S.current&&(clearTimeout(S.current),S.current=null)},Ce=async()=>{if(!oe){he();try{const{token:De,authEnabled:Ue}=await Qo();if(oe)return;const We=`${r}/api/browser/ws`,ar=Ue?`${We}?token=${encodeURIComponent(De)}`:We,xt=new WebSocket(ar);xt.binaryType="arraybuffer",i.current=xt,xt.addEventListener("open",()=>{E.current=0,W(!0),j(null),_e()}),xt.addEventListener("message",_t=>{if(_t.data instanceof ArrayBuffer){ke(_t.data);return}if(typeof _t.data!="string")return;let et;try{et=JSON.parse(_t.data)}catch{return}if(et.type==="clear"){Le(),q(!0),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{k.current=null,q(!1)},2500);return}if(et.type==="status"){const Be=et.status;if(V(Be),ie(Be.audio),Be.activeTabId!==T.current){T.current=Be.activeTabId;const ht=Be.tabs.find(rt=>rt.id===Be.activeTabId);O(Ts(ht==null?void 0:ht.url)??"")}else{const ht=Ts(Be.pageUrl);ht&&O(ht)}Be.error&&j(Be.error);return}et.type==="error"&&j(et.error)}),xt.addEventListener("close",()=>{if(i.current===xt&&(i.current=null),W(!1),oe)return;const _t=Math.min(E.current+1,6);E.current=_t,S.current=setTimeout(Ce,500*Math.pow(2,_t-1))}),xt.addEventListener("error",()=>{W(!1)})}catch(De){if(oe)return;j(De instanceof Error?De.message:"Browser connection failed");const Ue=Math.min(E.current+1,6);E.current=Ue,S.current=setTimeout(Ce,500*Math.pow(2,Ue-1))}}};return Ce(),()=>{oe=!0,he(),i.current&&(i.current.close(),i.current=null)}},[Le,ke,_e,r]),$.useEffect(()=>()=>{k.current&&(clearTimeout(k.current),k.current=null)},[]),$.useEffect(()=>{if(!Ag())return;let oe=!1,he=null,Ce=null;const De=()=>{if(he){try{he.close()}catch{}he=null}if(Ce){try{Ce.close()}catch{}Ce=null}p.current=null,_.current=null,I(!1)};return(async()=>{try{const{token:We,authEnabled:ar}=await Qo();if(oe)return;const xt=`${r}/api/browser/webrtc/ws`,_t=ar?`${xt}?token=${encodeURIComponent(We)}`:xt;Ce=new WebSocket(_t),_.current=Ce,Ce.addEventListener("open",async()=>{var et;if(!(oe||!Ce)){he=new RTCPeerConnection({iceServers:[]}),p.current=he,he.addTransceiver("video",{direction:"recvonly"}),he.ontrack=Be=>{const[ht]=Be.streams,rt=L.current;rt&&ht&&(rt.srcObject=ht,rt.play().catch(()=>{}),I(!0))},he.onconnectionstatechange=()=>{const Be=he==null?void 0:he.connectionState;(Be==="failed"||Be==="disconnected"||Be==="closed")&&I(!1)};try{const Be=await he.createOffer();if(await he.setLocalDescription(Be),await Dg(he),oe||!Ce||Ce.readyState!==WebSocket.OPEN)return;Ce.send(JSON.stringify({type:"webrtc-offer",sdp:(et=he.localDescription)==null?void 0:et.sdp}))}catch(Be){oe||j(Be instanceof Error?Be.message:"WebRTC negotiation failed")}}}),Ce.addEventListener("message",async et=>{if(typeof et.data!="string")return;let Be;try{Be=JSON.parse(et.data)}catch{return}Be.type==="webrtc-answer"&&Be.sdp&&he?await he.setRemoteDescription({type:"answer",sdp:Be.sdp}).catch(ht=>{oe||j(ht instanceof Error?ht.message:"setRemoteDescription failed")}):Be.type==="webrtc-error"&&Be.error&&j(Be.error)}),Ce.addEventListener("close",()=>{I(!1)})}catch(We){oe||j(We instanceof Error?We.message:"WebRTC connection failed")}})(),()=>{oe=!0,De()}},[r]);const Ie=$.useCallback(()=>{const oe=w.current;if(!oe||oe.updating)return;const he=h.current.shift();if(he)try{oe.appendBuffer(he)}catch(Ce){h.current.unshift(he),te(Ce instanceof Error?Ce.message:"Browser audio append failed")}},[]),Ne=$.useCallback(oe=>{const he=oe.slice(0),Ce=w.current;if(!Ce||Ce.updating||h.current.length>0){h.current.length<Tg&&h.current.push(he);return}try{Ce.appendBuffer(he)}catch(De){te(De instanceof Error?De.message:"Browser audio append failed")}},[]),ge=$.useCallback(()=>{const oe=n.current;n.current=null,oe&&oe.readyState!==WebSocket.CLOSED&&oe.readyState!==WebSocket.CLOSING&&oe.close(),h.current=[],w.current=null;const he=M.current;if(M.current=null,(he==null?void 0:he.readyState)==="open")try{he.endOfStream()}catch{}const Ce=b.current;Ce&&(Ce.pause(),Ce.removeAttribute("src"),Ce.load()),c.current&&(URL.revokeObjectURL(c.current),c.current=null),H(!1)},[]),Xe=$.useCallback(async()=>{var Ue;if(((Ue=n.current)==null?void 0:Ue.readyState)===WebSocket.OPEN)return;const oe=(J==null?void 0:J.mimeType)||Rg;if(typeof MediaSource>"u"||!MediaSource.isTypeSupported(oe)){te(`This browser cannot play ${oe}`),H(!1);return}ge(),te(null),H(!0);const he=new MediaSource;M.current=he;const Ce=URL.createObjectURL(he);c.current=Ce;const De=b.current;De&&(De.src=Ce,De.autoplay=!0,De.play().catch(()=>{})),he.addEventListener("sourceopen",()=>{if(M.current===he)try{const We=he.addSourceBuffer(oe);We.mode="sequence",w.current=We,We.addEventListener("updateend",Ie),Ie()}catch(We){te(We instanceof Error?We.message:"Browser audio setup failed"),H(!1)}},{once:!0});try{const{token:We,authEnabled:ar}=await Qo(),xt=`${r}/api/browser/audio/ws`,_t=ar?`${xt}?token=${encodeURIComponent(We)}`:xt,et=new WebSocket(_t);et.binaryType="arraybuffer",n.current=et,et.addEventListener("message",Be=>{var ht;if(typeof Be.data=="string"){let rt;try{rt=JSON.parse(Be.data)}catch{return}if(rt.type==="audio-status"){ie(rt.status),rt.status.error?te(rt.status.error):rt.status.available&&te(null);return}rt.type==="audio-error"&&(te(rt.error),H(!1));return}Be.data instanceof ArrayBuffer&&(Ne(Be.data),(ht=b.current)==null||ht.play().catch(()=>{}))}),et.addEventListener("close",()=>{n.current===et&&(n.current=null),H(!1)}),et.addEventListener("error",()=>{te("Browser audio connection failed"),H(!1)})}catch(We){ge(),te(We instanceof Error?We.message:"Browser audio failed")}},[Ne,J,Ie,ge,r]);$.useEffect(()=>()=>ge(),[ge]);const kt=$.useCallback(()=>{if(P||n.current){ge();return}Xe()},[P,Xe,ge]),yt=$.useCallback(async()=>{ue(!0),j(null);try{const oe=await pg();V(oe),ie(oe.audio);const he=Ts(oe.pageUrl);he&&O(he)}catch(oe){j(oe instanceof Error?oe.message:"Browser start failed")}finally{ue(!1)}},[]),Je=$.useCallback(async()=>{ue(!0),j(null);try{const oe=await _g();V(oe),ie(oe.audio),Le(),ge()}catch(oe){j(oe instanceof Error?oe.message:"Browser stop failed")}finally{ue(!1)}},[Le,ge]),Qe=$.useCallback(async()=>{const oe=K.trim();if(oe){ue(!0),j(null);try{const he=await vg(oe);V(he),ie(he.audio);const Ce=Ts(he.pageUrl);Ce&&O(Ce)}catch(he){j(he instanceof Error?he.message:"Navigate failed")}finally{ue(!1)}}},[K]),Ze=$.useCallback(()=>{ce({type:"new-tab"})},[ce]),Vt=$.useCallback(oe=>{oe!==T.current&&ce({type:"activate-tab",targetId:oe})},[ce]),wt=$.useCallback(oe=>{ce({type:"close-tab",targetId:oe})},[ce]),at=$.useCallback((oe,he)=>{const Ce=o.current;if(!Ce)return null;const De=Ce.getBoundingClientRect();if(De.width<=0||De.height<=0)return null;const Ue=v.current.width||Ce.width||l.current.width||1280,We=v.current.height||Ce.height||l.current.height||720,ar=Math.min(De.width/Ue,De.height/We),xt=Ue*ar,_t=We*ar,et=De.left+(De.width-xt)/2,Be=De.top+(De.height-_t)/2,ht=Math.max(0,Math.min(Ue,(oe-et)/xt*Ue)),rt=Math.max(0,Math.min(We,(he-Be)/_t*We));return{x:ht,y:rt}},[]),St=$.useCallback(oe=>at(oe.clientX,oe.clientY),[at]),ft=$.useCallback(oe=>{const he=St(oe);he&&ce({type:"mouse",eventType:"mouseMoved",x:he.x,y:he.y,button:u.current?g.current:"none",modifiers:Sn(oe)})},[St,ce]),or=$.useCallback(oe=>{var Ce;const he=St(oe);he&&(oe.preventDefault(),(Ce=R.current)==null||Ce.focus({preventScroll:!0}),u.current=!0,g.current=Mg(oe.button),ce({type:"mouse",eventType:"mousePressed",x:he.x,y:he.y,button:g.current,clickCount:oe.detail||1,modifiers:Sn(oe)}))},[St,ce]),Ct=$.useCallback(oe=>{const he=St(oe);if(!he)return;oe.preventDefault();const Ce=g.current;u.current=!1,g.current="none",ce({type:"mouse",eventType:"mouseReleased",x:he.x,y:he.y,button:Ce,clickCount:oe.detail||1,modifiers:Sn(oe)})},[St,ce]);$.useEffect(()=>{const oe=he=>{if(!u.current)return;const Ce=at(he.clientX,he.clientY),De=g.current;u.current=!1,g.current="none",Ce&&ce({type:"mouse",eventType:"mouseReleased",x:Ce.x,y:Ce.y,button:De,clickCount:1,modifiers:Sn(he)})};return window.addEventListener("mouseup",oe),()=>window.removeEventListener("mouseup",oe)},[at,ce]);const Ot=$.useCallback(oe=>{const he=St(oe);he&&(oe.preventDefault(),ce({type:"mouse",eventType:"mouseWheel",x:he.x,y:he.y,button:"none",deltaX:oe.deltaX,deltaY:oe.deltaY,modifiers:Sn(oe)}))},[St,ce]),ze=$.useCallback(oe=>{if(Ad(oe.target))return;oe.preventDefault();const he=!oe.ctrlKey&&!oe.metaKey&&!oe.altKey&&oe.key.length===1?oe.key:void 0;ce({type:"key",eventType:"keyDown",key:oe.key,code:oe.code,text:he,modifiers:Dd(oe)})},[ce]),Br=$.useCallback(oe=>{Ad(oe.target)||(oe.preventDefault(),ce({type:"key",eventType:"keyUp",key:oe.key,code:oe.code,modifiers:Dd(oe)}))},[ce]),Se=(J==null?void 0:J.reason)||se||(P?"Stop audio":"Start audio"),Re=(N==null?void 0:N.running)??!1,Ke=(N==null?void 0:N.launching)??!1,Ge=(N==null?void 0:N.tabs)??[],Tt=(N==null?void 0:N.activeTabId)??null,He=B&&!Gc(N==null?void 0:N.pageUrl),pt=A||He?"page":!Re&&!Ke?"stopped":Ke?"launching":Y?z?"switching":"ready":"connecting",Ye=Y?Ke?"launching":P?"connected · audio":"connected":"offline";return D.jsxs("section",{className:"browser-layout",children:[D.jsxs("div",{className:"browser-toolbar",children:[D.jsxs("div",{className:"browser-address-group",children:[D.jsx("button",{type:"button",className:"browser-toolbar-button",onClick:yt,disabled:ae||(N==null?void 0:N.running),title:"Start","aria-label":"Start browser",children:"▶"}),D.jsx("button",{type:"button",className:"browser-toolbar-button",onClick:Je,disabled:ae||!(N!=null&&N.running),title:"Stop","aria-label":"Stop browser",children:"■"}),D.jsx("button",{type:"button",className:P?"browser-toolbar-button browser-toolbar-button-active":"browser-toolbar-button",onClick:kt,disabled:ae||!(N!=null&&N.running),title:Se,"aria-label":"Browser audio",children:D.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:D.jsx("path",{d:"M4 9v6h4l5 4V5L8 9H4zm11.5-1.5v9a5 5 0 000-9zm2.5-2.5v14a8 8 0 000-14z",fill:"currentColor"})})}),D.jsx("button",{type:"button",className:"browser-toolbar-button",onClick:()=>ce({type:"back"}),disabled:!(N!=null&&N.running),title:"戻る","aria-label":"Back",children:"←"}),D.jsx("button",{type:"button",className:"browser-toolbar-button",onClick:()=>ce({type:"forward"}),disabled:!(N!=null&&N.running),title:"進む","aria-label":"Forward",children:"→"}),D.jsx("button",{type:"button",className:"browser-toolbar-button",onClick:()=>ce({type:"reload"}),disabled:!(N!=null&&N.running),title:"再読み込み","aria-label":"Reload",children:"⟳"}),D.jsxs("form",{className:"browser-address-form",onSubmit:oe=>{oe.preventDefault(),Qe()},children:[D.jsx("input",{className:"browser-address-input",value:K,onChange:oe=>O(oe.target.value),placeholder:"URLを入力 (例: example.com)",spellCheck:!1,autoCapitalize:"off",autoComplete:"off","aria-label":"URL"}),D.jsx("button",{type:"submit",className:"browser-go-button",disabled:ae,title:"Go","aria-label":"Go",children:"→"})]})]}),D.jsxs("div",{className:"browser-status-line",title:(N==null?void 0:N.profileDir)||"",children:[D.jsx("span",{className:Re?"browser-dot browser-dot-running":"browser-dot"}),D.jsx("span",{children:Ye})]})]}),Re&&Ge.length>0&&D.jsxs("div",{className:"browser-tabs",role:"tablist",children:[Ge.map(oe=>D.jsxs("div",{role:"tab","aria-selected":oe.id===Tt,className:oe.id===Tt?"browser-tab browser-tab-active":"browser-tab",onClick:()=>Vt(oe.id),onAuxClick:he=>{he.button===1&&(he.preventDefault(),wt(oe.id))},title:Ts(oe.url)??Bd(oe),children:[D.jsx("span",{className:"browser-tab-title",children:Bd(oe)}),D.jsx("button",{type:"button",className:"browser-tab-close",onClick:he=>{he.stopPropagation(),wt(oe.id)},title:"タブを閉じる","aria-label":"タブを閉じる",children:"×"})]},oe.id)),D.jsx("button",{type:"button",className:"browser-tab-new",onClick:Ze,title:"新しいタブ","aria-label":"新しいタブ",children:"+"})]}),(X||se)&&D.jsx("div",{className:"browser-error",children:X||se}),D.jsx("audio",{ref:b,className:"browser-audio"}),D.jsxs("div",{ref:R,className:"browser-viewport",tabIndex:0,onKeyDown:ze,onKeyUp:Br,children:[D.jsx("canvas",{ref:o,className:"browser-frame",style:{display:!A&&pt==="page"?"block":"none"},onMouseMove:ft,onMouseDown:or,onMouseUp:Ct,onWheel:Ot,onContextMenu:oe=>oe.preventDefault()}),D.jsx("video",{ref:L,className:"browser-frame",style:{display:A?"block":"none"},autoPlay:!0,playsInline:!0,muted:!0}),pt==="stopped"&&D.jsxs("div",{className:"browser-state",children:[D.jsx("div",{className:"browser-state-title",children:"ブラウザは停止中です"}),D.jsx("button",{type:"button",className:"browser-state-action",onClick:yt,disabled:ae,children:"▶ 起動する"})]}),pt==="launching"&&D.jsxs("div",{className:"browser-state",children:[D.jsx("div",{className:"browser-spinner","aria-hidden":"true"}),D.jsx("div",{className:"browser-state-title",children:"ブラウザを起動中…"})]}),pt==="connecting"&&D.jsxs("div",{className:"browser-state",children:[D.jsx("div",{className:"browser-spinner","aria-hidden":"true"}),D.jsx("div",{className:"browser-state-title",children:"接続中…"})]}),pt==="switching"&&D.jsxs("div",{className:"browser-state",children:[D.jsx("div",{className:"browser-spinner","aria-hidden":"true"}),D.jsx("div",{className:"browser-state-title",children:"読み込み中…"})]}),pt==="ready"&&D.jsxs("div",{className:"browser-state",children:[D.jsx("div",{className:"browser-state-title",children:"準備完了"}),D.jsx("div",{className:"browser-state-hint",children:"上のバーにURLを入力してEnterでアクセスできます"})]})]})]})}function sa(){return{files:[],activeFileId:null,tree:[],treeLoading:!1,treeError:null}}function na(){return{terminals:[],activeTerminalId:null}}function ip(r,i){var n;return i&&r.some(_=>_.id===i)?i:((n=r[0])==null?void 0:n.id)??null}function Bg(r){const i=r.lastIndexOf(".");return i===-1||i===0?"":r.slice(i+1).toLowerCase()}function Pg(r){const i=Bg(r);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"}[i]||"plaintext"}function Ht(r){return r instanceof Error?r.message:String(r)}function oa(r){return r.map(i=>({...i,expanded:!1,loading:!1,children:i.type==="dir"?[]:void 0}))}function sp(r){return Pg(r)}function Oc(r,i,n){return i?r.map(_=>{if(_.path===i&&_.type==="dir"){const L=[..._.children||[],n].sort((R,o)=>R.type!==o.type?R.type==="dir"?-1:1:R.name.localeCompare(o.name));return{..._,children:L,expanded:!0}}return _.children?{..._,children:Oc(_.children,i,n)}:_}):[...r,n].sort((p,L)=>p.type!==L.type?p.type==="dir"?-1:1:p.name.localeCompare(L.name))}function Nc(r,i){return r.filter(n=>n.path===i?!1:(n.children&&(n.children=Nc(n.children,i)),!0))}function As(r,i,n){return r.map(_=>_.path===i?n(_):_.children?{..._,children:As(_.children,i,n)}:_)}function Pd(r){return r.trim().replace(/[\\/]+$/,"").replace(/\\/g,"/").toLowerCase()}function Og(r){return r.includes("\\")?"\\":"/"}function Ng(r,i){const n=Og(r),_=r.replace(/[\\/]+$/,"");return _?`${_}${n}${i}`:i}function Od(r){const i=r.replace(/[\\/]+$/,"");if(!i)return r;if(/^[A-Za-z]:$/.test(i))return`${i}\\`;if(i==="/")return"/";const n=Math.max(i.lastIndexOf("/"),i.lastIndexOf("\\"));if(i.startsWith("/")&&n===0)return"/";if(n<=0)return i;const _=i.slice(0,n);return/^[A-Za-z]:$/.test(_)?`${_}\\`:_}function np(){if(typeof window>"u")return{view:"terminal",workspaceId:null,deckIds:[],workspaceMode:"list"};const r=new URLSearchParams(window.location.search),i=r.get("view"),n=r.get("mode"),_=r.get("decks")||r.get("deck"),p=_?_.split(",").filter(Boolean):[];return{view:i==="workspace"||i==="browser"?i:"terminal",workspaceId:r.get("workspace"),deckIds:p,workspaceMode:n==="editor"?"editor":"list"}}function Ig(){if(typeof window>"u")return"light";const r=window.localStorage.getItem(Vf);return r==="light"||r==="dark"?r:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Xt(r,i=1e4){return Promise.race([r,new Promise((n,_)=>setTimeout(()=>_(new Error("Request timeout")),i))])}var nc={exports:{}},Nd;function jg(){return Nd||(Nd=1,(function(r,i){(function(n,_){r.exports=_()})(globalThis,(()=>(()=>{var n={4567:function(R,o,d){var v=this&&this.__decorate||function(l,u,g,S){var E,T=arguments.length,k=T<3?u:S===null?S=Object.getOwnPropertyDescriptor(u,g):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(l,u,g,S);else for(var N=l.length-1;N>=0;N--)(E=l[N])&&(k=(T<3?E(k):T>3?E(u,g,k):E(u,g))||k);return T>3&&k&&Object.defineProperty(u,g,k),k},y=this&&this.__param||function(l,u){return function(g,S){u(g,S,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const f=d(9042),C=d(9924),b=d(844),M=d(4725),w=d(2585),c=d(3656);let h=o.AccessibilityManager=class extends b.Disposable{constructor(l,u,g,S){super(),this._terminal=l,this._coreBrowserService=g,this._renderService=S,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let E=0;E<this._terminal.rows;E++)this._rowElements[E]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[E]);if(this._topBoundaryFocusListener=E=>this._handleBoundaryFocus(E,0),this._bottomBoundaryFocusListener=E=>this._handleBoundaryFocus(E,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new C.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((E=>this._handleResize(E.rows)))),this.register(this._terminal.onRender((E=>this._refreshRows(E.start,E.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((E=>this._handleChar(E)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
41
+ `)))),this.register(this._terminal.onA11yTab((E=>this._handleTab(E)))),this.register(this._terminal.onKey((E=>this._handleKey(E.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,c.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(l){for(let u=0;u<l;u++)this._handleChar(" ")}_handleChar(l){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==l&&(this._charsToAnnounce+=l):this._charsToAnnounce+=l,l===`
42
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(l){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(l)||this._charsToConsume.push(l)}_refreshRows(l,u){this._liveRegionDebouncer.refresh(l,u,this._terminal.rows)}_renderRows(l,u){const g=this._terminal.buffer,S=g.lines.length.toString();for(let E=l;E<=u;E++){const T=g.lines.get(g.ydisp+E),k=[],N=(T==null?void 0:T.translateToString(!0,void 0,void 0,k))||"",V=(g.ydisp+E+1).toString(),K=this._rowElements[E];K&&(N.length===0?(K.innerText=" ",this._rowColumns.set(K,[0,1])):(K.textContent=N,this._rowColumns.set(K,k)),K.setAttribute("aria-posinset",V),K.setAttribute("aria-setsize",S))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(l,u){const g=l.target,S=this._rowElements[u===0?1:this._rowElements.length-2];if(g.getAttribute("aria-posinset")===(u===0?"1":`${this._terminal.buffer.lines.length}`)||l.relatedTarget!==S)return;let E,T;if(u===0?(E=g,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(E=this._rowElements.shift(),T=g,this._rowContainer.removeChild(E)),E.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),u===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(u===0?-1:1),this._rowElements[u===0?1:this._rowElements.length-2].focus(),l.preventDefault(),l.stopImmediatePropagation()}_handleSelectionChange(){var N;if(this._rowElements.length===0)return;const l=document.getSelection();if(!l)return;if(l.isCollapsed)return void(this._rowContainer.contains(l.anchorNode)&&this._terminal.clearSelection());if(!l.anchorNode||!l.focusNode)return void console.error("anchorNode and/or focusNode are null");let u={node:l.anchorNode,offset:l.anchorOffset},g={node:l.focusNode,offset:l.focusOffset};if((u.node.compareDocumentPosition(g.node)&Node.DOCUMENT_POSITION_PRECEDING||u.node===g.node&&u.offset>g.offset)&&([u,g]=[g,u]),u.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(u={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(u.node))return;const S=this._rowElements.slice(-1)[0];if(g.node.compareDocumentPosition(S)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(g={node:S,offset:((N=S.textContent)==null?void 0:N.length)??0}),!this._rowContainer.contains(g.node))return;const E=({node:V,offset:K})=>{const O=V instanceof Text?V.parentNode:V;let B=parseInt(O==null?void 0:O.getAttribute("aria-posinset"),10)-1;if(isNaN(B))return console.warn("row is invalid. Race condition?"),null;const U=this._rowColumns.get(O);if(!U)return console.warn("columns is null. Race condition?"),null;let z=K<U.length?U[K]:U.slice(-1)[0]+1;return z>=this._terminal.cols&&(++B,z=0),{row:B,column:z}},T=E(u),k=E(g);if(T&&k){if(T.row>k.row||T.row===k.row&&T.column>=k.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(k.row-T.row)*this._terminal.cols-T.column+k.column)}}_handleResize(l){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let u=this._rowContainer.children.length;u<this._terminal.rows;u++)this._rowElements[u]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[u]);for(;this._rowElements.length>l;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const l=this._coreBrowserService.mainDocument.createElement("div");return l.setAttribute("role","listitem"),l.tabIndex=-1,this._refreshRowDimensions(l),l}_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 l=0;l<this._terminal.rows;l++)this._refreshRowDimensions(this._rowElements[l])}}_refreshRowDimensions(l){l.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=h=v([y(1,w.IInstantiationService),y(2,M.ICoreBrowserService),y(3,M.IRenderService)],h)},3614:(R,o)=>{function d(C){return C.replace(/\r?\n/g,"\r")}function v(C,b){return b?"\x1B[200~"+C+"\x1B[201~":C}function y(C,b,M,w){C=v(C=d(C),M.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),M.triggerDataEvent(C,!0),b.value=""}function f(C,b,M){const w=M.getBoundingClientRect(),c=C.clientX-w.left-10,h=C.clientY-w.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${c}px`,b.style.top=`${h}px`,b.style.zIndex="1000",b.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=d,o.bracketTextForPaste=v,o.copyHandler=function(C,b){C.clipboardData&&C.clipboardData.setData("text/plain",b.selectionText),C.preventDefault()},o.handlePasteEvent=function(C,b,M,w){C.stopPropagation(),C.clipboardData&&y(C.clipboardData.getData("text/plain"),b,M,w)},o.paste=y,o.moveTextAreaUnderMouseCursor=f,o.rightClickHandler=function(C,b,M,w,c){f(C,b,M),c&&w.rightClickSelect(C),b.value=w.selectionText,b.select()}},7239:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const v=d(1505);o.ColorContrastCache=class{constructor(){this._color=new v.TwoKeyMap,this._css=new v.TwoKeyMap}setCss(y,f,C){this._css.set(y,f,C)}getCss(y,f){return this._css.get(y,f)}setColor(y,f,C){this._color.set(y,f,C)}getColor(y,f){return this._color.get(y,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(d,v,y,f){d.addEventListener(v,y,f);let C=!1;return{dispose:()=>{C||(C=!0,d.removeEventListener(v,y,f))}}}},3551:function(R,o,d){var v=this&&this.__decorate||function(h,l,u,g){var S,E=arguments.length,T=E<3?l:g===null?g=Object.getOwnPropertyDescriptor(l,u):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(h,l,u,g);else for(var k=h.length-1;k>=0;k--)(S=h[k])&&(T=(E<3?S(T):E>3?S(l,u,T):S(l,u))||T);return E>3&&T&&Object.defineProperty(l,u,T),T},y=this&&this.__param||function(h,l){return function(u,g){l(u,g,h)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const f=d(3656),C=d(8460),b=d(844),M=d(2585),w=d(4725);let c=o.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(h,l,u,g,S){super(),this._element=h,this._mouseService=l,this._renderService=u,this._bufferService=g,this._linkProviderService=S,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new C.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new C.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{var E;this._lastMouseEvent=void 0,(E=this._activeProviderReplies)==null||E.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(h){this._lastMouseEvent=h;const l=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!l)return;this._isMouseOut=!1;const u=h.composedPath();for(let g=0;g<u.length;g++){const S=u[g];if(S.classList.contains("xterm"))break;if(S.classList.contains("xterm-hover"))return}this._lastBufferCell&&l.x===this._lastBufferCell.x&&l.y===this._lastBufferCell.y||(this._handleHover(l),this._lastBufferCell=l)}_handleHover(h){if(this._activeLine!==h.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(h,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,h)||(this._clearCurrentLink(),this._askForLink(h,!0))}_askForLink(h,l){var g,S;this._activeProviderReplies&&l||((g=this._activeProviderReplies)==null||g.forEach((E=>{E==null||E.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=h.y);let u=!1;for(const[E,T]of this._linkProviderService.linkProviders.entries())l?(S=this._activeProviderReplies)!=null&&S.get(E)&&(u=this._checkLinkProviderResult(E,h,u)):T.provideLinks(h.y,(k=>{var V,K;if(this._isMouseOut)return;const N=k==null?void 0:k.map((O=>({link:O})));(V=this._activeProviderReplies)==null||V.set(E,N),u=this._checkLinkProviderResult(E,h,u),((K=this._activeProviderReplies)==null?void 0:K.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)}))}_removeIntersectingLinks(h,l){const u=new Set;for(let g=0;g<l.size;g++){const S=l.get(g);if(S)for(let E=0;E<S.length;E++){const T=S[E],k=T.link.range.start.y<h?0:T.link.range.start.x,N=T.link.range.end.y>h?this._bufferService.cols:T.link.range.end.x;for(let V=k;V<=N;V++){if(u.has(V)){S.splice(E--,1);break}u.add(V)}}}}_checkLinkProviderResult(h,l,u){var E;if(!this._activeProviderReplies)return u;const g=this._activeProviderReplies.get(h);let S=!1;for(let T=0;T<h;T++)this._activeProviderReplies.has(T)&&!this._activeProviderReplies.get(T)||(S=!0);if(!S&&g){const T=g.find((k=>this._linkAtPosition(k.link,l)));T&&(u=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!u)for(let T=0;T<this._activeProviderReplies.size;T++){const k=(E=this._activeProviderReplies.get(T))==null?void 0:E.find((N=>this._linkAtPosition(N.link,l)));if(k){u=!0,this._handleNewLink(k);break}}return u}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._currentLink)return;const l=this._positionFromMouseEvent(h,this._element,this._mouseService);l&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,l)&&this._currentLink.link.activate(h,this._currentLink.link.text)}_clearCurrentLink(h,l){this._currentLink&&this._lastMouseEvent&&(!h||!l||this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=l)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(h){if(!this._lastMouseEvent)return;const l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._linkAtPosition(h.link,l)&&(this._currentLink=h,this._currentLink.state={decorations:{underline:h.link.decorations===void 0||h.link.decorations.underline,pointerCursor:h.link.decorations===void 0||h.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,h.link,this._lastMouseEvent),h.link.decorations={},Object.defineProperties(h.link.decorations,{pointerCursor:{get:()=>{var u,g;return(g=(u=this._currentLink)==null?void 0:u.state)==null?void 0:g.decorations.pointerCursor},set:u=>{var g;(g=this._currentLink)!=null&&g.state&&this._currentLink.state.decorations.pointerCursor!==u&&(this._currentLink.state.decorations.pointerCursor=u,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",u))}},underline:{get:()=>{var u,g;return(g=(u=this._currentLink)==null?void 0:u.state)==null?void 0:g.decorations.underline},set:u=>{var g,S,E;(g=this._currentLink)!=null&&g.state&&((E=(S=this._currentLink)==null?void 0:S.state)==null?void 0:E.decorations.underline)!==u&&(this._currentLink.state.decorations.underline=u,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,u))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((u=>{if(!this._currentLink)return;const g=u.start===0?0:u.start+1+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.ydisp+1+u.end;if(this._currentLink.link.range.start.y>=g&&this._currentLink.link.range.end.y<=S&&(this._clearCurrentLink(g,S),this._lastMouseEvent)){const E=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);E&&this._askForLink(E,!1)}}))))}_linkHover(h,l,u){var g;(g=this._currentLink)!=null&&g.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!0),this._currentLink.state.decorations.pointerCursor&&h.classList.add("xterm-cursor-pointer")),l.hover&&l.hover(u,l.text)}_fireUnderlineEvent(h,l){const u=h.range,g=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(u.start.x-1,u.start.y-g-1,u.end.x,u.end.y-g-1,void 0);(l?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)}_linkLeave(h,l,u){var g;(g=this._currentLink)!=null&&g.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!1),this._currentLink.state.decorations.pointerCursor&&h.classList.remove("xterm-cursor-pointer")),l.leave&&l.leave(u,l.text)}_linkAtPosition(h,l){const u=h.range.start.y*this._bufferService.cols+h.range.start.x,g=h.range.end.y*this._bufferService.cols+h.range.end.x,S=l.y*this._bufferService.cols+l.x;return u<=S&&S<=g}_positionFromMouseEvent(h,l,u){const g=u.getCoords(h,l,this._bufferService.cols,this._bufferService.rows);if(g)return{x:g[0],y:g[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,l,u,g,S){return{x1:h,y1:l,x2:u,y2:g,cols:this._bufferService.cols,fg:S}}};o.Linkifier=c=v([y(1,w.IMouseService),y(2,w.IRenderService),y(3,M.IBufferService),y(4,w.ILinkProviderService)],c)},9042:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(R,o,d){var v=this&&this.__decorate||function(w,c,h,l){var u,g=arguments.length,S=g<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,h):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(w,c,h,l);else for(var E=w.length-1;E>=0;E--)(u=w[E])&&(S=(g<3?u(S):g>3?u(c,h,S):u(c,h))||S);return g>3&&S&&Object.defineProperty(c,h,S),S},y=this&&this.__param||function(w,c){return function(h,l){c(h,l,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const f=d(511),C=d(2585);let b=o.OscLinkProvider=class{constructor(w,c,h){this._bufferService=w,this._optionsService=c,this._oscLinkService=h}provideLinks(w,c){var N;const h=this._bufferService.buffer.lines.get(w-1);if(!h)return void c(void 0);const l=[],u=this._optionsService.rawOptions.linkHandler,g=new f.CellData,S=h.getTrimmedLength();let E=-1,T=-1,k=!1;for(let V=0;V<S;V++)if(T!==-1||h.hasContent(V)){if(h.loadCell(V,g),g.hasExtendedAttrs()&&g.extended.urlId){if(T===-1){T=V,E=g.extended.urlId;continue}k=g.extended.urlId!==E}else T!==-1&&(k=!0);if(k||T!==-1&&V===S-1){const K=(N=this._oscLinkService.getLinkData(E))==null?void 0:N.uri;if(K){const O={start:{x:T+1,y:w},end:{x:V+(k||V!==S-1?0:1),y:w}};let B=!1;if(!(u!=null&&u.allowNonHttpProtocols))try{const U=new URL(K);["http:","https:"].includes(U.protocol)||(B=!0)}catch{B=!0}B||l.push({text:K,range:O,activate:(U,z)=>u?u.activate(U,z,O):M(0,z),hover:(U,z)=>{var q;return(q=u==null?void 0:u.hover)==null?void 0:q.call(u,U,z,O)},leave:(U,z)=>{var q;return(q=u==null?void 0:u.leave)==null?void 0:q.call(u,U,z,O)}})}k=!1,g.hasExtendedAttrs()&&g.extended.urlId?(T=V,E=g.extended.urlId):(T=-1,E=-1)}}c(l)}};function M(w,c){if(confirm(`Do you want to navigate to ${c}?
43
+
44
+ WARNING: This link could potentially be dangerous`)){const h=window.open();if(h){try{h.opener=null}catch{}h.location.href=c}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=b=v([y(0,C.IBufferService),y(1,C.IOptionsService),y(2,C.IOscLinkService)],b)},6193:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(d,v){this._renderCallback=d,this._coreBrowserService=v,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(d){return this._refreshCallbacks.push(d),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(d,v,y){this._rowCount=y,d=d!==void 0?d:0,v=v!==void 0?v:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,d):d,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,v):v,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const d=Math.max(this._rowStart,0),v=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(d,v),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const d of this._refreshCallbacks)d(0);this._refreshCallbacks=[]}}},3236:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const v=d(3614),y=d(3656),f=d(3551),C=d(9042),b=d(3730),M=d(1680),w=d(3107),c=d(5744),h=d(2950),l=d(1296),u=d(428),g=d(4269),S=d(5114),E=d(8934),T=d(3230),k=d(9312),N=d(4725),V=d(6731),K=d(8055),O=d(8969),B=d(8460),U=d(844),z=d(6114),q=d(8437),Y=d(2584),W=d(7399),A=d(5941),I=d(9074),P=d(2585),H=d(5435),J=d(4567),ie=d(779);class ae extends O.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(X={}){super(X),this.browser=z,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new U.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._decorationService=this._instantiationService.createInstance(I.DecorationService),this._instantiationService.setService(P.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ie.LinkProviderService),this._instantiationService.setService(N.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((j,se)=>this.refresh(j,se)))),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,U.toDisposable)((()=>{var j,se;this._customKeyEventHandler=void 0,(se=(j=this.element)==null?void 0:j.parentNode)==null||se.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const j of X){let se,te="";switch(j.index){case 256:se="foreground",te="10";break;case 257:se="background",te="11";break;case 258:se="cursor",te="12";break;default:se="ansi",te="4;"+j.index}switch(j.type){case 0:const ce=K.color.toColorRGB(se==="ansi"?this._themeService.colors.ansi[j.index]:this._themeService.colors[se]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${te};${(0,A.toRgbString)(ce)}${Y.C1_ESCAPED.ST}`);break;case 1:if(se==="ansi")this._themeService.modifyColors((_e=>_e.ansi[j.index]=K.channels.toColor(...j.color)));else{const _e=se;this._themeService.modifyColors((Le=>Le[_e]=K.channels.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(X){X?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(J.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(X){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var X;return(X=this.textarea)==null?void 0:X.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.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 X=this.buffer.ybase+this.buffer.y,j=this.buffer.lines.get(X);if(!j)return;const se=Math.min(this.buffer.x,this.cols-1),te=this._renderService.dimensions.css.cell.height,ce=j.getWidth(se),_e=this._renderService.dimensions.css.cell.width*ce,Le=this.buffer.y*this._renderService.dimensions.css.cell.height,ke=se*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ke+"px",this.textarea.style.top=Le+"px",this.textarea.style.width=_e+"px",this.textarea.style.height=te+"px",this.textarea.style.lineHeight=te+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",(j=>{this.hasSelection()&&(0,v.copyHandler)(j,this._selectionService)})));const X=j=>(0,v.handlePasteEvent)(j,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",X)),this.register((0,y.addDisposableDomListener)(this.element,"paste",X)),z.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(j=>{j.button===2&&(0,v.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(j=>{(0,v.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),z.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(j=>{j.button===1&&(0,v.moveTextAreaUnderMouseCursor)(j,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(X=>this._keyUp(X)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(X=>this._keyDown(X)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(X=>this._keyPress(X)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(X=>this._compositionHelper.compositionupdate(X)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(X=>this._inputEvent(X)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(X){var se;if(!X)throw new Error("Terminal requires a parent element.");if(X.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((se=this.element)==null?void 0:se.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=X.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),X.appendChild(this.element);const j=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),j.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,y.addDisposableDomListener)(this.screenElement,"mousemove",(te=>this.updateCursorStyle(te)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),j.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",C.promptLabel),z.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(S.CoreBrowserService,this.textarea,X.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(N.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",(te=>this._handleTextAreaFocus(te)))),this.register((0,y.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(u.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(N.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(V.ThemeService),this._instantiationService.setService(N.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(g.CharacterJoinerService),this._instantiationService.setService(N.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(N.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((te=>this._onRender.fire(te)))),this.onResize((te=>this._renderService.resize(te.cols,te.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(h.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(E.MouseService),this._instantiationService.setService(N.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(j);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(M.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((te=>this.scrollLines(te.amount,te.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(k.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(N.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((te=>this.scrollLines(te.amount,te.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((te=>this._renderService.handleSelectionChanged(te.start,te.end,te.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((te=>{this.textarea.value=te,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((te=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,y.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(te=>this._selectionService.handleMouseDown(te)))),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(J.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(te=>this._handleScreenReaderModeOptionChange(te)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(c.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(te=>{!this._overviewRulerRenderer&&te&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(c.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(l.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const X=this,j=this.element;function se(_e){const Le=X._mouseService.getMouseReportCoords(_e,X.screenElement);if(!Le)return!1;let ke,Ie;switch(_e.overrideType||_e.type){case"mousemove":Ie=32,_e.buttons===void 0?(ke=3,_e.button!==void 0&&(ke=_e.button<3?_e.button:3)):ke=1&_e.buttons?0:4&_e.buttons?1:2&_e.buttons?2:3;break;case"mouseup":Ie=0,ke=_e.button<3?_e.button:3;break;case"mousedown":Ie=1,ke=_e.button<3?_e.button:3;break;case"wheel":if(X._customWheelEventHandler&&X._customWheelEventHandler(_e)===!1||X.viewport.getLinesScrolled(_e)===0)return!1;Ie=_e.deltaY<0?0:1,ke=4;break;default:return!1}return!(Ie===void 0||ke===void 0||ke>4)&&X.coreMouseService.triggerMouseEvent({col:Le.col,row:Le.row,x:Le.x,y:Le.y,button:ke,action:Ie,ctrl:_e.ctrlKey,alt:_e.altKey,shift:_e.shiftKey})}const te={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ce={mouseup:_e=>(se(_e),_e.buttons||(this._document.removeEventListener("mouseup",te.mouseup),te.mousedrag&&this._document.removeEventListener("mousemove",te.mousedrag)),this.cancel(_e)),wheel:_e=>(se(_e),this.cancel(_e,!0)),mousedrag:_e=>{_e.buttons&&se(_e)},mousemove:_e=>{_e.buttons||se(_e)}};this.register(this.coreMouseService.onProtocolChange((_e=>{_e?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(_e)),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&_e?te.mousemove||(j.addEventListener("mousemove",ce.mousemove),te.mousemove=ce.mousemove):(j.removeEventListener("mousemove",te.mousemove),te.mousemove=null),16&_e?te.wheel||(j.addEventListener("wheel",ce.wheel,{passive:!1}),te.wheel=ce.wheel):(j.removeEventListener("wheel",te.wheel),te.wheel=null),2&_e?te.mouseup||(te.mouseup=ce.mouseup):(this._document.removeEventListener("mouseup",te.mouseup),te.mouseup=null),4&_e?te.mousedrag||(te.mousedrag=ce.mousedrag):(this._document.removeEventListener("mousemove",te.mousedrag),te.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(j,"mousedown",(_e=>{if(_e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(_e))return se(_e),te.mouseup&&this._document.addEventListener("mouseup",te.mouseup),te.mousedrag&&this._document.addEventListener("mousemove",te.mousedrag),this.cancel(_e)}))),this.register((0,y.addDisposableDomListener)(j,"wheel",(_e=>{if(!te.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(_e)===!1)return!1;if(!this.buffer.hasScrollback){const Le=this.viewport.getLinesScrolled(_e);if(Le===0)return;const ke=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(_e.deltaY<0?"A":"B");let Ie="";for(let Ne=0;Ne<Math.abs(Le);Ne++)Ie+=ke;return this.coreService.triggerDataEvent(Ie,!0),this.cancel(_e,!0)}return this.viewport.handleWheel(_e)?this.cancel(_e):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(j,"touchstart",(_e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(_e),this.cancel(_e)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(j,"touchmove",(_e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(_e)?void 0:this.cancel(_e)}),{passive:!1}))}refresh(X,j){var se;(se=this._renderService)==null||se.refreshRows(X,j)}updateCursorStyle(X){var j;(j=this._selectionService)!=null&&j.shouldColumnSelect(X)?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(X,j,se=0){var te;se===1?(super.scrollLines(X,j,se),this.refresh(0,this.rows-1)):(te=this.viewport)==null||te.scrollLines(X)}paste(X){(0,v.paste)(X,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(X){this._customKeyEventHandler=X}attachCustomWheelEventHandler(X){this._customWheelEventHandler=X}registerLinkProvider(X){return this._linkProviderService.registerLinkProvider(X)}registerCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const j=this._characterJoinerService.register(X);return this.refresh(0,this.rows-1),j}deregisterCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(X)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(X){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+X)}registerDecoration(X){return this._decorationService.registerDecoration(X)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(X,j,se){this._selectionService.setSelection(X,j,se)}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 X;(X=this._selectionService)==null||X.clearSelection()}selectAll(){var X;(X=this._selectionService)==null||X.selectAll()}selectLines(X,j){var se;(se=this._selectionService)==null||se.selectLines(X,j)}_keyDown(X){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;const j=this.browser.isMac&&this.options.macOptionIsMeta&&X.altKey;if(!j&&!this._compositionHelper.keydown(X))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;j||X.key!=="Dead"&&X.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const se=(0,W.evaluateKeyboardEvent)(X,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),se.type===3||se.type===2){const te=this.rows-1;return this.scrollLines(se.type===2?-te:te),this.cancel(X,!0)}return se.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,X)||(se.cancel&&this.cancel(X,!0),!se.key||!!(X.key&&!X.ctrlKey&&!X.altKey&&!X.metaKey&&X.key.length===1&&X.key.charCodeAt(0)>=65&&X.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(se.key!==Y.C0.ETX&&se.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:se.key,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(se.key,!0),!this.optionsService.rawOptions.screenReaderMode||X.altKey||X.ctrlKey?this.cancel(X,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(X,j){const se=X.isMac&&!this.options.macOptionIsMeta&&j.altKey&&!j.ctrlKey&&!j.metaKey||X.isWindows&&j.altKey&&j.ctrlKey&&!j.metaKey||X.isWindows&&j.getModifierState("AltGraph");return j.type==="keypress"?se:se&&(!j.keyCode||j.keyCode>47)}_keyUp(X){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||((function(j){return j.keyCode===16||j.keyCode===17||j.keyCode===18})(X)||this.focus(),this.updateCursorStyle(X),this._keyPressHandled=!1)}_keyPress(X){let j;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)j=X.charCode;else if(X.which===null||X.which===void 0)j=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;j=X.which}return!(!j||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X)||(j=String.fromCharCode(j),this._onKey.fire({key:j,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(j,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(X){if(X.data&&X.inputType==="insertText"&&(!X.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const j=X.data;return this.coreService.triggerDataEvent(j,!0),this.cancel(X),!0}return!1}resize(X,j){X!==this.cols||j!==this.rows?super.resize(X,j):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(X,j){var se,te;(se=this._charSizeService)==null||se.measure(),(te=this.viewport)==null||te.syncScrollArea(!0)}clear(){var X;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(q.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(X=this.viewport)==null||X.reset(),this.refresh(0,this.rows-1)}}reset(){var j,se;this.options.rows=this.rows,this.options.cols=this.cols;const X=this._customKeyEventHandler;this._setup(),super.reset(),(j=this._selectionService)==null||j.reset(),this._decorationService.reset(),(se=this.viewport)==null||se.reset(),this._customKeyEventHandler=X,this.refresh(0,this.rows-1)}clearTextureAtlas(){var X;(X=this._renderService)==null||X.clearTextureAtlas()}_reportFocus(){var X;(X=this.element)!=null&&X.classList.contains("focus")?this.coreService.triggerDataEvent(Y.C0.ESC+"[I"):this.coreService.triggerDataEvent(Y.C0.ESC+"[O")}_reportWindowsOptions(X){if(this._renderService)switch(X){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const j=this._renderService.dimensions.css.canvas.width.toFixed(0),se=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${se};${j}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const te=this._renderService.dimensions.css.cell.width.toFixed(0),ce=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[6;${ce};${te}t`)}}cancel(X,j){if(this.options.cancelEvents||j)return X.preventDefault(),X.stopPropagation(),!1}}o.Terminal=ae},9924:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(d,v=1e3){this._renderCallback=d,this._debounceThresholdMS=v,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(d,v,y){this._rowCount=y,d=d!==void 0?d:0,v=v!==void 0?v:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,d):d,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,v):v;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const C=f-this._lastRefreshMs,b=this._debounceThresholdMS-C;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const d=Math.max(this._rowStart,0),v=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(d,v)}}},1680:function(R,o,d){var v=this&&this.__decorate||function(h,l,u,g){var S,E=arguments.length,T=E<3?l:g===null?g=Object.getOwnPropertyDescriptor(l,u):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(h,l,u,g);else for(var k=h.length-1;k>=0;k--)(S=h[k])&&(T=(E<3?S(T):E>3?S(l,u,T):S(l,u))||T);return E>3&&T&&Object.defineProperty(l,u,T),T},y=this&&this.__param||function(h,l){return function(u,g){l(u,g,h)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const f=d(3656),C=d(4725),b=d(8460),M=d(844),w=d(2585);let c=o.Viewport=class extends M.Disposable{constructor(h,l,u,g,S,E,T,k){super(),this._viewportElement=h,this._scrollArea=l,this._bufferService=u,this._optionsService=g,this._charSizeService=S,this._renderService=E,this._coreBrowserService=T,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((N=>this._activeBuffer=N.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((N=>this._renderDimensions=N))),this._handleThemeChange(k.colors),this.register(k.onChangeColors((N=>this._handleThemeChange(N)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(h){this._viewportElement.style.backgroundColor=h.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(h){if(h)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const l=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==l&&(this._lastRecordedBufferHeight=l,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const h=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==h&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=h),this._refreshAnimationFrame=null}syncScrollArea(h=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(h);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(h)}_handleScroll(h){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 h=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(h*(this._smoothScrollState.target-this._smoothScrollState.origin)),h<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(h,l){const u=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(l<0&&this._viewportElement.scrollTop!==0||l>0&&u<this._lastRecordedBufferHeight)||(h.cancelable&&h.preventDefault(),!1)}handleWheel(h){const l=this._getPixelsScrolled(h);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(h,l))}scrollLines(h){if(h!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const l=h*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:h,suppressScrollEvent:!1})}_getPixelsScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let l=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_LINE?l*=this._currentRowHeight:h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._currentRowHeight*this._bufferService.rows),l}getBufferElements(h,l){var k;let u,g="";const S=[],E=l??this._bufferService.buffer.lines.length,T=this._bufferService.buffer.lines;for(let N=h;N<E;N++){const V=T.get(N);if(!V)continue;const K=(k=T.get(N+1))==null?void 0:k.isWrapped;if(g+=V.translateToString(!K),!K||N===T.length-1){const O=document.createElement("div");O.textContent=g,S.push(O),g.length>0&&(u=O),g=""}}return{bufferElements:S,cursorElement:u}}getLinesScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let l=this._applyScrollModifier(h.deltaY,h);return h.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):h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l}_applyScrollModifier(h,l){const u=this._optionsService.rawOptions.fastScrollModifier;return u==="alt"&&l.altKey||u==="ctrl"&&l.ctrlKey||u==="shift"&&l.shiftKey?h*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:h*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(h){this._lastTouchY=h.touches[0].pageY}handleTouchMove(h){const l=this._lastTouchY-h.touches[0].pageY;return this._lastTouchY=h.touches[0].pageY,l!==0&&(this._viewportElement.scrollTop+=l,this._bubbleScroll(h,l))}};o.Viewport=c=v([y(2,w.IBufferService),y(3,w.IOptionsService),y(4,C.ICharSizeService),y(5,C.IRenderService),y(6,C.ICoreBrowserService),y(7,C.IThemeService)],c)},3107:function(R,o,d){var v=this&&this.__decorate||function(w,c,h,l){var u,g=arguments.length,S=g<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,h):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(w,c,h,l);else for(var E=w.length-1;E>=0;E--)(u=w[E])&&(S=(g<3?u(S):g>3?u(c,h,S):u(c,h))||S);return g>3&&S&&Object.defineProperty(c,h,S),S},y=this&&this.__param||function(w,c){return function(h,l){c(h,l,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const f=d(4725),C=d(844),b=d(2585);let M=o.BufferDecorationRenderer=class extends C.Disposable{constructor(w,c,h,l,u){super(),this._screenElement=w,this._bufferService=c,this._coreBrowserService=h,this._decorationService=l,this._renderService=u,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((g=>this._removeDecoration(g)))),this.register((0,C.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 w of this._decorationService.decorations)this._renderDecoration(w);this._dimensionsChanged=!1}_renderDecoration(w){this._refreshStyle(w),this._dimensionsChanged&&this._refreshXPosition(w)}_createElement(w){var l;const c=this._coreBrowserService.mainDocument.createElement("div");c.classList.add("xterm-decoration"),c.classList.toggle("xterm-decoration-top-layer",((l=w==null?void 0:w.options)==null?void 0:l.layer)==="top"),c.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,c.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",c.style.top=(w.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 h=w.options.x??0;return h&&h>this._bufferService.cols&&(c.style.display="none"),this._refreshXPosition(w,c),c}_refreshStyle(w){const c=w.marker.line-this._bufferService.buffers.active.ydisp;if(c<0||c>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let h=this._decorationElements.get(w);h||(h=this._createElement(w),w.element=h,this._decorationElements.set(w,h),this._container.appendChild(h),w.onDispose((()=>{this._decorationElements.delete(w),h.remove()}))),h.style.top=c*this._renderService.dimensions.css.cell.height+"px",h.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(h)}}_refreshXPosition(w,c=w.element){if(!c)return;const h=w.options.x??0;(w.options.anchor||"left")==="right"?c.style.right=h?h*this._renderService.dimensions.css.cell.width+"px":"":c.style.left=h?h*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){var c;(c=this._decorationElements.get(w))==null||c.remove(),this._decorationElements.delete(w),w.dispose()}};o.BufferDecorationRenderer=M=v([y(1,b.IBufferService),y(2,f.ICoreBrowserService),y(3,b.IDecorationService),y(4,f.IRenderService)],M)},5871:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(d){if(d.options.overviewRulerOptions){for(const v of this._zones)if(v.color===d.options.overviewRulerOptions.color&&v.position===d.options.overviewRulerOptions.position){if(this._lineIntersectsZone(v,d.marker.line))return;if(this._lineAdjacentToZone(v,d.marker.line,d.options.overviewRulerOptions.position))return void this._addLineToZone(v,d.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=d.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=d.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=d.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=d.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:d.options.overviewRulerOptions.color,position:d.options.overviewRulerOptions.position,startBufferLine:d.marker.line,endBufferLine:d.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(d){this._linePadding=d}_lineIntersectsZone(d,v){return v>=d.startBufferLine&&v<=d.endBufferLine}_lineAdjacentToZone(d,v,y){return v>=d.startBufferLine-this._linePadding[y||"full"]&&v<=d.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(d,v){d.startBufferLine=Math.min(d.startBufferLine,v),d.endBufferLine=Math.max(d.endBufferLine,v)}}},5744:function(R,o,d){var v=this&&this.__decorate||function(u,g,S,E){var T,k=arguments.length,N=k<3?g:E===null?E=Object.getOwnPropertyDescriptor(g,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(u,g,S,E);else for(var V=u.length-1;V>=0;V--)(T=u[V])&&(N=(k<3?T(N):k>3?T(g,S,N):T(g,S))||N);return k>3&&N&&Object.defineProperty(g,S,N),N},y=this&&this.__param||function(u,g){return function(S,E){g(S,E,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const f=d(5871),C=d(4725),b=d(844),M=d(2585),w={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0};let l=o.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(u,g,S,E,T,k,N){var K;super(),this._viewportElement=u,this._screenElement=g,this._bufferService=S,this._decorationService=E,this._renderService=T,this._optionsService=k,this._coreBrowserService=N,this._colorZoneStore=new f.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(K=this._viewportElement.parentElement)==null||K.insertBefore(this._canvas,this._viewportElement);const V=this._canvas.getContext("2d");if(!V)throw new Error("Ctx cannot be null");this._ctx=V,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{var O;(O=this._canvas)==null||O.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const u=Math.floor(this._canvas.width/3),g=Math.ceil(this._canvas.width/3);c.full=this._canvas.width,c.left=u,c.center=g,c.right=u,this._refreshDrawHeightConstants(),h.full=0,h.left=0,h.center=c.left,h.right=c.left+c.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const u=this._canvas.height/this._bufferService.buffer.lines.length,g=Math.round(Math.max(Math.min(u,12),6)*this._coreBrowserService.dpr);w.left=g,w.center=g,w.right=g}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const g of this._decorationService.decorations)this._colorZoneStore.addDecoration(g);this._ctx.lineWidth=1;const u=this._colorZoneStore.zones;for(const g of u)g.position!=="full"&&this._renderColorZone(g);for(const g of u)g.position==="full"&&this._renderColorZone(g);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(u){this._ctx.fillStyle=u.color,this._ctx.fillRect(h[u.position||"full"],Math.round((this._canvas.height-1)*(u.startBufferLine/this._bufferService.buffers.active.lines.length)-w[u.position||"full"]/2),c[u.position||"full"],Math.round((this._canvas.height-1)*((u.endBufferLine-u.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[u.position||"full"]))}_queueRefresh(u,g){this._shouldUpdateDimensions=u||this._shouldUpdateDimensions,this._shouldUpdateAnchor=g||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=l=v([y(2,M.IBufferService),y(3,M.IDecorationService),y(4,C.IRenderService),y(5,M.IOptionsService),y(6,C.ICoreBrowserService)],l)},2950:function(R,o,d){var v=this&&this.__decorate||function(w,c,h,l){var u,g=arguments.length,S=g<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,h):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(w,c,h,l);else for(var E=w.length-1;E>=0;E--)(u=w[E])&&(S=(g<3?u(S):g>3?u(c,h,S):u(c,h))||S);return g>3&&S&&Object.defineProperty(c,h,S),S},y=this&&this.__param||function(w,c){return function(h,l){c(h,l,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const f=d(4725),C=d(2585),b=d(2584);let M=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,c,h,l,u,g){this._textarea=w,this._compositionView=c,this._bufferService=h,this._optionsService=l,this._coreService=u,this._renderService=g,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(w){this._compositionView.textContent=w.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(w){if(this._isComposing||this._isSendingComposition){if(w.keyCode===229||w.keyCode===16||w.keyCode===17||w.keyCode===18)return!1;this._finalizeComposition(!1)}return w.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(w){if(this._compositionView.classList.remove("active"),this._isComposing=!1,w){const c={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let h;this._isSendingComposition=!1,c.start+=this._dataAlreadySent.length,h=this._isComposing?this._textarea.value.substring(c.start,c.end):this._textarea.value.substring(c.start),h.length>0&&this._coreService.triggerDataEvent(h,!0)}}),0)}else{this._isSendingComposition=!1;const c=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(c,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const c=this._textarea.value,h=c.replace(w,"");this._dataAlreadySent=h,c.length>w.length?this._coreService.triggerDataEvent(h,!0):c.length<w.length?this._coreService.triggerDataEvent(`${b.C0.DEL}`,!0):c.length===w.length&&c!==w&&this._coreService.triggerDataEvent(c,!0)}}),0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const c=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),h=this._renderService.dimensions.css.cell.height,l=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,u=c*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=u+"px",this._compositionView.style.top=l+"px",this._compositionView.style.height=h+"px",this._compositionView.style.lineHeight=h+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const g=this._compositionView.getBoundingClientRect();this._textarea.style.left=u+"px",this._textarea.style.top=l+"px",this._textarea.style.width=Math.max(g.width,1)+"px",this._textarea.style.height=Math.max(g.height,1)+"px",this._textarea.style.lineHeight=g.height+"px"}w||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=M=v([y(2,C.IBufferService),y(3,C.IOptionsService),y(4,C.ICoreService),y(5,f.IRenderService)],M)},9806:(R,o)=>{function d(v,y,f){const C=f.getBoundingClientRect(),b=v.getComputedStyle(f),M=parseInt(b.getPropertyValue("padding-left")),w=parseInt(b.getPropertyValue("padding-top"));return[y.clientX-C.left-M,y.clientY-C.top-w]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=d,o.getCoords=function(v,y,f,C,b,M,w,c,h){if(!M)return;const l=d(v,y,f);return l?(l[0]=Math.ceil((l[0]+(h?w/2:0))/w),l[1]=Math.ceil(l[1]/c),l[0]=Math.min(Math.max(l[0],1),C+(h?1:0)),l[1]=Math.min(Math.max(l[1],1),b),l):void 0}},9504:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const v=d(2584);function y(c,h,l,u){const g=c-f(c,l),S=h-f(h,l),E=Math.abs(g-S)-(function(T,k,N){let V=0;const K=T-f(T,N),O=k-f(k,N);for(let B=0;B<Math.abs(K-O);B++){const U=C(T,k)==="A"?-1:1,z=N.buffer.lines.get(K+U*B);z!=null&&z.isWrapped&&V++}return V})(c,h,l);return w(E,M(C(c,h),u))}function f(c,h){let l=0,u=h.buffer.lines.get(c),g=u==null?void 0:u.isWrapped;for(;g&&c>=0&&c<h.rows;)l++,u=h.buffer.lines.get(--c),g=u==null?void 0:u.isWrapped;return l}function C(c,h){return c>h?"A":"B"}function b(c,h,l,u,g,S){let E=c,T=h,k="";for(;E!==l||T!==u;)E+=g?1:-1,g&&E>S.cols-1?(k+=S.buffer.translateBufferLineToString(T,!1,c,E),E=0,c=0,T++):!g&&E<0&&(k+=S.buffer.translateBufferLineToString(T,!1,0,c+1),E=S.cols-1,c=E,T--);return k+S.buffer.translateBufferLineToString(T,!1,c,E)}function M(c,h){const l=h?"O":"[";return v.C0.ESC+l+c}function w(c,h){c=Math.floor(c);let l="";for(let u=0;u<c;u++)l+=h;return l}o.moveToCellSequence=function(c,h,l,u){const g=l.buffer.x,S=l.buffer.y;if(!l.buffer.hasScrollback)return(function(k,N,V,K,O,B){return y(N,K,O,B).length===0?"":w(b(k,N,k,N-f(N,O),!1,O).length,M("D",B))})(g,S,0,h,l,u)+y(S,h,l,u)+(function(k,N,V,K,O,B){let U;U=y(N,K,O,B).length>0?K-f(K,O):N;const z=K,q=(function(Y,W,A,I,P,H){let J;return J=y(A,I,P,H).length>0?I-f(I,P):W,Y<A&&J<=I||Y>=A&&J<I?"C":"D"})(k,N,V,K,O,B);return w(b(k,U,V,z,q==="C",O).length,M(q,B))})(g,S,c,h,l,u);let E;if(S===h)return E=g>c?"D":"C",w(Math.abs(g-c),M(E,u));E=S>h?"D":"C";const T=Math.abs(S-h);return w((function(k,N){return N.cols-k})(S>h?c:g,l)+(T-1)*l.cols+1+((S>h?g:c)-1),M(E,u))}},1296:function(R,o,d){var v=this&&this.__decorate||function(B,U,z,q){var Y,W=arguments.length,A=W<3?U:q===null?q=Object.getOwnPropertyDescriptor(U,z):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(B,U,z,q);else for(var I=B.length-1;I>=0;I--)(Y=B[I])&&(A=(W<3?Y(A):W>3?Y(U,z,A):Y(U,z))||A);return W>3&&A&&Object.defineProperty(U,z,A),A},y=this&&this.__param||function(B,U){return function(z,q){U(z,q,B)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const f=d(3787),C=d(2550),b=d(2223),M=d(6171),w=d(6052),c=d(4725),h=d(8055),l=d(8460),u=d(844),g=d(2585),S="xterm-dom-renderer-owner-",E="xterm-rows",T="xterm-fg-",k="xterm-bg-",N="xterm-focus",V="xterm-selection";let K=1,O=o.DomRenderer=class extends u.Disposable{constructor(B,U,z,q,Y,W,A,I,P,H,J,ie,ae){super(),this._terminal=B,this._document=U,this._element=z,this._screenElement=q,this._viewportElement=Y,this._helperContainer=W,this._linkifier2=A,this._charSizeService=P,this._optionsService=H,this._bufferService=J,this._coreBrowserService=ie,this._themeService=ae,this._terminalClass=K++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new l.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(E),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(V),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,M.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ue=>this._injectCss(ue)))),this._injectCss(this._themeService.colors),this._rowFactory=I.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(S+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ue=>this._handleLinkHover(ue)))),this.register(this._linkifier2.onHideLinkUnderline((ue=>this._handleLinkLeave(ue)))),this.register((0,u.toDisposable)((()=>{this._element.classList.remove(S+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new C.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const B=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*B,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*B),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/B),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/B),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const z of this._rowElements)z.style.width=`${this.dimensions.css.canvas.width}px`,z.style.height=`${this.dimensions.css.cell.height}px`,z.style.lineHeight=`${this.dimensions.css.cell.height}px`,z.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const U=`${this._terminalSelector} .${E} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=U,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(B){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let U=`${this._terminalSelector} .${E} { color: ${B.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;U+=`${this._terminalSelector} .${E} .xterm-dim { color: ${h.color.multiplyOpacity(B.foreground,.5).css};}`,U+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const z=`blink_underline_${this._terminalClass}`,q=`blink_bar_${this._terminalClass}`,Y=`blink_block_${this._terminalClass}`;U+=`@keyframes ${z} { 50% { border-bottom-style: hidden; }}`,U+=`@keyframes ${q} { 50% { box-shadow: none; }}`,U+=`@keyframes ${Y} { 0% { background-color: ${B.cursor.css}; color: ${B.cursorAccent.css}; } 50% { background-color: inherit; color: ${B.cursor.css}; }}`,U+=`${this._terminalSelector} .${E}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${E}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${E}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block { background-color: ${B.cursor.css}; color: ${B.cursorAccent.css};}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${B.cursor.css} !important; color: ${B.cursorAccent.css} !important;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${B.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${B.cursor.css} inset;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${B.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,U+=`${this._terminalSelector} .${V} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${V} div { position: absolute; background-color: ${B.selectionBackgroundOpaque.css};}${this._terminalSelector} .${V} div { position: absolute; background-color: ${B.selectionInactiveBackgroundOpaque.css};}`;for(const[W,A]of B.ansi.entries())U+=`${this._terminalSelector} .${T}${W} { color: ${A.css}; }${this._terminalSelector} .${T}${W}.xterm-dim { color: ${h.color.multiplyOpacity(A,.5).css}; }${this._terminalSelector} .${k}${W} { background-color: ${A.css}; }`;U+=`${this._terminalSelector} .${T}${b.INVERTED_DEFAULT_COLOR} { color: ${h.color.opaque(B.background).css}; }${this._terminalSelector} .${T}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${h.color.multiplyOpacity(h.color.opaque(B.background),.5).css}; }${this._terminalSelector} .${k}${b.INVERTED_DEFAULT_COLOR} { background-color: ${B.foreground.css}; }`,this._themeStyleElement.textContent=U}_setDefaultSpacing(){const B=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${B}px`,this._rowFactory.defaultSpacing=B}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(B,U){for(let z=this._rowElements.length;z<=U;z++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>U;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(B,U){this._refreshRowElements(B,U),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(N),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(N),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(B,U,z){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(B,U,z),this.renderRows(0,this._bufferService.rows-1),!B||!U)return;this._selectionRenderModel.update(this._terminal,B,U,z);const q=this._selectionRenderModel.viewportStartRow,Y=this._selectionRenderModel.viewportEndRow,W=this._selectionRenderModel.viewportCappedStartRow,A=this._selectionRenderModel.viewportCappedEndRow;if(W>=this._bufferService.rows||A<0)return;const I=this._document.createDocumentFragment();if(z){const P=B[0]>U[0];I.appendChild(this._createSelectionElement(W,P?U[0]:B[0],P?B[0]:U[0],A-W+1))}else{const P=q===W?B[0]:0,H=W===Y?U[0]:this._bufferService.cols;I.appendChild(this._createSelectionElement(W,P,H));const J=A-W-1;if(I.appendChild(this._createSelectionElement(W+1,0,this._bufferService.cols,J)),W!==A){const ie=Y===A?U[0]:this._bufferService.cols;I.appendChild(this._createSelectionElement(A,0,ie))}}this._selectionContainer.appendChild(I)}_createSelectionElement(B,U,z,q=1){const Y=this._document.createElement("div"),W=U*this.dimensions.css.cell.width;let A=this.dimensions.css.cell.width*(z-U);return W+A>this.dimensions.css.canvas.width&&(A=this.dimensions.css.canvas.width-W),Y.style.height=q*this.dimensions.css.cell.height+"px",Y.style.top=B*this.dimensions.css.cell.height+"px",Y.style.left=`${W}px`,Y.style.width=`${A}px`,Y}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 B of this._rowElements)B.replaceChildren()}renderRows(B,U){const z=this._bufferService.buffer,q=z.ybase+z.y,Y=Math.min(z.x,this._bufferService.cols-1),W=this._optionsService.rawOptions.cursorBlink,A=this._optionsService.rawOptions.cursorStyle,I=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=B;P<=U;P++){const H=P+z.ydisp,J=this._rowElements[P],ie=z.lines.get(H);if(!J||!ie)break;J.replaceChildren(...this._rowFactory.createRow(ie,H,H===q,A,I,Y,W,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${S}${this._terminalClass}`}_handleLinkHover(B){this._setCellUnderline(B.x1,B.x2,B.y1,B.y2,B.cols,!0)}_handleLinkLeave(B){this._setCellUnderline(B.x1,B.x2,B.y1,B.y2,B.cols,!1)}_setCellUnderline(B,U,z,q,Y,W){z<0&&(B=0),q<0&&(U=0);const A=this._bufferService.rows-1;z=Math.max(Math.min(z,A),0),q=Math.max(Math.min(q,A),0),Y=Math.min(Y,this._bufferService.cols);const I=this._bufferService.buffer,P=I.ybase+I.y,H=Math.min(I.x,Y-1),J=this._optionsService.rawOptions.cursorBlink,ie=this._optionsService.rawOptions.cursorStyle,ae=this._optionsService.rawOptions.cursorInactiveStyle;for(let ue=z;ue<=q;++ue){const X=ue+I.ydisp,j=this._rowElements[ue],se=I.lines.get(X);if(!j||!se)break;j.replaceChildren(...this._rowFactory.createRow(se,X,X===P,ie,ae,H,J,this.dimensions.css.cell.width,this._widthCache,W?ue===z?B:0:-1,W?(ue===q?U:Y)-1:-1))}}};o.DomRenderer=O=v([y(7,g.IInstantiationService),y(8,c.ICharSizeService),y(9,g.IOptionsService),y(10,g.IBufferService),y(11,c.ICoreBrowserService),y(12,c.IThemeService)],O)},3787:function(R,o,d){var v=this&&this.__decorate||function(E,T,k,N){var V,K=arguments.length,O=K<3?T:N===null?N=Object.getOwnPropertyDescriptor(T,k):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(E,T,k,N);else for(var B=E.length-1;B>=0;B--)(V=E[B])&&(O=(K<3?V(O):K>3?V(T,k,O):V(T,k))||O);return K>3&&O&&Object.defineProperty(T,k,O),O},y=this&&this.__param||function(E,T){return function(k,N){T(k,N,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const f=d(2223),C=d(643),b=d(511),M=d(2585),w=d(8055),c=d(4725),h=d(4269),l=d(6171),u=d(3734);let g=o.DomRendererRowFactory=class{constructor(E,T,k,N,V,K,O){this._document=E,this._characterJoinerService=T,this._optionsService=k,this._coreBrowserService=N,this._coreService=V,this._decorationService=K,this._themeService=O,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(E,T,k){this._selectionStart=E,this._selectionEnd=T,this._columnSelectMode=k}createRow(E,T,k,N,V,K,O,B,U,z,q){const Y=[],W=this._characterJoinerService.getJoinedCharacters(T),A=this._themeService.colors;let I,P=E.getNoBgTrimmedLength();k&&P<K+1&&(P=K+1);let H=0,J="",ie=0,ae=0,ue=0,X=!1,j=0,se=!1,te=0;const ce=[],_e=z!==-1&&q!==-1;for(let Le=0;Le<P;Le++){E.loadCell(Le,this._workCell);let ke=this._workCell.getWidth();if(ke===0)continue;let Ie=!1,Ne=Le,ge=this._workCell;if(W.length>0&&Le===W[0][0]){Ie=!0;const ze=W.shift();ge=new h.JoinedCellData(this._workCell,E.translateToString(!0,ze[0],ze[1]),ze[1]-ze[0]),Ne=ze[1]-1,ke=ge.getWidth()}const Xe=this._isCellInSelection(Le,T),kt=k&&Le===K,yt=_e&&Le>=z&&Le<=q;let Je=!1;this._decorationService.forEachDecorationAtCell(Le,T,void 0,(ze=>{Je=!0}));let Qe=ge.getChars()||C.WHITESPACE_CELL_CHAR;if(Qe===" "&&(ge.isUnderline()||ge.isOverline())&&(Qe=" "),te=ke*B-U.get(Qe,ge.isBold(),ge.isItalic()),I){if(H&&(Xe&&se||!Xe&&!se&&ge.bg===ie)&&(Xe&&se&&A.selectionForeground||ge.fg===ae)&&ge.extended.ext===ue&&yt===X&&te===j&&!kt&&!Ie&&!Je){ge.isInvisible()?J+=C.WHITESPACE_CELL_CHAR:J+=Qe,H++;continue}H&&(I.textContent=J),I=this._document.createElement("span"),H=0,J=""}else I=this._document.createElement("span");if(ie=ge.bg,ae=ge.fg,ue=ge.extended.ext,X=yt,j=te,se=Xe,Ie&&K>=Le&&K<=Ne&&(K=Le),!this._coreService.isCursorHidden&&kt&&this._coreService.isCursorInitialized){if(ce.push("xterm-cursor"),this._coreBrowserService.isFocused)O&&ce.push("xterm-cursor-blink"),ce.push(N==="bar"?"xterm-cursor-bar":N==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(V)switch(V){case"outline":ce.push("xterm-cursor-outline");break;case"block":ce.push("xterm-cursor-block");break;case"bar":ce.push("xterm-cursor-bar");break;case"underline":ce.push("xterm-cursor-underline")}}if(ge.isBold()&&ce.push("xterm-bold"),ge.isItalic()&&ce.push("xterm-italic"),ge.isDim()&&ce.push("xterm-dim"),J=ge.isInvisible()?C.WHITESPACE_CELL_CHAR:ge.getChars()||C.WHITESPACE_CELL_CHAR,ge.isUnderline()&&(ce.push(`xterm-underline-${ge.extended.underlineStyle}`),J===" "&&(J=" "),!ge.isUnderlineColorDefault()))if(ge.isUnderlineColorRGB())I.style.textDecorationColor=`rgb(${u.AttributeData.toColorRGB(ge.getUnderlineColor()).join(",")})`;else{let ze=ge.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ge.isBold()&&ze<8&&(ze+=8),I.style.textDecorationColor=A.ansi[ze].css}ge.isOverline()&&(ce.push("xterm-overline"),J===" "&&(J=" ")),ge.isStrikethrough()&&ce.push("xterm-strikethrough"),yt&&(I.style.textDecoration="underline");let Ze=ge.getFgColor(),Vt=ge.getFgColorMode(),wt=ge.getBgColor(),at=ge.getBgColorMode();const St=!!ge.isInverse();if(St){const ze=Ze;Ze=wt,wt=ze;const Br=Vt;Vt=at,at=Br}let ft,or,Ct,Ot=!1;switch(this._decorationService.forEachDecorationAtCell(Le,T,void 0,(ze=>{ze.options.layer!=="top"&&Ot||(ze.backgroundColorRGB&&(at=50331648,wt=ze.backgroundColorRGB.rgba>>8&16777215,ft=ze.backgroundColorRGB),ze.foregroundColorRGB&&(Vt=50331648,Ze=ze.foregroundColorRGB.rgba>>8&16777215,or=ze.foregroundColorRGB),Ot=ze.options.layer==="top")})),!Ot&&Xe&&(ft=this._coreBrowserService.isFocused?A.selectionBackgroundOpaque:A.selectionInactiveBackgroundOpaque,wt=ft.rgba>>8&16777215,at=50331648,Ot=!0,A.selectionForeground&&(Vt=50331648,Ze=A.selectionForeground.rgba>>8&16777215,or=A.selectionForeground)),Ot&&ce.push("xterm-decoration-top"),at){case 16777216:case 33554432:Ct=A.ansi[wt],ce.push(`xterm-bg-${wt}`);break;case 50331648:Ct=w.channels.toColor(wt>>16,wt>>8&255,255&wt),this._addStyle(I,`background-color:#${S((wt>>>0).toString(16),"0",6)}`);break;default:St?(Ct=A.foreground,ce.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):Ct=A.background}switch(ft||ge.isDim()&&(ft=w.color.multiplyOpacity(Ct,.5)),Vt){case 16777216:case 33554432:ge.isBold()&&Ze<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ze+=8),this._applyMinimumContrast(I,Ct,A.ansi[Ze],ge,ft,void 0)||ce.push(`xterm-fg-${Ze}`);break;case 50331648:const ze=w.channels.toColor(Ze>>16&255,Ze>>8&255,255&Ze);this._applyMinimumContrast(I,Ct,ze,ge,ft,or)||this._addStyle(I,`color:#${S(Ze.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(I,Ct,A.foreground,ge,ft,or)||St&&ce.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}ce.length&&(I.className=ce.join(" "),ce.length=0),kt||Ie||Je?I.textContent=J:H++,te!==this.defaultSpacing&&(I.style.letterSpacing=`${te}px`),Y.push(I),Le=Ne}return I&&H&&(I.textContent=J),Y}_applyMinimumContrast(E,T,k,N,V,K){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,l.treatGlyphAsBackgroundColor)(N.getCode()))return!1;const O=this._getContrastCache(N);let B;if(V||K||(B=O.getColor(T.rgba,k.rgba)),B===void 0){const U=this._optionsService.rawOptions.minimumContrastRatio/(N.isDim()?2:1);B=w.color.ensureContrastRatio(V||T,K||k,U),O.setColor((V||T).rgba,(K||k).rgba,B??null)}return!!B&&(this._addStyle(E,`color:${B.css}`),!0)}_getContrastCache(E){return E.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(E,T){E.setAttribute("style",`${E.getAttribute("style")||""}${T};`)}_isCellInSelection(E,T){const k=this._selectionStart,N=this._selectionEnd;return!(!k||!N)&&(this._columnSelectMode?k[0]<=N[0]?E>=k[0]&&T>=k[1]&&E<N[0]&&T<=N[1]:E<k[0]&&T>=k[1]&&E>=N[0]&&T<=N[1]:T>k[1]&&T<N[1]||k[1]===N[1]&&T===k[1]&&E>=k[0]&&E<N[0]||k[1]<N[1]&&T===N[1]&&E<N[0]||k[1]<N[1]&&T===k[1]&&E>=k[0])}};function S(E,T,k){for(;E.length<k;)E=T+E;return E}o.DomRendererRowFactory=g=v([y(1,c.ICharacterJoinerService),y(2,M.IOptionsService),y(3,c.ICoreBrowserService),y(4,M.ICoreService),y(5,M.IDecorationService),y(6,c.IThemeService)],g)},2550:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(d,v){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=d.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const y=d.createElement("span");y.classList.add("xterm-char-measure-element");const f=d.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const C=d.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontStyle="italic";const b=d.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[y,f,C,b],this._container.appendChild(y),this._container.appendChild(f),this._container.appendChild(C),this._container.appendChild(b),v.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(d,v,y,f){d===this._font&&v===this._fontSize&&y===this._weight&&f===this._weightBold||(this._font=d,this._fontSize=v,this._weight=y,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(d,v,y){let f=0;if(!v&&!y&&d.length===1&&(f=d.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const M=this._measure(d,0);return M>0&&(this._flat[f]=M),M}let C=d;v&&(C+="B"),y&&(C+="I");let b=this._holey.get(C);if(b===void 0){let M=0;v&&(M|=1),y&&(M|=2),b=this._measure(d,M),b>0&&this._holey.set(C,b)}return b}_measure(d,v){const y=this._measureElements[v];return y.textContent=d.repeat(32),y.offsetWidth/32}}},2223:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const v=d(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=v.isFirefox||v.isLegacyEdge?"bottom":"ideographic"},6171:(R,o)=>{function d(y){return 57508<=y&&y<=57558}function v(y){return y>=128512&&y<=128591||y>=127744&&y<=128511||y>=128640&&y<=128767||y>=9728&&y<=9983||y>=9984&&y<=10175||y>=65024&&y<=65039||y>=129280&&y<=129535||y>=127462&&y<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(y){if(!y)throw new Error("value must not be falsy");return y},o.isPowerlineGlyph=d,o.isRestrictedPowerlineGlyph=function(y){return 57520<=y&&y<=57527},o.isEmoji=v,o.allowRescaling=function(y,f,C,b){return f===1&&C>Math.ceil(1.5*b)&&y!==void 0&&y>255&&!v(y)&&!d(y)&&!(function(M){return 57344<=M&&M<=63743})(y)},o.treatGlyphAsBackgroundColor=function(y){return d(y)||(function(f){return 9472<=f&&f<=9631})(y)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(y,f,C=0){return(y-(2*Math.round(f)-C))%(2*Math.round(f))}},6052:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class d{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(y,f,C,b=!1){if(this.selectionStart=f,this.selectionEnd=C,!f||!C||f[0]===C[0]&&f[1]===C[1])return void this.clear();const M=y.buffers.active.ydisp,w=f[1]-M,c=C[1]-M,h=Math.max(w,0),l=Math.min(c,y.rows-1);h>=y.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=w,this.viewportEndRow=c,this.viewportCappedStartRow=h,this.viewportCappedEndRow=l,this.startCol=f[0],this.endCol=C[0])}isCellSelected(y,f,C){return!!this.hasSelection&&(C-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&C>=this.viewportCappedStartRow&&f<this.endCol&&C<=this.viewportCappedEndRow:f<this.startCol&&C>=this.viewportCappedStartRow&&f>=this.endCol&&C<=this.viewportCappedEndRow:C>this.viewportStartRow&&C<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&C===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportStartRow&&f>=this.startCol)}}o.createSelectionRenderModel=function(){return new d}},456:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(d){this._bufferService=d,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const d=this.selectionStart[0]+this.selectionStartLength;return d>this._bufferService.cols?d%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)-1]:[d%this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)]:[d,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const d=this.selectionStart[0]+this.selectionStartLength;return d>this._bufferService.cols?[d%this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)]:[Math.max(d,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const d=this.selectionStart,v=this.selectionEnd;return!(!d||!v)&&(d[1]>v[1]||d[1]===v[1]&&d[0]>v[0])}handleTrim(d){return this.selectionStart&&(this.selectionStart[1]-=d),this.selectionEnd&&(this.selectionEnd[1]-=d),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(R,o,d){var v=this&&this.__decorate||function(l,u,g,S){var E,T=arguments.length,k=T<3?u:S===null?S=Object.getOwnPropertyDescriptor(u,g):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(l,u,g,S);else for(var N=l.length-1;N>=0;N--)(E=l[N])&&(k=(T<3?E(k):T>3?E(u,g,k):E(u,g))||k);return T>3&&k&&Object.defineProperty(u,g,k),k},y=this&&this.__param||function(l,u){return function(g,S){u(g,S,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const f=d(2585),C=d(8460),b=d(844);let M=o.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(l,u,g){super(),this._optionsService=g,this.width=0,this.height=0,this._onCharSizeChange=this.register(new C.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new h(this._optionsService))}catch{this._measureStrategy=this.register(new c(l,u,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const l=this._measureStrategy.measure();l.width===this.width&&l.height===this.height||(this.width=l.width,this.height=l.height,this._onCharSizeChange.fire())}};o.CharSizeService=M=v([y(2,f.IOptionsService)],M);class w extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(u,g){u!==void 0&&u>0&&g!==void 0&&g>0&&(this._result.width=u,this._result.height=g)}}class c extends w{constructor(u,g,S){super(),this._document=u,this._parentElement=g,this._optionsService=S,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class h extends w{constructor(u){super(),this._optionsService=u,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const g=this._ctx.measureText("W");if(!("width"in g&&"fontBoundingBoxAscent"in g&&"fontBoundingBoxDescent"in g))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const u=this._ctx.measureText("W");return this._validateAndSet(u.width,u.fontBoundingBoxAscent+u.fontBoundingBoxDescent),this._result}}},4269:function(R,o,d){var v=this&&this.__decorate||function(h,l,u,g){var S,E=arguments.length,T=E<3?l:g===null?g=Object.getOwnPropertyDescriptor(l,u):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(h,l,u,g);else for(var k=h.length-1;k>=0;k--)(S=h[k])&&(T=(E<3?S(T):E>3?S(l,u,T):S(l,u))||T);return E>3&&T&&Object.defineProperty(l,u,T),T},y=this&&this.__param||function(h,l){return function(u,g){l(u,g,h)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const f=d(3734),C=d(643),b=d(511),M=d(2585);class w extends f.AttributeData{constructor(l,u,g){super(),this.content=0,this.combinedData="",this.fg=l.fg,this.bg=l.bg,this.combinedData=u,this._width=g}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()]}}o.JoinedCellData=w;let c=o.CharacterJoinerService=class op{constructor(l){this._bufferService=l,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(l){const u={id:this._nextCharacterJoinerId++,handler:l};return this._characterJoiners.push(u),u.id}deregister(l){for(let u=0;u<this._characterJoiners.length;u++)if(this._characterJoiners[u].id===l)return this._characterJoiners.splice(u,1),!0;return!1}getJoinedCharacters(l){if(this._characterJoiners.length===0)return[];const u=this._bufferService.buffer.lines.get(l);if(!u||u.length===0)return[];const g=[],S=u.translateToString(!0);let E=0,T=0,k=0,N=u.getFg(0),V=u.getBg(0);for(let K=0;K<u.getTrimmedLength();K++)if(u.loadCell(K,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==N||this._workCell.bg!==V){if(K-E>1){const O=this._getJoinedRanges(S,k,T,u,E);for(let B=0;B<O.length;B++)g.push(O[B])}E=K,k=T,N=this._workCell.fg,V=this._workCell.bg}T+=this._workCell.getChars().length||C.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-E>1){const K=this._getJoinedRanges(S,k,T,u,E);for(let O=0;O<K.length;O++)g.push(K[O])}return g}_getJoinedRanges(l,u,g,S,E){const T=l.substring(u,g);let k=[];try{k=this._characterJoiners[0].handler(T)}catch(N){console.error(N)}for(let N=1;N<this._characterJoiners.length;N++)try{const V=this._characterJoiners[N].handler(T);for(let K=0;K<V.length;K++)op._mergeRanges(k,V[K])}catch(V){console.error(V)}return this._stringRangesToCellRanges(k,S,E),k}_stringRangesToCellRanges(l,u,g){let S=0,E=!1,T=0,k=l[S];if(k){for(let N=g;N<this._bufferService.cols;N++){const V=u.getWidth(N),K=u.getString(N).length||C.WHITESPACE_CELL_CHAR.length;if(V!==0){if(!E&&k[0]<=T&&(k[0]=N,E=!0),k[1]<=T){if(k[1]=N,k=l[++S],!k)break;k[0]<=T?(k[0]=N,E=!0):E=!1}T+=K}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(l,u){let g=!1;for(let S=0;S<l.length;S++){const E=l[S];if(g){if(u[1]<=E[0])return l[S-1][1]=u[1],l;if(u[1]<=E[1])return l[S-1][1]=Math.max(u[1],E[1]),l.splice(S,1),l;l.splice(S,1),S--}else{if(u[1]<=E[0])return l.splice(S,0,u),l;if(u[1]<=E[1])return E[0]=Math.min(u[0],E[0]),l;u[0]<E[1]&&(E[0]=Math.min(u[0],E[0]),g=!0)}}return g?l[l.length-1][1]=u[1]:l.push(u),l}};o.CharacterJoinerService=c=v([y(0,M.IBufferService)],c)},5114:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const v=d(844),y=d(8460),f=d(3656);class C extends v.Disposable{constructor(w,c,h){super(),this._textarea=w,this._window=c,this.mainDocument=h,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(this._window),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new y.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((l=>this._screenDprMonitor.setWindow(l)))),this.register((0,y.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(w){this._window!==w&&(this._window=w,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=C;class b extends v.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new v.MutableDisposable),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,v.toDisposable)((()=>this.clearListener())))}setWindow(w){this._parentWindow=w,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var w;this._outerListener&&((w=this._resolutionMediaMatchList)==null||w.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const v=d(844);class y extends v.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,v.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(C){return this.linkProviders.push(C),{dispose:()=>{const b=this.linkProviders.indexOf(C);b!==-1&&this.linkProviders.splice(b,1)}}}}o.LinkProviderService=y},8934:function(R,o,d){var v=this&&this.__decorate||function(M,w,c,h){var l,u=arguments.length,g=u<3?w:h===null?h=Object.getOwnPropertyDescriptor(w,c):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(M,w,c,h);else for(var S=M.length-1;S>=0;S--)(l=M[S])&&(g=(u<3?l(g):u>3?l(w,c,g):l(w,c))||g);return u>3&&g&&Object.defineProperty(w,c,g),g},y=this&&this.__param||function(M,w){return function(c,h){w(c,h,M)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const f=d(4725),C=d(9806);let b=o.MouseService=class{constructor(M,w){this._renderService=M,this._charSizeService=w}getCoords(M,w,c,h,l){return(0,C.getCoords)(window,M,w,c,h,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(M,w){const c=(0,C.getCoordsRelativeToElement)(window,M,w);if(this._charSizeService.hasValidSize)return c[0]=Math.min(Math.max(c[0],0),this._renderService.dimensions.css.canvas.width-1),c[1]=Math.min(Math.max(c[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(c[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(c[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(c[0]),y:Math.floor(c[1])}}};o.MouseService=b=v([y(0,f.IRenderService),y(1,f.ICharSizeService)],b)},3230:function(R,o,d){var v=this&&this.__decorate||function(l,u,g,S){var E,T=arguments.length,k=T<3?u:S===null?S=Object.getOwnPropertyDescriptor(u,g):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(l,u,g,S);else for(var N=l.length-1;N>=0;N--)(E=l[N])&&(k=(T<3?E(k):T>3?E(u,g,k):E(u,g))||k);return T>3&&k&&Object.defineProperty(u,g,k),k},y=this&&this.__param||function(l,u){return function(g,S){u(g,S,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const f=d(6193),C=d(4725),b=d(8460),M=d(844),w=d(7226),c=d(2585);let h=o.RenderService=class extends M.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(l,u,g,S,E,T,k,N){super(),this._rowCount=l,this._charSizeService=S,this._renderer=this.register(new M.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new M.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((V,K)=>this._renderRows(V,K)),k),this.register(this._renderDebouncer),this.register(k.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>{var V;return(V=this._renderer.value)==null?void 0:V.clear()}))),this.register(g.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(E.onDecorationRegistered((()=>this._fullRefresh()))),this.register(E.onDecorationRemoved((()=>this._fullRefresh()))),this.register(g.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()}))),this.register(g.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(N.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,u),this.register(k.onWindowChange((V=>this._registerIntersectionObserver(V,u))))}_registerIntersectionObserver(l,u){if("IntersectionObserver"in l){const g=new l.IntersectionObserver((S=>this._handleIntersectionChange(S[S.length-1])),{threshold:0});g.observe(u),this._observerDisposable.value=(0,M.toDisposable)((()=>g.disconnect()))}}_handleIntersectionChange(l){this._isPaused=l.isIntersecting===void 0?l.intersectionRatio===0:!l.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(l,u,g=!1){this._isPaused?this._needsFullRefresh=!0:(g||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(l,u,this._rowCount))}_renderRows(l,u){this._renderer.value&&(l=Math.min(l,this._rowCount-1),u=Math.min(u,this._rowCount-1),this._renderer.value.renderRows(l,u),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:l,end:u}),this._onRender.fire({start:l,end:u}),this._isNextRenderRedrawOnly=!0)}resize(l,u){this._rowCount=u,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(l){this._renderer.value=l,this._renderer.value&&(this._renderer.value.onRequestRedraw((u=>this.refreshRows(u.start,u.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(l){return this._renderDebouncer.addRefreshCallback(l)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var l,u;this._renderer.value&&((u=(l=this._renderer.value).clearTextureAtlas)==null||u.call(l),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(l,u){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var g;return(g=this._renderer.value)==null?void 0:g.handleResize(l,u)})):this._renderer.value.handleResize(l,u),this._fullRefresh())}handleCharSizeChanged(){var l;(l=this._renderer.value)==null||l.handleCharSizeChanged()}handleBlur(){var l;(l=this._renderer.value)==null||l.handleBlur()}handleFocus(){var l;(l=this._renderer.value)==null||l.handleFocus()}handleSelectionChanged(l,u,g){var S;this._selectionState.start=l,this._selectionState.end=u,this._selectionState.columnSelectMode=g,(S=this._renderer.value)==null||S.handleSelectionChanged(l,u,g)}handleCursorMove(){var l;(l=this._renderer.value)==null||l.handleCursorMove()}clear(){var l;(l=this._renderer.value)==null||l.clear()}};o.RenderService=h=v([y(2,c.IOptionsService),y(3,C.ICharSizeService),y(4,c.IDecorationService),y(5,c.IBufferService),y(6,C.ICoreBrowserService),y(7,C.IThemeService)],h)},9312:function(R,o,d){var v=this&&this.__decorate||function(k,N,V,K){var O,B=arguments.length,U=B<3?N:K===null?K=Object.getOwnPropertyDescriptor(N,V):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(k,N,V,K);else for(var z=k.length-1;z>=0;z--)(O=k[z])&&(U=(B<3?O(U):B>3?O(N,V,U):O(N,V))||U);return B>3&&U&&Object.defineProperty(N,V,U),U},y=this&&this.__param||function(k,N){return function(V,K){N(V,K,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const f=d(9806),C=d(9504),b=d(456),M=d(4725),w=d(8460),c=d(844),h=d(6114),l=d(4841),u=d(511),g=d(2585),S=" ",E=new RegExp(S,"g");let T=o.SelectionService=class extends c.Disposable{constructor(k,N,V,K,O,B,U,z,q){super(),this._element=k,this._screenElement=N,this._linkifier=V,this._bufferService=K,this._coreService=O,this._mouseService=B,this._optionsService=U,this._renderService=z,this._coreBrowserService=q,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new u.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new w.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Y=>this._handleMouseMove(Y),this._mouseUpListener=Y=>this._handleMouseUp(Y),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Y=>this._handleTrim(Y))),this.register(this._bufferService.buffers.onBufferActivate((Y=>this._handleBufferActivate(Y)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,c.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const k=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;return!(!k||!N||k[0]===N[0]&&k[1]===N[1])}get selectionText(){const k=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;if(!k||!N)return"";const V=this._bufferService.buffer,K=[];if(this._activeSelectionMode===3){if(k[0]===N[0])return"";const O=k[0]<N[0]?k[0]:N[0],B=k[0]<N[0]?N[0]:k[0];for(let U=k[1];U<=N[1];U++){const z=V.translateBufferLineToString(U,!0,O,B);K.push(z)}}else{const O=k[1]===N[1]?N[0]:void 0;K.push(V.translateBufferLineToString(k[1],!0,k[0],O));for(let B=k[1]+1;B<=N[1]-1;B++){const U=V.lines.get(B),z=V.translateBufferLineToString(B,!0);U!=null&&U.isWrapped?K[K.length-1]+=z:K.push(z)}if(k[1]!==N[1]){const B=V.lines.get(N[1]),U=V.translateBufferLineToString(N[1],!0,0,N[0]);B&&B.isWrapped?K[K.length-1]+=U:K.push(U)}}return K.map((O=>O.replace(E," "))).join(h.isWindows?`\r
45
+ `:`
46
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),h.isLinux&&k&&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(k){const N=this._getMouseBufferCoords(k),V=this._model.finalSelectionStart,K=this._model.finalSelectionEnd;return!!(V&&K&&N)&&this._areCoordsInSelection(N,V,K)}isCellInSelection(k,N){const V=this._model.finalSelectionStart,K=this._model.finalSelectionEnd;return!(!V||!K)&&this._areCoordsInSelection([k,N],V,K)}_areCoordsInSelection(k,N,V){return k[1]>N[1]&&k[1]<V[1]||N[1]===V[1]&&k[1]===N[1]&&k[0]>=N[0]&&k[0]<V[0]||N[1]<V[1]&&k[1]===V[1]&&k[0]<V[0]||N[1]<V[1]&&k[1]===N[1]&&k[0]>=N[0]}_selectWordAtCursor(k,N){var O,B;const V=(B=(O=this._linkifier.currentLink)==null?void 0:O.link)==null?void 0:B.range;if(V)return this._model.selectionStart=[V.start.x-1,V.start.y-1],this._model.selectionStartLength=(0,l.getRangeLength)(V,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const K=this._getMouseBufferCoords(k);return!!K&&(this._selectWordAt(K,N),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,N){this._model.clearSelection(),k=Math.max(k,0),N=Math.min(N,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,N],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const N=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(N)return N[0]--,N[1]--,N[1]+=this._bufferService.buffer.ydisp,N}_getMouseEventScrollAmount(k){let N=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const V=this._renderService.dimensions.css.canvas.height;return N>=0&&N<=V?0:(N>V&&(N-=V),N=Math.min(Math.max(N,-50),50),N/=50,N/Math.abs(N)+Math.round(14*N))}shouldForceSelection(k){return h.isMac?k.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:k.shiftKey}handleMouseDown(k){if(this._mouseDownTimeStamp=k.timeStamp,(k.button!==2||!this.hasSelection)&&k.button===0){if(!this._enabled){if(!this.shouldForceSelection(k))return;k.stopPropagation()}k.preventDefault(),this._dragScrollAmount=0,this._enabled&&k.shiftKey?this._handleIncrementalClick(k):k.detail===1?this._handleSingleClick(k):k.detail===2?this._handleDoubleClick(k):k.detail===3&&this._handleTripleClick(k),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(k){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(k))}_handleSingleClick(k){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(k)?3:0,this._model.selectionStart=this._getMouseBufferCoords(k),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const N=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);N&&N.length!==this._model.selectionStart[0]&&N.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const N=this._getMouseBufferCoords(k);N&&(this._activeSelectionMode=2,this._selectLineAt(N[1]))}shouldColumnSelect(k){return k.altKey&&!(h.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const N=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(k),!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(k),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const V=this._bufferService.buffer;if(this._model.selectionEnd[1]<V.lines.length){const K=V.lines.get(this._model.selectionEnd[1]);K&&K.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}N&&N[0]===this._model.selectionEnd[0]&&N[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 k=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(k.ydisp+this._bufferService.rows,k.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=k.ydisp),this.refresh()}}_handleMouseUp(k){const N=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&N<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const V=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(V&&V[0]!==void 0&&V[1]!==void 0){const K=(0,C.moveToCellSequence)(V[0]-1,V[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(K,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,N=this._model.finalSelectionEnd,V=!(!k||!N||k[0]===N[0]&&k[1]===N[1]);V?k&&N&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&N[0]===this._oldSelectionEnd[0]&&N[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,N,V)):this._oldHasSelection&&this._fireOnSelectionChange(k,N,V)}_fireOnSelectionChange(k,N,V){this._oldSelectionStart=k,this._oldSelectionEnd=N,this._oldHasSelection=V,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim((N=>this._handleTrim(N)))}_convertViewportColToCharacterIndex(k,N){let V=N;for(let K=0;N>=K;K++){const O=k.loadCell(K,this._workCell).getChars().length;this._workCell.getWidth()===0?V--:O>1&&N!==K&&(V+=O-1)}return V}setSelection(k,N,V){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,N],this._model.selectionStartLength=V,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,N,V=!0,K=!0){if(k[0]>=this._bufferService.cols)return;const O=this._bufferService.buffer,B=O.lines.get(k[1]);if(!B)return;const U=O.translateBufferLineToString(k[1],!1);let z=this._convertViewportColToCharacterIndex(B,k[0]),q=z;const Y=k[0]-z;let W=0,A=0,I=0,P=0;if(U.charAt(z)===" "){for(;z>0&&U.charAt(z-1)===" ";)z--;for(;q<U.length&&U.charAt(q+1)===" ";)q++}else{let ie=k[0],ae=k[0];B.getWidth(ie)===0&&(W++,ie--),B.getWidth(ae)===2&&(A++,ae++);const ue=B.getString(ae).length;for(ue>1&&(P+=ue-1,q+=ue-1);ie>0&&z>0&&!this._isCharWordSeparator(B.loadCell(ie-1,this._workCell));){B.loadCell(ie-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(W++,ie--):X>1&&(I+=X-1,z-=X-1),z--,ie--}for(;ae<B.length&&q+1<U.length&&!this._isCharWordSeparator(B.loadCell(ae+1,this._workCell));){B.loadCell(ae+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(A++,ae++):X>1&&(P+=X-1,q+=X-1),q++,ae++}}q++;let H=z+Y-W+I,J=Math.min(this._bufferService.cols,q-z+W+A-I-P);if(N||U.slice(z,q).trim()!==""){if(V&&H===0&&B.getCodePoint(0)!==32){const ie=O.lines.get(k[1]-1);if(ie&&B.isWrapped&&ie.getCodePoint(this._bufferService.cols-1)!==32){const ae=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(ae){const ue=this._bufferService.cols-ae.start;H-=ue,J+=ue}}}if(K&&H+J===this._bufferService.cols&&B.getCodePoint(this._bufferService.cols-1)!==32){const ie=O.lines.get(k[1]+1);if(ie!=null&&ie.isWrapped&&ie.getCodePoint(0)!==32){const ae=this._getWordAt([0,k[1]+1],!1,!1,!0);ae&&(J+=ae.length)}}return{start:H,length:J}}}_selectWordAt(k,N){const V=this._getWordAt(k,N);if(V){for(;V.start<0;)V.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[V.start,k[1]],this._model.selectionStartLength=V.length}}_selectToWordAt(k){const N=this._getWordAt(k,!0);if(N){let V=k[1];for(;N.start<0;)N.start+=this._bufferService.cols,V--;if(!this._model.areSelectionValuesReversed())for(;N.start+N.length>this._bufferService.cols;)N.length-=this._bufferService.cols,V++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?N.start:N.start+N.length,V]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const N=this._bufferService.buffer.getWrappedRangeForLine(k),V={start:{x:0,y:N.first},end:{x:this._bufferService.cols-1,y:N.last}};this._model.selectionStart=[0,N.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,l.getRangeLength)(V,this._bufferService.cols)}};o.SelectionService=T=v([y(3,g.IBufferService),y(4,g.ICoreService),y(5,M.IMouseService),y(6,g.IOptionsService),y(7,M.IRenderService),y(8,M.ICoreBrowserService)],T)},4725:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const v=d(8343);o.ICharSizeService=(0,v.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,v.createDecorator)("CoreBrowserService"),o.IMouseService=(0,v.createDecorator)("MouseService"),o.IRenderService=(0,v.createDecorator)("RenderService"),o.ISelectionService=(0,v.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,v.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,v.createDecorator)("ThemeService"),o.ILinkProviderService=(0,v.createDecorator)("LinkProviderService")},6731:function(R,o,d){var v=this&&this.__decorate||function(T,k,N,V){var K,O=arguments.length,B=O<3?k:V===null?V=Object.getOwnPropertyDescriptor(k,N):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(T,k,N,V);else for(var U=T.length-1;U>=0;U--)(K=T[U])&&(B=(O<3?K(B):O>3?K(k,N,B):K(k,N))||B);return O>3&&B&&Object.defineProperty(k,N,B),B},y=this&&this.__param||function(T,k){return function(N,V){k(N,V,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const f=d(7239),C=d(8055),b=d(8460),M=d(844),w=d(2585),c=C.css.toColor("#ffffff"),h=C.css.toColor("#000000"),l=C.css.toColor("#ffffff"),u=C.css.toColor("#000000"),g={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[C.css.toColor("#2e3436"),C.css.toColor("#cc0000"),C.css.toColor("#4e9a06"),C.css.toColor("#c4a000"),C.css.toColor("#3465a4"),C.css.toColor("#75507b"),C.css.toColor("#06989a"),C.css.toColor("#d3d7cf"),C.css.toColor("#555753"),C.css.toColor("#ef2929"),C.css.toColor("#8ae234"),C.css.toColor("#fce94f"),C.css.toColor("#729fcf"),C.css.toColor("#ad7fa8"),C.css.toColor("#34e2e2"),C.css.toColor("#eeeeec")],k=[0,95,135,175,215,255];for(let N=0;N<216;N++){const V=k[N/36%6|0],K=k[N/6%6|0],O=k[N%6];T.push({css:C.channels.toCss(V,K,O),rgba:C.channels.toRgba(V,K,O)})}for(let N=0;N<24;N++){const V=8+10*N;T.push({css:C.channels.toCss(V,V,V),rgba:C.channels.toRgba(V,V,V)})}return T})());let S=o.ThemeService=class extends M.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:c,background:h,cursor:l,cursorAccent:u,selectionForeground:void 0,selectionBackgroundTransparent:g,selectionBackgroundOpaque:C.color.blend(h,g),selectionInactiveBackgroundTransparent:g,selectionInactiveBackgroundOpaque:C.color.blend(h,g),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const k=this._colors;if(k.foreground=E(T.foreground,c),k.background=E(T.background,h),k.cursor=E(T.cursor,l),k.cursorAccent=E(T.cursorAccent,u),k.selectionBackgroundTransparent=E(T.selectionBackground,g),k.selectionBackgroundOpaque=C.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=E(T.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=C.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=T.selectionForeground?E(T.selectionForeground,C.NULL_COLOR):void 0,k.selectionForeground===C.NULL_COLOR&&(k.selectionForeground=void 0),C.color.isOpaque(k.selectionBackgroundTransparent)&&(k.selectionBackgroundTransparent=C.color.opacity(k.selectionBackgroundTransparent,.3)),C.color.isOpaque(k.selectionInactiveBackgroundTransparent)&&(k.selectionInactiveBackgroundTransparent=C.color.opacity(k.selectionInactiveBackgroundTransparent,.3)),k.ansi=o.DEFAULT_ANSI_COLORS.slice(),k.ansi[0]=E(T.black,o.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=E(T.red,o.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=E(T.green,o.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=E(T.yellow,o.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=E(T.blue,o.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=E(T.magenta,o.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=E(T.cyan,o.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=E(T.white,o.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=E(T.brightBlack,o.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=E(T.brightRed,o.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=E(T.brightGreen,o.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=E(T.brightYellow,o.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=E(T.brightBlue,o.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=E(T.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=E(T.brightCyan,o.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=E(T.brightWhite,o.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const N=Math.min(k.ansi.length-16,T.extendedAnsi.length);for(let V=0;V<N;V++)k.ansi[V+16]=E(T.extendedAnsi[V],o.DEFAULT_ANSI_COLORS[V+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(T){this._restoreColor(T),this._onChangeColors.fire(this.colors)}_restoreColor(T){if(T!==void 0)switch(T){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[T]=this._restoreColors.ansi[T]}else for(let k=0;k<this._restoreColors.ansi.length;++k)this._colors.ansi[k]=this._restoreColors.ansi[k]}modifyColors(T){T(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function E(T,k){if(T!==void 0)try{return C.css.toColor(T)}catch{}return k}o.ThemeService=S=v([y(0,w.IOptionsService)],S)},6349:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const v=d(8460),y=d(844);class f extends y.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new v.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new v.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new v.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(b){if(this._maxLength===b)return;const M=new Array(b);for(let w=0;w<Math.min(b,this.length);w++)M[w]=this._array[this._getCyclicIndex(w)];this._array=M,this._maxLength=b,this._startIndex=0}get length(){return this._length}set length(b){if(b>this._length)for(let M=this._length;M<b;M++)this._array[M]=void 0;this._length=b}get(b){return this._array[this._getCyclicIndex(b)]}set(b,M){this._array[this._getCyclicIndex(b)]=M}push(b){this._array[this._getCyclicIndex(this._length)]=b,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(b,M,...w){if(M){for(let c=b;c<this._length-M;c++)this._array[this._getCyclicIndex(c)]=this._array[this._getCyclicIndex(c+M)];this._length-=M,this.onDeleteEmitter.fire({index:b,amount:M})}for(let c=this._length-1;c>=b;c--)this._array[this._getCyclicIndex(c+w.length)]=this._array[this._getCyclicIndex(c)];for(let c=0;c<w.length;c++)this._array[this._getCyclicIndex(b+c)]=w[c];if(w.length&&this.onInsertEmitter.fire({index:b,amount:w.length}),this._length+w.length>this._maxLength){const c=this._length+w.length-this._maxLength;this._startIndex+=c,this._length=this._maxLength,this.onTrimEmitter.fire(c)}else this._length+=w.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,M,w){if(!(M<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let h=M-1;h>=0;h--)this.set(b+h+w,this.get(b+h));const c=b+M+w-this._length;if(c>0)for(this._length+=c;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let c=0;c<M;c++)this.set(b+c+w,this.get(b+c))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}o.CircularList=f},1439:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function d(v,y=5){if(typeof v!="object")return v;const f=Array.isArray(v)?[]:{};for(const C in v)f[C]=y<=1?v[C]:v[C]&&d(v[C],y-1);return f}},8055:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let d=0,v=0,y=0,f=0;var C,b,M,w,c;function h(u){const g=u.toString(16);return g.length<2?"0"+g:g}function l(u,g){return u<g?(g+.05)/(u+.05):(u+.05)/(g+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(u){u.toCss=function(g,S,E,T){return T!==void 0?`#${h(g)}${h(S)}${h(E)}${h(T)}`:`#${h(g)}${h(S)}${h(E)}`},u.toRgba=function(g,S,E,T=255){return(g<<24|S<<16|E<<8|T)>>>0},u.toColor=function(g,S,E,T){return{css:u.toCss(g,S,E,T),rgba:u.toRgba(g,S,E,T)}}})(C||(o.channels=C={})),(function(u){function g(S,E){return f=Math.round(255*E),[d,v,y]=c.toChannels(S.rgba),{css:C.toCss(d,v,y,f),rgba:C.toRgba(d,v,y,f)}}u.blend=function(S,E){if(f=(255&E.rgba)/255,f===1)return{css:E.css,rgba:E.rgba};const T=E.rgba>>24&255,k=E.rgba>>16&255,N=E.rgba>>8&255,V=S.rgba>>24&255,K=S.rgba>>16&255,O=S.rgba>>8&255;return d=V+Math.round((T-V)*f),v=K+Math.round((k-K)*f),y=O+Math.round((N-O)*f),{css:C.toCss(d,v,y),rgba:C.toRgba(d,v,y)}},u.isOpaque=function(S){return(255&S.rgba)==255},u.ensureContrastRatio=function(S,E,T){const k=c.ensureContrastRatio(S.rgba,E.rgba,T);if(k)return C.toColor(k>>24&255,k>>16&255,k>>8&255)},u.opaque=function(S){const E=(255|S.rgba)>>>0;return[d,v,y]=c.toChannels(E),{css:C.toCss(d,v,y),rgba:E}},u.opacity=g,u.multiplyOpacity=function(S,E){return f=255&S.rgba,g(S,f*E/255)},u.toColorRGB=function(S){return[S.rgba>>24&255,S.rgba>>16&255,S.rgba>>8&255]}})(b||(o.color=b={})),(function(u){let g,S;try{const E=document.createElement("canvas");E.width=1,E.height=1;const T=E.getContext("2d",{willReadFrequently:!0});T&&(g=T,g.globalCompositeOperation="copy",S=g.createLinearGradient(0,0,1,1))}catch{}u.toColor=function(E){if(E.match(/#[\da-f]{3,8}/i))switch(E.length){case 4:return d=parseInt(E.slice(1,2).repeat(2),16),v=parseInt(E.slice(2,3).repeat(2),16),y=parseInt(E.slice(3,4).repeat(2),16),C.toColor(d,v,y);case 5:return d=parseInt(E.slice(1,2).repeat(2),16),v=parseInt(E.slice(2,3).repeat(2),16),y=parseInt(E.slice(3,4).repeat(2),16),f=parseInt(E.slice(4,5).repeat(2),16),C.toColor(d,v,y,f);case 7:return{css:E,rgba:(parseInt(E.slice(1),16)<<8|255)>>>0};case 9:return{css:E,rgba:parseInt(E.slice(1),16)>>>0}}const T=E.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return d=parseInt(T[1]),v=parseInt(T[2]),y=parseInt(T[3]),f=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),C.toColor(d,v,y,f);if(!g||!S)throw new Error("css.toColor: Unsupported css format");if(g.fillStyle=S,g.fillStyle=E,typeof g.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(g.fillRect(0,0,1,1),[d,v,y,f]=g.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(d,v,y,f),css:E}}})(M||(o.css=M={})),(function(u){function g(S,E,T){const k=S/255,N=E/255,V=T/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.0722*(V<=.03928?V/12.92:Math.pow((V+.055)/1.055,2.4))}u.relativeLuminance=function(S){return g(S>>16&255,S>>8&255,255&S)},u.relativeLuminance2=g})(w||(o.rgb=w={})),(function(u){function g(E,T,k){const N=E>>24&255,V=E>>16&255,K=E>>8&255;let O=T>>24&255,B=T>>16&255,U=T>>8&255,z=l(w.relativeLuminance2(O,B,U),w.relativeLuminance2(N,V,K));for(;z<k&&(O>0||B>0||U>0);)O-=Math.max(0,Math.ceil(.1*O)),B-=Math.max(0,Math.ceil(.1*B)),U-=Math.max(0,Math.ceil(.1*U)),z=l(w.relativeLuminance2(O,B,U),w.relativeLuminance2(N,V,K));return(O<<24|B<<16|U<<8|255)>>>0}function S(E,T,k){const N=E>>24&255,V=E>>16&255,K=E>>8&255;let O=T>>24&255,B=T>>16&255,U=T>>8&255,z=l(w.relativeLuminance2(O,B,U),w.relativeLuminance2(N,V,K));for(;z<k&&(O<255||B<255||U<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),B=Math.min(255,B+Math.ceil(.1*(255-B))),U=Math.min(255,U+Math.ceil(.1*(255-U))),z=l(w.relativeLuminance2(O,B,U),w.relativeLuminance2(N,V,K));return(O<<24|B<<16|U<<8|255)>>>0}u.blend=function(E,T){if(f=(255&T)/255,f===1)return T;const k=T>>24&255,N=T>>16&255,V=T>>8&255,K=E>>24&255,O=E>>16&255,B=E>>8&255;return d=K+Math.round((k-K)*f),v=O+Math.round((N-O)*f),y=B+Math.round((V-B)*f),C.toRgba(d,v,y)},u.ensureContrastRatio=function(E,T,k){const N=w.relativeLuminance(E>>8),V=w.relativeLuminance(T>>8);if(l(N,V)<k){if(V<N){const B=g(E,T,k),U=l(N,w.relativeLuminance(B>>8));if(U<k){const z=S(E,T,k);return U>l(N,w.relativeLuminance(z>>8))?B:z}return B}const K=S(E,T,k),O=l(N,w.relativeLuminance(K>>8));if(O<k){const B=g(E,T,k);return O>l(N,w.relativeLuminance(B>>8))?K:B}return K}},u.reduceLuminance=g,u.increaseLuminance=S,u.toChannels=function(E){return[E>>24&255,E>>16&255,E>>8&255,255&E]}})(c||(o.rgba=c={})),o.toPaddedHex=h,o.contrastRatio=l},8969:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const v=d(844),y=d(2585),f=d(4348),C=d(7866),b=d(744),M=d(7302),w=d(6975),c=d(8460),h=d(1753),l=d(1480),u=d(7994),g=d(9282),S=d(5435),E=d(5981),T=d(2660);let k=!1;class N extends v.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new c.EventEmitter),this._onScroll.event((K=>{var O;(O=this._onScrollApi)==null||O.fire(K.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(K){for(const O in K)this.optionsService.options[O]=K[O]}constructor(K){super(),this._windowsWrappingHeuristics=this.register(new v.MutableDisposable),this._onBinary=this.register(new c.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new c.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new c.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new c.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new c.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new M.OptionsService(K)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(C.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(h.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(l.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(u.CharsetService),this._instantiationService.setService(y.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(y.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new S.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,c.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,c.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,c.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,c.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((O=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((O=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new E.WriteBuffer(((O,B)=>this._inputHandler.parse(O,B)))),this.register((0,c.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(K,O){this._writeBuffer.write(K,O)}writeSync(K,O){this._logService.logLevel<=y.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(K,O)}input(K,O=!0){this.coreService.triggerDataEvent(K,O)}resize(K,O){isNaN(K)||isNaN(O)||(K=Math.max(K,b.MINIMUM_COLS),O=Math.max(O,b.MINIMUM_ROWS),this._bufferService.resize(K,O))}scroll(K,O=!1){this._bufferService.scroll(K,O)}scrollLines(K,O,B){this._bufferService.scrollLines(K,O,B)}scrollPages(K){this.scrollLines(K*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(K){const O=K-this._bufferService.buffer.ydisp;O!==0&&this.scrollLines(O)}registerEscHandler(K,O){return this._inputHandler.registerEscHandler(K,O)}registerDcsHandler(K,O){return this._inputHandler.registerDcsHandler(K,O)}registerCsiHandler(K,O){return this._inputHandler.registerCsiHandler(K,O)}registerOscHandler(K,O){return this._inputHandler.registerOscHandler(K,O)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let K=!1;const O=this.optionsService.rawOptions.windowsPty;O&&O.buildNumber!==void 0&&O.buildNumber!==void 0?K=O.backend==="conpty"&&O.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(K=!0),K?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const K=[];K.push(this.onLineFeed(g.updateWindowsModeWrappedState.bind(null,this._bufferService))),K.push(this.registerCsiHandler({final:"H"},(()=>((0,g.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,v.toDisposable)((()=>{for(const O of K)O.dispose()}))}}}o.CoreTerminal=N},8460:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=d=>(this._listeners.push(d),{dispose:()=>{if(!this._disposed){for(let v=0;v<this._listeners.length;v++)if(this._listeners[v]===d)return void this._listeners.splice(v,1)}}})),this._event}fire(d,v){const y=[];for(let f=0;f<this._listeners.length;f++)y.push(this._listeners[f]);for(let f=0;f<y.length;f++)y[f].call(void 0,d,v)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(d,v){return d((y=>v.fire(y)))},o.runAndSubscribe=function(d,v){return v(void 0),d((y=>v(y)))}},5435:function(R,o,d){var v=this&&this.__decorate||function(W,A,I,P){var H,J=arguments.length,ie=J<3?A:P===null?P=Object.getOwnPropertyDescriptor(A,I):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ie=Reflect.decorate(W,A,I,P);else for(var ae=W.length-1;ae>=0;ae--)(H=W[ae])&&(ie=(J<3?H(ie):J>3?H(A,I,ie):H(A,I))||ie);return J>3&&ie&&Object.defineProperty(A,I,ie),ie},y=this&&this.__param||function(W,A){return function(I,P){A(I,P,W)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const f=d(2584),C=d(7116),b=d(2015),M=d(844),w=d(482),c=d(8437),h=d(8460),l=d(643),u=d(511),g=d(3734),S=d(2585),E=d(1480),T=d(6242),k=d(6351),N=d(5941),V={"(":0,")":1,"*":2,"+":3,"-":1,".":2},K=131072;function O(W,A){if(W>24)return A.setWinLines||!1;switch(W){case 1:return!!A.restoreWin;case 2:return!!A.minimizeWin;case 3:return!!A.setWinPosition;case 4:return!!A.setWinSizePixels;case 5:return!!A.raiseWin;case 6:return!!A.lowerWin;case 7:return!!A.refreshWin;case 8:return!!A.setWinSizeChars;case 9:return!!A.maximizeWin;case 10:return!!A.fullscreenWin;case 11:return!!A.getWinState;case 13:return!!A.getWinPosition;case 14:return!!A.getWinSizePixels;case 15:return!!A.getScreenSizePixels;case 16:return!!A.getCellSizePixels;case 18:return!!A.getWinSizeChars;case 19:return!!A.getScreenSizeChars;case 20:return!!A.getIconTitle;case 21:return!!A.getWinTitle;case 22:return!!A.pushTitle;case 23:return!!A.popTitle;case 24:return!!A.setWinLines}return!1}var B;(function(W){W[W.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",W[W.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(B||(o.WindowsOptionsReportType=B={}));let U=0;class z extends M.Disposable{getAttrData(){return this._curAttrData}constructor(A,I,P,H,J,ie,ae,ue,X=new b.EscapeSequenceParser){super(),this._bufferService=A,this._charsetService=I,this._coreService=P,this._logService=H,this._optionsService=J,this._oscLinkService=ie,this._coreMouseService=ae,this._unicodeService=ue,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new u.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=c.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=c.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new h.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new h.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new h.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new h.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new h.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new h.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new h.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new h.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new h.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new h.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new h.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 q(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((j=>this._activeBuffer=j.activeBuffer))),this._parser.setCsiHandlerFallback(((j,se)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(j),params:se.toArray()})})),this._parser.setEscHandlerFallback((j=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(j)})})),this._parser.setExecuteHandlerFallback((j=>{this._logService.debug("Unknown EXECUTE code: ",{code:j})})),this._parser.setOscHandlerFallback(((j,se,te)=>{this._logService.debug("Unknown OSC code: ",{identifier:j,action:se,data:te})})),this._parser.setDcsHandlerFallback(((j,se,te)=>{se==="HOOK"&&(te=te.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(j),action:se,payload:te})})),this._parser.setPrintHandler(((j,se,te)=>this.print(j,se,te))),this._parser.registerCsiHandler({final:"@"},(j=>this.insertChars(j))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(j=>this.scrollLeft(j))),this._parser.registerCsiHandler({final:"A"},(j=>this.cursorUp(j))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(j=>this.scrollRight(j))),this._parser.registerCsiHandler({final:"B"},(j=>this.cursorDown(j))),this._parser.registerCsiHandler({final:"C"},(j=>this.cursorForward(j))),this._parser.registerCsiHandler({final:"D"},(j=>this.cursorBackward(j))),this._parser.registerCsiHandler({final:"E"},(j=>this.cursorNextLine(j))),this._parser.registerCsiHandler({final:"F"},(j=>this.cursorPrecedingLine(j))),this._parser.registerCsiHandler({final:"G"},(j=>this.cursorCharAbsolute(j))),this._parser.registerCsiHandler({final:"H"},(j=>this.cursorPosition(j))),this._parser.registerCsiHandler({final:"I"},(j=>this.cursorForwardTab(j))),this._parser.registerCsiHandler({final:"J"},(j=>this.eraseInDisplay(j,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(j=>this.eraseInDisplay(j,!0))),this._parser.registerCsiHandler({final:"K"},(j=>this.eraseInLine(j,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(j=>this.eraseInLine(j,!0))),this._parser.registerCsiHandler({final:"L"},(j=>this.insertLines(j))),this._parser.registerCsiHandler({final:"M"},(j=>this.deleteLines(j))),this._parser.registerCsiHandler({final:"P"},(j=>this.deleteChars(j))),this._parser.registerCsiHandler({final:"S"},(j=>this.scrollUp(j))),this._parser.registerCsiHandler({final:"T"},(j=>this.scrollDown(j))),this._parser.registerCsiHandler({final:"X"},(j=>this.eraseChars(j))),this._parser.registerCsiHandler({final:"Z"},(j=>this.cursorBackwardTab(j))),this._parser.registerCsiHandler({final:"`"},(j=>this.charPosAbsolute(j))),this._parser.registerCsiHandler({final:"a"},(j=>this.hPositionRelative(j))),this._parser.registerCsiHandler({final:"b"},(j=>this.repeatPrecedingCharacter(j))),this._parser.registerCsiHandler({final:"c"},(j=>this.sendDeviceAttributesPrimary(j))),this._parser.registerCsiHandler({prefix:">",final:"c"},(j=>this.sendDeviceAttributesSecondary(j))),this._parser.registerCsiHandler({final:"d"},(j=>this.linePosAbsolute(j))),this._parser.registerCsiHandler({final:"e"},(j=>this.vPositionRelative(j))),this._parser.registerCsiHandler({final:"f"},(j=>this.hVPosition(j))),this._parser.registerCsiHandler({final:"g"},(j=>this.tabClear(j))),this._parser.registerCsiHandler({final:"h"},(j=>this.setMode(j))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(j=>this.setModePrivate(j))),this._parser.registerCsiHandler({final:"l"},(j=>this.resetMode(j))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(j=>this.resetModePrivate(j))),this._parser.registerCsiHandler({final:"m"},(j=>this.charAttributes(j))),this._parser.registerCsiHandler({final:"n"},(j=>this.deviceStatus(j))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(j=>this.deviceStatusPrivate(j))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(j=>this.softReset(j))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(j=>this.setCursorStyle(j))),this._parser.registerCsiHandler({final:"r"},(j=>this.setScrollRegion(j))),this._parser.registerCsiHandler({final:"s"},(j=>this.saveCursor(j))),this._parser.registerCsiHandler({final:"t"},(j=>this.windowOptions(j))),this._parser.registerCsiHandler({final:"u"},(j=>this.restoreCursor(j))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(j=>this.insertColumns(j))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(j=>this.deleteColumns(j))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(j=>this.selectProtected(j))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(j=>this.requestMode(j,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(j=>this.requestMode(j,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((j=>(this.setTitle(j),this.setIconName(j),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((j=>this.setIconName(j)))),this._parser.registerOscHandler(2,new T.OscHandler((j=>this.setTitle(j)))),this._parser.registerOscHandler(4,new T.OscHandler((j=>this.setOrReportIndexedColor(j)))),this._parser.registerOscHandler(8,new T.OscHandler((j=>this.setHyperlink(j)))),this._parser.registerOscHandler(10,new T.OscHandler((j=>this.setOrReportFgColor(j)))),this._parser.registerOscHandler(11,new T.OscHandler((j=>this.setOrReportBgColor(j)))),this._parser.registerOscHandler(12,new T.OscHandler((j=>this.setOrReportCursorColor(j)))),this._parser.registerOscHandler(104,new T.OscHandler((j=>this.restoreIndexedColor(j)))),this._parser.registerOscHandler(110,new T.OscHandler((j=>this.restoreFgColor(j)))),this._parser.registerOscHandler(111,new T.OscHandler((j=>this.restoreBgColor(j)))),this._parser.registerOscHandler(112,new T.OscHandler((j=>this.restoreCursorColor(j)))),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 j in C.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:j},(()=>this.selectCharset("("+j))),this._parser.registerEscHandler({intermediates:")",final:j},(()=>this.selectCharset(")"+j))),this._parser.registerEscHandler({intermediates:"*",final:j},(()=>this.selectCharset("*"+j))),this._parser.registerEscHandler({intermediates:"+",final:j},(()=>this.selectCharset("+"+j))),this._parser.registerEscHandler({intermediates:"-",final:j},(()=>this.selectCharset("-"+j))),this._parser.registerEscHandler({intermediates:".",final:j},(()=>this.selectCharset("."+j))),this._parser.registerEscHandler({intermediates:"/",final:j},(()=>this.selectCharset("/"+j)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((j=>(this._logService.error("Parsing error: ",j),j))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler(((j,se)=>this.requestStatusString(j,se))))}_preserveStack(A,I,P,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=A,this._parseStack.cursorStartY=I,this._parseStack.decodedLength=P,this._parseStack.position=H}_logSlowResolvingAsync(A){this._logService.logLevel<=S.LogLevelEnum.WARN&&Promise.race([A,new Promise(((I,P)=>setTimeout((()=>P("#SLOW_TIMEOUT")),5e3)))]).catch((I=>{if(I!=="#SLOW_TIMEOUT")throw I;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(A,I){let P,H=this._activeBuffer.x,J=this._activeBuffer.y,ie=0;const ae=this._parseStack.paused;if(ae){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,I))return this._logSlowResolvingAsync(P),P;H=this._parseStack.cursorStartX,J=this._parseStack.cursorStartY,this._parseStack.paused=!1,A.length>K&&(ie=this._parseStack.position+K)}if(this._logService.logLevel<=S.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof A=="string"?` "${A}"`:` "${Array.prototype.map.call(A,(j=>String.fromCharCode(j))).join("")}"`),typeof A=="string"?A.split("").map((j=>j.charCodeAt(0))):A),this._parseBuffer.length<A.length&&this._parseBuffer.length<K&&(this._parseBuffer=new Uint32Array(Math.min(A.length,K))),ae||this._dirtyRowTracker.clearRange(),A.length>K)for(let j=ie;j<A.length;j+=K){const se=j+K<A.length?j+K:A.length,te=typeof A=="string"?this._stringDecoder.decode(A.substring(j,se),this._parseBuffer):this._utf8Decoder.decode(A.subarray(j,se),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,te))return this._preserveStack(H,J,te,j),this._logSlowResolvingAsync(P),P}else if(!ae){const j=typeof A=="string"?this._stringDecoder.decode(A,this._parseBuffer):this._utf8Decoder.decode(A,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,j))return this._preserveStack(H,J,j,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===H&&this._activeBuffer.y===J||this._onCursorMove.fire();const ue=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(ue,this._bufferService.rows-1))}print(A,I,P){let H,J;const ie=this._charsetService.charset,ae=this._optionsService.rawOptions.screenReaderMode,ue=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,j=this._coreService.modes.insertMode,se=this._curAttrData;let te=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-I>0&&te.getWidth(this._activeBuffer.x-1)===2&&te.setCellFromCodepoint(this._activeBuffer.x-1,0,1,se);let ce=this._parser.precedingJoinState;for(let _e=I;_e<P;++_e){if(H=A[_e],H<127&&ie){const Ne=ie[String.fromCharCode(H)];Ne&&(H=Ne.charCodeAt(0))}const Le=this._unicodeService.charProperties(H,ce);J=E.UnicodeService.extractWidth(Le);const ke=E.UnicodeService.extractShouldJoin(Le),Ie=ke?E.UnicodeService.extractWidth(ce):0;if(ce=Le,ae&&this._onA11yChar.fire((0,w.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+J-Ie>ue){if(X){const Ne=te;let ge=this._activeBuffer.x-Ie;for(this._activeBuffer.x=Ie,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),te=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ie>0&&te instanceof c.BufferLine&&te.copyCellsFrom(Ne,ge,0,Ie,!1);ge<ue;)Ne.setCellFromCodepoint(ge++,0,1,se)}else if(this._activeBuffer.x=ue-1,J===2)continue}if(ke&&this._activeBuffer.x){const Ne=te.getWidth(this._activeBuffer.x-1)?1:2;te.addCodepointToCell(this._activeBuffer.x-Ne,H,J);for(let ge=J-Ie;--ge>=0;)te.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}else if(j&&(te.insertCells(this._activeBuffer.x,J-Ie,this._activeBuffer.getNullCell(se)),te.getWidth(ue-1)===2&&te.setCellFromCodepoint(ue-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,se)),te.setCellFromCodepoint(this._activeBuffer.x++,H,J,se),J>0)for(;--J;)te.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}this._parser.precedingJoinState=ce,this._activeBuffer.x<ue&&P-I>0&&te.getWidth(this._activeBuffer.x)===0&&!te.hasContent(this._activeBuffer.x)&&te.setCellFromCodepoint(this._activeBuffer.x,0,1,se),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(A,I){return A.final!=="t"||A.prefix||A.intermediates?this._parser.registerCsiHandler(A,I):this._parser.registerCsiHandler(A,(P=>!O(P.params[0],this._optionsService.rawOptions.windowOptions)||I(P)))}registerDcsHandler(A,I){return this._parser.registerDcsHandler(A,new k.DcsHandler(I))}registerEscHandler(A,I){return this._parser.registerEscHandler(A,I)}registerOscHandler(A,I){return this._parser.registerOscHandler(A,new T.OscHandler(I))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var A;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&A.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);I.hasWidth(this._activeBuffer.x)&&!I.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const A=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-A),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(A=this._bufferService.cols-1){this._activeBuffer.x=Math.min(A,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(A,I){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=A,this._activeBuffer.y=this._activeBuffer.scrollTop+I):(this._activeBuffer.x=A,this._activeBuffer.y=I),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(A,I){this._restrictCursor(),this._setCursor(this._activeBuffer.x+A,this._activeBuffer.y+I)}cursorUp(A){const I=this._activeBuffer.y-this._activeBuffer.scrollTop;return I>=0?this._moveCursor(0,-Math.min(I,A.params[0]||1)):this._moveCursor(0,-(A.params[0]||1)),!0}cursorDown(A){const I=this._activeBuffer.scrollBottom-this._activeBuffer.y;return I>=0?this._moveCursor(0,Math.min(I,A.params[0]||1)):this._moveCursor(0,A.params[0]||1),!0}cursorForward(A){return this._moveCursor(A.params[0]||1,0),!0}cursorBackward(A){return this._moveCursor(-(A.params[0]||1),0),!0}cursorNextLine(A){return this.cursorDown(A),this._activeBuffer.x=0,!0}cursorPrecedingLine(A){return this.cursorUp(A),this._activeBuffer.x=0,!0}cursorCharAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(A){return this._setCursor(A.length>=2?(A.params[1]||1)-1:0,(A.params[0]||1)-1),!0}charPosAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(A){return this._moveCursor(A.params[0]||1,0),!0}linePosAbsolute(A){return this._setCursor(this._activeBuffer.x,(A.params[0]||1)-1),!0}vPositionRelative(A){return this._moveCursor(0,A.params[0]||1),!0}hVPosition(A){return this.cursorPosition(A),!0}tabClear(A){const I=A.params[0];return I===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:I===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let I=A.params[0]||1;for(;I--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let I=A.params[0]||1;for(;I--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(A){const I=A.params[0];return I===1&&(this._curAttrData.bg|=536870912),I!==2&&I!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(A,I,P,H=!1,J=!1){const ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);ie.replaceCells(I,P,this._activeBuffer.getNullCell(this._eraseAttrData()),J),H&&(ie.isWrapped=!1)}_resetBufferLine(A,I=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),I),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+A),P.isWrapped=!1)}eraseInDisplay(A,I=!1){let P;switch(this._restrictCursor(this._bufferService.cols),A.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,I);P<this._bufferService.rows;P++)this._resetBufferLine(P,I);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,I),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,I);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,I);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(A,I=!1){switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,I);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,I);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,I)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(A){this._restrictCursor();let I=A.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,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,J=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;I--;)this._activeBuffer.lines.splice(J-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(A){this._restrictCursor();let I=A.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 H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;I--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(A){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.insertCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(A){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.deleteCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(A){let I=A.params[0]||1;for(;I--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(A){let I=A.params[0]||1;for(;I--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(c.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=A.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);H.deleteCells(0,I,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=A.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);H.insertCells(0,I,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=A.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);H.insertCells(this._activeBuffer.x,I,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=A.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);H.deleteCells(this._activeBuffer.x,I,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(A){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(A.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(A){const I=this._parser.precedingJoinState;if(!I)return!0;const P=A.params[0]||1,H=E.UnicodeService.extractWidth(I),J=this._activeBuffer.x-H,ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(J),ae=new Uint32Array(ie.length*P);let ue=0;for(let j=0;j<ie.length;){const se=ie.codePointAt(j)||0;ae[ue++]=se,j+=se>65535?2:1}let X=ue;for(let j=1;j<P;++j)ae.copyWithin(X,0,ue),X+=ue;return this.print(ae,0,X),!0}sendDeviceAttributesPrimary(A){return A.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(A){return A.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(A.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(A){return(this._optionsService.rawOptions.termName+"").indexOf(A)===0}setMode(A){for(let I=0;I<A.length;I++)switch(A.params[I]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(A){for(let I=0;I<A.length;I++)switch(A.params[I]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,C.DEFAULT_CHARSET),this._charsetService.setgCharset(1,C.DEFAULT_CHARSET),this._charsetService.setgCharset(2,C.DEFAULT_CHARSET),this._charsetService.setgCharset(3,C.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(A){for(let I=0;I<A.length;I++)switch(A.params[I]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(A){for(let I=0;I<A.length;I++)switch(A.params[I]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),A.params[I]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(A,I){const P=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:J}=this._coreMouseService,ie=this._coreService,{buffers:ae,cols:ue}=this._bufferService,{active:X,alt:j}=ae,se=this._optionsService.rawOptions,te=ke=>ke?1:2,ce=A.params[0];return _e=ce,Le=I?ce===2?4:ce===4?te(ie.modes.insertMode):ce===12?3:ce===20?te(se.convertEol):0:ce===1?te(P.applicationCursorKeys):ce===3?se.windowOptions.setWinLines?ue===80?2:ue===132?1:0:0:ce===6?te(P.origin):ce===7?te(P.wraparound):ce===8?3:ce===9?te(H==="X10"):ce===12?te(se.cursorBlink):ce===25?te(!ie.isCursorHidden):ce===45?te(P.reverseWraparound):ce===66?te(P.applicationKeypad):ce===67?4:ce===1e3?te(H==="VT200"):ce===1002?te(H==="DRAG"):ce===1003?te(H==="ANY"):ce===1004?te(P.sendFocus):ce===1005?4:ce===1006?te(J==="SGR"):ce===1015?4:ce===1016?te(J==="SGR_PIXELS"):ce===1048?1:ce===47||ce===1047||ce===1049?te(X===j):ce===2004?te(P.bracketedPasteMode):0,ie.triggerDataEvent(`${f.C0.ESC}[${I?"":"?"}${_e};${Le}$y`),!0;var _e,Le}_updateAttrColor(A,I,P,H,J){return I===2?(A|=50331648,A&=-16777216,A|=g.AttributeData.fromColorRGB([P,H,J])):I===5&&(A&=-50331904,A|=33554432|255&P),A}_extractColor(A,I,P){const H=[0,0,-1,0,0,0];let J=0,ie=0;do{if(H[ie+J]=A.params[I+ie],A.hasSubParams(I+ie)){const ae=A.getSubParams(I+ie);let ue=0;do H[1]===5&&(J=1),H[ie+ue+1+J]=ae[ue];while(++ue<ae.length&&ue+ie+1+J<H.length);break}if(H[1]===5&&ie+J>=2||H[1]===2&&ie+J>=5)break;H[1]&&(J=1)}while(++ie+I<A.length&&ie+J<H.length);for(let ae=2;ae<H.length;++ae)H[ae]===-1&&(H[ae]=0);switch(H[0]){case 38:P.fg=this._updateAttrColor(P.fg,H[1],H[3],H[4],H[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,H[1],H[3],H[4],H[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,H[1],H[3],H[4],H[5])}return ie}_processUnderline(A,I){I.extended=I.extended.clone(),(!~A||A>5)&&(A=1),I.extended.underlineStyle=A,I.fg|=268435456,A===0&&(I.fg&=-268435457),I.updateExtended()}_processSGR0(A){A.fg=c.DEFAULT_ATTR_DATA.fg,A.bg=c.DEFAULT_ATTR_DATA.bg,A.extended=A.extended.clone(),A.extended.underlineStyle=0,A.extended.underlineColor&=-67108864,A.updateExtended()}charAttributes(A){if(A.length===1&&A.params[0]===0)return this._processSGR0(this._curAttrData),!0;const I=A.length;let P;const H=this._curAttrData;for(let J=0;J<I;J++)P=A.params[J],P>=30&&P<=37?(H.fg&=-50331904,H.fg|=16777216|P-30):P>=40&&P<=47?(H.bg&=-50331904,H.bg|=16777216|P-40):P>=90&&P<=97?(H.fg&=-50331904,H.fg|=16777224|P-90):P>=100&&P<=107?(H.bg&=-50331904,H.bg|=16777224|P-100):P===0?this._processSGR0(H):P===1?H.fg|=134217728:P===3?H.bg|=67108864:P===4?(H.fg|=268435456,this._processUnderline(A.hasSubParams(J)?A.getSubParams(J)[0]:1,H)):P===5?H.fg|=536870912:P===7?H.fg|=67108864:P===8?H.fg|=1073741824:P===9?H.fg|=2147483648:P===2?H.bg|=134217728:P===21?this._processUnderline(2,H):P===22?(H.fg&=-134217729,H.bg&=-134217729):P===23?H.bg&=-67108865:P===24?(H.fg&=-268435457,this._processUnderline(0,H)):P===25?H.fg&=-536870913:P===27?H.fg&=-67108865:P===28?H.fg&=-1073741825:P===29?H.fg&=2147483647:P===39?(H.fg&=-67108864,H.fg|=16777215&c.DEFAULT_ATTR_DATA.fg):P===49?(H.bg&=-67108864,H.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?J+=this._extractColor(A,J,H):P===53?H.bg|=1073741824:P===55?H.bg&=-1073741825:P===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):P===100?(H.fg&=-67108864,H.fg|=16777215&c.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(A){switch(A.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const I=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${I};${P}R`)}return!0}deviceStatusPrivate(A){if(A.params[0]===6){const I=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${I};${P}R`)}return!0}softReset(A){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=c.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(A){const I=A.params[0]||1;switch(I){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=I%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(A){const I=A.params[0]||1;let P;return(A.length<2||(P=A.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>I&&(this._activeBuffer.scrollTop=I-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(A){if(!O(A.params[0],this._optionsService.rawOptions.windowOptions))return!0;const I=A.length>1?A.params[1]:0;switch(A.params[0]){case 14:I!==2&&this._onRequestWindowsOptionsReport.fire(B.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(B.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:I!==0&&I!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),I!==0&&I!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:I!==0&&I!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),I!==0&&I!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(A){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(A){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(A){return this._windowTitle=A,this._onTitleChange.fire(A),!0}setIconName(A){return this._iconName=A,!0}setOrReportIndexedColor(A){const I=[],P=A.split(";");for(;P.length>1;){const H=P.shift(),J=P.shift();if(/^\d+$/.exec(H)){const ie=parseInt(H);if(Y(ie))if(J==="?")I.push({type:0,index:ie});else{const ae=(0,N.parseColor)(J);ae&&I.push({type:1,index:ie,color:ae})}}}return I.length&&this._onColor.fire(I),!0}setHyperlink(A){const I=A.split(";");return!(I.length<2)&&(I[1]?this._createHyperlink(I[0],I[1]):!I[0]&&this._finishHyperlink())}_createHyperlink(A,I){this._getCurrentLinkId()&&this._finishHyperlink();const P=A.split(":");let H;const J=P.findIndex((ie=>ie.startsWith("id=")));return J!==-1&&(H=P[J].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:I}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(A,I){const P=A.split(";");for(let H=0;H<P.length&&!(I>=this._specialColors.length);++H,++I)if(P[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[I]}]);else{const J=(0,N.parseColor)(P[H]);J&&this._onColor.fire([{type:1,index:this._specialColors[I],color:J}])}return!0}setOrReportFgColor(A){return this._setOrReportSpecialColor(A,0)}setOrReportBgColor(A){return this._setOrReportSpecialColor(A,1)}setOrReportCursorColor(A){return this._setOrReportSpecialColor(A,2)}restoreIndexedColor(A){if(!A)return this._onColor.fire([{type:2}]),!0;const I=[],P=A.split(";");for(let H=0;H<P.length;++H)if(/^\d+$/.exec(P[H])){const J=parseInt(P[H]);Y(J)&&I.push({type:2,index:J})}return I.length&&this._onColor.fire(I),!0}restoreFgColor(A){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(A){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(A){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,C.DEFAULT_CHARSET),!0}selectCharset(A){return A.length!==2?(this.selectDefaultCharset(),!0):(A[0]==="/"||this._charsetService.setgCharset(V[A[0]],C.CHARSETS[A[1]]||C.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const A=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,A,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=c.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=c.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(A){return this._charsetService.setgLevel(A),!0}screenAlignmentPattern(){const A=new u.CellData;A.content=4194373,A.fg=this._curAttrData.fg,A.bg=this._curAttrData.bg,this._setCursor(0,0);for(let I=0;I<this._bufferService.rows;++I){const P=this._activeBuffer.ybase+this._activeBuffer.y+I,H=this._activeBuffer.lines.get(P);H&&(H.fill(A),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(A,I){const P=this._bufferService.buffer,H=this._optionsService.rawOptions;return(J=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${J}${f.C0.ESC}\\`),!0))(A==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:A==='"p'?'P1$r61;1"p':A==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:A==="m"?"P1$r0m":A===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(A,I){this._dirtyRowTracker.markRangeDirty(A,I)}}o.InputHandler=z;let q=class{constructor(W){this._bufferService=W,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(W){W<this.start?this.start=W:W>this.end&&(this.end=W)}markRangeDirty(W,A){W>A&&(U=W,W=A,A=U),W<this.start&&(this.start=W),A>this.end&&(this.end=A)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(W){return 0<=W&&W<256}q=v([y(0,S.IBufferService)],q)},844:(R,o)=>{function d(v){for(const y of v)y.dispose();v.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const v of this._disposables)v.dispose();this._disposables.length=0}register(v){return this._disposables.push(v),v}unregister(v){const y=this._disposables.indexOf(v);y!==-1&&this._disposables.splice(y,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(v){var y;this._isDisposed||v===this._value||((y=this._value)==null||y.dispose(),this._value=v)}clear(){this.value=void 0}dispose(){var v;this._isDisposed=!0,(v=this._value)==null||v.dispose(),this._value=void 0}},o.toDisposable=function(v){return{dispose:v}},o.disposeArray=d,o.getDisposeArrayDisposable=function(v){return{dispose:()=>d(v)}}},1505:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class d{constructor(){this._data={}}set(y,f,C){this._data[y]||(this._data[y]={}),this._data[y][f]=C}get(y,f){return this._data[y]?this._data[y][f]:void 0}clear(){this._data={}}}o.TwoKeyMap=d,o.FourKeyMap=class{constructor(){this._data=new d}set(v,y,f,C,b){this._data.get(v,y)||this._data.set(v,y,new d),this._data.get(v,y).set(f,C,b)}get(v,y,f,C){var b;return(b=this._data.get(v,y))==null?void 0:b.get(f,C)}clear(){this._data.clear()}}},6114:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const d=o.isNode?"node":navigator.userAgent,v=o.isNode?"node":navigator.platform;o.isFirefox=d.includes("Firefox"),o.isLegacyEdge=d.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(d),o.getSafariVersion=function(){if(!o.isSafari)return 0;const y=d.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(v),o.isIpad=v==="iPad",o.isIphone=v==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(v),o.isLinux=v.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(d)},6106:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let d=0;o.SortedList=class{constructor(v){this._getKey=v,this._array=[]}clear(){this._array.length=0}insert(v){this._array.length!==0?(d=this._search(this._getKey(v)),this._array.splice(d,0,v)):this._array.push(v)}delete(v){if(this._array.length===0)return!1;const y=this._getKey(v);if(y===void 0||(d=this._search(y),d===-1)||this._getKey(this._array[d])!==y)return!1;do if(this._array[d]===v)return this._array.splice(d,1),!0;while(++d<this._array.length&&this._getKey(this._array[d])===y);return!1}*getKeyIterator(v){if(this._array.length!==0&&(d=this._search(v),!(d<0||d>=this._array.length)&&this._getKey(this._array[d])===v))do yield this._array[d];while(++d<this._array.length&&this._getKey(this._array[d])===v)}forEachByKey(v,y){if(this._array.length!==0&&(d=this._search(v),!(d<0||d>=this._array.length)&&this._getKey(this._array[d])===v))do y(this._array[d]);while(++d<this._array.length&&this._getKey(this._array[d])===v)}values(){return[...this._array].values()}_search(v){let y=0,f=this._array.length-1;for(;f>=y;){let C=y+f>>1;const b=this._getKey(this._array[C]);if(b>v)f=C-1;else{if(!(b<v)){for(;C>0&&this._getKey(this._array[C-1])===v;)C--;return C}y=C+1}}return y}}},7226:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const v=d(6114);class y{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(b){this._idleCallback=void 0;let M=0,w=0,c=b.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(M=Date.now(),this._tasks[this._i]()||this._i++,M=Math.max(1,Date.now()-M),w=Math.max(M,w),h=b.timeRemaining(),1.5*w>h)return c-M<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(c-M))}ms`),void this._start();c=h}this.clear()}}class f extends y{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const M=Date.now()+b;return{timeRemaining:()=>Math.max(0,M-Date.now())}}}o.PriorityTaskQueue=f,o.IdleTaskQueue=!v.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(C){return requestIdleCallback(C)}_cancelCallback(C){cancelIdleCallback(C)}}:f,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(C){this._queue.clear(),this._queue.enqueue(C)}flush(){this._queue.flush()}}},9282:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const v=d(643);o.updateWindowsModeWrappedState=function(y){const f=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),C=f==null?void 0:f.get(y.cols-1),b=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);b&&C&&(b.isWrapped=C[v.CHAR_DATA_CODE_INDEX]!==v.NULL_CELL_CODE&&C[v.CHAR_DATA_CODE_INDEX]!==v.WHITESPACE_CELL_CODE)}},3734:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class d{constructor(){this.fg=0,this.bg=0,this.extended=new v}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new d;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=d;class v{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,C=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=C}clone(){return new v(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=v},9092:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const v=d(6349),y=d(7226),f=d(3734),C=d(8437),b=d(4634),M=d(511),w=d(643),c=d(4863),h=d(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(l,u,g){this._hasScrollback=l,this._optionsService=u,this._bufferService=g,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=C.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=M.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=M.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new y.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new v.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 f.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 f.ExtendedAttrs),this._whitespaceCell}getBlankLine(l,u){return new C.BufferLine(this._bufferService.cols,this.getNullCell(l),u)}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 u=l+this._optionsService.rawOptions.scrollback;return u>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:u}fillViewportRows(l){if(this.lines.length===0){l===void 0&&(l=C.DEFAULT_ATTR_DATA);let u=this._rows;for(;u--;)this.lines.push(this.getBlankLine(l))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new v.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(l,u){const g=this.getNullCell(C.DEFAULT_ATTR_DATA);let S=0;const E=this._getCorrectBufferLength(u);if(E>this.lines.maxLength&&(this.lines.maxLength=E),this.lines.length>0){if(this._cols<l)for(let k=0;k<this.lines.length;k++)S+=+this.lines.get(k).resize(l,g);let T=0;if(this._rows<u)for(let k=this._rows;k<u;k++)this.lines.length<u+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new C.BufferLine(l,g)):this.ybase>0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new C.BufferLine(l,g)));else for(let k=this._rows;k>u;k--)this.lines.length>u+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(E<this.lines.maxLength){const k=this.lines.length-E;k>0&&(this.lines.trimStart(k),this.ybase=Math.max(this.ybase-k,0),this.ydisp=Math.max(this.ydisp-k,0),this.savedY=Math.max(this.savedY-k,0)),this.lines.maxLength=E}this.x=Math.min(this.x,l-1),this.y=Math.min(this.y,u-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,l-1),this.scrollTop=0}if(this.scrollBottom=u-1,this._isReflowEnabled&&(this._reflow(l,u),this._cols>l))for(let T=0;T<this.lines.length;T++)S+=+this.lines.get(T).resize(l,g);this._cols=l,this._rows=u,this._memoryCleanupQueue.clear(),S>.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 u=0;for(;this._memoryCleanupPosition<this.lines.length;)if(u+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),u>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,u){this._cols!==l&&(l>this._cols?this._reflowLarger(l,u):this._reflowSmaller(l,u))}_reflowLarger(l,u){const g=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,l,this.ybase+this.y,this.getNullCell(C.DEFAULT_ATTR_DATA));if(g.length>0){const S=(0,b.reflowLargerCreateNewLayout)(this.lines,g);(0,b.reflowLargerApplyNewLayout)(this.lines,S.layout),this._reflowLargerAdjustViewport(l,u,S.countRemoved)}}_reflowLargerAdjustViewport(l,u,g){const S=this.getNullCell(C.DEFAULT_ATTR_DATA);let E=g;for(;E-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<u&&this.lines.push(new C.BufferLine(l,S))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-g,0)}_reflowSmaller(l,u){const g=this.getNullCell(C.DEFAULT_ATTR_DATA),S=[];let E=0;for(let T=this.lines.length-1;T>=0;T--){let k=this.lines.get(T);if(!k||!k.isWrapped&&k.getTrimmedLength()<=l)continue;const N=[k];for(;k.isWrapped&&T>0;)k=this.lines.get(--T),N.unshift(k);const V=this.ybase+this.y;if(V>=T&&V<T+N.length)continue;const K=N[N.length-1].getTrimmedLength(),O=(0,b.reflowSmallerGetNewLineLengths)(N,this._cols,l),B=O.length-N.length;let U;U=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 z=[];for(let P=0;P<B;P++){const H=this.getBlankLine(C.DEFAULT_ATTR_DATA,!0);z.push(H)}z.length>0&&(S.push({start:T+N.length+E,newLines:z}),E+=z.length),N.push(...z);let q=O.length-1,Y=O[q];Y===0&&(q--,Y=O[q]);let W=N.length-B-1,A=K;for(;W>=0;){const P=Math.min(A,Y);if(N[q]===void 0)break;if(N[q].copyCellsFrom(N[W],A-P,Y-P,P,!0),Y-=P,Y===0&&(q--,Y=O[q]),A-=P,A===0){W--;const H=Math.max(W,0);A=(0,b.getWrappedLineTrimmedLength)(N,H,this._cols)}}for(let P=0;P<N.length;P++)O[P]<l&&N[P].setCell(O[P],g);let I=B-U;for(;I-- >0;)this.ybase===0?this.y<u-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+E)-u&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+B,this.ybase+u-1)}if(S.length>0){const T=[],k=[];for(let q=0;q<this.lines.length;q++)k.push(this.lines.get(q));const N=this.lines.length;let V=N-1,K=0,O=S[K];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+E);let B=0;for(let q=Math.min(this.lines.maxLength-1,N+E-1);q>=0;q--)if(O&&O.start>V+B){for(let Y=O.newLines.length-1;Y>=0;Y--)this.lines.set(q--,O.newLines[Y]);q++,T.push({index:V+1,amount:O.newLines.length}),B+=O.newLines.length,O=S[++K]}else this.lines.set(q,k[V--]);let U=0;for(let q=T.length-1;q>=0;q--)T[q].index+=U,this.lines.onInsertEmitter.fire(T[q]),U+=T[q].amount;const z=Math.max(0,N+E-this.lines.maxLength);z>0&&this.lines.onTrimEmitter.fire(z)}}translateBufferLineToString(l,u,g=0,S){const E=this.lines.get(l);return E?E.translateToString(u,g,S):""}getWrappedRangeForLine(l){let u=l,g=l;for(;u>0&&this.lines.get(u).isWrapped;)u--;for(;g+1<this.lines.length&&this.lines.get(g+1).isWrapped;)g++;return{first:u,last:g}}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 u=0;u<this.markers.length;u++)this.markers[u].line===l&&(this.markers[u].dispose(),this.markers.splice(u--,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 u=new c.Marker(l);return this.markers.push(u),u.register(this.lines.onTrim((g=>{u.line-=g,u.line<0&&u.dispose()}))),u.register(this.lines.onInsert((g=>{u.line>=g.index&&(u.line+=g.amount)}))),u.register(this.lines.onDelete((g=>{u.line>=g.index&&u.line<g.index+g.amount&&u.dispose(),u.line>g.index&&(u.line-=g.amount)}))),u.register(u.onDispose((()=>this._removeMarker(u)))),u}_removeMarker(l){this._isClearing||this.markers.splice(this.markers.indexOf(l),1)}}},8437:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const v=d(3734),y=d(511),f=d(643),C=d(482);o.DEFAULT_ATTR_DATA=Object.freeze(new v.AttributeData);let b=0;class M{constructor(c,h,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*c);const u=h||y.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let g=0;g<c;++g)this.setCell(g,u);this.length=c}get(c){const h=this._data[3*c+0],l=2097151&h;return[this._data[3*c+1],2097152&h?this._combined[c]:l?(0,C.stringFromCodePoint)(l):"",h>>22,2097152&h?this._combined[c].charCodeAt(this._combined[c].length-1):l]}set(c,h){this._data[3*c+1]=h[f.CHAR_DATA_ATTR_INDEX],h[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[c]=h[1],this._data[3*c+0]=2097152|c|h[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*c+0]=h[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|h[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(c){return this._data[3*c+0]>>22}hasWidth(c){return 12582912&this._data[3*c+0]}getFg(c){return this._data[3*c+1]}getBg(c){return this._data[3*c+2]}hasContent(c){return 4194303&this._data[3*c+0]}getCodePoint(c){const h=this._data[3*c+0];return 2097152&h?this._combined[c].charCodeAt(this._combined[c].length-1):2097151&h}isCombined(c){return 2097152&this._data[3*c+0]}getString(c){const h=this._data[3*c+0];return 2097152&h?this._combined[c]:2097151&h?(0,C.stringFromCodePoint)(2097151&h):""}isProtected(c){return 536870912&this._data[3*c+2]}loadCell(c,h){return b=3*c,h.content=this._data[b+0],h.fg=this._data[b+1],h.bg=this._data[b+2],2097152&h.content&&(h.combinedData=this._combined[c]),268435456&h.bg&&(h.extended=this._extendedAttrs[c]),h}setCell(c,h){2097152&h.content&&(this._combined[c]=h.combinedData),268435456&h.bg&&(this._extendedAttrs[c]=h.extended),this._data[3*c+0]=h.content,this._data[3*c+1]=h.fg,this._data[3*c+2]=h.bg}setCellFromCodepoint(c,h,l,u){268435456&u.bg&&(this._extendedAttrs[c]=u.extended),this._data[3*c+0]=h|l<<22,this._data[3*c+1]=u.fg,this._data[3*c+2]=u.bg}addCodepointToCell(c,h,l){let u=this._data[3*c+0];2097152&u?this._combined[c]+=(0,C.stringFromCodePoint)(h):2097151&u?(this._combined[c]=(0,C.stringFromCodePoint)(2097151&u)+(0,C.stringFromCodePoint)(h),u&=-2097152,u|=2097152):u=h|4194304,l&&(u&=-12582913,u|=l<<22),this._data[3*c+0]=u}insertCells(c,h,l){if((c%=this.length)&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,l),h<this.length-c){const u=new y.CellData;for(let g=this.length-c-h-1;g>=0;--g)this.setCell(c+h+g,this.loadCell(c+g,u));for(let g=0;g<h;++g)this.setCell(c+g,l)}else for(let u=c;u<this.length;++u)this.setCell(u,l);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,l)}deleteCells(c,h,l){if(c%=this.length,h<this.length-c){const u=new y.CellData;for(let g=0;g<this.length-c-h;++g)this.setCell(c+g,this.loadCell(c+h+g,u));for(let g=this.length-h;g<this.length;++g)this.setCell(g,l)}else for(let u=c;u<this.length;++u)this.setCell(u,l);c&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,l),this.getWidth(c)!==0||this.hasContent(c)||this.setCellFromCodepoint(c,0,1,l)}replaceCells(c,h,l,u=!1){if(u)for(c&&this.getWidth(c-1)===2&&!this.isProtected(c-1)&&this.setCellFromCodepoint(c-1,0,1,l),h<this.length&&this.getWidth(h-1)===2&&!this.isProtected(h)&&this.setCellFromCodepoint(h,0,1,l);c<h&&c<this.length;)this.isProtected(c)||this.setCell(c,l),c++;else for(c&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,l),h<this.length&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h,0,1,l);c<h&&c<this.length;)this.setCell(c++,l)}resize(c,h){if(c===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const l=3*c;if(c>this.length){if(this._data.buffer.byteLength>=4*l)this._data=new Uint32Array(this._data.buffer,0,l);else{const u=new Uint32Array(l);u.set(this._data),this._data=u}for(let u=this.length;u<c;++u)this.setCell(u,h)}else{this._data=this._data.subarray(0,l);const u=Object.keys(this._combined);for(let S=0;S<u.length;S++){const E=parseInt(u[S],10);E>=c&&delete this._combined[E]}const g=Object.keys(this._extendedAttrs);for(let S=0;S<g.length;S++){const E=parseInt(g[S],10);E>=c&&delete this._extendedAttrs[E]}}return this.length=c,4*l*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const c=new Uint32Array(this._data.length);return c.set(this._data),this._data=c,1}return 0}fill(c,h=!1){if(h)for(let l=0;l<this.length;++l)this.isProtected(l)||this.setCell(l,c);else{this._combined={},this._extendedAttrs={};for(let l=0;l<this.length;++l)this.setCell(l,c)}}copyFrom(c){this.length!==c.length?this._data=new Uint32Array(c._data):this._data.set(c._data),this.length=c.length,this._combined={};for(const h in c._combined)this._combined[h]=c._combined[h];this._extendedAttrs={};for(const h in c._extendedAttrs)this._extendedAttrs[h]=c._extendedAttrs[h];this.isWrapped=c.isWrapped}clone(){const c=new M(0);c._data=new Uint32Array(this._data),c.length=this.length;for(const h in this._combined)c._combined[h]=this._combined[h];for(const h in this._extendedAttrs)c._extendedAttrs[h]=this._extendedAttrs[h];return c.isWrapped=this.isWrapped,c}getTrimmedLength(){for(let c=this.length-1;c>=0;--c)if(4194303&this._data[3*c+0])return c+(this._data[3*c+0]>>22);return 0}getNoBgTrimmedLength(){for(let c=this.length-1;c>=0;--c)if(4194303&this._data[3*c+0]||50331648&this._data[3*c+2])return c+(this._data[3*c+0]>>22);return 0}copyCellsFrom(c,h,l,u,g){const S=c._data;if(g)for(let T=u-1;T>=0;T--){for(let k=0;k<3;k++)this._data[3*(l+T)+k]=S[3*(h+T)+k];268435456&S[3*(h+T)+2]&&(this._extendedAttrs[l+T]=c._extendedAttrs[h+T])}else for(let T=0;T<u;T++){for(let k=0;k<3;k++)this._data[3*(l+T)+k]=S[3*(h+T)+k];268435456&S[3*(h+T)+2]&&(this._extendedAttrs[l+T]=c._extendedAttrs[h+T])}const E=Object.keys(c._combined);for(let T=0;T<E.length;T++){const k=parseInt(E[T],10);k>=h&&(this._combined[k-h+l]=c._combined[k])}}translateToString(c,h,l,u){h=h??0,l=l??this.length,c&&(l=Math.min(l,this.getTrimmedLength())),u&&(u.length=0);let g="";for(;h<l;){const S=this._data[3*h+0],E=2097151&S,T=2097152&S?this._combined[h]:E?(0,C.stringFromCodePoint)(E):f.WHITESPACE_CELL_CHAR;if(g+=T,u)for(let k=0;k<T.length;++k)u.push(h);h+=S>>22||1}return u&&u.push(h),g}}o.BufferLine=M},4841:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(d,v){if(d.start.y>d.end.y)throw new Error(`Buffer range end (${d.end.x}, ${d.end.y}) cannot be before start (${d.start.x}, ${d.start.y})`);return v*(d.end.y-d.start.y)+(d.end.x-d.start.x+1)}},4634:(R,o)=>{function d(v,y,f){if(y===v.length-1)return v[y].getTrimmedLength();const C=!v[y].hasContent(f-1)&&v[y].getWidth(f-1)===1,b=v[y+1].getWidth(0)===2;return C&&b?f-1:f}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(v,y,f,C,b){const M=[];for(let w=0;w<v.length-1;w++){let c=w,h=v.get(++c);if(!h.isWrapped)continue;const l=[v.get(w)];for(;c<v.length&&h.isWrapped;)l.push(h),h=v.get(++c);if(C>=w&&C<c){w+=l.length-1;continue}let u=0,g=d(l,u,y),S=1,E=0;for(;S<l.length;){const k=d(l,S,y),N=k-E,V=f-g,K=Math.min(N,V);l[u].copyCellsFrom(l[S],E,g,K,!1),g+=K,g===f&&(u++,g=0),E+=K,E===k&&(S++,E=0),g===0&&u!==0&&l[u-1].getWidth(f-1)===2&&(l[u].copyCellsFrom(l[u-1],f-1,g++,1,!1),l[u-1].setCell(f-1,b))}l[u].replaceCells(g,f,b);let T=0;for(let k=l.length-1;k>0&&(k>u||l[k].getTrimmedLength()===0);k--)T++;T>0&&(M.push(w+l.length-T),M.push(T)),w+=l.length-1}return M},o.reflowLargerCreateNewLayout=function(v,y){const f=[];let C=0,b=y[C],M=0;for(let w=0;w<v.length;w++)if(b===w){const c=y[++C];v.onDeleteEmitter.fire({index:w-M,amount:c}),w+=c-1,M+=c,b=y[++C]}else f.push(w);return{layout:f,countRemoved:M}},o.reflowLargerApplyNewLayout=function(v,y){const f=[];for(let C=0;C<y.length;C++)f.push(v.get(y[C]));for(let C=0;C<f.length;C++)v.set(C,f[C]);v.length=y.length},o.reflowSmallerGetNewLineLengths=function(v,y,f){const C=[],b=v.map(((h,l)=>d(v,l,y))).reduce(((h,l)=>h+l));let M=0,w=0,c=0;for(;c<b;){if(b-c<f){C.push(b-c);break}M+=f;const h=d(v,w,y);M>h&&(M-=h,w++);const l=v[w].getWidth(M-1)===2;l&&M--;const u=l?f-1:f;C.push(u),c+=u}return C},o.getWrappedLineTrimmedLength=d},5295:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const v=d(8460),y=d(844),f=d(9092);class C extends y.Disposable{constructor(M,w){super(),this._optionsService=M,this._bufferService=w,this._onBufferActivate=this.register(new v.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 f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.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(M){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(M),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(M,w){this._normal.resize(M,w),this._alt.resize(M,w),this.setupTabStops(M)}setupTabStops(M){this._normal.setupTabStops(M),this._alt.setupTabStops(M)}}o.BufferSet=C},511:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const v=d(482),y=d(643),f=d(3734);class C extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(M){const w=new C;return w.setFromCharData(M),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,v.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(M){this.fg=M[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(M[y.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(M[y.CHAR_DATA_CHAR_INDEX].length===2){const c=M[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=c&&c<=56319){const h=M[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(c-55296)+h-56320+65536|M[y.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=M[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|M[y.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=M[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|M[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=C},643:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const v=d(8460),y=d(844);class f{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new v.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,y.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}o.Marker=f,f._nextId=1},7116:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(R,o)=>{var d,v,y;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
47
+ `,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(d||(o.C0=d={})),(function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"})(v||(o.C1=v={})),(function(f){f.ST=`${d.ESC}\\`})(y||(o.C1_ESCAPED=y={}))},7399:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const v=d(2584),y={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(f,C,b,M){const w={type:0,cancel:!1,key:void 0},c=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?w.key=C?v.C0.ESC+"OA":v.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?w.key=C?v.C0.ESC+"OD":v.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?w.key=C?v.C0.ESC+"OC":v.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(w.key=C?v.C0.ESC+"OB":v.C0.ESC+"[B");break;case 8:w.key=f.ctrlKey?"\b":v.C0.DEL,f.altKey&&(w.key=v.C0.ESC+w.key);break;case 9:if(f.shiftKey){w.key=v.C0.ESC+"[Z";break}w.key=v.C0.HT,w.cancel=!0;break;case 13:w.key=f.altKey?v.C0.ESC+v.C0.CR:v.C0.CR,w.cancel=!0;break;case 27:w.key=v.C0.ESC,f.altKey&&(w.key=v.C0.ESC+v.C0.ESC),w.cancel=!0;break;case 37:if(f.metaKey)break;c?(w.key=v.C0.ESC+"[1;"+(c+1)+"D",w.key===v.C0.ESC+"[1;3D"&&(w.key=v.C0.ESC+(b?"b":"[1;5D"))):w.key=C?v.C0.ESC+"OD":v.C0.ESC+"[D";break;case 39:if(f.metaKey)break;c?(w.key=v.C0.ESC+"[1;"+(c+1)+"C",w.key===v.C0.ESC+"[1;3C"&&(w.key=v.C0.ESC+(b?"f":"[1;5C"))):w.key=C?v.C0.ESC+"OC":v.C0.ESC+"[C";break;case 38:if(f.metaKey)break;c?(w.key=v.C0.ESC+"[1;"+(c+1)+"A",b||w.key!==v.C0.ESC+"[1;3A"||(w.key=v.C0.ESC+"[1;5A")):w.key=C?v.C0.ESC+"OA":v.C0.ESC+"[A";break;case 40:if(f.metaKey)break;c?(w.key=v.C0.ESC+"[1;"+(c+1)+"B",b||w.key!==v.C0.ESC+"[1;3B"||(w.key=v.C0.ESC+"[1;5B")):w.key=C?v.C0.ESC+"OB":v.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(w.key=v.C0.ESC+"[2~");break;case 46:w.key=c?v.C0.ESC+"[3;"+(c+1)+"~":v.C0.ESC+"[3~";break;case 36:w.key=c?v.C0.ESC+"[1;"+(c+1)+"H":C?v.C0.ESC+"OH":v.C0.ESC+"[H";break;case 35:w.key=c?v.C0.ESC+"[1;"+(c+1)+"F":C?v.C0.ESC+"OF":v.C0.ESC+"[F";break;case 33:f.shiftKey?w.type=2:f.ctrlKey?w.key=v.C0.ESC+"[5;"+(c+1)+"~":w.key=v.C0.ESC+"[5~";break;case 34:f.shiftKey?w.type=3:f.ctrlKey?w.key=v.C0.ESC+"[6;"+(c+1)+"~":w.key=v.C0.ESC+"[6~";break;case 112:w.key=c?v.C0.ESC+"[1;"+(c+1)+"P":v.C0.ESC+"OP";break;case 113:w.key=c?v.C0.ESC+"[1;"+(c+1)+"Q":v.C0.ESC+"OQ";break;case 114:w.key=c?v.C0.ESC+"[1;"+(c+1)+"R":v.C0.ESC+"OR";break;case 115:w.key=c?v.C0.ESC+"[1;"+(c+1)+"S":v.C0.ESC+"OS";break;case 116:w.key=c?v.C0.ESC+"[15;"+(c+1)+"~":v.C0.ESC+"[15~";break;case 117:w.key=c?v.C0.ESC+"[17;"+(c+1)+"~":v.C0.ESC+"[17~";break;case 118:w.key=c?v.C0.ESC+"[18;"+(c+1)+"~":v.C0.ESC+"[18~";break;case 119:w.key=c?v.C0.ESC+"[19;"+(c+1)+"~":v.C0.ESC+"[19~";break;case 120:w.key=c?v.C0.ESC+"[20;"+(c+1)+"~":v.C0.ESC+"[20~";break;case 121:w.key=c?v.C0.ESC+"[21;"+(c+1)+"~":v.C0.ESC+"[21~";break;case 122:w.key=c?v.C0.ESC+"[23;"+(c+1)+"~":v.C0.ESC+"[23~";break;case 123:w.key=c?v.C0.ESC+"[24;"+(c+1)+"~":v.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(b&&!M||!f.altKey||f.metaKey)!b||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?w.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(w.key=v.C0.US),f.key==="@"&&(w.key=v.C0.NUL)):f.keyCode===65&&(w.type=1);else{const h=y[f.keyCode],l=h==null?void 0:h[f.shiftKey?1:0];if(l)w.key=v.C0.ESC+l;else if(f.keyCode>=65&&f.keyCode<=90){const u=f.ctrlKey?f.keyCode-64:f.keyCode+32;let g=String.fromCharCode(u);f.shiftKey&&(g=g.toUpperCase()),w.key=v.C0.ESC+g}else if(f.keyCode===32)w.key=v.C0.ESC+(f.ctrlKey?v.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let u=f.code.slice(3,4);f.shiftKey||(u=u.toLowerCase()),w.key=v.C0.ESC+u,w.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?w.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?w.key=v.C0.NUL:f.keyCode>=51&&f.keyCode<=55?w.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?w.key=v.C0.DEL:f.keyCode===219?w.key=v.C0.ESC:f.keyCode===220?w.key=v.C0.FS:f.keyCode===221&&(w.key=v.C0.GS)}return w}},482:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(d){return d>65535?(d-=65536,String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):String.fromCharCode(d)},o.utf32ToString=function(d,v=0,y=d.length){let f="";for(let C=v;C<y;++C){let b=d[C];b>65535?(b-=65536,f+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):f+=String.fromCharCode(b)}return f},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(d,v){const y=d.length;if(!y)return 0;let f=0,C=0;if(this._interim){const b=d.charCodeAt(C++);56320<=b&&b<=57343?v[f++]=1024*(this._interim-55296)+b-56320+65536:(v[f++]=this._interim,v[f++]=b),this._interim=0}for(let b=C;b<y;++b){const M=d.charCodeAt(b);if(55296<=M&&M<=56319){if(++b>=y)return this._interim=M,f;const w=d.charCodeAt(b);56320<=w&&w<=57343?v[f++]=1024*(M-55296)+w-56320+65536:(v[f++]=M,v[f++]=w)}else M!==65279&&(v[f++]=M)}return f}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(d,v){const y=d.length;if(!y)return 0;let f,C,b,M,w=0,c=0,h=0;if(this.interim[0]){let g=!1,S=this.interim[0];S&=(224&S)==192?31:(240&S)==224?15:7;let E,T=0;for(;(E=63&this.interim[++T])&&T<4;)S<<=6,S|=E;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,N=k-T;for(;h<N;){if(h>=y)return 0;if(E=d[h++],(192&E)!=128){h--,g=!0;break}this.interim[T++]=E,S<<=6,S|=63&E}g||(k===2?S<128?h--:v[w++]=S:k===3?S<2048||S>=55296&&S<=57343||S===65279||(v[w++]=S):S<65536||S>1114111||(v[w++]=S)),this.interim.fill(0)}const l=y-4;let u=h;for(;u<y;){for(;!(!(u<l)||128&(f=d[u])||128&(C=d[u+1])||128&(b=d[u+2])||128&(M=d[u+3]));)v[w++]=f,v[w++]=C,v[w++]=b,v[w++]=M,u+=4;if(f=d[u++],f<128)v[w++]=f;else if((224&f)==192){if(u>=y)return this.interim[0]=f,w;if(C=d[u++],(192&C)!=128){u--;continue}if(c=(31&f)<<6|63&C,c<128){u--;continue}v[w++]=c}else if((240&f)==224){if(u>=y)return this.interim[0]=f,w;if(C=d[u++],(192&C)!=128){u--;continue}if(u>=y)return this.interim[0]=f,this.interim[1]=C,w;if(b=d[u++],(192&b)!=128){u--;continue}if(c=(15&f)<<12|(63&C)<<6|63&b,c<2048||c>=55296&&c<=57343||c===65279)continue;v[w++]=c}else if((248&f)==240){if(u>=y)return this.interim[0]=f,w;if(C=d[u++],(192&C)!=128){u--;continue}if(u>=y)return this.interim[0]=f,this.interim[1]=C,w;if(b=d[u++],(192&b)!=128){u--;continue}if(u>=y)return this.interim[0]=f,this.interim[1]=C,this.interim[2]=b,w;if(M=d[u++],(192&M)!=128){u--;continue}if(c=(7&f)<<18|(63&C)<<12|(63&b)<<6|63&M,c<65536||c>1114111)continue;v[w++]=c}}return w}}},225:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const v=d(1480),y=[[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]],f=[[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 C;o.UnicodeV6=class{constructor(){if(this.version="6",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160),C.fill(2,4352,4448),C[9001]=2,C[9002]=2,C.fill(2,11904,42192),C[12351]=1,C.fill(2,44032,55204),C.fill(2,63744,64256),C.fill(2,65040,65050),C.fill(2,65072,65136),C.fill(2,65280,65377),C.fill(2,65504,65511);for(let b=0;b<y.length;++b)C.fill(0,y[b][0],y[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?C[b]:(function(M,w){let c,h=0,l=w.length-1;if(M<w[0][0]||M>w[l][1])return!1;for(;l>=h;)if(c=h+l>>1,M>w[c][1])h=c+1;else{if(!(M<w[c][0]))return!0;l=c-1}return!1})(b,f)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,M){let w=this.wcwidth(b),c=w===0&&M!==0;if(c){const h=v.UnicodeService.extractWidth(M);h===0?c=!1:h>w&&(w=h)}return v.UnicodeService.createPropertyValue(0,w,c)}}},5981:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const v=d(8460),y=d(844);class f extends y.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,M){if(M!==void 0&&this._syncCalls>M)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const c=this._callbacks.shift();c&&c()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,M){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(M),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(M)}_innerWrite(b=0,M=!0){const w=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const c=this._writeBuffer[this._bufferOffset],h=this._action(c,M);if(h){const u=g=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,g))):this._innerWrite(w,g);return void h.catch((g=>(queueMicrotask((()=>{throw g})),Promise.resolve(!1)))).then(u)}const l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=c.length,Date.now()-w>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=f},5941:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const d=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,v=/^[\da-f]+$/;function y(f,C){const b=f.toString(16),M=b.length<2?"0"+b:b;switch(C){case 4:return b[0];case 8:return M;case 12:return(M+M).slice(0,3);default:return M+M}}o.parseColor=function(f){if(!f)return;let C=f.toLowerCase();if(C.indexOf("rgb:")===0){C=C.slice(4);const b=d.exec(C);if(b){const M=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/M*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/M*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/M*255)]}}else if(C.indexOf("#")===0&&(C=C.slice(1),v.exec(C)&&[3,6,9,12].includes(C.length))){const b=C.length/3,M=[0,0,0];for(let w=0;w<3;++w){const c=parseInt(C.slice(b*w,b*w+b),16);M[w]=b===1?c<<4:b===2?c:b===3?c>>4:c>>8}return M}},o.toRgbString=function(f,C=16){const[b,M,w]=f;return`rgb:${y(b,C)}/${y(M,C)}/${y(w,C)}`}},5770:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const v=d(482),y=d(8742),f=d(5770),C=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=C,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=C}registerHandler(M,w){this._handlers[M]===void 0&&(this._handlers[M]=[]);const c=this._handlers[M];return c.push(w),{dispose:()=>{const h=c.indexOf(w);h!==-1&&c.splice(h,1)}}}clearHandler(M){this._handlers[M]&&delete this._handlers[M]}setHandlerFallback(M){this._handlerFb=M}reset(){if(this._active.length)for(let M=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;M>=0;--M)this._active[M].unhook(!1);this._stack.paused=!1,this._active=C,this._ident=0}hook(M,w){if(this.reset(),this._ident=M,this._active=this._handlers[M]||C,this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(M,w,c){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(M,w,c);else this._handlerFb(this._ident,"PUT",(0,v.utf32ToString)(M,w,c))}unhook(M,w=!0){if(this._active.length){let c=!1,h=this._active.length-1,l=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,c=w,l=this._stack.fallThrough,this._stack.paused=!1),!l&&c===!1){for(;h>=0&&(c=this._active[h].unhook(M),c!==!0);h--)if(c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,c;h--}for(;h>=0;h--)if(c=this._active[h].unhook(!1),c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,c}else this._handlerFb(this._ident,"UNHOOK",M);this._active=C,this._ident=0}};const b=new y.Params;b.addParam(0),o.DcsHandler=class{constructor(M){this._handler=M,this._data="",this._params=b,this._hitLimit=!1}hook(M){this._params=M.length>1||M.params[0]?M.clone():b,this._data="",this._hitLimit=!1}put(M,w,c){this._hitLimit||(this._data+=(0,v.utf32ToString)(M,w,c),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(M){let w=!1;if(this._hitLimit)w=!1;else if(M&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((c=>(this._params=b,this._data="",this._hitLimit=!1,c)));return this._params=b,this._data="",this._hitLimit=!1,w}}},2015:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const v=d(844),y=d(8742),f=d(6242),C=d(6351);class b{constructor(h){this.table=new Uint8Array(h)}setDefault(h,l){this.table.fill(h<<4|l)}add(h,l,u,g){this.table[l<<8|h]=u<<4|g}addMany(h,l,u,g){for(let S=0;S<h.length;S++)this.table[l<<8|h[S]]=u<<4|g}}o.TransitionTable=b;const M=160;o.VT500_TRANSITION_TABLE=(function(){const c=new b(4095),h=Array.apply(null,Array(256)).map(((T,k)=>k)),l=(T,k)=>h.slice(T,k),u=l(32,127),g=l(0,24);g.push(25),g.push.apply(g,l(28,32));const S=l(0,14);let E;for(E in c.setDefault(1,0),c.addMany(u,0,2,0),S)c.addMany([24,26,153,154],E,3,0),c.addMany(l(128,144),E,3,0),c.addMany(l(144,152),E,3,0),c.add(156,E,0,0),c.add(27,E,11,1),c.add(157,E,4,8),c.addMany([152,158,159],E,0,7),c.add(155,E,11,3),c.add(144,E,11,9);return c.addMany(g,0,3,0),c.addMany(g,1,3,1),c.add(127,1,0,1),c.addMany(g,8,0,8),c.addMany(g,3,3,3),c.add(127,3,0,3),c.addMany(g,4,3,4),c.add(127,4,0,4),c.addMany(g,6,3,6),c.addMany(g,5,3,5),c.add(127,5,0,5),c.addMany(g,2,3,2),c.add(127,2,0,2),c.add(93,1,4,8),c.addMany(u,8,5,8),c.add(127,8,5,8),c.addMany([156,27,24,26,7],8,6,0),c.addMany(l(28,32),8,0,8),c.addMany([88,94,95],1,0,7),c.addMany(u,7,0,7),c.addMany(g,7,0,7),c.add(156,7,0,0),c.add(127,7,0,7),c.add(91,1,11,3),c.addMany(l(64,127),3,7,0),c.addMany(l(48,60),3,8,4),c.addMany([60,61,62,63],3,9,4),c.addMany(l(48,60),4,8,4),c.addMany(l(64,127),4,7,0),c.addMany([60,61,62,63],4,0,6),c.addMany(l(32,64),6,0,6),c.add(127,6,0,6),c.addMany(l(64,127),6,0,0),c.addMany(l(32,48),3,9,5),c.addMany(l(32,48),5,9,5),c.addMany(l(48,64),5,0,6),c.addMany(l(64,127),5,7,0),c.addMany(l(32,48),4,9,5),c.addMany(l(32,48),1,9,2),c.addMany(l(32,48),2,9,2),c.addMany(l(48,127),2,10,0),c.addMany(l(48,80),1,10,0),c.addMany(l(81,88),1,10,0),c.addMany([89,90,92],1,10,0),c.addMany(l(96,127),1,10,0),c.add(80,1,11,9),c.addMany(g,9,0,9),c.add(127,9,0,9),c.addMany(l(28,32),9,0,9),c.addMany(l(32,48),9,9,12),c.addMany(l(48,60),9,8,10),c.addMany([60,61,62,63],9,9,10),c.addMany(g,11,0,11),c.addMany(l(32,128),11,0,11),c.addMany(l(28,32),11,0,11),c.addMany(g,10,0,10),c.add(127,10,0,10),c.addMany(l(28,32),10,0,10),c.addMany(l(48,60),10,8,10),c.addMany([60,61,62,63],10,0,11),c.addMany(l(32,48),10,9,12),c.addMany(g,12,0,12),c.add(127,12,0,12),c.addMany(l(28,32),12,0,12),c.addMany(l(32,48),12,9,12),c.addMany(l(48,64),12,0,11),c.addMany(l(64,127),12,12,13),c.addMany(l(64,127),10,12,13),c.addMany(l(64,127),9,12,13),c.addMany(g,13,13,13),c.addMany(u,13,13,13),c.add(127,13,0,13),c.addMany([27,156,24,26],13,14,0),c.add(M,0,2,0),c.add(M,8,5,8),c.add(M,6,0,6),c.add(M,11,0,11),c.add(M,13,13,13),c})();class w extends v.Disposable{constructor(h=o.VT500_TRANSITION_TABLE){super(),this._transitions=h,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new y.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(l,u,g)=>{},this._executeHandlerFb=l=>{},this._csiHandlerFb=(l,u)=>{},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,v.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new C.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(h,l=[64,126]){let u=0;if(h.prefix){if(h.prefix.length>1)throw new Error("only one byte as prefix supported");if(u=h.prefix.charCodeAt(0),u&&60>u||u>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(h.intermediates){if(h.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let S=0;S<h.intermediates.length;++S){const E=h.intermediates.charCodeAt(S);if(32>E||E>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");u<<=8,u|=E}}if(h.final.length!==1)throw new Error("final must be a single byte");const g=h.final.charCodeAt(0);if(l[0]>g||g>l[1])throw new Error(`final must be in range ${l[0]} .. ${l[1]}`);return u<<=8,u|=g,u}identToString(h){const l=[];for(;h;)l.push(String.fromCharCode(255&h)),h>>=8;return l.reverse().join("")}setPrintHandler(h){this._printHandler=h}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(h,l){const u=this._identifier(h,[48,126]);this._escHandlers[u]===void 0&&(this._escHandlers[u]=[]);const g=this._escHandlers[u];return g.push(l),{dispose:()=>{const S=g.indexOf(l);S!==-1&&g.splice(S,1)}}}clearEscHandler(h){this._escHandlers[this._identifier(h,[48,126])]&&delete this._escHandlers[this._identifier(h,[48,126])]}setEscHandlerFallback(h){this._escHandlerFb=h}setExecuteHandler(h,l){this._executeHandlers[h.charCodeAt(0)]=l}clearExecuteHandler(h){this._executeHandlers[h.charCodeAt(0)]&&delete this._executeHandlers[h.charCodeAt(0)]}setExecuteHandlerFallback(h){this._executeHandlerFb=h}registerCsiHandler(h,l){const u=this._identifier(h);this._csiHandlers[u]===void 0&&(this._csiHandlers[u]=[]);const g=this._csiHandlers[u];return g.push(l),{dispose:()=>{const S=g.indexOf(l);S!==-1&&g.splice(S,1)}}}clearCsiHandler(h){this._csiHandlers[this._identifier(h)]&&delete this._csiHandlers[this._identifier(h)]}setCsiHandlerFallback(h){this._csiHandlerFb=h}registerDcsHandler(h,l){return this._dcsParser.registerHandler(this._identifier(h),l)}clearDcsHandler(h){this._dcsParser.clearHandler(this._identifier(h))}setDcsHandlerFallback(h){this._dcsParser.setHandlerFallback(h)}registerOscHandler(h,l){return this._oscParser.registerHandler(h,l)}clearOscHandler(h){this._oscParser.clearHandler(h)}setOscHandlerFallback(h){this._oscParser.setHandlerFallback(h)}setErrorHandler(h){this._errorHandler=h}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(h,l,u,g,S){this._parseStack.state=h,this._parseStack.handlers=l,this._parseStack.handlerPos=u,this._parseStack.transition=g,this._parseStack.chunkPos=S}parse(h,l,u){let g,S=0,E=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(u===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const k=this._parseStack.handlers;let N=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(u===!1&&N>-1){for(;N>=0&&(g=k[N](this._params),g!==!0);N--)if(g instanceof Promise)return this._parseStack.handlerPos=N,g}this._parseStack.handlers=[];break;case 4:if(u===!1&&N>-1){for(;N>=0&&(g=k[N](),g!==!0);N--)if(g instanceof Promise)return this._parseStack.handlerPos=N,g}this._parseStack.handlers=[];break;case 6:if(S=h[this._parseStack.chunkPos],g=this._dcsParser.unhook(S!==24&&S!==26,u),g)return g;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(S=h[this._parseStack.chunkPos],g=this._oscParser.end(S!==24&&S!==26,u),g)return g;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let k=T;k<l;++k){switch(S=h[k],E=this._transitions.table[this.currentState<<8|(S<160?S:M)],E>>4){case 2:for(let B=k+1;;++B){if(B>=l||(S=h[B])<32||S>126&&S<M){this._printHandler(h,k,B),k=B-1;break}if(++B>=l||(S=h[B])<32||S>126&&S<M){this._printHandler(h,k,B),k=B-1;break}if(++B>=l||(S=h[B])<32||S>126&&S<M){this._printHandler(h,k,B),k=B-1;break}if(++B>=l||(S=h[B])<32||S>126&&S<M){this._printHandler(h,k,B),k=B-1;break}}break;case 3:this._executeHandlers[S]?this._executeHandlers[S]():this._executeHandlerFb(S),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:k,code:S,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const N=this._csiHandlers[this._collect<<8|S];let V=N?N.length-1:-1;for(;V>=0&&(g=N[V](this._params),g!==!0);V--)if(g instanceof Promise)return this._preserveStack(3,N,V,E,k),g;V<0&&this._csiHandlerFb(this._collect<<8|S,this._params),this.precedingJoinState=0;break;case 8:do switch(S){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(S-48)}while(++k<l&&(S=h[k])>47&&S<60);k--;break;case 9:this._collect<<=8,this._collect|=S;break;case 10:const K=this._escHandlers[this._collect<<8|S];let O=K?K.length-1:-1;for(;O>=0&&(g=K[O](),g!==!0);O--)if(g instanceof Promise)return this._preserveStack(4,K,O,E,k),g;O<0&&this._escHandlerFb(this._collect<<8|S),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|S,this._params);break;case 13:for(let B=k+1;;++B)if(B>=l||(S=h[B])===24||S===26||S===27||S>127&&S<M){this._dcsParser.put(h,k,B),k=B-1;break}break;case 14:if(g=this._dcsParser.unhook(S!==24&&S!==26),g)return this._preserveStack(6,[],0,E,k),g;S===27&&(E|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let B=k+1;;B++)if(B>=l||(S=h[B])<32||S>127&&S<M){this._oscParser.put(h,k,B),k=B-1;break}break;case 6:if(g=this._oscParser.end(S!==24&&S!==26),g)return this._preserveStack(5,[],0,E,k),g;S===27&&(E|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&E}}}o.EscapeSequenceParser=w},6242:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const v=d(5770),y=d(482),f=[];o.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(C,b){this._handlers[C]===void 0&&(this._handlers[C]=[]);const M=this._handlers[C];return M.push(b),{dispose:()=>{const w=M.indexOf(b);w!==-1&&M.splice(w,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].start();else this._handlerFb(this._id,"START")}_put(C,b,M){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(C,b,M);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(C,b,M))}start(){this.reset(),this._state=1}put(C,b,M){if(this._state!==3){if(this._state===1)for(;b<M;){const w=C[b++];if(w===59){this._state=2,this._start();break}if(w<48||57<w)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+w-48}this._state===2&&M-b>0&&this._put(C,b,M)}}end(C,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let M=!1,w=this._active.length-1,c=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,M=b,c=this._stack.fallThrough,this._stack.paused=!1),!c&&M===!1){for(;w>=0&&(M=this._active[w].end(C),M!==!0);w--)if(M instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,M;w--}for(;w>=0;w--)if(M=this._active[w].end(!1),M instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,M}else this._handlerFb(this._id,"END",C);this._active=f,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(C){this._handler=C,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(C,b,M){this._hitLimit||(this._data+=(0,y.utf32ToString)(C,b,M),this._data.length>v.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(C){let b=!1;if(this._hitLimit)b=!1;else if(C&&(b=this._handler(this._data),b instanceof Promise))return b.then((M=>(this._data="",this._hitLimit=!1,M)));return this._data="",this._hitLimit=!1,b}}},8742:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const d=2147483647;class v{static fromArray(f){const C=new v;if(!f.length)return C;for(let b=Array.isArray(f[0])?1:0;b<f.length;++b){const M=f[b];if(Array.isArray(M))for(let w=0;w<M.length;++w)C.addSubParam(M[w]);else C.addParam(M)}return C}constructor(f=32,C=32){if(this.maxLength=f,this.maxSubParamsLength=C,C>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(C),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new v(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let C=0;C<this.length;++C){f.push(this.params[C]);const b=this._subParamsIdx[C]>>8,M=255&this._subParamsIdx[C];M-b>0&&f.push(Array.prototype.slice.call(this._subParams,b,M))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>d?d:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>d?d:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const C=this._subParamsIdx[f]>>8,b=255&this._subParamsIdx[f];return b-C>0?this._subParams.subarray(C,b):null}getSubParamsAll(){const f={};for(let C=0;C<this.length;++C){const b=this._subParamsIdx[C]>>8,M=255&this._subParamsIdx[C];M-b>0&&(f[C]=this._subParams.slice(b,M))}return f}addDigit(f){let C;if(this._rejectDigits||!(C=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,M=b[C-1];b[C-1]=~M?Math.min(10*M+f,d):f}}o.Params=v},5741:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let d=this._addons.length-1;d>=0;d--)this._addons[d].instance.dispose()}loadAddon(d,v){const y={instance:v,dispose:v.dispose,isDisposed:!1};this._addons.push(y),v.dispose=()=>this._wrappedAddonDispose(y),v.activate(d)}_wrappedAddonDispose(d){if(d.isDisposed)return;let v=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===d){v=y;break}if(v===-1)throw new Error("Could not dispose an addon that has not been loaded");d.isDisposed=!0,d.dispose.apply(d.instance),this._addons.splice(v,1)}}},8771:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const v=d(3785),y=d(511);o.BufferApiView=class{constructor(f,C){this._buffer=f,this.type=C}init(f){return this._buffer=f,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(f){const C=this._buffer.lines.get(f);if(C)return new v.BufferLineApiView(C)}getNullCell(){return new y.CellData}}},3785:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const v=d(511);o.BufferLineApiView=class{constructor(y){this._line=y}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(y,f){if(!(y<0||y>=this._line.length))return f?(this._line.loadCell(y,f),f):this._line.loadCell(y,new v.CellData)}translateToString(y,f,C){return this._line.translateToString(y,f,C)}}},8285:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const v=d(8771),y=d(8460),f=d(844);class C extends f.Disposable{constructor(M){super(),this._core=M,this._onBufferChange=this.register(new y.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new v.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new v.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=C},7975:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(d){this._core=d}registerCsiHandler(d,v){return this._core.registerCsiHandler(d,(y=>v(y.toArray())))}addCsiHandler(d,v){return this.registerCsiHandler(d,v)}registerDcsHandler(d,v){return this._core.registerDcsHandler(d,((y,f)=>v(y,f.toArray())))}addDcsHandler(d,v){return this.registerDcsHandler(d,v)}registerEscHandler(d,v){return this._core.registerEscHandler(d,v)}addEscHandler(d,v){return this.registerEscHandler(d,v)}registerOscHandler(d,v){return this._core.registerOscHandler(d,v)}addOscHandler(d,v){return this.registerOscHandler(d,v)}}},7090:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(d){this._core=d}register(d){this._core.unicodeService.register(d)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(d){this._core.unicodeService.activeVersion=d}}},744:function(R,o,d){var v=this&&this.__decorate||function(c,h,l,u){var g,S=arguments.length,E=S<3?h:u===null?u=Object.getOwnPropertyDescriptor(h,l):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(c,h,l,u);else for(var T=c.length-1;T>=0;T--)(g=c[T])&&(E=(S<3?g(E):S>3?g(h,l,E):g(h,l))||E);return S>3&&E&&Object.defineProperty(h,l,E),E},y=this&&this.__param||function(c,h){return function(l,u){h(l,u,c)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const f=d(8460),C=d(844),b=d(5295),M=d(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let w=o.BufferService=class extends C.Disposable{get buffer(){return this.buffers.active}constructor(c){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(c.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(c.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(c,this))}resize(c,h){this.cols=c,this.rows=h,this.buffers.resize(c,h),this._onResize.fire({cols:c,rows:h})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(c,h=!1){const l=this.buffer;let u;u=this._cachedBlankLine,u&&u.length===this.cols&&u.getFg(0)===c.fg&&u.getBg(0)===c.bg||(u=l.getBlankLine(c,h),this._cachedBlankLine=u),u.isWrapped=h;const g=l.ybase+l.scrollTop,S=l.ybase+l.scrollBottom;if(l.scrollTop===0){const E=l.lines.isFull;S===l.lines.length-1?E?l.lines.recycle().copyFrom(u):l.lines.push(u.clone()):l.lines.splice(S+1,0,u.clone()),E?this.isUserScrolling&&(l.ydisp=Math.max(l.ydisp-1,0)):(l.ybase++,this.isUserScrolling||l.ydisp++)}else{const E=S-g+1;l.lines.shiftElements(g+1,E-1,-1),l.lines.set(S,u.clone())}this.isUserScrolling||(l.ydisp=l.ybase),this._onScroll.fire(l.ydisp)}scrollLines(c,h,l){const u=this.buffer;if(c<0){if(u.ydisp===0)return;this.isUserScrolling=!0}else c+u.ydisp>=u.ybase&&(this.isUserScrolling=!1);const g=u.ydisp;u.ydisp=Math.max(Math.min(u.ydisp+c,u.ybase),0),g!==u.ydisp&&(h||this._onScroll.fire(u.ydisp))}};o.BufferService=w=v([y(0,M.IOptionsService)],w)},7994:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(d){this.glevel=d,this.charset=this._charsets[d]}setgCharset(d,v){this._charsets[d]=v,this.glevel===d&&(this.charset=v)}}},1753:function(R,o,d){var v=this&&this.__decorate||function(u,g,S,E){var T,k=arguments.length,N=k<3?g:E===null?E=Object.getOwnPropertyDescriptor(g,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(u,g,S,E);else for(var V=u.length-1;V>=0;V--)(T=u[V])&&(N=(k<3?T(N):k>3?T(g,S,N):T(g,S))||N);return k>3&&N&&Object.defineProperty(g,S,N),N},y=this&&this.__param||function(u,g){return function(S,E){g(S,E,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const f=d(2585),C=d(8460),b=d(844),M={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:u=>u.button!==4&&u.action===1&&(u.ctrl=!1,u.alt=!1,u.shift=!1,!0)},VT200:{events:19,restrict:u=>u.action!==32},DRAG:{events:23,restrict:u=>u.action!==32||u.button!==3},ANY:{events:31,restrict:u=>!0}};function w(u,g){let S=(u.ctrl?16:0)|(u.shift?4:0)|(u.alt?8:0);return u.button===4?(S|=64,S|=u.action):(S|=3&u.button,4&u.button&&(S|=64),8&u.button&&(S|=128),u.action===32?S|=32:u.action!==0||g||(S|=3)),S}const c=String.fromCharCode,h={DEFAULT:u=>{const g=[w(u,!1)+32,u.col+32,u.row+32];return g[0]>255||g[1]>255||g[2]>255?"":`\x1B[M${c(g[0])}${c(g[1])}${c(g[2])}`},SGR:u=>{const g=u.action===0&&u.button!==4?"m":"M";return`\x1B[<${w(u,!0)};${u.col};${u.row}${g}`},SGR_PIXELS:u=>{const g=u.action===0&&u.button!==4?"m":"M";return`\x1B[<${w(u,!0)};${u.x};${u.y}${g}`}};let l=o.CoreMouseService=class extends b.Disposable{constructor(u,g){super(),this._bufferService=u,this._coreService=g,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new C.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const S of Object.keys(M))this.addProtocol(S,M[S]);for(const S of Object.keys(h))this.addEncoding(S,h[S]);this.reset()}addProtocol(u,g){this._protocols[u]=g}addEncoding(u,g){this._encodings[u]=g}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(u){if(!this._protocols[u])throw new Error(`unknown protocol "${u}"`);this._activeProtocol=u,this._onProtocolChange.fire(this._protocols[u].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(u){if(!this._encodings[u])throw new Error(`unknown encoding "${u}"`);this._activeEncoding=u}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(u){if(u.col<0||u.col>=this._bufferService.cols||u.row<0||u.row>=this._bufferService.rows||u.button===4&&u.action===32||u.button===3&&u.action!==32||u.button!==4&&(u.action===2||u.action===3)||(u.col++,u.row++,u.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,u,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(u))return!1;const g=this._encodings[this._activeEncoding](u);return g&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(g):this._coreService.triggerDataEvent(g,!0)),this._lastEvent=u,!0}explainEvents(u){return{down:!!(1&u),up:!!(2&u),drag:!!(4&u),move:!!(8&u),wheel:!!(16&u)}}_equalEvents(u,g,S){if(S){if(u.x!==g.x||u.y!==g.y)return!1}else if(u.col!==g.col||u.row!==g.row)return!1;return u.button===g.button&&u.action===g.action&&u.ctrl===g.ctrl&&u.alt===g.alt&&u.shift===g.shift}};o.CoreMouseService=l=v([y(0,f.IBufferService),y(1,f.ICoreService)],l)},6975:function(R,o,d){var v=this&&this.__decorate||function(l,u,g,S){var E,T=arguments.length,k=T<3?u:S===null?S=Object.getOwnPropertyDescriptor(u,g):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(l,u,g,S);else for(var N=l.length-1;N>=0;N--)(E=l[N])&&(k=(T<3?E(k):T>3?E(u,g,k):E(u,g))||k);return T>3&&k&&Object.defineProperty(u,g,k),k},y=this&&this.__param||function(l,u){return function(g,S){u(g,S,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const f=d(1439),C=d(8460),b=d(844),M=d(2585),w=Object.freeze({insertMode:!1}),c=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let h=o.CoreService=class extends b.Disposable{constructor(l,u,g){super(),this._bufferService=l,this._logService=u,this._optionsService=g,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new C.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new C.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new C.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new C.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(c)}reset(){this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(c)}triggerDataEvent(l,u=!1){if(this._optionsService.rawOptions.disableStdin)return;const g=this._bufferService.buffer;u&&this._optionsService.rawOptions.scrollOnUserInput&&g.ybase!==g.ydisp&&this._onRequestScrollToBottom.fire(),u&&this._onUserInput.fire(),this._logService.debug(`sending data "${l}"`,(()=>l.split("").map((S=>S.charCodeAt(0))))),this._onData.fire(l)}triggerBinaryEvent(l){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${l}"`,(()=>l.split("").map((u=>u.charCodeAt(0))))),this._onBinary.fire(l))}};o.CoreService=h=v([y(0,M.IBufferService),y(1,M.ILogService),y(2,M.IOptionsService)],h)},9074:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const v=d(8055),y=d(8460),f=d(844),C=d(6106);let b=0,M=0;class w extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new C.SortedList((l=>l==null?void 0:l.marker.line)),this._onDecorationRegistered=this.register(new y.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new y.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(l){if(l.marker.isDisposed)return;const u=new c(l);if(u){const g=u.marker.onDispose((()=>u.dispose()));u.onDispose((()=>{u&&(this._decorations.delete(u)&&this._onDecorationRemoved.fire(u),g.dispose())})),this._decorations.insert(u),this._onDecorationRegistered.fire(u)}return u}reset(){for(const l of this._decorations.values())l.dispose();this._decorations.clear()}*getDecorationsAtCell(l,u,g){let S=0,E=0;for(const T of this._decorations.getKeyIterator(u))S=T.options.x??0,E=S+(T.options.width??1),l>=S&&l<E&&(!g||(T.options.layer??"bottom")===g)&&(yield T)}forEachDecorationAtCell(l,u,g,S){this._decorations.forEachByKey(u,(E=>{b=E.options.x??0,M=b+(E.options.width??1),l>=b&&l<M&&(!g||(E.options.layer??"bottom")===g)&&S(E)}))}}o.DecorationService=w;class c extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=v.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=v.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(l){super(),this.options=l,this.onRenderEmitter=this.register(new y.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new y.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=l.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const v=d(2585),y=d(8343);class f{constructor(...b){this._entries=new Map;for(const[M,w]of b)this.set(M,w)}set(b,M){const w=this._entries.get(b);return this._entries.set(b,M),w}forEach(b){for(const[M,w]of this._entries.entries())b(M,w)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}o.ServiceCollection=f,o.InstantiationService=class{constructor(){this._services=new f,this._services.set(v.IInstantiationService,this)}setService(C,b){this._services.set(C,b)}getService(C){return this._services.get(C)}createInstance(C,...b){const M=(0,y.getServiceDependencies)(C).sort(((h,l)=>h.index-l.index)),w=[];for(const h of M){const l=this._services.get(h.id);if(!l)throw new Error(`[createInstance] ${C.name} depends on UNKNOWN service ${h.id}.`);w.push(l)}const c=M.length>0?M[0].index:b.length;if(b.length!==c)throw new Error(`[createInstance] First service dependency of ${C.name} at position ${c+1} conflicts with ${b.length} static arguments`);return new C(...b,...w)}}},7866:function(R,o,d){var v=this&&this.__decorate||function(c,h,l,u){var g,S=arguments.length,E=S<3?h:u===null?u=Object.getOwnPropertyDescriptor(h,l):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(c,h,l,u);else for(var T=c.length-1;T>=0;T--)(g=c[T])&&(E=(S<3?g(E):S>3?g(h,l,E):g(h,l))||E);return S>3&&E&&Object.defineProperty(h,l,E),E},y=this&&this.__param||function(c,h){return function(l,u){h(l,u,c)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const f=d(844),C=d(2585),b={trace:C.LogLevelEnum.TRACE,debug:C.LogLevelEnum.DEBUG,info:C.LogLevelEnum.INFO,warn:C.LogLevelEnum.WARN,error:C.LogLevelEnum.ERROR,off:C.LogLevelEnum.OFF};let M,w=o.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(c){super(),this._optionsService=c,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),M=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(c){for(let h=0;h<c.length;h++)typeof c[h]=="function"&&(c[h]=c[h]())}_log(c,h,l){this._evalLazyOptionalParams(l),c.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...l)}trace(c,...h){var l;this._logLevel<=C.LogLevelEnum.TRACE&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.trace.bind(this._optionsService.options.logger))??console.log,c,h)}debug(c,...h){var l;this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.debug.bind(this._optionsService.options.logger))??console.log,c,h)}info(c,...h){var l;this._logLevel<=C.LogLevelEnum.INFO&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.info.bind(this._optionsService.options.logger))??console.info,c,h)}warn(c,...h){var l;this._logLevel<=C.LogLevelEnum.WARN&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.warn.bind(this._optionsService.options.logger))??console.warn,c,h)}error(c,...h){var l;this._logLevel<=C.LogLevelEnum.ERROR&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.error.bind(this._optionsService.options.logger))??console.error,c,h)}};o.LogService=w=v([y(0,C.IOptionsService)],w),o.setTraceLogger=function(c){M=c},o.traceCall=function(c,h,l){if(typeof l.value!="function")throw new Error("not supported");const u=l.value;l.value=function(...g){if(M.logLevel!==C.LogLevelEnum.TRACE)return u.apply(this,g);M.trace(`GlyphRenderer#${u.name}(${g.map((E=>JSON.stringify(E))).join(", ")})`);const S=u.apply(this,g);return M.trace(`GlyphRenderer#${u.name} return`,S),S}}},7302:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const v=d(8460),y=d(844),f=d(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const C=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends y.Disposable{constructor(w){super(),this._onOptionChange=this.register(new v.EventEmitter),this.onOptionChange=this._onOptionChange.event;const c={...o.DEFAULT_OPTIONS};for(const h in w)if(h in c)try{const l=w[h];c[h]=this._sanitizeAndValidateOption(h,l)}catch(l){console.error(l)}this.rawOptions=c,this.options={...c},this._setupOptions(),this.register((0,y.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,c){return this.onOptionChange((h=>{h===w&&c(this.rawOptions[w])}))}onMultipleOptionChange(w,c){return this.onOptionChange((h=>{w.indexOf(h)!==-1&&c()}))}_setupOptions(){const w=h=>{if(!(h in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);return this.rawOptions[h]},c=(h,l)=>{if(!(h in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);l=this._sanitizeAndValidateOption(h,l),this.rawOptions[h]!==l&&(this.rawOptions[h]=l,this._onOptionChange.fire(h))};for(const h in this.rawOptions){const l={get:w.bind(this,h),set:c.bind(this,h)};Object.defineProperty(this.options,h,l)}}_sanitizeAndValidateOption(w,c){switch(w){case"cursorStyle":if(c||(c=o.DEFAULT_OPTIONS[w]),!(function(h){return h==="block"||h==="underline"||h==="bar"})(c))throw new Error(`"${c}" is not a valid value for ${w}`);break;case"wordSeparator":c||(c=o.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof c=="number"&&1<=c&&c<=1e3)break;c=C.includes(c)?c:o.DEFAULT_OPTIONS[w];break;case"cursorWidth":c=Math.floor(c);case"lineHeight":case"tabStopWidth":if(c<1)throw new Error(`${w} cannot be less than 1, value: ${c}`);break;case"minimumContrastRatio":c=Math.max(1,Math.min(21,Math.round(10*c)/10));break;case"scrollback":if((c=Math.min(c,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${c}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(c<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${c}`);break;case"rows":case"cols":if(!c&&c!==0)throw new Error(`${w} must be numeric, value: ${c}`);break;case"windowsPty":c=c??{}}return c}}o.OptionsService=b},2660:function(R,o,d){var v=this&&this.__decorate||function(b,M,w,c){var h,l=arguments.length,u=l<3?M:c===null?c=Object.getOwnPropertyDescriptor(M,w):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(b,M,w,c);else for(var g=b.length-1;g>=0;g--)(h=b[g])&&(u=(l<3?h(u):l>3?h(M,w,u):h(M,w))||u);return l>3&&u&&Object.defineProperty(M,w,u),u},y=this&&this.__param||function(b,M){return function(w,c){M(w,c,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const f=d(2585);let C=o.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const M=this._bufferService.buffer;if(b.id===void 0){const g=M.addMarker(M.ybase+M.y),S={data:b,id:this._nextId++,lines:[g]};return g.onDispose((()=>this._removeMarkerFromLink(S,g))),this._dataByLinkId.set(S.id,S),S.id}const w=b,c=this._getEntryIdKey(w),h=this._entriesWithId.get(c);if(h)return this.addLineToLink(h.id,M.ybase+M.y),h.id;const l=M.addMarker(M.ybase+M.y),u={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[l]};return l.onDispose((()=>this._removeMarkerFromLink(u,l))),this._entriesWithId.set(u.key,u),this._dataByLinkId.set(u.id,u),u.id}addLineToLink(b,M){const w=this._dataByLinkId.get(b);if(w&&w.lines.every((c=>c.line!==M))){const c=this._bufferService.buffer.addMarker(M);w.lines.push(c),c.onDispose((()=>this._removeMarkerFromLink(w,c)))}}getLinkData(b){var M;return(M=this._dataByLinkId.get(b))==null?void 0:M.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,M){const w=b.lines.indexOf(M);w!==-1&&(b.lines.splice(w,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};o.OscLinkService=C=v([y(0,f.IBufferService)],C)},8343:(R,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const d="di$target",v="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(y){return y[v]||[]},o.createDecorator=function(y){if(o.serviceRegistry.has(y))return o.serviceRegistry.get(y);const f=function(C,b,M){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,c,h){c[d]===c?c[v].push({id:w,index:h}):(c[v]=[{id:w,index:h}],c[d]=c)})(f,C,M)};return f.toString=()=>y,o.serviceRegistry.set(y,f),f}},2585:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const v=d(8343);var y;o.IBufferService=(0,v.createDecorator)("BufferService"),o.ICoreMouseService=(0,v.createDecorator)("CoreMouseService"),o.ICoreService=(0,v.createDecorator)("CoreService"),o.ICharsetService=(0,v.createDecorator)("CharsetService"),o.IInstantiationService=(0,v.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(y||(o.LogLevelEnum=y={})),o.ILogService=(0,v.createDecorator)("LogService"),o.IOptionsService=(0,v.createDecorator)("OptionsService"),o.IOscLinkService=(0,v.createDecorator)("OscLinkService"),o.IUnicodeService=(0,v.createDecorator)("UnicodeService"),o.IDecorationService=(0,v.createDecorator)("DecorationService")},1480:(R,o,d)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const v=d(8460),y=d(225);class f{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,M,w=!1){return(16777215&b)<<3|(3&M)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new v.EventEmitter,this.onChange=this._onChange.event;const b=new y.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let M=0,w=0;const c=b.length;for(let h=0;h<c;++h){let l=b.charCodeAt(h);if(55296<=l&&l<=56319){if(++h>=c)return M+this.wcwidth(l);const S=b.charCodeAt(h);56320<=S&&S<=57343?l=1024*(l-55296)+S-56320+65536:M+=this.wcwidth(S)}const u=this.charProperties(l,w);let g=f.extractWidth(u);f.extractShouldJoin(u)&&(g-=f.extractWidth(w)),M+=g,w=u}return M}charProperties(b,M){return this._activeProvider.charProperties(b,M)}}o.UnicodeService=f}},_={};function p(R){var o=_[R];if(o!==void 0)return o.exports;var d=_[R]={exports:{}};return n[R].call(d.exports,d,d.exports,p),d.exports}var L={};return(()=>{var R=L;Object.defineProperty(R,"__esModule",{value:!0}),R.Terminal=void 0;const o=p(9042),d=p(3236),v=p(844),y=p(5741),f=p(8285),C=p(7975),b=p(7090),M=["cols","rows"];class w extends v.Disposable{constructor(h){super(),this._core=this.register(new d.Terminal(h)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const l=g=>this._core.options[g],u=(g,S)=>{this._checkReadonlyOptions(g),this._core.options[g]=S};for(const g in this._core.options){const S={get:l.bind(this,g),set:u.bind(this,g)};Object.defineProperty(this._publicOptions,g,S)}}_checkReadonlyOptions(h){if(M.includes(h))throw new Error(`Option "${h}" 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 C.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const h=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:h.applicationCursorKeys,applicationKeypadMode:h.applicationKeypad,bracketedPasteMode:h.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:h.origin,reverseWraparoundMode:h.reverseWraparound,sendFocusMode:h.sendFocus,wraparoundMode:h.wraparound}}get options(){return this._publicOptions}set options(h){for(const l in h)this._publicOptions[l]=h[l]}blur(){this._core.blur()}focus(){this._core.focus()}input(h,l=!0){this._core.input(h,l)}resize(h,l){this._verifyIntegers(h,l),this._core.resize(h,l)}open(h){this._core.open(h)}attachCustomKeyEventHandler(h){this._core.attachCustomKeyEventHandler(h)}attachCustomWheelEventHandler(h){this._core.attachCustomWheelEventHandler(h)}registerLinkProvider(h){return this._core.registerLinkProvider(h)}registerCharacterJoiner(h){return this._checkProposedApi(),this._core.registerCharacterJoiner(h)}deregisterCharacterJoiner(h){this._checkProposedApi(),this._core.deregisterCharacterJoiner(h)}registerMarker(h=0){return this._verifyIntegers(h),this._core.registerMarker(h)}registerDecoration(h){return this._checkProposedApi(),this._verifyPositiveIntegers(h.x??0,h.width??0,h.height??0),this._core.registerDecoration(h)}hasSelection(){return this._core.hasSelection()}select(h,l,u){this._verifyIntegers(h,l,u),this._core.select(h,l,u)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(h,l){this._verifyIntegers(h,l),this._core.selectLines(h,l)}dispose(){super.dispose()}scrollLines(h){this._verifyIntegers(h),this._core.scrollLines(h)}scrollPages(h){this._verifyIntegers(h),this._core.scrollPages(h)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(h){this._verifyIntegers(h),this._core.scrollToLine(h)}clear(){this._core.clear()}write(h,l){this._core.write(h,l)}writeln(h,l){this._core.write(h),this._core.write(`\r
48
+ `,l)}paste(h){this._core.paste(h)}refresh(h,l){this._verifyIntegers(h,l),this._core.refresh(h,l)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(h){this._addonManager.loadAddon(this,h)}static get strings(){return o}_verifyIntegers(...h){for(const l of h)if(l===1/0||isNaN(l)||l%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...h){for(const l of h)if(l&&(l===1/0||isNaN(l)||l%1!=0||l<0))throw new Error("This API only accepts positive integers")}}R.Terminal=w})(),L})()))})(nc)),nc.exports}var Fg=jg();/**
49
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
50
+ * @license MIT
51
+ *
52
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
53
+ * @license MIT
54
+ *
55
+ * Originally forked from (with the author's permission):
56
+ * Fabrice Bellard's javascript vt100 for jslinux:
57
+ * http://bellard.org/jslinux/
58
+ * Copyright (c) 2011 Fabrice Bellard
59
+ */var Hg=2,$g=1,zg=class{activate(r){this._terminal=r}dispose(){}fit(){let r=this.proposeDimensions();if(!r||!this._terminal||isNaN(r.cols)||isNaN(r.rows))return;let i=this._terminal._core;(this._terminal.rows!==r.rows||this._terminal.cols!==r.cols)&&(i._renderService.clear(),this._terminal.resize(r.cols,r.rows))}proposeDimensions(){var f;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let r=this._terminal._core._renderService.dimensions;if(r.css.cell.width===0||r.css.cell.height===0)return;let i=this._terminal.options.scrollback===0?0:((f=this._terminal.options.overviewRuler)==null?void 0:f.width)||14,n=window.getComputedStyle(this._terminal.element.parentElement),_=parseInt(n.getPropertyValue("height")),p=Math.max(0,parseInt(n.getPropertyValue("width"))),L=window.getComputedStyle(this._terminal.element),R={top:parseInt(L.getPropertyValue("padding-top")),bottom:parseInt(L.getPropertyValue("padding-bottom")),right:parseInt(L.getPropertyValue("padding-right")),left:parseInt(L.getPropertyValue("padding-left"))},o=R.top+R.bottom,d=R.right+R.left,v=_-o,y=p-d-i;return{cols:Math.max(Hg,Math.floor(y/r.css.cell.width)),rows:Math.max($g,Math.floor(v/r.css.cell.height))}}};/**
60
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
61
+ * @license MIT
62
+ *
63
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
64
+ * @license MIT
65
+ *
66
+ * Originally forked from (with the author's permission):
67
+ * Fabrice Bellard's javascript vt100 for jslinux:
68
+ * http://bellard.org/jslinux/
69
+ * Copyright (c) 2011 Fabrice Bellard
70
+ */var oc=[[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]],Ug=[[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]],At;function Wg(r,i){let n=0,_=i.length-1,p;if(r<i[0][0]||r>i[_][1])return!1;for(;_>=n;)if(p=n+_>>1,r>i[p][1])n=p+1;else if(r<i[p][0])_=p-1;else return!0;return!1}var Vg=class{constructor(){if(this.version="6",!At){At=new Uint8Array(65536),At.fill(1),At[0]=0,At.fill(0,1,32),At.fill(0,127,160),At.fill(2,4352,4448),At[9001]=2,At[9002]=2,At.fill(2,11904,42192),At[12351]=1,At.fill(2,44032,55204),At.fill(2,63744,64256),At.fill(2,65040,65050),At.fill(2,65072,65136),At.fill(2,65280,65377),At.fill(2,65504,65511);for(let i=0;i<oc.length;++i)At.fill(0,oc[i][0],oc[i][1]+1)}}wcwidth(i){return i<32?0:i<127?1:i<65536?At[i]:Wg(i,Ug)?0:i>=131072&&i<=196605||i>=196608&&i<=262141?2:1}charProperties(i,n){let _=this.wcwidth(i),p=_===0&&n!==0;if(p){let L=la.extractWidth(n);L===0?p=!1:L>_&&(_=L)}return la.createPropertyValue(0,_,p)}},Kg=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(i){setTimeout(()=>{throw i.stack?Id.isErrorNoTelemetry(i)?new Id(i.message+`
71
+
72
+ `+i.stack):new Error(i.message+`
73
+
74
+ `+i.stack):i},0)}}addListener(i){return this.listeners.push(i),()=>{this._removeListener(i)}}emit(i){this.listeners.forEach(n=>{n(i)})}_removeListener(i){this.listeners.splice(this.listeners.indexOf(i),1)}setUnexpectedErrorHandler(i){this.unexpectedErrorHandler=i}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(i){this.unexpectedErrorHandler(i),this.emit(i)}onUnexpectedExternalError(i){this.unexpectedErrorHandler(i)}},qg=new Kg;function ac(r){Gg(r)||qg.onUnexpectedError(r)}var Ic="Canceled";function Gg(r){return r instanceof Yg?!0:r instanceof Error&&r.name===Ic&&r.message===Ic}var Yg=class extends Error{constructor(){super(Ic),this.name=this.message}},Id=class jc extends Error{constructor(i){super(i),this.name="CodeExpectedError"}static fromError(i){if(i instanceof jc)return i;let n=new jc;return n.message=i.message,n.stack=i.stack,n}static isErrorNoTelemetry(i){return i.name==="CodeExpectedError"}};function Xg(r,i){let n=this,_=!1,p;return function(){return _||(_=!0,i||(p=r.apply(n,arguments))),p}}var Jg;(r=>{function i(L){return L<0}r.isLessThan=i;function n(L){return L<=0}r.isLessThanOrEqual=n;function _(L){return L>0}r.isGreaterThan=_;function p(L){return L===0}r.isNeitherLessOrGreaterThan=p,r.greaterThan=1,r.lessThan=-1,r.neitherLessOrGreaterThan=0})(Jg||(Jg={}));var ap;(r=>{function i(g){return g&&typeof g=="object"&&typeof g[Symbol.iterator]=="function"}r.is=i;let n=Object.freeze([]);function _(){return n}r.empty=_;function*p(g){yield g}r.single=p;function L(g){return i(g)?g:p(g)}r.wrap=L;function R(g){return g||n}r.from=R;function*o(g){for(let S=g.length-1;S>=0;S--)yield g[S]}r.reverse=o;function d(g){return!g||g[Symbol.iterator]().next().done===!0}r.isEmpty=d;function v(g){return g[Symbol.iterator]().next().value}r.first=v;function y(g,S){let E=0;for(let T of g)if(S(T,E++))return!0;return!1}r.some=y;function f(g,S){for(let E of g)if(S(E))return E}r.find=f;function*C(g,S){for(let E of g)S(E)&&(yield E)}r.filter=C;function*b(g,S){let E=0;for(let T of g)yield S(T,E++)}r.map=b;function*M(g,S){let E=0;for(let T of g)yield*S(T,E++)}r.flatMap=M;function*w(...g){for(let S of g)yield*S}r.concat=w;function c(g,S,E){let T=E;for(let k of g)T=S(T,k);return T}r.reduce=c;function*h(g,S,E=g.length){for(S<0&&(S+=g.length),E<0?E+=g.length:E>g.length&&(E=g.length);S<E;S++)yield g[S]}r.slice=h;function l(g,S=Number.POSITIVE_INFINITY){let E=[];if(S===0)return[E,g];let T=g[Symbol.iterator]();for(let k=0;k<S;k++){let N=T.next();if(N.done)return[E,r.empty()];E.push(N.value)}return[E,{[Symbol.iterator](){return T}}]}r.consume=l;async function u(g){let S=[];for await(let E of g)S.push(E);return Promise.resolve(S)}r.asyncToArray=u})(ap||(ap={}));function lp(r){if(ap.is(r)){let i=[];for(let n of r)if(n)try{n.dispose()}catch(_){i.push(_)}if(i.length===1)throw i[0];if(i.length>1)throw new AggregateError(i,"Encountered errors while disposing of store");return Array.isArray(r)?[]:r}else if(r)return r.dispose(),r}function Qg(...r){return cp(()=>lp(r))}function cp(r){return{dispose:Xg(()=>{r()})}}var hp=class up{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{lp(this._toDispose)}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?up.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(i),i}delete(i){if(i){if(i===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(i),i.dispose()}}deleteAndLeak(i){i&&this._toDispose.has(i)&&(this._toDispose.delete(i),void 0)}};hp.DISABLE_DISPOSED_WARNING=!1;var Yc=hp,aa=class{constructor(){this._store=new Yc,this._store}dispose(){this._store.dispose()}_register(i){if(i===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(i)}};aa.None=Object.freeze({dispose(){}});var Zg=globalThis.performance&&typeof globalThis.performance.now=="function",em=class dp{static create(i){return new dp(i)}constructor(i){this._now=Zg&&i===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},tm;(r=>{r.None=()=>aa.None;function i(O,B){return f(O,()=>{},0,void 0,!0,void 0,B)}r.defer=i;function n(O){return(B,U=null,z)=>{let q=!1,Y;return Y=O(W=>{if(!q)return Y?Y.dispose():q=!0,B.call(U,W)},null,z),q&&Y.dispose(),Y}}r.once=n;function _(O,B,U){return v((z,q=null,Y)=>O(W=>z.call(q,B(W)),null,Y),U)}r.map=_;function p(O,B,U){return v((z,q=null,Y)=>O(W=>{B(W),z.call(q,W)},null,Y),U)}r.forEach=p;function L(O,B,U){return v((z,q=null,Y)=>O(W=>B(W)&&z.call(q,W),null,Y),U)}r.filter=L;function R(O){return O}r.signal=R;function o(...O){return(B,U=null,z)=>{let q=Qg(...O.map(Y=>Y(W=>B.call(U,W))));return y(q,z)}}r.any=o;function d(O,B,U,z){let q=U;return _(O,Y=>(q=B(q,Y),q),z)}r.reduce=d;function v(O,B){let U,z={onWillAddFirstListener(){U=O(q.fire,q)},onDidRemoveLastListener(){U==null||U.dispose()}},q=new Pi(z);return B==null||B.add(q),q.event}function y(O,B){return B instanceof Array?B.push(O):B&&B.add(O),O}function f(O,B,U=100,z=!1,q=!1,Y,W){let A,I,P,H=0,J,ie={leakWarningThreshold:Y,onWillAddFirstListener(){A=O(ue=>{H++,I=B(I,ue),z&&!P&&(ae.fire(I),I=void 0),J=()=>{let X=I;I=void 0,P=void 0,(!z||H>1)&&ae.fire(X),H=0},typeof U=="number"?(clearTimeout(P),P=setTimeout(J,U)):P===void 0&&(P=0,queueMicrotask(J))})},onWillRemoveListener(){q&&H>0&&(J==null||J())},onDidRemoveLastListener(){J=void 0,A.dispose()}},ae=new Pi(ie);return W==null||W.add(ae),ae.event}r.debounce=f;function C(O,B=0,U){return r.debounce(O,(z,q)=>z?(z.push(q),z):[q],B,void 0,!0,void 0,U)}r.accumulate=C;function b(O,B=(z,q)=>z===q,U){let z=!0,q;return L(O,Y=>{let W=z||!B(Y,q);return z=!1,q=Y,W},U)}r.latch=b;function M(O,B,U){return[r.filter(O,B,U),r.filter(O,z=>!B(z),U)]}r.split=M;function w(O,B=!1,U=[],z){let q=U.slice(),Y=O(I=>{q?q.push(I):A.fire(I)});z&&z.add(Y);let W=()=>{q==null||q.forEach(I=>A.fire(I)),q=null},A=new Pi({onWillAddFirstListener(){Y||(Y=O(I=>A.fire(I)),z&&z.add(Y))},onDidAddFirstListener(){q&&(B?setTimeout(W):W())},onDidRemoveLastListener(){Y&&Y.dispose(),Y=null}});return z&&z.add(A),A.event}r.buffer=w;function c(O,B){return(U,z,q)=>{let Y=B(new l);return O(function(W){let A=Y.evaluate(W);A!==h&&U.call(z,A)},void 0,q)}}r.chain=c;let h=Symbol("HaltChainable");class l{constructor(){this.steps=[]}map(B){return this.steps.push(B),this}forEach(B){return this.steps.push(U=>(B(U),U)),this}filter(B){return this.steps.push(U=>B(U)?U:h),this}reduce(B,U){let z=U;return this.steps.push(q=>(z=B(z,q),z)),this}latch(B=(U,z)=>U===z){let U=!0,z;return this.steps.push(q=>{let Y=U||!B(q,z);return U=!1,z=q,Y?q:h}),this}evaluate(B){for(let U of this.steps)if(B=U(B),B===h)break;return B}}function u(O,B,U=z=>z){let z=(...A)=>W.fire(U(...A)),q=()=>O.on(B,z),Y=()=>O.removeListener(B,z),W=new Pi({onWillAddFirstListener:q,onDidRemoveLastListener:Y});return W.event}r.fromNodeEventEmitter=u;function g(O,B,U=z=>z){let z=(...A)=>W.fire(U(...A)),q=()=>O.addEventListener(B,z),Y=()=>O.removeEventListener(B,z),W=new Pi({onWillAddFirstListener:q,onDidRemoveLastListener:Y});return W.event}r.fromDOMEventEmitter=g;function S(O){return new Promise(B=>n(O)(B))}r.toPromise=S;function E(O){let B=new Pi;return O.then(U=>{B.fire(U)},()=>{B.fire(void 0)}).finally(()=>{B.dispose()}),B.event}r.fromPromise=E;function T(O,B){return O(U=>B.fire(U))}r.forward=T;function k(O,B,U){return B(U),O(z=>B(z))}r.runAndSubscribe=k;class N{constructor(B,U){this._observable=B,this._counter=0,this._hasChanged=!1;let z={onWillAddFirstListener:()=>{B.addObserver(this)},onDidRemoveLastListener:()=>{B.removeObserver(this)}};this.emitter=new Pi(z),U&&U.add(this.emitter)}beginUpdate(B){this._counter++}handlePossibleChange(B){}handleChange(B,U){this._hasChanged=!0}endUpdate(B){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function V(O,B){return new N(O,B).emitter.event}r.fromObservable=V;function K(O){return(B,U,z)=>{let q=0,Y=!1,W={beginUpdate(){q++},endUpdate(){q--,q===0&&(O.reportChanges(),Y&&(Y=!1,B.call(U)))},handlePossibleChange(){},handleChange(){Y=!0}};O.addObserver(W),O.reportChanges();let A={dispose(){O.removeObserver(W)}};return z instanceof Yc?z.add(A):Array.isArray(z)&&z.push(A),A}}r.fromObservableLight=K})(tm||(tm={}));var Fc=class Hc{constructor(i){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${i}_${Hc._idPool++}`,Hc.all.add(this)}start(i){this._stopWatch=new em,this.listenerCount=i}stop(){if(this._stopWatch){let i=this._stopWatch.elapsed();this.durations.push(i),this.elapsedOverall+=i,this.invocationCount+=1,this._stopWatch=void 0}}};Fc.all=new Set,Fc._idPool=0;var rm=Fc,im=-1,fp=class pp{constructor(i,n,_=(pp._idPool++).toString(16).padStart(3,"0")){this._errorHandler=i,this.threshold=n,this.name=_,this._warnCountdown=0}dispose(){var i;(i=this._stacks)==null||i.clear()}check(i,n){let _=this.threshold;if(_<=0||n<_)return;this._stacks||(this._stacks=new Map);let p=this._stacks.get(i.value)||0;if(this._stacks.set(i.value,p+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=_*.5;let[L,R]=this.getMostFrequentStack(),o=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${R}):`;console.warn(o),console.warn(L);let d=new om(o,L);this._errorHandler(d)}return()=>{let L=this._stacks.get(i.value)||0;this._stacks.set(i.value,L-1)}}getMostFrequentStack(){if(!this._stacks)return;let i,n=0;for(let[_,p]of this._stacks)(!i||n<p)&&(i=[_,p],n=p);return i}};fp._idPool=1;var sm=fp,nm=class _p{constructor(i){this.value=i}static create(){let i=new Error;return new _p(i.stack??"")}print(){console.warn(this.value.split(`
75
+ `).slice(2).join(`
76
+ `))}},om=class extends Error{constructor(i,n){super(i),this.name="ListenerLeakError",this.stack=n}},am=class extends Error{constructor(i,n){super(i),this.name="ListenerRefusalError",this.stack=n}},lm=0,lc=class{constructor(r){this.value=r,this.id=lm++}},cm=2,hm,Pi=class{constructor(i){var n,_,p,L;this._size=0,this._options=i,this._leakageMon=(n=this._options)!=null&&n.leakWarningThreshold?new sm((i==null?void 0:i.onListenerError)??ac,((_=this._options)==null?void 0:_.leakWarningThreshold)??im):void 0,this._perfMon=(p=this._options)!=null&&p._profName?new rm(this._options._profName):void 0,this._deliveryQueue=(L=this._options)==null?void 0:L.deliveryQueue}dispose(){var i,n,_,p;this._disposed||(this._disposed=!0,((i=this._deliveryQueue)==null?void 0:i.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(_=(n=this._options)==null?void 0:n.onDidRemoveLastListener)==null||_.call(n),(p=this._leakageMon)==null||p.dispose())}get event(){return this._event??(this._event=(i,n,_)=>{var o,d,v,y,f;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let C=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(C);let b=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],M=new am(`${C}. HINT: Stack shows most frequent listener (${b[1]}-times)`,b[0]);return(((o=this._options)==null?void 0:o.onListenerError)||ac)(M),aa.None}if(this._disposed)return aa.None;n&&(i=i.bind(n));let p=new lc(i),L;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(p.stack=nm.create(),L=this._leakageMon.check(p.stack,this._size+1)),this._listeners?this._listeners instanceof lc?(this._deliveryQueue??(this._deliveryQueue=new um),this._listeners=[this._listeners,p]):this._listeners.push(p):((v=(d=this._options)==null?void 0:d.onWillAddFirstListener)==null||v.call(d,this),this._listeners=p,(f=(y=this._options)==null?void 0:y.onDidAddFirstListener)==null||f.call(y,this)),this._size++;let R=cp(()=>{L==null||L(),this._removeListener(p)});return _ instanceof Yc?_.add(R):Array.isArray(_)&&_.push(R),R}),this._event}_removeListener(i){var L,R,o,d;if((R=(L=this._options)==null?void 0:L.onWillRemoveListener)==null||R.call(L,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(d=(o=this._options)==null?void 0:o.onDidRemoveLastListener)==null||d.call(o,this),this._size=0;return}let n=this._listeners,_=n.indexOf(i);if(_===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[_]=void 0;let p=this._deliveryQueue.current===this;if(this._size*cm<=n.length){let v=0;for(let y=0;y<n.length;y++)n[y]?n[v++]=n[y]:p&&(this._deliveryQueue.end--,v<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=v}}_deliver(i,n){var p;if(!i)return;let _=((p=this._options)==null?void 0:p.onListenerError)||ac;if(!_){i.value(n);return}try{i.value(n)}catch(L){_(L)}}_deliverQueue(i){let n=i.current._listeners;for(;i.i<i.end;)this._deliver(n[i.i++],i.value);i.reset()}fire(i){var n,_,p,L;if((n=this._deliveryQueue)!=null&&n.current&&(this._deliverQueue(this._deliveryQueue),(_=this._perfMon)==null||_.stop()),(p=this._perfMon)==null||p.start(this._size),this._listeners)if(this._listeners instanceof lc)this._deliver(this._listeners,i);else{let R=this._deliveryQueue;R.enqueue(this,i,this._listeners.length),this._deliverQueue(R)}(L=this._perfMon)==null||L.stop()}hasListeners(){return this._size>0}},um=class{constructor(){this.i=-1,this.end=0}enqueue(r,i,n){this.i=0,this.end=n,this.current=r,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},la=class Zo{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Pi,this.onChange=this._onChange.event;let i=new Vg;this.register(i),this._active=i.version,this._activeProvider=i}static extractShouldJoin(i){return(i&1)!==0}static extractWidth(i){return i>>1&3}static extractCharKind(i){return i>>3}static createPropertyValue(i,n,_=!1){return(i&16777215)<<3|(n&3)<<1|(_?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(i){if(!this._providers[i])throw new Error(`unknown Unicode version "${i}"`);this._active=i,this._activeProvider=this._providers[i],this._onChange.fire(i)}register(i){this._providers[i.version]=i}wcwidth(i){return this._activeProvider.wcwidth(i)}getStringCellWidth(i){let n=0,_=0,p=i.length;for(let L=0;L<p;++L){let R=i.charCodeAt(L);if(55296<=R&&R<=56319){if(++L>=p)return n+this.wcwidth(R);let v=i.charCodeAt(L);56320<=v&&v<=57343?R=(R-55296)*1024+v-56320+65536:n+=this.wcwidth(v)}let o=this.charProperties(R,_),d=Zo.extractWidth(o);Zo.extractShouldJoin(o)&&(d-=Zo.extractWidth(_)),n+=d,_=o}return n}charProperties(i,n){return this._activeProvider.charProperties(i,n)}},cc=[[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]],dm=[[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]],hc=[[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]],fm=[[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]],oi;function jd(r,i){let n=0,_=i.length-1,p;if(r<i[0][0]||r>i[_][1])return!1;for(;_>=n;)if(p=n+_>>1,r>i[p][1])n=p+1;else if(r<i[p][0])_=p-1;else return!0;return!1}var pm=class{constructor(){if(this.version="11",!oi){oi=new Uint8Array(65536),oi.fill(1),oi[0]=0,oi.fill(0,1,32),oi.fill(0,127,160);for(let i=0;i<cc.length;++i)oi.fill(0,cc[i][0],cc[i][1]+1);for(let i=0;i<hc.length;++i)oi.fill(2,hc[i][0],hc[i][1]+1)}}wcwidth(i){return i<32?0:i<127?1:i<65536?oi[i]:jd(i,dm)?0:jd(i,fm)?2:1}charProperties(i,n){let _=this.wcwidth(i),p=_===0&&n!==0;if(p){let L=la.extractWidth(n);L===0?p=!1:L>_&&(_=L)}return la.createPropertyValue(0,_,p)}},_m=class{activate(r){r.unicode.register(new pm)}dispose(){}};/**
77
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
78
+ * @license MIT
79
+ *
80
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
81
+ * @license MIT
82
+ *
83
+ * Originally forked from (with the author's permission):
84
+ * Fabrice Bellard's javascript vt100 for jslinux:
85
+ * http://bellard.org/jslinux/
86
+ * Copyright (c) 2011 Fabrice Bellard
87
+ */var vm=class{constructor(i,n,_,p={}){this._terminal=i,this._regex=n,this._handler=_,this._options=p}provideLinks(i,n){let _=mm.computeLink(i,this._regex,this._terminal,this._handler);n(this._addCallbacks(_))}_addCallbacks(i){return i.map(n=>(n.leave=this._options.leave,n.hover=(_,p)=>{if(this._options.hover){let{range:L}=n;this._options.hover(_,p,L)}},n))}};function gm(r){try{let i=new URL(r),n=i.password&&i.username?`${i.protocol}//${i.username}:${i.password}@${i.host}`:i.username?`${i.protocol}//${i.username}@${i.host}`:`${i.protocol}//${i.host}`;return r.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var mm=class ea{static computeLink(i,n,_,p){let L=new RegExp(n.source,(n.flags||"")+"g"),[R,o]=ea._getWindowedLineStrings(i-1,_),d=R.join(""),v,y=[];for(;v=L.exec(d);){let f=v[0];if(!gm(f))continue;let[C,b]=ea._mapStrIdx(_,o,0,v.index),[M,w]=ea._mapStrIdx(_,C,b,f.length);if(C===-1||b===-1||M===-1||w===-1)continue;let c={start:{x:b+1,y:C+1},end:{x:w,y:M+1}};y.push({range:c,text:f,activate:p})}return y}static _getWindowedLineStrings(i,n){let _,p=i,L=i,R=0,o="",d=[];if(_=n.buffer.active.getLine(i)){let v=_.translateToString(!0);if(_.isWrapped&&v[0]!==" "){for(R=0;(_=n.buffer.active.getLine(--p))&&R<2048&&(o=_.translateToString(!0),R+=o.length,d.push(o),!(!_.isWrapped||o.indexOf(" ")!==-1)););d.reverse()}for(d.push(v),R=0;(_=n.buffer.active.getLine(++L))&&_.isWrapped&&R<2048&&(o=_.translateToString(!0),R+=o.length,d.push(o),o.indexOf(" ")===-1););}return[d,p]}static _mapStrIdx(i,n,_,p){let L=i.buffer.active,R=L.getNullCell(),o=_;for(;p;){let d=L.getLine(n);if(!d)return[-1,-1];for(let v=o;v<d.length;++v){d.getCell(v,R);let y=R.getChars();if(R.getWidth()&&(p-=y.length||1,v===d.length-1&&y==="")){let f=L.getLine(n+1);f&&f.isWrapped&&(f.getCell(0,R),R.getWidth()===2&&(p+=1))}if(p<0)return[n,v]}n++,o=0}return[n,o]}},ym=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function wm(r,i){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}var Sm=class{constructor(r=wm,i={}){this._handler=r,this._options=i}activate(r){this._terminal=r;let i=this._options,n=i.urlRegex||ym;this._linkProvider=this._terminal.registerLinkProvider(new vm(this._terminal,n,this._handler,i))}dispose(){var r;(r=this._linkProvider)==null||r.dispose()}};/**
88
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
89
+ * @license MIT
90
+ *
91
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
92
+ * @license MIT
93
+ *
94
+ * Originally forked from (with the author's permission):
95
+ * Fabrice Bellard's javascript vt100 for jslinux:
96
+ * http://bellard.org/jslinux/
97
+ * Copyright (c) 2011 Fabrice Bellard
98
+ */var Cm=(r,i,n,_)=>{for(var p=i,L=r.length-1,R;L>=0;L--)(R=r[L])&&(p=R(p)||p);return p},xm=(r,i)=>(n,_)=>i(n,_,r),bm=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(r){setTimeout(()=>{throw r.stack?Fd.isErrorNoTelemetry(r)?new Fd(r.message+`
99
+
100
+ `+r.stack):new Error(r.message+`
101
+
102
+ `+r.stack):r},0)}}addListener(r){return this.listeners.push(r),()=>{this._removeListener(r)}}emit(r){this.listeners.forEach(i=>{i(r)})}_removeListener(r){this.listeners.splice(this.listeners.indexOf(r),1)}setUnexpectedErrorHandler(r){this.unexpectedErrorHandler=r}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(r){this.unexpectedErrorHandler(r),this.emit(r)}onUnexpectedExternalError(r){this.unexpectedErrorHandler(r)}},Em=new bm;function uc(r){km(r)||Em.onUnexpectedError(r)}var $c="Canceled";function km(r){return r instanceof Lm?!0:r instanceof Error&&r.name===$c&&r.message===$c}var Lm=class extends Error{constructor(){super($c),this.name=this.message}},Fd=class zc extends Error{constructor(i){super(i),this.name="CodeExpectedError"}static fromError(i){if(i instanceof zc)return i;let n=new zc;return n.message=i.message,n.stack=i.stack,n}static isErrorNoTelemetry(i){return i.name==="CodeExpectedError"}},Rm;(r=>{function i(L){return L<0}r.isLessThan=i;function n(L){return L<=0}r.isLessThanOrEqual=n;function _(L){return L>0}r.isGreaterThan=_;function p(L){return L===0}r.isNeitherLessOrGreaterThan=p,r.greaterThan=1,r.lessThan=-1,r.neitherLessOrGreaterThan=0})(Rm||(Rm={}));function Tm(r,i){let n=this,_=!1,p;return function(){return _||(_=!0,i||(p=r.apply(n,arguments))),p}}var vp;(r=>{function i(g){return g&&typeof g=="object"&&typeof g[Symbol.iterator]=="function"}r.is=i;let n=Object.freeze([]);function _(){return n}r.empty=_;function*p(g){yield g}r.single=p;function L(g){return i(g)?g:p(g)}r.wrap=L;function R(g){return g||n}r.from=R;function*o(g){for(let S=g.length-1;S>=0;S--)yield g[S]}r.reverse=o;function d(g){return!g||g[Symbol.iterator]().next().done===!0}r.isEmpty=d;function v(g){return g[Symbol.iterator]().next().value}r.first=v;function y(g,S){let E=0;for(let T of g)if(S(T,E++))return!0;return!1}r.some=y;function f(g,S){for(let E of g)if(S(E))return E}r.find=f;function*C(g,S){for(let E of g)S(E)&&(yield E)}r.filter=C;function*b(g,S){let E=0;for(let T of g)yield S(T,E++)}r.map=b;function*M(g,S){let E=0;for(let T of g)yield*S(T,E++)}r.flatMap=M;function*w(...g){for(let S of g)yield*S}r.concat=w;function c(g,S,E){let T=E;for(let k of g)T=S(T,k);return T}r.reduce=c;function*h(g,S,E=g.length){for(S<0&&(S+=g.length),E<0?E+=g.length:E>g.length&&(E=g.length);S<E;S++)yield g[S]}r.slice=h;function l(g,S=Number.POSITIVE_INFINITY){let E=[];if(S===0)return[E,g];let T=g[Symbol.iterator]();for(let k=0;k<S;k++){let N=T.next();if(N.done)return[E,r.empty()];E.push(N.value)}return[E,{[Symbol.iterator](){return T}}]}r.consume=l;async function u(g){let S=[];for await(let E of g)S.push(E);return Promise.resolve(S)}r.asyncToArray=u})(vp||(vp={}));function gp(r){if(vp.is(r)){let i=[];for(let n of r)if(n)try{n.dispose()}catch(_){i.push(_)}if(i.length===1)throw i[0];if(i.length>1)throw new AggregateError(i,"Encountered errors while disposing of store");return Array.isArray(r)?[]:r}else if(r)return r.dispose(),r}function mp(...r){return tr(()=>gp(r))}function tr(r){return{dispose:Tm(()=>{r()})}}var yp=class wp{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{gp(this._toDispose)}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?wp.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(i),i}delete(i){if(i){if(i===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(i),i.dispose()}}deleteAndLeak(i){i&&this._toDispose.has(i)&&(this._toDispose.delete(i),void 0)}};yp.DISABLE_DISPOSED_WARNING=!1;var Is=yp,$r=class{constructor(){this._store=new Is,this._store}dispose(){this._store.dispose()}_register(r){if(r===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(r)}};$r.None=Object.freeze({dispose(){}});var Cn=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(i){var n;this._isDisposed||i===this._value||((n=this._value)==null||n.dispose(),this._value=i)}clear(){this.value=void 0}dispose(){var i;this._isDisposed=!0,(i=this._value)==null||i.dispose(),this._value=void 0}clearAndLeak(){let i=this._value;return this._value=void 0,i}},Xc=typeof process<"u"&&"title"in process,ua=Xc?"node":navigator.userAgent,Mm=Xc?"node":navigator.platform,Dm=ua.includes("Firefox"),Am=ua.includes("Edge"),Sp=/^((?!chrome|android).)*safari/i.test(ua);function Bm(){if(!Sp)return 0;let r=ua.match(/Version\/(\d+)/);return r===null||r.length<2?0:parseInt(r[1])}Mm.indexOf("Linux")>=0;var Pm="",$t=0,zt=0,Ut=0,mt=0,Mr={css:"#00000000",rgba:0},nr;(r=>{function i(p,L,R,o){return o!==void 0?`#${Qi(p)}${Qi(L)}${Qi(R)}${Qi(o)}`:`#${Qi(p)}${Qi(L)}${Qi(R)}`}r.toCss=i;function n(p,L,R,o=255){return(p<<24|L<<16|R<<8|o)>>>0}r.toRgba=n;function _(p,L,R,o){return{css:r.toCss(p,L,R,o),rgba:r.toRgba(p,L,R,o)}}r.toColor=_})(nr||(nr={}));var Ln;(r=>{function i(d,v){if(mt=(v.rgba&255)/255,mt===1)return{css:v.css,rgba:v.rgba};let y=v.rgba>>24&255,f=v.rgba>>16&255,C=v.rgba>>8&255,b=d.rgba>>24&255,M=d.rgba>>16&255,w=d.rgba>>8&255;$t=b+Math.round((y-b)*mt),zt=M+Math.round((f-M)*mt),Ut=w+Math.round((C-w)*mt);let c=nr.toCss($t,zt,Ut),h=nr.toRgba($t,zt,Ut);return{css:c,rgba:h}}r.blend=i;function n(d){return(d.rgba&255)===255}r.isOpaque=n;function _(d,v,y){let f=ts.ensureContrastRatio(d.rgba,v.rgba,y);if(f)return nr.toColor(f>>24&255,f>>16&255,f>>8&255)}r.ensureContrastRatio=_;function p(d){let v=(d.rgba|255)>>>0;return[$t,zt,Ut]=ts.toChannels(v),{css:nr.toCss($t,zt,Ut),rgba:v}}r.opaque=p;function L(d,v){return mt=Math.round(v*255),[$t,zt,Ut]=ts.toChannels(d.rgba),{css:nr.toCss($t,zt,Ut,mt),rgba:nr.toRgba($t,zt,Ut,mt)}}r.opacity=L;function R(d,v){return mt=d.rgba&255,L(d,mt*v/255)}r.multiplyOpacity=R;function o(d){return[d.rgba>>24&255,d.rgba>>16&255,d.rgba>>8&255]}r.toColorRGB=o})(Ln||(Ln={}));var Om;(r=>{let i,n;try{let p=document.createElement("canvas");p.width=1,p.height=1;let L=p.getContext("2d",{willReadFrequently:!0});L&&(i=L,i.globalCompositeOperation="copy",n=i.createLinearGradient(0,0,1,1))}catch{}function _(p){if(p.match(/#[\da-f]{3,8}/i))switch(p.length){case 4:return $t=parseInt(p.slice(1,2).repeat(2),16),zt=parseInt(p.slice(2,3).repeat(2),16),Ut=parseInt(p.slice(3,4).repeat(2),16),nr.toColor($t,zt,Ut);case 5:return $t=parseInt(p.slice(1,2).repeat(2),16),zt=parseInt(p.slice(2,3).repeat(2),16),Ut=parseInt(p.slice(3,4).repeat(2),16),mt=parseInt(p.slice(4,5).repeat(2),16),nr.toColor($t,zt,Ut,mt);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}}let L=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(L)return $t=parseInt(L[1]),zt=parseInt(L[2]),Ut=parseInt(L[3]),mt=Math.round((L[5]===void 0?1:parseFloat(L[5]))*255),nr.toColor($t,zt,Ut,mt);if(!i||!n)throw new Error("css.toColor: Unsupported css format");if(i.fillStyle=n,i.fillStyle=p,typeof i.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(i.fillRect(0,0,1,1),[$t,zt,Ut,mt]=i.getImageData(0,0,1,1).data,mt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:nr.toRgba($t,zt,Ut,mt),css:p}}r.toColor=_})(Om||(Om={}));var sr;(r=>{function i(_){return n(_>>16&255,_>>8&255,_&255)}r.relativeLuminance=i;function n(_,p,L){let R=_/255,o=p/255,d=L/255,v=R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4),y=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),f=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4);return v*.2126+y*.7152+f*.0722}r.relativeLuminance2=n})(sr||(sr={}));var ts;(r=>{function i(R,o){if(mt=(o&255)/255,mt===1)return o;let d=o>>24&255,v=o>>16&255,y=o>>8&255,f=R>>24&255,C=R>>16&255,b=R>>8&255;return $t=f+Math.round((d-f)*mt),zt=C+Math.round((v-C)*mt),Ut=b+Math.round((y-b)*mt),nr.toRgba($t,zt,Ut)}r.blend=i;function n(R,o,d){let v=sr.relativeLuminance(R>>8),y=sr.relativeLuminance(o>>8);if(ai(v,y)<d){if(y<v){let b=_(R,o,d),M=ai(v,sr.relativeLuminance(b>>8));if(M<d){let w=p(R,o,d),c=ai(v,sr.relativeLuminance(w>>8));return M>c?b:w}return b}let f=p(R,o,d),C=ai(v,sr.relativeLuminance(f>>8));if(C<d){let b=_(R,o,d),M=ai(v,sr.relativeLuminance(b>>8));return C>M?f:b}return f}}r.ensureContrastRatio=n;function _(R,o,d){let v=R>>24&255,y=R>>16&255,f=R>>8&255,C=o>>24&255,b=o>>16&255,M=o>>8&255,w=ai(sr.relativeLuminance2(C,b,M),sr.relativeLuminance2(v,y,f));for(;w<d&&(C>0||b>0||M>0);)C-=Math.max(0,Math.ceil(C*.1)),b-=Math.max(0,Math.ceil(b*.1)),M-=Math.max(0,Math.ceil(M*.1)),w=ai(sr.relativeLuminance2(C,b,M),sr.relativeLuminance2(v,y,f));return(C<<24|b<<16|M<<8|255)>>>0}r.reduceLuminance=_;function p(R,o,d){let v=R>>24&255,y=R>>16&255,f=R>>8&255,C=o>>24&255,b=o>>16&255,M=o>>8&255,w=ai(sr.relativeLuminance2(C,b,M),sr.relativeLuminance2(v,y,f));for(;w<d&&(C<255||b<255||M<255);)C=Math.min(255,C+Math.ceil((255-C)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),M=Math.min(255,M+Math.ceil((255-M)*.1)),w=ai(sr.relativeLuminance2(C,b,M),sr.relativeLuminance2(v,y,f));return(C<<24|b<<16|M<<8|255)>>>0}r.increaseLuminance=p;function L(R){return[R>>24&255,R>>16&255,R>>8&255,R&255]}r.toChannels=L})(ts||(ts={}));function Qi(r){let i=r.toString(16);return i.length<2?"0"+i:i}function ai(r,i){return r<i?(i+.05)/(r+.05):(r+.05)/(i+.05)}function Rt(r){if(!r)throw new Error("value must not be falsy");return r}function Jc(r){return 57508<=r&&r<=57558}function Nm(r){return 57520<=r&&r<=57527}function Im(r){return 57344<=r&&r<=63743}function jm(r){return 9472<=r&&r<=9631}function Fm(r){return r>=128512&&r<=128591||r>=127744&&r<=128511||r>=128640&&r<=128767||r>=9728&&r<=9983||r>=9984&&r<=10175||r>=65024&&r<=65039||r>=129280&&r<=129535||r>=127462&&r<=127487}function Hm(r,i,n,_){return i===1&&n>Math.ceil(_*1.5)&&r!==void 0&&r>255&&!Fm(r)&&!Jc(r)&&!Im(r)}function Cp(r){return Jc(r)||jm(r)}function $m(){return{css:{canvas:Vo(),cell:Vo()},device:{canvas:Vo(),cell:Vo(),char:{width:0,height:0,left:0,top:0}}}}function Vo(){return{width:0,height:0}}function zm(r,i,n=0){return(r-(Math.round(i)*2-n))%(Math.round(i)*2)}var Gt=0,Ft=0,Gr=!1,li=!1,Ko=!1,_r,dc=0,Um=class{constructor(r,i,n,_,p,L){this._terminal=r,this._optionService=i,this._selectionRenderModel=n,this._decorationService=_,this._coreBrowserService=p,this._themeService=L,this.result={fg:0,bg:0,ext:0}}resolve(r,i,n,_){if(this.result.bg=r.bg,this.result.fg=r.fg,this.result.ext=r.bg&268435456?r.extended.ext:0,Ft=0,Gt=0,li=!1,Gr=!1,Ko=!1,_r=this._themeService.colors,dc=0,r.getCode()!==0&&r.extended.underlineStyle===4){let p=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));dc=i*_%(Math.round(p)*2)}if(this._decorationService.forEachDecorationAtCell(i,n,"bottom",p=>{p.backgroundColorRGB&&(Ft=p.backgroundColorRGB.rgba>>8&16777215,li=!0),p.foregroundColorRGB&&(Gt=p.foregroundColorRGB.rgba>>8&16777215,Gr=!0)}),Ko=this._selectionRenderModel.isCellSelected(this._terminal,i,n),Ko){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:Ft=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Ft=(this.result.fg&16777215)<<8|255;break;case 0:default:Ft=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:Ft=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Ft=(this.result.bg&16777215)<<8|255;break}Ft=ts.blend(Ft,(this._coreBrowserService.isFocused?_r.selectionBackgroundOpaque:_r.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else Ft=(this._coreBrowserService.isFocused?_r.selectionBackgroundOpaque:_r.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(li=!0,_r.selectionForeground&&(Gt=_r.selectionForeground.rgba>>8&16777215,Gr=!0),Cp(r.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Gt=(this._coreBrowserService.isFocused?_r.selectionBackgroundOpaque:_r.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Gt=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Gt=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Gt=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Gt=(this.result.fg&16777215)<<8|255;break;case 0:default:Gt=this._themeService.colors.foreground.rgba}Gt=ts.blend(Gt,(this._coreBrowserService.isFocused?_r.selectionBackgroundOpaque:_r.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}Gr=!0}}this._decorationService.forEachDecorationAtCell(i,n,"top",p=>{p.backgroundColorRGB&&(Ft=p.backgroundColorRGB.rgba>>8&16777215,li=!0),p.foregroundColorRGB&&(Gt=p.foregroundColorRGB.rgba>>8&16777215,Gr=!0)}),li&&(Ko?Ft=r.bg&-16777216&-134217729|Ft|50331648:Ft=r.bg&-16777216|Ft|50331648),Gr&&(Gt=r.fg&-16777216&-67108865|Gt|50331648),this.result.fg&67108864&&(li&&!Gr&&((this.result.bg&50331648)===0?Gt=this.result.fg&-134217728|_r.background.rgba>>8&16777215&16777215|50331648:Gt=this.result.fg&-134217728|this.result.bg&67108863,Gr=!0),!li&&Gr&&((this.result.fg&50331648)===0?Ft=this.result.bg&-67108864|_r.foreground.rgba>>8&16777215&16777215|50331648:Ft=this.result.bg&-67108864|this.result.fg&67108863,li=!0)),_r=void 0,this.result.bg=li?Ft:this.result.bg,this.result.fg=Gr?Gt:this.result.fg,this.result.ext&=536870911,this.result.ext|=dc<<29&3758096384}},Wm=.5,xp=Dm||Am?"bottom":"ideographic",Vm={"▀":[{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}]},Km={"░":[[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]]},qm={"─":{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:(r,i)=>`M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i}`},"║":{1:(r,i)=>`M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╒":{1:(r,i)=>`M.5,1 L.5,${.5-i} L1,${.5-i} M.5,${.5+i} L1,${.5+i}`},"╓":{1:(r,i)=>`M${.5-r},1 L${.5-r},.5 L1,.5 M${.5+r},.5 L${.5+r},1`},"╔":{1:(r,i)=>`M1,${.5-i} L${.5-r},${.5-i} L${.5-r},1 M1,${.5+i} L${.5+r},${.5+i} L${.5+r},1`},"╕":{1:(r,i)=>`M0,${.5-i} L.5,${.5-i} L.5,1 M0,${.5+i} L.5,${.5+i}`},"╖":{1:(r,i)=>`M${.5+r},1 L${.5+r},.5 L0,.5 M${.5-r},.5 L${.5-r},1`},"╗":{1:(r,i)=>`M0,${.5+i} L${.5-r},${.5+i} L${.5-r},1 M0,${.5-i} L${.5+r},${.5-i} L${.5+r},1`},"╘":{1:(r,i)=>`M.5,0 L.5,${.5+i} L1,${.5+i} M.5,${.5-i} L1,${.5-i}`},"╙":{1:(r,i)=>`M1,.5 L${.5-r},.5 L${.5-r},0 M${.5+r},.5 L${.5+r},0`},"╚":{1:(r,i)=>`M1,${.5-i} L${.5+r},${.5-i} L${.5+r},0 M1,${.5+i} L${.5-r},${.5+i} L${.5-r},0`},"╛":{1:(r,i)=>`M0,${.5+i} L.5,${.5+i} L.5,0 M0,${.5-i} L.5,${.5-i}`},"╜":{1:(r,i)=>`M0,.5 L${.5+r},.5 L${.5+r},0 M${.5-r},.5 L${.5-r},0`},"╝":{1:(r,i)=>`M0,${.5-i} L${.5-r},${.5-i} L${.5-r},0 M0,${.5+i} L${.5+r},${.5+i} L${.5+r},0`},"╞":{1:(r,i)=>`M.5,0 L.5,1 M.5,${.5-i} L1,${.5-i} M.5,${.5+i} L1,${.5+i}`},"╟":{1:(r,i)=>`M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1 M${.5+r},.5 L1,.5`},"╠":{1:(r,i)=>`M${.5-r},0 L${.5-r},1 M1,${.5+i} L${.5+r},${.5+i} L${.5+r},1 M1,${.5-i} L${.5+r},${.5-i} L${.5+r},0`},"╡":{1:(r,i)=>`M.5,0 L.5,1 M0,${.5-i} L.5,${.5-i} M0,${.5+i} L.5,${.5+i}`},"╢":{1:(r,i)=>`M0,.5 L${.5-r},.5 M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╣":{1:(r,i)=>`M${.5+r},0 L${.5+r},1 M0,${.5+i} L${.5-r},${.5+i} L${.5-r},1 M0,${.5-i} L${.5-r},${.5-i} L${.5-r},0`},"╤":{1:(r,i)=>`M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i} M.5,${.5+i} L.5,1`},"╥":{1:(r,i)=>`M0,.5 L1,.5 M${.5-r},.5 L${.5-r},1 M${.5+r},.5 L${.5+r},1`},"╦":{1:(r,i)=>`M0,${.5-i} L1,${.5-i} M0,${.5+i} L${.5-r},${.5+i} L${.5-r},1 M1,${.5+i} L${.5+r},${.5+i} L${.5+r},1`},"╧":{1:(r,i)=>`M.5,0 L.5,${.5-i} M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i}`},"╨":{1:(r,i)=>`M0,.5 L1,.5 M${.5-r},.5 L${.5-r},0 M${.5+r},.5 L${.5+r},0`},"╩":{1:(r,i)=>`M0,${.5+i} L1,${.5+i} M0,${.5-i} L${.5-r},${.5-i} L${.5-r},0 M1,${.5-i} L${.5+r},${.5-i} L${.5+r},0`},"╪":{1:(r,i)=>`M.5,0 L.5,1 M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i}`},"╫":{1:(r,i)=>`M0,.5 L1,.5 M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╬":{1:(r,i)=>`M0,${.5+i} L${.5-r},${.5+i} L${.5-r},1 M1,${.5+i} L${.5+r},${.5+i} L${.5+r},1 M0,${.5-i} L${.5-r},${.5-i} L${.5-r},0 M1,${.5-i} L${.5+r},${.5-i} L${.5+r},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:(r,i)=>`M.5,1 L.5,${.5+i/.15*.5} C.5,${.5+i/.15*.5},.5,.5,1,.5`},"╮":{1:(r,i)=>`M.5,1 L.5,${.5+i/.15*.5} C.5,${.5+i/.15*.5},.5,.5,0,.5`},"╯":{1:(r,i)=>`M.5,0 L.5,${.5-i/.15*.5} C.5,${.5-i/.15*.5},.5,.5,0,.5`},"╰":{1:(r,i)=>`M.5,0 L.5,${.5-i/.15*.5} C.5,${.5-i/.15*.5},.5,.5,1,.5`}},Dn={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{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}};Dn[""]=Dn[""];Dn[""]=Dn[""];function Gm(r,i,n,_,p,L,R,o){let d=Vm[i];if(d)return Ym(r,d,n,_,p,L),!0;let v=Km[i];if(v)return Xm(r,v,n,_,p,L),!0;let y=qm[i];if(y)return Jm(r,y,n,_,p,L,o),!0;let f=Dn[i];return f?(Qm(r,f,n,_,p,L,R,o),!0):!1}function Ym(r,i,n,_,p,L){for(let R=0;R<i.length;R++){let o=i[R],d=p/8,v=L/8;r.fillRect(n+o.x*d,_+o.y*v,o.w*d,o.h*v)}}var Hd=new Map;function Xm(r,i,n,_,p,L){let R=Hd.get(i);R||(R=new Map,Hd.set(i,R));let o=r.fillStyle;if(typeof o!="string")throw new Error(`Unexpected fillStyle type "${o}"`);let d=R.get(o);if(!d){let v=i[0].length,y=i.length,f=r.canvas.ownerDocument.createElement("canvas");f.width=v,f.height=y;let C=Rt(f.getContext("2d")),b=new ImageData(v,y),M,w,c,h;if(o.startsWith("#"))M=parseInt(o.slice(1,3),16),w=parseInt(o.slice(3,5),16),c=parseInt(o.slice(5,7),16),h=o.length>7&&parseInt(o.slice(7,9),16)||1;else if(o.startsWith("rgba"))[M,w,c,h]=o.substring(5,o.length-1).split(",").map(l=>parseFloat(l));else throw new Error(`Unexpected fillStyle color format "${o}" when drawing pattern glyph`);for(let l=0;l<y;l++)for(let u=0;u<v;u++)b.data[(l*v+u)*4]=M,b.data[(l*v+u)*4+1]=w,b.data[(l*v+u)*4+2]=c,b.data[(l*v+u)*4+3]=i[l][u]*(h*255);C.putImageData(b,0,0),d=Rt(r.createPattern(f,null)),R.set(o,d)}r.fillStyle=d,r.fillRect(n,_,p,L)}function Jm(r,i,n,_,p,L,R){r.strokeStyle=r.fillStyle;for(let[o,d]of Object.entries(i)){r.beginPath(),r.lineWidth=R*Number.parseInt(o);let v;if(typeof d=="function"){let y=.15/L*p;v=d(.15,y)}else v=d;for(let y of v.split(" ")){let f=y[0],C=bp[f];if(!C){console.error(`Could not find drawing instructions for "${f}"`);continue}let b=y.substring(1).split(",");!b[0]||!b[1]||C(r,Ep(b,p,L,n,_,!0,R))}r.stroke(),r.closePath()}}function Qm(r,i,n,_,p,L,R,o){let d=new Path2D;d.rect(n,_,p,L),r.clip(d),r.beginPath();let v=R/12;r.lineWidth=o*v;for(let y of i.d.split(" ")){let f=y[0],C=bp[f];if(!C){console.error(`Could not find drawing instructions for "${f}"`);continue}let b=y.substring(1).split(",");!b[0]||!b[1]||C(r,Ep(b,p,L,n,_,!1,o,(i.leftPadding??0)*(v/2),(i.rightPadding??0)*(v/2)))}i.type===1?(r.strokeStyle=r.fillStyle,r.stroke()):r.fill(),r.closePath()}function $d(r,i,n=0){return Math.max(Math.min(r,i),n)}var bp={C:(r,i)=>r.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]),L:(r,i)=>r.lineTo(i[0],i[1]),M:(r,i)=>r.moveTo(i[0],i[1])};function Ep(r,i,n,_,p,L,R,o=0,d=0){let v=r.map(y=>parseFloat(y)||parseInt(y));if(v.length<2)throw new Error("Too few arguments for instruction");for(let y=0;y<v.length;y+=2)v[y]*=i-o*R-d*R,L&&v[y]!==0&&(v[y]=$d(Math.round(v[y]+.5)-.5,i,0)),v[y]+=_+o*R;for(let y=1;y<v.length;y+=2)v[y]*=n,L&&v[y]!==0&&(v[y]=$d(Math.round(v[y]+.5)-.5,n,0)),v[y]+=p;return v}var zd=class{constructor(){this._data={}}set(r,i,n){this._data[r]||(this._data[r]={}),this._data[r][i]=n}get(r,i){return this._data[r]?this._data[r][i]:void 0}clear(){this._data={}}},Ud=class{constructor(){this._data=new zd}set(r,i,n,_,p){this._data.get(r,i)||this._data.set(r,i,new zd),this._data.get(r,i).set(n,_,p)}get(r,i,n,_){var p;return(p=this._data.get(r,i))==null?void 0:p.get(n,_)}clear(){this._data.clear()}},kp=class{constructor(){this._tasks=[],this._i=0}enqueue(i){this._tasks.push(i),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(i){this._idleCallback=void 0;let n=0,_=0,p=i.timeRemaining(),L=0;for(;this._i<this._tasks.length;){if(n=performance.now(),this._tasks[this._i]()||this._i++,n=Math.max(1,performance.now()-n),_=Math.max(n,_),L=i.timeRemaining(),_*1.5>L){p-n<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(p-n))}ms`),this._start();return}p=L}this.clear()}},Zm=class extends kp{_requestCallback(r){return setTimeout(()=>r(this._createDeadline(16)))}_cancelCallback(r){clearTimeout(r)}_createDeadline(r){let i=performance.now()+r;return{timeRemaining:()=>Math.max(0,i-performance.now())}}},e0=class extends kp{_requestCallback(r){return requestIdleCallback(r)}_cancelCallback(r){cancelIdleCallback(r)}},t0=!Xc&&"requestIdleCallback"in window?e0:Zm,Ps=class Lp{constructor(){this.fg=0,this.bg=0,this.extended=new Rp}static toColorRGB(i){return[i>>>16&255,i>>>8&255,i&255]}static fromColorRGB(i){return(i[0]&255)<<16|(i[1]&255)<<8|i[2]&255}clone(){let i=new Lp;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Rp=class Tp{constructor(i=0,n=0){this._ext=0,this._urlId=0,this._ext=i,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(i){this._ext=i}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(i){this._ext&=-469762049,this._ext|=i<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(i){this._ext&=-67108864,this._ext|=i&67108863}get urlId(){return this._urlId}set urlId(i){this._urlId=i}get underlineVariantOffset(){let i=(this._ext&3758096384)>>29;return i<0?i^4294967288:i}set underlineVariantOffset(i){this._ext&=536870911,this._ext|=i<<29&3758096384}clone(){return new Tp(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},r0=globalThis.performance&&typeof globalThis.performance.now=="function",i0=class Mp{static create(i){return new Mp(i)}constructor(i){this._now=r0&&i===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},ui;(r=>{r.None=()=>$r.None;function i(O,B){return f(O,()=>{},0,void 0,!0,void 0,B)}r.defer=i;function n(O){return(B,U=null,z)=>{let q=!1,Y;return Y=O(W=>{if(!q)return Y?Y.dispose():q=!0,B.call(U,W)},null,z),q&&Y.dispose(),Y}}r.once=n;function _(O,B,U){return v((z,q=null,Y)=>O(W=>z.call(q,B(W)),null,Y),U)}r.map=_;function p(O,B,U){return v((z,q=null,Y)=>O(W=>{B(W),z.call(q,W)},null,Y),U)}r.forEach=p;function L(O,B,U){return v((z,q=null,Y)=>O(W=>B(W)&&z.call(q,W),null,Y),U)}r.filter=L;function R(O){return O}r.signal=R;function o(...O){return(B,U=null,z)=>{let q=mp(...O.map(Y=>Y(W=>B.call(U,W))));return y(q,z)}}r.any=o;function d(O,B,U,z){let q=U;return _(O,Y=>(q=B(q,Y),q),z)}r.reduce=d;function v(O,B){let U,z={onWillAddFirstListener(){U=O(q.fire,q)},onDidRemoveLastListener(){U==null||U.dispose()}},q=new ot(z);return B==null||B.add(q),q.event}function y(O,B){return B instanceof Array?B.push(O):B&&B.add(O),O}function f(O,B,U=100,z=!1,q=!1,Y,W){let A,I,P,H=0,J,ie={leakWarningThreshold:Y,onWillAddFirstListener(){A=O(ue=>{H++,I=B(I,ue),z&&!P&&(ae.fire(I),I=void 0),J=()=>{let X=I;I=void 0,P=void 0,(!z||H>1)&&ae.fire(X),H=0},typeof U=="number"?(clearTimeout(P),P=setTimeout(J,U)):P===void 0&&(P=0,queueMicrotask(J))})},onWillRemoveListener(){q&&H>0&&(J==null||J())},onDidRemoveLastListener(){J=void 0,A.dispose()}},ae=new ot(ie);return W==null||W.add(ae),ae.event}r.debounce=f;function C(O,B=0,U){return r.debounce(O,(z,q)=>z?(z.push(q),z):[q],B,void 0,!0,void 0,U)}r.accumulate=C;function b(O,B=(z,q)=>z===q,U){let z=!0,q;return L(O,Y=>{let W=z||!B(Y,q);return z=!1,q=Y,W},U)}r.latch=b;function M(O,B,U){return[r.filter(O,B,U),r.filter(O,z=>!B(z),U)]}r.split=M;function w(O,B=!1,U=[],z){let q=U.slice(),Y=O(I=>{q?q.push(I):A.fire(I)});z&&z.add(Y);let W=()=>{q==null||q.forEach(I=>A.fire(I)),q=null},A=new ot({onWillAddFirstListener(){Y||(Y=O(I=>A.fire(I)),z&&z.add(Y))},onDidAddFirstListener(){q&&(B?setTimeout(W):W())},onDidRemoveLastListener(){Y&&Y.dispose(),Y=null}});return z&&z.add(A),A.event}r.buffer=w;function c(O,B){return(U,z,q)=>{let Y=B(new l);return O(function(W){let A=Y.evaluate(W);A!==h&&U.call(z,A)},void 0,q)}}r.chain=c;let h=Symbol("HaltChainable");class l{constructor(){this.steps=[]}map(B){return this.steps.push(B),this}forEach(B){return this.steps.push(U=>(B(U),U)),this}filter(B){return this.steps.push(U=>B(U)?U:h),this}reduce(B,U){let z=U;return this.steps.push(q=>(z=B(z,q),z)),this}latch(B=(U,z)=>U===z){let U=!0,z;return this.steps.push(q=>{let Y=U||!B(q,z);return U=!1,z=q,Y?q:h}),this}evaluate(B){for(let U of this.steps)if(B=U(B),B===h)break;return B}}function u(O,B,U=z=>z){let z=(...A)=>W.fire(U(...A)),q=()=>O.on(B,z),Y=()=>O.removeListener(B,z),W=new ot({onWillAddFirstListener:q,onDidRemoveLastListener:Y});return W.event}r.fromNodeEventEmitter=u;function g(O,B,U=z=>z){let z=(...A)=>W.fire(U(...A)),q=()=>O.addEventListener(B,z),Y=()=>O.removeEventListener(B,z),W=new ot({onWillAddFirstListener:q,onDidRemoveLastListener:Y});return W.event}r.fromDOMEventEmitter=g;function S(O){return new Promise(B=>n(O)(B))}r.toPromise=S;function E(O){let B=new ot;return O.then(U=>{B.fire(U)},()=>{B.fire(void 0)}).finally(()=>{B.dispose()}),B.event}r.fromPromise=E;function T(O,B){return O(U=>B.fire(U))}r.forward=T;function k(O,B,U){return B(U),O(z=>B(z))}r.runAndSubscribe=k;class N{constructor(B,U){this._observable=B,this._counter=0,this._hasChanged=!1;let z={onWillAddFirstListener:()=>{B.addObserver(this)},onDidRemoveLastListener:()=>{B.removeObserver(this)}};this.emitter=new ot(z),U&&U.add(this.emitter)}beginUpdate(B){this._counter++}handlePossibleChange(B){}handleChange(B,U){this._hasChanged=!0}endUpdate(B){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function V(O,B){return new N(O,B).emitter.event}r.fromObservable=V;function K(O){return(B,U,z)=>{let q=0,Y=!1,W={beginUpdate(){q++},endUpdate(){q--,q===0&&(O.reportChanges(),Y&&(Y=!1,B.call(U)))},handlePossibleChange(){},handleChange(){Y=!0}};O.addObserver(W),O.reportChanges();let A={dispose(){O.removeObserver(W)}};return z instanceof Is?z.add(A):Array.isArray(z)&&z.push(A),A}}r.fromObservableLight=K})(ui||(ui={}));var Uc=class Wc{constructor(i){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${i}_${Wc._idPool++}`,Wc.all.add(this)}start(i){this._stopWatch=new i0,this.listenerCount=i}stop(){if(this._stopWatch){let i=this._stopWatch.elapsed();this.durations.push(i),this.elapsedOverall+=i,this.invocationCount+=1,this._stopWatch=void 0}}};Uc.all=new Set,Uc._idPool=0;var s0=Uc,n0=-1,Dp=class Ap{constructor(i,n,_=(Ap._idPool++).toString(16).padStart(3,"0")){this._errorHandler=i,this.threshold=n,this.name=_,this._warnCountdown=0}dispose(){var i;(i=this._stacks)==null||i.clear()}check(i,n){let _=this.threshold;if(_<=0||n<_)return;this._stacks||(this._stacks=new Map);let p=this._stacks.get(i.value)||0;if(this._stacks.set(i.value,p+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=_*.5;let[L,R]=this.getMostFrequentStack(),o=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${R}):`;console.warn(o),console.warn(L);let d=new l0(o,L);this._errorHandler(d)}return()=>{let L=this._stacks.get(i.value)||0;this._stacks.set(i.value,L-1)}}getMostFrequentStack(){if(!this._stacks)return;let i,n=0;for(let[_,p]of this._stacks)(!i||n<p)&&(i=[_,p],n=p);return i}};Dp._idPool=1;var o0=Dp,a0=class Bp{constructor(i){this.value=i}static create(){let i=new Error;return new Bp(i.stack??"")}print(){console.warn(this.value.split(`
103
+ `).slice(2).join(`
104
+ `))}},l0=class extends Error{constructor(r,i){super(r),this.name="ListenerLeakError",this.stack=i}},c0=class extends Error{constructor(r,i){super(r),this.name="ListenerRefusalError",this.stack=i}},h0=0,fc=class{constructor(r){this.value=r,this.id=h0++}},u0=2,d0,ot=class{constructor(i){var n,_,p,L;this._size=0,this._options=i,this._leakageMon=(n=this._options)!=null&&n.leakWarningThreshold?new o0((i==null?void 0:i.onListenerError)??uc,((_=this._options)==null?void 0:_.leakWarningThreshold)??n0):void 0,this._perfMon=(p=this._options)!=null&&p._profName?new s0(this._options._profName):void 0,this._deliveryQueue=(L=this._options)==null?void 0:L.deliveryQueue}dispose(){var i,n,_,p;this._disposed||(this._disposed=!0,((i=this._deliveryQueue)==null?void 0:i.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(_=(n=this._options)==null?void 0:n.onDidRemoveLastListener)==null||_.call(n),(p=this._leakageMon)==null||p.dispose())}get event(){return this._event??(this._event=(i,n,_)=>{var o,d,v,y,f;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let C=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(C);let b=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],M=new c0(`${C}. HINT: Stack shows most frequent listener (${b[1]}-times)`,b[0]);return(((o=this._options)==null?void 0:o.onListenerError)||uc)(M),$r.None}if(this._disposed)return $r.None;n&&(i=i.bind(n));let p=new fc(i),L;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(p.stack=a0.create(),L=this._leakageMon.check(p.stack,this._size+1)),this._listeners?this._listeners instanceof fc?(this._deliveryQueue??(this._deliveryQueue=new f0),this._listeners=[this._listeners,p]):this._listeners.push(p):((v=(d=this._options)==null?void 0:d.onWillAddFirstListener)==null||v.call(d,this),this._listeners=p,(f=(y=this._options)==null?void 0:y.onDidAddFirstListener)==null||f.call(y,this)),this._size++;let R=tr(()=>{L==null||L(),this._removeListener(p)});return _ instanceof Is?_.add(R):Array.isArray(_)&&_.push(R),R}),this._event}_removeListener(i){var L,R,o,d;if((R=(L=this._options)==null?void 0:L.onWillRemoveListener)==null||R.call(L,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(d=(o=this._options)==null?void 0:o.onDidRemoveLastListener)==null||d.call(o,this),this._size=0;return}let n=this._listeners,_=n.indexOf(i);if(_===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[_]=void 0;let p=this._deliveryQueue.current===this;if(this._size*u0<=n.length){let v=0;for(let y=0;y<n.length;y++)n[y]?n[v++]=n[y]:p&&(this._deliveryQueue.end--,v<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=v}}_deliver(i,n){var p;if(!i)return;let _=((p=this._options)==null?void 0:p.onListenerError)||uc;if(!_){i.value(n);return}try{i.value(n)}catch(L){_(L)}}_deliverQueue(i){let n=i.current._listeners;for(;i.i<i.end;)this._deliver(n[i.i++],i.value);i.reset()}fire(i){var n,_,p,L;if((n=this._deliveryQueue)!=null&&n.current&&(this._deliverQueue(this._deliveryQueue),(_=this._perfMon)==null||_.stop()),(p=this._perfMon)==null||p.start(this._size),this._listeners)if(this._listeners instanceof fc)this._deliver(this._listeners,i);else{let R=this._deliveryQueue;R.enqueue(this,i,this._listeners.length),this._deliverQueue(R)}(L=this._perfMon)==null||L.stop()}hasListeners(){return this._size>0}},f0=class{constructor(){this.i=-1,this.end=0}enqueue(r,i,n){this.i=0,this.end=n,this.current=r,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Wd={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}},xn=2,bn,Oi=class Bs{constructor(i,n,_){this._document=i,this._config=n,this._unicodeService=_,this._didWarmUp=!1,this._cacheMap=new Ud,this._cacheMapCombined=new Ud,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new Ps,this._textureSize=512,this._onAddTextureAtlasCanvas=new ot,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new ot,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=Pp(i,this._config.deviceCellWidth*4+xn*2,this._config.deviceCellHeight+xn*2),this._tmpCtx=Rt(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let i of this.pages)i.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let i=new t0;for(let n=33;n<126;n++)i.enqueue(()=>{if(!this._cacheMap.get(n,0,0,0)){let _=this._drawToCache(n,0,0,0,!1,void 0);this._cacheMap.set(n,0,0,0,_)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let i of this._pages)i.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(Bs.maxAtlasPages&&this._pages.length>=Math.max(4,Bs.maxAtlasPages)){let n=this._pages.filter(v=>v.canvas.width*2<=(Bs.maxTextureSize||4096)).sort((v,y)=>y.canvas.width!==v.canvas.width?y.canvas.width-v.canvas.width:y.percentageUsed-v.percentageUsed),_=-1,p=0;for(let v=0;v<n.length;v++)if(n[v].canvas.width!==p)_=v,p=n[v].canvas.width;else if(v-_===3)break;let L=n.slice(_,_+4),R=L.map(v=>v.glyphs[0].texturePage).sort((v,y)=>v>y?1:-1),o=this.pages.length-L.length,d=this._mergePages(L,o);d.version++;for(let v=R.length-1;v>=0;v--)this._deletePage(R[v]);this.pages.push(d),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(d.canvas)}let i=new pc(this._document,this._textureSize);return this._pages.push(i),this._activePages.push(i),this._onAddTextureAtlasCanvas.fire(i.canvas),i}_mergePages(i,n){let _=i[0].canvas.width*2,p=new pc(this._document,_,i);for(let[L,R]of i.entries()){let o=L*R.canvas.width%_,d=Math.floor(L/2)*R.canvas.height;p.ctx.drawImage(R.canvas,o,d);for(let y of R.glyphs)y.texturePage=n,y.sizeClipSpace.x=y.size.x/_,y.sizeClipSpace.y=y.size.y/_,y.texturePosition.x+=o,y.texturePosition.y+=d,y.texturePositionClipSpace.x=y.texturePosition.x/_,y.texturePositionClipSpace.y=y.texturePosition.y/_;this._onRemoveTextureAtlasCanvas.fire(R.canvas);let v=this._activePages.indexOf(R);v!==-1&&this._activePages.splice(v,1)}return p}_deletePage(i){this._pages.splice(i,1);for(let n=i;n<this._pages.length;n++){let _=this._pages[n];for(let p of _.glyphs)p.texturePage--;_.version++}}getRasterizedGlyphCombinedChar(i,n,_,p,L,R){return this._getFromCacheMap(this._cacheMapCombined,i,n,_,p,L,R)}getRasterizedGlyph(i,n,_,p,L,R){return this._getFromCacheMap(this._cacheMap,i,n,_,p,L,R)}_getFromCacheMap(i,n,_,p,L,R,o){return bn=i.get(n,_,p,L),bn||(bn=this._drawToCache(n,_,p,L,R,o),i.set(n,_,p,L,bn)),bn}_getColorFromAnsiIndex(i){if(i>=this._config.colors.ansi.length)throw new Error("No color found for idx "+i);return this._config.colors.ansi[i]}_getBackgroundColor(i,n,_,p){if(this._config.allowTransparency)return Mr;let L;switch(i){case 16777216:case 33554432:L=this._getColorFromAnsiIndex(n);break;case 50331648:let R=Ps.toColorRGB(n);L=nr.toColor(R[0],R[1],R[2]);break;case 0:default:_?L=Ln.opaque(this._config.colors.foreground):L=this._config.colors.background;break}return this._config.allowTransparency||(L=Ln.opaque(L)),L}_getForegroundColor(i,n,_,p,L,R,o,d,v,y){let f=this._getMinimumContrastColor(i,n,_,p,L,R,o,v,d,y);if(f)return f;let C;switch(L){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&v&&R<8&&(R+=8),C=this._getColorFromAnsiIndex(R);break;case 50331648:let b=Ps.toColorRGB(R);C=nr.toColor(b[0],b[1],b[2]);break;case 0:default:o?C=this._config.colors.background:C=this._config.colors.foreground}return this._config.allowTransparency&&(C=Ln.opaque(C)),d&&(C=Ln.multiplyOpacity(C,Wm)),C}_resolveBackgroundRgba(i,n,_){switch(i){case 16777216:case 33554432:return this._getColorFromAnsiIndex(n).rgba;case 50331648:return n<<8;case 0:default:return _?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(i,n,_,p){switch(i){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&p&&n<8&&(n+=8),this._getColorFromAnsiIndex(n).rgba;case 50331648:return n<<8;case 0:default:return _?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(i,n,_,p,L,R,o,d,v,y){if(this._config.minimumContrastRatio===1||y)return;let f=this._getContrastCache(v),C=f.getColor(i,p);if(C!==void 0)return C||void 0;let b=this._resolveBackgroundRgba(n,_,o),M=this._resolveForegroundRgba(L,R,o,d),w=ts.ensureContrastRatio(b,M,this._config.minimumContrastRatio/(v?2:1));if(!w){f.setColor(i,p,null);return}let c=nr.toColor(w>>24&255,w>>16&255,w>>8&255);return f.setColor(i,p,c),c}_getContrastCache(i){return i?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(i,n,_,p,L,R){let o=typeof i=="number"?String.fromCharCode(i):i;R&&this._tmpCanvas.parentElement!==R&&(this._tmpCanvas.style.display="none",R.append(this._tmpCanvas));let d=Math.min(this._config.deviceCellWidth*Math.max(o.length,2)+xn*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<d&&(this._tmpCanvas.width=d);let v=Math.min(this._config.deviceCellHeight+xn*4,this._textureSize);if(this._tmpCanvas.height<v&&(this._tmpCanvas.height=v),this._tmpCtx.save(),this._workAttributeData.fg=_,this._workAttributeData.bg=n,this._workAttributeData.extended.ext=p,!!this._workAttributeData.isInvisible())return Wd;let y=!!this._workAttributeData.isBold(),f=!!this._workAttributeData.isInverse(),C=!!this._workAttributeData.isDim(),b=!!this._workAttributeData.isItalic(),M=!!this._workAttributeData.isUnderline(),w=!!this._workAttributeData.isStrikethrough(),c=!!this._workAttributeData.isOverline(),h=this._workAttributeData.getFgColor(),l=this._workAttributeData.getFgColorMode(),u=this._workAttributeData.getBgColor(),g=this._workAttributeData.getBgColorMode();if(f){let I=h;h=u,u=I;let P=l;l=g,g=P}let S=this._getBackgroundColor(g,u,f,C);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=S.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let E=y?this._config.fontWeightBold:this._config.fontWeight,T=b?"italic":"";this._tmpCtx.font=`${T} ${E} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=xp;let k=o.length===1&&Jc(o.charCodeAt(0)),N=o.length===1&&Nm(o.charCodeAt(0)),V=this._getForegroundColor(n,g,u,_,l,h,f,C,y,Cp(o.charCodeAt(0)));this._tmpCtx.fillStyle=V.css;let K=N?0:xn*2,O=!1;this._config.customGlyphs!==!1&&(O=Gm(this._tmpCtx,o,K,K,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let B=!k,U;if(typeof i=="number"?U=this._unicodeService.wcwidth(i):U=this._unicodeService.getStringCellWidth(i),M){this._tmpCtx.save();let I=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),P=I%2===1?.5:0;if(this._tmpCtx.lineWidth=I,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())B=!1,this._tmpCtx.strokeStyle=`rgb(${Ps.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{B=!1;let X=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&X<8&&(X+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(X).css}this._tmpCtx.beginPath();let H=K,J=Math.ceil(K+this._config.deviceCharHeight)-P-(L?I*2:0),ie=J+I,ae=J+I*2,ue=this._workAttributeData.getUnderlineVariantOffset();for(let X=0;X<U;X++){this._tmpCtx.save();let j=H+X*this._config.deviceCellWidth,se=H+(X+1)*this._config.deviceCellWidth,te=j+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(j,J),this._tmpCtx.lineTo(se,J),this._tmpCtx.moveTo(j,ae),this._tmpCtx.lineTo(se,ae);break;case 3:let ce=I<=1?ae:Math.ceil(K+this._config.deviceCharHeight-I/2)-P,_e=I<=1?J:Math.ceil(K+this._config.deviceCharHeight+I/2)-P,Le=new Path2D;Le.rect(j,J,this._config.deviceCellWidth,ae-J),this._tmpCtx.clip(Le),this._tmpCtx.moveTo(j-this._config.deviceCellWidth/2,ie),this._tmpCtx.bezierCurveTo(j-this._config.deviceCellWidth/2,_e,j,_e,j,ie),this._tmpCtx.bezierCurveTo(j,ce,te,ce,te,ie),this._tmpCtx.bezierCurveTo(te,_e,se,_e,se,ie),this._tmpCtx.bezierCurveTo(se,ce,se+this._config.deviceCellWidth/2,ce,se+this._config.deviceCellWidth/2,ie);break;case 4:let ke=ue===0?0:ue>=I?I*2-ue:I-ue;ue>=I||ke===0?(this._tmpCtx.setLineDash([Math.round(I),Math.round(I)]),this._tmpCtx.moveTo(j+ke,J),this._tmpCtx.lineTo(se,J)):(this._tmpCtx.setLineDash([Math.round(I),Math.round(I)]),this._tmpCtx.moveTo(j,J),this._tmpCtx.lineTo(j+ke,J),this._tmpCtx.moveTo(j+ke+I,J),this._tmpCtx.lineTo(se,J)),ue=zm(se-j,I,ue);break;case 5:let Ie=.6,Ne=.3,ge=se-j,Xe=Math.floor(Ie*ge),kt=Math.floor(Ne*ge),yt=ge-Xe-kt;this._tmpCtx.setLineDash([Xe,kt,yt]),this._tmpCtx.moveTo(j,J),this._tmpCtx.lineTo(se,J);break;case 1:default:this._tmpCtx.moveTo(j,J),this._tmpCtx.lineTo(se,J);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!O&&this._config.fontSize>=12&&!this._config.allowTransparency&&o!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let X=this._tmpCtx.measureText(o);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in X&&X.actualBoundingBoxDescent>0){this._tmpCtx.save();let j=new Path2D;j.rect(H,J-Math.ceil(I/2),this._config.deviceCellWidth*U,ae-J+Math.ceil(I/2)),this._tmpCtx.clip(j),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=S.css,this._tmpCtx.strokeText(o,K,K+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(c){let I=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),P=I%2===1?.5:0;this._tmpCtx.lineWidth=I,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(K,K+P),this._tmpCtx.lineTo(K+this._config.deviceCharWidth*U,K+P),this._tmpCtx.stroke()}if(O||this._tmpCtx.fillText(o,K,K+this._config.deviceCharHeight),o==="_"&&!this._config.allowTransparency){let I=_c(this._tmpCtx.getImageData(K,K,this._config.deviceCellWidth,this._config.deviceCellHeight),S,V,B);if(I)for(let P=1;P<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=S.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(o,K,K+this._config.deviceCharHeight-P),I=_c(this._tmpCtx.getImageData(K,K,this._config.deviceCellWidth,this._config.deviceCellHeight),S,V,B),!!I);P++);}if(w){let I=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),P=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=I,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(K,K+Math.floor(this._config.deviceCharHeight/2)-P),this._tmpCtx.lineTo(K+this._config.deviceCharWidth*U,K+Math.floor(this._config.deviceCharHeight/2)-P),this._tmpCtx.stroke()}this._tmpCtx.restore();let z=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),q;if(this._config.allowTransparency?q=p0(z):q=_c(z,S,V,B),q)return Wd;let Y=this._findGlyphBoundingBox(z,this._workBoundingBox,d,N,O,K),W,A;for(;;){if(this._activePages.length===0){let I=this._createNewPage();W=I,A=I.currentRow,A.height=Y.size.y;break}W=this._activePages[this._activePages.length-1],A=W.currentRow;for(let I of this._activePages)Y.size.y<=I.currentRow.height&&(W=I,A=I.currentRow);for(let I=this._activePages.length-1;I>=0;I--)for(let P of this._activePages[I].fixedRows)P.height<=A.height&&Y.size.y<=P.height&&(W=this._activePages[I],A=P);if(Y.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new pc(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),W=this._overflowSizePage,A=this._overflowSizePage.currentRow,A.x+Y.size.x>=W.canvas.width&&(A.x=0,A.y+=A.height,A.height=0);break}if(A.y+Y.size.y>=W.canvas.height||A.height>Y.size.y+2){let I=!1;if(W.currentRow.y+W.currentRow.height+Y.size.y>=W.canvas.height){let P;for(let H of this._activePages)if(H.currentRow.y+H.currentRow.height+Y.size.y<H.canvas.height){P=H;break}if(P)W=P;else if(Bs.maxAtlasPages&&this._pages.length>=Bs.maxAtlasPages&&A.y+Y.size.y<=W.canvas.height&&A.height>=Y.size.y&&A.x+Y.size.x<=W.canvas.width)I=!0;else{let H=this._createNewPage();W=H,A=H.currentRow,A.height=Y.size.y,I=!0}}I||(W.currentRow.height>0&&W.fixedRows.push(W.currentRow),A={x:0,y:W.currentRow.y+W.currentRow.height,height:Y.size.y},W.fixedRows.push(A),W.currentRow={x:0,y:A.y+A.height,height:0})}if(A.x+Y.size.x<=W.canvas.width)break;A===W.currentRow?(A.x=0,A.y+=A.height,A.height=0):W.fixedRows.splice(W.fixedRows.indexOf(A),1)}return Y.texturePage=this._pages.indexOf(W),Y.texturePosition.x=A.x,Y.texturePosition.y=A.y,Y.texturePositionClipSpace.x=A.x/W.canvas.width,Y.texturePositionClipSpace.y=A.y/W.canvas.height,Y.sizeClipSpace.x/=W.canvas.width,Y.sizeClipSpace.y/=W.canvas.height,A.height=Math.max(A.height,Y.size.y),A.x+=Y.size.x,W.ctx.putImageData(z,Y.texturePosition.x-this._workBoundingBox.left,Y.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Y.size.x,Y.size.y),W.addGlyph(Y),W.version++,Y}_findGlyphBoundingBox(i,n,_,p,L,R){n.top=0;let o=p?this._config.deviceCellHeight:this._tmpCanvas.height,d=p?this._config.deviceCellWidth:_,v=!1;for(let y=0;y<o;y++){for(let f=0;f<d;f++){let C=y*this._tmpCanvas.width*4+f*4+3;if(i.data[C]!==0){n.top=y,v=!0;break}}if(v)break}n.left=0,v=!1;for(let y=0;y<R+d;y++){for(let f=0;f<o;f++){let C=f*this._tmpCanvas.width*4+y*4+3;if(i.data[C]!==0){n.left=y,v=!0;break}}if(v)break}n.right=d,v=!1;for(let y=R+d-1;y>=R;y--){for(let f=0;f<o;f++){let C=f*this._tmpCanvas.width*4+y*4+3;if(i.data[C]!==0){n.right=y,v=!0;break}}if(v)break}n.bottom=o,v=!1;for(let y=o-1;y>=0;y--){for(let f=0;f<d;f++){let C=y*this._tmpCanvas.width*4+f*4+3;if(i.data[C]!==0){n.bottom=y,v=!0;break}}if(v)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:n.right-n.left+1,y:n.bottom-n.top+1},sizeClipSpace:{x:n.right-n.left+1,y:n.bottom-n.top+1},offset:{x:-n.left+R+(p||L?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-n.top+R+(p||L?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},pc=class{constructor(r,i,n){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],n)for(let _ of n)this._glyphs.push(..._.glyphs),this._usedPixels+=_._usedPixels;this.canvas=Pp(r,i,i),this.ctx=Rt(this.canvas.getContext("2d",{alpha:!0}))}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}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 _c(r,i,n,_){let p=i.rgba>>>24,L=i.rgba>>>16&255,R=i.rgba>>>8&255,o=n.rgba>>>24,d=n.rgba>>>16&255,v=n.rgba>>>8&255,y=Math.floor((Math.abs(p-o)+Math.abs(L-d)+Math.abs(R-v))/12),f=!0;for(let C=0;C<r.data.length;C+=4)r.data[C]===p&&r.data[C+1]===L&&r.data[C+2]===R||_&&Math.abs(r.data[C]-p)+Math.abs(r.data[C+1]-L)+Math.abs(r.data[C+2]-R)<y?r.data[C+3]=0:f=!1;return f}function p0(r){for(let i=0;i<r.data.length;i+=4)if(r.data[i+3]>0)return!1;return!0}function Pp(r,i,n){let _=r.createElement("canvas");return _.width=i,_.height=n,_}function _0(r,i,n,_,p,L,R,o){let d={foreground:L.foreground,background:L.background,cursor:Mr,cursorAccent:Mr,selectionForeground:Mr,selectionBackgroundTransparent:Mr,selectionBackgroundOpaque:Mr,selectionInactiveBackgroundTransparent:Mr,selectionInactiveBackgroundOpaque:Mr,overviewRulerBorder:Mr,scrollbarSliderBackground:Mr,scrollbarSliderHoverBackground:Mr,scrollbarSliderActiveBackground:Mr,ansi:L.ansi.slice(),contrastCache:L.contrastCache,halfContrastCache:L.halfContrastCache};return{customGlyphs:p.customGlyphs,devicePixelRatio:R,deviceMaxTextureSize:o,letterSpacing:p.letterSpacing,lineHeight:p.lineHeight,deviceCellWidth:r,deviceCellHeight:i,deviceCharWidth:n,deviceCharHeight:_,fontFamily:p.fontFamily,fontSize:p.fontSize,fontWeight:p.fontWeight,fontWeightBold:p.fontWeightBold,allowTransparency:p.allowTransparency,drawBoldTextInBrightColors:p.drawBoldTextInBrightColors,minimumContrastRatio:p.minimumContrastRatio,colors:d}}function Vd(r,i){for(let n=0;n<r.colors.ansi.length;n++)if(r.colors.ansi[n].rgba!==i.colors.ansi[n].rgba)return!1;return r.devicePixelRatio===i.devicePixelRatio&&r.customGlyphs===i.customGlyphs&&r.lineHeight===i.lineHeight&&r.letterSpacing===i.letterSpacing&&r.fontFamily===i.fontFamily&&r.fontSize===i.fontSize&&r.fontWeight===i.fontWeight&&r.fontWeightBold===i.fontWeightBold&&r.allowTransparency===i.allowTransparency&&r.deviceCharWidth===i.deviceCharWidth&&r.deviceCharHeight===i.deviceCharHeight&&r.drawBoldTextInBrightColors===i.drawBoldTextInBrightColors&&r.minimumContrastRatio===i.minimumContrastRatio&&r.colors.foreground.rgba===i.colors.foreground.rgba&&r.colors.background.rgba===i.colors.background.rgba}function v0(r){return(r&50331648)===16777216||(r&50331648)===33554432}var Ar=[];function Op(r,i,n,_,p,L,R,o,d){let v=_0(_,p,L,R,i,n,o,d);for(let C=0;C<Ar.length;C++){let b=Ar[C],M=b.ownedBy.indexOf(r);if(M>=0){if(Vd(b.config,v))return b.atlas;b.ownedBy.length===1?(b.atlas.dispose(),Ar.splice(C,1)):b.ownedBy.splice(M,1);break}}for(let C=0;C<Ar.length;C++){let b=Ar[C];if(Vd(b.config,v))return b.ownedBy.push(r),b.atlas}let y=r._core,f={atlas:new Oi(document,v,y.unicodeService),config:v,ownedBy:[r]};return Ar.push(f),f.atlas}function Kd(r){for(let i=0;i<Ar.length;i++){let n=Ar[i].ownedBy.indexOf(r);if(n!==-1){Ar[i].ownedBy.length===1?(Ar[i].atlas.dispose(),Ar.splice(i,1)):Ar[i].ownedBy.splice(n,1);break}}}var qo=600,g0=class{constructor(r,i){this._renderCallback=r,this._coreBrowserService=i,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(r=qo){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let i=qo-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,i>0){this._restartInterval(i);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let i=qo-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(i);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},qo)},r)}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()}};function qd(r,i,n){let _=new i.ResizeObserver(p=>{let L=p.find(d=>d.target===r);if(!L)return;if(!("devicePixelContentBoxSize"in L)){_==null||_.disconnect(),_=void 0;return}let R=L.devicePixelContentBoxSize[0].inlineSize,o=L.devicePixelContentBoxSize[0].blockSize;R>0&&o>0&&n(R,o)});try{_.observe(r,{box:["device-pixel-content-box"]})}catch{_.disconnect(),_=void 0}return tr(()=>_==null?void 0:_.disconnect())}function m0(r){return r>65535?(r-=65536,String.fromCharCode((r>>10)+55296)+String.fromCharCode(r%1024+56320)):String.fromCharCode(r)}var Gd=class Np extends Ps{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Rp,this.combinedData=""}static fromCharData(i){let n=new Np;return n.setFromCharData(i),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?m0(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(i){this.fg=i[0],this.bg=0;let n=!1;if(i[1].length>2)n=!0;else if(i[1].length===2){let _=i[1].charCodeAt(0);if(55296<=_&&_<=56319){let p=i[1].charCodeAt(1);56320<=p&&p<=57343?this.content=(_-55296)*1024+p-56320+65536|i[2]<<22:n=!0}else n=!0}else this.content=i[1].charCodeAt(0)|i[2]<<22;n&&(this.combinedData=i[1],this.content=2097152|i[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Ip=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function jp(r,i,n){let _=Rt(r.createProgram());if(r.attachShader(_,Rt(Yd(r,r.VERTEX_SHADER,i))),r.attachShader(_,Rt(Yd(r,r.FRAGMENT_SHADER,n))),r.linkProgram(_),r.getProgramParameter(_,r.LINK_STATUS))return _;console.error(r.getProgramInfoLog(_)),r.deleteProgram(_)}function Yd(r,i,n){let _=Rt(r.createShader(i));if(r.shaderSource(_,n),r.compileShader(_),r.getShaderParameter(_,r.COMPILE_STATUS))return _;console.error(r.getShaderInfoLog(_)),r.deleteShader(_)}function y0(r,i){let n=Math.min(r.length*2,i),_=new Float32Array(n);for(let p=0;p<r.length;p++)_[p]=r[p];return _}var w0=class{constructor(r){this.texture=r,this.version=-1}},S0=`#version 300 es
105
+ layout (location = 0) in vec2 a_unitquad;
106
+ layout (location = 1) in vec2 a_cellpos;
107
+ layout (location = 2) in vec2 a_offset;
108
+ layout (location = 3) in vec2 a_size;
109
+ layout (location = 4) in float a_texpage;
110
+ layout (location = 5) in vec2 a_texcoord;
111
+ layout (location = 6) in vec2 a_texsize;
112
+
113
+ uniform mat4 u_projection;
114
+ uniform vec2 u_resolution;
115
+
116
+ out vec2 v_texcoord;
117
+ flat out int v_texpage;
118
+
119
+ void main() {
120
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
121
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
122
+ v_texpage = int(a_texpage);
123
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
124
+ }`;function C0(r){let i="";for(let n=1;n<r;n++)i+=` else if (v_texpage == ${n}) { outColor = texture(u_texture[${n}], v_texcoord); }`;return`#version 300 es
125
+ precision lowp float;
126
+
127
+ in vec2 v_texcoord;
128
+ flat in int v_texpage;
129
+
130
+ uniform sampler2D u_texture[${r}];
131
+
132
+ out vec4 outColor;
133
+
134
+ void main() {
135
+ if (v_texpage == 0) {
136
+ outColor = texture(u_texture[0], v_texcoord);
137
+ } ${i}
138
+ }`}var Ni=11,Ms=Ni*Float32Array.BYTES_PER_ELEMENT,x0=2,gt=0,nt,vc=0,En=0,b0=class extends $r{constructor(r,i,n,_){super(),this._terminal=r,this._gl=i,this._dimensions=n,this._optionsService=_,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let p=this._gl;Oi.maxAtlasPages===void 0&&(Oi.maxAtlasPages=Math.min(32,Rt(p.getParameter(p.MAX_TEXTURE_IMAGE_UNITS))),Oi.maxTextureSize=Rt(p.getParameter(p.MAX_TEXTURE_SIZE))),this._program=Rt(jp(p,S0,C0(Oi.maxAtlasPages))),this._register(tr(()=>p.deleteProgram(this._program))),this._projectionLocation=Rt(p.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=Rt(p.getUniformLocation(this._program,"u_resolution")),this._textureLocation=Rt(p.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=p.createVertexArray(),p.bindVertexArray(this._vertexArrayObject);let L=new Float32Array([0,0,1,0,0,1,1,1]),R=p.createBuffer();this._register(tr(()=>p.deleteBuffer(R))),p.bindBuffer(p.ARRAY_BUFFER,R),p.bufferData(p.ARRAY_BUFFER,L,p.STATIC_DRAW),p.enableVertexAttribArray(0),p.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let o=new Uint8Array([0,1,2,3]),d=p.createBuffer();this._register(tr(()=>p.deleteBuffer(d))),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,d),p.bufferData(p.ELEMENT_ARRAY_BUFFER,o,p.STATIC_DRAW),this._attributesBuffer=Rt(p.createBuffer()),this._register(tr(()=>p.deleteBuffer(this._attributesBuffer))),p.bindBuffer(p.ARRAY_BUFFER,this._attributesBuffer),p.enableVertexAttribArray(2),p.vertexAttribPointer(2,2,p.FLOAT,!1,Ms,0),p.vertexAttribDivisor(2,1),p.enableVertexAttribArray(3),p.vertexAttribPointer(3,2,p.FLOAT,!1,Ms,2*Float32Array.BYTES_PER_ELEMENT),p.vertexAttribDivisor(3,1),p.enableVertexAttribArray(4),p.vertexAttribPointer(4,1,p.FLOAT,!1,Ms,4*Float32Array.BYTES_PER_ELEMENT),p.vertexAttribDivisor(4,1),p.enableVertexAttribArray(5),p.vertexAttribPointer(5,2,p.FLOAT,!1,Ms,5*Float32Array.BYTES_PER_ELEMENT),p.vertexAttribDivisor(5,1),p.enableVertexAttribArray(6),p.vertexAttribPointer(6,2,p.FLOAT,!1,Ms,7*Float32Array.BYTES_PER_ELEMENT),p.vertexAttribDivisor(6,1),p.enableVertexAttribArray(1),p.vertexAttribPointer(1,2,p.FLOAT,!1,Ms,9*Float32Array.BYTES_PER_ELEMENT),p.vertexAttribDivisor(1,1),p.useProgram(this._program);let v=new Int32Array(Oi.maxAtlasPages);for(let y=0;y<Oi.maxAtlasPages;y++)v[y]=y;p.uniform1iv(this._textureLocation,v),p.uniformMatrix4fv(this._projectionLocation,!1,Ip),this._atlasTextures=[];for(let y=0;y<Oi.maxAtlasPages;y++){let f=new w0(Rt(p.createTexture()));this._register(tr(()=>p.deleteTexture(f.texture))),p.activeTexture(p.TEXTURE0+y),p.bindTexture(p.TEXTURE_2D,f.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,1,1,0,p.RGBA,p.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[y]=f}p.enable(p.BLEND),p.blendFunc(p.SRC_ALPHA,p.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(r,i,n,_,p,L,R,o,d){this._updateCell(this._vertices.attributes,r,i,n,_,p,L,R,o,d)}_updateCell(r,i,n,_,p,L,R,o,d,v){if(gt=(n*this._terminal.cols+i)*Ni,_===0||_===void 0){r.fill(0,gt,gt+Ni-1-x0);return}this._atlas&&(o&&o.length>1?nt=this._atlas.getRasterizedGlyphCombinedChar(o,p,L,R,!1,this._terminal.element):nt=this._atlas.getRasterizedGlyph(_,p,L,R,!1,this._terminal.element),vc=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),p!==v&&nt.offset.x>vc?(En=nt.offset.x-vc,r[gt]=-(nt.offset.x-En)+this._dimensions.device.char.left,r[gt+1]=-nt.offset.y+this._dimensions.device.char.top,r[gt+2]=(nt.size.x-En)/this._dimensions.device.canvas.width,r[gt+3]=nt.size.y/this._dimensions.device.canvas.height,r[gt+4]=nt.texturePage,r[gt+5]=nt.texturePositionClipSpace.x+En/this._atlas.pages[nt.texturePage].canvas.width,r[gt+6]=nt.texturePositionClipSpace.y,r[gt+7]=nt.sizeClipSpace.x-En/this._atlas.pages[nt.texturePage].canvas.width,r[gt+8]=nt.sizeClipSpace.y):(r[gt]=-nt.offset.x+this._dimensions.device.char.left,r[gt+1]=-nt.offset.y+this._dimensions.device.char.top,r[gt+2]=nt.size.x/this._dimensions.device.canvas.width,r[gt+3]=nt.size.y/this._dimensions.device.canvas.height,r[gt+4]=nt.texturePage,r[gt+5]=nt.texturePositionClipSpace.x,r[gt+6]=nt.texturePositionClipSpace.y,r[gt+7]=nt.sizeClipSpace.x,r[gt+8]=nt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&Hm(_,d,nt.size.x,this._dimensions.device.cell.width)&&(r[gt+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let r=this._terminal,i=r.cols*r.rows*Ni;this._vertices.count!==i?this._vertices.attributes=new Float32Array(i):this._vertices.attributes.fill(0);let n=0;for(;n<this._vertices.attributesBuffers.length;n++)this._vertices.count!==i?this._vertices.attributesBuffers[n]=new Float32Array(i):this._vertices.attributesBuffers[n].fill(0);this._vertices.count=i,n=0;for(let _=0;_<r.rows;_++)for(let p=0;p<r.cols;p++)this._vertices.attributes[n+9]=p/r.cols,this._vertices.attributes[n+10]=_/r.rows,n+=Ni}handleResize(){let r=this._gl;r.useProgram(this._program),r.viewport(0,0,r.canvas.width,r.canvas.height),r.uniform2f(this._resolutionLocation,r.canvas.width,r.canvas.height),this.clear()}render(r){if(!this._atlas)return;let i=this._gl;i.useProgram(this._program),i.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let n=this._vertices.attributesBuffers[this._activeBuffer],_=0;for(let p=0;p<r.lineLengths.length;p++){let L=p*this._terminal.cols*Ni,R=this._vertices.attributes.subarray(L,L+r.lineLengths[p]*Ni);n.set(R,_),_+=R.length}i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.bufferData(i.ARRAY_BUFFER,n.subarray(0,_),i.STREAM_DRAW);for(let p=0;p<this._atlas.pages.length;p++)this._atlas.pages[p].version!==this._atlasTextures[p].version&&this._bindAtlasPageTexture(i,this._atlas,p);i.drawElementsInstanced(i.TRIANGLE_STRIP,4,i.UNSIGNED_BYTE,0,_/Ni)}setAtlas(r){this._atlas=r;for(let i of this._atlasTextures)i.version=-1}_bindAtlasPageTexture(r,i,n){r.activeTexture(r.TEXTURE0+n),r.bindTexture(r.TEXTURE_2D,this._atlasTextures[n].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,r.RGBA,r.UNSIGNED_BYTE,i.pages[n].canvas),r.generateMipmap(r.TEXTURE_2D),this._atlasTextures[n].version=i.pages[n].version}setDimensions(r){this._dimensions=r}},E0=class{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(r,i,n,_=!1){if(this.selectionStart=i,this.selectionEnd=n,!i||!n||i[0]===n[0]&&i[1]===n[1]){this.clear();return}let p=r.buffers.active.ydisp,L=i[1]-p,R=n[1]-p,o=Math.max(L,0),d=Math.min(R,r.rows-1);if(o>=r.rows||d<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=L,this.viewportEndRow=R,this.viewportCappedStartRow=o,this.viewportCappedEndRow=d,this.startCol=i[0],this.endCol=n[0]}isCellSelected(r,i,n){return this.hasSelection?(n-=r.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?i>=this.startCol&&n>=this.viewportCappedStartRow&&i<this.endCol&&n<=this.viewportCappedEndRow:i<this.startCol&&n>=this.viewportCappedStartRow&&i>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol):!1}};function k0(){return new E0}var ca=4,ta=1,ra=2,gc=3,L0=2147483648,R0=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=k0()}resize(r,i){let n=r*i*ca;n!==this.cells.length&&(this.cells=new Uint32Array(n),this.lineLengths=new Uint32Array(i))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},T0=`#version 300 es
139
+ layout (location = 0) in vec2 a_position;
140
+ layout (location = 1) in vec2 a_size;
141
+ layout (location = 2) in vec4 a_color;
142
+ layout (location = 3) in vec2 a_unitquad;
143
+
144
+ uniform mat4 u_projection;
145
+
146
+ out vec4 v_color;
147
+
148
+ void main() {
149
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
150
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
151
+ v_color = a_color;
152
+ }`,M0=`#version 300 es
153
+ precision lowp float;
154
+
155
+ in vec4 v_color;
156
+
157
+ out vec4 outColor;
158
+
159
+ void main() {
160
+ outColor = v_color;
161
+ }`,hi=8,mc=hi*Float32Array.BYTES_PER_ELEMENT,D0=20*hi,Xd=class{constructor(){this.attributes=new Float32Array(D0),this.count=0}},ci=0,Jd=0,Qd=0,Zd=0,ef=0,tf=0,rf=0,A0=class extends $r{constructor(r,i,n,_){super(),this._terminal=r,this._gl=i,this._dimensions=n,this._themeService=_,this._vertices=new Xd,this._verticesCursor=new Xd;let p=this._gl;this._program=Rt(jp(p,T0,M0)),this._register(tr(()=>p.deleteProgram(this._program))),this._projectionLocation=Rt(p.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=p.createVertexArray(),p.bindVertexArray(this._vertexArrayObject);let L=new Float32Array([0,0,1,0,0,1,1,1]),R=p.createBuffer();this._register(tr(()=>p.deleteBuffer(R))),p.bindBuffer(p.ARRAY_BUFFER,R),p.bufferData(p.ARRAY_BUFFER,L,p.STATIC_DRAW),p.enableVertexAttribArray(3),p.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let o=new Uint8Array([0,1,2,3]),d=p.createBuffer();this._register(tr(()=>p.deleteBuffer(d))),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,d),p.bufferData(p.ELEMENT_ARRAY_BUFFER,o,p.STATIC_DRAW),this._attributesBuffer=Rt(p.createBuffer()),this._register(tr(()=>p.deleteBuffer(this._attributesBuffer))),p.bindBuffer(p.ARRAY_BUFFER,this._attributesBuffer),p.enableVertexAttribArray(0),p.vertexAttribPointer(0,2,p.FLOAT,!1,mc,0),p.vertexAttribDivisor(0,1),p.enableVertexAttribArray(1),p.vertexAttribPointer(1,2,p.FLOAT,!1,mc,2*Float32Array.BYTES_PER_ELEMENT),p.vertexAttribDivisor(1,1),p.enableVertexAttribArray(2),p.vertexAttribPointer(2,4,p.FLOAT,!1,mc,4*Float32Array.BYTES_PER_ELEMENT),p.vertexAttribDivisor(2,1),this._updateCachedColors(_.colors),this._register(this._themeService.onChangeColors(v=>{this._updateCachedColors(v),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(r){let i=this._gl;i.useProgram(this._program),i.bindVertexArray(this._vertexArrayObject),i.uniformMatrix4fv(this._projectionLocation,!1,Ip),i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.bufferData(i.ARRAY_BUFFER,r.attributes,i.DYNAMIC_DRAW),i.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,i.UNSIGNED_BYTE,0,r.count)}handleResize(){this._updateViewportRectangle()}setDimensions(r){this._dimensions=r}_updateCachedColors(r){this._bgFloat=this._colorToFloat32Array(r.background),this._cursorFloat=this._colorToFloat32Array(r.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(r){let i=this._terminal,n=this._vertices,_=1,p,L,R,o,d,v,y,f,C,b,M;for(p=0;p<i.rows;p++){for(R=-1,o=0,d=0,v=!1,L=0;L<i.cols;L++)y=(p*i.cols+L)*ca,f=r.cells[y+ta],C=r.cells[y+ra],b=!!(C&67108864),(f!==o||C!==d&&(v||b))&&((o!==0||v&&d!==0)&&(M=_++*hi,this._updateRectangle(n,M,d,o,R,L,p)),R=L,o=f,d=C,v=b);(o!==0||v&&d!==0)&&(M=_++*hi,this._updateRectangle(n,M,d,o,R,i.cols,p))}n.count=_}updateCursor(r){let i=this._verticesCursor,n=r.cursor;if(!n||n.style==="block"){i.count=0;return}let _,p=0;(n.style==="bar"||n.style==="outline")&&(_=p++*hi,this._addRectangleFloat(i.attributes,_,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.style==="bar"?n.dpr*n.cursorWidth:n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(n.style==="underline"||n.style==="outline")&&(_=p++*hi,this._addRectangleFloat(i.attributes,_,n.x*this._dimensions.device.cell.width,(n.y+1)*this._dimensions.device.cell.height-n.dpr,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat)),n.style==="outline"&&(_=p++*hi,this._addRectangleFloat(i.attributes,_,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat),_=p++*hi,this._addRectangleFloat(i.attributes,_,(n.x+n.width)*this._dimensions.device.cell.width-n.dpr,n.y*this._dimensions.device.cell.height,n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),i.count=p}_updateRectangle(r,i,n,_,p,L,R){if(n&67108864)switch(n&50331648){case 16777216:case 33554432:ci=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:ci=(n&16777215)<<8;break;case 0:default:ci=this._themeService.colors.foreground.rgba}else switch(_&50331648){case 16777216:case 33554432:ci=this._themeService.colors.ansi[_&255].rgba;break;case 50331648:ci=(_&16777215)<<8;break;case 0:default:ci=this._themeService.colors.background.rgba}r.attributes.length<i+4&&(r.attributes=y0(r.attributes,this._terminal.rows*this._terminal.cols*hi)),Jd=p*this._dimensions.device.cell.width,Qd=R*this._dimensions.device.cell.height,Zd=(ci>>24&255)/255,ef=(ci>>16&255)/255,tf=(ci>>8&255)/255,rf=1,this._addRectangle(r.attributes,i,Jd,Qd,(L-p)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,Zd,ef,tf,rf)}_addRectangle(r,i,n,_,p,L,R,o,d,v){r[i]=n/this._dimensions.device.canvas.width,r[i+1]=_/this._dimensions.device.canvas.height,r[i+2]=p/this._dimensions.device.canvas.width,r[i+3]=L/this._dimensions.device.canvas.height,r[i+4]=R,r[i+5]=o,r[i+6]=d,r[i+7]=v}_addRectangleFloat(r,i,n,_,p,L,R){r[i]=n/this._dimensions.device.canvas.width,r[i+1]=_/this._dimensions.device.canvas.height,r[i+2]=p/this._dimensions.device.canvas.width,r[i+3]=L/this._dimensions.device.canvas.height,r[i+4]=R[0],r[i+5]=R[1],r[i+6]=R[2],r[i+7]=R[3]}_colorToFloat32Array(r){return new Float32Array([(r.rgba>>24&255)/255,(r.rgba>>16&255)/255,(r.rgba>>8&255)/255,(r.rgba&255)/255])}},B0=class extends $r{constructor(r,i,n,_,p,L,R,o){super(),this._container=i,this._alpha=p,this._coreBrowserService=L,this._optionsService=R,this._themeService=o,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${n}-layer`),this._canvas.style.zIndex=_.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(d=>{this._refreshCharAtlas(r,d),this.reset(r)})),this._register(tr(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=Rt(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(r){}handleFocus(r){}handleCursorMove(r){}handleGridChanged(r,i,n){}handleSelectionChanged(r,i,n,_=!1){}_setTransparency(r,i){if(i===this._alpha)return;let n=this._canvas;this._alpha=i,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(r,this._themeService.colors),this.handleGridChanged(r,0,r.rows-1)}_refreshCharAtlas(r,i){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=Op(r,this._optionsService.rawOptions,i,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(r,i){this._deviceCellWidth=i.device.cell.width,this._deviceCellHeight=i.device.cell.height,this._deviceCharWidth=i.device.char.width,this._deviceCharHeight=i.device.char.height,this._deviceCharLeft=i.device.char.left,this._deviceCharTop=i.device.char.top,this._canvas.width=i.device.canvas.width,this._canvas.height=i.device.canvas.height,this._canvas.style.width=`${i.css.canvas.width}px`,this._canvas.style.height=`${i.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(r,this._themeService.colors)}_fillBottomLineAtCells(r,i,n=1){this._ctx.fillRect(r*this._deviceCellWidth,(i+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,n*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(r,i,n,_){this._alpha?this._ctx.clearRect(r*this._deviceCellWidth,i*this._deviceCellHeight,n*this._deviceCellWidth,_*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(r*this._deviceCellWidth,i*this._deviceCellHeight,n*this._deviceCellWidth,_*this._deviceCellHeight))}_fillCharTrueColor(r,i,n,_){this._ctx.font=this._getFont(r,!1,!1),this._ctx.textBaseline=xp,this._clipCell(n,_,i.getWidth()),this._ctx.fillText(i.getChars(),n*this._deviceCellWidth+this._deviceCharLeft,_*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(r,i,n){this._ctx.beginPath(),this._ctx.rect(r*this._deviceCellWidth,i*this._deviceCellHeight,n*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(r,i,n){let _=i?r.options.fontWeightBold:r.options.fontWeight;return`${n?"italic":""} ${_} ${r.options.fontSize*this._coreBrowserService.dpr}px ${r.options.fontFamily}`}},P0=class extends B0{constructor(r,i,n,_,p,L,R){super(n,r,"link",i,!0,p,L,R),this._register(_.onShowLinkUnderline(o=>this._handleShowLinkUnderline(o))),this._register(_.onHideLinkUnderline(o=>this._handleHideLinkUnderline(o)))}resize(r,i){super.resize(r,i),this._state=void 0}reset(r){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let r=this._state.y2-this._state.y1-1;r>0&&this._clearCells(0,this._state.y1+1,this._state.cols,r),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(r){if(r.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:r.fg!==void 0&&v0(r.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[r.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,r.y1===r.y2)this._fillBottomLineAtCells(r.x1,r.y1,r.x2-r.x1);else{this._fillBottomLineAtCells(r.x1,r.y1,r.cols-r.x1);for(let i=r.y1+1;i<r.y2;i++)this._fillBottomLineAtCells(0,i,r.cols);this._fillBottomLineAtCells(0,r.y2,r.x2)}this._state=r}_handleHideLinkUnderline(r){this._clearCurrentLink()}},Zi=typeof window=="object"?window:globalThis,Vc=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new ot,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new ot,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(i){return this.mapWindowIdToZoomLevel.get(this.getWindowId(i))??0}setZoomLevel(i,n){if(this.getZoomLevel(n)===i)return;let _=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(_,i),this._onDidChangeZoomLevel.fire(_)}getZoomFactor(i){return this.mapWindowIdToZoomFactor.get(this.getWindowId(i))??1}setZoomFactor(i,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),i)}setFullscreen(i,n){if(this.isFullscreen(n)===i)return;let _=this.getWindowId(n);this.mapWindowIdToFullScreen.set(_,i),this._onDidChangeFullscreen.fire(_)}isFullscreen(i){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(i))}getWindowId(i){return i.vscodeWindowId}};Vc.INSTANCE=new Vc;var Fp=Vc;function O0(r,i,n){typeof i=="string"&&(i=r.matchMedia(i)),i.addEventListener("change",n)}Fp.INSTANCE.onDidChangeZoomLevel;Fp.INSTANCE.onDidChangeFullscreen;var js=typeof navigator=="object"?navigator.userAgent:"";js.indexOf("Firefox")>=0;js.indexOf("AppleWebKit")>=0;var N0=js.indexOf("Chrome")>=0;!N0&&js.indexOf("Safari")>=0;js.indexOf("Electron/")>=0;js.indexOf("Android")>=0;var yc=!1;if(typeof Zi.matchMedia=="function"){let r=Zi.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),i=Zi.matchMedia("(display-mode: fullscreen)");yc=r.matches,O0(Zi,r,({matches:n})=>{yc&&i.matches||(yc=n)})}var Os="en",wc=!1,Hp=!1,Go,ia=Os,sf=Os,I0,Hr,rs=globalThis,Yt,Bf;typeof rs.vscode<"u"&&typeof rs.vscode.process<"u"?Yt=rs.vscode.process:typeof process<"u"&&typeof((Bf=process==null?void 0:process.versions)==null?void 0:Bf.node)=="string"&&(Yt=process);var Pf,j0=typeof((Pf=Yt==null?void 0:Yt.versions)==null?void 0:Pf.electron)=="string",F0=j0&&(Yt==null?void 0:Yt.type)==="renderer",Of;if(typeof Yt=="object"){Yt.platform,Yt.platform,wc=Yt.platform==="linux",wc&&Yt.env.SNAP&&Yt.env.SNAP_REVISION,Yt.env.CI||Yt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Go=Os,ia=Os;let r=Yt.env.VSCODE_NLS_CONFIG;if(r)try{let i=JSON.parse(r);Go=i.userLocale,sf=i.osLocale,ia=i.resolvedLanguage||Os,I0=(Of=i.languagePack)==null?void 0:Of.translationsConfigFile}catch{}Hp=!0}else typeof navigator=="object"&&!F0?(Hr=navigator.userAgent,Hr.indexOf("Windows")>=0,Hr.indexOf("Macintosh")>=0,(Hr.indexOf("Macintosh")>=0||Hr.indexOf("iPad")>=0||Hr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,wc=Hr.indexOf("Linux")>=0,(Hr==null?void 0:Hr.indexOf("Mobi"))>=0,ia=globalThis._VSCODE_NLS_LANGUAGE||Os,Go=navigator.language.toLowerCase(),sf=Go):console.error("Unable to resolve platform.");var nf=Hp,Yr=Hr,Bi=ia,H0;(r=>{function i(){return Bi}r.value=i;function n(){return Bi.length===2?Bi==="en":Bi.length>=3?Bi[0]==="e"&&Bi[1]==="n"&&Bi[2]==="-":!1}r.isDefaultVariant=n;function _(){return Bi==="en"}r.isDefault=_})(H0||(H0={}));var $0=typeof rs.postMessage=="function"&&!rs.importScripts;(()=>{if($0){let r=[];rs.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let _=0,p=r.length;_<p;_++){let L=r[_];if(L.id===n.data.vscodeScheduleAsyncWork){r.splice(_,1),L.callback();return}}});let i=0;return n=>{let _=++i;r.push({id:_,callback:n}),rs.postMessage({vscodeScheduleAsyncWork:_},"*")}}return r=>setTimeout(r)})();var z0=!!(Yr&&Yr.indexOf("Chrome")>=0);Yr&&Yr.indexOf("Firefox")>=0;!z0&&Yr&&Yr.indexOf("Safari")>=0;Yr&&Yr.indexOf("Edg/")>=0;Yr&&Yr.indexOf("Android")>=0;var Ds=typeof navigator=="object"?navigator:{};nf||document.queryCommandSupported&&document.queryCommandSupported("copy")||Ds&&Ds.clipboard&&Ds.clipboard.writeText,nf||Ds&&Ds.clipboard&&Ds.clipboard.readText;var Qc=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(r,i){this._keyCodeToStr[r]=i,this._strToKeyCode[i.toLowerCase()]=r}keyCodeToStr(r){return this._keyCodeToStr[r]}strToKeyCode(r){return this._strToKeyCode[r.toLowerCase()]||0}},Sc=new Qc,of=new Qc,af=new Qc;new Array(230);var U0;(r=>{function i(o){return Sc.keyCodeToStr(o)}r.toString=i;function n(o){return Sc.strToKeyCode(o)}r.fromString=n;function _(o){return of.keyCodeToStr(o)}r.toUserSettingsUS=_;function p(o){return af.keyCodeToStr(o)}r.toUserSettingsGeneral=p;function L(o){return of.strToKeyCode(o)||af.strToKeyCode(o)}r.fromUserSettings=L;function R(o){if(o>=98&&o<=113)return null;switch(o){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Sc.keyCodeToStr(o)}r.toElectronAccelerator=R})(U0||(U0={}));var $p=Object.freeze(function(r,i){let n=setTimeout(r.bind(i),0);return{dispose(){clearTimeout(n)}}}),W0;(r=>{function i(n){return n===r.None||n===r.Cancelled||n instanceof V0?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}r.isCancellationToken=i,r.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ui.None}),r.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:$p})})(W0||(W0={}));var V0=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?$p:(this._emitter||(this._emitter=new ot),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},K0;(r=>{async function i(_){let p,L=await Promise.all(_.map(R=>R.then(o=>o,o=>{p||(p=o)})));if(typeof p<"u")throw p;return L}r.settled=i;function n(_){return new Promise(async(p,L)=>{try{await _(p,L)}catch(R){L(R)}})}r.withAsyncBody=n})(K0||(K0={}));var lf=class Dr{static fromArray(i){return new Dr(n=>{n.emitMany(i)})}static fromPromise(i){return new Dr(async n=>{n.emitMany(await i)})}static fromPromises(i){return new Dr(async n=>{await Promise.all(i.map(async _=>n.emitOne(await _)))})}static merge(i){return new Dr(async n=>{await Promise.all(i.map(async _=>{for await(let p of _)n.emitOne(p)}))})}constructor(i,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new ot,queueMicrotask(async()=>{let _={emitOne:p=>this.emitOne(p),emitMany:p=>this.emitMany(p),reject:p=>this.reject(p)};try{await Promise.resolve(i(_)),this.resolve()}catch(p){this.reject(p)}finally{_.emitOne=void 0,_.emitMany=void 0,_.reject=void 0}})}[Symbol.asyncIterator](){let i=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(i<this._results.length)return{done:!1,value:this._results[i++]};if(this._state===1)return{done:!0,value:void 0};await ui.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var n;return(n=this._onReturn)==null||n.call(this),{done:!0,value:void 0}}}}static map(i,n){return new Dr(async _=>{for await(let p of i)_.emitOne(n(p))})}map(i){return Dr.map(this,i)}static filter(i,n){return new Dr(async _=>{for await(let p of i)n(p)&&_.emitOne(p)})}filter(i){return Dr.filter(this,i)}static coalesce(i){return Dr.filter(i,n=>!!n)}coalesce(){return Dr.coalesce(this)}static async toPromise(i){let n=[];for await(let _ of i)n.push(_);return n}toPromise(){return Dr.toPromise(this)}emitOne(i){this._state===0&&(this._results.push(i),this._onStateChanged.fire())}emitMany(i){this._state===0&&(this._results=this._results.concat(i),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(i){this._state===0&&(this._state=2,this._error=i,this._onStateChanged.fire())}};lf.EMPTY=lf.fromArray([]);var{getWindow:q0}=(function(){let r=new Map,i={window:Zi,disposables:new Is};r.set(Zi.vscodeWindowId,i);let n=new ot,_=new ot,p=new ot;function L(R,o){return(typeof R=="number"?r.get(R):void 0)??(o?i:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:p.event,onDidUnregisterWindow:_.event,registerWindow(R){if(r.has(R.vscodeWindowId))return $r.None;let o=new Is,d={window:R,disposables:o.add(new Is)};return r.set(R.vscodeWindowId,d),o.add(tr(()=>{r.delete(R.vscodeWindowId),_.fire(R)})),o.add(Kc(R,Y0.BEFORE_UNLOAD,()=>{p.fire(R)})),n.fire(d),o},getWindows(){return r.values()},getWindowsCount(){return r.size},getWindowId(R){return R.vscodeWindowId},hasWindow(R){return r.has(R)},getWindowById:L,getWindow(R){var v;let o=R;if((v=o==null?void 0:o.ownerDocument)!=null&&v.defaultView)return o.ownerDocument.defaultView.window;let d=R;return d!=null&&d.view?d.view.window:Zi},getDocument(R){return q0(R).document}}})(),G0=class{constructor(r,i,n,_){this._node=r,this._type=i,this._handler=n,this._options=_||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Kc(r,i,n,_){return new G0(r,i,n,_)}var Y0={BEFORE_UNLOAD:"beforeunload"},X0=class extends $r{constructor(r,i,n,_,p,L,R,o,d){super(),this._terminal=r,this._characterJoinerService=i,this._charSizeService=n,this._coreBrowserService=_,this._coreService=p,this._decorationService=L,this._optionsService=R,this._themeService=o,this._cursorBlinkStateManager=new Cn,this._charAtlasDisposable=this._register(new Cn),this._observerDisposable=this._register(new Cn),this._model=new R0,this._workCell=new Gd,this._workCell2=new Gd,this._rectangleRenderer=this._register(new Cn),this._glyphRenderer=this._register(new Cn),this._onChangeTextureAtlas=this._register(new ot),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new ot),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new ot),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new ot),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new ot),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let v={antialias:!1,depth:!1,preserveDrawingBuffer:d};if(this._gl=this._canvas.getContext("webgl2",v),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new Um(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new P0(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,R,this._themeService)],this.dimensions=$m(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(R.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(Kc(this._canvas,"webglcontextlost",y=>{console.log("webglcontextlost event received"),y.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(y)},3e3)})),this._register(Kc(this._canvas,"webglcontextrestored",y=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,Kd(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=qd(this._canvas,this._coreBrowserService.window,(y,f)=>this._setCanvasDevicePixelDimensions(y,f)),this._register(this._coreBrowserService.onWindowChange(y=>{this._observerDisposable.value=qd(this._canvas,y,(f,C)=>this._setCanvasDevicePixelDimensions(f,C))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(tr(()=>{var y;for(let f of this._renderLayers)f.dispose();(y=this._canvas.parentElement)==null||y.removeChild(this._canvas),Kd(this._terminal)}))}get textureAtlas(){var r;return(r=this._charAtlas)==null?void 0:r.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(r,i){var n,_,p,L;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let R of this._renderLayers)R.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.setDimensions(this.dimensions),(_=this._rectangleRenderer.value)==null||_.handleResize(),(p=this._glyphRenderer.value)==null||p.setDimensions(this.dimensions),(L=this._glyphRenderer.value)==null||L.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var r;for(let i of this._renderLayers)i.handleBlur(this._terminal);(r=this._cursorBlinkStateManager.value)==null||r.pause(),this._requestRedrawViewport()}handleFocus(){var r;for(let i of this._renderLayers)i.handleFocus(this._terminal);(r=this._cursorBlinkStateManager.value)==null||r.resume(),this._requestRedrawViewport()}handleSelectionChanged(r,i,n){for(let _ of this._renderLayers)_.handleSelectionChanged(this._terminal,r,i,n);this._model.selection.update(this._core,r,i,n),this._requestRedrawViewport()}handleCursorMove(){var r;for(let i of this._renderLayers)i.handleCursorMove(this._terminal);(r=this._cursorBlinkStateManager.value)==null||r.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new A0(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new b0(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var i;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let r=Op(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._deviceMaxTextureSize);this._charAtlas!==r&&(this._onChangeTextureAtlas.fire(r.pages[0].canvas),this._charAtlasDisposable.value=mp(ui.forward(r.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),ui.forward(r.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=r,this._charAtlas.warmUp(),(i=this._glyphRenderer.value)==null||i.setAtlas(this._charAtlas)}_clearModel(r){var i;this._model.clear(),r&&((i=this._glyphRenderer.value)==null||i.clear())}clearTextureAtlas(){var r;(r=this._charAtlas)==null||r.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var r;this._clearModel(!0);for(let i of this._renderLayers)i.reset(this._terminal);(r=this._cursorBlinkStateManager.value)==null||r.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(r,i){var n;if(!this._isAttached)if((n=this._core.screenElement)!=null&&n.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let _ of this._renderLayers)_.handleGridChanged(this._terminal,r,i);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(r,i),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new g0(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(r,i){let n=this._core,_=this._workCell,p,L,R,o,d,v,y=0,f=!0,C,b,M,w,c,h,l,u,g;r=cf(r,n.rows-1,0),i=cf(i,n.rows-1,0);let S=this._coreService.decPrivateModes.cursorStyle??n.options.cursorStyle??"block",E=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,T=E-n.buffer.ydisp,k=Math.min(this._terminal.buffer.active.cursorX,n.cols-1),N=-1,V=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let K=!1;for(L=r;L<=i;L++)for(R=L+n.buffer.ydisp,o=n.buffer.lines.get(R),this._model.lineLengths[L]=0,M=E===R,y=0,d=this._characterJoinerService.getJoinedCharacters(R),u=0;u<n.cols;u++){if(p=this._cellColorResolver.result.bg,o.loadCell(u,_),u===0&&(p=this._cellColorResolver.result.bg),v=!1,f=u>=y,C=u,d.length>0&&u===d[0][0]&&f){b=d.shift();let O=this._model.selection.isCellSelected(this._terminal,b[0],R);for(l=b[0]+1;l<b[1];l++)f&&(f=O===this._model.selection.isCellSelected(this._terminal,l,R));f&&(f=!M||k<b[0]||k>=b[1]),f?(v=!0,_=new J0(_,o.translateToString(!0,b[0],b[1]),b[1]-b[0]),C=b[1]-1):y=b[1]}if(w=_.getChars(),c=_.getCode(),l=(L*n.cols+u)*ca,this._cellColorResolver.resolve(_,u,R,this.dimensions.device.cell.width),V&&R===E&&(u===k&&(this._model.cursor={x:k,y:T,width:_.getWidth(),style:this._coreBrowserService.isFocused?S:n.options.cursorInactiveStyle,cursorWidth:n.options.cursorWidth,dpr:this._devicePixelRatio},N=k+_.getWidth()-1),u>=k&&u<=N&&(this._coreBrowserService.isFocused&&S==="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)),c!==0&&(this._model.lineLengths[L]=u+1),!(this._model.cells[l]===c&&this._model.cells[l+ta]===this._cellColorResolver.result.bg&&this._model.cells[l+ra]===this._cellColorResolver.result.fg&&this._model.cells[l+gc]===this._cellColorResolver.result.ext)&&(K=!0,w.length>1&&(c|=L0),this._model.cells[l]=c,this._model.cells[l+ta]=this._cellColorResolver.result.bg,this._model.cells[l+ra]=this._cellColorResolver.result.fg,this._model.cells[l+gc]=this._cellColorResolver.result.ext,h=_.getWidth(),this._glyphRenderer.value.updateCell(u,L,c,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,w,h,p),v)){for(_=this._workCell,u++;u<=C;u++)g=(L*n.cols+u)*ca,this._glyphRenderer.value.updateCell(u,L,0,0,0,0,Pm,0,0),this._model.cells[g]=0,this._model.cells[g+ta]=this._cellColorResolver.result.bg,this._model.cells[g+ra]=this._cellColorResolver.result.fg,this._model.cells[g+gc]=this._cellColorResolver.result.ext;u--}}K&&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(r,i){this._canvas.width===r&&this._canvas.height===i||(this._canvas.width=r,this._canvas.height=i,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let r=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:r,end:r})}},J0=class extends Ps{constructor(r,i,n){super(),this.content=0,this.combinedData="",this.fg=r.fg,this.bg=r.bg,this.combinedData=i,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(r){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function cf(r,i,n=0){return Math.max(Math.min(r,i),n)}var hf="di$target",uf="di$dependencies",Cc=new Map;function Xr(r){if(Cc.has(r))return Cc.get(r);let i=function(n,_,p){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Q0(i,n,p)};return i._id=r,Cc.set(r,i),i}function Q0(r,i,n){i[hf]===i?i[uf].push({id:r,index:n}):(i[uf]=[{id:r,index:n}],i[hf]=i)}Xr("BufferService");Xr("CoreMouseService");Xr("CoreService");Xr("CharsetService");Xr("InstantiationService");Xr("LogService");var Z0=Xr("OptionsService");Xr("OscLinkService");Xr("UnicodeService");Xr("DecorationService");var e1={trace:0,debug:1,info:2,warn:3,error:4,off:5},t1="xterm.js: ",df=class extends $r{constructor(r){super(),this._optionsService=r,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=e1[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let i=0;i<r.length;i++)typeof r[i]=="function"&&(r[i]=r[i]())}_log(r,i,n){this._evalLazyOptionalParams(n),r.call(console,(this._optionsService.options.logger?"":t1)+i,...n)}trace(r,...i){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,r,i)}debug(r,...i){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,r,i)}info(r,...i){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,r,i)}warn(r,...i){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,r,i)}error(r,...i){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,r,i)}};df=Cm([xm(0,Z0)],df);var r1=class extends $r{constructor(r){if(Sp&&Bm()<16){let i={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",i))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=r,this._onChangeTextureAtlas=this._register(new ot),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new ot),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new ot),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new ot),this.onContextLoss=this._onContextLoss.event}activate(r){let i=r._core;if(!r.element){this._register(i.onWillOpen(()=>this.activate(r)));return}this._terminal=r;let n=i.coreService,_=i.optionsService,p=i,L=p._renderService,R=p._characterJoinerService,o=p._charSizeService,d=p._coreBrowserService,v=p._decorationService;p._logService;let y=p._themeService;this._renderer=this._register(new X0(r,R,o,d,n,v,_,y,this._preserveDrawingBuffer)),this._register(ui.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(ui.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(ui.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(ui.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),L.setRenderer(this._renderer),this._register(tr(()=>{if(this._terminal._core._store._isDisposed)return;let f=this._terminal._core._renderService;f.setRenderer(this._terminal._core._createRenderer()),f.handleResize(r.cols,r.rows)}))}get textureAtlas(){var r;return(r=this._renderer)==null?void 0:r.textureAtlas}clearTextureAtlas(){var r;(r=this._renderer)==null||r.clearTextureAtlas()}};function xc(r){return(r*257).toString(16).padStart(4,"0")}function bc(r){const i=parseInt(r.slice(1,3),16),n=parseInt(r.slice(3,5),16),_=parseInt(r.slice(5,7),16);return`${xc(i)}/${xc(n)}/${xc(_)}`}function i1(r,i){r.parser.registerCsiHandler({final:"n"},n=>{const _=n.length>0?n[0]:0;if(_===6){const p=r.buffer.active,L=p.cursorY+1,R=p.cursorX+1;return i(`\x1B[${L};${R}R`),!0}else if(_===5)return i("\x1B[0n"),!0;return!1}),r.parser.registerCsiHandler({final:"c"},()=>(i("\x1B[?62;1;6;22c"),!0)),r.parser.registerCsiHandler({prefix:">",final:"c"},()=>(i("\x1B[>1;500;0c"),!0)),r.parser.registerCsiHandler({prefix:"?",final:"p",intermediates:"$"},n=>{const _=n[0]||0,p=r.modes;let L=0;return _===1?L=p.applicationCursorKeysMode?1:2:_===25?L=1:_===1e3?L=p.mouseTrackingMode==="x10"?1:2:_===1002?L=p.mouseTrackingMode==="drag"?1:2:_===1003?L=p.mouseTrackingMode==="any"?1:2:_===1004?L=p.sendFocusMode?1:2:_===1006?L=p.mouseTrackingMode!=="none"?1:2:_===1049?L=r.buffer.active.type==="alternate"?1:2:_===2004?L=p.bracketedPasteMode?1:2:_===2026&&(L=2),i(`\x1B[?${_};${L}$y`),!0}),r.parser.registerOscHandler(10,n=>n==="?"?(i(`\x1B]10;rgb:${bc(Wf)}\x07`),!0):!1),r.parser.registerOscHandler(11,n=>n==="?"?(i(`\x1B]11;rgb:${bc(Bc)}\x07`),!0):!1),r.parser.registerOscHandler(12,n=>n==="?"?(i("\x1B]12;rgb:ffff/ffff/ffff\x07"),!0):!1),r.parser.registerOscHandler(4,n=>{const _=n.match(/^(\d+);?\?$/);if(_){const p=parseInt(_[1]),L=p>=0&&p<Bt.length?Bt[p]:Bt[0];return i(`\x1B]4;${p};rgb:${bc(L)}\x07`),!0}return!1}),r.parser.registerOscHandler(52,n=>!!n.includes("?")),r.parser.registerCsiHandler({prefix:">",final:"q"},()=>(i("\x1BP>|xterm.js(5.5.0)\x1B\\"),!0)),r.parser.registerCsiHandler({prefix:"?",final:"u"},()=>!0),r.parser.registerCsiHandler({prefix:"?",final:"m"},n=>n[0]===4?(i("\x1B[>4;0m"),!0):!1),r.parser.registerCsiHandler({final:"t"},n=>{const _=n[0];return _===19?(i(`\x1B[9;${r.rows};${r.cols}t`),!0):_===20?(i("\x1B]LTerminal\x1B\\"),!0):_===21?(i("\x1B]lTerminal\x1B\\"),!0):!1}),r.parser.registerCsiHandler({prefix:"?",final:"S"},()=>!0),r.parser.registerDcsHandler({intermediates:"$",final:"q"},n=>n==="m"?(i("\x1BP1$rm\x1B\\"),!0):n==='"p'?(i('\x1BP1$r62;1"p\x1B\\'),!0):n==="r"?(i(`\x1BP1$r1;${r.rows}r\x1B\\`),!0):(i("\x1BP0$r\x1B\\"),!0)),r.parser.registerDcsHandler({intermediates:"+",final:"q"},n=>{try{const p=(n.match(/.{2}/g)||[]).map(R=>String.fromCharCode(parseInt(R,16))).join(""),L={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(p in L){const o=L[p].split("").map(d=>d.charCodeAt(0).toString(16).padStart(2,"0")).join("");return i(`\x1BP1+r${o}\x1B\\`),!0}}catch(_){console.error("[XTGETTCAP] Failed to decode:",_)}return i("\x1BP0+r\x1B\\"),!0}),r.parser.registerCsiHandler({final:"b"},n=>{const _=n[0]||1;return _>65535?(console.warn(`[REP] Large repeat count ${_} clamped to 65535 for security`),!0):!1})}const s1=new Set(["w","t","n","r","s","p","j"]),Ec=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent||"");function n1(r,i){const n=()=>{if(!r.hasSelection())return!1;try{const p=navigator==null?void 0:navigator.clipboard;if(p&&typeof p.writeText=="function")return p.writeText(r.getSelection()).catch(()=>{}),!0}catch{}return!1},_=()=>{try{const p=navigator==null?void 0:navigator.clipboard;if(p&&typeof p.readText=="function")return p.readText().then(L=>{!i()&&L&&r.paste(L)}).catch(()=>{}),!0}catch{}return!1};r.attachCustomKeyEventHandler(p=>{if(p.type!=="keydown"||p.isComposing||p.keyCode===229)return!0;const L=p.key.length===1?p.key.toLowerCase():p.key;return(p.ctrlKey&&p.shiftKey&&L==="c"||p.ctrlKey&&!p.shiftKey&&p.key==="Insert"||Ec&&p.metaKey&&!p.ctrlKey&&L==="c")&&r.hasSelection()&&n()||(p.ctrlKey&&p.shiftKey&&L==="v"||p.shiftKey&&!p.ctrlKey&&p.key==="Insert"||Ec&&p.metaKey&&!p.ctrlKey&&L==="v")&&_()?(p.preventDefault(),!1):((p.ctrlKey||p.metaKey)&&(p.key==="+"||p.key==="-"||p.key==="="||p.key==="0")||!Ec&&p.ctrlKey&&!p.shiftKey&&!p.altKey&&!p.metaKey&&s1.has(L)&&p.preventDefault(),!0)})}const o1="接続が終了しました。",ff=5,pf=1e3,a1=new Set(["Deck deleted","Terminal deleted","Terminal exited","Terminal not found"]),_f=new TextEncoder,kc=48*1024;function l1(r){const i=new Uint8Array(r.length);for(let n=0;n<r.length;n++)i[n]=r.charCodeAt(n)&255;return i}function c1({session:r,wsUrl:i,onDelete:n,onExit:_,onTitle:p}){const L=$.useRef(null),R=$.useRef(null),o=$.useRef(null),d=$.useRef(null),v=$.useRef(0),y=$.useRef(_),f=$.useRef(p),[C,b]=$.useState(null);return $.useEffect(()=>{y.current=_},[_]),$.useEffect(()=>{f.current=p},[p]),$.useEffect(()=>{var M;b(null),(M=f.current)==null||M.call(f,null)},[r.id]),$.useEffect(()=>{var ze,Br;if(!R.current)return;v.current=0,R.current.innerHTML="";const M=new Fg.Terminal({cursorBlink:!0,cursorInactiveStyle:"outline",fontFamily:Kv,fontSize:qv,allowProposedApi:!0,scrollback:1e4,scrollSensitivity:3,fastScrollModifier:"alt",macOptionIsMeta:!0,convertEol:!1,windowsMode:!1,rightClickSelectsWord:!0,theme:{background:Bc,foreground:Wf,cursor:Gv,cursorAccent:Bc,selectionBackground:Yv,black:Bt[0],red:Bt[1],green:Bt[2],yellow:Bt[3],blue:Bt[4],magenta:Bt[5],cyan:Bt[6],white:Bt[7],brightBlack:Bt[8],brightRed:Bt[9],brightGreen:Bt[10],brightYellow:Bt[11],brightBlue:Bt[12],brightMagenta:Bt[13],brightCyan:Bt[14],brightWhite:Bt[15]},windowOptions:{getWinSizePixels:!0,getCellSizePixels:!0,getWinSizeChars:!0}}),w=new zg,c=new _m,h=new Sm;M.loadAddon(w),M.loadAddon(c),M.loadAddon(h),M.unicode.activeVersion="11",o.current=w,M.open(R.current);let l=null,u=!1;const g=()=>{if(!(u||Je||l)){u=!0;try{const Se=new r1;Se.onContextLoss(()=>{Se.dispose(),l===Se&&(l=null)}),M.loadAddon(Se),l=Se}catch(Se){if(console.warn("[Terminal] WebGL renderer unavailable, falling back to DOM:",Se),l){try{l.dispose()}catch{}l=null}}}},S=new IntersectionObserver(Se=>{for(const Re of Se)Re.isIntersecting&&Re.intersectionRatio>0&&(g(),_e(!0))});S.observe(R.current),n1(M,()=>Je);const E=M.onTitleChange(Se=>{var Re;b(Se),(Re=f.current)==null||Re.call(f,Se)});let T=null;const k=M.onBell(()=>{var Re;const Se=L.current??((Re=R.current)==null?void 0:Re.closest(".terminal-tile"));Se&&(Se.classList.add("bell-flash"),T&&clearTimeout(T),T=setTimeout(()=>{T=null,Se.classList.remove("bell-flash")},150))});let N=!0,V=!1,K=0,O=!0,B=!1,U=!0;const z=()=>{N=!1,B&&(B=!1,_e(!0)),U&&window.requestAnimationFrame(()=>{M.scrollToBottom()})},q=Se=>{const Re=d.current;Re&&Re.readyState===WebSocket.OPEN&&Re.send(JSON.stringify(Se))};i1(M,Se=>{if(N||!O)return;const Re=d.current;Re&&Re.readyState===WebSocket.OPEN&&Re.send(_f.encode(Se))});let W=0,A=0,I=null,P=M.cols,H=M.rows,J=0,ie=0,ae=((ze=window.visualViewport)==null?void 0:ze.scale)??1;const ue=(Se,Re)=>{M.cols>0&&(J=Se/M.cols),M.rows>0&&(ie=Re/M.rows)},X=R.current.querySelector(".xterm-helper-textarea");X instanceof HTMLTextAreaElement&&(X.setAttribute("spellcheck","false"),X.setAttribute("autocapitalize","off"),X.setAttribute("autocomplete","off"),X.setAttribute("autocorrect","off"));const j=()=>{const Se=M.cols,Re=M.rows;!Se||!Re||Se===P&&Re===H||(P=Se,H=Re,q({type:"resize",cols:Se,rows:Re}))},se=()=>{q({type:"claim"})},te=Se=>{const Re=d.current;if(!(!Re||Re.readyState!==WebSocket.OPEN)){if(Se.byteLength<=kc){Re.send(Se);return}for(let Ke=0;Ke<Se.byteLength;Ke+=kc){const Ge=Math.min(Ke+kc,Se.byteLength);Re.send(Se.subarray(Ke,Ge))}}},ce=(Se=!1)=>{var He;if(B)return;const Re=R.current;if(!Re)return;const Ke=Re.clientWidth,Ge=Re.clientHeight;if(!Ke||!Ge||!Se&&Ke===W&&Ge===A)return;const Tt=((He=window.visualViewport)==null?void 0:He.scale)??1;if(!Se&&J>0&&ie>0){const pt=Math.max(2,Math.floor(Ke/J)),Ye=Math.max(1,Math.floor(Ge/ie)),oe=Math.abs(Ke-W),he=Math.abs(Ge-A),Ce=Math.max(J*.75,2),De=Math.max(ie*.75,2),Ue=Math.abs(Tt-ae)>.001;if(pt===P&&Ye===H){W=Ke,A=Ge,ae=Tt;return}if(Ue&&oe<Ce&&he<De){W=Ke,A=Ge,ae=Tt;return}}W=Ke,A=Ge,w.fit(),ue(Ke,Ge),ae=Tt,j()},_e=(Se=!1)=>{if(I!==null){if(!Se)return;cancelAnimationFrame(I)}I=window.requestAnimationFrame(()=>{I=null,ce(Se)})},Le=new ResizeObserver(()=>{_e()});Le.observe(R.current),_e();const ke=typeof document<"u"?document.fonts:null,Ie=()=>{Je||_e(!0)};ke==null||ke.ready.then(Ie).catch(()=>{}),(Br=ke==null?void 0:ke.addEventListener)==null||Br.call(ke,"loadingdone",Ie);let Ne=null,ge=null,Xe=null,kt=null,yt=null,Je=!1,Qe=0,Ze=null,Vt=!1;const wt=()=>{var Re;const Se=(Re=R.current)==null?void 0:Re.querySelector(".xterm-helper-textarea");if(Se instanceof HTMLTextAreaElement)try{Se.focus({preventScroll:!0})}catch{Se.focus()}},at=()=>{Je||wt()},St=()=>{Je||wt()};R.current.addEventListener("pointerdown",at,{passive:!0,capture:!0}),R.current.addEventListener("mousedown",at,{passive:!0,capture:!0}),R.current.addEventListener("touchstart",at,{passive:!0,capture:!0}),R.current.addEventListener("focusin",St,!0),yt=()=>{var Se,Re,Ke,Ge;(Se=R.current)==null||Se.removeEventListener("pointerdown",at,!0),(Re=R.current)==null||Re.removeEventListener("mousedown",at,!0),(Ke=R.current)==null||Ke.removeEventListener("touchstart",at,!0),(Ge=R.current)==null||Ge.removeEventListener("focusin",St,!0)};const ft=async(Se=!1)=>{if(!Je){N=!0,V=!1,K=0;try{const{token:Re,authEnabled:Ke}=await Qo();if(Je)return;const Ge=Ke?`${i}?token=${Re}`:i;let Tt=Ge;if(Se&&v.current>0){const He=Ge.includes("?")?"&":"?";Tt=`${Ge}${He}bufferOffset=${v.current}`}if(Se){const He=Tt.includes("?")?"&":"?";Tt=`${Tt}${He}reconnect=1`}if(Ne=new WebSocket(Tt),Ne.binaryType="arraybuffer",d.current=Ne,Ne.addEventListener("open",()=>{var He;Qe=0,W=0,A=0,J=0,ie=0,P=-1,H=-1,ae=((He=window.visualViewport)==null?void 0:He.scale)??1,_e(),M.textarea&&document.activeElement===M.textarea&&se()}),Ne.addEventListener("message",He=>{if(typeof He.data=="string"){let Ye=null;try{Ye=JSON.parse(He.data)}catch{return}if((Ye==null?void 0:Ye.type)==="sync"){const oe=M.buffer.active;U=Ye.reset||oe.viewportY>=oe.baseY,N=!0,V=!1,K=0,B=!1,v.current=Ye.offsetBase,Ye.reset&&M.reset(),ce(!0),B=!0;return}if((Ye==null?void 0:Ye.type)==="ready"){V=!0,K===0&&z();return}if((Ye==null?void 0:Ye.type)==="primary"){O=Ye.value;return}return}if(He.data instanceof Blob){He.data.arrayBuffer().then(oe=>{if(Je)return;const he=new Uint8Array(oe);K++,M.write(he,()=>{v.current+=he.byteLength,K=Math.max(0,K-1),V&&K===0&&z()})});return}const pt=new Uint8Array(He.data);K++,M.write(pt,()=>{v.current+=pt.byteLength,K=Math.max(0,K-1),V&&K===0&&z()})}),Ne.addEventListener("close",He=>{if(!(Je||Vt)&&d.current===Ne){if(He.code===1e3&&a1.has(He.reason)){y.current();return}if(Qe<ff){Qe++;const pt=pf*Math.pow(2,Qe-1);Ze=setTimeout(()=>ft(!0),pt)}else M.write(`\r
162
+ \x1B[31m${o1}\x1B[0m\r
163
+ `)}}),Ne.addEventListener("error",()=>{}),ge&&ge.dispose(),ge=M.onData(He=>{N||Ne&&Ne.readyState===WebSocket.OPEN&&te(_f.encode(He))}),Xe&&Xe.dispose(),Xe=M.onBinary(He=>{N||Ne&&Ne.readyState===WebSocket.OPEN&&te(l1(He))}),!kt&&M.textarea){const He=()=>{se()};M.textarea.addEventListener("focus",He),kt=()=>{var pt;(pt=M.textarea)==null||pt.removeEventListener("focus",He)}}}catch(Re){if(console.error("[Terminal] Failed to connect:",Re),Qe<ff){Qe++;const Ke=pf*Math.pow(2,Qe-1);Ze=setTimeout(()=>ft(!0),Ke)}else M.write(`\r
164
+ \x1B[31m接続エラー: ${Re instanceof Error?Re.message:"Unknown error"}\x1B[0m\r
165
+ `)}}};ft();const or=()=>{if(Je||Vt)return;const Se=d.current;Se&&(Se.readyState===WebSocket.OPEN||Se.readyState===WebSocket.CONNECTING)||(Qe=0,!(Se&&Se.readyState===WebSocket.CLOSING)&&(Ze&&(clearTimeout(Ze),Ze=null),ft(!0)))},Ct=()=>or(),Ot=()=>{document.visibilityState==="visible"&&or()};return window.addEventListener("online",Ct),document.addEventListener("visibilitychange",Ot),()=>{var Se;if(Je=!0,Vt=!0,window.removeEventListener("online",Ct),document.removeEventListener("visibilitychange",Ot),Ze&&clearTimeout(Ze),I!==null&&cancelAnimationFrame(I),Le.disconnect(),S.disconnect(),(Se=ke==null?void 0:ke.removeEventListener)==null||Se.call(ke,"loadingdone",Ie),ge&&ge.dispose(),Xe&&Xe.dispose(),kt&&kt(),yt&&yt(),E.dispose(),k.dispose(),T&&(clearTimeout(T),T=null),Ne&&Ne.close(),d.current=null,l){try{l.dispose()}catch{}l=null}o.current=null,M.dispose()}},[r.id,i]),D.jsxs("div",{className:"terminal-tile",ref:L,children:[D.jsxs("div",{className:"terminal-tile-header",children:[D.jsx("span",{children:C||r.title}),D.jsx("button",{type:"button",className:"terminal-close-btn",onClick:()=>{window.confirm("このターミナルを閉じますか?")&&n()},"aria-label":"ターミナルを閉じる",children:"×"})]}),D.jsx("div",{className:"terminal-tile-body",ref:R})]})}function h1(r){if(r<=1)return{cols:1,rows:1};const i=Math.ceil(Math.sqrt(r)),n=Math.ceil(r/i);return{cols:i,rows:n}}function u1({terminals:r,wsBase:i,activeTerminalId:n,onDeleteTerminal:_,onExitTerminal:p,onTerminalTitle:L}){const{cols:R,rows:o}=h1(r.length),[d,v]=$.useState(()=>typeof window<"u"&&window.matchMedia("(max-width: 720px)").matches);$.useEffect(()=>{const f=window.matchMedia("(max-width: 720px)");v(f.matches);const C=()=>v(f.matches);return f.addEventListener("change",C),()=>f.removeEventListener("change",C)},[]);const y=ip(r,n);return D.jsx("section",{className:"terminal-pane",children:r.length===0?D.jsx("div",{className:"terminal-empty",children:D.jsx("span",{className:"terminal-empty-text",children:"ターミナルを追加"})}):D.jsx("div",{className:Et("terminal-grid",d&&"terminal-grid-mobile"),style:d?void 0:{gridTemplateColumns:`repeat(${R}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${o}, minmax(0, 1fr))`},children:r.map(f=>D.jsx("div",{className:Et("terminal-tile-slot",d&&(f.id===y?"terminal-tile-slot-mobile-active":"terminal-tile-slot-mobile-hidden")),children:D.jsx(c1,{session:f,wsUrl:`${i}/api/terminals/${f.id}`,onDelete:()=>_(f.id),onExit:()=>p(f.id),onTitle:C=>L==null?void 0:L(f.id,C)})},f.id))})})}const d1="ワークスペースがありません。";function f1({workspaces:r,selectedWorkspaceId:i,onSelect:n,onDelete:_}){return D.jsx("div",{className:"w-full grid gap-2",children:r.length===0?D.jsx("div",{className:"flex items-center justify-center text-muted text-[13px] p-8",children:d1}):r.map(p=>D.jsxs("div",{className:Et("flex items-center gap-2 p-4 border border-border rounded bg-panel transition-colors hover:bg-list-hover",p.id===i&&"bg-list-active border-accent"),children:[D.jsxs("button",{type:"button",className:"flex-1 min-w-0 text-left bg-transparent border-0 p-0 cursor-pointer",onClick:()=>n(p.id),children:[D.jsx("div",{className:"font-semibold text-[15px] mb-1",children:p.name}),D.jsx("div",{className:"text-[12px] text-muted font-mono truncate",children:p.path})]}),D.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:L=>{L.stopPropagation(),confirm(`「${p.name}」を削除しますか?`)&&_(p.id)},children:D.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[D.jsx("polyline",{points:"3 6 5 6 21 6"}),D.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"})]})})]},p.id))})}function p1({contextMenu:r,onNewFile:i,onNewFolder:n,onDelete:_}){var p;return D.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:r.x,top:r.y},onClick:L=>L.stopPropagation(),children:[(r.isRoot||((p=r.node)==null?void 0:p.type)==="dir")&&D.jsxs(D.Fragment,{children:[D.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 L;return i(((L=r.node)==null?void 0:L.path)||"",r.node?1:0)},children:"新規ファイル"}),D.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 L;return n(((L=r.node)==null?void 0:L.path)||"",r.node?1:0)},children:"新規フォルダ"})]}),r.node&&!r.isRoot&&D.jsxs(D.Fragment,{children:[r.node.type==="dir"&&D.jsx("div",{className:"h-px my-1 bg-border"}),D.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:()=>_(r.node),children:"削除"})]})]})}const vf="読み込み中...",_1="ファイル",v1="更新",g1="ファイルが見つかりません。",m1="戻る";function y1(r,i){if(!i)return"";const n=i.find(_=>_.path===r||r.endsWith(_.path));return n?`git-tree-${n.status}`:""}const w1=()=>D.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-chevron-icon",children:D.jsx("path",{d:"M9 6l6 6-6 6",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),gf=()=>D.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-svg",children:D.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"})}),mf=()=>D.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-svg",children:[D.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"}),D.jsx("path",{d:"M14 3.5V8h4",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})]});function zp({root:r,entries:i=[],loading:n,error:_,mode:p="tree",canBack:L,onBack:R,onToggleDir:o,onOpenFile:d,onRefresh:v,onCreateFile:y,onCreateDirectory:f,onDeleteFile:C,onDeleteDirectory:b,gitFiles:M}){const[w,c]=$.useState(null),[h,l]=$.useState(null),[u,g]=$.useState(""),S=$.useRef(null),E=$.useRef(null),T=i??[];$.useEffect(()=>{const q=()=>c(null);if(w)return document.addEventListener("click",q),()=>document.removeEventListener("click",q)},[w]),$.useEffect(()=>{h&&S.current&&S.current.focus()},[h]);const k=$.useCallback((q,Y,W=!1)=>{q.preventDefault(),q.stopPropagation();const A=180,I=150,P=Math.min(q.clientX,window.innerWidth-A-4),H=Math.min(q.clientY,window.innerHeight-I-4);c({x:P,y:H,node:Y,isRoot:W})},[]),N=$.useCallback((q,Y)=>{c(null),l({parentPath:q,type:"file",depth:Y}),g("")},[]),V=$.useCallback((q,Y)=>{c(null),l({parentPath:q,type:"dir",depth:Y}),g("")},[]),K=$.useCallback(q=>{c(null),q.type==="dir"?window.confirm(`フォルダ "${q.name}" を削除しますか?
166
+ 中のファイルも全て削除されます。`)&&(b==null||b(q.path)):window.confirm(`ファイル "${q.name}" を削除しますか?`)&&(C==null||C(q.path))},[C,b]),O=$.useCallback(()=>{if(!h||!u.trim()){l(null);return}const q=u.trim();h.type==="file"?y==null||y(h.parentPath,q):f==null||f(h.parentPath,q),l(null),g("")},[h,u,y,f]),B=$.useCallback(q=>{q.key==="Enter"?O():q.key==="Escape"&&l(null)},[O]),U=q=>!h||h.depth!==q?null:D.jsxs("div",{className:"tree-row tree-input-row",style:{paddingLeft:12+q*16},children:[D.jsx("span",{className:"tree-icon","aria-hidden":"true",children:h.type==="dir"?D.jsx(gf,{}):D.jsx(mf,{})}),D.jsx("input",{ref:S,type:"text",className:"tree-input",value:u,onChange:Y=>g(Y.target.value),onKeyDown:B,onBlur:O,placeholder:h.type==="dir"?"フォルダ名":"ファイル名"})]}),z=(q,Y)=>q.map(W=>{const A=W.type==="file"?y1(W.path,M):"";return D.jsxs("div",{children:[D.jsxs("button",{type:"button",className:Et("tree-row",W.type==="dir"&&"is-dir",p==="tree"&&W.expanded&&"is-open",A),style:{paddingLeft:12+Y*16},onClick:()=>W.type==="dir"?o(W):d(W),onContextMenu:I=>k(I,W),"aria-expanded":W.type==="dir"&&p==="tree"?W.expanded:void 0,title:W.path,children:[D.jsx("span",{className:"tree-chevron","aria-hidden":"true",children:W.type==="dir"?D.jsx(w1,{}):null}),D.jsx("span",{className:`tree-icon ${W.type}`,"aria-hidden":"true",children:W.type==="dir"?D.jsx(gf,{}):D.jsx(mf,{})}),D.jsx("span",{className:"tree-label",children:W.name}),W.loading?D.jsx("span",{className:"tree-meta",children:vf}):null]}),p==="tree"&&W.expanded&&W.type==="dir"&&D.jsxs(D.Fragment,{children:[(h==null?void 0:h.parentPath)===W.path&&U(Y+1),W.children&&W.children.length>0&&z(W.children,Y+1)]})]},W.path)});return D.jsxs("section",{className:"panel file-tree",ref:E,children:[D.jsxs("div",{className:"panel-header",children:[D.jsxs("div",{children:[D.jsx("div",{className:"panel-title",children:_1}),D.jsx("div",{className:"panel-subtitle",children:r})]}),D.jsxs("div",{className:"tree-actions",children:[R?D.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:R,disabled:L===!1,children:m1}):null,D.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:v,children:v1})]})]}),D.jsxs("div",{className:"panel-body tree-body",onContextMenu:q=>k(q,null,!0),children:[n?D.jsx("div",{className:"tree-state",children:vf}):null,_?D.jsx("div",{className:"tree-state text-[#f14c4c]",children:_}):null,T.length===0&&!n?D.jsx("div",{className:"tree-state",children:g1}):null,(h==null?void 0:h.parentPath)===""&&U(0),z(T,0)]}),w&&D.jsx(p1,{contextMenu:w,onNewFile:N,onNewFolder:V,onDelete:K})]})}const S1=({isOpen:r,defaultRoot:i,onSubmit:n,onClose:_})=>{const[p,L]=$.useState(""),[R,o]=$.useState([]),[d,v]=$.useState(!1),[y,f]=$.useState(null),[C,b]=$.useState(!1),M=jf(r,_),w=p.trim()||i,c=$.useMemo(()=>w?Od(w)!==w:!1,[w]);$.useEffect(()=>{if(!r){o([]),v(!1),f(null);return}let S=!0;return v(!0),f(null),Md(w,"").then(E=>{S&&(o(oa(E)),v(!1))}).catch(E=>{S&&(f(Ht(E)),v(!1))}),()=>{S=!1}},[r,w]),$.useEffect(()=>{r&&(p.trim()||i&&L(i))},[i,r,p]);const h=()=>{r&&(v(!0),f(null),Md(w,"").then(S=>{o(oa(S)),v(!1)}).catch(S=>{f(Ht(S)),v(!1)}))},l=S=>{if(S.type!=="dir")return;const E=Ng(w,S.name);L(E)},u=()=>{if(!w)return;const S=Od(w);S&&S!==w&&L(S)},g=async S=>{if(S.preventDefault(),!C){b(!0);try{await n(p),L("")}finally{b(!1)}}};return r?D.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:D.jsxs("form",{className:"modal flex flex-col !overflow-hidden",ref:M,onSubmit:g,children:[D.jsx("div",{className:"text-[14px] font-semibold mb-3 shrink-0",id:"workspace-modal-title",children:"ワークスペース追加"}),D.jsxs("label",{className:"grid gap-1 text-xs shrink-0",children:[D.jsx("span",{children:"パス"}),D.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:p,placeholder:i||"",required:!0,maxLength:500,onChange:S=>L(S.target.value)})]}),D.jsx("div",{className:"flex-1 min-h-0 mt-3",children:D.jsx(zp,{root:w,entries:R,loading:d,error:y,mode:"navigator",canBack:c,onBack:u,onToggleDir:l,onOpenFile:()=>{},onRefresh:h})}),D.jsxs("div",{className:"flex justify-end gap-2 mt-4 shrink-0",children:[D.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:_,disabled:C,children:"キャンセル"}),D.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:C,children:C?"追加中...":"追加"})]})]})}):null},C1="ステージ",x1="アンステージ",b1="変更を破棄",E1="差分を表示",k1={modified:"M",staged:"A",untracked:"U",deleted:"D",renamed:"R",conflicted:"C"};function yf({file:r,onStage:i,onUnstage:n,onDiscard:_,onShowDiff:p}){const L=`git-${r.status}`,R=k1[r.status];return D.jsxs("div",{className:"git-file-row",children:[D.jsxs("button",{type:"button",className:"git-file-main",onClick:()=>p(r),title:E1,children:[D.jsx("span",{className:`git-status-badge ${L}`,children:R}),D.jsx("span",{className:"git-file-path",children:r.path})]}),D.jsx("div",{className:"git-file-actions",children:r.staged?D.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>n(r.path),title:x1,children:D.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:D.jsx("path",{d:"M19 13H5v-2h14v2z"})})}):D.jsxs(D.Fragment,{children:[D.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>_(r.path),title:b1,children:D.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:D.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"})})}),D.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>i(r.path),title:C1,children:D.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:D.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})]})})]})}const L1="ステージ済みの変更",R1="変更",T1="コミット",M1="コミットメッセージを入力...",D1="変更はありません",A1="すべてステージ",B1="すべてアンステージ",wf="Push",Sf="Pull",P1="Pushing...",O1="Pulling...";function N1({status:r,branchStatus:i,hasRemote:n,pushing:_,pulling:p,commitMessage:L,onCommitMessageChange:R,onCommit:o,onStageFile:d,onUnstageFile:v,onStageAll:y,onUnstageAll:f,onDiscardFile:C,onShowDiff:b,onPush:M,onPull:w}){const c=r.files.filter(S=>S.staged),h=r.files.filter(S=>!S.staged),l=r.files.length>0,u=c.length>0,g=$.useCallback(S=>{S.key==="Enter"&&(S.ctrlKey||S.metaKey)&&(S.preventDefault(),o())},[o]);return D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:"flex flex-col gap-2 px-3",children:[D.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:M1,value:L,onChange:S=>R(S.target.value),onKeyDown:g,rows:3}),D.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:o,disabled:!u||!L.trim(),children:T1})]}),n&&D.jsxs("div",{className:"flex gap-2 px-3 py-2 border-b border-border",children:[D.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:w,disabled:p||_,title:i!=null&&i.behind?`${i.behind} commits behind`:Sf,children:[D.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24","aria-hidden":"true",children:D.jsx("path",{d:"M12 4v12m0 0l-4-4m4 4l4-4M4 20h16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),p?O1:Sf,i!=null&&i.behind?` (${i.behind})`:""]}),D.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:M,disabled:_||p,title:i!=null&&i.ahead?`${i.ahead} commits ahead`:wf,children:[D.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24","aria-hidden":"true",children:D.jsx("path",{d:"M12 20V8m0 0l4 4m-4-4l-4 4M4 4h16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),_?P1:wf,i!=null&&i.ahead?` (${i.ahead})`:""]})]}),l?D.jsxs(D.Fragment,{children:[c.length>0&&D.jsxs("div",{className:"flex flex-col",children:[D.jsxs("div",{className:"flex items-center justify-between px-3 py-1",children:[D.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted",children:[L1," (",c.length,")"]}),D.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:f,title:B1,children:D.jsx("svg",{className:"w-3.5 h-3.5 fill-current",viewBox:"0 0 24 24","aria-hidden":"true",children:D.jsx("path",{d:"M19 13H5v-2h14v2z"})})})]}),D.jsx("div",{className:"flex flex-col",children:c.map(S=>D.jsx(yf,{file:S,onStage:d,onUnstage:v,onDiscard:C,onShowDiff:b},S.path))})]}),h.length>0&&D.jsxs("div",{className:"flex flex-col",children:[D.jsxs("div",{className:"flex items-center justify-between px-3 py-1",children:[D.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted",children:[R1," (",h.length,")"]}),D.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:y,title:A1,children:D.jsx("svg",{className:"w-3.5 h-3.5 fill-current",viewBox:"0 0 24 24","aria-hidden":"true",children:D.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})]}),D.jsx("div",{className:"flex flex-col",children:h.map(S=>D.jsx(yf,{file:S,onStage:d,onUnstage:v,onDiscard:C,onShowDiff:b},S.path))})]})]}):D.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:D1})]})}const I1="読み込み中...",j1="新規ブランチ",F1="作成",H1="キャンセル";function $1({branches:r,branchesLoading:i,onCheckoutBranch:n,onCreateBranch:_}){const[p,L]=$.useState(!1),[R,o]=$.useState(""),d=$.useCallback(()=>{R.trim()&&(_(R.trim()),o(""),L(!1))},[R,_]),v=$.useCallback(y=>{y.key==="Enter"?(y.preventDefault(),d()):y.key==="Escape"&&(L(!1),o(""))},[d]);return D.jsxs("div",{className:"flex flex-col gap-2",children:[D.jsx("div",{className:"px-3 py-2 border-b border-border",children:p?D.jsxs("div",{className:"flex gap-1.5 items-center",children:[D.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:R,onChange:y=>o(y.target.value),onKeyDown:v,autoFocus:!0}),D.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,disabled:!R.trim(),children:F1}),D.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:()=>{L(!1),o("")},children:H1})]}):D.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:()=>L(!0),children:j1})}),i?D.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:I1}):D.jsx("div",{className:"flex flex-col",children:r.map(y=>D.jsxs("button",{type:"button",className:Et("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",y.current&&"bg-list-active cursor-default"),onClick:()=>!y.current&&n(y.name),disabled:y.current,children:[D.jsxs("svg",{className:"w-4 h-4 flex-shrink-0 text-ink-muted",viewBox:"0 0 24 24","aria-hidden":"true",children:[D.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"}),D.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),D.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono",children:y.name}),y.current&&D.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 bg-accent text-white rounded-[3px]",children:"現在"})]},y.name))})]})}const z1="読み込み中...";function U1({logs:r,logsLoading:i}){return D.jsx("div",{className:"flex flex-col",children:i?D.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:z1}):r.length===0?D.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:"コミット履歴がありません"}):D.jsx("div",{className:"flex flex-col",children:r.map(n=>D.jsxs("div",{className:"flex flex-col gap-0.5 px-3 py-2 border-b border-border hover:bg-list-hover transition-colors",children:[D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsx("span",{className:"font-mono text-xs text-accent font-semibold",children:n.hashShort}),D.jsx("span",{className:"text-xs text-ink-muted",children:n.author})]}),D.jsx("div",{className:"text-[13px] text-ink overflow-hidden text-ellipsis whitespace-nowrap",children:n.message}),D.jsx("div",{className:"text-[11px] text-muted",children:new Date(n.date).toLocaleString()})]},n.hash))})})}const kn="ソースコントロール",W1="Gitリポジトリではありません",V1="ワークスペースを選択してください",K1="読み込み中...",Lc="更新",q1="変更",G1="ブランチ",Y1="履歴",Rc="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",Tc="flex items-center justify-center h-full text-muted text-[13px] p-5";function X1({status:r,loading:i,error:n,workspaceId:_,branchStatus:p,hasRemote:L,pushing:R,pulling:o,branches:d,branchesLoading:v,logs:y,logsLoading:f,repos:C,selectedRepoPath:b,onSelectRepo:M,onRefresh:w,onStageFile:c,onUnstageFile:h,onStageAll:l,onUnstageAll:u,onCommit:g,onDiscardFile:S,onShowDiff:E,onPush:T,onPull:k,onLoadBranches:N,onCheckoutBranch:V,onCreateBranch:K,onLoadLogs:O}){const[B,U]=$.useState(""),[z,q]=$.useState("changes"),Y=$.useCallback(()=>{B.trim()&&(g(B.trim()),U(""))},[B,g]),W=$.useCallback(P=>{q(P),P==="branches"?N():P==="history"&&O()},[N,O]);if(!_)return D.jsxs("section",{className:"panel",children:[D.jsx("div",{className:"panel-header",children:D.jsx("div",{className:"panel-title",children:kn})}),D.jsx("div",{className:"panel-body",children:D.jsx("div",{className:Tc,children:V1})})]});if(i)return D.jsxs("section",{className:"panel",children:[D.jsx("div",{className:"panel-header",children:D.jsx("div",{className:"panel-title",children:kn})}),D.jsx("div",{className:"panel-body",children:D.jsx("div",{className:Tc,children:K1})})]});if(n)return D.jsxs("section",{className:"panel",children:[D.jsxs("div",{className:"panel-header",children:[D.jsx("div",{className:"panel-title",children:kn}),D.jsx("button",{type:"button",className:Rc,onClick:w,children:Lc})]}),D.jsx("div",{className:"panel-body",children:D.jsx("div",{className:"flex items-center justify-center h-full text-[#f14c4c] text-[13px] p-5",children:n})})]});if(!(r!=null&&r.isGitRepo))return D.jsxs("section",{className:"panel",children:[D.jsxs("div",{className:"panel-header",children:[D.jsx("div",{className:"panel-title",children:kn}),D.jsx("button",{type:"button",className:Rc,onClick:w,children:Lc})]}),D.jsx("div",{className:"panel-body",children:D.jsx("div",{className:Tc,children:W1})})]});const A=r.files.length>0,I=C.length>1;return D.jsxs("section",{className:"panel",children:[D.jsxs("div",{className:"panel-header",children:[D.jsxs("div",{children:[D.jsx("div",{className:"panel-title",children:kn}),D.jsxs("div",{className:"panel-subtitle flex items-center gap-1.5",children:[D.jsxs("svg",{viewBox:"0 0 24 24",className:"w-3.5 h-3.5 flex-shrink-0","aria-hidden":"true",children:[D.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"}),D.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),r.branch]})]}),D.jsx("button",{type:"button",className:Rc,onClick:w,children:Lc})]}),I&&D.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border bg-sidebar text-xs",children:[D.jsx("svg",{className:"w-3.5 h-3.5 text-muted flex-shrink-0",viewBox:"0 0 24 24","aria-hidden":"true",children:D.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"})}),D.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:b||"",onChange:P=>M(P.target.value),children:C.map(P=>D.jsxs("option",{value:P.path,children:[P.name," (",P.branch,") ",P.fileCount>0?`• ${P.fileCount}`:""]},P.path))}),D.jsxs("span",{className:"text-[11px] text-muted font-mono flex-shrink-0",children:[C.length," repos"]})]}),D.jsxs("div",{className:"git-tabs",children:[D.jsxs("button",{type:"button",className:Et("git-tab",z==="changes"&&"active"),onClick:()=>W("changes"),children:[q1,A&&D.jsx("span",{className:"text-[10px] font-semibold bg-accent/20 text-accent rounded-full px-1.5 py-0.5 leading-none",children:r.files.length})]}),D.jsx("button",{type:"button",className:Et("git-tab",z==="branches"&&"active"),onClick:()=>W("branches"),children:G1}),D.jsx("button",{type:"button",className:Et("git-tab",z==="history"&&"active"),onClick:()=>W("history"),children:Y1})]}),D.jsxs("div",{className:"panel-body",children:[z==="changes"&&D.jsx(N1,{status:r,branchStatus:p,hasRemote:L,pushing:R,pulling:o,commitMessage:B,onCommitMessageChange:U,onCommit:Y,onStageFile:c,onUnstageFile:h,onStageAll:l,onUnstageAll:u,onDiscardFile:S,onShowDiff:E,onPush:T,onPull:k}),z==="branches"&&D.jsx($1,{branches:d,branchesLoading:v,onCheckoutBranch:V,onCreateBranch:K}),z==="history"&&D.jsx(U1,{logs:y,logsLoading:f})]})]})}function Cf(r,i){(i==null||i>r.length)&&(i=r.length);for(var n=0,_=Array(i);n<i;n++)_[n]=r[n];return _}function J1(r){if(Array.isArray(r))return r}function Q1(r,i,n){return(i=ny(i))in r?Object.defineProperty(r,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[i]=n,r}function Z1(r,i){var n=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(n!=null){var _,p,L,R,o=[],d=!0,v=!1;try{if(L=(n=n.call(r)).next,i!==0)for(;!(d=(_=L.call(n)).done)&&(o.push(_.value),o.length!==i);d=!0);}catch(y){v=!0,p=y}finally{try{if(!d&&n.return!=null&&(R=n.return(),Object(R)!==R))return}finally{if(v)throw p}}return o}}function ey(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
167
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xf(r,i){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(r);i&&(_=_.filter(function(p){return Object.getOwnPropertyDescriptor(r,p).enumerable})),n.push.apply(n,_)}return n}function bf(r){for(var i=1;i<arguments.length;i++){var n=arguments[i]!=null?arguments[i]:{};i%2?xf(Object(n),!0).forEach(function(_){Q1(r,_,n[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):xf(Object(n)).forEach(function(_){Object.defineProperty(r,_,Object.getOwnPropertyDescriptor(n,_))})}return r}function ty(r,i){if(r==null)return{};var n,_,p=ry(r,i);if(Object.getOwnPropertySymbols){var L=Object.getOwnPropertySymbols(r);for(_=0;_<L.length;_++)n=L[_],i.indexOf(n)===-1&&{}.propertyIsEnumerable.call(r,n)&&(p[n]=r[n])}return p}function ry(r,i){if(r==null)return{};var n={};for(var _ in r)if({}.hasOwnProperty.call(r,_)){if(i.indexOf(_)!==-1)continue;n[_]=r[_]}return n}function iy(r,i){return J1(r)||Z1(r,i)||oy(r,i)||ey()}function sy(r,i){if(typeof r!="object"||!r)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var _=n.call(r,i);if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(r)}function ny(r){var i=sy(r,"string");return typeof i=="symbol"?i:i+""}function oy(r,i){if(r){if(typeof r=="string")return Cf(r,i);var n={}.toString.call(r).slice(8,-1);return n==="Object"&&r.constructor&&(n=r.constructor.name),n==="Map"||n==="Set"?Array.from(r):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cf(r,i):void 0}}function ay(r,i,n){return i in r?Object.defineProperty(r,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[i]=n,r}function Ef(r,i){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(r);i&&(_=_.filter(function(p){return Object.getOwnPropertyDescriptor(r,p).enumerable})),n.push.apply(n,_)}return n}function kf(r){for(var i=1;i<arguments.length;i++){var n=arguments[i]!=null?arguments[i]:{};i%2?Ef(Object(n),!0).forEach(function(_){ay(r,_,n[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):Ef(Object(n)).forEach(function(_){Object.defineProperty(r,_,Object.getOwnPropertyDescriptor(n,_))})}return r}function ly(){for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];return function(_){return i.reduceRight(function(p,L){return L(p)},_)}}function Rn(r){return function i(){for(var n=this,_=arguments.length,p=new Array(_),L=0;L<_;L++)p[L]=arguments[L];return p.length>=r.length?r.apply(this,p):function(){for(var R=arguments.length,o=new Array(R),d=0;d<R;d++)o[d]=arguments[d];return i.apply(n,[].concat(p,o))}}}function ha(r){return{}.toString.call(r).includes("Object")}function cy(r){return!Object.keys(r).length}function An(r){return typeof r=="function"}function hy(r,i){return Object.prototype.hasOwnProperty.call(r,i)}function uy(r,i){return ha(i)||Ii("changeType"),Object.keys(i).some(function(n){return!hy(r,n)})&&Ii("changeField"),i}function dy(r){An(r)||Ii("selectorType")}function fy(r){An(r)||ha(r)||Ii("handlerType"),ha(r)&&Object.values(r).some(function(i){return!An(i)})&&Ii("handlersType")}function py(r){r||Ii("initialIsRequired"),ha(r)||Ii("initialType"),cy(r)&&Ii("initialContent")}function _y(r,i){throw new Error(r[i]||r.default)}var vy={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"},Ii=Rn(_y)(vy),Yo={changes:uy,selector:dy,handler:fy,initial:py};function gy(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Yo.initial(r),Yo.handler(i);var n={current:r},_=Rn(wy)(n,i),p=Rn(yy)(n),L=Rn(Yo.changes)(r),R=Rn(my)(n);function o(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(y){return y};return Yo.selector(v),v(n.current)}function d(v){ly(_,p,L,R)(v)}return[o,d]}function my(r,i){return An(i)?i(r.current):i}function yy(r,i){return r.current=kf(kf({},r.current),i),i}function wy(r,i,n){return An(i)?i(r.current):Object.keys(n).forEach(function(_){var p;return(p=i[_])===null||p===void 0?void 0:p.call(i,r.current[_])}),n}var Sy={create:gy},Cy={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function xy(r){return function i(){for(var n=this,_=arguments.length,p=new Array(_),L=0;L<_;L++)p[L]=arguments[L];return p.length>=r.length?r.apply(this,p):function(){for(var R=arguments.length,o=new Array(R),d=0;d<R;d++)o[d]=arguments[d];return i.apply(n,[].concat(p,o))}}}function by(r){return{}.toString.call(r).includes("Object")}function Ey(r){return r||Lf("configIsRequired"),by(r)||Lf("configType"),r.urls?(ky(),{paths:{vs:r.urls.monacoBase}}):r}function ky(){console.warn(Up.deprecation)}function Ly(r,i){throw new Error(r[i]||r.default)}var Up={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!
168
+ You are using deprecated way of configuration.
169
+
170
+ Instead of using
171
+ monaco.config({ urls: { monacoBase: '...' } })
172
+ use
173
+ monaco.config({ paths: { vs: '...' } })
174
+
175
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
176
+ `},Lf=xy(Ly)(Up),Ry={config:Ey},Ty=function(){for(var i=arguments.length,n=new Array(i),_=0;_<i;_++)n[_]=arguments[_];return function(p){return n.reduceRight(function(L,R){return R(L)},p)}};function Wp(r,i){return Object.keys(i).forEach(function(n){i[n]instanceof Object&&r[n]&&Object.assign(i[n],Wp(r[n],i[n]))}),bf(bf({},r),i)}var My={type:"cancelation",msg:"operation is manually canceled"};function Mc(r){var i=!1,n=new Promise(function(_,p){r.then(function(L){return i?p(My):_(L)}),r.catch(p)});return n.cancel=function(){return i=!0},n}var Dy=["monaco"],Ay=Sy.create({config:Cy,isInitialized:!1,resolve:null,reject:null,monaco:null}),Vp=iy(Ay,2),Pn=Vp[0],da=Vp[1];function By(r){var i=Ry.config(r),n=i.monaco,_=ty(i,Dy);da(function(p){return{config:Wp(p.config,_),monaco:n}})}function Py(){var r=Pn(function(i){var n=i.monaco,_=i.isInitialized,p=i.resolve;return{monaco:n,isInitialized:_,resolve:p}});if(!r.isInitialized){if(da({isInitialized:!0}),r.monaco)return r.resolve(r.monaco),Mc(Dc);if(window.monaco&&window.monaco.editor)return Kp(window.monaco),r.resolve(window.monaco),Mc(Dc);Ty(Oy,Iy)(jy)}return Mc(Dc)}function Oy(r){return document.body.appendChild(r)}function Ny(r){var i=document.createElement("script");return r&&(i.src=r),i}function Iy(r){var i=Pn(function(_){var p=_.config,L=_.reject;return{config:p,reject:L}}),n=Ny("".concat(i.config.paths.vs,"/loader.js"));return n.onload=function(){return r()},n.onerror=i.reject,n}function jy(){var r=Pn(function(n){var _=n.config,p=n.resolve,L=n.reject;return{config:_,resolve:p,reject:L}}),i=window.require;i.config(r.config),i(["vs/editor/editor.main"],function(n){var _=n.m||n;Kp(_),r.resolve(_)},function(n){r.reject(n)})}function Kp(r){Pn().monaco||da({monaco:r})}function Fy(){return Pn(function(r){var i=r.monaco;return i})}var Dc=new Promise(function(r,i){return da({resolve:r,reject:i})}),qp={config:By,init:Py,__getMonacoInstance:Fy},Hy={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Ac=Hy,$y={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},zy=$y;function Uy({children:r}){return es.createElement("div",{style:zy.container},r)}var Wy=Uy,Vy=Wy;function Ky({width:r,height:i,isEditorReady:n,loading:_,_ref:p,className:L,wrapperProps:R}){return es.createElement("section",{style:{...Ac.wrapper,width:r,height:i},...R},!n&&es.createElement(Vy,null,_),es.createElement("div",{ref:p,style:{...Ac.fullWidth,...!n&&Ac.hide},className:L}))}var qy=Ky,Gp=$.memo(qy);function Gy(r){$.useEffect(r,[])}var Yp=Gy;function Yy(r,i,n=!0){let _=$.useRef(!0);$.useEffect(_.current||!n?()=>{_.current=!1}:r,i)}var Sr=Yy;function Mn(){}function Ns(r,i,n,_){return Xy(r,_)||Jy(r,i,n,_)}function Xy(r,i){return r.editor.getModel(Xp(r,i))}function Jy(r,i,n,_){return r.editor.createModel(i,n,_?Xp(r,_):void 0)}function Xp(r,i){return r.Uri.parse(i)}function Qy({original:r,modified:i,language:n,originalLanguage:_,modifiedLanguage:p,originalModelPath:L,modifiedModelPath:R,keepCurrentOriginalModel:o=!1,keepCurrentModifiedModel:d=!1,theme:v="light",loading:y="Loading...",options:f={},height:C="100%",width:b="100%",className:M,wrapperProps:w={},beforeMount:c=Mn,onMount:h=Mn}){let[l,u]=$.useState(!1),[g,S]=$.useState(!0),E=$.useRef(null),T=$.useRef(null),k=$.useRef(null),N=$.useRef(h),V=$.useRef(c),K=$.useRef(!1);Yp(()=>{let z=qp.init();return z.then(q=>(T.current=q)&&S(!1)).catch(q=>(q==null?void 0:q.type)!=="cancelation"&&console.error("Monaco initialization: error:",q)),()=>E.current?U():z.cancel()}),Sr(()=>{if(E.current&&T.current){let z=E.current.getOriginalEditor(),q=Ns(T.current,r||"",_||n||"text",L||"");q!==z.getModel()&&z.setModel(q)}},[L],l),Sr(()=>{if(E.current&&T.current){let z=E.current.getModifiedEditor(),q=Ns(T.current,i||"",p||n||"text",R||"");q!==z.getModel()&&z.setModel(q)}},[R],l),Sr(()=>{let z=E.current.getModifiedEditor();z.getOption(T.current.editor.EditorOption.readOnly)?z.setValue(i||""):i!==z.getValue()&&(z.executeEdits("",[{range:z.getModel().getFullModelRange(),text:i||"",forceMoveMarkers:!0}]),z.pushUndoStop())},[i],l),Sr(()=>{var z,q;(q=(z=E.current)==null?void 0:z.getModel())==null||q.original.setValue(r||"")},[r],l),Sr(()=>{let{original:z,modified:q}=E.current.getModel();T.current.editor.setModelLanguage(z,_||n||"text"),T.current.editor.setModelLanguage(q,p||n||"text")},[n,_,p],l),Sr(()=>{var z;(z=T.current)==null||z.editor.setTheme(v)},[v],l),Sr(()=>{var z;(z=E.current)==null||z.updateOptions(f)},[f],l);let O=$.useCallback(()=>{var Y;if(!T.current)return;V.current(T.current);let z=Ns(T.current,r||"",_||n||"text",L||""),q=Ns(T.current,i||"",p||n||"text",R||"");(Y=E.current)==null||Y.setModel({original:z,modified:q})},[n,i,p,r,_,L,R]),B=$.useCallback(()=>{var z;!K.current&&k.current&&(E.current=T.current.editor.createDiffEditor(k.current,{automaticLayout:!0,...f}),O(),(z=T.current)==null||z.editor.setTheme(v),u(!0),K.current=!0)},[f,v,O]);$.useEffect(()=>{l&&N.current(E.current,T.current)},[l]),$.useEffect(()=>{!g&&!l&&B()},[g,l,B]);function U(){var q,Y,W,A;let z=(q=E.current)==null?void 0:q.getModel();o||((Y=z==null?void 0:z.original)==null||Y.dispose()),d||((W=z==null?void 0:z.modified)==null||W.dispose()),(A=E.current)==null||A.dispose()}return es.createElement(Gp,{width:b,height:C,isEditorReady:l,loading:y,_ref:k,className:M,wrapperProps:w})}var Zy=Qy,ew=$.memo(Zy);function tw(r){let i=$.useRef();return $.useEffect(()=>{i.current=r},[r]),i.current}var rw=tw,Xo=new Map;function iw({defaultValue:r,defaultLanguage:i,defaultPath:n,value:_,language:p,path:L,theme:R="light",line:o,loading:d="Loading...",options:v={},overrideServices:y={},saveViewState:f=!0,keepCurrentModel:C=!1,width:b="100%",height:M="100%",className:w,wrapperProps:c={},beforeMount:h=Mn,onMount:l=Mn,onChange:u,onValidate:g=Mn}){let[S,E]=$.useState(!1),[T,k]=$.useState(!0),N=$.useRef(null),V=$.useRef(null),K=$.useRef(null),O=$.useRef(l),B=$.useRef(h),U=$.useRef(),z=$.useRef(_),q=rw(L),Y=$.useRef(!1),W=$.useRef(!1);Yp(()=>{let P=qp.init();return P.then(H=>(N.current=H)&&k(!1)).catch(H=>(H==null?void 0:H.type)!=="cancelation"&&console.error("Monaco initialization: error:",H)),()=>V.current?I():P.cancel()}),Sr(()=>{var H,J,ie,ae;let P=Ns(N.current,r||_||"",i||p||"",L||n||"");P!==((H=V.current)==null?void 0:H.getModel())&&(f&&Xo.set(q,(J=V.current)==null?void 0:J.saveViewState()),(ie=V.current)==null||ie.setModel(P),f&&((ae=V.current)==null||ae.restoreViewState(Xo.get(L))))},[L],S),Sr(()=>{var P;(P=V.current)==null||P.updateOptions(v)},[v],S),Sr(()=>{!V.current||_===void 0||(V.current.getOption(N.current.editor.EditorOption.readOnly)?V.current.setValue(_):_!==V.current.getValue()&&(W.current=!0,V.current.executeEdits("",[{range:V.current.getModel().getFullModelRange(),text:_,forceMoveMarkers:!0}]),V.current.pushUndoStop(),W.current=!1))},[_],S),Sr(()=>{var H,J;let P=(H=V.current)==null?void 0:H.getModel();P&&p&&((J=N.current)==null||J.editor.setModelLanguage(P,p))},[p],S),Sr(()=>{var P;o!==void 0&&((P=V.current)==null||P.revealLine(o))},[o],S),Sr(()=>{var P;(P=N.current)==null||P.editor.setTheme(R)},[R],S);let A=$.useCallback(()=>{var P;if(!(!K.current||!N.current)&&!Y.current){B.current(N.current);let H=L||n,J=Ns(N.current,_||r||"",i||p||"",H||"");V.current=(P=N.current)==null?void 0:P.editor.create(K.current,{model:J,automaticLayout:!0,...v},y),f&&V.current.restoreViewState(Xo.get(H)),N.current.editor.setTheme(R),o!==void 0&&V.current.revealLine(o),E(!0),Y.current=!0}},[r,i,n,_,p,L,v,y,f,R,o]);$.useEffect(()=>{S&&O.current(V.current,N.current)},[S]),$.useEffect(()=>{!T&&!S&&A()},[T,S,A]),z.current=_,$.useEffect(()=>{var P,H;S&&u&&((P=U.current)==null||P.dispose(),U.current=(H=V.current)==null?void 0:H.onDidChangeModelContent(J=>{W.current||u(V.current.getValue(),J)}))},[S,u]),$.useEffect(()=>{if(S){let P=N.current.editor.onDidChangeMarkers(H=>{var ie;let J=(ie=V.current.getModel())==null?void 0:ie.uri;if(J&&H.find(ae=>ae.path===J.path)){let ae=N.current.editor.getModelMarkers({resource:J});g==null||g(ae)}});return()=>{P==null||P.dispose()}}return()=>{}},[S,g]);function I(){var P,H;(P=U.current)==null||P.dispose(),C?f&&Xo.set(L,V.current.saveViewState()):(H=V.current.getModel())==null||H.dispose(),V.current.dispose()}return es.createElement(Gp,{width:b,height:M,isEditorReady:S,loading:d,_ref:K,className:w,wrapperProps:c})}var sw=iw,nw=$.memo(sw),ow=nw;const Rf="ファイルを選択してください",aw="vs-dark",lw="vs";function cw(r){var _;const i=((_=r.split(".").pop())==null?void 0:_.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"}}[i]||{icon:"📄",color:"var(--ink-muted)"}}function hw(r){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"}[r]||r}function uw({files:r,activeFileId:i,onSelectFile:n,onCloseFile:_,onChangeFile:p,onSaveFile:L,savingFileId:R,theme:o}){const d=r.find(w=>w.id===i),v=$.useRef(null),[y,f]=$.useState({line:1,column:1}),C=$.useCallback(w=>{v.current=w,w.onDidChangeCursorPosition(c=>{f({line:c.position.lineNumber,column:c.position.column})})},[]);$.useEffect(()=>{const w=c=>{!i||!((c.ctrlKey||c.metaKey)&&c.key.toLowerCase()==="s")||(c.preventDefault(),L==null||L(i))};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[i,L]);const b=(w,c)=>{w.stopPropagation(),_(c)},M=(w,c)=>{w.button===1&&(w.preventDefault(),_(c))};return r.length===0?D.jsx("div",{className:"editor-container editor-empty",children:D.jsxs("div",{className:"editor-welcome",children:[D.jsx("div",{className:"editor-welcome-icon",children:D.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[D.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"}),D.jsx("polyline",{points:"13 2 13 9 20 9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),D.jsx("div",{className:"editor-welcome-text",children:Rf}),D.jsx("div",{className:"editor-welcome-hint",children:"左のファイルツリーからファイルを選択"})]})}):D.jsxs("div",{className:"editor-container",children:[D.jsx("div",{className:"editor-tabs",children:D.jsx("div",{className:"editor-tabs-list",children:r.map(w=>{const{icon:c,color:h}=cw(w.name),l=w.id===i,u=R===w.id;return D.jsxs("div",{className:Et("editor-tab",l&&"active",w.dirty&&"dirty"),onClick:()=>n(w.id),onMouseDown:g=>M(g,w.id),role:"tab","aria-selected":l,tabIndex:0,children:[D.jsx("span",{className:"editor-tab-icon",style:{color:h},children:c}),D.jsx("span",{className:"editor-tab-name",children:w.name}),w.dirty&&!u&&D.jsx("span",{className:"editor-tab-dirty","aria-label":"未保存",children:"●"}),u&&D.jsx("span",{className:"editor-tab-saving","aria-label":"保存中",children:D.jsx("svg",{viewBox:"0 0 24 24",className:"spin",children:D.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeDasharray:"30 70"})})}),D.jsx("button",{type:"button",className:"editor-tab-close",onClick:g=>b(g,w.id),"aria-label":"閉じる",children:D.jsx("svg",{viewBox:"0 0 24 24",children:D.jsx("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]},w.id)})})}),d&&D.jsx("div",{className:"editor-breadcrumb",children:D.jsx("span",{className:"editor-breadcrumb-path",children:d.path})}),D.jsx("div",{className:"editor-content",children:d?D.jsx(ow,{height:"100%",theme:o==="dark"?aw:lw,language:d.language,value:d.contents,onChange:w=>p(d.id,w??""),onMount:C,options:{fontFamily:zf,fontSize:Uf,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}}}):D.jsx("div",{className:"editor-no-file",children:D.jsx("span",{children:Rf})})}),d&&D.jsxs("div",{className:"editor-statusbar",children:[D.jsx("div",{className:"editor-statusbar-left",children:D.jsxs("span",{className:"editor-status-item",children:[D.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[D.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"}),D.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),"main"]})}),D.jsxs("div",{className:"editor-statusbar-right",children:[D.jsxs("span",{className:"editor-status-item",children:["Ln ",y.line,", Col ",y.column]}),D.jsx("span",{className:"editor-status-item",children:"UTF-8"}),D.jsx("span",{className:"editor-status-item",children:hw(d.language)})]})]})]})}const dw="差分ビューア",fw="読み込み中...",pw="閉じる",_w="vs-dark",vw="vs";function gw({diff:r,loading:i,theme:n,onClose:_}){const p=r?sp(r.path):"plaintext";return D.jsxs("div",{className:"fixed inset-0 bg-bg z-50 grid grid-rows-[35px_minmax(0,1fr)]",children:[D.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 bg-title-bar border-b border-border",children:[D.jsxs("div",{children:[D.jsx("div",{className:"text-[13px] font-medium",children:dw}),r&&D.jsx("div",{className:"text-xs text-muted font-mono",children:r.path})]}),D.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:_,children:pw})]}),D.jsx("div",{className:"min-h-0 overflow-hidden",children:i?D.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:fw}):r?D.jsx(ew,{height:"100%",theme:n==="dark"?_w:vw,language:p,original:r.original,modified:r.modified,options:{fontFamily:zf,fontSize:Uf,readOnly:!0,renderSideBySide:!0,minimap:{enabled:!1},smoothScrolling:!0}}):null})]})}function mw({activeWorkspace:r,defaultRoot:i,activeWorkspaceState:n,editorWorkspaceId:_,gitState:p,theme:L,savingFileId:R,onCloseWorkspaceEditor:o,onToggleDir:d,onOpenFile:v,onRefreshTree:y,onCreateFile:f,onCreateDirectory:C,onDeleteFile:b,onDeleteDirectory:M,onRefreshGit:w,onSelectRepo:c,onStageFile:h,onUnstageFile:l,onStageAll:u,onUnstageAll:g,onCommit:S,onDiscardFile:E,onShowDiff:T,onCloseDiff:k,onPush:N,onPull:V,onLoadBranches:K,onCheckoutBranch:O,onCreateBranch:B,onLoadLogs:U,onSelectFile:z,onCloseFile:q,onChangeFile:Y,onSaveFile:W}){var ae,ue;const[A,I]=$.useState(!1),[P,H]=$.useState("files"),J=$.useCallback(X=>{v(X),I(!1)},[v]),ie=((ae=p.status)==null?void 0:ae.files.length)??0;return D.jsxs("div",{className:Et("workspace-editor-overlay",A&&"drawer-open"),children:[D.jsxs("div",{className:"workspace-editor-header",children:[D.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:o,children:"一覧に戻る"}),D.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:()=>I(X=>!X),"aria-label":"\\u30b5\\u30a4\\u30c9\\u30d0\\u30fc",children:D.jsx("svg",{viewBox:"0 0 24 24",width:"18",height:"18","aria-hidden":"true",children:D.jsx("path",{d:"M3 12h18M3 6h18M3 18h18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}),D.jsx("div",{className:"workspace-meta",children:r?r.path:null})]}),D.jsxs("div",{className:"workspace-editor-grid",children:[D.jsxs("div",{className:"activity-bar",children:[D.jsx("button",{type:"button",className:Et("activity-bar-item",P==="files"&&"active"),onClick:()=>H("files"),title:"エクスプローラー",children:D.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:D.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"})})}),D.jsxs("button",{type:"button",className:Et("activity-bar-item",P==="git"&&"active"),onClick:()=>{H("git"),w()},title:"ソースコントロール",children:[D.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[D.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"}),D.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]}),ie>0&&D.jsx("span",{className:"activity-bar-badge",children:ie})]})]}),D.jsx("div",{className:"sidebar-panel",children:D.jsx("div",{className:"sidebar-content",children:P==="files"?D.jsx(zp,{root:(r==null?void 0:r.path)||i||"",entries:n.tree,loading:n.treeLoading,error:n.treeError,onToggleDir:d,onOpenFile:J,onRefresh:y,onCreateFile:f,onCreateDirectory:C,onDeleteFile:b,onDeleteDirectory:M,gitFiles:(ue=p.status)==null?void 0:ue.files}):D.jsx(X1,{status:p.status,loading:p.loading,error:p.error,workspaceId:_,branchStatus:p.branchStatus,hasRemote:p.hasRemote,pushing:p.pushing,pulling:p.pulling,branches:p.branches,branchesLoading:p.branchesLoading,logs:p.logs,logsLoading:p.logsLoading,repos:p.repos,selectedRepoPath:p.selectedRepoPath,onSelectRepo:c,onRefresh:w,onStageFile:h,onUnstageFile:l,onStageAll:u,onUnstageAll:g,onCommit:S,onDiscardFile:E,onShowDiff:T,onPush:N,onPull:V,onLoadBranches:K,onCheckoutBranch:O,onCreateBranch:B,onLoadLogs:U})})}),D.jsx(uw,{files:n.files,activeFileId:n.activeFileId,onSelectFile:z,onCloseFile:q,onChangeFile:Y,onSaveFile:W,savingFileId:R,theme:L})]}),D.jsx("div",{className:"sidebar-overlay",onClick:()=>I(!1),"aria-hidden":"true"}),p.diffPath&&D.jsx(gw,{diff:p.diff,loading:p.diffLoading,theme:L,onClose:k})]})}function yw({terminals:r,liveTitles:i,value:n,onChange:_}){const[p,L]=$.useState(null),R=$.useCallback(()=>{const d={};for(const v of r)d[v.id]=i[v.id]||v.title;L(d)},[r,i]),o=d=>(p?p[d.id]:i[d.id]||d.title)||d.title;return D.jsx("select",{className:"terminal-switcher",value:n,onPointerDown:R,onFocus:R,onKeyDown:R,onChange:d=>{_(d.target.value),L(null)},onBlur:()=>L(null),"aria-label":"ターミナルを切り替え",children:r.map(d=>D.jsx("option",{value:d.id,children:o(d)},d.id))})}function Jp(){const[r,i]=$.useState(Ig);$.useEffect(()=>{if(!(typeof document>"u")){document.documentElement.dataset.theme=r;try{window.localStorage.setItem(Vf,r)}catch{}}},[r]);const n=$.useCallback(()=>{i(_=>_==="dark"?"light":"dark")},[]);return{theme:r,handleToggleTheme:n}}function ww(r){const i=r.lastIndexOf("/");return i<=0?"":r.slice(0,i)}function Tf(r,i){return r?`${r}/${i}`:i}function Mf(r){var n;if(r.type==="dir")return"📁";const i=((n=r.name.split(".").pop())==null?void 0:n.toLowerCase())??"";return["png","jpg","jpeg","gif","webp","svg","ico"].includes(i)?"🖼️":["md","txt","rst"].includes(i)?"📄":["ts","tsx","js","jsx","json","py","go","rs","c","cpp","java","sh"].includes(i)?"📜":["zip","tar","gz","tgz"].includes(i)?"🗜️":"📄"}function Sw({workspaceId:r,workspacePath:i,onOpenInEditor:n,onStatus:_}){const[p,L]=$.useState(""),[R,o]=$.useState([]),[d,v]=$.useState(!1),[y,f]=$.useState(null),[C,b]=$.useState("grid"),[M,w]=$.useState(""),[c,h]=$.useState(!1),l=$.useRef(null),u=$.useCallback(async O=>{v(!0),f(null);try{const B=await Pc(r,O);o(B)}catch(B){f(B instanceof Error?B.message:"Failed to list files")}finally{v(!1)}},[r]);$.useEffect(()=>{u(p)},[u,p]);const g=$.useMemo(()=>{const O=p?p.split("/"):[],B=[{label:"/",path:""}];let U="";for(const z of O)U=U?`${U}/${z}`:z,B.push({label:z,path:U});return B},[p]),S=$.useMemo(()=>{const O=M.trim().toLowerCase();return O?R.filter(U=>U.name.toLowerCase().includes(O)):R},[R,M]),E=$.useCallback(O=>{O.type==="dir"?L(O.path):n(O.path)},[n]),T=$.useCallback(async()=>{const O=window.prompt("新しいフォルダ名");if(O)try{await Yf(r,Tf(p,O)),_==null||_(`フォルダを作成しました: ${O}`),u(p)}catch(B){f(B instanceof Error?B.message:"Failed to create folder")}},[r,p,u,_]),k=$.useCallback(async O=>{const B=window.prompt("新しい名前",O.name);if(!(!B||B===O.name))try{await lg(r,O.path,Tf(ww(O.path),B)),_==null||_(`名前を変更しました: ${O.name} → ${B}`),u(p)}catch(U){f(U instanceof Error?U.message:"Failed to rename")}},[r,p,u,_]),N=$.useCallback(async O=>{if(window.confirm(`「${O.name}」を削除しますか?`))try{O.type==="dir"?await Xf(r,O.path):await Gf(r,O.path),_==null||_(`削除しました: ${O.name}`),u(p)}catch(B){f(B instanceof Error?B.message:"Failed to delete")}},[r,p,u,_]),V=$.useCallback(async O=>{if(O.length!==0)try{const B=await cg(r,p,O);_==null||_(`${B.uploaded.length} 件アップロードしました`),u(p)}catch(B){f(B instanceof Error?B.message:"Upload failed")}},[r,p,u,_]),K=$.useCallback(O=>{O.preventDefault(),h(!1);const B=Array.from(O.dataTransfer.files||[]);V(B)},[V]);return D.jsxs("div",{className:"drive-browser flex flex-col h-full min-h-0",children:[D.jsxs("div",{className:"drive-toolbar flex items-center gap-2 px-3 py-2 border-b border-border flex-wrap",children:[D.jsx("nav",{className:"flex items-center gap-1 text-[13px] min-w-0 overflow-hidden",children:g.map((O,B)=>D.jsxs("span",{className:"flex items-center gap-1 min-w-0",children:[B>0&&D.jsx("span",{className:"text-muted",children:"/"}),D.jsx("button",{type:"button",className:"px-1 py-0.5 rounded hover:bg-list-hover text-ink-muted hover:text-ink truncate max-w-[160px]",onClick:()=>L(O.path),title:O.label,children:B===0?i.split("/").pop()||"/":O.label})]},O.path))}),D.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[D.jsx("input",{className:"browser-address-input max-w-[180px]",value:M,onChange:O=>w(O.target.value),placeholder:"検索",spellCheck:!1}),D.jsx("button",{type:"button",className:"topbar-btn-sm",title:"表示切替",onClick:()=>b(O=>O==="grid"?"list":"grid"),children:C==="grid"?"≣":"▦"}),D.jsx("button",{type:"button",className:"topbar-btn-sm",title:"再読み込み",onClick:()=>void u(p),children:"⟳"}),D.jsx("button",{type:"button",className:"topbar-btn-sm",title:"新しいフォルダ",onClick:T,children:"+"}),D.jsx("button",{type:"button",className:"topbar-btn-sm",title:"アップロード",onClick:()=>{var O;return(O=l.current)==null?void 0:O.click()},children:"⤓"}),D.jsx("button",{type:"button",className:"topbar-btn-sm topbar-btn-claude",title:"VS Codeで開く",onClick:()=>n(),children:"</>"}),D.jsx("input",{ref:l,type:"file",multiple:!0,className:"hidden",onChange:O=>{V(Array.from(O.target.files||[])),O.target.value=""}})]})]}),y&&D.jsx("div",{className:"browser-error",children:y}),D.jsx("div",{className:Et("drive-body flex-1 min-h-0 overflow-auto p-3",c&&"drive-drag-active"),onDragOver:O=>{O.preventDefault(),h(!0)},onDragLeave:O=>{O.currentTarget.contains(O.relatedTarget)||h(!1)},onDrop:K,children:d?D.jsx("div",{className:"text-muted text-[13px] p-4",children:"読み込み中…"}):S.length===0?D.jsx("div",{className:"text-muted text-[13px] p-4",children:M?"一致するものがありません":"このフォルダは空です(ファイルをドロップでアップロード)"}):C==="grid"?D.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:"repeat(auto-fill, minmax(120px, 1fr))"},children:S.map(O=>D.jsxs("div",{className:"drive-card flex flex-col items-center gap-1 p-3 rounded border border-border hover:bg-list-hover cursor-pointer relative group",onDoubleClick:()=>E(O),title:O.name,children:[D.jsx("div",{className:"text-[32px] leading-none",children:Mf(O)}),D.jsx("div",{className:"text-[12px] text-ink text-center truncate w-full",children:O.name}),D.jsxs("div",{className:"absolute top-1 right-1 hidden group-hover:flex gap-0.5",children:[D.jsx("button",{type:"button",className:"drive-mini-btn",title:"名前変更",onClick:B=>{B.stopPropagation(),k(O)},children:"✎"}),D.jsx("button",{type:"button",className:"drive-mini-btn",title:"削除",onClick:B=>{B.stopPropagation(),N(O)},children:"🗑"})]})]},O.path))}):D.jsx("div",{className:"flex flex-col",children:S.map(O=>D.jsxs("div",{className:"drive-row flex items-center gap-2 px-2 py-1.5 rounded hover:bg-list-hover cursor-pointer group",onDoubleClick:()=>E(O),children:[D.jsx("span",{className:"text-[16px]",children:Mf(O)}),D.jsx("span",{className:"text-[13px] text-ink flex-1 truncate",children:O.name}),D.jsx("span",{className:"text-[11px] text-muted",children:O.type==="dir"?"フォルダ":"ファイル"}),D.jsxs("span",{className:"hidden group-hover:flex gap-1",children:[D.jsx("button",{type:"button",className:"drive-mini-btn",title:"名前変更",onClick:B=>{B.stopPropagation(),k(O)},children:"✎"}),D.jsx("button",{type:"button",className:"drive-mini-btn",title:"削除",onClick:B=>{B.stopPropagation(),N(O)},children:"🗑"})]})]},O.path))})})]})}function Cw(r){const[i,n]=$.useState(null);return $.useEffect(()=>{if(!r){n(null);return}let _=!0;return fetch(`/codeserver/status?wsId=${encodeURIComponent(r)}`,{credentials:"include"}).then(p=>p.ok?p.json():null).then(p=>{_&&p&&n(p)}).catch(()=>{}),()=>{_=!1}},[r]),i}function xw({wsId:r,folderPath:i}){const n=Cw(r),_=$.useMemo(()=>`/codeserver/${r}/?folder=${encodeURIComponent(i)}`,[r,i]);return n&&!n.acquired?D.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 text-center p-6 text-muted",children:[D.jsx("div",{className:"text-[15px] font-semibold text-ink",children:"VS Code (code-server) は未インストールです"}),D.jsx("div",{className:"text-[13px]",children:"サーバで次を実行してください:"}),D.jsx("code",{className:"bg-list-hover px-2 py-1 rounded text-[13px]",children:"deckide codeserver install"})]}):D.jsx("iframe",{className:"code-server-frame",src:_,title:"VS Code",style:{width:"100%",height:"100%",border:0,display:"block",background:"#1e1e1e"},allow:"clipboard-read; clipboard-write"})}function bw({wsBase:r}){const{theme:i,handleToggleTheme:n}=Jp(),[_,p]=$.useState([]),[L,R]=$.useState(null),[o,d]=$.useState([]),[v,y]=$.useState(!1),[f,C]=$.useState("drive"),[b,M]=$.useState("");$.useEffect(()=>{let S=!0;return qf().then(E=>{S&&(p(E),R(T=>{var k;return T??((k=E[0])==null?void 0:k.id)??null}))}).catch(()=>{}),()=>{S=!1}},[]);const w=$.useMemo(()=>_.find(S=>S.id===L)??null,[_,L]),c=$.useMemo(()=>new Map(_.map(S=>[S.id,S])),[_]),h=$.useCallback(()=>{L&&(d(S=>S.includes(L)?S:[...S,L]),C(`code:${L}`))},[L]),l=$.useCallback(S=>{d(E=>E.filter(T=>T!==S)),C(E=>E===`code:${S}`?"drive":E),fetch(`/codeserver/stop?wsId=${encodeURIComponent(S)}`,{method:"POST",credentials:"include"}).catch(()=>{})},[]),u=$.useCallback(S=>{R(S),C("drive")},[]),g=$.useMemo(()=>{var E;const S=[{id:"drive",label:w?w.name:"Drive",closeable:!1}];for(const T of o)S.push({id:`code:${T}`,label:`</> ${((E=c.get(T))==null?void 0:E.name)??T}`,closeable:!0});return v&&S.push({id:"browser",label:"◷ Browser",closeable:!0}),S},[w,o,v,c]);return D.jsxs("div",{className:"drive-shell flex h-full min-h-0","data-theme":i,children:[D.jsxs("aside",{className:"drive-rail flex flex-col w-[220px] flex-shrink-0 border-r border-border bg-sidebar min-h-0",children:[D.jsx("div",{className:"px-3 py-2.5 text-[13px] font-semibold text-ink border-b border-border",children:"Deck Drive"}),D.jsxs("div",{className:"flex-1 min-h-0 overflow-auto py-2",children:[D.jsx("div",{className:"px-3 py-1 text-[11px] uppercase tracking-wide text-muted",children:"Workspaces"}),_.map(S=>D.jsxs("button",{type:"button",className:Et("w-full text-left px-3 py-1.5 text-[13px] truncate hover:bg-list-hover",S.id===L?"text-ink bg-list-hover font-medium":"text-ink-muted"),onClick:()=>u(S.id),title:S.path,children:["📁 ",S.name]},S.id)),_.length===0&&D.jsx("div",{className:"px-3 py-2 text-[12px] text-muted",children:"ワークスペースがありません"}),D.jsx("div",{className:"px-3 py-1 mt-3 text-[11px] uppercase tracking-wide text-muted",children:"Open Items"}),o.map(S=>{var E;return D.jsxs("div",{className:"flex items-center px-3 py-1 text-[12px] text-ink-muted",children:[D.jsxs("button",{type:"button",className:"flex-1 text-left truncate hover:text-ink",onClick:()=>C(`code:${S}`),children:["</>"," ",((E=c.get(S))==null?void 0:E.name)??S]}),D.jsx("button",{type:"button",className:"drive-mini-btn",title:"停止",onClick:()=>l(S),children:"×"})]},S)}),D.jsx("button",{type:"button",className:Et("w-full text-left px-3 py-1 text-[12px] hover:text-ink",v?"text-ink":"text-ink-muted"),onClick:()=>{y(!0),C("browser")},children:"◷ Agent Browser"})]}),D.jsx("div",{className:"border-t border-border px-3 py-2 flex items-center gap-2",children:D.jsx("button",{type:"button",className:"topbar-btn-sm",title:"テーマ切替",onClick:n,children:"◐"})})]}),D.jsxs("main",{className:"flex flex-col flex-1 min-h-0",children:[D.jsx("div",{className:"drive-tabstrip flex items-center gap-1 px-2 border-b border-border bg-sidebar overflow-x-auto flex-shrink-0 min-h-[36px]",children:g.map(S=>D.jsxs("button",{type:"button",className:Et("drive-tab flex items-center gap-1 px-3 py-1.5 text-[13px] whitespace-nowrap",f===S.id?"text-ink border-b-2 border-accent":"text-ink-muted"),onClick:()=>C(S.id),children:[D.jsx("span",{className:"truncate max-w-[160px]",children:S.label}),S.closeable&&D.jsx("span",{role:"button","aria-label":"閉じる",className:"ml-1 text-muted hover:text-ink",onClick:E=>{E.stopPropagation(),S.id.startsWith("code:")?l(S.id.slice(5)):S.id==="browser"&&(y(!1),C("drive"))},children:"×"})]},S.id))}),D.jsxs("div",{className:"flex-1 min-h-0 relative",children:[D.jsx("div",{className:"absolute inset-0",style:{display:f==="drive"?"block":"none"},children:w?D.jsx(Sw,{workspaceId:w.id,workspacePath:w.path,onOpenInEditor:h,onStatus:M},w.id):D.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px]",children:"左でワークスペースを選択してください"})}),o.map(S=>{const E=c.get(S);return E?D.jsx("div",{className:"absolute inset-0",style:{display:f===`code:${S}`?"block":"none"},children:D.jsx(xw,{wsId:S,folderPath:E.path})},S):null}),v&&D.jsx("div",{className:"absolute inset-0",style:{display:f==="browser"?"block":"none"},children:D.jsx(rp,{wsBase:r})})]})]}),D.jsx(Ff,{message:b})]})}const Ew="設定",kw="サーバー設定",Lw="ポート番号",Rw="Basic認証",Tw="Basic認証を有効にする",Mw="ユーザー名",Dw="パスワード",Aw="※ 12文字以上推奨",Bw="キャンセル",Pw="保存",Ow="※ 設定を保存すると、サーバーが再起動されます",Nw="WebSocket設定",Iw="接続数上限 (IP毎)",jw="現在の接続数",Fw="全接続をクリア",Hw="適用",Jo="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 $w({isOpen:r,onClose:i,onSave:n}){const[_,p]=$.useState(8787),[L,R]=$.useState(!1),[o,d]=$.useState(""),[v,y]=$.useState(""),[f,C]=$.useState(!1),[b,M]=$.useState(1e3),[w,c]=$.useState(null),[h,l]=$.useState(!1),u=()=>{fetch("/api/ws/stats").then(T=>T.json()).then(T=>{c(T),M(T.limit)}).catch(T=>{console.error("Failed to load WS stats:",T)})};$.useEffect(()=>{if(!r)return;const T=k=>{k.key==="Escape"&&(k.preventDefault(),i())};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[r,i]),$.useEffect(()=>{r&&(fetch("/api/settings").then(T=>T.json()).then(T=>{p(T.port),R(T.basicAuthEnabled),d(T.basicAuthUser),y(T.basicAuthPassword)}).catch(T=>{console.error("Failed to load settings:",T)}),u())},[r]);const g=async()=>{try{await fetch("/api/ws/limit",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({limit:b})}),u()}catch(T){console.error("Failed to set WS limit:",T)}},S=async()=>{l(!0);try{await fetch("/api/ws/clear",{method:"POST"}),u()}catch(T){console.error("Failed to clear WS connections:",T)}finally{l(!1)}},E=async T=>{T.preventDefault(),C(!0);try{await n({port:_,basicAuthEnabled:L,basicAuthUser:o,basicAuthPassword:v}),i()}catch(k){console.error("Failed to save settings:",k),alert("設定の保存に失敗しました")}finally{C(!1)}};return r?D.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:i,children:D.jsxs("div",{className:"modal w-[500px]",onClick:T=>T.stopPropagation(),children:[D.jsxs("div",{className:"flex items-center justify-between mb-4",children:[D.jsx("h2",{className:"m-0 text-[14px] font-semibold",id:"settings-modal-title",children:Ew}),D.jsx("button",{type:"button",className:"modal-close-btn",onClick:i,"aria-label":"閉じる",children:"×"})]}),D.jsxs("form",{onSubmit:E,children:[D.jsxs("div",{className:"flex flex-col gap-4",children:[D.jsxs("section",{className:"flex flex-col gap-3",children:[D.jsx("h3",{className:"m-0 text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted border-b border-border pb-2",children:kw}),D.jsxs("div",{className:"flex flex-col gap-1",children:[D.jsx("label",{htmlFor:"port",className:"text-xs text-ink-muted",children:Lw}),D.jsx("input",{type:"number",id:"port",className:Jo,value:_,onChange:T=>p(Number(T.target.value)),min:1024,max:65535,required:!0})]}),D.jsxs("div",{className:"flex flex-col gap-1",children:[D.jsx("h4",{className:"m-0 text-xs font-semibold text-ink-muted",children:Rw}),D.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[D.jsx("input",{type:"checkbox",checked:L,onChange:T=>R(T.target.checked)}),D.jsx("span",{children:Tw})]})]}),L&&D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:"flex flex-col gap-1",children:[D.jsx("label",{htmlFor:"username",className:"text-xs text-ink-muted",children:Mw}),D.jsx("input",{type:"text",id:"username",className:Jo,value:o,onChange:T=>d(T.target.value),required:L,autoComplete:"username"})]}),D.jsxs("div",{className:"flex flex-col gap-1",children:[D.jsx("label",{htmlFor:"password",className:"text-xs text-ink-muted",children:Dw}),D.jsx("input",{type:"password",id:"password",className:Jo,value:v,onChange:T=>y(T.target.value),required:L,minLength:12,autoComplete:"new-password"}),D.jsx("p",{className:"m-0 text-[11px] text-muted",children:Aw})]})]})]}),D.jsxs("section",{className:"flex flex-col gap-3",children:[D.jsx("h3",{className:"m-0 text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted border-b border-border pb-2",children:Nw}),D.jsxs("div",{className:"flex flex-col gap-1",children:[D.jsx("label",{htmlFor:"wsLimit",className:"text-xs text-ink-muted",children:Iw}),D.jsxs("div",{className:"flex gap-2 items-center",children:[D.jsx("input",{type:"number",id:"wsLimit",className:`flex-1 ${Jo}`,value:b,onChange:T=>M(Number(T.target.value)),min:1,max:1e4}),D.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:g,children:Hw})]})]}),D.jsxs("div",{className:"flex flex-col gap-1",children:[D.jsx("label",{className:"text-xs text-ink-muted",children:jw}),D.jsx("div",{className:"border border-border rounded-[2px] p-2 text-xs bg-bg min-h-[40px] flex flex-col gap-1",children:w&&w.connections.length>0?w.connections.map(({ip:T,count:k})=>D.jsxs("div",{className:"flex justify-between items-center",children:[D.jsx("span",{className:"font-mono text-ink",children:T}),D.jsx("span",{className:"font-semibold text-ink-muted",children:k})]},T)):D.jsx("div",{className:"text-muted text-center",children:"接続なし"})})]}),D.jsx("div",{className:"flex flex-col gap-1",children:D.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:S,disabled:h,children:h?"クリア中...":Fw})})]}),D.jsx("p",{className:"m-0 text-[11px] text-muted italic",children:Ow})]}),D.jsxs("div",{className:"flex justify-end gap-2 mt-4 border-t border-border pt-4",children:[D.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:f,children:Bw}),D.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:f,children:f?"保存中...":Pw})]})]})]})}):null}const zw=()=>{const[r,i]=$.useState({}),n=$.useCallback((p,L)=>{i(R=>{const o=R[p]||sa();return{...R,[p]:L(o)}})},[]),_=$.useCallback(p=>{i(L=>{const R={...L};return p.forEach(o=>{R[o]||(R[o]=sa())}),R})},[]);return{workspaceStates:r,setWorkspaceStates:i,updateWorkspaceState:n,initializeWorkspaceStates:_}},Uw=()=>{const[r,i]=$.useState({}),n=$.useCallback((p,L)=>{i(R=>{const o=R[p]||na();return{...R,[p]:L(o)}})},[]),_=$.useCallback(p=>{i(L=>{const R={...L};return p.forEach(o=>{R[o]||(R[o]=na())}),R})},[]);return{deckStates:r,setDeckStates:i,updateDeckState:n,initializeDeckStates:_}},Ww=({setStatusMessage:r,defaultRoot:i,initializeWorkspaceStates:n,setWorkspaceStates:_})=>{const[p,L]=$.useState([]),[R,o]=$.useState(null);$.useEffect(()=>{let y=!0;return qf().then(f=>{y&&(L(f),o(C=>C&&f.some(b=>b.id===C)?C:null),n(f.map(C=>C.id)))}).catch(f=>{y&&r(`ワークスペースを取得できませんでした: ${Ht(f)}`)}),()=>{y=!1}},[r,n]);const d=$.useCallback(async y=>{const C=y.trim()||i;if(!C)return r("パスを入力してください。"),null;const b=Pd(C);if(p.some(w=>Pd(w.path)===b))return r("同じパスのワークスペースは追加できません。"),null;try{const w=await Zv(C);return L(c=>[...c,w]),o(w.id),_(c=>({...c,[w.id]:sa()})),w}catch(w){return r(`ワークスペースを追加できませんでした: ${Ht(w)}`),null}},[p,i,r,_]),v=$.useCallback(async y=>{try{await eg(y),L(f=>f.filter(C=>C.id!==y)),o(f=>f===y?null:f),_(f=>{const C={...f};return delete C[y],C})}catch(f){r(`ワークスペースを削除できませんでした: ${Ht(f)}`)}},[r,_]);return{workspaces:p,editorWorkspaceId:R,setEditorWorkspaceId:o,handleCreateWorkspace:d,handleDeleteWorkspace:v}},Vw=({setStatusMessage:r,initializeDeckStates:i,updateDeckState:n,setDeckStates:_,initialDeckIds:p})=>{const[L,R]=$.useState([]),[o,d]=$.useState(p??[]);$.useEffect(()=>{let w=!0;return tg().then(c=>{w&&(R(c),i(c.map(h=>h.id)),c.forEach(h=>{ug(h.id).then(l=>{w&&n(h.id,u=>{var g;return{...u,terminals:l,activeTerminalId:u.activeTerminalId&&l.some(S=>S.id===u.activeTerminalId)?u.activeTerminalId:((g=l[0])==null?void 0:g.id)??null}})}).catch(()=>{})}))}).catch(c=>{w&&r(`デッキを取得できませんでした: ${Ht(c)}`)}),()=>{w=!1}},[r,i,n]),$.useEffect(()=>{if(L.length===0)return;const w=o.filter(c=>L.some(h=>h.id===c));w.length===o.length&&w.length>0||(w.length>0?d(w):L[0]&&d([L[0].id]))},[L,o]);const v=$.useCallback(async(w,c)=>{try{const h=await rg(w,c);return R(l=>[...l,h]),d(l=>[...l.filter(u=>u!==h.id),h.id]),_(l=>({...l,[h.id]:na()})),h}catch(h){return r(`デッキの作成に失敗しました: ${Ht(h)}`),null}},[r,_]),y=$.useCallback(async w=>{try{await ig(w),R(c=>c.filter(h=>h.id!==w)),d(c=>c.filter(h=>h!==w)),_(c=>{const h={...c};return delete h[w],h})}catch(c){r(`デッキの削除に失敗しました: ${Ht(c)}`)}},[r,_]),f=$.useCallback(w=>{R(c=>{const h=w(c);return sg(h.map(l=>l.id)).catch(()=>{}),h})},[]),C=$.useCallback(async(w,c,h,l)=>{try{const u=await hg(w,l,h);n(w,g=>({...g,terminals:[...g.terminals,{id:u.id,title:u.title}],activeTerminalId:u.id}))}catch(u){r(`ターミナルを起動できませんでした: ${Ht(u)}`)}},[n,r]),b=$.useCallback(async(w,c)=>{try{await dg(c),n(w,h=>{var g;const l=h.terminals.filter(S=>S.id!==c),u=h.activeTerminalId===c?((g=l[l.length-1])==null?void 0:g.id)??null:h.activeTerminalId;return{...h,terminals:l,activeTerminalId:u}})}catch(h){r(`ターミナルを削除できませんでした: ${Ht(h)}`)}},[n,r]),M=$.useCallback((w,c)=>{n(w,h=>{var g;const l=h.terminals.filter(S=>S.id!==c),u=h.activeTerminalId===c?((g=l[l.length-1])==null?void 0:g.id)??null:h.activeTerminalId;return{...h,terminals:l,activeTerminalId:u}})},[n]);return{decks:L,activeDeckIds:o,setActiveDeckIds:d,handleCreateDeck:v,handleDeleteDeck:y,handleReorderDecks:f,handleCreateTerminal:C,handleDeleteTerminal:b,handleRemoveTerminalLocal:M}},Kw=({editorWorkspaceId:r,activeWorkspaceState:i,updateWorkspaceState:n,setStatusMessage:_})=>{const[p,L]=$.useState(null),R=$.useCallback(()=>{r&&(n(r,c=>({...c,treeLoading:!0,treeError:null})),Xt(Pc(r,""),15e3).then(c=>{n(r,h=>({...h,tree:oa(c),treeLoading:!1}))}).catch(c=>{n(r,h=>({...h,treeLoading:!1,treeError:Ht(c)}))}))},[r,n]),o=$.useCallback(c=>{if(!(!r||c.type!=="dir")){if(c.expanded){n(r,h=>({...h,tree:As(h.tree,c.path,l=>({...l,expanded:!1}))}));return}if(c.children&&c.children.length>0){n(r,h=>({...h,tree:As(h.tree,c.path,l=>({...l,expanded:!0}))}));return}n(r,h=>({...h,tree:As(h.tree,c.path,l=>({...l,loading:!0}))})),Xt(Pc(r,c.path),15e3).then(h=>{n(r,l=>({...l,tree:As(l.tree,c.path,u=>({...u,expanded:!0,loading:!1,children:oa(h)}))}))}).catch(h=>{n(r,l=>({...l,treeError:Ht(h),tree:As(l.tree,c.path,u=>({...u,loading:!1}))}))})}},[r,n]),d=$.useCallback(c=>{if(!r||c.type!=="file")return;const h=i.files.find(g=>g.path===c.path);if(h){n(r,g=>({...g,activeFileId:h.id}));return}const l=crypto.randomUUID(),u={id:l,name:c.name,path:c.path,language:sp(c.path),contents:"",dirty:!1};n(r,g=>({...g,files:[...g.files,{...u,contents:"読み込み中..."}],activeFileId:l})),Xt(ng(r,c.path),15e3).then(g=>{n(r,S=>({...S,files:S.files.map(E=>E.id===l?{...E,contents:g.contents}:E)}))}).catch(g=>{n(r,S=>({...S,files:S.files.filter(E=>E.id!==l),activeFileId:S.files.length>1?S.files[0].id:null})),_(`ファイルを開けませんでした: ${Ht(g)}`)})},[r,i.files,n,_]),v=$.useCallback((c,h)=>{r&&n(r,l=>({...l,files:l.files.map(u=>u.id===c?{...u,contents:h,dirty:!0}:u)}))},[r,n]),y=$.useCallback(async c=>{if(!r)return;const h=i.files.find(l=>l.id===c);if(h){L(c);try{await Xt(og(r,h.path,h.contents),15e3),n(r,l=>({...l,files:l.files.map(u=>u.id===c?{...u,dirty:!1}:u)})),_($f)}catch(l){_(`保存に失敗しました: ${Ht(l)}`)}finally{L(null)}}},[r,i.files,n,_]),f=$.useCallback(c=>{r&&n(r,h=>{const l=h.files.findIndex(S=>S.id===c),u=h.files.filter(S=>S.id!==c);let g=h.activeFileId;return h.activeFileId===c&&(u.length===0?g=null:l>=u.length?g=u[u.length-1].id:g=u[l].id),{...h,files:u,activeFileId:g}})},[r,n]),C=$.useCallback(async(c,h)=>{if(!r)return;const l=c?`${c}/${h}`:h;try{await Xt(ag(r,l),15e3);const u={name:h,path:l,type:"file",expanded:!1,loading:!1};n(r,g=>({...g,tree:Oc(g.tree,c,u)})),_(`ファイルを作成しました: ${h}`)}catch(u){_(`ファイル作成に失敗しました: ${Ht(u)}`)}},[r,n,_]),b=$.useCallback(async(c,h)=>{if(!r)return;const l=c?`${c}/${h}`:h;try{await Xt(Yf(r,l),15e3);const u={name:h,path:l,type:"dir",expanded:!1,loading:!1,children:[]};n(r,g=>({...g,tree:Oc(g.tree,c,u)})),_(`フォルダを作成しました: ${h}`)}catch(u){_(`フォルダ作成に失敗しました: ${Ht(u)}`)}},[r,n,_]),M=$.useCallback(async c=>{if(r)try{await Xt(Gf(r,c),15e3),n(r,h=>{const l=h.files.filter(S=>S.path!==c);let u=h.activeFileId;const g=h.files.find(S=>S.path===c);return g&&h.activeFileId===g.id&&(u=l.length>0?l[0].id:null),{...h,files:l,activeFileId:u,tree:Nc(h.tree,c)}}),_("ファイルを削除しました")}catch(h){_(`ファイル削除に失敗しました: ${Ht(h)}`)}},[r,n,_]),w=$.useCallback(async c=>{if(r)try{await Xt(Xf(r,c),15e3),n(r,h=>{const l=h.files.filter(S=>!S.path.startsWith(c+"/")&&S.path!==c);let u=h.activeFileId;const g=h.files.find(S=>S.id===h.activeFileId);return g&&(g.path.startsWith(c+"/")||g.path===c)&&(u=l.length>0?l[0].id:null),{...h,files:l,activeFileId:u,tree:Nc(h.tree,c)}}),_("フォルダを削除しました")}catch(h){_(`フォルダ削除に失敗しました: ${Ht(h)}`)}},[r,n,_]);return{savingFileId:p,handleRefreshTree:R,handleToggleDir:o,handleOpenFile:d,handleFileChange:v,handleSaveFile:y,handleCloseFile:f,handleCreateFile:C,handleCreateDirectory:b,handleDeleteFile:M,handleDeleteDirectory:w}};async function qw(r,i,n,_){if(!_.current[r]){_.current[r]=!0,i(r,p=>({...p,loading:!0,reposLoading:!0,error:null}));try{const L=(await Xt(gg(r)).catch(()=>({repos:[]}))).repos;i(r,f=>({...f,repos:L,reposLoading:!1,selectedRepoPath:f.selectedRepoPath??(L.length>0?L[0].path:null)}));const o=(n.current[r]||Tn()).selectedRepoPath??(L.length>0?L[0].path:void 0),[d,v,y]=await Promise.all([Xt(Jf(r,o||void 0)),Xt(ep(r,o||void 0)).catch(()=>({ahead:0,behind:0,hasUpstream:!1})),Xt(tp(r,o||void 0)).catch(()=>({hasRemote:!1,remotes:[]}))]);i(r,f=>({...f,status:d,branchStatus:v,hasRemote:y.hasRemote,loading:!1,error:null}))}catch(p){const L=p instanceof Error?p.message:"Failed to get git status";i(r,R=>({...R,status:null,loading:!1,reposLoading:!1,error:L}))}finally{_.current[r]=!1}}}async function Gw(r,i,n,_){n(r,p=>({...p,selectedRepoPath:i,loading:!0}));try{const[p,L,R]=await Promise.all([Xt(Jf(r,i||void 0)),Xt(ep(r,i||void 0)).catch(()=>({ahead:0,behind:0,hasUpstream:!1})),Xt(tp(r,i||void 0)).catch(()=>({hasRemote:!1,remotes:[]}))]);n(r,o=>({...o,status:p,branchStatus:L,hasRemote:R.hasRemote,loading:!1,branches:[],logs:[]}))}catch(p){const L=p instanceof Error?p.message:"Failed to get git status";_(L),n(r,R=>({...R,loading:!1}))}}async function Yw(r,i,n,_,p){try{await Qf(r,[i],n),await p()}catch(L){_(L instanceof Error?L.message:"Failed to stage file")}}async function Xw(r,i,n,_,p){try{await Zf(r,[i],n),await p()}catch(L){_(L instanceof Error?L.message:"Failed to unstage file")}}async function Jw(r,i,n,_,p){if(i.length!==0)try{await Qf(r,i,n),await p()}catch(L){_(L instanceof Error?L.message:"Failed to stage files")}}async function Qw(r,i,n,_,p){if(i.length!==0)try{await Zf(r,i,n),await p()}catch(L){_(L instanceof Error?L.message:"Failed to unstage files")}}async function Zw(r,i,n,_,p){try{const L=await mg(r,i.trim(),n);_(`Committed: ${L.summary.changes} changes, +${L.summary.insertions} -${L.summary.deletions}`),await p()}catch(L){_(L instanceof Error?L.message:"Failed to commit")}}async function eS(r,i,n,_,p){try{await yg(r,[i],n),await p()}catch(L){_(L instanceof Error?L.message:"Failed to discard changes")}}async function tS(r,i,n,_,p){_(r,L=>({...L,diffPath:i.path,diffLoading:!0,diff:null}));try{const L=await wg(r,i.path,i.staged,n);_(r,R=>({...R,diff:L,diffLoading:!1}))}catch(L){p(L instanceof Error?L.message:"Failed to get diff"),_(r,R=>({...R,diffPath:null,diff:null,diffLoading:!1}))}}async function rS(r,i,n,_,p){n(r,L=>({...L,pushing:!0}));try{const L=await Sg(r,i);_(`Pushed to ${L.branch}`),await p()}catch(L){_(L instanceof Error?L.message:"Failed to push")}finally{n(r,L=>({...L,pushing:!1}))}}async function iS(r,i,n,_,p){n(r,L=>({...L,pulling:!0}));try{const L=await Cg(r,i);L.summary.changes>0?_(`Pulled: ${L.summary.changes} changes, +${L.summary.insertions} -${L.summary.deletions}`):_("Already up to date"),await p()}catch(L){_(L instanceof Error?L.message:"Failed to pull")}finally{n(r,L=>({...L,pulling:!1}))}}async function sS(r,i,n,_){try{await xg(r,i),n("Fetched from remote"),await _()}catch(p){n(p instanceof Error?p.message:"Failed to fetch")}}async function nS(r,i,n,_){n(r,p=>({...p,branchesLoading:!0}));try{const p=await Xt(bg(r,i));n(r,L=>({...L,branches:p.branches,branchesLoading:!1}))}catch(p){_(p instanceof Error?p.message:"Failed to load branches"),n(r,L=>({...L,branchesLoading:!1}))}}async function oS(r,i,n,_,p,L){try{await Eg(r,i,n),_(`Switched to branch '${i}'`),await p(),await L()}catch(R){_(R instanceof Error?R.message:"Failed to checkout branch")}}async function aS(r,i,n,_,p,L,R){try{await kg(r,i,n,_),p(`Created branch '${i}'${n?" and switched to it":""}`),await L(),await R()}catch(o){p(o instanceof Error?o.message:"Failed to create branch")}}async function lS(r,i,n,_,p){_(r,L=>({...L,logsLoading:!0}));try{const L=await Xt(Lg(r,i,n));_(r,R=>({...R,logs:L.logs,logsLoading:!1}))}catch(L){p(L instanceof Error?L.message:"Failed to load git log"),_(r,R=>({...R,logsLoading:!1}))}}const Tn=()=>({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}),cS=(r,i)=>{const[n,_]=$.useState({}),p=$.useRef({}),L=$.useRef(n);L.current=n;const R=r&&n[r]||Tn(),o=$.useCallback((O,B)=>{_(U=>({...U,[O]:B(U[O]||Tn())}))},[]),d=$.useCallback(async O=>{const B=O||r;B&&await qw(B,o,L,p)},[r,o]),v=$.useCallback(async O=>{r&&await Gw(r,O,o,i)},[r,o,i]),y=$.useCallback(async()=>{const O=Object.keys(L.current);await Promise.all(O.map(B=>d(B)))},[d]),f=$.useCallback(()=>{if(!r)return;const O=L.current[r];return(O==null?void 0:O.selectedRepoPath)||void 0},[r]),C=$.useCallback(async O=>{r&&await Yw(r,O,f(),i,d)},[r,f,i,d]),b=$.useCallback(async O=>{r&&await Xw(r,O,f(),i,d)},[r,f,i,d]),M=$.useCallback(async()=>{if(!r||!R.status)return;const O=R.status.files.filter(B=>!B.staged).map(B=>B.path);await Jw(r,O,f(),i,d)},[r,R.status,f,i,d]),w=$.useCallback(async()=>{if(!r||!R.status)return;const O=R.status.files.filter(B=>B.staged).map(B=>B.path);await Qw(r,O,f(),i,d)},[r,R.status,f,i,d]),c=$.useCallback(async O=>{!r||!O.trim()||await Zw(r,O,f(),i,d)},[r,f,i,d]),h=$.useCallback(async O=>{r&&await eS(r,O,f(),i,d)},[r,f,i,d]),l=$.useCallback(async O=>{r&&await tS(r,O,f(),o,i)},[r,f,o,i]),u=$.useCallback(()=>{r&&o(r,O=>({...O,diffPath:null,diff:null,diffLoading:!1}))},[r,o]),g=$.useCallback(async()=>{r&&await rS(r,f(),o,i,d)},[r,f,o,i,d]),S=$.useCallback(async()=>{r&&await iS(r,f(),o,i,d)},[r,f,o,i,d]),E=$.useCallback(async()=>{r&&await sS(r,f(),i,d)},[r,f,i,d]),T=$.useCallback(async()=>{r&&await nS(r,f(),o,i)},[r,f,o,i]),k=$.useCallback(async O=>{r&&await oS(r,O,f(),i,d,T)},[r,f,i,d,T]),N=$.useCallback(async(O,B=!0)=>{r&&await aS(r,O,B,f(),i,d,T)},[r,f,i,d,T]),V=$.useCallback(async(O=50)=>{r&&await lS(r,O,f(),o,i)},[r,f,o,i]),K=$.useCallback(O=>n[O]||Tn(),[n]);return{gitState:R,gitStates:n,refreshGitStatus:d,refreshAllGitStatuses:y,getGitStateForWorkspace:K,handleSelectRepo:v,handleStageFile:C,handleUnstageFile:b,handleStageAll:M,handleUnstageAll:w,handleCommit:c,handleDiscardFile:h,handleShowDiff:l,handleCloseDiff:u,handlePush:g,handlePull:S,handleFetch:E,handleLoadBranches:T,handleCheckoutBranch:k,handleCreateBranch:N,handleLoadLogs:V}};function hS({view:r,editorWorkspaceId:i,activeDeckIds:n,workspaceMode:_,setView:p,setEditorWorkspaceId:L,setActiveDeckIds:R,setWorkspaceMode:o}){$.useEffect(()=>{const d=()=>{const v=np();p(v.view),L(v.workspaceId??null),R(v.deckIds),o(v.workspaceMode)};return window.addEventListener("popstate",d),()=>window.removeEventListener("popstate",d)},[p,L,R,o]),$.useEffect(()=>{const d=new URLSearchParams;d.set("view",r),r==="workspace"&&i&&d.set("workspace",i),n.length>0&&d.set("decks",n.join(",")),r==="workspace"&&_==="editor"&&i&&d.set("mode","editor");const v=d.toString(),y=v?`${window.location.pathname}?${v}`:window.location.pathname;window.history.replaceState(null,"",y)},[r,i,n,_])}function uS(){const[r,i]=$.useState(!1),[n,_]=$.useState(!1),[p,L]=$.useState(!1),R=$.useCallback(()=>i(!0),[]),o=$.useCallback(()=>i(!1),[]),d=$.useCallback(()=>_(!0),[]),v=$.useCallback(()=>_(!1),[]),y=$.useCallback(()=>L(!0),[]),f=$.useCallback(()=>L(!1),[]);return{isWorkspaceModalOpen:r,openWorkspaceModal:R,closeWorkspaceModal:o,isDeckModalOpen:n,openDeckModal:d,closeDeckModal:v,isSettingsModalOpen:p,openSettingsModal:y,closeSettingsModal:f}}const Df=3;function Af(r,i,n){const _=r.indexOf(i),p=r.indexOf(n);if(_<0||p<0||_===p)return r;const L=[...r];L.splice(_,1);const R=L.indexOf(n);return L.splice(R,0,i),L}function dS(){const r=np(),i=$.useRef(null),n=$.useRef(!1),[_,p]=$.useState(r.view),[L,R]=$.useState(r.workspaceMode),[o,d]=$.useState(zv),[v,y]=$.useState(""),[f,C]=$.useState(null),[b,M]=$.useState(null),[w,c]=$.useState(!1),[h,l]=$.useState(!1),[u,g]=$.useState(null),{theme:S,handleToggleTheme:E}=Jp(),[T,k]=$.useState({}),N=$.useCallback((le,me)=>{k(Pe=>Pe[le]===me?Pe:{...Pe,[le]:me})},[]);$.useEffect(()=>{const le=window.visualViewport;if(!le)return;let me=le.height,Pe=!1;const Fe=document.documentElement,xr=()=>{Pe?(me=le.height,Pe=!1):le.height>me&&(me=le.height);const $s=me-le.height>150;Fe.style.setProperty("--viewport-height",`${le.height}px`),Fe.classList.toggle("keyboard-open",$s)},zr=()=>{Pe=!0,window.setTimeout(xr,300)};return xr(),le.addEventListener("resize",xr),window.addEventListener("orientationchange",zr),()=>{le.removeEventListener("resize",xr),window.removeEventListener("orientationchange",zr),Fe.classList.remove("keyboard-open")}},[]);const{isWorkspaceModalOpen:V,openWorkspaceModal:K,closeWorkspaceModal:O,isDeckModalOpen:B,openDeckModal:U,closeDeckModal:z,isSettingsModalOpen:q,openSettingsModal:Y,closeSettingsModal:W}=uS(),{workspaceStates:A,setWorkspaceStates:I,updateWorkspaceState:P,initializeWorkspaceStates:H}=zw(),{deckStates:J,setDeckStates:ie,updateDeckState:ae,initializeDeckStates:ue}=Uw(),{workspaces:X,editorWorkspaceId:j,setEditorWorkspaceId:se,handleCreateWorkspace:te,handleDeleteWorkspace:ce}=Ww({setStatusMessage:y,defaultRoot:o,initializeWorkspaceStates:H,setWorkspaceStates:I}),{decks:_e,activeDeckIds:Le,setActiveDeckIds:ke,handleCreateDeck:Ie,handleDeleteDeck:Ne,handleReorderDecks:ge,handleCreateTerminal:Xe,handleDeleteTerminal:kt,handleRemoveTerminalLocal:yt}=Vw({setStatusMessage:y,initializeDeckStates:ue,updateDeckState:ae,setDeckStates:ie,initialDeckIds:r.deckIds}),Je=$.useMemo(()=>sa(),[]),Qe=$.useMemo(()=>na(),[]),Ze=X.find(le=>le.id===j)||null,Vt=j&&A[j]||Je,{savingFileId:wt,handleRefreshTree:at,handleToggleDir:St,handleOpenFile:ft,handleFileChange:or,handleSaveFile:Ct,handleCloseFile:Ot,handleCreateFile:ze,handleCreateDirectory:Br,handleDeleteFile:Se,handleDeleteDirectory:Re}=Kw({editorWorkspaceId:j,activeWorkspaceState:Vt,updateWorkspaceState:P,setStatusMessage:y}),{gitState:Ke,refreshGitStatus:Ge,handleSelectRepo:Tt,handleStageFile:He,handleUnstageFile:pt,handleStageAll:Ye,handleUnstageAll:oe,handleCommit:he,handleDiscardFile:Ce,handleShowDiff:De,handleCloseDiff:Ue,handlePush:We,handlePull:ar,handleLoadBranches:xt,handleCheckoutBranch:_t,handleCreateBranch:et,handleLoadLogs:Be}=cS(j,y);hS({view:_,editorWorkspaceId:j,activeDeckIds:Le,workspaceMode:L,setView:p,setEditorWorkspaceId:se,setActiveDeckIds:ke,setWorkspaceMode:R});const ht=Jv(),rt=$.useMemo(()=>new Map(X.map(le=>[le.id,le])),[X]),di=_e;$.useEffect(()=>{let le=!0;return Qv().then(me=>{le&&me!=null&&me.defaultRoot&&d(me.defaultRoot)}).catch(()=>{}),()=>{le=!1}},[]),$.useEffect(()=>{if(v!==$f)return;const le=setTimeout(()=>y(""),Vv);return()=>clearTimeout(le)},[v]),$.useEffect(()=>{L==="editor"&&!j&&R("list")},[L,j]),$.useEffect(()=>{if(typeof window>"u")return;const le=window.matchMedia("(pointer: fine) and (min-width: 721px)"),me=()=>l(le.matches);return me(),le.addEventListener("change",me),()=>le.removeEventListener("change",me)},[]);const lr=$.useCallback(()=>{C(null),M(null),c(!1)},[]),fi=$.useCallback(()=>{n.current=!0,window.setTimeout(()=>{n.current=!1},100)},[]);$.useEffect(()=>{h||lr()},[h,lr]);const Fs=$.useRef(null);$.useEffect(()=>{if(L!=="editor"||!j){Fs.current=null;return}Fs.current!==j&&(Fs.current=j,at(),Ge())},[L,j,at,Ge]);const fa=$.useCallback(()=>{if(X.length===0){y(Uv);return}U()},[X.length,U]),pa=$.useCallback(async(le,me)=>{if(!me){y(Wv);return}await Ie(le,me)&&z()},[Ie,z]),Jr=$.useCallback(async le=>{try{const me=await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(le)});if(!me.ok){const Pe=await me.text();throw new Error(Pe||"Failed to save settings")}await me.json(),y("設定を保存しました。ブラウザをリロードしてください。"),setTimeout(()=>{window.location.reload()},2e3)}catch(me){throw console.error("Failed to save settings:",me),me}},[]),On=$.useCallback(le=>{se(le),R("editor")},[se]),Nn=$.useCallback(()=>{R("list")},[]),_a=$.useCallback(async le=>{await te(le)&&O()},[te,O]),In=$.useCallback(le=>{const me=J[le]||Qe;Xe(le,me.terminals.length)},[J,Qe,Xe]),jn=$.useCallback(le=>{const me=J[le]||Qe;Xe(le,me.terminals.length,"claude","Claude Code")},[J,Qe,Xe]),Fn=$.useCallback(le=>{const me=J[le]||Qe;Xe(le,me.terminals.length,"codex","Codex")},[J,Qe,Xe]),Hn=$.useCallback((le,me)=>{kt(le,me)},[kt]),va=$.useCallback((le,me)=>{yt(le,me)},[yt]),ga=$.useCallback(le=>{if(n.current){n.current=!1;return}ke([le])},[ke]),lt=$.useCallback(le=>{ke(me=>{const Pe=[...me.filter(Fe=>Fe!==le),le];return Pe.length<=Df?Pe:Pe.slice(Pe.length-Df)})},[ke]),ma=$.useCallback(le=>{ke(me=>{if(me.length<=1){const Pe=di.find(Fe=>Fe.id!==le);return Pe?[Pe.id]:me}return me.filter(Pe=>Pe!==le)})},[di,ke]),Hs=$.useCallback((le,me)=>{le.preventDefault(),le.stopPropagation(),g({deckId:me,x:le.clientX,y:le.clientY})},[]),$n=$.useCallback(()=>{if(!u)return;const{deckId:le}=u;g(null),window.confirm(`このデッキを完全に削除しますか?
177
+ ターミナルもすべて削除されます。`)&&Ne(le)},[u,Ne]),ji=$.useCallback(()=>{g(null)},[]),ya=$.useCallback((le,me)=>{if(!h){le.preventDefault();return}le.dataTransfer.effectAllowed="move",le.dataTransfer.setData("text/plain",me),C(me),M(null),c(!1)},[h]),zn=$.useCallback((le,me)=>{!h||!f||f===me||(le.preventDefault(),le.dataTransfer.dropEffect="move",M(me),c(!1))},[h,f]),is=$.useCallback((le,me)=>{le.currentTarget.contains(le.relatedTarget)||M(Pe=>Pe===me?null:Pe)},[]),Cr=$.useCallback((le,me)=>{if(!h)return;le.preventDefault();const Pe=f||le.dataTransfer.getData("text/plain");if(!Pe||Pe===me){lr();return}ge(Fe=>{const xr=Fe.map(Ur=>Ur.id),zr=Af(xr,Pe,me),$s=new Map(Fe.map(Ur=>[Ur.id,Ur]));return zr.map(Ur=>$s.get(Ur))}),ke(Fe=>Af(Fe,Pe,me)),fi(),lr()},[f,h,lr,ke,fi,ge]),wa=$.useCallback(le=>{!h||!f||(le.preventDefault(),le.dataTransfer.dropEffect="move",c(!0))},[h,f]),vr=$.useCallback(le=>{le.currentTarget.contains(le.relatedTarget)||c(!1)},[]),Sa=$.useCallback(le=>{if(!h)return;le.preventDefault();const me=f||le.dataTransfer.getData("text/plain");if(!me){lr();return}lt(me),fi(),lr()},[f,lt,h,lr,fi]),Ca=$.useCallback(le=>{j&&P(j,me=>({...me,activeFileId:le}))},[j,P]),xa=L==="editor"&&!!j,ss=D.jsxs("div",{className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:[D.jsxs("div",{className:"flex flex-col items-center gap-4 p-6 flex-shrink-0",children:[D.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:K,children:"ワークスペース追加"}),D.jsx(f1,{workspaces:X,selectedWorkspaceId:j,onSelect:On,onDelete:ce})]}),xa&&D.jsx(mw,{activeWorkspace:Ze,defaultRoot:o,activeWorkspaceState:Vt,editorWorkspaceId:j,gitState:Ke,theme:S,savingFileId:wt,onCloseWorkspaceEditor:Nn,onToggleDir:St,onOpenFile:ft,onRefreshTree:at,onCreateFile:ze,onCreateDirectory:Br,onDeleteFile:Se,onDeleteDirectory:Re,onRefreshGit:Ge,onSelectRepo:Tt,onStageFile:He,onUnstageFile:pt,onStageAll:Ye,onUnstageAll:oe,onCommit:he,onDiscardFile:Ce,onShowDiff:De,onCloseDiff:Ue,onPush:We,onPull:ar,onLoadBranches:xt,onCheckoutBranch:_t,onCreateBranch:et,onLoadLogs:Be,onSelectFile:Ca,onCloseFile:Ot,onChangeFile:or,onSaveFile:Ct})]}),ns=D.jsxs("div",{className:"terminal-layout",children:[D.jsx("div",{className:"terminal-topbar",children:D.jsx("div",{className:"topbar-left",children:D.jsxs("div",{className:"deck-tabs",children:[di.map(le=>{var me,Pe;return D.jsxs("button",{type:"button",className:Et("deck-tab",Le.includes(le.id)&&"active",f===le.id&&"is-dragging",b===le.id&&"is-drag-over"),onClick:()=>ga(le.id),onContextMenu:Fe=>Hs(Fe,le.id),draggable:h,onDragStart:Fe=>ya(Fe,le.id),onDragOver:Fe=>zn(Fe,le.id),onDragLeave:Fe=>is(Fe,le.id),onDrop:Fe=>Cr(Fe,le.id),onDragEnd:lr,title:h?`${((me=rt.get(le.workspaceId))==null?void 0:me.path)||le.root}
178
+ ドラッグで並び替え / メインにドロップで分割表示`:`${((Pe=rt.get(le.workspaceId))==null?void 0:Pe.path)||le.root}`,children:[D.jsx("span",{className:"deck-tab-name",children:le.name}),D.jsx("span",{className:"deck-tab-close",role:"button","aria-label":"閉じる",onClick:Fe=>{Fe.stopPropagation(),ma(le.id)},children:"×"})]},le.id)}),D.jsx("button",{type:"button",className:"deck-tab deck-tab-add",onClick:fa,title:"デッキ作成",children:"+"})]})})}),D.jsx("div",{className:Et("terminal-split-container",w&&"is-drop-target"),ref:i,style:{gridTemplateColumns:`repeat(${Le.length}, minmax(0, 1fr))`},onDragOver:wa,onDragLeave:vr,onDrop:Sa,children:Le.length===0?D.jsx("div",{className:"panel flex items-center justify-center text-muted text-[13px] p-5",children:"デッキを作成してください。"}):Le.map(le=>{const me=_e.find(Fe=>Fe.id===le),Pe=J[le]||Qe;return me?D.jsxs("div",{className:"deck-split-pane",children:[D.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b border-border bg-sidebar gap-2 min-h-[28px]",children:[Le.length>1&&D.jsx("span",{className:"deck-pane-name flex-1 min-w-0 text-[11px] font-semibold text-ink-muted overflow-hidden text-ellipsis whitespace-nowrap",children:me.name}),Pe.terminals.length>0&&D.jsx(yw,{terminals:Pe.terminals,liveTitles:T,value:ip(Pe.terminals,Pe.activeTerminalId)??"",onChange:Fe=>ae(le,xr=>({...xr,activeTerminalId:Fe}))}),D.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[D.jsx("button",{type:"button",className:"topbar-btn-sm",onClick:()=>In(le),title:"ターミナル追加",children:"+"}),D.jsx("button",{type:"button",className:"topbar-btn-sm topbar-btn-claude",onClick:()=>jn(le),title:"Claude",children:"C"}),D.jsx("button",{type:"button",className:"topbar-btn-sm topbar-btn-codex",onClick:()=>Fn(le),title:"Codex",children:"X"})]})]}),D.jsx(u1,{terminals:Pe.terminals,wsBase:ht,activeTerminalId:Pe.activeTerminalId??null,onDeleteTerminal:Fe=>Hn(le,Fe),onExitTerminal:Fe=>va(le,Fe),onTerminalTitle:N})]},le):null})})]}),Fi=D.jsx(rp,{wsBase:ht}),[os]=$.useState(()=>{try{return new URLSearchParams(window.location.search).get("shell")==="drive"}catch{return!1}});return os?D.jsx(bw,{wsBase:ht}):D.jsxs("div",{className:"app","data-view":_,children:[D.jsx($v,{activeView:_,onSelect:p,theme:S,onToggleTheme:E,onOpenSettings:Y}),D.jsxs("main",{className:"main",children:[_==="workspace"&&ss,_==="terminal"&&ns,_==="browser"&&Fi]}),D.jsx(Ff,{message:v}),D.jsx(S1,{isOpen:V,defaultRoot:o,onSubmit:_a,onClose:O}),D.jsx(Hv,{isOpen:B,workspaces:X,onSubmit:pa,onClose:z}),D.jsx($w,{isOpen:q,onClose:W,onSave:Jr}),u&&D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"fixed inset-0 z-[999]",onClick:ji,onContextMenu:le=>{le.preventDefault(),ji()}}),D.jsx("div",{className:"fixed z-[1000] bg-panel border border-border shadow-lg rounded-[2px] py-1 min-w-[140px]",style:{left:u.x,top:u.y},children:D.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:$n,children:"デッキを削除"})})]})]})}class fS extends $.Component{constructor(i){super(i),this.handleReload=()=>{window.location.reload()},this.state={hasError:!1,error:null}}static getDerivedStateFromError(i){return{hasError:!0,error:i}}componentDidCatch(i,n){console.error("Application error:",i),console.error("Component stack:",n.componentStack)}render(){return this.state.hasError?D.jsx("div",{className:"flex items-center justify-center min-h-screen p-8 bg-bg",children:D.jsxs("div",{className:"max-w-[500px] p-8 bg-panel border border-border text-center",children:[D.jsx("h1",{className:"m-0 mb-4 text-xl text-[#f14c4c]",children:"Something went wrong"}),D.jsx("p",{className:"m-0 mb-6 text-muted",children:"The application encountered an unexpected error."}),this.state.error&&!1,D.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}}Fv.createRoot(document.getElementById("root")).render(D.jsx(es.StrictMode,{children:D.jsx(fS,{children:D.jsx(dS,{})})}));