agent-workbench 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,130 +0,0 @@
1
- var Wp=Object.defineProperty;var Up=(n,s,p)=>s in n?Wp(n,s,{enumerable:!0,configurable:!0,writable:!0,value:p}):n[s]=p;var mr=(n,s,p)=>Up(n,typeof s!="symbol"?s+"":s,p);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const M of document.querySelectorAll('link[rel="modulepreload"]'))S(M);new MutationObserver(M=>{for(const P of M)if(P.type==="childList")for(const N of P.addedNodes)N.tagName==="LINK"&&N.rel==="modulepreload"&&S(N)}).observe(document,{childList:!0,subtree:!0});function p(M){const P={};return M.integrity&&(P.integrity=M.integrity),M.referrerPolicy&&(P.referrerPolicy=M.referrerPolicy),M.crossOrigin==="use-credentials"?P.credentials="include":M.crossOrigin==="anonymous"?P.credentials="omit":P.credentials="same-origin",P}function S(M){if(M.ep)return;M.ep=!0;const P=p(M);fetch(M.href,P)}})();function zp(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var aa={exports:{}},Xn={},ca={exports:{}},Xe={};/**
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 dh;function qp(){if(dh)return Xe;dh=1;var n=Symbol.for("react.element"),s=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),P=Symbol.for("react.provider"),N=Symbol.for("react.context"),i=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),l=Symbol.iterator;function v(O){return O===null||typeof O!="object"?null:(O=l&&O[l]||O["@@iterator"],typeof O=="function"?O:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,f={};function o(O,U,K){this.props=O,this.context=U,this.refs=f,this.updater=K||C}o.prototype.isReactComponent={},o.prototype.setState=function(O,U){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,U,"setState")},o.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function u(){}u.prototype=o.prototype;function a(O,U,K){this.props=O,this.context=U,this.refs=f,this.updater=K||C}var h=a.prototype=new u;h.constructor=a,b(h,o.prototype),h.isPureReactComponent=!0;var y=Array.isArray,L=Object.prototype.hasOwnProperty,k={current:null},A={key:!0,ref:!0,__self:!0,__source:!0};function x(O,U,K){var ee,ne={},Q=null,q=null;if(U!=null)for(ee in U.ref!==void 0&&(q=U.ref),U.key!==void 0&&(Q=""+U.key),U)L.call(U,ee)&&!A.hasOwnProperty(ee)&&(ne[ee]=U[ee]);var H=arguments.length-2;if(H===1)ne.children=K;else if(1<H){for(var re=Array(H),te=0;te<H;te++)re[te]=arguments[te+2];ne.children=re}if(O&&O.defaultProps)for(ee in H=O.defaultProps,H)ne[ee]===void 0&&(ne[ee]=H[ee]);return{$$typeof:n,type:O,key:Q,ref:q,props:ne,_owner:k.current}}function E(O,U){return{$$typeof:n,type:O.type,key:U,ref:O.ref,props:O.props,_owner:O._owner}}function T(O){return typeof O=="object"&&O!==null&&O.$$typeof===n}function j(O){var U={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(K){return U[K]})}var D=/\/+/g;function B(O,U){return typeof O=="object"&&O!==null&&O.key!=null?j(""+O.key):U.toString(36)}function z(O,U,K,ee,ne){var Q=typeof O;(Q==="undefined"||Q==="boolean")&&(O=null);var q=!1;if(O===null)q=!0;else switch(Q){case"string":case"number":q=!0;break;case"object":switch(O.$$typeof){case n:case s:q=!0}}if(q)return q=O,ne=ne(q),O=ee===""?"."+B(q,0):ee,y(ne)?(K="",O!=null&&(K=O.replace(D,"$&/")+"/"),z(ne,U,K,"",function(te){return te})):ne!=null&&(T(ne)&&(ne=E(ne,K+(!ne.key||q&&q.key===ne.key?"":(""+ne.key).replace(D,"$&/")+"/")+O)),U.push(ne)),1;if(q=0,ee=ee===""?".":ee+":",y(O))for(var H=0;H<O.length;H++){Q=O[H];var re=ee+B(Q,H);q+=z(Q,U,K,re,ne)}else if(re=v(O),typeof re=="function")for(O=re.call(O),H=0;!(Q=O.next()).done;)Q=Q.value,re=ee+B(Q,H++),q+=z(Q,U,K,re,ne);else if(Q==="object")throw U=String(O),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.");return q}function X(O,U,K){if(O==null)return O;var ee=[],ne=0;return z(O,ee,"","",function(Q){return U.call(K,Q,ne++)}),ee}function Z(O){if(O._status===-1){var U=O._result;U=U(),U.then(function(K){(O._status===0||O._status===-1)&&(O._status=1,O._result=K)},function(K){(O._status===0||O._status===-1)&&(O._status=2,O._result=K)}),O._status===-1&&(O._status=0,O._result=U)}if(O._status===1)return O._result.default;throw O._result}var Y={current:null},V={transition:null},I={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:V,ReactCurrentOwner:k};function $(){throw Error("act(...) is not supported in production builds of React.")}return Xe.Children={map:X,forEach:function(O,U,K){X(O,function(){U.apply(this,arguments)},K)},count:function(O){var U=0;return X(O,function(){U++}),U},toArray:function(O){return X(O,function(U){return U})||[]},only:function(O){if(!T(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},Xe.Component=o,Xe.Fragment=p,Xe.Profiler=M,Xe.PureComponent=a,Xe.StrictMode=S,Xe.Suspense=c,Xe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,Xe.act=$,Xe.cloneElement=function(O,U,K){if(O==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+O+".");var ee=b({},O.props),ne=O.key,Q=O.ref,q=O._owner;if(U!=null){if(U.ref!==void 0&&(Q=U.ref,q=k.current),U.key!==void 0&&(ne=""+U.key),O.type&&O.type.defaultProps)var H=O.type.defaultProps;for(re in U)L.call(U,re)&&!A.hasOwnProperty(re)&&(ee[re]=U[re]===void 0&&H!==void 0?H[re]:U[re])}var re=arguments.length-2;if(re===1)ee.children=K;else if(1<re){H=Array(re);for(var te=0;te<re;te++)H[te]=arguments[te+2];ee.children=H}return{$$typeof:n,type:O.type,key:ne,ref:Q,props:ee,_owner:q}},Xe.createContext=function(O){return O={$$typeof:N,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},O.Provider={$$typeof:P,_context:O},O.Consumer=O},Xe.createElement=x,Xe.createFactory=function(O){var U=x.bind(null,O);return U.type=O,U},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function(O){return{$$typeof:i,render:O}},Xe.isValidElement=T,Xe.lazy=function(O){return{$$typeof:g,_payload:{_status:-1,_result:O},_init:Z}},Xe.memo=function(O,U){return{$$typeof:m,type:O,compare:U===void 0?null:U}},Xe.startTransition=function(O){var U=V.transition;V.transition={};try{O()}finally{V.transition=U}},Xe.unstable_act=$,Xe.useCallback=function(O,U){return Y.current.useCallback(O,U)},Xe.useContext=function(O){return Y.current.useContext(O)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(O){return Y.current.useDeferredValue(O)},Xe.useEffect=function(O,U){return Y.current.useEffect(O,U)},Xe.useId=function(){return Y.current.useId()},Xe.useImperativeHandle=function(O,U,K){return Y.current.useImperativeHandle(O,U,K)},Xe.useInsertionEffect=function(O,U){return Y.current.useInsertionEffect(O,U)},Xe.useLayoutEffect=function(O,U){return Y.current.useLayoutEffect(O,U)},Xe.useMemo=function(O,U){return Y.current.useMemo(O,U)},Xe.useReducer=function(O,U,K){return Y.current.useReducer(O,U,K)},Xe.useRef=function(O){return Y.current.useRef(O)},Xe.useState=function(O){return Y.current.useState(O)},Xe.useSyncExternalStore=function(O,U,K){return Y.current.useSyncExternalStore(O,U,K)},Xe.useTransition=function(){return Y.current.useTransition()},Xe.version="18.3.1",Xe}var fh;function Ha(){return fh||(fh=1,ca.exports=qp()),ca.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 ph;function Vp(){if(ph)return Xn;ph=1;var n=Ha(),s=Symbol.for("react.element"),p=Symbol.for("react.fragment"),S=Object.prototype.hasOwnProperty,M=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,P={key:!0,ref:!0,__self:!0,__source:!0};function N(i,c,m){var g,l={},v=null,C=null;m!==void 0&&(v=""+m),c.key!==void 0&&(v=""+c.key),c.ref!==void 0&&(C=c.ref);for(g in c)S.call(c,g)&&!P.hasOwnProperty(g)&&(l[g]=c[g]);if(i&&i.defaultProps)for(g in c=i.defaultProps,c)l[g]===void 0&&(l[g]=c[g]);return{$$typeof:s,type:i,key:v,ref:C,props:l,_owner:M.current}}return Xn.Fragment=p,Xn.jsx=N,Xn.jsxs=N,Xn}var _h;function Kp(){return _h||(_h=1,aa.exports=Vp()),aa.exports}var _=Kp(),uo={},ua={exports:{}},qt={},ha={exports:{}},da={};/**
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 mh;function Gp(){return mh||(mh=1,(function(n){function s(V,I){var $=V.length;V.push(I);e:for(;0<$;){var O=$-1>>>1,U=V[O];if(0<M(U,I))V[O]=I,V[$]=U,$=O;else break e}}function p(V){return V.length===0?null:V[0]}function S(V){if(V.length===0)return null;var I=V[0],$=V.pop();if($!==I){V[0]=$;e:for(var O=0,U=V.length,K=U>>>1;O<K;){var ee=2*(O+1)-1,ne=V[ee],Q=ee+1,q=V[Q];if(0>M(ne,$))Q<U&&0>M(q,ne)?(V[O]=q,V[Q]=$,O=Q):(V[O]=ne,V[ee]=$,O=ee);else if(Q<U&&0>M(q,$))V[O]=q,V[Q]=$,O=Q;else break e}}return I}function M(V,I){var $=V.sortIndex-I.sortIndex;return $!==0?$:V.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var P=performance;n.unstable_now=function(){return P.now()}}else{var N=Date,i=N.now();n.unstable_now=function(){return N.now()-i}}var c=[],m=[],g=1,l=null,v=3,C=!1,b=!1,f=!1,o=typeof setTimeout=="function"?setTimeout:null,u=typeof clearTimeout=="function"?clearTimeout:null,a=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(V){for(var I=p(m);I!==null;){if(I.callback===null)S(m);else if(I.startTime<=V)S(m),I.sortIndex=I.expirationTime,s(c,I);else break;I=p(m)}}function y(V){if(f=!1,h(V),!b)if(p(c)!==null)b=!0,Z(L);else{var I=p(m);I!==null&&Y(y,I.startTime-V)}}function L(V,I){b=!1,f&&(f=!1,u(x),x=-1),C=!0;var $=v;try{for(h(I),l=p(c);l!==null&&(!(l.expirationTime>I)||V&&!j());){var O=l.callback;if(typeof O=="function"){l.callback=null,v=l.priorityLevel;var U=O(l.expirationTime<=I);I=n.unstable_now(),typeof U=="function"?l.callback=U:l===p(c)&&S(c),h(I)}else S(c);l=p(c)}if(l!==null)var K=!0;else{var ee=p(m);ee!==null&&Y(y,ee.startTime-I),K=!1}return K}finally{l=null,v=$,C=!1}}var k=!1,A=null,x=-1,E=5,T=-1;function j(){return!(n.unstable_now()-T<E)}function D(){if(A!==null){var V=n.unstable_now();T=V;var I=!0;try{I=A(!0,V)}finally{I?B():(k=!1,A=null)}}else k=!1}var B;if(typeof a=="function")B=function(){a(D)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,X=z.port2;z.port1.onmessage=D,B=function(){X.postMessage(null)}}else B=function(){o(D,0)};function Z(V){A=V,k||(k=!0,B())}function Y(V,I){x=o(function(){V(n.unstable_now())},I)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(V){V.callback=null},n.unstable_continueExecution=function(){b||C||(b=!0,Z(L))},n.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<V?Math.floor(1e3/V):5},n.unstable_getCurrentPriorityLevel=function(){return v},n.unstable_getFirstCallbackNode=function(){return p(c)},n.unstable_next=function(V){switch(v){case 1:case 2:case 3:var I=3;break;default:I=v}var $=v;v=I;try{return V()}finally{v=$}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(V,I){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var $=v;v=V;try{return I()}finally{v=$}},n.unstable_scheduleCallback=function(V,I,$){var O=n.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?O+$:O):$=O,V){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=$+U,V={id:g++,callback:I,priorityLevel:V,startTime:$,expirationTime:U,sortIndex:-1},$>O?(V.sortIndex=$,s(m,V),p(c)===null&&V===p(m)&&(f?(u(x),x=-1):f=!0,Y(y,$-O))):(V.sortIndex=U,s(c,V),b||C||(b=!0,Z(L))),V},n.unstable_shouldYield=j,n.unstable_wrapCallback=function(V){var I=v;return function(){var $=v;v=I;try{return V.apply(this,arguments)}finally{v=$}}}})(da)),da}var gh;function Xp(){return gh||(gh=1,ha.exports=Gp()),ha.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 vh;function Yp(){if(vh)return qt;vh=1;var n=Ha(),s=Xp();function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var S=new Set,M={};function P(e,t){N(e,t),N(e+"Capture",t)}function N(e,t){for(M[e]=t,e=0;e<t.length;e++)S.add(t[e])}var i=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,m=/^[: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]*$/,g={},l={};function v(e){return c.call(l,e)?!0:c.call(g,e)?!1:m.test(e)?l[e]=!0:(g[e]=!0,!1)}function C(e,t,r,d){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return d?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function b(e,t,r,d){if(t===null||typeof t>"u"||C(e,t,r,d))return!0;if(d)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function f(e,t,r,d,w,R,W){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=d,this.attributeNamespace=w,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=R,this.removeEmptyString=W}var o={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){o[e]=new f(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];o[t]=new f(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){o[e]=new f(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){o[e]=new f(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){o[e]=new f(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){o[e]=new f(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){o[e]=new f(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){o[e]=new f(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){o[e]=new f(e,5,!1,e.toLowerCase(),null,!1,!1)});var u=/[\-:]([a-z])/g;function a(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(u,a);o[t]=new f(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(u,a);o[t]=new f(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(u,a);o[t]=new f(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){o[e]=new f(e,1,!1,e.toLowerCase(),null,!1,!1)}),o.xlinkHref=new f("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){o[e]=new f(e,1,!1,e.toLowerCase(),null,!0,!0)});function h(e,t,r,d){var w=o.hasOwnProperty(t)?o[t]:null;(w!==null?w.type!==0:d||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(b(t,r,w,d)&&(r=null),d||w===null?v(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):w.mustUseProperty?e[w.propertyName]=r===null?w.type===3?!1:"":r:(t=w.attributeName,d=w.attributeNamespace,r===null?e.removeAttribute(t):(w=w.type,r=w===3||w===4&&r===!0?"":""+r,d?e.setAttributeNS(d,t,r):e.setAttribute(t,r))))}var y=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,L=Symbol.for("react.element"),k=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),j=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),V=Symbol.iterator;function I(e){return e===null||typeof e!="object"?null:(e=V&&e[V]||e["@@iterator"],typeof e=="function"?e:null)}var $=Object.assign,O;function U(e){if(O===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);O=t&&t[1]||""}return`
34
- `+O+e}var K=!1;function ee(e,t){if(!e||K)return"";K=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(le){var d=le}Reflect.construct(e,[],t)}else{try{t.call()}catch(le){d=le}e.call(t.prototype)}else{try{throw Error()}catch(le){d=le}e()}}catch(le){if(le&&d&&typeof le.stack=="string"){for(var w=le.stack.split(`
35
- `),R=d.stack.split(`
36
- `),W=w.length-1,G=R.length-1;1<=W&&0<=G&&w[W]!==R[G];)G--;for(;1<=W&&0<=G;W--,G--)if(w[W]!==R[G]){if(W!==1||G!==1)do if(W--,G--,0>G||w[W]!==R[G]){var J=`
37
- `+w[W].replace(" at new "," at ");return e.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",e.displayName)),J}while(1<=W&&0<=G);break}}}finally{K=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?U(e):""}function ne(e){switch(e.tag){case 5:return U(e.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return e=ee(e.type,!1),e;case 11:return e=ee(e.type.render,!1),e;case 1:return e=ee(e.type,!0),e;default:return""}}function Q(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 A:return"Fragment";case k:return"Portal";case E:return"Profiler";case x:return"StrictMode";case B:return"Suspense";case z:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case j:return(e.displayName||"Context")+".Consumer";case T:return(e._context.displayName||"Context")+".Provider";case D:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case X:return t=e.displayName||null,t!==null?t:Q(e.type)||"Memo";case Z:t=e._payload,e=e._init;try{return Q(e(t))}catch{}}return null}function q(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 Q(t);case 8:return t===x?"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 H(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function re(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function te(e){var t=re(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),d=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var w=r.get,R=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return w.call(this)},set:function(W){d=""+W,R.call(this,W)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return d},setValue:function(W){d=""+W},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function he(e){e._valueTracker||(e._valueTracker=te(e))}function de(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),d="";return e&&(d=re(e)?e.checked?"true":"false":e.value),e=d,e!==r?(t.setValue(e),!0):!1}function Te(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 r=t.checked;return $({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function He(e,t){var r=t.defaultValue==null?"":t.defaultValue,d=t.checked!=null?t.checked:t.defaultChecked;r=H(t.value!=null?t.value:r),e._wrapperState={initialChecked:d,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Qe(e,t){t=t.checked,t!=null&&h(e,"checked",t,!1)}function ce(e,t){Qe(e,t);var r=H(t.value),d=t.type;if(r!=null)d==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(d==="submit"||d==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ot(e,t.type,r):t.hasOwnProperty("defaultValue")&&ot(e,t.type,H(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ze(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var d=t.type;if(!(d!=="submit"&&d!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function ot(e,t,r){(t!=="number"||Te(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Oe=Array.isArray;function Re(e,t,r,d){if(e=e.options,t){t={};for(var w=0;w<r.length;w++)t["$"+r[w]]=!0;for(r=0;r<e.length;r++)w=t.hasOwnProperty("$"+e[r].value),e[r].selected!==w&&(e[r].selected=w),w&&d&&(e[r].defaultSelected=!0)}else{for(r=""+H(r),t=null,w=0;w<e.length;w++){if(e[w].value===r){e[w].selected=!0,d&&(e[w].defaultSelected=!0);return}t!==null||e[w].disabled||(t=e[w])}t!==null&&(t.selected=!0)}}function Ie(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(p(91));return $({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function we(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(p(92));if(Oe(r)){if(1<r.length)throw Error(p(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:H(r)}}function We(e,t){var r=H(t.value),d=H(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),d!=null&&(e.defaultValue=""+d)}function et(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ve(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 ht(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ve(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Je,St=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,d,w){MSApp.execUnsafeLocalFunction(function(){return e(t,r,d,w)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Je=Je||document.createElement("div"),Je.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Je.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function tt(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var me={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},Ce=["Webkit","ms","Moz","O"];Object.keys(me).forEach(function(e){Ce.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),me[t]=me[e]})});function rt(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||me.hasOwnProperty(e)&&me[e]?(""+t).trim():t+"px"}function ye(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var d=r.indexOf("--")===0,w=rt(r,t[r],d);r==="float"&&(r="cssFloat"),d?e.setProperty(r,w):e[r]=w}}var Ye=$({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 it(e,t){if(t){if(Ye[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(p(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(p(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(p(61))}if(t.style!=null&&typeof t.style!="object")throw Error(p(62))}}function dt(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 Ke=null;function lt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ue=null,De=null,Fe=null;function Sr(e){if(e=Nn(e)){if(typeof ue!="function")throw Error(p(280));var t=e.stateNode;t&&(t=ki(t),ue(e.stateNode,e.type,t))}}function qe(e){De?Fe?Fe.push(e):Fe=[e]:De=e}function Cr(){if(De){var e=De,t=Fe;if(Fe=De=null,Sr(e),t)for(e=0;e<t.length;e++)Sr(t[e])}}function os(e,t){return e(t)}function Br(){}var or=!1;function Fr(e,t,r){if(or)return e(t,r);or=!0;try{return os(e,t,r)}finally{or=!1,(De!==null||Fe!==null)&&(Br(),Cr())}}function lr(e,t){var r=e.stateNode;if(r===null)return null;var d=ki(r);if(d===null)return null;r=d[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":(d=!d.disabled)||(e=e.type,d=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!d;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(p(231,t,typeof r));return r}var Pt=!1;if(i)try{var ar={};Object.defineProperty(ar,"passive",{get:function(){Pt=!0}}),window.addEventListener("test",ar,ar),window.removeEventListener("test",ar,ar)}catch{Pt=!1}function dn(e,t,r,d,w,R,W,G,J){var le=Array.prototype.slice.call(arguments,3);try{t.apply(r,le)}catch(pe){this.onError(pe)}}var Jt=!1,jt=null,bs=!1,ks=null,fn={onError:function(e){Jt=!0,jt=e}};function Ot(e,t,r,d,w,R,W,G,J){Jt=!1,jt=null,dn.apply(fn,arguments)}function Eo(e,t,r,d,w,R,W,G,J){if(Ot.apply(this,arguments),Jt){if(Jt){var le=jt;Jt=!1,jt=null}else throw Error(p(198));bs||(bs=!0,ks=le)}}function Rr(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function ri(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 si(e){if(Rr(e)!==e)throw Error(p(188))}function Lo(e){var t=e.alternate;if(!t){if(t=Rr(e),t===null)throw Error(p(188));return t!==e?null:e}for(var r=e,d=t;;){var w=r.return;if(w===null)break;var R=w.alternate;if(R===null){if(d=w.return,d!==null){r=d;continue}break}if(w.child===R.child){for(R=w.child;R;){if(R===r)return si(w),e;if(R===d)return si(w),t;R=R.sibling}throw Error(p(188))}if(r.return!==d.return)r=w,d=R;else{for(var W=!1,G=w.child;G;){if(G===r){W=!0,r=w,d=R;break}if(G===d){W=!0,d=w,r=R;break}G=G.sibling}if(!W){for(G=R.child;G;){if(G===r){W=!0,r=R,d=w;break}if(G===d){W=!0,d=R,r=w;break}G=G.sibling}if(!W)throw Error(p(189))}}if(r.alternate!==d)throw Error(p(190))}if(r.tag!==3)throw Error(p(188));return r.stateNode.current===r?e:t}function pn(e){return e=Lo(e),e!==null?_n(e):null}function _n(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=_n(e);if(t!==null)return t;e=e.sibling}return null}var mn=s.unstable_scheduleCallback,gn=s.unstable_cancelCallback,Ro=s.unstable_shouldYield,Mo=s.unstable_requestPaint,_t=s.unstable_now,ni=s.unstable_getCurrentPriorityLevel,Es=s.unstable_ImmediatePriority,Ls=s.unstable_UserBlockingPriority,$r=s.unstable_NormalPriority,Ao=s.unstable_LowPriority,ii=s.unstable_IdlePriority,Rs=null,Vt=null;function wr(e){if(Vt&&typeof Vt.onCommitFiberRoot=="function")try{Vt.onCommitFiberRoot(Rs,e,void 0,(e.current.flags&128)===128)}catch{}}var Kt=Math.clz32?Math.clz32:li,ls=Math.log,oi=Math.LN2;function li(e){return e>>>=0,e===0?32:31-(ls(e)/oi|0)|0}var as=64,Ms=4194304;function cs(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 As(e,t){var r=e.pendingLanes;if(r===0)return 0;var d=0,w=e.suspendedLanes,R=e.pingedLanes,W=r&268435455;if(W!==0){var G=W&~w;G!==0?d=cs(G):(R&=W,R!==0&&(d=cs(R)))}else W=r&~w,W!==0?d=cs(W):R!==0&&(d=cs(R));if(d===0)return 0;if(t!==0&&t!==d&&(t&w)===0&&(w=d&-d,R=t&-t,w>=R||w===16&&(R&4194240)!==0))return t;if((d&4)!==0&&(d|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=d;0<t;)r=31-Kt(t),w=1<<r,d|=e[r],t&=~w;return d}function To(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 Do(e,t){for(var r=e.suspendedLanes,d=e.pingedLanes,w=e.expirationTimes,R=e.pendingLanes;0<R;){var W=31-Kt(R),G=1<<W,J=w[W];J===-1?((G&r)===0||(G&d)!==0)&&(w[W]=To(G,t)):J<=t&&(e.expiredLanes|=G),R&=~G}}function xr(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function ai(){var e=as;return as<<=1,(as&4194240)===0&&(as=64),e}function Ts(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function us(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Kt(t),e[t]=r}function Io(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var d=e.eventTimes;for(e=e.expirationTimes;0<r;){var w=31-Kt(r),R=1<<w;t[w]=0,d[w]=-1,e[w]=-1,r&=~R}}function vn(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var d=31-Kt(r),w=1<<d;w&t|e[d]&t&&(e[d]|=t),r&=~w}}var nt=0;function ci(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Ds,Is,Ns,yn,ui,Ps=!1,hs=[],ae=null,Se=null,Ge=null,cr=new Map,Mr=new Map,Hr=[],uf="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 Xa(e,t){switch(e){case"focusin":case"focusout":ae=null;break;case"dragenter":case"dragleave":Se=null;break;case"mouseover":case"mouseout":Ge=null;break;case"pointerover":case"pointerout":cr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mr.delete(t.pointerId)}}function Sn(e,t,r,d,w,R){return e===null||e.nativeEvent!==R?(e={blockedOn:t,domEventName:r,eventSystemFlags:d,nativeEvent:R,targetContainers:[w]},t!==null&&(t=Nn(t),t!==null&&Is(t)),e):(e.eventSystemFlags|=d,t=e.targetContainers,w!==null&&t.indexOf(w)===-1&&t.push(w),e)}function hf(e,t,r,d,w){switch(t){case"focusin":return ae=Sn(ae,e,t,r,d,w),!0;case"dragenter":return Se=Sn(Se,e,t,r,d,w),!0;case"mouseover":return Ge=Sn(Ge,e,t,r,d,w),!0;case"pointerover":var R=w.pointerId;return cr.set(R,Sn(cr.get(R)||null,e,t,r,d,w)),!0;case"gotpointercapture":return R=w.pointerId,Mr.set(R,Sn(Mr.get(R)||null,e,t,r,d,w)),!0}return!1}function Ya(e){var t=ds(e.target);if(t!==null){var r=Rr(t);if(r!==null){if(t=r.tag,t===13){if(t=ri(r),t!==null){e.blockedOn=t,ui(e.priority,function(){Ns(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function hi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Po(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var d=new r.constructor(r.type,r);Ke=d,r.target.dispatchEvent(d),Ke=null}else return t=Nn(r),t!==null&&Is(t),e.blockedOn=r,!1;t.shift()}return!0}function Qa(e,t,r){hi(e)&&r.delete(t)}function df(){Ps=!1,ae!==null&&hi(ae)&&(ae=null),Se!==null&&hi(Se)&&(Se=null),Ge!==null&&hi(Ge)&&(Ge=null),cr.forEach(Qa),Mr.forEach(Qa)}function Cn(e,t){e.blockedOn===t&&(e.blockedOn=null,Ps||(Ps=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,df)))}function wn(e){function t(w){return Cn(w,e)}if(0<hs.length){Cn(hs[0],e);for(var r=1;r<hs.length;r++){var d=hs[r];d.blockedOn===e&&(d.blockedOn=null)}}for(ae!==null&&Cn(ae,e),Se!==null&&Cn(Se,e),Ge!==null&&Cn(Ge,e),cr.forEach(t),Mr.forEach(t),r=0;r<Hr.length;r++)d=Hr[r],d.blockedOn===e&&(d.blockedOn=null);for(;0<Hr.length&&(r=Hr[0],r.blockedOn===null);)Ya(r),r.blockedOn===null&&Hr.shift()}var js=y.ReactCurrentBatchConfig,di=!0;function ff(e,t,r,d){var w=nt,R=js.transition;js.transition=null;try{nt=1,No(e,t,r,d)}finally{nt=w,js.transition=R}}function pf(e,t,r,d){var w=nt,R=js.transition;js.transition=null;try{nt=4,No(e,t,r,d)}finally{nt=w,js.transition=R}}function No(e,t,r,d){if(di){var w=Po(e,t,r,d);if(w===null)Jo(e,t,d,fi,r),Xa(e,d);else if(hf(w,e,t,r,d))d.stopPropagation();else if(Xa(e,d),t&4&&-1<uf.indexOf(e)){for(;w!==null;){var R=Nn(w);if(R!==null&&Ds(R),R=Po(e,t,r,d),R===null&&Jo(e,t,d,fi,r),R===w)break;w=R}w!==null&&d.stopPropagation()}else Jo(e,t,d,null,r)}}var fi=null;function Po(e,t,r,d){if(fi=null,e=lt(d),e=ds(e),e!==null)if(t=Rr(e),t===null)e=null;else if(r=t.tag,r===13){if(e=ri(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return fi=e,null}function Ja(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(ni()){case Es:return 1;case Ls:return 4;case $r:case Ao:return 16;case ii:return 536870912;default:return 16}default:return 16}}var Wr=null,jo=null,pi=null;function Za(){if(pi)return pi;var e,t=jo,r=t.length,d,w="value"in Wr?Wr.value:Wr.textContent,R=w.length;for(e=0;e<r&&t[e]===w[e];e++);var W=r-e;for(d=1;d<=W&&t[r-d]===w[R-d];d++);return pi=w.slice(e,1<d?1-d:void 0)}function _i(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 mi(){return!0}function ec(){return!1}function Gt(e){function t(r,d,w,R,W){this._reactName=r,this._targetInst=w,this.type=d,this.nativeEvent=R,this.target=W,this.currentTarget=null;for(var G in e)e.hasOwnProperty(G)&&(r=e[G],this[G]=r?r(R):R[G]);return this.isDefaultPrevented=(R.defaultPrevented!=null?R.defaultPrevented:R.returnValue===!1)?mi:ec,this.isPropagationStopped=ec,this}return $(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=mi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=mi)},persist:function(){},isPersistent:mi}),t}var Os={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Oo=Gt(Os),xn=$({},Os,{view:0,detail:0}),_f=Gt(xn),Bo,Fo,bn,gi=$({},xn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ho,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!==bn&&(bn&&e.type==="mousemove"?(Bo=e.screenX-bn.screenX,Fo=e.screenY-bn.screenY):Fo=Bo=0,bn=e),Bo)},movementY:function(e){return"movementY"in e?e.movementY:Fo}}),tc=Gt(gi),mf=$({},gi,{dataTransfer:0}),gf=Gt(mf),vf=$({},xn,{relatedTarget:0}),$o=Gt(vf),yf=$({},Os,{animationName:0,elapsedTime:0,pseudoElement:0}),Sf=Gt(yf),Cf=$({},Os,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),wf=Gt(Cf),xf=$({},Os,{data:0}),rc=Gt(xf),bf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kf={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"},Ef={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Lf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ef[e])?!!t[e]:!1}function Ho(){return Lf}var Rf=$({},xn,{key:function(e){if(e.key){var t=bf[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=_i(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?kf[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ho,charCode:function(e){return e.type==="keypress"?_i(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?_i(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Mf=Gt(Rf),Af=$({},gi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sc=Gt(Af),Tf=$({},xn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ho}),Df=Gt(Tf),If=$({},Os,{propertyName:0,elapsedTime:0,pseudoElement:0}),Nf=Gt(If),Pf=$({},gi,{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}),jf=Gt(Pf),Of=[9,13,27,32],Wo=i&&"CompositionEvent"in window,kn=null;i&&"documentMode"in document&&(kn=document.documentMode);var Bf=i&&"TextEvent"in window&&!kn,nc=i&&(!Wo||kn&&8<kn&&11>=kn),ic=" ",oc=!1;function lc(e,t){switch(e){case"keyup":return Of.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ac(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bs=!1;function Ff(e,t){switch(e){case"compositionend":return ac(t);case"keypress":return t.which!==32?null:(oc=!0,ic);case"textInput":return e=t.data,e===ic&&oc?null:e;default:return null}}function $f(e,t){if(Bs)return e==="compositionend"||!Wo&&lc(e,t)?(e=Za(),pi=jo=Wr=null,Bs=!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 nc&&t.locale!=="ko"?null:t.data;default:return null}}var Hf={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 cc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Hf[e.type]:t==="textarea"}function uc(e,t,r,d){qe(d),t=wi(t,"onChange"),0<t.length&&(r=new Oo("onChange","change",null,r,d),e.push({event:r,listeners:t}))}var En=null,Ln=null;function Wf(e){Rc(e,0)}function vi(e){var t=Us(e);if(de(t))return e}function Uf(e,t){if(e==="change")return t}var hc=!1;if(i){var Uo;if(i){var zo="oninput"in document;if(!zo){var dc=document.createElement("div");dc.setAttribute("oninput","return;"),zo=typeof dc.oninput=="function"}Uo=zo}else Uo=!1;hc=Uo&&(!document.documentMode||9<document.documentMode)}function fc(){En&&(En.detachEvent("onpropertychange",pc),Ln=En=null)}function pc(e){if(e.propertyName==="value"&&vi(Ln)){var t=[];uc(t,Ln,e,lt(e)),Fr(Wf,t)}}function zf(e,t,r){e==="focusin"?(fc(),En=t,Ln=r,En.attachEvent("onpropertychange",pc)):e==="focusout"&&fc()}function qf(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return vi(Ln)}function Vf(e,t){if(e==="click")return vi(t)}function Kf(e,t){if(e==="input"||e==="change")return vi(t)}function Gf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ur=typeof Object.is=="function"?Object.is:Gf;function Rn(e,t){if(ur(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),d=Object.keys(t);if(r.length!==d.length)return!1;for(d=0;d<r.length;d++){var w=r[d];if(!c.call(t,w)||!ur(e[w],t[w]))return!1}return!0}function _c(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mc(e,t){var r=_c(e);e=0;for(var d;r;){if(r.nodeType===3){if(d=e+r.textContent.length,e<=t&&d>=t)return{node:r,offset:t-e};e=d}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=_c(r)}}function gc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vc(){for(var e=window,t=Te();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Te(e.document)}return t}function qo(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 Xf(e){var t=vc(),r=e.focusedElem,d=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&gc(r.ownerDocument.documentElement,r)){if(d!==null&&qo(r)){if(t=d.start,e=d.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var w=r.textContent.length,R=Math.min(d.start,w);d=d.end===void 0?R:Math.min(d.end,w),!e.extend&&R>d&&(w=d,d=R,R=w),w=mc(r,R);var W=mc(r,d);w&&W&&(e.rangeCount!==1||e.anchorNode!==w.node||e.anchorOffset!==w.offset||e.focusNode!==W.node||e.focusOffset!==W.offset)&&(t=t.createRange(),t.setStart(w.node,w.offset),e.removeAllRanges(),R>d?(e.addRange(t),e.extend(W.node,W.offset)):(t.setEnd(W.node,W.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Yf=i&&"documentMode"in document&&11>=document.documentMode,Fs=null,Vo=null,Mn=null,Ko=!1;function yc(e,t,r){var d=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ko||Fs==null||Fs!==Te(d)||(d=Fs,"selectionStart"in d&&qo(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Mn&&Rn(Mn,d)||(Mn=d,d=wi(Vo,"onSelect"),0<d.length&&(t=new Oo("onSelect","select",null,t,r),e.push({event:t,listeners:d}),t.target=Fs)))}function yi(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var $s={animationend:yi("Animation","AnimationEnd"),animationiteration:yi("Animation","AnimationIteration"),animationstart:yi("Animation","AnimationStart"),transitionend:yi("Transition","TransitionEnd")},Go={},Sc={};i&&(Sc=document.createElement("div").style,"AnimationEvent"in window||(delete $s.animationend.animation,delete $s.animationiteration.animation,delete $s.animationstart.animation),"TransitionEvent"in window||delete $s.transitionend.transition);function Si(e){if(Go[e])return Go[e];if(!$s[e])return e;var t=$s[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Sc)return Go[e]=t[r];return e}var Cc=Si("animationend"),wc=Si("animationiteration"),xc=Si("animationstart"),bc=Si("transitionend"),kc=new Map,Ec="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 Ur(e,t){kc.set(e,t),P(t,[e])}for(var Xo=0;Xo<Ec.length;Xo++){var Yo=Ec[Xo],Qf=Yo.toLowerCase(),Jf=Yo[0].toUpperCase()+Yo.slice(1);Ur(Qf,"on"+Jf)}Ur(Cc,"onAnimationEnd"),Ur(wc,"onAnimationIteration"),Ur(xc,"onAnimationStart"),Ur("dblclick","onDoubleClick"),Ur("focusin","onFocus"),Ur("focusout","onBlur"),Ur(bc,"onTransitionEnd"),N("onMouseEnter",["mouseout","mouseover"]),N("onMouseLeave",["mouseout","mouseover"]),N("onPointerEnter",["pointerout","pointerover"]),N("onPointerLeave",["pointerout","pointerover"]),P("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),P("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),P("onBeforeInput",["compositionend","keypress","textInput","paste"]),P("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),P("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),P("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var An="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(" "),Zf=new Set("cancel close invalid load scroll toggle".split(" ").concat(An));function Lc(e,t,r){var d=e.type||"unknown-event";e.currentTarget=r,Eo(d,t,void 0,e),e.currentTarget=null}function Rc(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var d=e[r],w=d.event;d=d.listeners;e:{var R=void 0;if(t)for(var W=d.length-1;0<=W;W--){var G=d[W],J=G.instance,le=G.currentTarget;if(G=G.listener,J!==R&&w.isPropagationStopped())break e;Lc(w,G,le),R=J}else for(W=0;W<d.length;W++){if(G=d[W],J=G.instance,le=G.currentTarget,G=G.listener,J!==R&&w.isPropagationStopped())break e;Lc(w,G,le),R=J}}}if(bs)throw e=ks,bs=!1,ks=null,e}function ct(e,t){var r=t[nl];r===void 0&&(r=t[nl]=new Set);var d=e+"__bubble";r.has(d)||(Mc(t,e,2,!1),r.add(d))}function Qo(e,t,r){var d=0;t&&(d|=4),Mc(r,e,d,t)}var Ci="_reactListening"+Math.random().toString(36).slice(2);function Tn(e){if(!e[Ci]){e[Ci]=!0,S.forEach(function(r){r!=="selectionchange"&&(Zf.has(r)||Qo(r,!1,e),Qo(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ci]||(t[Ci]=!0,Qo("selectionchange",!1,t))}}function Mc(e,t,r,d){switch(Ja(t)){case 1:var w=ff;break;case 4:w=pf;break;default:w=No}r=w.bind(null,t,r,e),w=void 0,!Pt||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(w=!0),d?w!==void 0?e.addEventListener(t,r,{capture:!0,passive:w}):e.addEventListener(t,r,!0):w!==void 0?e.addEventListener(t,r,{passive:w}):e.addEventListener(t,r,!1)}function Jo(e,t,r,d,w){var R=d;if((t&1)===0&&(t&2)===0&&d!==null)e:for(;;){if(d===null)return;var W=d.tag;if(W===3||W===4){var G=d.stateNode.containerInfo;if(G===w||G.nodeType===8&&G.parentNode===w)break;if(W===4)for(W=d.return;W!==null;){var J=W.tag;if((J===3||J===4)&&(J=W.stateNode.containerInfo,J===w||J.nodeType===8&&J.parentNode===w))return;W=W.return}for(;G!==null;){if(W=ds(G),W===null)return;if(J=W.tag,J===5||J===6){d=R=W;continue e}G=G.parentNode}}d=d.return}Fr(function(){var le=R,pe=lt(r),_e=[];e:{var fe=kc.get(e);if(fe!==void 0){var xe=Oo,Le=e;switch(e){case"keypress":if(_i(r)===0)break e;case"keydown":case"keyup":xe=Mf;break;case"focusin":Le="focus",xe=$o;break;case"focusout":Le="blur",xe=$o;break;case"beforeblur":case"afterblur":xe=$o;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":xe=tc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":xe=gf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":xe=Df;break;case Cc:case wc:case xc:xe=Sf;break;case bc:xe=Nf;break;case"scroll":xe=_f;break;case"wheel":xe=jf;break;case"copy":case"cut":case"paste":xe=wf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":xe=sc}var Me=(t&4)!==0,Ct=!Me&&e==="scroll",ie=Me?fe!==null?fe+"Capture":null:fe;Me=[];for(var se=le,oe;se!==null;){oe=se;var ge=oe.stateNode;if(oe.tag===5&&ge!==null&&(oe=ge,ie!==null&&(ge=lr(se,ie),ge!=null&&Me.push(Dn(se,ge,oe)))),Ct)break;se=se.return}0<Me.length&&(fe=new xe(fe,Le,null,r,pe),_e.push({event:fe,listeners:Me}))}}if((t&7)===0){e:{if(fe=e==="mouseover"||e==="pointerover",xe=e==="mouseout"||e==="pointerout",fe&&r!==Ke&&(Le=r.relatedTarget||r.fromElement)&&(ds(Le)||Le[Ar]))break e;if((xe||fe)&&(fe=pe.window===pe?pe:(fe=pe.ownerDocument)?fe.defaultView||fe.parentWindow:window,xe?(Le=r.relatedTarget||r.toElement,xe=le,Le=Le?ds(Le):null,Le!==null&&(Ct=Rr(Le),Le!==Ct||Le.tag!==5&&Le.tag!==6)&&(Le=null)):(xe=null,Le=le),xe!==Le)){if(Me=tc,ge="onMouseLeave",ie="onMouseEnter",se="mouse",(e==="pointerout"||e==="pointerover")&&(Me=sc,ge="onPointerLeave",ie="onPointerEnter",se="pointer"),Ct=xe==null?fe:Us(xe),oe=Le==null?fe:Us(Le),fe=new Me(ge,se+"leave",xe,r,pe),fe.target=Ct,fe.relatedTarget=oe,ge=null,ds(pe)===le&&(Me=new Me(ie,se+"enter",Le,r,pe),Me.target=oe,Me.relatedTarget=Ct,ge=Me),Ct=ge,xe&&Le)t:{for(Me=xe,ie=Le,se=0,oe=Me;oe;oe=Hs(oe))se++;for(oe=0,ge=ie;ge;ge=Hs(ge))oe++;for(;0<se-oe;)Me=Hs(Me),se--;for(;0<oe-se;)ie=Hs(ie),oe--;for(;se--;){if(Me===ie||ie!==null&&Me===ie.alternate)break t;Me=Hs(Me),ie=Hs(ie)}Me=null}else Me=null;xe!==null&&Ac(_e,fe,xe,Me,!1),Le!==null&&Ct!==null&&Ac(_e,Ct,Le,Me,!0)}}e:{if(fe=le?Us(le):window,xe=fe.nodeName&&fe.nodeName.toLowerCase(),xe==="select"||xe==="input"&&fe.type==="file")var Ae=Uf;else if(cc(fe))if(hc)Ae=Kf;else{Ae=qf;var Ne=zf}else(xe=fe.nodeName)&&xe.toLowerCase()==="input"&&(fe.type==="checkbox"||fe.type==="radio")&&(Ae=Vf);if(Ae&&(Ae=Ae(e,le))){uc(_e,Ae,r,pe);break e}Ne&&Ne(e,fe,le),e==="focusout"&&(Ne=fe._wrapperState)&&Ne.controlled&&fe.type==="number"&&ot(fe,"number",fe.value)}switch(Ne=le?Us(le):window,e){case"focusin":(cc(Ne)||Ne.contentEditable==="true")&&(Fs=Ne,Vo=le,Mn=null);break;case"focusout":Mn=Vo=Fs=null;break;case"mousedown":Ko=!0;break;case"contextmenu":case"mouseup":case"dragend":Ko=!1,yc(_e,r,pe);break;case"selectionchange":if(Yf)break;case"keydown":case"keyup":yc(_e,r,pe)}var Pe;if(Wo)e:{switch(e){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else Bs?lc(e,r)&&($e="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&($e="onCompositionStart");$e&&(nc&&r.locale!=="ko"&&(Bs||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&Bs&&(Pe=Za()):(Wr=pe,jo="value"in Wr?Wr.value:Wr.textContent,Bs=!0)),Ne=wi(le,$e),0<Ne.length&&($e=new rc($e,e,null,r,pe),_e.push({event:$e,listeners:Ne}),Pe?$e.data=Pe:(Pe=ac(r),Pe!==null&&($e.data=Pe)))),(Pe=Bf?Ff(e,r):$f(e,r))&&(le=wi(le,"onBeforeInput"),0<le.length&&(pe=new rc("onBeforeInput","beforeinput",null,r,pe),_e.push({event:pe,listeners:le}),pe.data=Pe))}Rc(_e,t)})}function Dn(e,t,r){return{instance:e,listener:t,currentTarget:r}}function wi(e,t){for(var r=t+"Capture",d=[];e!==null;){var w=e,R=w.stateNode;w.tag===5&&R!==null&&(w=R,R=lr(e,r),R!=null&&d.unshift(Dn(e,R,w)),R=lr(e,t),R!=null&&d.push(Dn(e,R,w))),e=e.return}return d}function Hs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ac(e,t,r,d,w){for(var R=t._reactName,W=[];r!==null&&r!==d;){var G=r,J=G.alternate,le=G.stateNode;if(J!==null&&J===d)break;G.tag===5&&le!==null&&(G=le,w?(J=lr(r,R),J!=null&&W.unshift(Dn(r,J,G))):w||(J=lr(r,R),J!=null&&W.push(Dn(r,J,G)))),r=r.return}W.length!==0&&e.push({event:t,listeners:W})}var ep=/\r\n?/g,tp=/\u0000|\uFFFD/g;function Tc(e){return(typeof e=="string"?e:""+e).replace(ep,`
38
- `).replace(tp,"")}function xi(e,t,r){if(t=Tc(t),Tc(e)!==t&&r)throw Error(p(425))}function bi(){}var Zo=null,el=null;function tl(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 rl=typeof setTimeout=="function"?setTimeout:void 0,rp=typeof clearTimeout=="function"?clearTimeout:void 0,Dc=typeof Promise=="function"?Promise:void 0,sp=typeof queueMicrotask=="function"?queueMicrotask:typeof Dc<"u"?function(e){return Dc.resolve(null).then(e).catch(np)}:rl;function np(e){setTimeout(function(){throw e})}function sl(e,t){var r=t,d=0;do{var w=r.nextSibling;if(e.removeChild(r),w&&w.nodeType===8)if(r=w.data,r==="/$"){if(d===0){e.removeChild(w),wn(t);return}d--}else r!=="$"&&r!=="$?"&&r!=="$!"||d++;r=w}while(r);wn(t)}function zr(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 Ic(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Ws=Math.random().toString(36).slice(2),br="__reactFiber$"+Ws,In="__reactProps$"+Ws,Ar="__reactContainer$"+Ws,nl="__reactEvents$"+Ws,ip="__reactListeners$"+Ws,op="__reactHandles$"+Ws;function ds(e){var t=e[br];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Ar]||r[br]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Ic(e);e!==null;){if(r=e[br])return r;e=Ic(e)}return t}e=r,r=e.parentNode}return null}function Nn(e){return e=e[br]||e[Ar],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Us(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(p(33))}function ki(e){return e[In]||null}var il=[],zs=-1;function qr(e){return{current:e}}function ut(e){0>zs||(e.current=il[zs],il[zs]=null,zs--)}function at(e,t){zs++,il[zs]=e.current,e.current=t}var Vr={},At=qr(Vr),$t=qr(!1),fs=Vr;function qs(e,t){var r=e.type.contextTypes;if(!r)return Vr;var d=e.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===t)return d.__reactInternalMemoizedMaskedChildContext;var w={},R;for(R in r)w[R]=t[R];return d&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=w),w}function Ht(e){return e=e.childContextTypes,e!=null}function Ei(){ut($t),ut(At)}function Nc(e,t,r){if(At.current!==Vr)throw Error(p(168));at(At,t),at($t,r)}function Pc(e,t,r){var d=e.stateNode;if(t=t.childContextTypes,typeof d.getChildContext!="function")return r;d=d.getChildContext();for(var w in d)if(!(w in t))throw Error(p(108,q(e)||"Unknown",w));return $({},r,d)}function Li(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vr,fs=At.current,at(At,e),at($t,$t.current),!0}function jc(e,t,r){var d=e.stateNode;if(!d)throw Error(p(169));r?(e=Pc(e,t,fs),d.__reactInternalMemoizedMergedChildContext=e,ut($t),ut(At),at(At,e)):ut($t),at($t,r)}var Tr=null,Ri=!1,ol=!1;function Oc(e){Tr===null?Tr=[e]:Tr.push(e)}function lp(e){Ri=!0,Oc(e)}function Kr(){if(!ol&&Tr!==null){ol=!0;var e=0,t=nt;try{var r=Tr;for(nt=1;e<r.length;e++){var d=r[e];do d=d(!0);while(d!==null)}Tr=null,Ri=!1}catch(w){throw Tr!==null&&(Tr=Tr.slice(e+1)),mn(Es,Kr),w}finally{nt=t,ol=!1}}return null}var Vs=[],Ks=0,Mi=null,Ai=0,Zt=[],er=0,ps=null,Dr=1,Ir="";function _s(e,t){Vs[Ks++]=Ai,Vs[Ks++]=Mi,Mi=e,Ai=t}function Bc(e,t,r){Zt[er++]=Dr,Zt[er++]=Ir,Zt[er++]=ps,ps=e;var d=Dr;e=Ir;var w=32-Kt(d)-1;d&=~(1<<w),r+=1;var R=32-Kt(t)+w;if(30<R){var W=w-w%5;R=(d&(1<<W)-1).toString(32),d>>=W,w-=W,Dr=1<<32-Kt(t)+w|r<<w|d,Ir=R+e}else Dr=1<<R|r<<w|d,Ir=e}function ll(e){e.return!==null&&(_s(e,1),Bc(e,1,0))}function al(e){for(;e===Mi;)Mi=Vs[--Ks],Vs[Ks]=null,Ai=Vs[--Ks],Vs[Ks]=null;for(;e===ps;)ps=Zt[--er],Zt[er]=null,Ir=Zt[--er],Zt[er]=null,Dr=Zt[--er],Zt[er]=null}var Xt=null,Yt=null,ft=!1,hr=null;function Fc(e,t){var r=nr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function $c(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Xt=e,Yt=zr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Xt=e,Yt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=ps!==null?{id:Dr,overflow:Ir}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=nr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Xt=e,Yt=null,!0):!1;default:return!1}}function cl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ul(e){if(ft){var t=Yt;if(t){var r=t;if(!$c(e,t)){if(cl(e))throw Error(p(418));t=zr(r.nextSibling);var d=Xt;t&&$c(e,t)?Fc(d,r):(e.flags=e.flags&-4097|2,ft=!1,Xt=e)}}else{if(cl(e))throw Error(p(418));e.flags=e.flags&-4097|2,ft=!1,Xt=e}}}function Hc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Xt=e}function Ti(e){if(e!==Xt)return!1;if(!ft)return Hc(e),ft=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!tl(e.type,e.memoizedProps)),t&&(t=Yt)){if(cl(e))throw Wc(),Error(p(418));for(;t;)Fc(e,t),t=zr(t.nextSibling)}if(Hc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(p(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Yt=zr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Yt=null}}else Yt=Xt?zr(e.stateNode.nextSibling):null;return!0}function Wc(){for(var e=Yt;e;)e=zr(e.nextSibling)}function Gs(){Yt=Xt=null,ft=!1}function hl(e){hr===null?hr=[e]:hr.push(e)}var ap=y.ReactCurrentBatchConfig;function Pn(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(p(309));var d=r.stateNode}if(!d)throw Error(p(147,e));var w=d,R=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===R?t.ref:(t=function(W){var G=w.refs;W===null?delete G[R]:G[R]=W},t._stringRef=R,t)}if(typeof e!="string")throw Error(p(284));if(!r._owner)throw Error(p(290,e))}return e}function Di(e,t){throw e=Object.prototype.toString.call(t),Error(p(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Uc(e){var t=e._init;return t(e._payload)}function zc(e){function t(ie,se){if(e){var oe=ie.deletions;oe===null?(ie.deletions=[se],ie.flags|=16):oe.push(se)}}function r(ie,se){if(!e)return null;for(;se!==null;)t(ie,se),se=se.sibling;return null}function d(ie,se){for(ie=new Map;se!==null;)se.key!==null?ie.set(se.key,se):ie.set(se.index,se),se=se.sibling;return ie}function w(ie,se){return ie=ts(ie,se),ie.index=0,ie.sibling=null,ie}function R(ie,se,oe){return ie.index=oe,e?(oe=ie.alternate,oe!==null?(oe=oe.index,oe<se?(ie.flags|=2,se):oe):(ie.flags|=2,se)):(ie.flags|=1048576,se)}function W(ie){return e&&ie.alternate===null&&(ie.flags|=2),ie}function G(ie,se,oe,ge){return se===null||se.tag!==6?(se=ra(oe,ie.mode,ge),se.return=ie,se):(se=w(se,oe),se.return=ie,se)}function J(ie,se,oe,ge){var Ae=oe.type;return Ae===A?pe(ie,se,oe.props.children,ge,oe.key):se!==null&&(se.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===Z&&Uc(Ae)===se.type)?(ge=w(se,oe.props),ge.ref=Pn(ie,se,oe),ge.return=ie,ge):(ge=ro(oe.type,oe.key,oe.props,null,ie.mode,ge),ge.ref=Pn(ie,se,oe),ge.return=ie,ge)}function le(ie,se,oe,ge){return se===null||se.tag!==4||se.stateNode.containerInfo!==oe.containerInfo||se.stateNode.implementation!==oe.implementation?(se=sa(oe,ie.mode,ge),se.return=ie,se):(se=w(se,oe.children||[]),se.return=ie,se)}function pe(ie,se,oe,ge,Ae){return se===null||se.tag!==7?(se=xs(oe,ie.mode,ge,Ae),se.return=ie,se):(se=w(se,oe),se.return=ie,se)}function _e(ie,se,oe){if(typeof se=="string"&&se!==""||typeof se=="number")return se=ra(""+se,ie.mode,oe),se.return=ie,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case L:return oe=ro(se.type,se.key,se.props,null,ie.mode,oe),oe.ref=Pn(ie,null,se),oe.return=ie,oe;case k:return se=sa(se,ie.mode,oe),se.return=ie,se;case Z:var ge=se._init;return _e(ie,ge(se._payload),oe)}if(Oe(se)||I(se))return se=xs(se,ie.mode,oe,null),se.return=ie,se;Di(ie,se)}return null}function fe(ie,se,oe,ge){var Ae=se!==null?se.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number")return Ae!==null?null:G(ie,se,""+oe,ge);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case L:return oe.key===Ae?J(ie,se,oe,ge):null;case k:return oe.key===Ae?le(ie,se,oe,ge):null;case Z:return Ae=oe._init,fe(ie,se,Ae(oe._payload),ge)}if(Oe(oe)||I(oe))return Ae!==null?null:pe(ie,se,oe,ge,null);Di(ie,oe)}return null}function xe(ie,se,oe,ge,Ae){if(typeof ge=="string"&&ge!==""||typeof ge=="number")return ie=ie.get(oe)||null,G(se,ie,""+ge,Ae);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case L:return ie=ie.get(ge.key===null?oe:ge.key)||null,J(se,ie,ge,Ae);case k:return ie=ie.get(ge.key===null?oe:ge.key)||null,le(se,ie,ge,Ae);case Z:var Ne=ge._init;return xe(ie,se,oe,Ne(ge._payload),Ae)}if(Oe(ge)||I(ge))return ie=ie.get(oe)||null,pe(se,ie,ge,Ae,null);Di(se,ge)}return null}function Le(ie,se,oe,ge){for(var Ae=null,Ne=null,Pe=se,$e=se=0,Lt=null;Pe!==null&&$e<oe.length;$e++){Pe.index>$e?(Lt=Pe,Pe=null):Lt=Pe.sibling;var st=fe(ie,Pe,oe[$e],ge);if(st===null){Pe===null&&(Pe=Lt);break}e&&Pe&&st.alternate===null&&t(ie,Pe),se=R(st,se,$e),Ne===null?Ae=st:Ne.sibling=st,Ne=st,Pe=Lt}if($e===oe.length)return r(ie,Pe),ft&&_s(ie,$e),Ae;if(Pe===null){for(;$e<oe.length;$e++)Pe=_e(ie,oe[$e],ge),Pe!==null&&(se=R(Pe,se,$e),Ne===null?Ae=Pe:Ne.sibling=Pe,Ne=Pe);return ft&&_s(ie,$e),Ae}for(Pe=d(ie,Pe);$e<oe.length;$e++)Lt=xe(Pe,ie,$e,oe[$e],ge),Lt!==null&&(e&&Lt.alternate!==null&&Pe.delete(Lt.key===null?$e:Lt.key),se=R(Lt,se,$e),Ne===null?Ae=Lt:Ne.sibling=Lt,Ne=Lt);return e&&Pe.forEach(function(rs){return t(ie,rs)}),ft&&_s(ie,$e),Ae}function Me(ie,se,oe,ge){var Ae=I(oe);if(typeof Ae!="function")throw Error(p(150));if(oe=Ae.call(oe),oe==null)throw Error(p(151));for(var Ne=Ae=null,Pe=se,$e=se=0,Lt=null,st=oe.next();Pe!==null&&!st.done;$e++,st=oe.next()){Pe.index>$e?(Lt=Pe,Pe=null):Lt=Pe.sibling;var rs=fe(ie,Pe,st.value,ge);if(rs===null){Pe===null&&(Pe=Lt);break}e&&Pe&&rs.alternate===null&&t(ie,Pe),se=R(rs,se,$e),Ne===null?Ae=rs:Ne.sibling=rs,Ne=rs,Pe=Lt}if(st.done)return r(ie,Pe),ft&&_s(ie,$e),Ae;if(Pe===null){for(;!st.done;$e++,st=oe.next())st=_e(ie,st.value,ge),st!==null&&(se=R(st,se,$e),Ne===null?Ae=st:Ne.sibling=st,Ne=st);return ft&&_s(ie,$e),Ae}for(Pe=d(ie,Pe);!st.done;$e++,st=oe.next())st=xe(Pe,ie,$e,st.value,ge),st!==null&&(e&&st.alternate!==null&&Pe.delete(st.key===null?$e:st.key),se=R(st,se,$e),Ne===null?Ae=st:Ne.sibling=st,Ne=st);return e&&Pe.forEach(function(Hp){return t(ie,Hp)}),ft&&_s(ie,$e),Ae}function Ct(ie,se,oe,ge){if(typeof oe=="object"&&oe!==null&&oe.type===A&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case L:e:{for(var Ae=oe.key,Ne=se;Ne!==null;){if(Ne.key===Ae){if(Ae=oe.type,Ae===A){if(Ne.tag===7){r(ie,Ne.sibling),se=w(Ne,oe.props.children),se.return=ie,ie=se;break e}}else if(Ne.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===Z&&Uc(Ae)===Ne.type){r(ie,Ne.sibling),se=w(Ne,oe.props),se.ref=Pn(ie,Ne,oe),se.return=ie,ie=se;break e}r(ie,Ne);break}else t(ie,Ne);Ne=Ne.sibling}oe.type===A?(se=xs(oe.props.children,ie.mode,ge,oe.key),se.return=ie,ie=se):(ge=ro(oe.type,oe.key,oe.props,null,ie.mode,ge),ge.ref=Pn(ie,se,oe),ge.return=ie,ie=ge)}return W(ie);case k:e:{for(Ne=oe.key;se!==null;){if(se.key===Ne)if(se.tag===4&&se.stateNode.containerInfo===oe.containerInfo&&se.stateNode.implementation===oe.implementation){r(ie,se.sibling),se=w(se,oe.children||[]),se.return=ie,ie=se;break e}else{r(ie,se);break}else t(ie,se);se=se.sibling}se=sa(oe,ie.mode,ge),se.return=ie,ie=se}return W(ie);case Z:return Ne=oe._init,Ct(ie,se,Ne(oe._payload),ge)}if(Oe(oe))return Le(ie,se,oe,ge);if(I(oe))return Me(ie,se,oe,ge);Di(ie,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"?(oe=""+oe,se!==null&&se.tag===6?(r(ie,se.sibling),se=w(se,oe),se.return=ie,ie=se):(r(ie,se),se=ra(oe,ie.mode,ge),se.return=ie,ie=se),W(ie)):r(ie,se)}return Ct}var Xs=zc(!0),qc=zc(!1),Ii=qr(null),Ni=null,Ys=null,dl=null;function fl(){dl=Ys=Ni=null}function pl(e){var t=Ii.current;ut(Ii),e._currentValue=t}function _l(e,t,r){for(;e!==null;){var d=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,d!==null&&(d.childLanes|=t)):d!==null&&(d.childLanes&t)!==t&&(d.childLanes|=t),e===r)break;e=e.return}}function Qs(e,t){Ni=e,dl=Ys=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Wt=!0),e.firstContext=null)}function tr(e){var t=e._currentValue;if(dl!==e)if(e={context:e,memoizedValue:t,next:null},Ys===null){if(Ni===null)throw Error(p(308));Ys=e,Ni.dependencies={lanes:0,firstContext:e}}else Ys=Ys.next=e;return t}var ms=null;function ml(e){ms===null?ms=[e]:ms.push(e)}function Vc(e,t,r,d){var w=t.interleaved;return w===null?(r.next=r,ml(t)):(r.next=w.next,w.next=r),t.interleaved=r,Nr(e,d)}function Nr(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Gr=!1;function gl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Kc(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 Pr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Xr(e,t,r){var d=e.updateQueue;if(d===null)return null;if(d=d.shared,(Ze&2)!==0){var w=d.pending;return w===null?t.next=t:(t.next=w.next,w.next=t),d.pending=t,Nr(e,r)}return w=d.interleaved,w===null?(t.next=t,ml(d)):(t.next=w.next,w.next=t),d.interleaved=t,Nr(e,r)}function Pi(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var d=t.lanes;d&=e.pendingLanes,r|=d,t.lanes=r,vn(e,r)}}function Gc(e,t){var r=e.updateQueue,d=e.alternate;if(d!==null&&(d=d.updateQueue,r===d)){var w=null,R=null;if(r=r.firstBaseUpdate,r!==null){do{var W={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};R===null?w=R=W:R=R.next=W,r=r.next}while(r!==null);R===null?w=R=t:R=R.next=t}else w=R=t;r={baseState:d.baseState,firstBaseUpdate:w,lastBaseUpdate:R,shared:d.shared,effects:d.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function ji(e,t,r,d){var w=e.updateQueue;Gr=!1;var R=w.firstBaseUpdate,W=w.lastBaseUpdate,G=w.shared.pending;if(G!==null){w.shared.pending=null;var J=G,le=J.next;J.next=null,W===null?R=le:W.next=le,W=J;var pe=e.alternate;pe!==null&&(pe=pe.updateQueue,G=pe.lastBaseUpdate,G!==W&&(G===null?pe.firstBaseUpdate=le:G.next=le,pe.lastBaseUpdate=J))}if(R!==null){var _e=w.baseState;W=0,pe=le=J=null,G=R;do{var fe=G.lane,xe=G.eventTime;if((d&fe)===fe){pe!==null&&(pe=pe.next={eventTime:xe,lane:0,tag:G.tag,payload:G.payload,callback:G.callback,next:null});e:{var Le=e,Me=G;switch(fe=t,xe=r,Me.tag){case 1:if(Le=Me.payload,typeof Le=="function"){_e=Le.call(xe,_e,fe);break e}_e=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=Me.payload,fe=typeof Le=="function"?Le.call(xe,_e,fe):Le,fe==null)break e;_e=$({},_e,fe);break e;case 2:Gr=!0}}G.callback!==null&&G.lane!==0&&(e.flags|=64,fe=w.effects,fe===null?w.effects=[G]:fe.push(G))}else xe={eventTime:xe,lane:fe,tag:G.tag,payload:G.payload,callback:G.callback,next:null},pe===null?(le=pe=xe,J=_e):pe=pe.next=xe,W|=fe;if(G=G.next,G===null){if(G=w.shared.pending,G===null)break;fe=G,G=fe.next,fe.next=null,w.lastBaseUpdate=fe,w.shared.pending=null}}while(!0);if(pe===null&&(J=_e),w.baseState=J,w.firstBaseUpdate=le,w.lastBaseUpdate=pe,t=w.shared.interleaved,t!==null){w=t;do W|=w.lane,w=w.next;while(w!==t)}else R===null&&(w.shared.lanes=0);ys|=W,e.lanes=W,e.memoizedState=_e}}function Xc(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var d=e[t],w=d.callback;if(w!==null){if(d.callback=null,d=r,typeof w!="function")throw Error(p(191,w));w.call(d)}}}var jn={},kr=qr(jn),On=qr(jn),Bn=qr(jn);function gs(e){if(e===jn)throw Error(p(174));return e}function vl(e,t){switch(at(Bn,t),at(On,e),at(kr,jn),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ht(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ht(t,e)}ut(kr),at(kr,t)}function Js(){ut(kr),ut(On),ut(Bn)}function Yc(e){gs(Bn.current);var t=gs(kr.current),r=ht(t,e.type);t!==r&&(at(On,e),at(kr,r))}function yl(e){On.current===e&&(ut(kr),ut(On))}var mt=qr(0);function Oi(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==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 Sl=[];function Cl(){for(var e=0;e<Sl.length;e++)Sl[e]._workInProgressVersionPrimary=null;Sl.length=0}var Bi=y.ReactCurrentDispatcher,wl=y.ReactCurrentBatchConfig,vs=0,gt=null,xt=null,kt=null,Fi=!1,Fn=!1,$n=0,cp=0;function Tt(){throw Error(p(321))}function xl(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!ur(e[r],t[r]))return!1;return!0}function bl(e,t,r,d,w,R){if(vs=R,gt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Bi.current=e===null||e.memoizedState===null?fp:pp,e=r(d,w),Fn){R=0;do{if(Fn=!1,$n=0,25<=R)throw Error(p(301));R+=1,kt=xt=null,t.updateQueue=null,Bi.current=_p,e=r(d,w)}while(Fn)}if(Bi.current=Wi,t=xt!==null&&xt.next!==null,vs=0,kt=xt=gt=null,Fi=!1,t)throw Error(p(300));return e}function kl(){var e=$n!==0;return $n=0,e}function Er(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return kt===null?gt.memoizedState=kt=e:kt=kt.next=e,kt}function rr(){if(xt===null){var e=gt.alternate;e=e!==null?e.memoizedState:null}else e=xt.next;var t=kt===null?gt.memoizedState:kt.next;if(t!==null)kt=t,xt=e;else{if(e===null)throw Error(p(310));xt=e,e={memoizedState:xt.memoizedState,baseState:xt.baseState,baseQueue:xt.baseQueue,queue:xt.queue,next:null},kt===null?gt.memoizedState=kt=e:kt=kt.next=e}return kt}function Hn(e,t){return typeof t=="function"?t(e):t}function El(e){var t=rr(),r=t.queue;if(r===null)throw Error(p(311));r.lastRenderedReducer=e;var d=xt,w=d.baseQueue,R=r.pending;if(R!==null){if(w!==null){var W=w.next;w.next=R.next,R.next=W}d.baseQueue=w=R,r.pending=null}if(w!==null){R=w.next,d=d.baseState;var G=W=null,J=null,le=R;do{var pe=le.lane;if((vs&pe)===pe)J!==null&&(J=J.next={lane:0,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),d=le.hasEagerState?le.eagerState:e(d,le.action);else{var _e={lane:pe,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null};J===null?(G=J=_e,W=d):J=J.next=_e,gt.lanes|=pe,ys|=pe}le=le.next}while(le!==null&&le!==R);J===null?W=d:J.next=G,ur(d,t.memoizedState)||(Wt=!0),t.memoizedState=d,t.baseState=W,t.baseQueue=J,r.lastRenderedState=d}if(e=r.interleaved,e!==null){w=e;do R=w.lane,gt.lanes|=R,ys|=R,w=w.next;while(w!==e)}else w===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ll(e){var t=rr(),r=t.queue;if(r===null)throw Error(p(311));r.lastRenderedReducer=e;var d=r.dispatch,w=r.pending,R=t.memoizedState;if(w!==null){r.pending=null;var W=w=w.next;do R=e(R,W.action),W=W.next;while(W!==w);ur(R,t.memoizedState)||(Wt=!0),t.memoizedState=R,t.baseQueue===null&&(t.baseState=R),r.lastRenderedState=R}return[R,d]}function Qc(){}function Jc(e,t){var r=gt,d=rr(),w=t(),R=!ur(d.memoizedState,w);if(R&&(d.memoizedState=w,Wt=!0),d=d.queue,Rl(tu.bind(null,r,d,e),[e]),d.getSnapshot!==t||R||kt!==null&&kt.memoizedState.tag&1){if(r.flags|=2048,Wn(9,eu.bind(null,r,d,w,t),void 0,null),Et===null)throw Error(p(349));(vs&30)!==0||Zc(r,t,w)}return w}function Zc(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=gt.updateQueue,t===null?(t={lastEffect:null,stores:null},gt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function eu(e,t,r,d){t.value=r,t.getSnapshot=d,ru(t)&&su(e)}function tu(e,t,r){return r(function(){ru(t)&&su(e)})}function ru(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!ur(e,r)}catch{return!0}}function su(e){var t=Nr(e,1);t!==null&&_r(t,e,1,-1)}function nu(e){var t=Er();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Hn,lastRenderedState:e},t.queue=e,e=e.dispatch=dp.bind(null,gt,e),[t.memoizedState,e]}function Wn(e,t,r,d){return e={tag:e,create:t,destroy:r,deps:d,next:null},t=gt.updateQueue,t===null?(t={lastEffect:null,stores:null},gt.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(d=r.next,r.next=e,e.next=d,t.lastEffect=e)),e}function iu(){return rr().memoizedState}function $i(e,t,r,d){var w=Er();gt.flags|=e,w.memoizedState=Wn(1|t,r,void 0,d===void 0?null:d)}function Hi(e,t,r,d){var w=rr();d=d===void 0?null:d;var R=void 0;if(xt!==null){var W=xt.memoizedState;if(R=W.destroy,d!==null&&xl(d,W.deps)){w.memoizedState=Wn(t,r,R,d);return}}gt.flags|=e,w.memoizedState=Wn(1|t,r,R,d)}function ou(e,t){return $i(8390656,8,e,t)}function Rl(e,t){return Hi(2048,8,e,t)}function lu(e,t){return Hi(4,2,e,t)}function au(e,t){return Hi(4,4,e,t)}function cu(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function uu(e,t,r){return r=r!=null?r.concat([e]):null,Hi(4,4,cu.bind(null,t,e),r)}function Ml(){}function hu(e,t){var r=rr();t=t===void 0?null:t;var d=r.memoizedState;return d!==null&&t!==null&&xl(t,d[1])?d[0]:(r.memoizedState=[e,t],e)}function du(e,t){var r=rr();t=t===void 0?null:t;var d=r.memoizedState;return d!==null&&t!==null&&xl(t,d[1])?d[0]:(e=e(),r.memoizedState=[e,t],e)}function fu(e,t,r){return(vs&21)===0?(e.baseState&&(e.baseState=!1,Wt=!0),e.memoizedState=r):(ur(r,t)||(r=ai(),gt.lanes|=r,ys|=r,e.baseState=!0),t)}function up(e,t){var r=nt;nt=r!==0&&4>r?r:4,e(!0);var d=wl.transition;wl.transition={};try{e(!1),t()}finally{nt=r,wl.transition=d}}function pu(){return rr().memoizedState}function hp(e,t,r){var d=Zr(e);if(r={lane:d,action:r,hasEagerState:!1,eagerState:null,next:null},_u(e))mu(t,r);else if(r=Vc(e,t,r,d),r!==null){var w=Ft();_r(r,e,d,w),gu(r,t,d)}}function dp(e,t,r){var d=Zr(e),w={lane:d,action:r,hasEagerState:!1,eagerState:null,next:null};if(_u(e))mu(t,w);else{var R=e.alternate;if(e.lanes===0&&(R===null||R.lanes===0)&&(R=t.lastRenderedReducer,R!==null))try{var W=t.lastRenderedState,G=R(W,r);if(w.hasEagerState=!0,w.eagerState=G,ur(G,W)){var J=t.interleaved;J===null?(w.next=w,ml(t)):(w.next=J.next,J.next=w),t.interleaved=w;return}}catch{}finally{}r=Vc(e,t,w,d),r!==null&&(w=Ft(),_r(r,e,d,w),gu(r,t,d))}}function _u(e){var t=e.alternate;return e===gt||t!==null&&t===gt}function mu(e,t){Fn=Fi=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function gu(e,t,r){if((r&4194240)!==0){var d=t.lanes;d&=e.pendingLanes,r|=d,t.lanes=r,vn(e,r)}}var Wi={readContext:tr,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useInsertionEffect:Tt,useLayoutEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useMutableSource:Tt,useSyncExternalStore:Tt,useId:Tt,unstable_isNewReconciler:!1},fp={readContext:tr,useCallback:function(e,t){return Er().memoizedState=[e,t===void 0?null:t],e},useContext:tr,useEffect:ou,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,$i(4194308,4,cu.bind(null,t,e),r)},useLayoutEffect:function(e,t){return $i(4194308,4,e,t)},useInsertionEffect:function(e,t){return $i(4,2,e,t)},useMemo:function(e,t){var r=Er();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var d=Er();return t=r!==void 0?r(t):t,d.memoizedState=d.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},d.queue=e,e=e.dispatch=hp.bind(null,gt,e),[d.memoizedState,e]},useRef:function(e){var t=Er();return e={current:e},t.memoizedState=e},useState:nu,useDebugValue:Ml,useDeferredValue:function(e){return Er().memoizedState=e},useTransition:function(){var e=nu(!1),t=e[0];return e=up.bind(null,e[1]),Er().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var d=gt,w=Er();if(ft){if(r===void 0)throw Error(p(407));r=r()}else{if(r=t(),Et===null)throw Error(p(349));(vs&30)!==0||Zc(d,t,r)}w.memoizedState=r;var R={value:r,getSnapshot:t};return w.queue=R,ou(tu.bind(null,d,R,e),[e]),d.flags|=2048,Wn(9,eu.bind(null,d,R,r,t),void 0,null),r},useId:function(){var e=Er(),t=Et.identifierPrefix;if(ft){var r=Ir,d=Dr;r=(d&~(1<<32-Kt(d)-1)).toString(32)+r,t=":"+t+"R"+r,r=$n++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=cp++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},pp={readContext:tr,useCallback:hu,useContext:tr,useEffect:Rl,useImperativeHandle:uu,useInsertionEffect:lu,useLayoutEffect:au,useMemo:du,useReducer:El,useRef:iu,useState:function(){return El(Hn)},useDebugValue:Ml,useDeferredValue:function(e){var t=rr();return fu(t,xt.memoizedState,e)},useTransition:function(){var e=El(Hn)[0],t=rr().memoizedState;return[e,t]},useMutableSource:Qc,useSyncExternalStore:Jc,useId:pu,unstable_isNewReconciler:!1},_p={readContext:tr,useCallback:hu,useContext:tr,useEffect:Rl,useImperativeHandle:uu,useInsertionEffect:lu,useLayoutEffect:au,useMemo:du,useReducer:Ll,useRef:iu,useState:function(){return Ll(Hn)},useDebugValue:Ml,useDeferredValue:function(e){var t=rr();return xt===null?t.memoizedState=e:fu(t,xt.memoizedState,e)},useTransition:function(){var e=Ll(Hn)[0],t=rr().memoizedState;return[e,t]},useMutableSource:Qc,useSyncExternalStore:Jc,useId:pu,unstable_isNewReconciler:!1};function dr(e,t){if(e&&e.defaultProps){t=$({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Al(e,t,r,d){t=e.memoizedState,r=r(d,t),r=r==null?t:$({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Ui={isMounted:function(e){return(e=e._reactInternals)?Rr(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var d=Ft(),w=Zr(e),R=Pr(d,w);R.payload=t,r!=null&&(R.callback=r),t=Xr(e,R,w),t!==null&&(_r(t,e,w,d),Pi(t,e,w))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var d=Ft(),w=Zr(e),R=Pr(d,w);R.tag=1,R.payload=t,r!=null&&(R.callback=r),t=Xr(e,R,w),t!==null&&(_r(t,e,w,d),Pi(t,e,w))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Ft(),d=Zr(e),w=Pr(r,d);w.tag=2,t!=null&&(w.callback=t),t=Xr(e,w,d),t!==null&&(_r(t,e,d,r),Pi(t,e,d))}};function vu(e,t,r,d,w,R,W){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(d,R,W):t.prototype&&t.prototype.isPureReactComponent?!Rn(r,d)||!Rn(w,R):!0}function yu(e,t,r){var d=!1,w=Vr,R=t.contextType;return typeof R=="object"&&R!==null?R=tr(R):(w=Ht(t)?fs:At.current,d=t.contextTypes,R=(d=d!=null)?qs(e,w):Vr),t=new t(r,R),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ui,e.stateNode=t,t._reactInternals=e,d&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=w,e.__reactInternalMemoizedMaskedChildContext=R),t}function Su(e,t,r,d){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,d),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,d),t.state!==e&&Ui.enqueueReplaceState(t,t.state,null)}function Tl(e,t,r,d){var w=e.stateNode;w.props=r,w.state=e.memoizedState,w.refs={},gl(e);var R=t.contextType;typeof R=="object"&&R!==null?w.context=tr(R):(R=Ht(t)?fs:At.current,w.context=qs(e,R)),w.state=e.memoizedState,R=t.getDerivedStateFromProps,typeof R=="function"&&(Al(e,t,R,r),w.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(t=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),t!==w.state&&Ui.enqueueReplaceState(w,w.state,null),ji(e,r,w,d),w.state=e.memoizedState),typeof w.componentDidMount=="function"&&(e.flags|=4194308)}function Zs(e,t){try{var r="",d=t;do r+=ne(d),d=d.return;while(d);var w=r}catch(R){w=`
39
- Error generating stack: `+R.message+`
40
- `+R.stack}return{value:e,source:t,stack:w,digest:null}}function Dl(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Il(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var mp=typeof WeakMap=="function"?WeakMap:Map;function Cu(e,t,r){r=Pr(-1,r),r.tag=3,r.payload={element:null};var d=t.value;return r.callback=function(){Yi||(Yi=!0,Gl=d),Il(e,t)},r}function wu(e,t,r){r=Pr(-1,r),r.tag=3;var d=e.type.getDerivedStateFromError;if(typeof d=="function"){var w=t.value;r.payload=function(){return d(w)},r.callback=function(){Il(e,t)}}var R=e.stateNode;return R!==null&&typeof R.componentDidCatch=="function"&&(r.callback=function(){Il(e,t),typeof d!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var W=t.stack;this.componentDidCatch(t.value,{componentStack:W!==null?W:""})}),r}function xu(e,t,r){var d=e.pingCache;if(d===null){d=e.pingCache=new mp;var w=new Set;d.set(t,w)}else w=d.get(t),w===void 0&&(w=new Set,d.set(t,w));w.has(r)||(w.add(r),e=Ap.bind(null,e,t,r),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 ku(e,t,r,d,w){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Pr(-1,1),t.tag=2,Xr(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=w,e)}var gp=y.ReactCurrentOwner,Wt=!1;function Bt(e,t,r,d){t.child=e===null?qc(t,null,r,d):Xs(t,e.child,r,d)}function Eu(e,t,r,d,w){r=r.render;var R=t.ref;return Qs(t,w),d=bl(e,t,r,d,R,w),r=kl(),e!==null&&!Wt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~w,jr(e,t,w)):(ft&&r&&ll(t),t.flags|=1,Bt(e,t,d,w),t.child)}function Lu(e,t,r,d,w){if(e===null){var R=r.type;return typeof R=="function"&&!ta(R)&&R.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=R,Ru(e,t,R,d,w)):(e=ro(r.type,null,d,t,t.mode,w),e.ref=t.ref,e.return=t,t.child=e)}if(R=e.child,(e.lanes&w)===0){var W=R.memoizedProps;if(r=r.compare,r=r!==null?r:Rn,r(W,d)&&e.ref===t.ref)return jr(e,t,w)}return t.flags|=1,e=ts(R,d),e.ref=t.ref,e.return=t,t.child=e}function Ru(e,t,r,d,w){if(e!==null){var R=e.memoizedProps;if(Rn(R,d)&&e.ref===t.ref)if(Wt=!1,t.pendingProps=d=R,(e.lanes&w)!==0)(e.flags&131072)!==0&&(Wt=!0);else return t.lanes=e.lanes,jr(e,t,w)}return Nl(e,t,r,d,w)}function Mu(e,t,r){var d=t.pendingProps,w=d.children,R=e!==null?e.memoizedState:null;if(d.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},at(tn,Qt),Qt|=r;else{if((r&1073741824)===0)return e=R!==null?R.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,at(tn,Qt),Qt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=R!==null?R.baseLanes:r,at(tn,Qt),Qt|=d}else R!==null?(d=R.baseLanes|r,t.memoizedState=null):d=r,at(tn,Qt),Qt|=d;return Bt(e,t,w,r),t.child}function Au(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Nl(e,t,r,d,w){var R=Ht(r)?fs:At.current;return R=qs(t,R),Qs(t,w),r=bl(e,t,r,d,R,w),d=kl(),e!==null&&!Wt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~w,jr(e,t,w)):(ft&&d&&ll(t),t.flags|=1,Bt(e,t,r,w),t.child)}function Tu(e,t,r,d,w){if(Ht(r)){var R=!0;Li(t)}else R=!1;if(Qs(t,w),t.stateNode===null)qi(e,t),yu(t,r,d),Tl(t,r,d,w),d=!0;else if(e===null){var W=t.stateNode,G=t.memoizedProps;W.props=G;var J=W.context,le=r.contextType;typeof le=="object"&&le!==null?le=tr(le):(le=Ht(r)?fs:At.current,le=qs(t,le));var pe=r.getDerivedStateFromProps,_e=typeof pe=="function"||typeof W.getSnapshotBeforeUpdate=="function";_e||typeof W.UNSAFE_componentWillReceiveProps!="function"&&typeof W.componentWillReceiveProps!="function"||(G!==d||J!==le)&&Su(t,W,d,le),Gr=!1;var fe=t.memoizedState;W.state=fe,ji(t,d,W,w),J=t.memoizedState,G!==d||fe!==J||$t.current||Gr?(typeof pe=="function"&&(Al(t,r,pe,d),J=t.memoizedState),(G=Gr||vu(t,r,G,d,fe,J,le))?(_e||typeof W.UNSAFE_componentWillMount!="function"&&typeof W.componentWillMount!="function"||(typeof W.componentWillMount=="function"&&W.componentWillMount(),typeof W.UNSAFE_componentWillMount=="function"&&W.UNSAFE_componentWillMount()),typeof W.componentDidMount=="function"&&(t.flags|=4194308)):(typeof W.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=d,t.memoizedState=J),W.props=d,W.state=J,W.context=le,d=G):(typeof W.componentDidMount=="function"&&(t.flags|=4194308),d=!1)}else{W=t.stateNode,Kc(e,t),G=t.memoizedProps,le=t.type===t.elementType?G:dr(t.type,G),W.props=le,_e=t.pendingProps,fe=W.context,J=r.contextType,typeof J=="object"&&J!==null?J=tr(J):(J=Ht(r)?fs:At.current,J=qs(t,J));var xe=r.getDerivedStateFromProps;(pe=typeof xe=="function"||typeof W.getSnapshotBeforeUpdate=="function")||typeof W.UNSAFE_componentWillReceiveProps!="function"&&typeof W.componentWillReceiveProps!="function"||(G!==_e||fe!==J)&&Su(t,W,d,J),Gr=!1,fe=t.memoizedState,W.state=fe,ji(t,d,W,w);var Le=t.memoizedState;G!==_e||fe!==Le||$t.current||Gr?(typeof xe=="function"&&(Al(t,r,xe,d),Le=t.memoizedState),(le=Gr||vu(t,r,le,d,fe,Le,J)||!1)?(pe||typeof W.UNSAFE_componentWillUpdate!="function"&&typeof W.componentWillUpdate!="function"||(typeof W.componentWillUpdate=="function"&&W.componentWillUpdate(d,Le,J),typeof W.UNSAFE_componentWillUpdate=="function"&&W.UNSAFE_componentWillUpdate(d,Le,J)),typeof W.componentDidUpdate=="function"&&(t.flags|=4),typeof W.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof W.componentDidUpdate!="function"||G===e.memoizedProps&&fe===e.memoizedState||(t.flags|=4),typeof W.getSnapshotBeforeUpdate!="function"||G===e.memoizedProps&&fe===e.memoizedState||(t.flags|=1024),t.memoizedProps=d,t.memoizedState=Le),W.props=d,W.state=Le,W.context=J,d=le):(typeof W.componentDidUpdate!="function"||G===e.memoizedProps&&fe===e.memoizedState||(t.flags|=4),typeof W.getSnapshotBeforeUpdate!="function"||G===e.memoizedProps&&fe===e.memoizedState||(t.flags|=1024),d=!1)}return Pl(e,t,r,d,R,w)}function Pl(e,t,r,d,w,R){Au(e,t);var W=(t.flags&128)!==0;if(!d&&!W)return w&&jc(t,r,!1),jr(e,t,R);d=t.stateNode,gp.current=t;var G=W&&typeof r.getDerivedStateFromError!="function"?null:d.render();return t.flags|=1,e!==null&&W?(t.child=Xs(t,e.child,null,R),t.child=Xs(t,null,G,R)):Bt(e,t,G,R),t.memoizedState=d.state,w&&jc(t,r,!0),t.child}function Du(e){var t=e.stateNode;t.pendingContext?Nc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Nc(e,t.context,!1),vl(e,t.containerInfo)}function Iu(e,t,r,d,w){return Gs(),hl(w),t.flags|=256,Bt(e,t,r,d),t.child}var jl={dehydrated:null,treeContext:null,retryLane:0};function Ol(e){return{baseLanes:e,cachePool:null,transitions:null}}function Nu(e,t,r){var d=t.pendingProps,w=mt.current,R=!1,W=(t.flags&128)!==0,G;if((G=W)||(G=e!==null&&e.memoizedState===null?!1:(w&2)!==0),G?(R=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(w|=1),at(mt,w&1),e===null)return ul(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):(W=d.children,e=d.fallback,R?(d=t.mode,R=t.child,W={mode:"hidden",children:W},(d&1)===0&&R!==null?(R.childLanes=0,R.pendingProps=W):R=so(W,d,0,null),e=xs(e,d,r,null),R.return=t,e.return=t,R.sibling=e,t.child=R,t.child.memoizedState=Ol(r),t.memoizedState=jl,e):Bl(t,W));if(w=e.memoizedState,w!==null&&(G=w.dehydrated,G!==null))return vp(e,t,W,d,G,w,r);if(R){R=d.fallback,W=t.mode,w=e.child,G=w.sibling;var J={mode:"hidden",children:d.children};return(W&1)===0&&t.child!==w?(d=t.child,d.childLanes=0,d.pendingProps=J,t.deletions=null):(d=ts(w,J),d.subtreeFlags=w.subtreeFlags&14680064),G!==null?R=ts(G,R):(R=xs(R,W,r,null),R.flags|=2),R.return=t,d.return=t,d.sibling=R,t.child=d,d=R,R=t.child,W=e.child.memoizedState,W=W===null?Ol(r):{baseLanes:W.baseLanes|r,cachePool:null,transitions:W.transitions},R.memoizedState=W,R.childLanes=e.childLanes&~r,t.memoizedState=jl,d}return R=e.child,e=R.sibling,d=ts(R,{mode:"visible",children:d.children}),(t.mode&1)===0&&(d.lanes=r),d.return=t,d.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=d,t.memoizedState=null,d}function Bl(e,t){return t=so({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function zi(e,t,r,d){return d!==null&&hl(d),Xs(t,e.child,null,r),e=Bl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function vp(e,t,r,d,w,R,W){if(r)return t.flags&256?(t.flags&=-257,d=Dl(Error(p(422))),zi(e,t,W,d)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(R=d.fallback,w=t.mode,d=so({mode:"visible",children:d.children},w,0,null),R=xs(R,w,W,null),R.flags|=2,d.return=t,R.return=t,d.sibling=R,t.child=d,(t.mode&1)!==0&&Xs(t,e.child,null,W),t.child.memoizedState=Ol(W),t.memoizedState=jl,R);if((t.mode&1)===0)return zi(e,t,W,null);if(w.data==="$!"){if(d=w.nextSibling&&w.nextSibling.dataset,d)var G=d.dgst;return d=G,R=Error(p(419)),d=Dl(R,d,void 0),zi(e,t,W,d)}if(G=(W&e.childLanes)!==0,Wt||G){if(d=Et,d!==null){switch(W&-W){case 4:w=2;break;case 16:w=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:w=32;break;case 536870912:w=268435456;break;default:w=0}w=(w&(d.suspendedLanes|W))!==0?0:w,w!==0&&w!==R.retryLane&&(R.retryLane=w,Nr(e,w),_r(d,e,w,-1))}return ea(),d=Dl(Error(p(421))),zi(e,t,W,d)}return w.data==="$?"?(t.flags|=128,t.child=e.child,t=Tp.bind(null,e),w._reactRetry=t,null):(e=R.treeContext,Yt=zr(w.nextSibling),Xt=t,ft=!0,hr=null,e!==null&&(Zt[er++]=Dr,Zt[er++]=Ir,Zt[er++]=ps,Dr=e.id,Ir=e.overflow,ps=t),t=Bl(t,d.children),t.flags|=4096,t)}function Pu(e,t,r){e.lanes|=t;var d=e.alternate;d!==null&&(d.lanes|=t),_l(e.return,t,r)}function Fl(e,t,r,d,w){var R=e.memoizedState;R===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:d,tail:r,tailMode:w}:(R.isBackwards=t,R.rendering=null,R.renderingStartTime=0,R.last=d,R.tail=r,R.tailMode=w)}function ju(e,t,r){var d=t.pendingProps,w=d.revealOrder,R=d.tail;if(Bt(e,t,d.children,r),d=mt.current,(d&2)!==0)d=d&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&&Pu(e,r,t);else if(e.tag===19)Pu(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}d&=1}if(at(mt,d),(t.mode&1)===0)t.memoizedState=null;else switch(w){case"forwards":for(r=t.child,w=null;r!==null;)e=r.alternate,e!==null&&Oi(e)===null&&(w=r),r=r.sibling;r=w,r===null?(w=t.child,t.child=null):(w=r.sibling,r.sibling=null),Fl(t,!1,w,r,R);break;case"backwards":for(r=null,w=t.child,t.child=null;w!==null;){if(e=w.alternate,e!==null&&Oi(e)===null){t.child=w;break}e=w.sibling,w.sibling=r,r=w,w=e}Fl(t,!0,r,null,R);break;case"together":Fl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function qi(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function jr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),ys|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(p(153));if(t.child!==null){for(e=t.child,r=ts(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=ts(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function yp(e,t,r){switch(t.tag){case 3:Du(t),Gs();break;case 5:Yc(t);break;case 1:Ht(t.type)&&Li(t);break;case 4:vl(t,t.stateNode.containerInfo);break;case 10:var d=t.type._context,w=t.memoizedProps.value;at(Ii,d._currentValue),d._currentValue=w;break;case 13:if(d=t.memoizedState,d!==null)return d.dehydrated!==null?(at(mt,mt.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?Nu(e,t,r):(at(mt,mt.current&1),e=jr(e,t,r),e!==null?e.sibling:null);at(mt,mt.current&1);break;case 19:if(d=(r&t.childLanes)!==0,(e.flags&128)!==0){if(d)return ju(e,t,r);t.flags|=128}if(w=t.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),at(mt,mt.current),d)break;return null;case 22:case 23:return t.lanes=0,Mu(e,t,r)}return jr(e,t,r)}var Ou,$l,Bu,Fu;Ou=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},$l=function(){},Bu=function(e,t,r,d){var w=e.memoizedProps;if(w!==d){e=t.stateNode,gs(kr.current);var R=null;switch(r){case"input":w=ke(e,w),d=ke(e,d),R=[];break;case"select":w=$({},w,{value:void 0}),d=$({},d,{value:void 0}),R=[];break;case"textarea":w=Ie(e,w),d=Ie(e,d),R=[];break;default:typeof w.onClick!="function"&&typeof d.onClick=="function"&&(e.onclick=bi)}it(r,d);var W;r=null;for(le in w)if(!d.hasOwnProperty(le)&&w.hasOwnProperty(le)&&w[le]!=null)if(le==="style"){var G=w[le];for(W in G)G.hasOwnProperty(W)&&(r||(r={}),r[W]="")}else le!=="dangerouslySetInnerHTML"&&le!=="children"&&le!=="suppressContentEditableWarning"&&le!=="suppressHydrationWarning"&&le!=="autoFocus"&&(M.hasOwnProperty(le)?R||(R=[]):(R=R||[]).push(le,null));for(le in d){var J=d[le];if(G=w!=null?w[le]:void 0,d.hasOwnProperty(le)&&J!==G&&(J!=null||G!=null))if(le==="style")if(G){for(W in G)!G.hasOwnProperty(W)||J&&J.hasOwnProperty(W)||(r||(r={}),r[W]="");for(W in J)J.hasOwnProperty(W)&&G[W]!==J[W]&&(r||(r={}),r[W]=J[W])}else r||(R||(R=[]),R.push(le,r)),r=J;else le==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,G=G?G.__html:void 0,J!=null&&G!==J&&(R=R||[]).push(le,J)):le==="children"?typeof J!="string"&&typeof J!="number"||(R=R||[]).push(le,""+J):le!=="suppressContentEditableWarning"&&le!=="suppressHydrationWarning"&&(M.hasOwnProperty(le)?(J!=null&&le==="onScroll"&&ct("scroll",e),R||G===J||(R=[])):(R=R||[]).push(le,J))}r&&(R=R||[]).push("style",r);var le=R;(t.updateQueue=le)&&(t.flags|=4)}},Fu=function(e,t,r,d){r!==d&&(t.flags|=4)};function Un(e,t){if(!ft)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var d=null;r!==null;)r.alternate!==null&&(d=r),r=r.sibling;d===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:d.sibling=null}}function Dt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,d=0;if(t)for(var w=e.child;w!==null;)r|=w.lanes|w.childLanes,d|=w.subtreeFlags&14680064,d|=w.flags&14680064,w.return=e,w=w.sibling;else for(w=e.child;w!==null;)r|=w.lanes|w.childLanes,d|=w.subtreeFlags,d|=w.flags,w.return=e,w=w.sibling;return e.subtreeFlags|=d,e.childLanes=r,t}function Sp(e,t,r){var d=t.pendingProps;switch(al(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dt(t),null;case 1:return Ht(t.type)&&Ei(),Dt(t),null;case 3:return d=t.stateNode,Js(),ut($t),ut(At),Cl(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(e===null||e.child===null)&&(Ti(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,hr!==null&&(Ql(hr),hr=null))),$l(e,t),Dt(t),null;case 5:yl(t);var w=gs(Bn.current);if(r=t.type,e!==null&&t.stateNode!=null)Bu(e,t,r,d,w),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!d){if(t.stateNode===null)throw Error(p(166));return Dt(t),null}if(e=gs(kr.current),Ti(t)){d=t.stateNode,r=t.type;var R=t.memoizedProps;switch(d[br]=t,d[In]=R,e=(t.mode&1)!==0,r){case"dialog":ct("cancel",d),ct("close",d);break;case"iframe":case"object":case"embed":ct("load",d);break;case"video":case"audio":for(w=0;w<An.length;w++)ct(An[w],d);break;case"source":ct("error",d);break;case"img":case"image":case"link":ct("error",d),ct("load",d);break;case"details":ct("toggle",d);break;case"input":He(d,R),ct("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!R.multiple},ct("invalid",d);break;case"textarea":we(d,R),ct("invalid",d)}it(r,R),w=null;for(var W in R)if(R.hasOwnProperty(W)){var G=R[W];W==="children"?typeof G=="string"?d.textContent!==G&&(R.suppressHydrationWarning!==!0&&xi(d.textContent,G,e),w=["children",G]):typeof G=="number"&&d.textContent!==""+G&&(R.suppressHydrationWarning!==!0&&xi(d.textContent,G,e),w=["children",""+G]):M.hasOwnProperty(W)&&G!=null&&W==="onScroll"&&ct("scroll",d)}switch(r){case"input":he(d),ze(d,R,!0);break;case"textarea":he(d),et(d);break;case"select":case"option":break;default:typeof R.onClick=="function"&&(d.onclick=bi)}d=w,t.updateQueue=d,d!==null&&(t.flags|=4)}else{W=w.nodeType===9?w:w.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ve(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=W.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof d.is=="string"?e=W.createElement(r,{is:d.is}):(e=W.createElement(r),r==="select"&&(W=e,d.multiple?W.multiple=!0:d.size&&(W.size=d.size))):e=W.createElementNS(e,r),e[br]=t,e[In]=d,Ou(e,t,!1,!1),t.stateNode=e;e:{switch(W=dt(r,d),r){case"dialog":ct("cancel",e),ct("close",e),w=d;break;case"iframe":case"object":case"embed":ct("load",e),w=d;break;case"video":case"audio":for(w=0;w<An.length;w++)ct(An[w],e);w=d;break;case"source":ct("error",e),w=d;break;case"img":case"image":case"link":ct("error",e),ct("load",e),w=d;break;case"details":ct("toggle",e),w=d;break;case"input":He(e,d),w=ke(e,d),ct("invalid",e);break;case"option":w=d;break;case"select":e._wrapperState={wasMultiple:!!d.multiple},w=$({},d,{value:void 0}),ct("invalid",e);break;case"textarea":we(e,d),w=Ie(e,d),ct("invalid",e);break;default:w=d}it(r,w),G=w;for(R in G)if(G.hasOwnProperty(R)){var J=G[R];R==="style"?ye(e,J):R==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&St(e,J)):R==="children"?typeof J=="string"?(r!=="textarea"||J!=="")&&tt(e,J):typeof J=="number"&&tt(e,""+J):R!=="suppressContentEditableWarning"&&R!=="suppressHydrationWarning"&&R!=="autoFocus"&&(M.hasOwnProperty(R)?J!=null&&R==="onScroll"&&ct("scroll",e):J!=null&&h(e,R,J,W))}switch(r){case"input":he(e),ze(e,d,!1);break;case"textarea":he(e),et(e);break;case"option":d.value!=null&&e.setAttribute("value",""+H(d.value));break;case"select":e.multiple=!!d.multiple,R=d.value,R!=null?Re(e,!!d.multiple,R,!1):d.defaultValue!=null&&Re(e,!!d.multiple,d.defaultValue,!0);break;default:typeof w.onClick=="function"&&(e.onclick=bi)}switch(r){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}}d&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Dt(t),null;case 6:if(e&&t.stateNode!=null)Fu(e,t,e.memoizedProps,d);else{if(typeof d!="string"&&t.stateNode===null)throw Error(p(166));if(r=gs(Bn.current),gs(kr.current),Ti(t)){if(d=t.stateNode,r=t.memoizedProps,d[br]=t,(R=d.nodeValue!==r)&&(e=Xt,e!==null))switch(e.tag){case 3:xi(d.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&xi(d.nodeValue,r,(e.mode&1)!==0)}R&&(t.flags|=4)}else d=(r.nodeType===9?r:r.ownerDocument).createTextNode(d),d[br]=t,t.stateNode=d}return Dt(t),null;case 13:if(ut(mt),d=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ft&&Yt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Wc(),Gs(),t.flags|=98560,R=!1;else if(R=Ti(t),d!==null&&d.dehydrated!==null){if(e===null){if(!R)throw Error(p(318));if(R=t.memoizedState,R=R!==null?R.dehydrated:null,!R)throw Error(p(317));R[br]=t}else Gs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Dt(t),R=!1}else hr!==null&&(Ql(hr),hr=null),R=!0;if(!R)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(d=d!==null,d!==(e!==null&&e.memoizedState!==null)&&d&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(mt.current&1)!==0?bt===0&&(bt=3):ea())),t.updateQueue!==null&&(t.flags|=4),Dt(t),null);case 4:return Js(),$l(e,t),e===null&&Tn(t.stateNode.containerInfo),Dt(t),null;case 10:return pl(t.type._context),Dt(t),null;case 17:return Ht(t.type)&&Ei(),Dt(t),null;case 19:if(ut(mt),R=t.memoizedState,R===null)return Dt(t),null;if(d=(t.flags&128)!==0,W=R.rendering,W===null)if(d)Un(R,!1);else{if(bt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(W=Oi(e),W!==null){for(t.flags|=128,Un(R,!1),d=W.updateQueue,d!==null&&(t.updateQueue=d,t.flags|=4),t.subtreeFlags=0,d=r,r=t.child;r!==null;)R=r,e=d,R.flags&=14680066,W=R.alternate,W===null?(R.childLanes=0,R.lanes=e,R.child=null,R.subtreeFlags=0,R.memoizedProps=null,R.memoizedState=null,R.updateQueue=null,R.dependencies=null,R.stateNode=null):(R.childLanes=W.childLanes,R.lanes=W.lanes,R.child=W.child,R.subtreeFlags=0,R.deletions=null,R.memoizedProps=W.memoizedProps,R.memoizedState=W.memoizedState,R.updateQueue=W.updateQueue,R.type=W.type,e=W.dependencies,R.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return at(mt,mt.current&1|2),t.child}e=e.sibling}R.tail!==null&&_t()>rn&&(t.flags|=128,d=!0,Un(R,!1),t.lanes=4194304)}else{if(!d)if(e=Oi(W),e!==null){if(t.flags|=128,d=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Un(R,!0),R.tail===null&&R.tailMode==="hidden"&&!W.alternate&&!ft)return Dt(t),null}else 2*_t()-R.renderingStartTime>rn&&r!==1073741824&&(t.flags|=128,d=!0,Un(R,!1),t.lanes=4194304);R.isBackwards?(W.sibling=t.child,t.child=W):(r=R.last,r!==null?r.sibling=W:t.child=W,R.last=W)}return R.tail!==null?(t=R.tail,R.rendering=t,R.tail=t.sibling,R.renderingStartTime=_t(),t.sibling=null,r=mt.current,at(mt,d?r&1|2:r&1),t):(Dt(t),null);case 22:case 23:return Zl(),d=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==d&&(t.flags|=8192),d&&(t.mode&1)!==0?(Qt&1073741824)!==0&&(Dt(t),t.subtreeFlags&6&&(t.flags|=8192)):Dt(t),null;case 24:return null;case 25:return null}throw Error(p(156,t.tag))}function Cp(e,t){switch(al(t),t.tag){case 1:return Ht(t.type)&&Ei(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Js(),ut($t),ut(At),Cl(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return yl(t),null;case 13:if(ut(mt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(p(340));Gs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ut(mt),null;case 4:return Js(),null;case 10:return pl(t.type._context),null;case 22:case 23:return Zl(),null;case 24:return null;default:return null}}var Vi=!1,It=!1,wp=typeof WeakSet=="function"?WeakSet:Set,Ee=null;function en(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(d){yt(e,t,d)}else r.current=null}function Hl(e,t,r){try{r()}catch(d){yt(e,t,d)}}var $u=!1;function xp(e,t){if(Zo=di,e=vc(),qo(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var d=r.getSelection&&r.getSelection();if(d&&d.rangeCount!==0){r=d.anchorNode;var w=d.anchorOffset,R=d.focusNode;d=d.focusOffset;try{r.nodeType,R.nodeType}catch{r=null;break e}var W=0,G=-1,J=-1,le=0,pe=0,_e=e,fe=null;t:for(;;){for(var xe;_e!==r||w!==0&&_e.nodeType!==3||(G=W+w),_e!==R||d!==0&&_e.nodeType!==3||(J=W+d),_e.nodeType===3&&(W+=_e.nodeValue.length),(xe=_e.firstChild)!==null;)fe=_e,_e=xe;for(;;){if(_e===e)break t;if(fe===r&&++le===w&&(G=W),fe===R&&++pe===d&&(J=W),(xe=_e.nextSibling)!==null)break;_e=fe,fe=_e.parentNode}_e=xe}r=G===-1||J===-1?null:{start:G,end:J}}else r=null}r=r||{start:0,end:0}}else r=null;for(el={focusedElem:e,selectionRange:r},di=!1,Ee=t;Ee!==null;)if(t=Ee,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ee=e;else for(;Ee!==null;){t=Ee;try{var Le=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(Le!==null){var Me=Le.memoizedProps,Ct=Le.memoizedState,ie=t.stateNode,se=ie.getSnapshotBeforeUpdate(t.elementType===t.type?Me:dr(t.type,Me),Ct);ie.__reactInternalSnapshotBeforeUpdate=se}break;case 3:var oe=t.stateNode.containerInfo;oe.nodeType===1?oe.textContent="":oe.nodeType===9&&oe.documentElement&&oe.removeChild(oe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163))}}catch(ge){yt(t,t.return,ge)}if(e=t.sibling,e!==null){e.return=t.return,Ee=e;break}Ee=t.return}return Le=$u,$u=!1,Le}function zn(e,t,r){var d=t.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var w=d=d.next;do{if((w.tag&e)===e){var R=w.destroy;w.destroy=void 0,R!==void 0&&Hl(t,r,R)}w=w.next}while(w!==d)}}function Ki(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var d=r.create;r.destroy=d()}r=r.next}while(r!==t)}}function Wl(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Hu(e){var t=e.alternate;t!==null&&(e.alternate=null,Hu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[br],delete t[In],delete t[nl],delete t[ip],delete t[op])),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 Wu(e){return e.tag===5||e.tag===3||e.tag===4}function Uu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Wu(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 Ul(e,t,r){var d=e.tag;if(d===5||d===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=bi));else if(d!==4&&(e=e.child,e!==null))for(Ul(e,t,r),e=e.sibling;e!==null;)Ul(e,t,r),e=e.sibling}function zl(e,t,r){var d=e.tag;if(d===5||d===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(d!==4&&(e=e.child,e!==null))for(zl(e,t,r),e=e.sibling;e!==null;)zl(e,t,r),e=e.sibling}var Rt=null,fr=!1;function Yr(e,t,r){for(r=r.child;r!==null;)zu(e,t,r),r=r.sibling}function zu(e,t,r){if(Vt&&typeof Vt.onCommitFiberUnmount=="function")try{Vt.onCommitFiberUnmount(Rs,r)}catch{}switch(r.tag){case 5:It||en(r,t);case 6:var d=Rt,w=fr;Rt=null,Yr(e,t,r),Rt=d,fr=w,Rt!==null&&(fr?(e=Rt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Rt.removeChild(r.stateNode));break;case 18:Rt!==null&&(fr?(e=Rt,r=r.stateNode,e.nodeType===8?sl(e.parentNode,r):e.nodeType===1&&sl(e,r),wn(e)):sl(Rt,r.stateNode));break;case 4:d=Rt,w=fr,Rt=r.stateNode.containerInfo,fr=!0,Yr(e,t,r),Rt=d,fr=w;break;case 0:case 11:case 14:case 15:if(!It&&(d=r.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){w=d=d.next;do{var R=w,W=R.destroy;R=R.tag,W!==void 0&&((R&2)!==0||(R&4)!==0)&&Hl(r,t,W),w=w.next}while(w!==d)}Yr(e,t,r);break;case 1:if(!It&&(en(r,t),d=r.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=r.memoizedProps,d.state=r.memoizedState,d.componentWillUnmount()}catch(G){yt(r,t,G)}Yr(e,t,r);break;case 21:Yr(e,t,r);break;case 22:r.mode&1?(It=(d=It)||r.memoizedState!==null,Yr(e,t,r),It=d):Yr(e,t,r);break;default:Yr(e,t,r)}}function qu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new wp),t.forEach(function(d){var w=Dp.bind(null,e,d);r.has(d)||(r.add(d),d.then(w,w))})}}function pr(e,t){var r=t.deletions;if(r!==null)for(var d=0;d<r.length;d++){var w=r[d];try{var R=e,W=t,G=W;e:for(;G!==null;){switch(G.tag){case 5:Rt=G.stateNode,fr=!1;break e;case 3:Rt=G.stateNode.containerInfo,fr=!0;break e;case 4:Rt=G.stateNode.containerInfo,fr=!0;break e}G=G.return}if(Rt===null)throw Error(p(160));zu(R,W,w),Rt=null,fr=!1;var J=w.alternate;J!==null&&(J.return=null),w.return=null}catch(le){yt(w,t,le)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Vu(t,e),t=t.sibling}function Vu(e,t){var r=e.alternate,d=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(pr(t,e),Lr(e),d&4){try{zn(3,e,e.return),Ki(3,e)}catch(Me){yt(e,e.return,Me)}try{zn(5,e,e.return)}catch(Me){yt(e,e.return,Me)}}break;case 1:pr(t,e),Lr(e),d&512&&r!==null&&en(r,r.return);break;case 5:if(pr(t,e),Lr(e),d&512&&r!==null&&en(r,r.return),e.flags&32){var w=e.stateNode;try{tt(w,"")}catch(Me){yt(e,e.return,Me)}}if(d&4&&(w=e.stateNode,w!=null)){var R=e.memoizedProps,W=r!==null?r.memoizedProps:R,G=e.type,J=e.updateQueue;if(e.updateQueue=null,J!==null)try{G==="input"&&R.type==="radio"&&R.name!=null&&Qe(w,R),dt(G,W);var le=dt(G,R);for(W=0;W<J.length;W+=2){var pe=J[W],_e=J[W+1];pe==="style"?ye(w,_e):pe==="dangerouslySetInnerHTML"?St(w,_e):pe==="children"?tt(w,_e):h(w,pe,_e,le)}switch(G){case"input":ce(w,R);break;case"textarea":We(w,R);break;case"select":var fe=w._wrapperState.wasMultiple;w._wrapperState.wasMultiple=!!R.multiple;var xe=R.value;xe!=null?Re(w,!!R.multiple,xe,!1):fe!==!!R.multiple&&(R.defaultValue!=null?Re(w,!!R.multiple,R.defaultValue,!0):Re(w,!!R.multiple,R.multiple?[]:"",!1))}w[In]=R}catch(Me){yt(e,e.return,Me)}}break;case 6:if(pr(t,e),Lr(e),d&4){if(e.stateNode===null)throw Error(p(162));w=e.stateNode,R=e.memoizedProps;try{w.nodeValue=R}catch(Me){yt(e,e.return,Me)}}break;case 3:if(pr(t,e),Lr(e),d&4&&r!==null&&r.memoizedState.isDehydrated)try{wn(t.containerInfo)}catch(Me){yt(e,e.return,Me)}break;case 4:pr(t,e),Lr(e);break;case 13:pr(t,e),Lr(e),w=e.child,w.flags&8192&&(R=w.memoizedState!==null,w.stateNode.isHidden=R,!R||w.alternate!==null&&w.alternate.memoizedState!==null||(Kl=_t())),d&4&&qu(e);break;case 22:if(pe=r!==null&&r.memoizedState!==null,e.mode&1?(It=(le=It)||pe,pr(t,e),It=le):pr(t,e),Lr(e),d&8192){if(le=e.memoizedState!==null,(e.stateNode.isHidden=le)&&!pe&&(e.mode&1)!==0)for(Ee=e,pe=e.child;pe!==null;){for(_e=Ee=pe;Ee!==null;){switch(fe=Ee,xe=fe.child,fe.tag){case 0:case 11:case 14:case 15:zn(4,fe,fe.return);break;case 1:en(fe,fe.return);var Le=fe.stateNode;if(typeof Le.componentWillUnmount=="function"){d=fe,r=fe.return;try{t=d,Le.props=t.memoizedProps,Le.state=t.memoizedState,Le.componentWillUnmount()}catch(Me){yt(d,r,Me)}}break;case 5:en(fe,fe.return);break;case 22:if(fe.memoizedState!==null){Xu(_e);continue}}xe!==null?(xe.return=fe,Ee=xe):Xu(_e)}pe=pe.sibling}e:for(pe=null,_e=e;;){if(_e.tag===5){if(pe===null){pe=_e;try{w=_e.stateNode,le?(R=w.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none"):(G=_e.stateNode,J=_e.memoizedProps.style,W=J!=null&&J.hasOwnProperty("display")?J.display:null,G.style.display=rt("display",W))}catch(Me){yt(e,e.return,Me)}}}else if(_e.tag===6){if(pe===null)try{_e.stateNode.nodeValue=le?"":_e.memoizedProps}catch(Me){yt(e,e.return,Me)}}else if((_e.tag!==22&&_e.tag!==23||_e.memoizedState===null||_e===e)&&_e.child!==null){_e.child.return=_e,_e=_e.child;continue}if(_e===e)break e;for(;_e.sibling===null;){if(_e.return===null||_e.return===e)break e;pe===_e&&(pe=null),_e=_e.return}pe===_e&&(pe=null),_e.sibling.return=_e.return,_e=_e.sibling}}break;case 19:pr(t,e),Lr(e),d&4&&qu(e);break;case 21:break;default:pr(t,e),Lr(e)}}function Lr(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Wu(r)){var d=r;break e}r=r.return}throw Error(p(160))}switch(d.tag){case 5:var w=d.stateNode;d.flags&32&&(tt(w,""),d.flags&=-33);var R=Uu(e);zl(e,R,w);break;case 3:case 4:var W=d.stateNode.containerInfo,G=Uu(e);Ul(e,G,W);break;default:throw Error(p(161))}}catch(J){yt(e,e.return,J)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bp(e,t,r){Ee=e,Ku(e)}function Ku(e,t,r){for(var d=(e.mode&1)!==0;Ee!==null;){var w=Ee,R=w.child;if(w.tag===22&&d){var W=w.memoizedState!==null||Vi;if(!W){var G=w.alternate,J=G!==null&&G.memoizedState!==null||It;G=Vi;var le=It;if(Vi=W,(It=J)&&!le)for(Ee=w;Ee!==null;)W=Ee,J=W.child,W.tag===22&&W.memoizedState!==null?Yu(w):J!==null?(J.return=W,Ee=J):Yu(w);for(;R!==null;)Ee=R,Ku(R),R=R.sibling;Ee=w,Vi=G,It=le}Gu(e)}else(w.subtreeFlags&8772)!==0&&R!==null?(R.return=w,Ee=R):Gu(e)}}function Gu(e){for(;Ee!==null;){var t=Ee;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:It||Ki(5,t);break;case 1:var d=t.stateNode;if(t.flags&4&&!It)if(r===null)d.componentDidMount();else{var w=t.elementType===t.type?r.memoizedProps:dr(t.type,r.memoizedProps);d.componentDidUpdate(w,r.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var R=t.updateQueue;R!==null&&Xc(t,R,d);break;case 3:var W=t.updateQueue;if(W!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Xc(t,W,r)}break;case 5:var G=t.stateNode;if(r===null&&t.flags&4){r=G;var J=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&r.focus();break;case"img":J.src&&(r.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var le=t.alternate;if(le!==null){var pe=le.memoizedState;if(pe!==null){var _e=pe.dehydrated;_e!==null&&wn(_e)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(p(163))}It||t.flags&512&&Wl(t)}catch(fe){yt(t,t.return,fe)}}if(t===e){Ee=null;break}if(r=t.sibling,r!==null){r.return=t.return,Ee=r;break}Ee=t.return}}function Xu(e){for(;Ee!==null;){var t=Ee;if(t===e){Ee=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Ee=r;break}Ee=t.return}}function Yu(e){for(;Ee!==null;){var t=Ee;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Ki(4,t)}catch(J){yt(t,r,J)}break;case 1:var d=t.stateNode;if(typeof d.componentDidMount=="function"){var w=t.return;try{d.componentDidMount()}catch(J){yt(t,w,J)}}var R=t.return;try{Wl(t)}catch(J){yt(t,R,J)}break;case 5:var W=t.return;try{Wl(t)}catch(J){yt(t,W,J)}}}catch(J){yt(t,t.return,J)}if(t===e){Ee=null;break}var G=t.sibling;if(G!==null){G.return=t.return,Ee=G;break}Ee=t.return}}var kp=Math.ceil,Gi=y.ReactCurrentDispatcher,ql=y.ReactCurrentOwner,sr=y.ReactCurrentBatchConfig,Ze=0,Et=null,wt=null,Mt=0,Qt=0,tn=qr(0),bt=0,qn=null,ys=0,Xi=0,Vl=0,Vn=null,Ut=null,Kl=0,rn=1/0,Or=null,Yi=!1,Gl=null,Qr=null,Qi=!1,Jr=null,Ji=0,Kn=0,Xl=null,Zi=-1,eo=0;function Ft(){return(Ze&6)!==0?_t():Zi!==-1?Zi:Zi=_t()}function Zr(e){return(e.mode&1)===0?1:(Ze&2)!==0&&Mt!==0?Mt&-Mt:ap.transition!==null?(eo===0&&(eo=ai()),eo):(e=nt,e!==0||(e=window.event,e=e===void 0?16:Ja(e.type)),e)}function _r(e,t,r,d){if(50<Kn)throw Kn=0,Xl=null,Error(p(185));us(e,r,d),((Ze&2)===0||e!==Et)&&(e===Et&&((Ze&2)===0&&(Xi|=r),bt===4&&es(e,Mt)),zt(e,d),r===1&&Ze===0&&(t.mode&1)===0&&(rn=_t()+500,Ri&&Kr()))}function zt(e,t){var r=e.callbackNode;Do(e,t);var d=As(e,e===Et?Mt:0);if(d===0)r!==null&&gn(r),e.callbackNode=null,e.callbackPriority=0;else if(t=d&-d,e.callbackPriority!==t){if(r!=null&&gn(r),t===1)e.tag===0?lp(Ju.bind(null,e)):Oc(Ju.bind(null,e)),sp(function(){(Ze&6)===0&&Kr()}),r=null;else{switch(ci(d)){case 1:r=Es;break;case 4:r=Ls;break;case 16:r=$r;break;case 536870912:r=ii;break;default:r=$r}r=oh(r,Qu.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Qu(e,t){if(Zi=-1,eo=0,(Ze&6)!==0)throw Error(p(327));var r=e.callbackNode;if(sn()&&e.callbackNode!==r)return null;var d=As(e,e===Et?Mt:0);if(d===0)return null;if((d&30)!==0||(d&e.expiredLanes)!==0||t)t=to(e,d);else{t=d;var w=Ze;Ze|=2;var R=eh();(Et!==e||Mt!==t)&&(Or=null,rn=_t()+500,Cs(e,t));do try{Rp();break}catch(G){Zu(e,G)}while(!0);fl(),Gi.current=R,Ze=w,wt!==null?t=0:(Et=null,Mt=0,t=bt)}if(t!==0){if(t===2&&(w=xr(e),w!==0&&(d=w,t=Yl(e,w))),t===1)throw r=qn,Cs(e,0),es(e,d),zt(e,_t()),r;if(t===6)es(e,d);else{if(w=e.current.alternate,(d&30)===0&&!Ep(w)&&(t=to(e,d),t===2&&(R=xr(e),R!==0&&(d=R,t=Yl(e,R))),t===1))throw r=qn,Cs(e,0),es(e,d),zt(e,_t()),r;switch(e.finishedWork=w,e.finishedLanes=d,t){case 0:case 1:throw Error(p(345));case 2:ws(e,Ut,Or);break;case 3:if(es(e,d),(d&130023424)===d&&(t=Kl+500-_t(),10<t)){if(As(e,0)!==0)break;if(w=e.suspendedLanes,(w&d)!==d){Ft(),e.pingedLanes|=e.suspendedLanes&w;break}e.timeoutHandle=rl(ws.bind(null,e,Ut,Or),t);break}ws(e,Ut,Or);break;case 4:if(es(e,d),(d&4194240)===d)break;for(t=e.eventTimes,w=-1;0<d;){var W=31-Kt(d);R=1<<W,W=t[W],W>w&&(w=W),d&=~R}if(d=w,d=_t()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*kp(d/1960))-d,10<d){e.timeoutHandle=rl(ws.bind(null,e,Ut,Or),d);break}ws(e,Ut,Or);break;case 5:ws(e,Ut,Or);break;default:throw Error(p(329))}}}return zt(e,_t()),e.callbackNode===r?Qu.bind(null,e):null}function Yl(e,t){var r=Vn;return e.current.memoizedState.isDehydrated&&(Cs(e,t).flags|=256),e=to(e,t),e!==2&&(t=Ut,Ut=r,t!==null&&Ql(t)),e}function Ql(e){Ut===null?Ut=e:Ut.push.apply(Ut,e)}function Ep(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var d=0;d<r.length;d++){var w=r[d],R=w.getSnapshot;w=w.value;try{if(!ur(R(),w))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function es(e,t){for(t&=~Vl,t&=~Xi,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Kt(t),d=1<<r;e[r]=-1,t&=~d}}function Ju(e){if((Ze&6)!==0)throw Error(p(327));sn();var t=As(e,0);if((t&1)===0)return zt(e,_t()),null;var r=to(e,t);if(e.tag!==0&&r===2){var d=xr(e);d!==0&&(t=d,r=Yl(e,d))}if(r===1)throw r=qn,Cs(e,0),es(e,t),zt(e,_t()),r;if(r===6)throw Error(p(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ws(e,Ut,Or),zt(e,_t()),null}function Jl(e,t){var r=Ze;Ze|=1;try{return e(t)}finally{Ze=r,Ze===0&&(rn=_t()+500,Ri&&Kr())}}function Ss(e){Jr!==null&&Jr.tag===0&&(Ze&6)===0&&sn();var t=Ze;Ze|=1;var r=sr.transition,d=nt;try{if(sr.transition=null,nt=1,e)return e()}finally{nt=d,sr.transition=r,Ze=t,(Ze&6)===0&&Kr()}}function Zl(){Qt=tn.current,ut(tn)}function Cs(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,rp(r)),wt!==null)for(r=wt.return;r!==null;){var d=r;switch(al(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&Ei();break;case 3:Js(),ut($t),ut(At),Cl();break;case 5:yl(d);break;case 4:Js();break;case 13:ut(mt);break;case 19:ut(mt);break;case 10:pl(d.type._context);break;case 22:case 23:Zl()}r=r.return}if(Et=e,wt=e=ts(e.current,null),Mt=Qt=t,bt=0,qn=null,Vl=Xi=ys=0,Ut=Vn=null,ms!==null){for(t=0;t<ms.length;t++)if(r=ms[t],d=r.interleaved,d!==null){r.interleaved=null;var w=d.next,R=r.pending;if(R!==null){var W=R.next;R.next=w,d.next=W}r.pending=d}ms=null}return e}function Zu(e,t){do{var r=wt;try{if(fl(),Bi.current=Wi,Fi){for(var d=gt.memoizedState;d!==null;){var w=d.queue;w!==null&&(w.pending=null),d=d.next}Fi=!1}if(vs=0,kt=xt=gt=null,Fn=!1,$n=0,ql.current=null,r===null||r.return===null){bt=1,qn=t,wt=null;break}e:{var R=e,W=r.return,G=r,J=t;if(t=Mt,G.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var le=J,pe=G,_e=pe.tag;if((pe.mode&1)===0&&(_e===0||_e===11||_e===15)){var fe=pe.alternate;fe?(pe.updateQueue=fe.updateQueue,pe.memoizedState=fe.memoizedState,pe.lanes=fe.lanes):(pe.updateQueue=null,pe.memoizedState=null)}var xe=bu(W);if(xe!==null){xe.flags&=-257,ku(xe,W,G,R,t),xe.mode&1&&xu(R,le,t),t=xe,J=le;var Le=t.updateQueue;if(Le===null){var Me=new Set;Me.add(J),t.updateQueue=Me}else Le.add(J);break e}else{if((t&1)===0){xu(R,le,t),ea();break e}J=Error(p(426))}}else if(ft&&G.mode&1){var Ct=bu(W);if(Ct!==null){(Ct.flags&65536)===0&&(Ct.flags|=256),ku(Ct,W,G,R,t),hl(Zs(J,G));break e}}R=J=Zs(J,G),bt!==4&&(bt=2),Vn===null?Vn=[R]:Vn.push(R),R=W;do{switch(R.tag){case 3:R.flags|=65536,t&=-t,R.lanes|=t;var ie=Cu(R,J,t);Gc(R,ie);break e;case 1:G=J;var se=R.type,oe=R.stateNode;if((R.flags&128)===0&&(typeof se.getDerivedStateFromError=="function"||oe!==null&&typeof oe.componentDidCatch=="function"&&(Qr===null||!Qr.has(oe)))){R.flags|=65536,t&=-t,R.lanes|=t;var ge=wu(R,G,t);Gc(R,ge);break e}}R=R.return}while(R!==null)}rh(r)}catch(Ae){t=Ae,wt===r&&r!==null&&(wt=r=r.return);continue}break}while(!0)}function eh(){var e=Gi.current;return Gi.current=Wi,e===null?Wi:e}function ea(){(bt===0||bt===3||bt===2)&&(bt=4),Et===null||(ys&268435455)===0&&(Xi&268435455)===0||es(Et,Mt)}function to(e,t){var r=Ze;Ze|=2;var d=eh();(Et!==e||Mt!==t)&&(Or=null,Cs(e,t));do try{Lp();break}catch(w){Zu(e,w)}while(!0);if(fl(),Ze=r,Gi.current=d,wt!==null)throw Error(p(261));return Et=null,Mt=0,bt}function Lp(){for(;wt!==null;)th(wt)}function Rp(){for(;wt!==null&&!Ro();)th(wt)}function th(e){var t=ih(e.alternate,e,Qt);e.memoizedProps=e.pendingProps,t===null?rh(e):wt=t,ql.current=null}function rh(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=Sp(r,t,Qt),r!==null){wt=r;return}}else{if(r=Cp(r,t),r!==null){r.flags&=32767,wt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{bt=6,wt=null;return}}if(t=t.sibling,t!==null){wt=t;return}wt=t=e}while(t!==null);bt===0&&(bt=5)}function ws(e,t,r){var d=nt,w=sr.transition;try{sr.transition=null,nt=1,Mp(e,t,r,d)}finally{sr.transition=w,nt=d}return null}function Mp(e,t,r,d){do sn();while(Jr!==null);if((Ze&6)!==0)throw Error(p(327));r=e.finishedWork;var w=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(p(177));e.callbackNode=null,e.callbackPriority=0;var R=r.lanes|r.childLanes;if(Io(e,R),e===Et&&(wt=Et=null,Mt=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||Qi||(Qi=!0,oh($r,function(){return sn(),null})),R=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||R){R=sr.transition,sr.transition=null;var W=nt;nt=1;var G=Ze;Ze|=4,ql.current=null,xp(e,r),Vu(r,e),Xf(el),di=!!Zo,el=Zo=null,e.current=r,bp(r),Mo(),Ze=G,nt=W,sr.transition=R}else e.current=r;if(Qi&&(Qi=!1,Jr=e,Ji=w),R=e.pendingLanes,R===0&&(Qr=null),wr(r.stateNode),zt(e,_t()),t!==null)for(d=e.onRecoverableError,r=0;r<t.length;r++)w=t[r],d(w.value,{componentStack:w.stack,digest:w.digest});if(Yi)throw Yi=!1,e=Gl,Gl=null,e;return(Ji&1)!==0&&e.tag!==0&&sn(),R=e.pendingLanes,(R&1)!==0?e===Xl?Kn++:(Kn=0,Xl=e):Kn=0,Kr(),null}function sn(){if(Jr!==null){var e=ci(Ji),t=sr.transition,r=nt;try{if(sr.transition=null,nt=16>e?16:e,Jr===null)var d=!1;else{if(e=Jr,Jr=null,Ji=0,(Ze&6)!==0)throw Error(p(331));var w=Ze;for(Ze|=4,Ee=e.current;Ee!==null;){var R=Ee,W=R.child;if((Ee.flags&16)!==0){var G=R.deletions;if(G!==null){for(var J=0;J<G.length;J++){var le=G[J];for(Ee=le;Ee!==null;){var pe=Ee;switch(pe.tag){case 0:case 11:case 15:zn(8,pe,R)}var _e=pe.child;if(_e!==null)_e.return=pe,Ee=_e;else for(;Ee!==null;){pe=Ee;var fe=pe.sibling,xe=pe.return;if(Hu(pe),pe===le){Ee=null;break}if(fe!==null){fe.return=xe,Ee=fe;break}Ee=xe}}}var Le=R.alternate;if(Le!==null){var Me=Le.child;if(Me!==null){Le.child=null;do{var Ct=Me.sibling;Me.sibling=null,Me=Ct}while(Me!==null)}}Ee=R}}if((R.subtreeFlags&2064)!==0&&W!==null)W.return=R,Ee=W;else e:for(;Ee!==null;){if(R=Ee,(R.flags&2048)!==0)switch(R.tag){case 0:case 11:case 15:zn(9,R,R.return)}var ie=R.sibling;if(ie!==null){ie.return=R.return,Ee=ie;break e}Ee=R.return}}var se=e.current;for(Ee=se;Ee!==null;){W=Ee;var oe=W.child;if((W.subtreeFlags&2064)!==0&&oe!==null)oe.return=W,Ee=oe;else e:for(W=se;Ee!==null;){if(G=Ee,(G.flags&2048)!==0)try{switch(G.tag){case 0:case 11:case 15:Ki(9,G)}}catch(Ae){yt(G,G.return,Ae)}if(G===W){Ee=null;break e}var ge=G.sibling;if(ge!==null){ge.return=G.return,Ee=ge;break e}Ee=G.return}}if(Ze=w,Kr(),Vt&&typeof Vt.onPostCommitFiberRoot=="function")try{Vt.onPostCommitFiberRoot(Rs,e)}catch{}d=!0}return d}finally{nt=r,sr.transition=t}}return!1}function sh(e,t,r){t=Zs(r,t),t=Cu(e,t,1),e=Xr(e,t,1),t=Ft(),e!==null&&(us(e,1,t),zt(e,t))}function yt(e,t,r){if(e.tag===3)sh(e,e,r);else for(;t!==null;){if(t.tag===3){sh(t,e,r);break}else if(t.tag===1){var d=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Qr===null||!Qr.has(d))){e=Zs(r,e),e=wu(t,e,1),t=Xr(t,e,1),e=Ft(),t!==null&&(us(t,1,e),zt(t,e));break}}t=t.return}}function Ap(e,t,r){var d=e.pingCache;d!==null&&d.delete(t),t=Ft(),e.pingedLanes|=e.suspendedLanes&r,Et===e&&(Mt&r)===r&&(bt===4||bt===3&&(Mt&130023424)===Mt&&500>_t()-Kl?Cs(e,0):Vl|=r),zt(e,t)}function nh(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ms,Ms<<=1,(Ms&130023424)===0&&(Ms=4194304)));var r=Ft();e=Nr(e,t),e!==null&&(us(e,t,r),zt(e,r))}function Tp(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),nh(e,r)}function Dp(e,t){var r=0;switch(e.tag){case 13:var d=e.stateNode,w=e.memoizedState;w!==null&&(r=w.retryLane);break;case 19:d=e.stateNode;break;default:throw Error(p(314))}d!==null&&d.delete(t),nh(e,r)}var ih;ih=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||$t.current)Wt=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return Wt=!1,yp(e,t,r);Wt=(e.flags&131072)!==0}else Wt=!1,ft&&(t.flags&1048576)!==0&&Bc(t,Ai,t.index);switch(t.lanes=0,t.tag){case 2:var d=t.type;qi(e,t),e=t.pendingProps;var w=qs(t,At.current);Qs(t,r),w=bl(null,t,d,e,w,r);var R=kl();return t.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ht(d)?(R=!0,Li(t)):R=!1,t.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,gl(t),w.updater=Ui,t.stateNode=w,w._reactInternals=t,Tl(t,d,e,r),t=Pl(null,t,d,!0,R,r)):(t.tag=0,ft&&R&&ll(t),Bt(null,t,w,r),t=t.child),t;case 16:d=t.elementType;e:{switch(qi(e,t),e=t.pendingProps,w=d._init,d=w(d._payload),t.type=d,w=t.tag=Np(d),e=dr(d,e),w){case 0:t=Nl(null,t,d,e,r);break e;case 1:t=Tu(null,t,d,e,r);break e;case 11:t=Eu(null,t,d,e,r);break e;case 14:t=Lu(null,t,d,dr(d.type,e),r);break e}throw Error(p(306,d,""))}return t;case 0:return d=t.type,w=t.pendingProps,w=t.elementType===d?w:dr(d,w),Nl(e,t,d,w,r);case 1:return d=t.type,w=t.pendingProps,w=t.elementType===d?w:dr(d,w),Tu(e,t,d,w,r);case 3:e:{if(Du(t),e===null)throw Error(p(387));d=t.pendingProps,R=t.memoizedState,w=R.element,Kc(e,t),ji(t,d,null,r);var W=t.memoizedState;if(d=W.element,R.isDehydrated)if(R={element:d,isDehydrated:!1,cache:W.cache,pendingSuspenseBoundaries:W.pendingSuspenseBoundaries,transitions:W.transitions},t.updateQueue.baseState=R,t.memoizedState=R,t.flags&256){w=Zs(Error(p(423)),t),t=Iu(e,t,d,r,w);break e}else if(d!==w){w=Zs(Error(p(424)),t),t=Iu(e,t,d,r,w);break e}else for(Yt=zr(t.stateNode.containerInfo.firstChild),Xt=t,ft=!0,hr=null,r=qc(t,null,d,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Gs(),d===w){t=jr(e,t,r);break e}Bt(e,t,d,r)}t=t.child}return t;case 5:return Yc(t),e===null&&ul(t),d=t.type,w=t.pendingProps,R=e!==null?e.memoizedProps:null,W=w.children,tl(d,w)?W=null:R!==null&&tl(d,R)&&(t.flags|=32),Au(e,t),Bt(e,t,W,r),t.child;case 6:return e===null&&ul(t),null;case 13:return Nu(e,t,r);case 4:return vl(t,t.stateNode.containerInfo),d=t.pendingProps,e===null?t.child=Xs(t,null,d,r):Bt(e,t,d,r),t.child;case 11:return d=t.type,w=t.pendingProps,w=t.elementType===d?w:dr(d,w),Eu(e,t,d,w,r);case 7:return Bt(e,t,t.pendingProps,r),t.child;case 8:return Bt(e,t,t.pendingProps.children,r),t.child;case 12:return Bt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(d=t.type._context,w=t.pendingProps,R=t.memoizedProps,W=w.value,at(Ii,d._currentValue),d._currentValue=W,R!==null)if(ur(R.value,W)){if(R.children===w.children&&!$t.current){t=jr(e,t,r);break e}}else for(R=t.child,R!==null&&(R.return=t);R!==null;){var G=R.dependencies;if(G!==null){W=R.child;for(var J=G.firstContext;J!==null;){if(J.context===d){if(R.tag===1){J=Pr(-1,r&-r),J.tag=2;var le=R.updateQueue;if(le!==null){le=le.shared;var pe=le.pending;pe===null?J.next=J:(J.next=pe.next,pe.next=J),le.pending=J}}R.lanes|=r,J=R.alternate,J!==null&&(J.lanes|=r),_l(R.return,r,t),G.lanes|=r;break}J=J.next}}else if(R.tag===10)W=R.type===t.type?null:R.child;else if(R.tag===18){if(W=R.return,W===null)throw Error(p(341));W.lanes|=r,G=W.alternate,G!==null&&(G.lanes|=r),_l(W,r,t),W=R.sibling}else W=R.child;if(W!==null)W.return=R;else for(W=R;W!==null;){if(W===t){W=null;break}if(R=W.sibling,R!==null){R.return=W.return,W=R;break}W=W.return}R=W}Bt(e,t,w.children,r),t=t.child}return t;case 9:return w=t.type,d=t.pendingProps.children,Qs(t,r),w=tr(w),d=d(w),t.flags|=1,Bt(e,t,d,r),t.child;case 14:return d=t.type,w=dr(d,t.pendingProps),w=dr(d.type,w),Lu(e,t,d,w,r);case 15:return Ru(e,t,t.type,t.pendingProps,r);case 17:return d=t.type,w=t.pendingProps,w=t.elementType===d?w:dr(d,w),qi(e,t),t.tag=1,Ht(d)?(e=!0,Li(t)):e=!1,Qs(t,r),yu(t,d,w),Tl(t,d,w,r),Pl(null,t,d,!0,e,r);case 19:return ju(e,t,r);case 22:return Mu(e,t,r)}throw Error(p(156,t.tag))};function oh(e,t){return mn(e,t)}function Ip(e,t,r,d){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nr(e,t,r,d){return new Ip(e,t,r,d)}function ta(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Np(e){if(typeof e=="function")return ta(e)?1:0;if(e!=null){if(e=e.$$typeof,e===D)return 11;if(e===X)return 14}return 2}function ts(e,t){var r=e.alternate;return r===null?(r=nr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function ro(e,t,r,d,w,R){var W=2;if(d=e,typeof e=="function")ta(e)&&(W=1);else if(typeof e=="string")W=5;else e:switch(e){case A:return xs(r.children,w,R,t);case x:W=8,w|=8;break;case E:return e=nr(12,r,t,w|2),e.elementType=E,e.lanes=R,e;case B:return e=nr(13,r,t,w),e.elementType=B,e.lanes=R,e;case z:return e=nr(19,r,t,w),e.elementType=z,e.lanes=R,e;case Y:return so(r,w,R,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T:W=10;break e;case j:W=9;break e;case D:W=11;break e;case X:W=14;break e;case Z:W=16,d=null;break e}throw Error(p(130,e==null?e:typeof e,""))}return t=nr(W,r,t,w),t.elementType=e,t.type=d,t.lanes=R,t}function xs(e,t,r,d){return e=nr(7,e,d,t),e.lanes=r,e}function so(e,t,r,d){return e=nr(22,e,d,t),e.elementType=Y,e.lanes=r,e.stateNode={isHidden:!1},e}function ra(e,t,r){return e=nr(6,e,null,t),e.lanes=r,e}function sa(e,t,r){return t=nr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Pp(e,t,r,d,w){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=Ts(0),this.expirationTimes=Ts(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ts(0),this.identifierPrefix=d,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function na(e,t,r,d,w,R,W,G,J){return e=new Pp(e,t,r,G,J),t===1?(t=1,R===!0&&(t|=8)):t=0,R=nr(3,null,null,t),e.current=R,R.stateNode=e,R.memoizedState={element:d,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},gl(R),e}function jp(e,t,r){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:k,key:d==null?null:""+d,children:e,containerInfo:t,implementation:r}}function lh(e){if(!e)return Vr;e=e._reactInternals;e:{if(Rr(e)!==e||e.tag!==1)throw Error(p(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ht(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(p(171))}if(e.tag===1){var r=e.type;if(Ht(r))return Pc(e,r,t)}return t}function ah(e,t,r,d,w,R,W,G,J){return e=na(r,d,!0,e,w,R,W,G,J),e.context=lh(null),r=e.current,d=Ft(),w=Zr(r),R=Pr(d,w),R.callback=t??null,Xr(r,R,w),e.current.lanes=w,us(e,w,d),zt(e,d),e}function no(e,t,r,d){var w=t.current,R=Ft(),W=Zr(w);return r=lh(r),t.context===null?t.context=r:t.pendingContext=r,t=Pr(R,W),t.payload={element:e},d=d===void 0?null:d,d!==null&&(t.callback=d),e=Xr(w,t,W),e!==null&&(_r(e,w,W,R),Pi(e,w,W)),W}function io(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 ch(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function ia(e,t){ch(e,t),(e=e.alternate)&&ch(e,t)}function Op(){return null}var uh=typeof reportError=="function"?reportError:function(e){console.error(e)};function oa(e){this._internalRoot=e}oo.prototype.render=oa.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(p(409));no(e,t,null,null)},oo.prototype.unmount=oa.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ss(function(){no(null,e,null,null)}),t[Ar]=null}};function oo(e){this._internalRoot=e}oo.prototype.unstable_scheduleHydration=function(e){if(e){var t=yn();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Hr.length&&t!==0&&t<Hr[r].priority;r++);Hr.splice(r,0,e),r===0&&Ya(e)}};function la(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function lo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function hh(){}function Bp(e,t,r,d,w){if(w){if(typeof d=="function"){var R=d;d=function(){var le=io(W);R.call(le)}}var W=ah(t,d,e,0,null,!1,!1,"",hh);return e._reactRootContainer=W,e[Ar]=W.current,Tn(e.nodeType===8?e.parentNode:e),Ss(),W}for(;w=e.lastChild;)e.removeChild(w);if(typeof d=="function"){var G=d;d=function(){var le=io(J);G.call(le)}}var J=na(e,0,!1,null,null,!1,!1,"",hh);return e._reactRootContainer=J,e[Ar]=J.current,Tn(e.nodeType===8?e.parentNode:e),Ss(function(){no(t,J,r,d)}),J}function ao(e,t,r,d,w){var R=r._reactRootContainer;if(R){var W=R;if(typeof w=="function"){var G=w;w=function(){var J=io(W);G.call(J)}}no(t,W,e,w)}else W=Bp(r,t,e,w,d);return io(W)}Ds=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=cs(t.pendingLanes);r!==0&&(vn(t,r|1),zt(t,_t()),(Ze&6)===0&&(rn=_t()+500,Kr()))}break;case 13:Ss(function(){var d=Nr(e,1);if(d!==null){var w=Ft();_r(d,e,1,w)}}),ia(e,1)}},Is=function(e){if(e.tag===13){var t=Nr(e,134217728);if(t!==null){var r=Ft();_r(t,e,134217728,r)}ia(e,134217728)}},Ns=function(e){if(e.tag===13){var t=Zr(e),r=Nr(e,t);if(r!==null){var d=Ft();_r(r,e,t,d)}ia(e,t)}},yn=function(){return nt},ui=function(e,t){var r=nt;try{return nt=e,t()}finally{nt=r}},ue=function(e,t,r){switch(t){case"input":if(ce(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var d=r[t];if(d!==e&&d.form===e.form){var w=ki(d);if(!w)throw Error(p(90));de(d),ce(d,w)}}}break;case"textarea":We(e,r);break;case"select":t=r.value,t!=null&&Re(e,!!r.multiple,t,!1)}},os=Jl,Br=Ss;var Fp={usingClientEntryPoint:!1,Events:[Nn,Us,ki,qe,Cr,Jl]},Gn={findFiberByHostInstance:ds,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},$p={bundleType:Gn.bundleType,version:Gn.version,rendererPackageName:Gn.rendererPackageName,rendererConfig:Gn.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:y.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=pn(e),e===null?null:e.stateNode},findFiberByHostInstance:Gn.findFiberByHostInstance||Op,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var co=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!co.isDisabled&&co.supportsFiber)try{Rs=co.inject($p),Vt=co}catch{}}return qt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Fp,qt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!la(t))throw Error(p(200));return jp(e,t,null,r)},qt.createRoot=function(e,t){if(!la(e))throw Error(p(299));var r=!1,d="",w=uh;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(d=t.identifierPrefix),t.onRecoverableError!==void 0&&(w=t.onRecoverableError)),t=na(e,1,!1,null,null,r,!1,d,w),e[Ar]=t.current,Tn(e.nodeType===8?e.parentNode:e),new oa(t)},qt.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(p(188)):(e=Object.keys(e).join(","),Error(p(268,e)));return e=pn(t),e=e===null?null:e.stateNode,e},qt.flushSync=function(e){return Ss(e)},qt.hydrate=function(e,t,r){if(!lo(t))throw Error(p(200));return ao(null,e,t,!0,r)},qt.hydrateRoot=function(e,t,r){if(!la(e))throw Error(p(405));var d=r!=null&&r.hydratedSources||null,w=!1,R="",W=uh;if(r!=null&&(r.unstable_strictMode===!0&&(w=!0),r.identifierPrefix!==void 0&&(R=r.identifierPrefix),r.onRecoverableError!==void 0&&(W=r.onRecoverableError)),t=ah(t,null,e,1,r??null,w,!1,R,W),e[Ar]=t.current,Tn(e),d)for(e=0;e<d.length;e++)r=d[e],w=r._getVersion,w=w(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,w]:t.mutableSourceEagerHydrationData.push(r,w);return new oo(t)},qt.render=function(e,t,r){if(!lo(t))throw Error(p(200));return ao(null,e,t,!1,r)},qt.unmountComponentAtNode=function(e){if(!lo(e))throw Error(p(40));return e._reactRootContainer?(Ss(function(){ao(null,null,e,!1,function(){e._reactRootContainer=null,e[Ar]=null})}),!0):!1},qt.unstable_batchedUpdates=Jl,qt.unstable_renderSubtreeIntoContainer=function(e,t,r,d){if(!lo(r))throw Error(p(200));if(e==null||e._reactInternals===void 0)throw Error(p(38));return ao(e,t,r,!1,d)},qt.version="18.3.1-next-f1338f8080-20240426",qt}var yh;function xd(){if(yh)return ua.exports;yh=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(s){console.error(s)}}return n(),ua.exports=Yp(),ua.exports}var Sh;function Qp(){if(Sh)return uo;Sh=1;var n=xd();return uo.createRoot=n.createRoot,uo.hydrateRoot=n.hydrateRoot,uo}var Jp=Qp(),F=Ha();const Zp=zp(F);function je(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)?n:null}function be(n){return typeof n=="string"?n:null}function ve(n){return typeof n=="string"&&n.length>0?n:null}function pt(n){return typeof n=="boolean"?n:null}function Be(n){return typeof n=="number"&&Number.isFinite(n)?n:null}function vo(n){if(!Array.isArray(n))return null;const s=[];for(const p of n){if(typeof p!="string")return null;s.push(p)}return s}function vt(n,s){if(!Array.isArray(n))return null;const p=[];for(const S of n){const M=s(S);if(M===null)return null;p.push(M)}return p}function yr(n,s){if(!Array.isArray(n))return null;const p=[];for(const S of n){const M=s(S);M!==null&&p.push(M)}return p}function Ue(n,s){return typeof n=="string"&&s.includes(n)?n:null}function e_(n){try{return JSON.parse(n)}catch{return}}const t_=["auto","default","acceptEdits","plan"],bd={auto:"Automatico",default:"Manual",acceptEdits:"Aceptar ediciones",plan:"Plan"},r_={auto:"La CLI decide sola que herramientas usar sin preguntar",default:"Pregunta antes de cada herramienta que no este permitida",acceptEdits:"Acepta las ediciones de archivos sin preguntar",plan:"Investiga y propone un plan, sin tocar nada hasta que lo apruebes"};function on(n){return typeof n=="string"&&t_.includes(n)}const cn=["claude-code","codex","opencode","antigravity"],s_=["gemini-cli","antigravity-ide"],xo=[...cn,...s_],n_={"gemini-cli":"Gemini CLI","antigravity-ide":"Antigravity IDE"};function ei(n){return cn.includes(n)}const i_=["at-quoted","bare-path-paste"],o_=["at"],l_=["usage-with-variants","token-count","usage-with-catalog","status-line"],a_=["child-session-marker"],c_=["active","missing","other-command","disabled","unreadable"];function kd(n,s=null){return!n.statusSource||s==="unknown"}const Ed={sessionIdAtLaunch:!1,resume:!1,statusSource:!1,readySignal:!1,permissionCycle:null,models:null,efforts:null,questionCards:!1,imagesByPath:null,fileMentions:null,rewind:!1,contextWindowSource:null,plans:!1,waitingBlocksSubmit:!1};function Wa(n){return n.filter(s=>s.available).length>1}function u_(n){const s=je(n);if(s===null)return null;const p=s.modes;if(!Array.isArray(p)||p.length===0)return null;const S=[];for(const N of p){if(!on(N))return null;S.push(N)}const M=s.launchMode;if(!on(M)||!S.includes(M))return null;const P=ve(s.keyLabel);return P===null?null:{modes:S,launchMode:M,keyLabel:P,approvesPendingOnCycle:s.approvesPendingOnCycle===!0}}function h_(n){const s=je(n);if(s===null)return null;const p=Ue(s.state,c_),S=ve(s.settingsPath),M=ve(s.scriptPath),P=s.fragment,N=P===null?null:ve(P);return p===null||S===null||M===null||P!==null&&N===null?null:{state:p,settingsPath:S,scriptPath:M,fragment:N}}function d_(n){const s=je(n);if(s===null)return null;const p=ve(s.value),S=be(s.label),M=be(s.family),P=pt(s.long),N=s.window,i=N===null?null:Be(N);return p===null||S===null||M===null||P===null||N!==null&&i===null?null:{value:p,label:S,family:M,long:P,window:i}}function f_(n){const s=je(n);if(s===null)return null;const p=ve(s.value),S=be(s.label);return p===null||S===null?null:{value:p,label:S}}function Ch(n,s){const p=vt(n,s);return p===null||p.length===0?null:p}function p_(n){const s=je(n);return s===null?{...Ed}:{sessionIdAtLaunch:s.sessionIdAtLaunch===!0,resume:s.resume===!0,statusSource:s.statusSource===!0,readySignal:s.readySignal===!0,permissionCycle:u_(s.permissionCycle),models:Ch(s.models,d_),efforts:Ch(s.efforts,f_),questionCards:s.questionCards===!0,imagesByPath:Ue(s.imagesByPath,i_),fileMentions:Ue(s.fileMentions,o_),rewind:s.rewind===!0,contextWindowSource:Ue(s.contextWindowSource,l_),plans:s.plans===!0,waitingBlocksSubmit:s.waitingBlocksSubmit===!0}}function wh(n){const s=je(n);if(s===null)return null;const p=Ue(s.id,cn),S=be(s.label),M=be(s.command),P=be(s.installUrl);return p===null||S===null||M===null||P===null?null:{id:p,label:S,command:M,available:s.available===!0,version:be(s.version),installUrl:P,missingMessage:be(s.missingMessage),capabilities:p_(s.capabilities),environmentNotice:Ue(s.environmentNotice,a_),statusLine:h_(s.statusLine)}}const __=["custom","ai","first-message","none"],m_=["native","vault"],g_=["idle","scanning","ready"],v_=["agent","shell"],y_=["busy","idle","waiting","offline","unknown"],S_=["server-closed"];function C_(n){const s=je(n);if(s===null)return null;const p=ve(s.sessionId),S=be(s.title),M=Ue(s.titleSource,__),P=Be(s.updatedAt),N=Be(s.sizeBytes);if(p===null||S===null||M===null||P===null||N===null)return null;const i=s.agent===void 0?"claude-code":Ue(s.agent,xo);if(i===null)return null;const c=be(s.cwd)??"";return{agent:i,sessionId:p,cwd:c,title:S,titleSource:M,updatedAt:P,sizeBytes:N,archived:s.archived===!0,storage:Ue(s.storage,m_)??"native",partial:s.partial===!0}}function w_(n){const s=je(n);if(s===null)return null;const p=be(s.cwd),S=pt(s.cwdExists),M=yr(s.sessions,C_),P=Be(s.lastActivityAt);if(p===null||S===null||M===null||P===null)return null;const N=ve(s.key);if(N!==null)return{key:N,fallbackName:be(s.fallbackName)??"",cwd:p,cwdExists:S,sessions:M,lastActivityAt:P};const i=ve(s.slug);return i===null?null:{key:i,fallbackName:p.length===0?i:"",cwd:p,cwdExists:S,sessions:M,lastActivityAt:P}}function x_(n){const s=je(n);if(s===null)return null;const p=Ue(s.state,g_),S=Be(s.scannedFiles),M=Be(s.totalFiles);return p===null||S===null||M===null?null:{state:p,scannedFiles:S,totalFiles:M}}function xh(n){const s=je(n);if(s===null)return null;const p=ve(s.terminalId),S=Ue(s.kind,v_)??"agent";let M=null;if(S==="agent"&&(M=s.agent===void 0?"claude-code":Ue(s.agent,cn),M===null))return null;const P=be(s.cwd),N=be(s.sessionId),i=be(s.label),c=pt(s.resumed),m=Be(s.createdAt),g=pt(s.alive);if(p===null||P===null||N===null||i===null||c===null||m===null||g===null)return null;const l=s.exitCode;return{terminalId:p,kind:S,agent:M,cwd:P,sessionId:N,label:i,resumed:c,createdAt:m,alive:g,exitCode:typeof l=="number"?l:null,sleeping:s.sleeping===!0}}const Ld=["user","assistant"],b_=["content","attachment"],k_=["compacted","interrupted","error"];function Rd(n){switch(n.notice){case"compacted":return n.detail==="auto"?"Contexto compactado automáticamente":"Contexto compactado";case"interrupted":return"Interrumpido";case"error":return n.detail.length>0?`La CLI devolvió un error: ${n.detail}`:"La CLI devolvió un error"}}const E_=["cli-plans","project","scratch"],fa={lastRequestTokens:0,lastOutputTokens:0,lastModel:null,contextWindow:null,contextWindowEstimated:!1,totalInputTokens:0,totalOutputTokens:0,totalCacheReadTokens:0,assistantMessages:0},bh=["waiting","live","unavailable","no-transcript"];function L_(n){const s=je(n);if(s===null)return null;const p=Be(s.inputTokens),S=Be(s.outputTokens),M=Be(s.cacheCreationInputTokens),P=Be(s.cacheReadInputTokens);return p===null||S===null||M===null||P===null?null:{inputTokens:p,outputTokens:S,cacheCreationInputTokens:M,cacheReadInputTokens:P}}function R_(n){const s=je(n);if(s===null)return null;const p=ve(s.label);return p===null?null:{label:p,description:be(s.description)??""}}function M_(n){const s=je(n);if(s===null)return null;const p=ve(s.question),S=vt(s.options,R_);return p===null||S===null||S.length===0?null:{question:p,header:be(s.header)??"",multiSelect:s.multiSelect===!0,options:S}}function Md(n){const s=je(n);if(s===null)return null;switch(s.kind){case"text":{const p=be(s.text),S=pt(s.truncated);return p===null||S===null?null:{kind:"text",text:p,truncated:S}}case"tool-call":{const p=be(s.toolUseId),S=be(s.name),M=be(s.input),P=pt(s.truncated);return p===null||S===null||M===null||P===null?null:{kind:"tool-call",toolUseId:p,name:S,input:M,truncated:P}}case"tool-result":{const p=be(s.toolUseId),S=be(s.text),M=pt(s.isError),P=pt(s.truncated),N=Be(s.imageCount);return p===null||S===null||M===null||P===null||N===null?null:{kind:"tool-result",toolUseId:p,text:S,isError:M,truncated:P,imageCount:N}}case"thinking":return{kind:"thinking"};case"question":{const p=ve(s.toolUseId),S=vt(s.questions,M_);return p===null||S===null||S.length===0?null:{kind:"question",toolUseId:p,questions:S}}case"image":{const p=Be(s.index),S=be(s.mediaType);if(p===null||S===null)return null;const M=s.source==="attachment"?"attachment":"content";return{kind:"image",index:p,mediaType:S,source:M}}case"notice":{const p=Ue(s.notice,k_);return p===null?null:{kind:"notice",notice:p,detail:be(s.detail)??""}}default:return null}}function pa(n){const s=je(n);if(s===null)return null;const p=ve(s.eventId),S=Ue(s.role,Ld),M=Be(s.at),P=vt(s.parts,Md);return p===null||S===null||M===null||P===null?null:{eventId:p,role:S,at:M,parts:P,model:be(s.model),usage:L_(s.usage),effort:be(s.effort),durationMs:Be(s.durationMs),queued:s.queued===!0}}function kh(n){const s=je(n);if(s===null)return null;const p=Be(s.lastRequestTokens),S=Be(s.lastOutputTokens),M=Be(s.totalInputTokens),P=Be(s.totalOutputTokens),N=Be(s.totalCacheReadTokens),i=Be(s.assistantMessages);if(p===null||S===null||M===null||P===null||N===null||i===null)return null;const c=be(s.lastEffort);return{lastRequestTokens:p,lastOutputTokens:S,lastModel:be(s.lastModel),contextWindow:Be(s.contextWindow),contextWindowEstimated:s.contextWindowEstimated===!0,totalInputTokens:M,totalOutputTokens:P,totalCacheReadTokens:N,assistantMessages:i,...c!==null?{lastEffort:c}:{}}}function A_(n){const s=je(n);if(s===null)return null;const p=ve(s.fileName),S=ve(s.title),M=Be(s.modifiedAt),P=Be(s.sizeBytes);if(p===null||S===null||M===null||P===null)return null;const N=s.origin,i=E_.find(m=>m===N)??"cli-plans",c=be(s.path)??"";return{fileName:p,title:S,origin:i,path:c,exists:s.exists===!0,modifiedAt:M,sizeBytes:P}}function T_(n){const s=je(n);if(s===null)return null;const p=ve(s.fileName),S=be(s.text);return p===null||S===null?null:{fileName:p,text:S,truncated:s.truncated===!0}}const Ad=[{value:"default",label:"Por defecto",family:"",long:!1,window:null},{value:"opus",label:"Opus",family:"opus",long:!1,window:2e5},{value:"opus[1m]",label:"Opus",family:"opus",long:!0,window:1e6},{value:"sonnet",label:"Sonnet",family:"sonnet",long:!1,window:2e5},{value:"sonnet[1m]",label:"Sonnet",family:"sonnet",long:!0,window:1e6},{value:"haiku",label:"Haiku",family:"haiku",long:!1,window:2e5},{value:"fable",label:"Fable",family:"fable",long:!1,window:2e5},{value:"fable[1m]",label:"Fable",family:"fable",long:!0,window:1e6}];function D_(n){if(n.window===null)return n.label;const s=n.window>=1e6?`${Math.round(n.window/1e6)}M`:`${Math.round(n.window/1e3)}k`;return`${n.label} · ${s}`}function I_(n,s=Ad){const p=N_(n,s);if(p===null||n===null)return null;const S=n.includes("[1m]");return s.find(M=>M.family===p&&M.long===S)??null}function N_(n,s=Ad){var S;return n===null||n.length===0?null:((S=s.filter(M=>M.family.length>0).sort((M,P)=>P.family.length-M.family.length).find(M=>n.includes(M.family)))==null?void 0:S.family)??null}function P_(n){return`/model ${n}`}function j_(n){return`/effort ${n}`}const O_=["staged","unstaged","untracked","conflict"],B_=["added","modified","deleted","renamed","copied","type-changed","untracked","conflict"],F_=["ready","not-a-repo","git-missing","error"],_a={state:"not-a-repo",message:null,repoRoot:"",branch:null,head:null,upstream:null,ahead:0,behind:0,changes:[],worktrees:[],truncated:!1,updatedAt:0},$_=["meta","hunk","context","added","removed"];function H_(n){const s=je(n);if(s===null)return null;const p=ve(s.path),S=Ue(s.kind,B_),M=Ue(s.stage,O_);return p===null||S===null||M===null?null:{path:p,kind:S,stage:M,oldPath:be(s.oldPath)}}function W_(n){const s=je(n);if(s===null)return null;const p=ve(s.path);return p===null?null:{path:p,branch:be(s.branch),isCurrent:s.isCurrent===!0}}function U_(n){const s=je(n);if(s===null)return null;const p=Ue(s.state,F_),S=be(s.repoRoot),M=Be(s.ahead),P=Be(s.behind),N=vt(s.changes,H_),i=vt(s.worktrees,W_),c=Be(s.updatedAt);return p===null||S===null||M===null||P===null||N===null||i===null||c===null?null:{state:p,message:be(s.message),repoRoot:S,branch:be(s.branch),head:be(s.head),upstream:be(s.upstream),ahead:M,behind:P,changes:N,worktrees:i,truncated:s.truncated===!0,updatedAt:c}}function z_(n){const s=je(n);if(s===null)return null;const p=Ue(s.kind,$_),S=be(s.text);return p===null||S===null?null:{kind:p,text:S,oldLine:Be(s.oldLine),newLine:Be(s.newLine)}}function q_(n){const s=je(n);if(s===null)return null;const p=ve(s.path),S=pt(s.staged),M=vt(s.lines,z_);return p===null||S===null||M===null?null:{path:p,staged:S,lines:M,truncated:s.truncated===!0,binary:s.binary===!0,message:be(s.message)}}const V_=["dir","file"],K_=["ignored","always"];function Td(n){const s=je(n);if(s===null)return null;const p=ve(s.name),S=ve(s.path),M=Ue(s.kind,V_),P=Be(s.sizeBytes),N=Be(s.modifiedAt);if(p===null||S===null||M===null||P===null||N===null)return null;const i=Ue(s.hidden,K_),c={name:p,path:S,kind:M,sizeBytes:P,modifiedAt:N};return i===null?c:{...c,hidden:i}}function G_(n){const s=je(n);if(s===null)return null;const p=be(s.query),S=vt(s.entries,Td);return p===null||S===null?null:{query:p,entries:S,truncated:s.truncated===!0}}function X_(n){const s=je(n);if(s===null)return null;const p=be(s.path),S=vt(s.entries,Td),M=Be(s.hiddenCount);return p===null||S===null||M===null?null:{path:p,entries:S,truncated:s.truncated===!0,hiddenCount:M}}function Y_(n){const s=je(n);if(s===null)return null;const p=ve(s.path),S=be(s.text),M=Be(s.sizeBytes),P=pt(s.binary);return p===null||S===null||M===null||P===null?null:{path:p,language:be(s.language),text:S,sizeBytes:M,truncated:s.truncated===!0,binary:P}}function Q_(n){const s=je(n);if(s===null)return null;const p=ve(s.pickerId),S=ve(s.path),M=vt(s.entries,N=>ve(N)),P=vt(s.roots,N=>ve(N));return p===null||S===null||M===null||P===null?null:{pickerId:p,path:S,entries:M,roots:P,canGoUp:s.canGoUp===!0,truncated:s.truncated===!0}}const So="MEMORY.md",Ua=["AGENTS.md","CLAUDE.md"],Dd=["claude-code","codex","antigravity","opencode"],J_=["outside","encoding"],Z_=["create","append-block","replace-block","append-lines","copy"];function em(n){return{instructionFiles:[...Ua],gitMode:n!==null&&n.git.kind==="error"?"version":"ignore",importNative:n!==null&&n.native.pending>0,copyFromMainWorktree:n!==null&&n.git.kind==="repo"&&n.git.worktree!==null&&n.git.worktree.mainHasMemory}}function tm(n){const s=je(n);if(s===null)return null;const p=Ue(s.name,Ua),S=pt(s.exists),M=pt(s.hasBlock),P=pt(s.blockCurrent),N=pt(s.brokenBlock),i=s.problem,c=i===null?null:Ue(i,J_);return p===null||S===null||M===null||P===null||N===null||i!==null&&c===null?null:{name:p,exists:S,hasBlock:M,blockCurrent:P,brokenBlock:N,problem:c}}function rm(n){const s=je(n);if(s===null)return null;switch(s.kind){case"not-repo":return{kind:"not-repo"};case"error":{const p=be(s.message);return p===null?null:{kind:"error",message:p}}case"repo":{const p=pt(s.ignored);if(p===null)return null;if(s.worktree===null)return{kind:"repo",ignored:p,worktree:null};const S=je(s.worktree);if(S===null)return null;const M=ve(S.mainPath),P=pt(S.mainHasMemory);return M===null||P===null?null:{kind:"repo",ignored:p,worktree:{mainPath:M,mainHasMemory:P}}}default:return null}}function sm(n){const s=je(n);if(s===null)return null;const p=Ue(s.agent,Dd),S=ve(s.label),M=pt(s.reaches),P=be(s.via);return p===null||S===null||M===null||P===null?null:{agent:p,label:S,reaches:M,via:P}}function nm(n){const s=je(n);if(s===null)return null;const p=ve(s.name),S=be(s.title),M=be(s.description),P=Be(s.sizeBytes),N=Be(s.modifiedAt);return p===null||S===null||M===null||P===null||N===null?null:{name:p,title:S,description:M,sizeBytes:P,modifiedAt:N}}const im=["line","command","json"];function om(n){const s=je(n);if(s===null)return null;const p=Ue(s.agent,Dd),S=ve(s.label),M=ve(s.target),P=Ue(s.kind,im),N=ve(s.text),i=be(s.note);return p===null||S===null||M===null||P===null||N===null||i===null?null:{agent:p,label:S,target:M,kind:P,text:N,note:i}}function lm(n){const s=je(n);if(s===null)return null;const p=ve(s.cwd),S=pt(s.folderExists),M=pt(s.indexExists),P=pt(s.installed),N=vt(s.notes,nm),i=vt(s.files,tm),c=rm(s.git),m=vt(s.reach,sm),g=je(s.native),l=g===null?null:Be(g.available),v=g===null?null:Be(g.pending),C=vt(s.globalFragments,om);return p===null||S===null||M===null||P===null||N===null||i===null||c===null||m===null||l===null||v===null||C===null?null:{cwd:p,folderExists:S,indexExists:M,installed:P,notes:N,files:i,git:c,reach:m,native:{available:l,pending:v},globalFragments:C}}function Eh(n){const s=je(n);if(s===null)return null;const p=ve(s.file),S=Ue(s.action,Z_),M=be(s.preview);return p===null||S===null||M===null?null:{file:p,action:S,preview:M}}function am(n){const s=je(n);if(s===null)return null;const p=ve(s.name),S=be(s.text),M=pt(s.truncated);return p===null||S===null||M===null?null:{name:p,text:S,truncated:M}}const Lh=20;function cm(n,s="Nota"){const p=n.text.split(`
41
- `).map(S=>S.trim()).find(S=>S.length>0);return p===void 0?n.images.length>0?"Imagen":s:p.length>40?`${p.slice(0,40)}…`:p}function um(n){const s=je(n);if(s===null)return null;const p=ve(s.imageId),S=ve(s.mediaType),M=Be(s.bytes);return p===null||S===null||M===null?null:{imageId:p,mediaType:S,bytes:M}}function hm(n){const s=je(n);if(s===null)return null;const p=ve(s.noteId),S=be(s.text),M=vt(s.images,um),P=Be(s.createdAt),N=Be(s.updatedAt);return p===null||S===null||M===null?null:{noteId:p,text:S,images:M,createdAt:P??0,updatedAt:N??0}}const Id=3,dm=3e4,fm=["results","time"];function un(n){return typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}function Jn(n,s){if(n==null)return null;const p=s(n);return p===null?void 0:p}function Nd(n){const s=je(n);if(s===null)return null;const p=Ue(s.agent,xo),S=ve(s.sessionId),M=Jn(s.cwd,be),P=be(s.title),N=Jn(s.eventId,ve),i=Jn(s.role,v=>Ue(v,Ld)),c=Jn(s.at,Be),m=be(s.snippet),g=un(s.matchStart),l=un(s.matchLength);return p===null||S===null||M===void 0||P===null||N===void 0||i===void 0||c===void 0||m===null||g===null||l===null||g+l>m.length?null:{agent:p,sessionId:S,cwd:M,title:P,eventId:N,role:i,at:c,snippet:m,matchStart:g,matchLength:l}}function pm(n){const s=je(n);if(s===null)return null;const p=be(s.query),S=yr(s.hits,Nd),M=un(s.sessionsScanned),P=un(s.sessionsTotal),N=Jn(s.truncated,i=>Ue(i,fm));return p===null||S===null||M===null||P===null||M>P||N===void 0?null:{query:p,hits:S,sessionsScanned:M,sessionsTotal:P,truncated:N}}function _m(n){const s=je(n);if(s===null)return null;const p=be(s.query),S=yr(s.hits,Nd),M=un(s.sessionsScanned),P=un(s.sessionsTotal);return p===null||S===null||M===null||P===null||M>P?null:{query:p,hits:S,sessionsScanned:M,sessionsTotal:P}}const mm=["off","idle","measuring","writing","moving"];function Nt(n){return typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}function Yn(n,s){if(n==null)return null;const p=s(n);return p===null?void 0:p}function gm(n){const s=je(n);if(s===null)return null;const p=Ue(s.agent,xo),S=Nt(s.sessions),M=Nt(s.eventBytes),P=Nt(s.images),N=Nt(s.imageBytes),i=Nt(s.skippedArchived),c=Nt(s.skippedEmpty),m=Nt(s.unsupported),g=Nt(s.failed),l=vo(s.failureReasons);return p===null||S===null||M===null||P===null||N===null||i===null||c===null||m===null||g===null||l===null?null:{agent:p,sessions:S,eventBytes:M,images:P,imageBytes:N,skippedArchived:i,skippedEmpty:c,unsupported:m,failed:g,failureReasons:l}}function vm(n){const s=je(n);if(s===null)return null;const p=Be(s.measuredAt),S=Be(s.durationMs),M=yr(s.byAgent,gm),P=Nt(s.memoryProjects),N=Nt(s.memoryBytes);return p===null||S===null||M===null||P===null||N===null?null:{measuredAt:p,durationMs:S,byAgent:M,memoryProjects:P,memoryBytes:N}}function ym(n){const s=je(n);if(s===null)return null;const p=Nt(s.done),S=Nt(s.total);return p===null||S===null?null:{done:p,total:S}}function Sm(n){const s=je(n);if(s===null)return null;const p=pt(s.enabled),S=be(s.dir),M=pt(s.isDefaultDir),P=Ue(s.state,mm),N=Nt(s.sessions),i=Nt(s.passSessions),c=Nt(s.bytes),m=Nt(s.pending),g=Yn(s.progress,ym),l=Yn(s.lastPassAt,Be),v=Yn(s.measurement,vm),C=Yn(s.previousDir,be),b=Yn(s.lastError,be);return p===null||S===null||M===null||P===null||N===null||i===null||c===null||m===null||g===void 0||l===void 0||v===void 0||C===void 0||b===void 0?null:{enabled:p,dir:S,isDefaultDir:M,state:P,progress:g,sessions:N,passSessions:i,bytes:c,lastPassAt:l,pending:m,measurement:v,previousDir:C,lastError:b}}const Co=7,Cm="/ws",Na="token",wo=12*1024*1024,ma=8,wm=["sending","prefilled"],xm=["no-delivery","not-ready","send-failed"],bm=["cli-not-found","shell-not-found","spawn-failed","bad-message","unknown-terminal","terminal-asleep","invalid-cwd","too-many-terminals","invalid-path","read-failed","submit-failed","answer-failed","mode-failed","archive-failed","notes-failed","picker-failed","memory-failed","vault-failed","continue-failed","search-failed","agent-unsupported","internal"];function km(n){const s={model:null,effort:null,contextWindow:null};if(typeof n!="object"||n===null)return s;const p=n;return{model:ve(p.model),effort:ve(p.effort),contextWindow:Be(p.contextWindow)}}function Rh(n){return typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}function ho(n,s){const p=ve(s.requestId);return p!==null&&(n.requestId=p),n}function Em(n){const s=je(e_(n));if(s===null)return null;switch(s.type){case"hello":{const p=Be(s.protocolVersion),S=be(s.platform),M=be(s.defaultCwd);return p===null||S===null||M===null?null:{type:"hello",protocolVersion:p,agents:yr(s.agents,wh)??[],defaultAgent:Ue(s.defaultAgent,cn),platform:S,defaultCwd:M,shellName:ve(s.shellName)}}case"agents":{const p=yr(s.agents,wh);return p===null?null:{type:"agents",agents:p,defaultAgent:Ue(s.defaultAgent,cn)}}case"terminal.list":{const p=yr(s.terminals,xh),S=vo(s.order);return p===null||S===null?null:{type:"terminal.list",terminals:p,order:S}}case"terminal.opened":{const p=ve(s.requestId),S=xh(s.terminal);return p===null||S===null?null:{type:"terminal.opened",requestId:p,terminal:S}}case"terminal.output":{const p=ve(s.terminalId),S=be(s.data);return p===null||S===null?null:{type:"terminal.output",terminalId:p,data:S}}case"terminal.replay":{const p=ve(s.terminalId),S=be(s.data);return p===null||S===null?null:{type:"terminal.replay",terminalId:p,data:S,truncated:s.truncated===!0}}case"terminal.exit":{const p=ve(s.terminalId),S=Be(s.exitCode);if(p===null||S===null)return null;const M=s.signal;return{type:"terminal.exit",terminalId:p,exitCode:S,signal:typeof M=="number"?M:null}}case"terminal.closed":{const p=ve(s.terminalId);return p===null?null:{type:"terminal.closed",terminalId:p}}case"terminal.activity":{const p=ve(s.terminalId),S=Ue(s.activity,y_);if(p===null||S===null)return null;const M=S==="offline"?Ue(s.offlineReason,S_):null;return M===null?{type:"terminal.activity",terminalId:p,activity:S}:{type:"terminal.activity",terminalId:p,activity:S,offlineReason:M}}case"index.status":{const p=x_(s.status);return p===null?null:{type:"index.status",status:p}}case"index.projects":{const p=yr(s.projects,w_);return p===null?null:{type:"index.projects",projects:p,replace:s.replace===!0}}case"conversation.reset":{const p=ve(s.terminalId),S=be(s.sessionId),M=Ue(s.state,bh),P=yr(s.events,pa),N=kh(s.usage);return p===null||S===null||M===null||P===null||N===null?null:{type:"conversation.reset",terminalId:p,sessionId:S,state:M,events:P,hasMore:s.hasMore===!0,usage:N,permissionMode:on(s.permissionMode)?s.permissionMode:null,defaults:km(s.defaults),waitingFor:ve(s.waitingFor),openToolCall:s.openToolCall===!0}}case"conversation.append":{const p=ve(s.terminalId),S=yr(s.events,pa),M=kh(s.usage);return p===null||S===null||M===null?null:{type:"conversation.append",terminalId:p,events:S,usage:M,permissionMode:on(s.permissionMode)?s.permissionMode:null}}case"conversation.mode":{const p=ve(s.terminalId),S=s.mode;return p===null||!on(S)?null:{type:"conversation.mode",terminalId:p,mode:S}}case"conversation.waiting":{const p=ve(s.terminalId);return p===null?null:{type:"conversation.waiting",terminalId:p,waitingFor:ve(s.waitingFor)}}case"conversation.toolCall":{const p=ve(s.terminalId),S=pt(s.open);return p===null||S===null?null:{type:"conversation.toolCall",terminalId:p,open:S}}case"conversation.page":{const p=ve(s.terminalId),S=yr(s.events,pa);return p===null||S===null?null:{type:"conversation.page",terminalId:p,events:S,hasMore:s.hasMore===!0}}case"conversation.turns":{const p=ve(s.terminalId),S=vt(s.turns,M=>{const P=je(M);if(P===null)return null;const N=ve(P.eventId),i=Be(P.durationMs);return N===null||i===null?null:{eventId:N,durationMs:i}});return p===null||S===null?null:{type:"conversation.turns",terminalId:p,turns:S}}case"conversation.parts":{const p=ve(s.terminalId),S=vt(s.updates,M=>{const P=je(M);if(P===null)return null;const N=ve(P.eventId),i=vt(P.parts,Md);return N===null||i===null?null:{eventId:N,parts:i}});return p===null||S===null?null:{type:"conversation.parts",terminalId:p,updates:S}}case"conversation.imageData":{const p=ve(s.terminalId),S=ve(s.eventId),M=Be(s.index),P=be(s.mediaType);if(p===null||S===null||M===null||P===null)return null;const N=s.data;return{type:"conversation.imageData",terminalId:p,eventId:S,index:M,source:Ue(s.source,b_)??"content",mediaType:P,data:typeof N=="string"?N:null}}case"conversation.state":{const p=ve(s.terminalId),S=Ue(s.state,bh);return p===null||S===null?null:{type:"conversation.state",terminalId:p,state:S}}case"git.status":{const p=ve(s.terminalId),S=U_(s.status);return p===null||S===null?null:{type:"git.status",terminalId:p,status:S}}case"git.diff":{const p=ve(s.terminalId),S=q_(s.diff);return p===null||S===null?null:{type:"git.diff",terminalId:p,diff:S}}case"files.listing":{const p=ve(s.terminalId),S=X_(s.listing);return p===null||S===null?null:{type:"files.listing",terminalId:p,listing:S}}case"picker.listing":{const p=Q_(s.listing);return p===null?null:{type:"picker.listing",listing:p}}case"files.preview":{const p=ve(s.terminalId),S=Y_(s.preview);return p===null||S===null?null:{type:"files.preview",terminalId:p,preview:S}}case"conversation.plans":{const p=ve(s.terminalId),S=vt(s.plans,A_);return p===null||S===null?null:{type:"conversation.plans",terminalId:p,plans:S}}case"plans.content":{const p=ve(s.terminalId),S=T_(s.plan);return p===null||S===null?null:{type:"plans.content",terminalId:p,plan:S}}case"files.results":{const p=ve(s.terminalId),S=G_(s.result);return p===null||S===null?null:{type:"files.results",terminalId:p,result:S}}case"notes.list":{const p=vt(s.notes,hm);return p===null?null:{type:"notes.list",notes:p}}case"notes.imageData":{const p=ve(s.imageId),S=be(s.mediaType);if(p===null||S===null)return null;const M=s.data;return{type:"notes.imageData",imageId:p,mediaType:S,data:typeof M=="string"?M:null}}case"memory.status":{const p=ve(s.terminalId),S=lm(s.status);return p===null||S===null?null:{type:"memory.status",terminalId:p,status:S}}case"memory.planned":{const p=ve(s.terminalId),S=vt(s.changes,Eh);return p===null||S===null?null:ho({type:"memory.planned",terminalId:p,changes:S},s)}case"memory.installed":{const p=ve(s.terminalId),S=vt(s.applied,Eh);return p===null||S===null?null:ho({type:"memory.installed",terminalId:p,applied:S},s)}case"memory.imported":{const p=ve(s.terminalId),S=vo(s.copied),M=vo(s.skipped);return p===null||S===null||M===null?null:ho({type:"memory.imported",terminalId:p,copied:S,skipped:M},s)}case"memory.content":{const p=ve(s.terminalId),S=am(s.note);return p===null||S===null?null:ho({type:"memory.content",terminalId:p,note:S},s)}case"vault.status":{const p=Sm(s.status);return p===null?null:{type:"vault.status",status:p}}case"vault.exported":{const p=ve(s.projectKey),S=Be(s.sessions);return p===null||S===null?null:{type:"vault.exported",projectKey:p,sessions:S}}case"session.continued":{const p=ve(s.requestId),S=ve(s.terminalId),M=je(s.source),P=Ue(M==null?void 0:M.agent,xo),N=ve(M==null?void 0:M.sessionId),i=be(M==null?void 0:M.title),c=Rh(s.includedTurns),m=Rh(s.totalTurns),g=Ue(s.delivery,wm);return p===null||S===null||P===null||N===null||i===null||c===null||m===null||c>m||g===null?null:{type:"session.continued",requestId:p,terminalId:S,source:{agent:P,sessionId:N,title:i},includedTurns:c,totalTurns:m,totalTurnsIsMinimum:s.totalTurnsIsMinimum===!0,delivery:g}}case"composer.prefill":{const p=ve(s.terminalId),S=ve(s.text),M=Ue(s.reason,xm);return p===null||S===null||M===null?null:{type:"composer.prefill",terminalId:p,text:S,reason:M}}case"search.progress":{const p=ve(s.searchId),S=_m(s.progress);return p===null||S===null?null:{type:"search.progress",searchId:p,progress:S}}case"search.results":{const p=ve(s.searchId),S=pm(s.result);return p===null||S===null?null:{type:"search.results",searchId:p,result:S}}case"error":{const p=be(s.message);if(p===null)return null;const M={type:"error",code:Ue(s.code,bm)??"internal",message:p},P=be(s.detail);P!==null&&(M.detail=P);const N=ve(s.requestId);return N!==null&&(M.requestId=N),M}default:return null}}function Mh(n){return JSON.stringify(n)}const Lm=/^[A-Za-z]:\\$/;function hn(n,s){return n.length===0?"":s==="win32"?Rm(n):Mm(n)}function Rm(n){let s=n.replace(/\//g,"\\");for(s.startsWith("\\\\?\\UNC\\")?s=`\\\\${s.slice(8)}`:s.startsWith("\\\\?\\")&&(s=s.slice(4)),s=s.startsWith("\\\\")?`\\\\${s.slice(2).replace(/\\+/g,"\\")}`:s.replace(/\\+/g,"\\");s.endsWith("\\")&&!Lm.test(s);)s=s.slice(0,-1);return s.toLowerCase()}function Pd(n,s,p){return n.length===0||p==="win32"&&n!==s&&n.toLowerCase()===s.toLowerCase()?s:n}function Mm(n){let s=n.replace(/\/+/g,"/");for(;s.length>1&&s.endsWith("/");)s=s.slice(0,-1);return s}function Am(n,s,p,S){const M=hn(p.cwd,S);let P=-1;for(const[N,i]of n.entries()){const c=s(i);c===void 0||c.kind!=="agent"||hn(c.cwd,S)===M&&(P=N)}return P===-1?n.length:P+1}const Tm=[{keys:"Esc",description:"Interrumpir el turno en curso"},{keys:"Esc Esc",description:"Editar un mensaje anterior"},{keys:"Ctrl + C",description:"Interrumpir, o salir si no hay turno"},{keys:"Alt + , / Alt + .",description:"Bajar / subir el esfuerzo"},{keys:"Shift + Tab",description:"Cambiar entre el modo por defecto y Plan (con el foco en la terminal)"},{keys:"Tab",description:"Encolar el mensaje mientras el agente trabaja"},{keys:"Ctrl + T",description:"Ver la transcripción"},{keys:"Ctrl + R",description:"Buscar en el historial de mensajes"},{keys:"@",description:"Mencionar un archivo, una skill o un plugin"},{keys:"/",description:"Comandos"},{keys:"Ctrl + G",description:"Editar el mensaje en el editor externo"}],Dm=[{keys:"Esc Esc",description:"Interrumpir (el primer toque sólo avisa)"},{keys:"Tab / Shift + Tab",description:"Cambiar de agente, build o plan (con el foco en la terminal)"},{keys:"Ctrl + P",description:"Lista de comandos, con las variantes del modelo"},{keys:"Ctrl + X y M",description:"Elegir modelo"},{keys:"Ctrl + X y N",description:"Sesión nueva: la pestaña sigue atada a la sesión con la que se abrió"},{keys:"Ctrl + J",description:"Salto de línea"},{keys:"Ctrl + C",description:"Limpiar la entrada; dos veces, salir"},{keys:"Ctrl + V",description:"Pegar"}],Im=[{keys:"Esc",description:"Interrumpir el turno en curso, o cancelar un pedido de permiso"},{keys:"Shift + Tab",description:"Cambiar el modo: accept-edits, plan y por defecto (con el foco en la terminal)"},{keys:"1 … 4",description:"Contestar un pedido de permiso: 1 lo permite, 4 lo rechaza"},{keys:"/",description:"Comandos"},{keys:"?",description:"Ver los atajos de la CLI"}],ln={"claude-code":{shortLabel:"CC",shortcuts:[{keys:"Esc",description:"Interrumpir lo que la CLI esté haciendo"},{keys:"Esc Esc",description:"Abrir el menú de rewind"},{keys:"Ctrl + C",description:"Cancelar"},{keys:"Ctrl + R",description:"Buscar en el historial de comandos"},{keys:"Ctrl + O",description:"Ver la salida completa"},{keys:"Shift + Tab",description:"Cambiar el modo de permisos (con el foco en la terminal)"},{keys:"Alt + V",description:"Pegar una imagen del portapapeles"},{keys:"Ctrl + V",description:"Pegar texto del portapapeles"}],shortcutsNote:null,instructionsFile:"CLAUDE.md",savesModelChoice:!1},codex:{shortLabel:"CX",shortcuts:Tm,shortcutsNote:"Alt + ← / → cambian de agente dentro de Codex, pero acá los usa la app para cambiar de pestaña.",instructionsFile:"AGENTS.md",savesModelChoice:!1},opencode:{shortLabel:"OC",shortcuts:Dm,shortcutsNote:"Ctrl + T cambia la variante del modelo dentro de OpenCode, pero el navegador se la queda: está en Ctrl + P.",instructionsFile:"AGENTS.md",savesModelChoice:!1},antigravity:{shortLabel:"AG",shortcuts:Im,shortcutsNote:null,instructionsFile:"AGENTS.md",savesModelChoice:!0}},Nm={"gemini-cli":"GC","antigravity-ide":"AI"};function Pm(n){return ei(n)?ln[n].shortLabel:Nm[n]}function ti(n,s){var p;return ei(n)?((p=s.find(S=>S.id===n))==null?void 0:p.label)??n:n_[n]}function Pa(n){return n.storage==="native"&&ei(n.agent)}function jm(n){return n!==null&&ln[n].savesModelChoice?", y la CLI lo guarda como predeterminado para las pestañas siguientes":""}function Om(n){return n===null?null:ln[n].instructionsFile}function Bm(n){return{modeCycle:n.permissionCycle,models:n.models,efforts:n.efforts,imagesAllowed:n.imagesByPath!==null,rewind:n.rewind,questionsAnswerable:n.questionCards,fileMentions:n.fileMentions!==null,plansAvailable:n.plans,contextWindowSource:n.contextWindowSource,noteSendable:n.readySignal}}function Fm(n,s){const p=I_(s,n);return p===null?null:n.find(S=>S.value===p.value)??null}function $m(n,s){return n??s.launchMode}function Hm(n,s){return`Modo ${bd[n]}: ${r_[n]}. Cambiarlo manda ${s.keyLabel} a la pestaña CLI`}function jd(n,s){return n.approvesPendingOnCycle&&s!==null}function Wm(n,s,p,S){if(jd(s,S))return"Hay una confirmación pendiente en la CLI: cambiar de modo ahora la aprobaría. Contestala en la solapa CLI.";const M=Hm(n,s);return!s.approvesPendingOnCycle||p?M:`${M}. Sin datos de la status line la app no sabe si hay una confirmación pendiente; cambiar el modo en ese momento la aprueba`}function Um(n){switch(n){case"active":return"Configurada";case"missing":return"No configurada";case"other-command":return"Tenés otra status line: pegar esta la reemplaza";case"disabled":return"Desactivada (enabled: false)";case"unreadable":return"No pude leer settings.json"}}const zm="La carpeta de la app tiene caracteres que la consola interpreta (como & % ! o comillas), y con ellos no hay una línea que la CLI pueda correr: en Windows la corre con cmd /c y ninguna comilla le llega. Con la carpeta de configuración en una ruta sin esos caracteres se resuelve.";function qm(n,s){return n.filter(p=>s||p.id!=="plans")}function Vm(n,s){return n==="plans"&&!s?"cli":n}function Km(n,s,p){const S=M=>M===null?void 0:s.find(P=>P.id===M);return S(n)??S(p)??s[0]??null}function Gm(n){return[{keys:"Enter",description:"Enviar el mensaje"},{keys:"Shift + Enter",description:"Salto de línea sin enviar"},{keys:"Ctrl + V",description:n?"Pegar texto o una imagen (queda como miniatura)":"Pegar texto"},{keys:"Esc",description:"Interrumpir lo que la CLI esté haciendo"}]}const Ah="Esta CLI no recibe imagenes desde el cuadro.";function Xm(n,s,p){return p??(n==="token-count"||n==="status-line"?s.contextWindow:null)}function Ym(n,s){return n==="status-line"?s.lastRequestTokens>0:s.assistantMessages>0}function Qm(n,s){return n===null&&s!==null&&s.state!=="active"}function Jm(n){return`Esta CLI publica sus tokens solo por su status line, y ${n==="other-command"?"tenés otra status line configurada":n==="disabled"?"la status line de la app está desactivada":n==="unreadable"?"no se pudo leer su settings.json":"todavía no está configurada"}. Configurar explica cómo.`}function Zm(n,s){return s.contextWindowEstimated?"limite deducido de los tokens medidos":n==="usage-with-catalog"&&s.contextWindow!==null?"limite del catalogo de modelos de la CLI":null}function eg(n,s=null){return s==="status-line"?"La status line todavia no publico tokens de esta conversacion. No arranca en cero: el numero aparece cuando la CLI la corre, con el primer mensaje o al retomar la sesion.":`La sesion todavia no midio ninguna respuesta. No arranca en cero: el prompt de sistema, las herramientas y el ${n??"archivo de instrucciones del proyecto"} ya ocupan contexto, y el numero real aparece con la primera respuesta.`}function tg(n,s=null){return n==="idle"?"Lista, sin nada en curso":n==="unknown"?s===null?"Esta CLI no publica su estado":s.state==="active"?"La status line todavía no publicó el estado de esta conversación":"Esta CLI publica su estado sólo con la status line configurada":"CLI abierta"}function Th(n,s){return n.length===0?!0:n.some(p=>p.id===s&&p.available&&p.capabilities.resume)}function rg(n,s,p){return n?p?"La nota esta vacia":`Mandar la nota al agente en una conversacion nueva de ${s??""}`:s===null?"Abri una pestana primero: la conversacion se abre en su proyecto":"La CLI de esta pestaña no avisa cuando esta lista, asi que la nota no se puede mandar"}function Od(n,s,p){const S=hn(s,p);let M=null;for(const P of n)P.kind!=="agent"||P.agent===null||hn(P.cwd,p)===S&&(M=P.agent);return M}function Bd(n,s){var S;const p=s.filter(M=>M.available);for(const M of n)if(M!==null&&p.some(P=>P.id===M))return M;return((S=p[0])==null?void 0:S.id)??null}function sg(n){let s=null;for(const p of n){const S=p.agent;ei(S)&&(s===null||p.updatedAt>s.updatedAt)&&(s={agent:S,updatedAt:p.updatedAt})}return(s==null?void 0:s.agent)??null}function ng(n,s,p,S,M){return Bd([Od(n,s,p),M],S)}function ig(n,s,p,S,M){return Bd([Od(n,s.cwd,p),sg(s.sessions),M],S)}function Fd(n){return n.filter(s=>s.available)}function og(n,s){const p=n.findIndex(S=>S.id===s);return p===-1?0:p}function lg(n,s,p){return p<=0?0:((n+s)%p+p)%p}function ag(n,s,p,S=4){const M=n.bottom+2,P=n.top-2-s.height,N=M+s.height+S<=p.height||P<S?Math.max(S,Math.min(M,p.height-s.height-S)):P;return{left:Math.max(S,Math.min(n.left,p.width-s.width-S)),top:N}}function cg(n,s,p){const S=n;return S===null||typeof S!="object"||typeof S.contains!="function"?!0:p!==null&&p.contains(n)?!1:S.contains(s)}function $d(n,s,p=!1){return s===null||p||!Wa(n)?[]:Fd(n).filter(S=>S.id!==s)}const ug="Continuar esta conversación con otra CLI";function hg(n,s,p){return s?"La sesión todavía no está en el historial: aparece con el primer mensaje.":n.length===0?"Esta pestaña todavía no tiene una conversación que continuar.":p?null:"Esta conversación todavía no tiene mensajes que continuar."}function dg(n,s,p,S){const M=S?`de más de ${p}`:`de ${p}`,P=s>=p&&!S?p===1?"del único turno":`de los ${p} turnos`:s===1?`del último turno ${M}`:`de los últimos ${s} ${M} turnos`;return`Continuación de ${n}: el agente arranca de un transcript ${P}, no del contexto que tenía. Los resultados de herramientas van recortados y las imágenes no viajan.`}const fg="Mandando la continuación…";function pg(n){switch(n){case"no-delivery":return"El mensaje quedó en el cuadro: revisalo y mandalo con Enter.";case"not-ready":return"La CLI no llegó a estar lista a tiempo: el mensaje quedó en el cuadro para que lo mandes.";case"send-failed":return"No se pudo mandar solo: el mensaje quedó en el cuadro para que lo mandes."}}function Dh(n,s){return n.trim().length===0?s:`${s}
42
-
43
- ${n}`}function _g(n,s){return n&&s!==null}function mg(n,s,p){if(!ei(n))return{badge:!0,unavailableTitle:null};const S=s.find(N=>N.id===n),M=s.some(N=>N.available),P=S!==void 0&&!S.available&&M;return{badge:p||P,unavailableTitle:P?`La CLI ${S.label} no está instalada.`:null}}function gg(n,s,p){return n!==null&&s===""&&!p.sessionIdAtLaunch}const vg="Esta conversación es de una versión de la CLI que no dejaba el transcript legible. Se puede reanudar desde la barra lateral, pero acá no hay nada que mostrar.",yg="La sesión aparece en el historial con el primer mensaje.";function Sg(n,s,p,S,M=null){return!S||!kd(n,M)||!s?null:`${p??"La CLI"} tiene una herramienta sin resultado: puede estar pidiendo una aprobación. Contestala en la solapa CLI.`}function Hd(n,s=!1){return n==="permission prompt"?"La CLI esta esperando que autorices una herramienta.":n==="question"&&s?"El agente te hizo una pregunta: respondela en el hilo.":"La CLI esta esperando una respuesta tuya."}function Cg(n){return n.relaunching?"relaunching":n.offlineReason==="server-closed"&&n.alive?"offer":null}function wg(n){return`El servidor de ${n??"la CLI"} se cerró y esta pestaña quedó sin conexión.`}const xg="Relanzar",bg="Relanzando…";function kg(n,s){const p=new Map,S=[];for(const[M,P]of n){const N=s.find(i=>i.terminalId===M);N===void 0||N.alive&&P==="exited"?S.push(M):p.set(M,N.alive?P:"exited")}return{phases:p,finished:S}}function Eg(n,s,p){var S;return!p||s===null||((S=n.permissionCycle)==null?void 0:S.approvesPendingOnCycle)!==!0&&!n.waitingBlocksSubmit?null:Hd(s,n.questionCards)}const Lg=2e4;function Rg(n){if(n.label.length>0)return n.label;const s=n.cwd.split(/[\\/]/).filter(p=>p.length>0);return s[s.length-1]??n.cwd}function Mg(n,s,p){const S=n.map(P=>({terminalId:P.terminalId,kind:P.kind,cwd:P.cwd})),M=[];for(const P of s){const N=Am(S.map(i=>i.terminalId),i=>S.find(c=>c.terminalId===i),{cwd:P.cwd},p);M.push({pending:P,index:N,label:Rg(P)}),S.splice(N,0,{terminalId:`pending:${P.requestId}`,kind:"agent",cwd:P.cwd})}return M}function Ih(n,s,p){const S=hn(s,p);return n.some(M=>hn(M.cwd,p)===S)}const Wd="Abriendo una pestaña en este proyecto…";function Ag({models:n,efforts:s,model:p,effort:S,modelProvisional:M=!1,effortProvisional:P=!1,choiceNote:N="",disabled:i,onCommand:c}){const m=n===null?null:Fm(n,p),g=m===null&&p!==null;return _.jsxs(_.Fragment,{children:[n!==null&&_.jsxs("select",{className:"agent-select",value:(m==null?void 0:m.value)??"",disabled:i,onChange:l=>{l.target.value.length>0&&c(P_(l.target.value))},title:p===null?"Modelo: todavia no hubo ninguna respuesta en esta sesion":M?`Modelo segun tu configuracion: ${p}. Todavia no hubo ninguna respuesta que lo confirme`:`Modelo en uso: ${p}. Cambiarlo manda /model a la pestaña CLI${N}`,children:[m===null&&_.jsx("option",{value:"",children:g?p??"":"modelo — sin datos"}),n.map(l=>_.jsx("option",{value:l.value,children:D_(l)},l.value))]}),s!==null&&_.jsxs("select",{className:"agent-select",value:S??"",disabled:i,onChange:l=>{l.target.value.length>0&&c(j_(l.target.value))},title:S===null?"Esfuerzo: sin datos. No todos los modelos tienen niveles — con haiku, /effort no deja rastro":P?`Esfuerzo segun tu configuracion: ${S}. Todavia no hubo ninguna respuesta que lo confirme`:`Esfuerzo en uso: ${S}. Cambiarlo manda /effort a la pestaña CLI${N}`,children:[S===null&&_.jsx("option",{value:"",children:"esfuerzo — sin datos"}),s.map(l=>_.jsx("option",{value:l.value,children:l.label},l.value))]})]})}function Tg({mode:n,cycle:s,disabled:p,waitingFor:S=null,statusKnown:M=!0,onChange:P}){const N=$m(n,s);return _.jsx("select",{className:"agent-select agent-select-mode",value:N,disabled:p||jd(s,S),onChange:i=>{on(i.target.value)&&P(i.target.value)},title:Wm(N,s,M,S),children:s.modes.map(i=>_.jsx("option",{value:i,children:bd[i]},i))})}var Ud=xd();function zd({src:n,caption:s,onClose:p}){return F.useEffect(()=>{const S=M=>{M.key==="Escape"&&(M.preventDefault(),M.stopPropagation(),p())};return window.addEventListener("keydown",S,!0),()=>window.removeEventListener("keydown",S,!0)},[p]),Ud.createPortal(_.jsxs("div",{className:"viewer",onClick:p,role:"presentation",children:[_.jsx("div",{className:"viewer-frame",onClick:S=>S.stopPropagation(),children:_.jsx("img",{className:"viewer-image",src:n,alt:s})}),_.jsxs("div",{className:"viewer-bar",children:[_.jsx("span",{className:"viewer-caption",children:s}),_.jsx("button",{className:"viewer-close",onClick:p,title:"Cerrar (Esc)",children:"×"})]})]}),document.body)}const Dg=5,Ig=1200;function Nh(){return crypto.randomUUID()}function Ng(n=!0){const[s,p]=F.useState([]),[S,M]=F.useState(null),P=F.useCallback(v=>{if(s.filter(b=>b.kind==="image").length>=ma){M(`Hasta ${ma} imagenes por mensaje.`);return}if(v.size>wo){M(`"${v.name||"la imagen"}" pesa ${Math.round(v.size/1024/1024)} MB; el maximo son ${wo/1024/1024} MB.`);return}const C=new FileReader;C.onload=()=>{const b=C.result;if(typeof b!="string")return;const f=b.indexOf(",");f!==-1&&p(o=>o.filter(u=>u.kind==="image").length>=ma?o:[...o,{id:Nh(),kind:"image",mediaType:v.type,base64:b.slice(f+1),dataUrl:b,bytes:v.size,name:v.name.length>0?v.name:"imagen pegada"}])},C.onerror=()=>M("No se pudo leer la imagen del portapapeles."),C.readAsDataURL(v)},[s]),N=F.useCallback(v=>{const C=Array.from(v).filter(b=>b.type.startsWith("image/"));if(C.length>0&&!n){M(Ah);return}for(const b of C)P(b)},[P,n]),i=F.useCallback(v=>{const C=Array.from(v.files).filter(o=>o.type.startsWith("image/"));if(C.length>0){if(!n)return M(Ah),!0;for(const o of C)P(o);return!0}const b=v.getData("text/plain");if(b.length===0)return!1;const f=b.split(`
44
- `).length;return f<Dg&&b.length<Ig?!1:(p(o=>[...o,{id:Nh(),kind:"text",text:b,lines:f}]),!0)},[P,n]),c=F.useCallback(v=>{p(C=>C.filter(b=>b.id!==v))},[]),m=F.useCallback(v=>{p(v),M(null)},[]),g=F.useCallback(()=>m([]),[m]),l=F.useCallback(()=>M(null),[]);return{items:s,problem:S,acceptPaste:i,acceptFiles:N,remove:c,replace:m,clear:g,dismissProblem:l}}function yo({min:n,max:s,value:p,measure:S,onChange:M,onCommit:P,onStart:N}){const i=F.useRef(!1),c=F.useRef(p),m=F.useCallback(v=>{i.current=!0,c.current=p,N==null||N(v),v.currentTarget.setPointerCapture(v.pointerId),v.preventDefault()},[N,p]),g=F.useCallback(v=>{if(!i.current)return;const C=Math.min(s,Math.max(n,S(v)));c.current=C,M(C)},[s,n,S,M]),l=F.useCallback(v=>{i.current&&(i.current=!1,v.currentTarget.releasePointerCapture(v.pointerId),P(c.current))},[P]);return{onPointerDown:m,onPointerMove:g,onPointerUp:l,onPointerCancel:l}}function vr(n,s,p){try{const S=window.localStorage.getItem(n);return S===null?s:p(S)??s}catch{return s}}function ir(n,s){try{window.localStorage.setItem(n,s)}catch{}}function Pg(n,s,p){const S=Number.parseInt(n,10);return Number.isFinite(S)&&S>=s&&S<=p?S:null}const Ph=90,jg=260,jh=720,Oh="agent-workbench.composer-height",Og=4e3;function Bg({connection:n,terminalId:s,alive:p,sleeping:S=!1,controls:M,leading:P,imagesAllowed:N=!0,blockedReason:i=null,prefills:c,onPrefillApplied:m,notice:g=null,onDismissNotice:l,onSubmitted:v}){const[C,b]=F.useState(""),[f,o]=F.useState(!1),u=Ng(N),a=F.useRef(null),[h,y]=F.useState(()=>vr(Oh,jg,K=>Pg(K,Ph,jh))),[L,k]=F.useState(!1),A=F.useCallback(()=>{const K=a.current;if(K===null)return;K.style.height="auto";const ee=L?h:Math.min(K.scrollHeight,h);K.style.height=`${ee}px`},[h,L]);F.useEffect(A,[C,A]);const x=F.useRef(0),E=F.useRef(0),T=yo({min:Ph,max:jh,value:h,measure:F.useCallback(K=>x.current-K.clientY-E.current,[]),onChange:y,onCommit:F.useCallback(K=>{k(!1),ir(Oh,String(K))},[]),onStart:F.useCallback(K=>{const ee=a.current,ne=ee==null?void 0:ee.getBoundingClientRect();x.current=(ne==null?void 0:ne.bottom)??K.clientY,E.current=((ne==null?void 0:ne.bottom)??K.clientY)-K.clientY-((ne==null?void 0:ne.height)??0),k(!0)},[])}),j=F.useRef(new Map),D=F.useRef(null),B=F.useRef(C);B.current=C;const z=F.useRef(u.items);z.current=u.items;const{replace:X}=u;F.useEffect(()=>{var ne;const K=D.current;if(K===s)return;D.current=s,K!==null&&j.current.set(K,{text:B.current,items:z.current});const ee=s===null?void 0:j.current.get(s);b((ee==null?void 0:ee.text)??""),X((ee==null?void 0:ee.items)??[]),s!==null&&((ne=a.current)==null||ne.focus())},[s,X]);const Z=F.useRef(new Set);F.useEffect(()=>{if(!(c===void 0||c.length===0)){for(const K of c)if(!Z.current.has(K.id)){if(Z.current.add(K.id),K.terminalId===D.current)b(ee=>Dh(ee,K.text));else{const ee=j.current.get(K.terminalId);j.current.set(K.terminalId,{text:Dh((ee==null?void 0:ee.text)??"",K.text),items:(ee==null?void 0:ee.items)??[]})}m==null||m(K.id)}}},[c,m]);const Y=F.useCallback(()=>{if(s===null||i!==null)return;const K=u.items.filter(Q=>Q.kind==="text").map(Q=>Q.text),ee=u.items.filter(Q=>Q.kind==="image").map(Q=>({mediaType:Q.mediaType,data:Q.base64})),ne=[...K,C].filter(Q=>Q.trim().length>0).join(`
45
-
46
- `);ne.length===0&&ee.length===0||(n.send({type:"agent.submit",terminalId:s,text:ne,images:ee}),b(""),u.clear(),v==null||v(s))},[n,s,C,u,i,v]),V=F.useCallback(()=>{s!==null&&n.send({type:"agent.interrupt",terminalId:s})},[n,s]),I=F.useCallback(K=>{if(K.key==="Enter"&&!K.shiftKey&&!K.altKey){K.preventDefault(),Y();return}K.key==="Escape"&&(K.preventDefault(),V())},[Y,V]),$=F.useCallback(K=>{K.clipboardData!==null&&u.acceptPaste(K.clipboardData)&&K.preventDefault()},[u]),O=s===null||!p,U=C.trim().length>0||u.items.length>0;return _.jsxs("div",{className:`composer${f?" composer-dragging":""}`,onDragOver:K=>{Array.from(K.dataTransfer.types).includes("Files")&&(K.preventDefault(),o(!0))},onDragLeave:()=>o(!1),onDrop:K=>{K.preventDefault(),o(!1),u.acceptFiles(K.dataTransfer.files)},children:[_.jsx("div",{className:"hdivider composer-divider",...T,title:"Arrastrar para cambiar el alto del cuadro"}),g!==null&&_.jsxs("div",{className:"handoff-notice",role:"status",children:[_.jsxs("span",{className:"handoff-notice-text",children:[g.text,g.status!==null&&_.jsx("span",{className:"handoff-notice-status",children:g.status})]}),l!==void 0&&_.jsx("button",{className:"icon-button",onClick:l,title:"Cerrar el aviso",children:"×"})]}),u.problem!==null&&_.jsxs("div",{className:"composer-problem",children:[_.jsx("span",{children:u.problem}),_.jsx("button",{className:"icon-button",onClick:u.dismissProblem,title:"Cerrar",children:"×"})]}),u.items.length>0&&_.jsx("div",{className:"composer-chips",children:u.items.map(K=>_.jsx(Fg,{item:K,onRemove:()=>u.remove(K.id)},K.id))}),_.jsx("textarea",{ref:a,className:"composer-input",value:C,rows:1,placeholder:O?S?"Esta pestaña todavía no tiene la CLI abierta.":"La sesion de esta pestana termino.":"Escribi tu mensaje.",disabled:O,onChange:K=>b(K.target.value),onKeyDown:I,onPaste:$,spellCheck:!1}),_.jsxs("div",{className:"composer-bar",children:[P,_.jsx("span",{className:"composer-spacer"}),M,_.jsx("button",{className:"composer-stop",onClick:V,disabled:O,title:"Interrumpir lo que la CLI este haciendo (Esc)",children:"Detener"}),_.jsx("button",{className:"composer-send",onClick:Y,disabled:O||!U||i!==null,title:i??"Enviar (Enter)",children:"Enviar"})]})]})}function Fg({item:n,onRemove:s}){const[p,S]=F.useState(!1);if(n.kind==="image"){const M=`${n.name} · ${$g(n.bytes)}`;return _.jsxs("figure",{className:"chip chip-image",title:M,children:[_.jsx("img",{src:n.dataUrl,alt:n.name,onClick:()=>S(!0)}),_.jsx("button",{className:"chip-remove",onClick:s,title:"Quitar",children:"×"}),p&&_.jsx(zd,{src:n.dataUrl,caption:M,onClose:()=>S(!1)})]})}return _.jsxs("div",{className:`chip chip-text${p?" chip-open":""}`,children:[_.jsxs("button",{className:"chip-toggle",onClick:()=>S(M=>!M),children:[_.jsx("span",{className:"chip-icon",children:"¶"}),"Texto pegado · ",n.lines," lineas",_.jsx("span",{className:"chip-chevron",children:p?"▾":"▸"})]}),_.jsx("button",{className:"chip-remove",onClick:s,title:"Quitar",children:"×"}),p&&_.jsx("pre",{className:"chip-preview",children:n.text.slice(0,Og)})]})}function $g(n){return n<1024?`${n} B`:n<1024*1024?`${Math.round(n/1024)} KB`:`${(n/1024/1024).toFixed(1)} MB`}var ga={exports:{}},Bh;function Hg(){return Bh||(Bh=1,(function(n,s){(function(p,S){n.exports=S()})(self,(()=>(()=>{var p={};return(()=>{var S=p;Object.defineProperty(S,"__esModule",{value:!0}),S.FitAddon=void 0,S.FitAddon=class{activate(M){this._terminal=M}dispose(){}fit(){const M=this.proposeDimensions();if(!M||!this._terminal||isNaN(M.cols)||isNaN(M.rows))return;const P=this._terminal._core;this._terminal.rows===M.rows&&this._terminal.cols===M.cols||(P._renderService.clear(),this._terminal.resize(M.cols,M.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const M=this._terminal._core,P=M._renderService.dimensions;if(P.css.cell.width===0||P.css.cell.height===0)return;const N=this._terminal.options.scrollback===0?0:M.viewport.scrollBarWidth,i=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(i.getPropertyValue("height")),m=Math.max(0,parseInt(i.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),l=c-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),v=m-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-N;return{cols:Math.max(2,Math.floor(v/P.css.cell.width)),rows:Math.max(1,Math.floor(l/P.css.cell.height))}}}})(),p})()))})(ga)),ga.exports}var Wg=Hg(),va={exports:{}},Fh;function Ug(){return Fh||(Fh=1,(function(n,s){(function(p,S){n.exports=S()})(self,(()=>(()=>{var p={6:(N,i)=>{function c(g){try{const l=new URL(g),v=l.password&&l.username?`${l.protocol}//${l.username}:${l.password}@${l.host}`:l.username?`${l.protocol}//${l.username}@${l.host}`:`${l.protocol}//${l.host}`;return g.toLocaleLowerCase().startsWith(v.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(i,"__esModule",{value:!0}),i.LinkComputer=i.WebLinkProvider=void 0,i.WebLinkProvider=class{constructor(g,l,v,C={}){this._terminal=g,this._regex=l,this._handler=v,this._options=C}provideLinks(g,l){const v=m.computeLink(g,this._regex,this._terminal,this._handler);l(this._addCallbacks(v))}_addCallbacks(g){return g.map((l=>(l.leave=this._options.leave,l.hover=(v,C)=>{if(this._options.hover){const{range:b}=l;this._options.hover(v,C,b)}},l)))}};class m{static computeLink(l,v,C,b){const f=new RegExp(v.source,(v.flags||"")+"g"),[o,u]=m._getWindowedLineStrings(l-1,C),a=o.join("");let h;const y=[];for(;h=f.exec(a);){const L=h[0];if(!c(L))continue;const[k,A]=m._mapStrIdx(C,u,0,h.index),[x,E]=m._mapStrIdx(C,k,A,L.length);if(k===-1||A===-1||x===-1||E===-1)continue;const T={start:{x:A+1,y:k+1},end:{x:E,y:x+1}};y.push({range:T,text:L,activate:b})}return y}static _getWindowedLineStrings(l,v){let C,b=l,f=l,o=0,u="";const a=[];if(C=v.buffer.active.getLine(l)){const h=C.translateToString(!0);if(C.isWrapped&&h[0]!==" "){for(o=0;(C=v.buffer.active.getLine(--b))&&o<2048&&(u=C.translateToString(!0),o+=u.length,a.push(u),C.isWrapped&&u.indexOf(" ")===-1););a.reverse()}for(a.push(h),o=0;(C=v.buffer.active.getLine(++f))&&C.isWrapped&&o<2048&&(u=C.translateToString(!0),o+=u.length,a.push(u),u.indexOf(" ")===-1););}return[a,b]}static _mapStrIdx(l,v,C,b){const f=l.buffer.active,o=f.getNullCell();let u=C;for(;b;){const a=f.getLine(v);if(!a)return[-1,-1];for(let h=u;h<a.length;++h){a.getCell(h,o);const y=o.getChars();if(o.getWidth()&&(b-=y.length||1,h===a.length-1&&y==="")){const L=f.getLine(v+1);L&&L.isWrapped&&(L.getCell(0,o),o.getWidth()===2&&(b+=1))}if(b<0)return[v,h]}v++,u=0}return[v,u]}}i.LinkComputer=m}},S={};function M(N){var i=S[N];if(i!==void 0)return i.exports;var c=S[N]={exports:{}};return p[N](c,c.exports,M),c.exports}var P={};return(()=>{var N=P;Object.defineProperty(N,"__esModule",{value:!0}),N.WebLinksAddon=void 0;const i=M(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function m(g,l){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=l}else console.warn("Opening link blocked as opener could not be cleared")}N.WebLinksAddon=class{constructor(g=m,l={}){this._handler=g,this._options=l}activate(g){this._terminal=g;const l=this._options,v=l.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new i.WebLinkProvider(this._terminal,v,this._handler,l))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),P})()))})(va)),va.exports}var zg=Ug(),ya={exports:{}},$h;function qg(){return $h||($h=1,(function(n,s){(function(p,S){n.exports=S()})(self,(()=>(()=>{var p={965:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GlyphRenderer=void 0;const m=c(374),g=c(509),l=c(855),v=c(859),C=c(381),b=11,f=b*Float32Array.BYTES_PER_ELEMENT;let o,u=0,a=0,h=0;class y extends v.Disposable{constructor(k,A,x,E){super(),this._terminal=k,this._gl=A,this._dimensions=x,this._optionsService=E,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const T=this._gl;g.TextureAtlas.maxAtlasPages===void 0&&(g.TextureAtlas.maxAtlasPages=Math.min(32,(0,m.throwIfFalsy)(T.getParameter(T.MAX_TEXTURE_IMAGE_UNITS))),g.TextureAtlas.maxTextureSize=(0,m.throwIfFalsy)(T.getParameter(T.MAX_TEXTURE_SIZE))),this._program=(0,m.throwIfFalsy)((0,C.createProgram)(T,`#version 300 es
47
- layout (location = 0) in vec2 a_unitquad;
48
- layout (location = 1) in vec2 a_cellpos;
49
- layout (location = 2) in vec2 a_offset;
50
- layout (location = 3) in vec2 a_size;
51
- layout (location = 4) in float a_texpage;
52
- layout (location = 5) in vec2 a_texcoord;
53
- layout (location = 6) in vec2 a_texsize;
54
-
55
- uniform mat4 u_projection;
56
- uniform vec2 u_resolution;
57
-
58
- out vec2 v_texcoord;
59
- flat out int v_texpage;
60
-
61
- void main() {
62
- vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
63
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
64
- v_texpage = int(a_texpage);
65
- v_texcoord = a_texcoord + a_unitquad * a_texsize;
66
- }`,(function(Z){let Y="";for(let V=1;V<Z;V++)Y+=` else if (v_texpage == ${V}) { outColor = texture(u_texture[${V}], v_texcoord); }`;return`#version 300 es
67
- precision lowp float;
68
-
69
- in vec2 v_texcoord;
70
- flat in int v_texpage;
71
-
72
- uniform sampler2D u_texture[${Z}];
73
-
74
- out vec4 outColor;
75
-
76
- void main() {
77
- if (v_texpage == 0) {
78
- outColor = texture(u_texture[0], v_texcoord);
79
- } ${Y}
80
- }`})(g.TextureAtlas.maxAtlasPages))),this.register((0,v.toDisposable)((()=>T.deleteProgram(this._program)))),this._projectionLocation=(0,m.throwIfFalsy)(T.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,m.throwIfFalsy)(T.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,m.throwIfFalsy)(T.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=T.createVertexArray(),T.bindVertexArray(this._vertexArrayObject);const j=new Float32Array([0,0,1,0,0,1,1,1]),D=T.createBuffer();this.register((0,v.toDisposable)((()=>T.deleteBuffer(D)))),T.bindBuffer(T.ARRAY_BUFFER,D),T.bufferData(T.ARRAY_BUFFER,j,T.STATIC_DRAW),T.enableVertexAttribArray(0),T.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const B=new Uint8Array([0,1,2,3]),z=T.createBuffer();this.register((0,v.toDisposable)((()=>T.deleteBuffer(z)))),T.bindBuffer(T.ELEMENT_ARRAY_BUFFER,z),T.bufferData(T.ELEMENT_ARRAY_BUFFER,B,T.STATIC_DRAW),this._attributesBuffer=(0,m.throwIfFalsy)(T.createBuffer()),this.register((0,v.toDisposable)((()=>T.deleteBuffer(this._attributesBuffer)))),T.bindBuffer(T.ARRAY_BUFFER,this._attributesBuffer),T.enableVertexAttribArray(2),T.vertexAttribPointer(2,2,T.FLOAT,!1,f,0),T.vertexAttribDivisor(2,1),T.enableVertexAttribArray(3),T.vertexAttribPointer(3,2,T.FLOAT,!1,f,2*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(3,1),T.enableVertexAttribArray(4),T.vertexAttribPointer(4,1,T.FLOAT,!1,f,4*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(4,1),T.enableVertexAttribArray(5),T.vertexAttribPointer(5,2,T.FLOAT,!1,f,5*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(5,1),T.enableVertexAttribArray(6),T.vertexAttribPointer(6,2,T.FLOAT,!1,f,7*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(6,1),T.enableVertexAttribArray(1),T.vertexAttribPointer(1,2,T.FLOAT,!1,f,9*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(1,1),T.useProgram(this._program);const X=new Int32Array(g.TextureAtlas.maxAtlasPages);for(let Z=0;Z<g.TextureAtlas.maxAtlasPages;Z++)X[Z]=Z;T.uniform1iv(this._textureLocation,X),T.uniformMatrix4fv(this._projectionLocation,!1,C.PROJECTION_MATRIX),this._atlasTextures=[];for(let Z=0;Z<g.TextureAtlas.maxAtlasPages;Z++){const Y=new C.GLTexture((0,m.throwIfFalsy)(T.createTexture()));this.register((0,v.toDisposable)((()=>T.deleteTexture(Y.texture)))),T.activeTexture(T.TEXTURE0+Z),T.bindTexture(T.TEXTURE_2D,Y.texture),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_S,T.CLAMP_TO_EDGE),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_T,T.CLAMP_TO_EDGE),T.texImage2D(T.TEXTURE_2D,0,T.RGBA,1,1,0,T.RGBA,T.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[Z]=Y}T.enable(T.BLEND),T.blendFunc(T.SRC_ALPHA,T.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(k,A,x,E,T,j,D,B,z){this._updateCell(this._vertices.attributes,k,A,x,E,T,j,D,B,z)}_updateCell(k,A,x,E,T,j,D,B,z,X){u=(x*this._terminal.cols+A)*b,E!==l.NULL_CELL_CODE&&E!==void 0?this._atlas&&(o=B&&B.length>1?this._atlas.getRasterizedGlyphCombinedChar(B,T,j,D,!1):this._atlas.getRasterizedGlyph(E,T,j,D,!1),a=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),T!==X&&o.offset.x>a?(h=o.offset.x-a,k[u]=-(o.offset.x-h)+this._dimensions.device.char.left,k[u+1]=-o.offset.y+this._dimensions.device.char.top,k[u+2]=(o.size.x-h)/this._dimensions.device.canvas.width,k[u+3]=o.size.y/this._dimensions.device.canvas.height,k[u+4]=o.texturePage,k[u+5]=o.texturePositionClipSpace.x+h/this._atlas.pages[o.texturePage].canvas.width,k[u+6]=o.texturePositionClipSpace.y,k[u+7]=o.sizeClipSpace.x-h/this._atlas.pages[o.texturePage].canvas.width,k[u+8]=o.sizeClipSpace.y):(k[u]=-o.offset.x+this._dimensions.device.char.left,k[u+1]=-o.offset.y+this._dimensions.device.char.top,k[u+2]=o.size.x/this._dimensions.device.canvas.width,k[u+3]=o.size.y/this._dimensions.device.canvas.height,k[u+4]=o.texturePage,k[u+5]=o.texturePositionClipSpace.x,k[u+6]=o.texturePositionClipSpace.y,k[u+7]=o.sizeClipSpace.x,k[u+8]=o.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,m.allowRescaling)(E,z,o.size.x,this._dimensions.device.cell.width)&&(k[u+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):k.fill(0,u,u+b-1-2)}clear(){const k=this._terminal,A=k.cols*k.rows*b;this._vertices.count!==A?this._vertices.attributes=new Float32Array(A):this._vertices.attributes.fill(0);let x=0;for(;x<this._vertices.attributesBuffers.length;x++)this._vertices.count!==A?this._vertices.attributesBuffers[x]=new Float32Array(A):this._vertices.attributesBuffers[x].fill(0);this._vertices.count=A,x=0;for(let E=0;E<k.rows;E++)for(let T=0;T<k.cols;T++)this._vertices.attributes[x+9]=T/k.cols,this._vertices.attributes[x+10]=E/k.rows,x+=b}handleResize(){const k=this._gl;k.useProgram(this._program),k.viewport(0,0,k.canvas.width,k.canvas.height),k.uniform2f(this._resolutionLocation,k.canvas.width,k.canvas.height),this.clear()}render(k){if(!this._atlas)return;const A=this._gl;A.useProgram(this._program),A.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const x=this._vertices.attributesBuffers[this._activeBuffer];let E=0;for(let T=0;T<k.lineLengths.length;T++){const j=T*this._terminal.cols*b,D=this._vertices.attributes.subarray(j,j+k.lineLengths[T]*b);x.set(D,E),E+=D.length}A.bindBuffer(A.ARRAY_BUFFER,this._attributesBuffer),A.bufferData(A.ARRAY_BUFFER,x.subarray(0,E),A.STREAM_DRAW);for(let T=0;T<this._atlas.pages.length;T++)this._atlas.pages[T].version!==this._atlasTextures[T].version&&this._bindAtlasPageTexture(A,this._atlas,T);A.drawElementsInstanced(A.TRIANGLE_STRIP,4,A.UNSIGNED_BYTE,0,E/b)}setAtlas(k){this._atlas=k;for(const A of this._atlasTextures)A.version=-1}_bindAtlasPageTexture(k,A,x){k.activeTexture(k.TEXTURE0+x),k.bindTexture(k.TEXTURE_2D,this._atlasTextures[x].texture),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_S,k.CLAMP_TO_EDGE),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_T,k.CLAMP_TO_EDGE),k.texImage2D(k.TEXTURE_2D,0,k.RGBA,k.RGBA,k.UNSIGNED_BYTE,A.pages[x].canvas),k.generateMipmap(k.TEXTURE_2D),this._atlasTextures[x].version=A.pages[x].version}setDimensions(k){this._dimensions=k}}i.GlyphRenderer=y},742:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RectangleRenderer=void 0;const m=c(374),g=c(859),l=c(310),v=c(381),C=8*Float32Array.BYTES_PER_ELEMENT;class b{constructor(){this.attributes=new Float32Array(160),this.count=0}}let f=0,o=0,u=0,a=0,h=0,y=0,L=0;class k extends g.Disposable{constructor(x,E,T,j){super(),this._terminal=x,this._gl=E,this._dimensions=T,this._themeService=j,this._vertices=new b,this._verticesCursor=new b;const D=this._gl;this._program=(0,m.throwIfFalsy)((0,v.createProgram)(D,`#version 300 es
81
- layout (location = 0) in vec2 a_position;
82
- layout (location = 1) in vec2 a_size;
83
- layout (location = 2) in vec4 a_color;
84
- layout (location = 3) in vec2 a_unitquad;
85
-
86
- uniform mat4 u_projection;
87
-
88
- out vec4 v_color;
89
-
90
- void main() {
91
- vec2 zeroToOne = a_position + (a_unitquad * a_size);
92
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
93
- v_color = a_color;
94
- }`,`#version 300 es
95
- precision lowp float;
96
-
97
- in vec4 v_color;
98
-
99
- out vec4 outColor;
100
-
101
- void main() {
102
- outColor = v_color;
103
- }`)),this.register((0,g.toDisposable)((()=>D.deleteProgram(this._program)))),this._projectionLocation=(0,m.throwIfFalsy)(D.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=D.createVertexArray(),D.bindVertexArray(this._vertexArrayObject);const B=new Float32Array([0,0,1,0,0,1,1,1]),z=D.createBuffer();this.register((0,g.toDisposable)((()=>D.deleteBuffer(z)))),D.bindBuffer(D.ARRAY_BUFFER,z),D.bufferData(D.ARRAY_BUFFER,B,D.STATIC_DRAW),D.enableVertexAttribArray(3),D.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const X=new Uint8Array([0,1,2,3]),Z=D.createBuffer();this.register((0,g.toDisposable)((()=>D.deleteBuffer(Z)))),D.bindBuffer(D.ELEMENT_ARRAY_BUFFER,Z),D.bufferData(D.ELEMENT_ARRAY_BUFFER,X,D.STATIC_DRAW),this._attributesBuffer=(0,m.throwIfFalsy)(D.createBuffer()),this.register((0,g.toDisposable)((()=>D.deleteBuffer(this._attributesBuffer)))),D.bindBuffer(D.ARRAY_BUFFER,this._attributesBuffer),D.enableVertexAttribArray(0),D.vertexAttribPointer(0,2,D.FLOAT,!1,C,0),D.vertexAttribDivisor(0,1),D.enableVertexAttribArray(1),D.vertexAttribPointer(1,2,D.FLOAT,!1,C,2*Float32Array.BYTES_PER_ELEMENT),D.vertexAttribDivisor(1,1),D.enableVertexAttribArray(2),D.vertexAttribPointer(2,4,D.FLOAT,!1,C,4*Float32Array.BYTES_PER_ELEMENT),D.vertexAttribDivisor(2,1),this._updateCachedColors(j.colors),this.register(this._themeService.onChangeColors((Y=>{this._updateCachedColors(Y),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(x){const E=this._gl;E.useProgram(this._program),E.bindVertexArray(this._vertexArrayObject),E.uniformMatrix4fv(this._projectionLocation,!1,v.PROJECTION_MATRIX),E.bindBuffer(E.ARRAY_BUFFER,this._attributesBuffer),E.bufferData(E.ARRAY_BUFFER,x.attributes,E.DYNAMIC_DRAW),E.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,E.UNSIGNED_BYTE,0,x.count)}handleResize(){this._updateViewportRectangle()}setDimensions(x){this._dimensions=x}_updateCachedColors(x){this._bgFloat=this._colorToFloat32Array(x.background),this._cursorFloat=this._colorToFloat32Array(x.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(x){const E=this._terminal,T=this._vertices;let j,D,B,z,X,Z,Y,V,I,$,O,U=1;for(j=0;j<E.rows;j++){for(B=-1,z=0,X=0,Z=!1,D=0;D<E.cols;D++)Y=(j*E.cols+D)*l.RENDER_MODEL_INDICIES_PER_CELL,V=x.cells[Y+l.RENDER_MODEL_BG_OFFSET],I=x.cells[Y+l.RENDER_MODEL_FG_OFFSET],$=!!(67108864&I),(V!==z||I!==X&&(Z||$))&&((z!==0||Z&&X!==0)&&(O=8*U++,this._updateRectangle(T,O,X,z,B,D,j)),B=D,z=V,X=I,Z=$);(z!==0||Z&&X!==0)&&(O=8*U++,this._updateRectangle(T,O,X,z,B,E.cols,j))}T.count=U}updateCursor(x){const E=this._verticesCursor,T=x.cursor;if(!T||T.style==="block")return void(E.count=0);let j,D=0;T.style!=="bar"&&T.style!=="outline"||(j=8*D++,this._addRectangleFloat(E.attributes,j,T.x*this._dimensions.device.cell.width,T.y*this._dimensions.device.cell.height,T.style==="bar"?T.dpr*T.cursorWidth:T.dpr,this._dimensions.device.cell.height,this._cursorFloat)),T.style!=="underline"&&T.style!=="outline"||(j=8*D++,this._addRectangleFloat(E.attributes,j,T.x*this._dimensions.device.cell.width,(T.y+1)*this._dimensions.device.cell.height-T.dpr,T.width*this._dimensions.device.cell.width,T.dpr,this._cursorFloat)),T.style==="outline"&&(j=8*D++,this._addRectangleFloat(E.attributes,j,T.x*this._dimensions.device.cell.width,T.y*this._dimensions.device.cell.height,T.width*this._dimensions.device.cell.width,T.dpr,this._cursorFloat),j=8*D++,this._addRectangleFloat(E.attributes,j,(T.x+T.width)*this._dimensions.device.cell.width-T.dpr,T.y*this._dimensions.device.cell.height,T.dpr,this._dimensions.device.cell.height,this._cursorFloat)),E.count=D}_updateRectangle(x,E,T,j,D,B,z){if(67108864&T)switch(50331648&T){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&T].rgba;break;case 50331648:f=(16777215&T)<<8;break;default:f=this._themeService.colors.foreground.rgba}else switch(50331648&j){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&j].rgba;break;case 50331648:f=(16777215&j)<<8;break;default:f=this._themeService.colors.background.rgba}x.attributes.length<E+4&&(x.attributes=(0,v.expandFloat32Array)(x.attributes,this._terminal.rows*this._terminal.cols*8)),o=D*this._dimensions.device.cell.width,u=z*this._dimensions.device.cell.height,a=(f>>24&255)/255,h=(f>>16&255)/255,y=(f>>8&255)/255,L=1,this._addRectangle(x.attributes,E,o,u,(B-D)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,a,h,y,L)}_addRectangle(x,E,T,j,D,B,z,X,Z,Y){x[E]=T/this._dimensions.device.canvas.width,x[E+1]=j/this._dimensions.device.canvas.height,x[E+2]=D/this._dimensions.device.canvas.width,x[E+3]=B/this._dimensions.device.canvas.height,x[E+4]=z,x[E+5]=X,x[E+6]=Z,x[E+7]=Y}_addRectangleFloat(x,E,T,j,D,B,z){x[E]=T/this._dimensions.device.canvas.width,x[E+1]=j/this._dimensions.device.canvas.height,x[E+2]=D/this._dimensions.device.canvas.width,x[E+3]=B/this._dimensions.device.canvas.height,x[E+4]=z[0],x[E+5]=z[1],x[E+6]=z[2],x[E+7]=z[3]}_colorToFloat32Array(x){return new Float32Array([(x.rgba>>24&255)/255,(x.rgba>>16&255)/255,(x.rgba>>8&255)/255,(255&x.rgba)/255])}}i.RectangleRenderer=k},310:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderModel=i.COMBINED_CHAR_BIT_MASK=i.RENDER_MODEL_EXT_OFFSET=i.RENDER_MODEL_FG_OFFSET=i.RENDER_MODEL_BG_OFFSET=i.RENDER_MODEL_INDICIES_PER_CELL=void 0;const m=c(296);i.RENDER_MODEL_INDICIES_PER_CELL=4,i.RENDER_MODEL_BG_OFFSET=1,i.RENDER_MODEL_FG_OFFSET=2,i.RENDER_MODEL_EXT_OFFSET=3,i.COMBINED_CHAR_BIT_MASK=2147483648,i.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,m.createSelectionRenderModel)()}resize(g,l){const v=g*l*i.RENDER_MODEL_INDICIES_PER_CELL;v!==this.cells.length&&(this.cells=new Uint32Array(v),this.lineLengths=new Uint32Array(l))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.JoinedCellData=i.WebglRenderer=void 0;const m=c(820),g=c(274),l=c(627),v=c(457),C=c(56),b=c(374),f=c(345),o=c(859),u=c(147),a=c(782),h=c(855),y=c(965),L=c(742),k=c(310),A=c(733);class x extends o.Disposable{constructor(D,B,z,X,Z,Y,V,I,$){super(),this._terminal=D,this._characterJoinerService=B,this._charSizeService=z,this._coreBrowserService=X,this._coreService=Z,this._decorationService=Y,this._optionsService=V,this._themeService=I,this._cursorBlinkStateManager=new o.MutableDisposable,this._charAtlasDisposable=this.register(new o.MutableDisposable),this._observerDisposable=this.register(new o.MutableDisposable),this._model=new k.RenderModel,this._workCell=new a.CellData,this._workCell2=new a.CellData,this._rectangleRenderer=this.register(new o.MutableDisposable),this._glyphRenderer=this.register(new o.MutableDisposable),this._onChangeTextureAtlas=this.register(new f.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new f.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new f.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new f.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new g.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new A.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,V,this._themeService)],this.dimensions=(0,b.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(V.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const O={antialias:!1,depth:!1,preserveDrawingBuffer:$};if(this._gl=this._canvas.getContext("webgl2",O),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,m.addDisposableDomListener)(this._canvas,"webglcontextlost",(U=>{console.log("webglcontextlost event received"),U.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(U)}),3e3)}))),this.register((0,m.addDisposableDomListener)(this._canvas,"webglcontextrestored",(U=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,l.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,C.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((U,K)=>this._setCanvasDevicePixelDimensions(U,K))),this.register(this._coreBrowserService.onWindowChange((U=>{this._observerDisposable.value=(0,C.observeDevicePixelDimensions)(this._canvas,U,((K,ee)=>this._setCanvasDevicePixelDimensions(K,ee)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,o.toDisposable)((()=>{var U;for(const K of this._renderLayers)K.dispose();(U=this._canvas.parentElement)==null||U.removeChild(this._canvas),(0,l.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var D;return(D=this._charAtlas)==null?void 0:D.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(D,B){var z,X,Z,Y;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const V of this._renderLayers)V.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`,(z=this._rectangleRenderer.value)==null||z.setDimensions(this.dimensions),(X=this._rectangleRenderer.value)==null||X.handleResize(),(Z=this._glyphRenderer.value)==null||Z.setDimensions(this.dimensions),(Y=this._glyphRenderer.value)==null||Y.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var D;for(const B of this._renderLayers)B.handleBlur(this._terminal);(D=this._cursorBlinkStateManager.value)==null||D.pause(),this._requestRedrawViewport()}handleFocus(){var D;for(const B of this._renderLayers)B.handleFocus(this._terminal);(D=this._cursorBlinkStateManager.value)==null||D.resume(),this._requestRedrawViewport()}handleSelectionChanged(D,B,z){for(const X of this._renderLayers)X.handleSelectionChanged(this._terminal,D,B,z);this._model.selection.update(this._core,D,B,z),this._requestRedrawViewport()}handleCursorMove(){var D;for(const B of this._renderLayers)B.handleCursorMove(this._terminal);(D=this._cursorBlinkStateManager.value)==null||D.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new L.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new y.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var B;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const D=(0,l.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==D&&(this._onChangeTextureAtlas.fire(D.pages[0].canvas),this._charAtlasDisposable.value=(0,o.getDisposeArrayDisposable)([(0,f.forwardEvent)(D.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,f.forwardEvent)(D.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=D,this._charAtlas.warmUp(),(B=this._glyphRenderer.value)==null||B.setAtlas(this._charAtlas)}_clearModel(D){var B;this._model.clear(),D&&((B=this._glyphRenderer.value)==null||B.clear())}clearTextureAtlas(){var D;(D=this._charAtlas)==null||D.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var D;this._clearModel(!0);for(const B of this._renderLayers)B.reset(this._terminal);(D=this._cursorBlinkStateManager.value)==null||D.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(D){return-1}deregisterCharacterJoiner(D){return!1}renderRows(D,B){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const z of this._renderLayers)z.handleGridChanged(this._terminal,D,B);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(D,B),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new v.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(D,B){const z=this._core;let X,Z,Y,V,I,$,O,U,K,ee,ne,Q,q,H,re=this._workCell;D=T(D,z.rows-1,0),B=T(B,z.rows-1,0);const te=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,he=te-z.buffer.ydisp,de=Math.min(this._terminal.buffer.active.cursorX,z.cols-1);let Te=-1;const ke=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let He=!1;for(Z=D;Z<=B;Z++)for(Y=Z+z.buffer.ydisp,V=z.buffer.lines.get(Y),this._model.lineLengths[Z]=0,I=this._characterJoinerService.getJoinedCharacters(Y),q=0;q<z.cols;q++)if(X=this._cellColorResolver.result.bg,V.loadCell(q,re),q===0&&(X=this._cellColorResolver.result.bg),$=!1,O=q,I.length>0&&q===I[0][0]&&($=!0,U=I.shift(),re=new E(re,V.translateToString(!0,U[0],U[1]),U[1]-U[0]),O=U[1]-1),K=re.getChars(),ee=re.getCode(),Q=(Z*z.cols+q)*k.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(re,q,Y,this.dimensions.device.cell.width),ke&&Y===te&&(q===de&&(this._model.cursor={x:de,y:he,width:re.getWidth(),style:this._coreBrowserService.isFocused?z.options.cursorStyle||"block":z.options.cursorInactiveStyle,cursorWidth:z.options.cursorWidth,dpr:this._devicePixelRatio},Te=de+re.getWidth()-1),q>=de&&q<=Te&&(this._coreBrowserService.isFocused&&(z.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&z.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)),ee!==h.NULL_CELL_CODE&&(this._model.lineLengths[Z]=q+1),(this._model.cells[Q]!==ee||this._model.cells[Q+k.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[Q+k.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[Q+k.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(He=!0,K.length>1&&(ee|=k.COMBINED_CHAR_BIT_MASK),this._model.cells[Q]=ee,this._model.cells[Q+k.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[Q+k.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[Q+k.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,ne=re.getWidth(),this._glyphRenderer.value.updateCell(q,Z,ee,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,K,ne,X),$))for(re=this._workCell,q++;q<O;q++)H=(Z*z.cols+q)*k.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(q,Z,h.NULL_CELL_CODE,0,0,0,h.NULL_CELL_CHAR,0,0),this._model.cells[H]=h.NULL_CELL_CODE,this._model.cells[H+k.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[H+k.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[H+k.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;He&&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(D,B){this._canvas.width===D&&this._canvas.height===B||(this._canvas.width=D,this._canvas.height=B,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const D=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:D,end:D})}}i.WebglRenderer=x;class E extends u.AttributeData{constructor(D,B,z){super(),this.content=0,this.combinedData="",this.fg=D.fg,this.bg=D.bg,this.combinedData=B,this._width=z}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(D){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function T(j,D,B=0){return Math.max(Math.min(j,D),B)}i.JoinedCellData=E},381:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GLTexture=i.expandFloat32Array=i.createShader=i.createProgram=i.PROJECTION_MATRIX=void 0;const m=c(374);function g(l,v,C){const b=(0,m.throwIfFalsy)(l.createShader(v));if(l.shaderSource(b,C),l.compileShader(b),l.getShaderParameter(b,l.COMPILE_STATUS))return b;console.error(l.getShaderInfoLog(b)),l.deleteShader(b)}i.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),i.createProgram=function(l,v,C){const b=(0,m.throwIfFalsy)(l.createProgram());if(l.attachShader(b,(0,m.throwIfFalsy)(g(l,l.VERTEX_SHADER,v))),l.attachShader(b,(0,m.throwIfFalsy)(g(l,l.FRAGMENT_SHADER,C))),l.linkProgram(b),l.getProgramParameter(b,l.LINK_STATUS))return b;console.error(l.getProgramInfoLog(b)),l.deleteProgram(b)},i.createShader=g,i.expandFloat32Array=function(l,v){const C=Math.min(2*l.length,v),b=new Float32Array(C);for(let f=0;f<l.length;f++)b[f]=l[f];return b},i.GLTexture=class{constructor(l){this.texture=l,this.version=-1}}},592:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BaseRenderLayer=void 0;const m=c(627),g=c(237),l=c(374),v=c(859);class C extends v.Disposable{constructor(f,o,u,a,h,y,L,k){super(),this._container=o,this._alpha=h,this._coreBrowserService=y,this._optionsService=L,this._themeService=k,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${u}-layer`),this._canvas.style.zIndex=a.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((A=>{this._refreshCharAtlas(f,A),this.reset(f)}))),this.register((0,v.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,l.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(f){}handleFocus(f){}handleCursorMove(f){}handleGridChanged(f,o,u){}handleSelectionChanged(f,o,u,a=!1){}_setTransparency(f,o){if(o===this._alpha)return;const u=this._canvas;this._alpha=o,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,u),this._refreshCharAtlas(f,this._themeService.colors),this.handleGridChanged(f,0,f.rows-1)}_refreshCharAtlas(f,o){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,m.acquireTextureAtlas)(f,this._optionsService.rawOptions,o,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(f,o){this._deviceCellWidth=o.device.cell.width,this._deviceCellHeight=o.device.cell.height,this._deviceCharWidth=o.device.char.width,this._deviceCharHeight=o.device.char.height,this._deviceCharLeft=o.device.char.left,this._deviceCharTop=o.device.char.top,this._canvas.width=o.device.canvas.width,this._canvas.height=o.device.canvas.height,this._canvas.style.width=`${o.css.canvas.width}px`,this._canvas.style.height=`${o.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(f,this._themeService.colors)}_fillBottomLineAtCells(f,o,u=1){this._ctx.fillRect(f*this._deviceCellWidth,(o+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,u*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(f,o,u,a){this._alpha?this._ctx.clearRect(f*this._deviceCellWidth,o*this._deviceCellHeight,u*this._deviceCellWidth,a*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(f*this._deviceCellWidth,o*this._deviceCellHeight,u*this._deviceCellWidth,a*this._deviceCellHeight))}_fillCharTrueColor(f,o,u,a){this._ctx.font=this._getFont(f,!1,!1),this._ctx.textBaseline=g.TEXT_BASELINE,this._clipCell(u,a,o.getWidth()),this._ctx.fillText(o.getChars(),u*this._deviceCellWidth+this._deviceCharLeft,a*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(f,o,u){this._ctx.beginPath(),this._ctx.rect(f*this._deviceCellWidth,o*this._deviceCellHeight,u*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(f,o,u){return`${u?"italic":""} ${o?f.options.fontWeightBold:f.options.fontWeight} ${f.options.fontSize*this._coreBrowserService.dpr}px ${f.options.fontFamily}`}}i.BaseRenderLayer=C},733:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkRenderLayer=void 0;const m=c(197),g=c(237),l=c(592);class v extends l.BaseRenderLayer{constructor(b,f,o,u,a,h,y){super(o,b,"link",f,!0,a,h,y),this.register(u.onShowLinkUnderline((L=>this._handleShowLinkUnderline(L)))),this.register(u.onHideLinkUnderline((L=>this._handleHideLinkUnderline(L))))}resize(b,f){super.resize(b,f),this._state=void 0}reset(b){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const b=this._state.y2-this._state.y1-1;b>0&&this._clearCells(0,this._state.y1+1,this._state.cols,b),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(b){if(b.fg===g.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:b.fg!==void 0&&(0,m.is256Color)(b.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[b.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,b.y1===b.y2)this._fillBottomLineAtCells(b.x1,b.y1,b.x2-b.x1);else{this._fillBottomLineAtCells(b.x1,b.y1,b.cols-b.x1);for(let f=b.y1+1;f<b.y2;f++)this._fillBottomLineAtCells(0,f,b.cols);this._fillBottomLineAtCells(0,b.y2,b.x2)}this._state=b}_handleHideLinkUnderline(b){this._clearCurrentLink()}}i.LinkRenderLayer=v},820:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(c,m,g,l){c.addEventListener(m,g,l);let v=!1;return{dispose:()=>{v||(v=!0,c.removeEventListener(m,g,l))}}}},274:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellColorResolver=void 0;const m=c(855),g=c(160),l=c(374);let v,C=0,b=0,f=!1,o=!1,u=!1,a=0;i.CellColorResolver=class{constructor(h,y,L,k,A,x){this._terminal=h,this._optionService=y,this._selectionRenderModel=L,this._decorationService=k,this._coreBrowserService=A,this._themeService=x,this.result={fg:0,bg:0,ext:0}}resolve(h,y,L,k){if(this.result.bg=h.bg,this.result.fg=h.fg,this.result.ext=268435456&h.bg?h.extended.ext:0,b=0,C=0,o=!1,f=!1,u=!1,v=this._themeService.colors,a=0,h.getCode()!==m.NULL_CELL_CODE&&h.extended.underlineStyle===4){const A=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));a=y*k%(2*Math.round(A))}if(this._decorationService.forEachDecorationAtCell(y,L,"bottom",(A=>{A.backgroundColorRGB&&(b=A.backgroundColorRGB.rgba>>8&16777215,o=!0),A.foregroundColorRGB&&(C=A.foregroundColorRGB.rgba>>8&16777215,f=!0)})),u=this._selectionRenderModel.isCellSelected(this._terminal,y,L),u){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:b=(16777215&this.result.fg)<<8|255;break;default:b=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:b=(16777215&this.result.bg)<<8|255}b=g.rgba.blend(b,4294967040&(this._coreBrowserService.isFocused?v.selectionBackgroundOpaque:v.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else b=(this._coreBrowserService.isFocused?v.selectionBackgroundOpaque:v.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(o=!0,v.selectionForeground&&(C=v.selectionForeground.rgba>>8&16777215,f=!0),(0,l.treatGlyphAsBackgroundColor)(h.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)C=(this._coreBrowserService.isFocused?v.selectionBackgroundOpaque:v.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:C=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:C=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:C=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:C=(16777215&this.result.fg)<<8|255;break;default:C=this._themeService.colors.foreground.rgba}C=g.rgba.blend(C,4294967040&(this._coreBrowserService.isFocused?v.selectionBackgroundOpaque:v.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}f=!0}}this._decorationService.forEachDecorationAtCell(y,L,"top",(A=>{A.backgroundColorRGB&&(b=A.backgroundColorRGB.rgba>>8&16777215,o=!0),A.foregroundColorRGB&&(C=A.foregroundColorRGB.rgba>>8&16777215,f=!0)})),o&&(b=u?-16777216&h.bg&-134217729|b|50331648:-16777216&h.bg|b|50331648),f&&(C=-16777216&h.fg&-67108865|C|50331648),67108864&this.result.fg&&(o&&!f&&(C=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&v.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,f=!0),!o&&f&&(b=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&v.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,o=!0)),v=void 0,this.result.bg=o?b:this.result.bg,this.result.fg=f?C:this.result.fg,this.result.ext&=536870911,this.result.ext|=a<<29&3758096384}}},627:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.removeTerminalFromCache=i.acquireTextureAtlas=void 0;const m=c(509),g=c(197),l=[];i.acquireTextureAtlas=function(v,C,b,f,o,u,a,h){const y=(0,g.generateConfig)(f,o,u,a,C,b,h);for(let A=0;A<l.length;A++){const x=l[A],E=x.ownedBy.indexOf(v);if(E>=0){if((0,g.configEquals)(x.config,y))return x.atlas;x.ownedBy.length===1?(x.atlas.dispose(),l.splice(A,1)):x.ownedBy.splice(E,1);break}}for(let A=0;A<l.length;A++){const x=l[A];if((0,g.configEquals)(x.config,y))return x.ownedBy.push(v),x.atlas}const L=v._core,k={atlas:new m.TextureAtlas(document,y,L.unicodeService),config:y,ownedBy:[v]};return l.push(k),k.atlas},i.removeTerminalFromCache=function(v){for(let C=0;C<l.length;C++){const b=l[C].ownedBy.indexOf(v);if(b!==-1){l[C].ownedBy.length===1?(l[C].atlas.dispose(),l.splice(C,1)):l[C].ownedBy.splice(b,1);break}}}},197:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.is256Color=i.configEquals=i.generateConfig=void 0;const m=c(160);i.generateConfig=function(g,l,v,C,b,f,o){const u={foreground:f.foreground,background:f.background,cursor:m.NULL_COLOR,cursorAccent:m.NULL_COLOR,selectionForeground:m.NULL_COLOR,selectionBackgroundTransparent:m.NULL_COLOR,selectionBackgroundOpaque:m.NULL_COLOR,selectionInactiveBackgroundTransparent:m.NULL_COLOR,selectionInactiveBackgroundOpaque:m.NULL_COLOR,ansi:f.ansi.slice(),contrastCache:f.contrastCache,halfContrastCache:f.halfContrastCache};return{customGlyphs:b.customGlyphs,devicePixelRatio:o,letterSpacing:b.letterSpacing,lineHeight:b.lineHeight,deviceCellWidth:g,deviceCellHeight:l,deviceCharWidth:v,deviceCharHeight:C,fontFamily:b.fontFamily,fontSize:b.fontSize,fontWeight:b.fontWeight,fontWeightBold:b.fontWeightBold,allowTransparency:b.allowTransparency,drawBoldTextInBrightColors:b.drawBoldTextInBrightColors,minimumContrastRatio:b.minimumContrastRatio,colors:u}},i.configEquals=function(g,l){for(let v=0;v<g.colors.ansi.length;v++)if(g.colors.ansi[v].rgba!==l.colors.ansi[v].rgba)return!1;return g.devicePixelRatio===l.devicePixelRatio&&g.customGlyphs===l.customGlyphs&&g.lineHeight===l.lineHeight&&g.letterSpacing===l.letterSpacing&&g.fontFamily===l.fontFamily&&g.fontSize===l.fontSize&&g.fontWeight===l.fontWeight&&g.fontWeightBold===l.fontWeightBold&&g.allowTransparency===l.allowTransparency&&g.deviceCharWidth===l.deviceCharWidth&&g.deviceCharHeight===l.deviceCharHeight&&g.drawBoldTextInBrightColors===l.drawBoldTextInBrightColors&&g.minimumContrastRatio===l.minimumContrastRatio&&g.colors.foreground.rgba===l.colors.foreground.rgba&&g.colors.background.rgba===l.colors.background.rgba},i.is256Color=function(g){return(50331648&g)==16777216||(50331648&g)==33554432}},237:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;const m=c(399);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=m.isFirefox||m.isLegacyEdge?"bottom":"ideographic"},457:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CursorBlinkStateManager=void 0,i.CursorBlinkStateManager=class{constructor(c,m){this._renderCallback=c,this._coreBrowserService=m,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(c=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const m=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,m>0)return void this._restartInterval(m)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const m=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(m)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),c)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tryDrawCustomChar=i.powerlineDefinitions=i.boxDrawingDefinitions=i.blockElementDefinitions=void 0;const m=c(374);i.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const g={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};i.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(f,o)=>`M0,${.5-o} L1,${.5-o} M0,${.5+o} L1,${.5+o}`},"║":{1:(f,o)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╒":{1:(f,o)=>`M.5,1 L.5,${.5-o} L1,${.5-o} M.5,${.5+o} L1,${.5+o}`},"╓":{1:(f,o)=>`M${.5-f},1 L${.5-f},.5 L1,.5 M${.5+f},.5 L${.5+f},1`},"╔":{1:(f,o)=>`M1,${.5-o} L${.5-f},${.5-o} L${.5-f},1 M1,${.5+o} L${.5+f},${.5+o} L${.5+f},1`},"╕":{1:(f,o)=>`M0,${.5-o} L.5,${.5-o} L.5,1 M0,${.5+o} L.5,${.5+o}`},"╖":{1:(f,o)=>`M${.5+f},1 L${.5+f},.5 L0,.5 M${.5-f},.5 L${.5-f},1`},"╗":{1:(f,o)=>`M0,${.5+o} L${.5-f},${.5+o} L${.5-f},1 M0,${.5-o} L${.5+f},${.5-o} L${.5+f},1`},"╘":{1:(f,o)=>`M.5,0 L.5,${.5+o} L1,${.5+o} M.5,${.5-o} L1,${.5-o}`},"╙":{1:(f,o)=>`M1,.5 L${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╚":{1:(f,o)=>`M1,${.5-o} L${.5+f},${.5-o} L${.5+f},0 M1,${.5+o} L${.5-f},${.5+o} L${.5-f},0`},"╛":{1:(f,o)=>`M0,${.5+o} L.5,${.5+o} L.5,0 M0,${.5-o} L.5,${.5-o}`},"╜":{1:(f,o)=>`M0,.5 L${.5+f},.5 L${.5+f},0 M${.5-f},.5 L${.5-f},0`},"╝":{1:(f,o)=>`M0,${.5-o} L${.5-f},${.5-o} L${.5-f},0 M0,${.5+o} L${.5+f},${.5+o} L${.5+f},0`},"╞":{1:(f,o)=>`M.5,0 L.5,1 M.5,${.5-o} L1,${.5-o} M.5,${.5+o} L1,${.5+o}`},"╟":{1:(f,o)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1 M${.5+f},.5 L1,.5`},"╠":{1:(f,o)=>`M${.5-f},0 L${.5-f},1 M1,${.5+o} L${.5+f},${.5+o} L${.5+f},1 M1,${.5-o} L${.5+f},${.5-o} L${.5+f},0`},"╡":{1:(f,o)=>`M.5,0 L.5,1 M0,${.5-o} L.5,${.5-o} M0,${.5+o} L.5,${.5+o}`},"╢":{1:(f,o)=>`M0,.5 L${.5-f},.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╣":{1:(f,o)=>`M${.5+f},0 L${.5+f},1 M0,${.5+o} L${.5-f},${.5+o} L${.5-f},1 M0,${.5-o} L${.5-f},${.5-o} L${.5-f},0`},"╤":{1:(f,o)=>`M0,${.5-o} L1,${.5-o} M0,${.5+o} L1,${.5+o} M.5,${.5+o} L.5,1`},"╥":{1:(f,o)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},1 M${.5+f},.5 L${.5+f},1`},"╦":{1:(f,o)=>`M0,${.5-o} L1,${.5-o} M0,${.5+o} L${.5-f},${.5+o} L${.5-f},1 M1,${.5+o} L${.5+f},${.5+o} L${.5+f},1`},"╧":{1:(f,o)=>`M.5,0 L.5,${.5-o} M0,${.5-o} L1,${.5-o} M0,${.5+o} L1,${.5+o}`},"╨":{1:(f,o)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╩":{1:(f,o)=>`M0,${.5+o} L1,${.5+o} M0,${.5-o} L${.5-f},${.5-o} L${.5-f},0 M1,${.5-o} L${.5+f},${.5-o} L${.5+f},0`},"╪":{1:(f,o)=>`M.5,0 L.5,1 M0,${.5-o} L1,${.5-o} M0,${.5+o} L1,${.5+o}`},"╫":{1:(f,o)=>`M0,.5 L1,.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╬":{1:(f,o)=>`M0,${.5+o} L${.5-f},${.5+o} L${.5-f},1 M1,${.5+o} L${.5+f},${.5+o} L${.5+f},1 M0,${.5-o} L${.5-f},${.5-o} L${.5-f},0 M1,${.5-o} L${.5+f},${.5-o} L${.5+f},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(f,o)=>`M.5,1 L.5,${.5+o/.15*.5} C.5,${.5+o/.15*.5},.5,.5,1,.5`},"╮":{1:(f,o)=>`M.5,1 L.5,${.5+o/.15*.5} C.5,${.5+o/.15*.5},.5,.5,0,.5`},"╯":{1:(f,o)=>`M.5,0 L.5,${.5-o/.15*.5} C.5,${.5-o/.15*.5},.5,.5,0,.5`},"╰":{1:(f,o)=>`M.5,0 L.5,${.5-o/.15*.5} C.5,${.5-o/.15*.5},.5,.5,1,.5`}},i.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},i.powerlineDefinitions[""]=i.powerlineDefinitions[""],i.powerlineDefinitions[""]=i.powerlineDefinitions[""],i.tryDrawCustomChar=function(f,o,u,a,h,y,L,k){const A=i.blockElementDefinitions[o];if(A)return(function(j,D,B,z,X,Z){for(let Y=0;Y<D.length;Y++){const V=D[Y],I=X/8,$=Z/8;j.fillRect(B+V.x*I,z+V.y*$,V.w*I,V.h*$)}})(f,A,u,a,h,y),!0;const x=g[o];if(x)return(function(j,D,B,z,X,Z){let Y=l.get(D);Y||(Y=new Map,l.set(D,Y));const V=j.fillStyle;if(typeof V!="string")throw new Error(`Unexpected fillStyle type "${V}"`);let I=Y.get(V);if(!I){const $=D[0].length,O=D.length,U=j.canvas.ownerDocument.createElement("canvas");U.width=$,U.height=O;const K=(0,m.throwIfFalsy)(U.getContext("2d")),ee=new ImageData($,O);let ne,Q,q,H;if(V.startsWith("#"))ne=parseInt(V.slice(1,3),16),Q=parseInt(V.slice(3,5),16),q=parseInt(V.slice(5,7),16),H=V.length>7&&parseInt(V.slice(7,9),16)||1;else{if(!V.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${V}" when drawing pattern glyph`);[ne,Q,q,H]=V.substring(5,V.length-1).split(",").map((re=>parseFloat(re)))}for(let re=0;re<O;re++)for(let te=0;te<$;te++)ee.data[4*(re*$+te)]=ne,ee.data[4*(re*$+te)+1]=Q,ee.data[4*(re*$+te)+2]=q,ee.data[4*(re*$+te)+3]=D[re][te]*(255*H);K.putImageData(ee,0,0),I=(0,m.throwIfFalsy)(j.createPattern(U,null)),Y.set(V,I)}j.fillStyle=I,j.fillRect(B,z,X,Z)})(f,x,u,a,h,y),!0;const E=i.boxDrawingDefinitions[o];if(E)return(function(j,D,B,z,X,Z,Y){j.strokeStyle=j.fillStyle;for(const[V,I]of Object.entries(D)){let $;j.beginPath(),j.lineWidth=Y*Number.parseInt(V),$=typeof I=="function"?I(.15,.15/Z*X):I;for(const O of $.split(" ")){const U=O[0],K=C[U];if(!K){console.error(`Could not find drawing instructions for "${U}"`);continue}const ee=O.substring(1).split(",");ee[0]&&ee[1]&&K(j,b(ee,X,Z,B,z,!0,Y))}j.stroke(),j.closePath()}})(f,E,u,a,h,y,k),!0;const T=i.powerlineDefinitions[o];return!!T&&((function(j,D,B,z,X,Z,Y,V){const I=new Path2D;I.rect(B,z,X,Z),j.clip(I),j.beginPath();const $=Y/12;j.lineWidth=V*$;for(const O of D.d.split(" ")){const U=O[0],K=C[U];if(!K){console.error(`Could not find drawing instructions for "${U}"`);continue}const ee=O.substring(1).split(",");ee[0]&&ee[1]&&K(j,b(ee,X,Z,B,z,!1,V,(D.leftPadding??0)*($/2),(D.rightPadding??0)*($/2)))}D.type===1?(j.strokeStyle=j.fillStyle,j.stroke()):j.fill(),j.closePath()})(f,T,u,a,h,y,L,k),!0)};const l=new Map;function v(f,o,u=0){return Math.max(Math.min(f,o),u)}const C={C:(f,o)=>f.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]),L:(f,o)=>f.lineTo(o[0],o[1]),M:(f,o)=>f.moveTo(o[0],o[1])};function b(f,o,u,a,h,y,L,k=0,A=0){const x=f.map((E=>parseFloat(E)||parseInt(E)));if(x.length<2)throw new Error("Too few arguments for instruction");for(let E=0;E<x.length;E+=2)x[E]*=o-k*L-A*L,y&&x[E]!==0&&(x[E]=v(Math.round(x[E]+.5)-.5,o,0)),x[E]+=a+k*L;for(let E=1;E<x.length;E+=2)x[E]*=u,y&&x[E]!==0&&(x[E]=v(Math.round(x[E]+.5)-.5,u,0)),x[E]+=h;return x}},56:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.observeDevicePixelDimensions=void 0;const m=c(859);i.observeDevicePixelDimensions=function(g,l,v){let C=new l.ResizeObserver((b=>{const f=b.find((a=>a.target===g));if(!f)return;if(!("devicePixelContentBoxSize"in f))return C==null||C.disconnect(),void(C=void 0);const o=f.devicePixelContentBoxSize[0].inlineSize,u=f.devicePixelContentBoxSize[0].blockSize;o>0&&u>0&&v(o,u)}));try{C.observe(g,{box:["device-pixel-content-box"]})}catch{C.disconnect(),C=void 0}return(0,m.toDisposable)((()=>C==null?void 0:C.disconnect()))}},374:(N,i)=>{function c(g){return 57508<=g&&g<=57558}function m(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(i,"__esModule",{value:!0}),i.computeNextVariantOffset=i.createRenderDimensions=i.treatGlyphAsBackgroundColor=i.allowRescaling=i.isEmoji=i.isRestrictedPowerlineGlyph=i.isPowerlineGlyph=i.throwIfFalsy=void 0,i.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},i.isPowerlineGlyph=c,i.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},i.isEmoji=m,i.allowRescaling=function(g,l,v,C){return l===1&&v>Math.ceil(1.5*C)&&g!==void 0&&g>255&&!m(g)&&!c(g)&&!(function(b){return 57344<=b&&b<=63743})(g)},i.treatGlyphAsBackgroundColor=function(g){return c(g)||(function(l){return 9472<=l&&l<=9631})(g)},i.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}}}},i.computeNextVariantOffset=function(g,l,v=0){return(g-(2*Math.round(l)-v))%(2*Math.round(l))}},296:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(g,l,v,C=!1){if(this.selectionStart=l,this.selectionEnd=v,!l||!v||l[0]===v[0]&&l[1]===v[1])return void this.clear();const b=g.buffers.active.ydisp,f=l[1]-b,o=v[1]-b,u=Math.max(f,0),a=Math.min(o,g.rows-1);u>=g.rows||a<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=f,this.viewportEndRow=o,this.viewportCappedStartRow=u,this.viewportCappedEndRow=a,this.startCol=l[0],this.endCol=v[0])}isCellSelected(g,l,v){return!!this.hasSelection&&(v-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&v>=this.viewportCappedStartRow&&l<this.endCol&&v<=this.viewportCappedEndRow:l<this.startCol&&v>=this.viewportCappedStartRow&&l>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&l>=this.startCol)}}i.createSelectionRenderModel=function(){return new c}},509:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TextureAtlas=void 0;const m=c(237),g=c(860),l=c(374),v=c(160),C=c(345),b=c(485),f=c(385),o=c(147),u=c(855),a={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let h;class y{get pages(){return this._pages}constructor(E,T,j){this._document=E,this._config=T,this._unicodeService=j,this._didWarmUp=!1,this._cacheMap=new b.FourKeyMap,this._cacheMapCombined=new b.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new o.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new C.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new C.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=A(E,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,l.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const E of this.pages)E.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const E=new f.IdleTaskQueue;for(let T=33;T<126;T++)E.enqueue((()=>{if(!this._cacheMap.get(T,u.DEFAULT_COLOR,u.DEFAULT_COLOR,u.DEFAULT_EXT)){const j=this._drawToCache(T,u.DEFAULT_COLOR,u.DEFAULT_COLOR,u.DEFAULT_EXT);this._cacheMap.set(T,u.DEFAULT_COLOR,u.DEFAULT_COLOR,u.DEFAULT_EXT,j)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const E of this._pages)E.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(y.maxAtlasPages&&this._pages.length>=Math.max(4,y.maxAtlasPages)){const T=this._pages.filter((Y=>2*Y.canvas.width<=(y.maxTextureSize||4096))).sort(((Y,V)=>V.canvas.width!==Y.canvas.width?V.canvas.width-Y.canvas.width:V.percentageUsed-Y.percentageUsed));let j=-1,D=0;for(let Y=0;Y<T.length;Y++)if(T[Y].canvas.width!==D)j=Y,D=T[Y].canvas.width;else if(Y-j==3)break;const B=T.slice(j,j+4),z=B.map((Y=>Y.glyphs[0].texturePage)).sort(((Y,V)=>Y>V?1:-1)),X=this.pages.length-B.length,Z=this._mergePages(B,X);Z.version++;for(let Y=z.length-1;Y>=0;Y--)this._deletePage(z[Y]);this.pages.push(Z),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(Z.canvas)}const E=new L(this._document,this._textureSize);return this._pages.push(E),this._activePages.push(E),this._onAddTextureAtlasCanvas.fire(E.canvas),E}_mergePages(E,T){const j=2*E[0].canvas.width,D=new L(this._document,j,E);for(const[B,z]of E.entries()){const X=B*z.canvas.width%j,Z=Math.floor(B/2)*z.canvas.height;D.ctx.drawImage(z.canvas,X,Z);for(const V of z.glyphs)V.texturePage=T,V.sizeClipSpace.x=V.size.x/j,V.sizeClipSpace.y=V.size.y/j,V.texturePosition.x+=X,V.texturePosition.y+=Z,V.texturePositionClipSpace.x=V.texturePosition.x/j,V.texturePositionClipSpace.y=V.texturePosition.y/j;this._onRemoveTextureAtlasCanvas.fire(z.canvas);const Y=this._activePages.indexOf(z);Y!==-1&&this._activePages.splice(Y,1)}return D}_deletePage(E){this._pages.splice(E,1);for(let T=E;T<this._pages.length;T++){const j=this._pages[T];for(const D of j.glyphs)D.texturePage--;j.version++}}getRasterizedGlyphCombinedChar(E,T,j,D,B){return this._getFromCacheMap(this._cacheMapCombined,E,T,j,D,B)}getRasterizedGlyph(E,T,j,D,B){return this._getFromCacheMap(this._cacheMap,E,T,j,D,B)}_getFromCacheMap(E,T,j,D,B,z=!1){return h=E.get(T,j,D,B),h||(h=this._drawToCache(T,j,D,B,z),E.set(T,j,D,B,h)),h}_getColorFromAnsiIndex(E){if(E>=this._config.colors.ansi.length)throw new Error("No color found for idx "+E);return this._config.colors.ansi[E]}_getBackgroundColor(E,T,j,D){if(this._config.allowTransparency)return v.NULL_COLOR;let B;switch(E){case 16777216:case 33554432:B=this._getColorFromAnsiIndex(T);break;case 50331648:const z=o.AttributeData.toColorRGB(T);B=v.channels.toColor(z[0],z[1],z[2]);break;default:B=j?v.color.opaque(this._config.colors.foreground):this._config.colors.background}return B}_getForegroundColor(E,T,j,D,B,z,X,Z,Y,V){const I=this._getMinimumContrastColor(E,T,j,D,B,z,X,Y,Z,V);if(I)return I;let $;switch(B){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&Y&&z<8&&(z+=8),$=this._getColorFromAnsiIndex(z);break;case 50331648:const O=o.AttributeData.toColorRGB(z);$=v.channels.toColor(O[0],O[1],O[2]);break;default:$=X?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&($=v.color.opaque($)),Z&&($=v.color.multiplyOpacity($,m.DIM_OPACITY)),$}_resolveBackgroundRgba(E,T,j){switch(E){case 16777216:case 33554432:return this._getColorFromAnsiIndex(T).rgba;case 50331648:return T<<8;default:return j?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(E,T,j,D){switch(E){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&D&&T<8&&(T+=8),this._getColorFromAnsiIndex(T).rgba;case 50331648:return T<<8;default:return j?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(E,T,j,D,B,z,X,Z,Y,V){if(this._config.minimumContrastRatio===1||V)return;const I=this._getContrastCache(Y),$=I.getColor(E,D);if($!==void 0)return $||void 0;const O=this._resolveBackgroundRgba(T,j,X),U=this._resolveForegroundRgba(B,z,X,Z),K=v.rgba.ensureContrastRatio(O,U,this._config.minimumContrastRatio/(Y?2:1));if(!K)return void I.setColor(E,D,null);const ee=v.channels.toColor(K>>24&255,K>>16&255,K>>8&255);return I.setColor(E,D,ee),ee}_getContrastCache(E){return E?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(E,T,j,D,B=!1){const z=typeof E=="number"?String.fromCharCode(E):E,X=Math.min(this._config.deviceCellWidth*Math.max(z.length,2)+4,this._textureSize);this._tmpCanvas.width<X&&(this._tmpCanvas.width=X);const Z=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<Z&&(this._tmpCanvas.height=Z),this._tmpCtx.save(),this._workAttributeData.fg=j,this._workAttributeData.bg=T,this._workAttributeData.extended.ext=D,this._workAttributeData.isInvisible())return a;const Y=!!this._workAttributeData.isBold(),V=!!this._workAttributeData.isInverse(),I=!!this._workAttributeData.isDim(),$=!!this._workAttributeData.isItalic(),O=!!this._workAttributeData.isUnderline(),U=!!this._workAttributeData.isStrikethrough(),K=!!this._workAttributeData.isOverline();let ee=this._workAttributeData.getFgColor(),ne=this._workAttributeData.getFgColorMode(),Q=this._workAttributeData.getBgColor(),q=this._workAttributeData.getBgColorMode();if(V){const we=ee;ee=Q,Q=we;const We=ne;ne=q,q=We}const H=this._getBackgroundColor(q,Q,V,I);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=H.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const re=Y?this._config.fontWeightBold:this._config.fontWeight,te=$?"italic":"";this._tmpCtx.font=`${te} ${re} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=m.TEXT_BASELINE;const he=z.length===1&&(0,l.isPowerlineGlyph)(z.charCodeAt(0)),de=z.length===1&&(0,l.isRestrictedPowerlineGlyph)(z.charCodeAt(0)),Te=this._getForegroundColor(T,q,Q,j,ne,ee,V,I,Y,(0,l.treatGlyphAsBackgroundColor)(z.charCodeAt(0)));this._tmpCtx.fillStyle=Te.css;const ke=de?0:4;let He=!1;this._config.customGlyphs!==!1&&(He=(0,g.tryDrawCustomChar)(this._tmpCtx,z,ke,ke,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let Qe,ce=!he;if(Qe=typeof E=="number"?this._unicodeService.wcwidth(E):this._unicodeService.getStringCellWidth(E),O){this._tmpCtx.save();const we=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),We=we%2==1?.5:0;if(this._tmpCtx.lineWidth=we,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())ce=!1,this._tmpCtx.strokeStyle=`rgb(${o.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{ce=!1;let tt=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&tt<8&&(tt+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(tt).css}this._tmpCtx.beginPath();const et=ke,Ve=Math.ceil(ke+this._config.deviceCharHeight)-We-(B?2*we:0),ht=Ve+we,Je=Ve+2*we;let St=this._workAttributeData.getUnderlineVariantOffset();for(let tt=0;tt<Qe;tt++){this._tmpCtx.save();const me=et+tt*this._config.deviceCellWidth,Ce=et+(tt+1)*this._config.deviceCellWidth,rt=me+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(me,Ve),this._tmpCtx.lineTo(Ce,Ve),this._tmpCtx.moveTo(me,Je),this._tmpCtx.lineTo(Ce,Je);break;case 3:const ye=we<=1?Je:Math.ceil(ke+this._config.deviceCharHeight-we/2)-We,Ye=we<=1?Ve:Math.ceil(ke+this._config.deviceCharHeight+we/2)-We,it=new Path2D;it.rect(me,Ve,this._config.deviceCellWidth,Je-Ve),this._tmpCtx.clip(it),this._tmpCtx.moveTo(me-this._config.deviceCellWidth/2,ht),this._tmpCtx.bezierCurveTo(me-this._config.deviceCellWidth/2,Ye,me,Ye,me,ht),this._tmpCtx.bezierCurveTo(me,ye,rt,ye,rt,ht),this._tmpCtx.bezierCurveTo(rt,Ye,Ce,Ye,Ce,ht),this._tmpCtx.bezierCurveTo(Ce,ye,Ce+this._config.deviceCellWidth/2,ye,Ce+this._config.deviceCellWidth/2,ht);break;case 4:const dt=St===0?0:St>=we?2*we-St:we-St;St>=we||dt===0?(this._tmpCtx.setLineDash([Math.round(we),Math.round(we)]),this._tmpCtx.moveTo(me+dt,Ve),this._tmpCtx.lineTo(Ce,Ve)):(this._tmpCtx.setLineDash([Math.round(we),Math.round(we)]),this._tmpCtx.moveTo(me,Ve),this._tmpCtx.lineTo(me+dt,Ve),this._tmpCtx.moveTo(me+dt+we,Ve),this._tmpCtx.lineTo(Ce,Ve)),St=(0,l.computeNextVariantOffset)(Ce-me,we,St);break;case 5:const Ke=.6,lt=.3,ue=Ce-me,De=Math.floor(Ke*ue),Fe=Math.floor(lt*ue),Sr=ue-De-Fe;this._tmpCtx.setLineDash([De,Fe,Sr]),this._tmpCtx.moveTo(me,Ve),this._tmpCtx.lineTo(Ce,Ve);break;default:this._tmpCtx.moveTo(me,Ve),this._tmpCtx.lineTo(Ce,Ve)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!He&&this._config.fontSize>=12&&!this._config.allowTransparency&&z!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const tt=this._tmpCtx.measureText(z);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in tt&&tt.actualBoundingBoxDescent>0){this._tmpCtx.save();const me=new Path2D;me.rect(et,Ve-Math.ceil(we/2),this._config.deviceCellWidth*Qe,Je-Ve+Math.ceil(we/2)),this._tmpCtx.clip(me),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=H.css,this._tmpCtx.strokeText(z,ke,ke+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(K){const we=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),We=we%2==1?.5:0;this._tmpCtx.lineWidth=we,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ke,ke+We),this._tmpCtx.lineTo(ke+this._config.deviceCharWidth*Qe,ke+We),this._tmpCtx.stroke()}if(He||this._tmpCtx.fillText(z,ke,ke+this._config.deviceCharHeight),z==="_"&&!this._config.allowTransparency){let we=k(this._tmpCtx.getImageData(ke,ke,this._config.deviceCellWidth,this._config.deviceCellHeight),H,Te,ce);if(we)for(let We=1;We<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=H.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(z,ke,ke+this._config.deviceCharHeight-We),we=k(this._tmpCtx.getImageData(ke,ke,this._config.deviceCellWidth,this._config.deviceCellHeight),H,Te,ce),we);We++);}if(U){const we=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),We=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=we,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ke,ke+Math.floor(this._config.deviceCharHeight/2)-We),this._tmpCtx.lineTo(ke+this._config.deviceCharWidth*Qe,ke+Math.floor(this._config.deviceCharHeight/2)-We),this._tmpCtx.stroke()}this._tmpCtx.restore();const ze=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let ot;if(ot=this._config.allowTransparency?(function(we){for(let We=0;We<we.data.length;We+=4)if(we.data[We+3]>0)return!1;return!0})(ze):k(ze,H,Te,ce),ot)return a;const Oe=this._findGlyphBoundingBox(ze,this._workBoundingBox,X,de,He,ke);let Re,Ie;for(;;){if(this._activePages.length===0){const we=this._createNewPage();Re=we,Ie=we.currentRow,Ie.height=Oe.size.y;break}Re=this._activePages[this._activePages.length-1],Ie=Re.currentRow;for(const we of this._activePages)Oe.size.y<=we.currentRow.height&&(Re=we,Ie=we.currentRow);for(let we=this._activePages.length-1;we>=0;we--)for(const We of this._activePages[we].fixedRows)We.height<=Ie.height&&Oe.size.y<=We.height&&(Re=this._activePages[we],Ie=We);if(Ie.y+Oe.size.y>=Re.canvas.height||Ie.height>Oe.size.y+2){let we=!1;if(Re.currentRow.y+Re.currentRow.height+Oe.size.y>=Re.canvas.height){let We;for(const et of this._activePages)if(et.currentRow.y+et.currentRow.height+Oe.size.y<et.canvas.height){We=et;break}if(We)Re=We;else if(y.maxAtlasPages&&this._pages.length>=y.maxAtlasPages&&Ie.y+Oe.size.y<=Re.canvas.height&&Ie.height>=Oe.size.y&&Ie.x+Oe.size.x<=Re.canvas.width)we=!0;else{const et=this._createNewPage();Re=et,Ie=et.currentRow,Ie.height=Oe.size.y,we=!0}}we||(Re.currentRow.height>0&&Re.fixedRows.push(Re.currentRow),Ie={x:0,y:Re.currentRow.y+Re.currentRow.height,height:Oe.size.y},Re.fixedRows.push(Ie),Re.currentRow={x:0,y:Ie.y+Ie.height,height:0})}if(Ie.x+Oe.size.x<=Re.canvas.width)break;Ie===Re.currentRow?(Ie.x=0,Ie.y+=Ie.height,Ie.height=0):Re.fixedRows.splice(Re.fixedRows.indexOf(Ie),1)}return Oe.texturePage=this._pages.indexOf(Re),Oe.texturePosition.x=Ie.x,Oe.texturePosition.y=Ie.y,Oe.texturePositionClipSpace.x=Ie.x/Re.canvas.width,Oe.texturePositionClipSpace.y=Ie.y/Re.canvas.height,Oe.sizeClipSpace.x/=Re.canvas.width,Oe.sizeClipSpace.y/=Re.canvas.height,Ie.height=Math.max(Ie.height,Oe.size.y),Ie.x+=Oe.size.x,Re.ctx.putImageData(ze,Oe.texturePosition.x-this._workBoundingBox.left,Oe.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Oe.size.x,Oe.size.y),Re.addGlyph(Oe),Re.version++,Oe}_findGlyphBoundingBox(E,T,j,D,B,z){T.top=0;const X=D?this._config.deviceCellHeight:this._tmpCanvas.height,Z=D?this._config.deviceCellWidth:j;let Y=!1;for(let V=0;V<X;V++){for(let I=0;I<Z;I++){const $=V*this._tmpCanvas.width*4+4*I+3;if(E.data[$]!==0){T.top=V,Y=!0;break}}if(Y)break}T.left=0,Y=!1;for(let V=0;V<z+Z;V++){for(let I=0;I<X;I++){const $=I*this._tmpCanvas.width*4+4*V+3;if(E.data[$]!==0){T.left=V,Y=!0;break}}if(Y)break}T.right=Z,Y=!1;for(let V=z+Z-1;V>=z;V--){for(let I=0;I<X;I++){const $=I*this._tmpCanvas.width*4+4*V+3;if(E.data[$]!==0){T.right=V,Y=!0;break}}if(Y)break}T.bottom=X,Y=!1;for(let V=X-1;V>=0;V--){for(let I=0;I<Z;I++){const $=V*this._tmpCanvas.width*4+4*I+3;if(E.data[$]!==0){T.bottom=V,Y=!0;break}}if(Y)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:T.right-T.left+1,y:T.bottom-T.top+1},sizeClipSpace:{x:T.right-T.left+1,y:T.bottom-T.top+1},offset:{x:-T.left+z+(D||B?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-T.top+z+(D||B?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}i.TextureAtlas=y;class L{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(E){this._glyphs.push(E),this._usedPixels+=E.size.x*E.size.y}constructor(E,T,j){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],j)for(const D of j)this._glyphs.push(...D.glyphs),this._usedPixels+=D._usedPixels;this.canvas=A(E,T,T),this.ctx=(0,l.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function k(x,E,T,j){const D=E.rgba>>>24,B=E.rgba>>>16&255,z=E.rgba>>>8&255,X=T.rgba>>>24,Z=T.rgba>>>16&255,Y=T.rgba>>>8&255,V=Math.floor((Math.abs(D-X)+Math.abs(B-Z)+Math.abs(z-Y))/12);let I=!0;for(let $=0;$<x.data.length;$+=4)x.data[$]===D&&x.data[$+1]===B&&x.data[$+2]===z||j&&Math.abs(x.data[$]-D)+Math.abs(x.data[$+1]-B)+Math.abs(x.data[$+2]-z)<V?x.data[$+3]=0:I=!1;return I}function A(x,E,T){const j=x.createElement("canvas");return j.width=E,j.height=T,j}},160:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.contrastRatio=i.toPaddedHex=i.rgba=i.rgb=i.css=i.color=i.channels=i.NULL_COLOR=void 0;let c=0,m=0,g=0,l=0;var v,C,b,f,o;function u(h){const y=h.toString(16);return y.length<2?"0"+y:y}function a(h,y){return h<y?(y+.05)/(h+.05):(h+.05)/(y+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},(function(h){h.toCss=function(y,L,k,A){return A!==void 0?`#${u(y)}${u(L)}${u(k)}${u(A)}`:`#${u(y)}${u(L)}${u(k)}`},h.toRgba=function(y,L,k,A=255){return(y<<24|L<<16|k<<8|A)>>>0},h.toColor=function(y,L,k,A){return{css:h.toCss(y,L,k,A),rgba:h.toRgba(y,L,k,A)}}})(v||(i.channels=v={})),(function(h){function y(L,k){return l=Math.round(255*k),[c,m,g]=o.toChannels(L.rgba),{css:v.toCss(c,m,g,l),rgba:v.toRgba(c,m,g,l)}}h.blend=function(L,k){if(l=(255&k.rgba)/255,l===1)return{css:k.css,rgba:k.rgba};const A=k.rgba>>24&255,x=k.rgba>>16&255,E=k.rgba>>8&255,T=L.rgba>>24&255,j=L.rgba>>16&255,D=L.rgba>>8&255;return c=T+Math.round((A-T)*l),m=j+Math.round((x-j)*l),g=D+Math.round((E-D)*l),{css:v.toCss(c,m,g),rgba:v.toRgba(c,m,g)}},h.isOpaque=function(L){return(255&L.rgba)==255},h.ensureContrastRatio=function(L,k,A){const x=o.ensureContrastRatio(L.rgba,k.rgba,A);if(x)return v.toColor(x>>24&255,x>>16&255,x>>8&255)},h.opaque=function(L){const k=(255|L.rgba)>>>0;return[c,m,g]=o.toChannels(k),{css:v.toCss(c,m,g),rgba:k}},h.opacity=y,h.multiplyOpacity=function(L,k){return l=255&L.rgba,y(L,l*k/255)},h.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(C||(i.color=C={})),(function(h){let y,L;try{const k=document.createElement("canvas");k.width=1,k.height=1;const A=k.getContext("2d",{willReadFrequently:!0});A&&(y=A,y.globalCompositeOperation="copy",L=y.createLinearGradient(0,0,1,1))}catch{}h.toColor=function(k){if(k.match(/#[\da-f]{3,8}/i))switch(k.length){case 4:return c=parseInt(k.slice(1,2).repeat(2),16),m=parseInt(k.slice(2,3).repeat(2),16),g=parseInt(k.slice(3,4).repeat(2),16),v.toColor(c,m,g);case 5:return c=parseInt(k.slice(1,2).repeat(2),16),m=parseInt(k.slice(2,3).repeat(2),16),g=parseInt(k.slice(3,4).repeat(2),16),l=parseInt(k.slice(4,5).repeat(2),16),v.toColor(c,m,g,l);case 7:return{css:k,rgba:(parseInt(k.slice(1),16)<<8|255)>>>0};case 9:return{css:k,rgba:parseInt(k.slice(1),16)>>>0}}const A=k.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(A)return c=parseInt(A[1]),m=parseInt(A[2]),g=parseInt(A[3]),l=Math.round(255*(A[5]===void 0?1:parseFloat(A[5]))),v.toColor(c,m,g,l);if(!y||!L)throw new Error("css.toColor: Unsupported css format");if(y.fillStyle=L,y.fillStyle=k,typeof y.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(y.fillRect(0,0,1,1),[c,m,g,l]=y.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:v.toRgba(c,m,g,l),css:k}}})(b||(i.css=b={})),(function(h){function y(L,k,A){const x=L/255,E=k/255,T=A/255;return .2126*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.7152*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}h.relativeLuminance=function(L){return y(L>>16&255,L>>8&255,255&L)},h.relativeLuminance2=y})(f||(i.rgb=f={})),(function(h){function y(k,A,x){const E=k>>24&255,T=k>>16&255,j=k>>8&255;let D=A>>24&255,B=A>>16&255,z=A>>8&255,X=a(f.relativeLuminance2(D,B,z),f.relativeLuminance2(E,T,j));for(;X<x&&(D>0||B>0||z>0);)D-=Math.max(0,Math.ceil(.1*D)),B-=Math.max(0,Math.ceil(.1*B)),z-=Math.max(0,Math.ceil(.1*z)),X=a(f.relativeLuminance2(D,B,z),f.relativeLuminance2(E,T,j));return(D<<24|B<<16|z<<8|255)>>>0}function L(k,A,x){const E=k>>24&255,T=k>>16&255,j=k>>8&255;let D=A>>24&255,B=A>>16&255,z=A>>8&255,X=a(f.relativeLuminance2(D,B,z),f.relativeLuminance2(E,T,j));for(;X<x&&(D<255||B<255||z<255);)D=Math.min(255,D+Math.ceil(.1*(255-D))),B=Math.min(255,B+Math.ceil(.1*(255-B))),z=Math.min(255,z+Math.ceil(.1*(255-z))),X=a(f.relativeLuminance2(D,B,z),f.relativeLuminance2(E,T,j));return(D<<24|B<<16|z<<8|255)>>>0}h.blend=function(k,A){if(l=(255&A)/255,l===1)return A;const x=A>>24&255,E=A>>16&255,T=A>>8&255,j=k>>24&255,D=k>>16&255,B=k>>8&255;return c=j+Math.round((x-j)*l),m=D+Math.round((E-D)*l),g=B+Math.round((T-B)*l),v.toRgba(c,m,g)},h.ensureContrastRatio=function(k,A,x){const E=f.relativeLuminance(k>>8),T=f.relativeLuminance(A>>8);if(a(E,T)<x){if(T<E){const B=y(k,A,x),z=a(E,f.relativeLuminance(B>>8));if(z<x){const X=L(k,A,x);return z>a(E,f.relativeLuminance(X>>8))?B:X}return B}const j=L(k,A,x),D=a(E,f.relativeLuminance(j>>8));if(D<x){const B=y(k,A,x);return D>a(E,f.relativeLuminance(B>>8))?j:B}return j}},h.reduceLuminance=y,h.increaseLuminance=L,h.toChannels=function(k){return[k>>24&255,k>>16&255,k>>8&255,255&k]}})(o||(i.rgba=o={})),i.toPaddedHex=u,i.contrastRatio=a},345:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let m=0;m<this._listeners.length;m++)if(this._listeners[m]===c)return void this._listeners.splice(m,1)}}})),this._event}fire(c,m){const g=[];for(let l=0;l<this._listeners.length;l++)g.push(this._listeners[l]);for(let l=0;l<g.length;l++)g[l].call(void 0,c,m)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(c,m){return c((g=>m.fire(g)))},i.runAndSubscribe=function(c,m){return m(void 0),c((g=>m(g)))}},859:(N,i)=>{function c(m){for(const g of m)g.dispose();m.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const m of this._disposables)m.dispose();this._disposables.length=0}register(m){return this._disposables.push(m),m}unregister(m){const g=this._disposables.indexOf(m);g!==-1&&this._disposables.splice(g,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(m){var g;this._isDisposed||m===this._value||((g=this._value)==null||g.dispose(),this._value=m)}clear(){this.value=void 0}dispose(){var m;this._isDisposed=!0,(m=this._value)==null||m.dispose(),this._value=void 0}},i.toDisposable=function(m){return{dispose:m}},i.disposeArray=c,i.getDisposeArrayDisposable=function(m){return{dispose:()=>c(m)}}},485:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,l,v){this._data[g]||(this._data[g]={}),this._data[g][l]=v}get(g,l){return this._data[g]?this._data[g][l]:void 0}clear(){this._data={}}}i.TwoKeyMap=c,i.FourKeyMap=class{constructor(){this._data=new c}set(m,g,l,v,C){this._data.get(m,g)||this._data.set(m,g,new c),this._data.get(m,g).set(l,v,C)}get(m,g,l,v){var C;return(C=this._data.get(m,g))==null?void 0:C.get(l,v)}clear(){this._data.clear()}}},399:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isChromeOS=i.isLinux=i.isWindows=i.isIphone=i.isIpad=i.isMac=i.getSafariVersion=i.isSafari=i.isLegacyEdge=i.isFirefox=i.isNode=void 0,i.isNode=typeof process<"u"&&"title"in process;const c=i.isNode?"node":navigator.userAgent,m=i.isNode?"node":navigator.platform;i.isFirefox=c.includes("Firefox"),i.isLegacyEdge=c.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(c),i.getSafariVersion=function(){if(!i.isSafari)return 0;const g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(m),i.isIpad=m==="iPad",i.isIphone=m==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(m),i.isLinux=m.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(c)},385:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;const m=c(399);class g{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),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(C){this._idleCallback=void 0;let b=0,f=0,o=C.timeRemaining(),u=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),f=Math.max(b,f),u=C.timeRemaining(),1.5*f>u)return o-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(o-b))}ms`),void this._start();o=u}this.clear()}}class l extends g{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const b=Date.now()+C;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}i.PriorityTaskQueue=l,i.IdleTaskQueue=!m.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:l,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},147:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new m}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new c;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}i.AttributeData=c;class m{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,v=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=v}clone(){return new m(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=m},782:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;const m=c(133),g=c(855),l=c(147);class v extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const f=new v;return f.setFromCharData(b),f}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,m.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(b[g.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(b[g.CHAR_DATA_CHAR_INDEX].length===2){const o=b[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=o&&o<=56319){const u=b[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=u&&u<=57343?this.content=1024*(o-55296)+u-56320+65536|b[g.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=b[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[g.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=b[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=v},855:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WHITESPACE_CELL_CODE=i.WHITESPACE_CELL_WIDTH=i.WHITESPACE_CELL_CHAR=i.NULL_CELL_CODE=i.NULL_CELL_WIDTH=i.NULL_CELL_CHAR=i.CHAR_DATA_CODE_INDEX=i.CHAR_DATA_WIDTH_INDEX=i.CHAR_DATA_CHAR_INDEX=i.CHAR_DATA_ATTR_INDEX=i.DEFAULT_EXT=i.DEFAULT_ATTR=i.DEFAULT_COLOR=void 0,i.DEFAULT_COLOR=0,i.DEFAULT_ATTR=256|i.DEFAULT_COLOR<<9,i.DEFAULT_EXT=0,i.CHAR_DATA_ATTR_INDEX=0,i.CHAR_DATA_CHAR_INDEX=1,i.CHAR_DATA_WIDTH_INDEX=2,i.CHAR_DATA_CODE_INDEX=3,i.NULL_CELL_CHAR="",i.NULL_CELL_WIDTH=1,i.NULL_CELL_CODE=0,i.WHITESPACE_CELL_CHAR=" ",i.WHITESPACE_CELL_WIDTH=1,i.WHITESPACE_CELL_CODE=32},133:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Utf8ToUtf32=i.StringToUtf32=i.utf32ToString=i.stringFromCodePoint=void 0,i.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},i.utf32ToString=function(c,m=0,g=c.length){let l="";for(let v=m;v<g;++v){let C=c[v];C>65535?(C-=65536,l+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):l+=String.fromCharCode(C)}return l},i.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,m){const g=c.length;if(!g)return 0;let l=0,v=0;if(this._interim){const C=c.charCodeAt(v++);56320<=C&&C<=57343?m[l++]=1024*(this._interim-55296)+C-56320+65536:(m[l++]=this._interim,m[l++]=C),this._interim=0}for(let C=v;C<g;++C){const b=c.charCodeAt(C);if(55296<=b&&b<=56319){if(++C>=g)return this._interim=b,l;const f=c.charCodeAt(C);56320<=f&&f<=57343?m[l++]=1024*(b-55296)+f-56320+65536:(m[l++]=b,m[l++]=f)}else b!==65279&&(m[l++]=b)}return l}},i.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,m){const g=c.length;if(!g)return 0;let l,v,C,b,f=0,o=0,u=0;if(this.interim[0]){let y=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let k,A=0;for(;(k=63&this.interim[++A])&&A<4;)L<<=6,L|=k;const x=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=x-A;for(;u<E;){if(u>=g)return 0;if(k=c[u++],(192&k)!=128){u--,y=!0;break}this.interim[A++]=k,L<<=6,L|=63&k}y||(x===2?L<128?u--:m[f++]=L:x===3?L<2048||L>=55296&&L<=57343||L===65279||(m[f++]=L):L<65536||L>1114111||(m[f++]=L)),this.interim.fill(0)}const a=g-4;let h=u;for(;h<g;){for(;!(!(h<a)||128&(l=c[h])||128&(v=c[h+1])||128&(C=c[h+2])||128&(b=c[h+3]));)m[f++]=l,m[f++]=v,m[f++]=C,m[f++]=b,h+=4;if(l=c[h++],l<128)m[f++]=l;else if((224&l)==192){if(h>=g)return this.interim[0]=l,f;if(v=c[h++],(192&v)!=128){h--;continue}if(o=(31&l)<<6|63&v,o<128){h--;continue}m[f++]=o}else if((240&l)==224){if(h>=g)return this.interim[0]=l,f;if(v=c[h++],(192&v)!=128){h--;continue}if(h>=g)return this.interim[0]=l,this.interim[1]=v,f;if(C=c[h++],(192&C)!=128){h--;continue}if(o=(15&l)<<12|(63&v)<<6|63&C,o<2048||o>=55296&&o<=57343||o===65279)continue;m[f++]=o}else if((248&l)==240){if(h>=g)return this.interim[0]=l,f;if(v=c[h++],(192&v)!=128){h--;continue}if(h>=g)return this.interim[0]=l,this.interim[1]=v,f;if(C=c[h++],(192&C)!=128){h--;continue}if(h>=g)return this.interim[0]=l,this.interim[1]=v,this.interim[2]=C,f;if(b=c[h++],(192&b)!=128){h--;continue}if(o=(7&l)<<18|(63&v)<<12|(63&C)<<6|63&b,o<65536||o>1114111)continue;m[f++]=o}}return f}}},776:function(N,i,c){var m=this&&this.__decorate||function(o,u,a,h){var y,L=arguments.length,k=L<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,a):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,u,a,h);else for(var A=o.length-1;A>=0;A--)(y=o[A])&&(k=(L<3?y(k):L>3?y(u,a,k):y(u,a))||k);return L>3&&k&&Object.defineProperty(u,a,k),k},g=this&&this.__param||function(o,u){return function(a,h){u(a,h,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.traceCall=i.setTraceLogger=i.LogService=void 0;const l=c(859),v=c(97),C={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let b,f=i.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(o){super(),this._optionsService=o,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),b=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(o){for(let u=0;u<o.length;u++)typeof o[u]=="function"&&(o[u]=o[u]())}_log(o,u,a){this._evalLazyOptionalParams(a),o.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+u,...a)}trace(o,...u){var a;this._logLevel<=v.LogLevelEnum.TRACE&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.trace.bind(this._optionsService.options.logger))??console.log,o,u)}debug(o,...u){var a;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.debug.bind(this._optionsService.options.logger))??console.log,o,u)}info(o,...u){var a;this._logLevel<=v.LogLevelEnum.INFO&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.info.bind(this._optionsService.options.logger))??console.info,o,u)}warn(o,...u){var a;this._logLevel<=v.LogLevelEnum.WARN&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.warn.bind(this._optionsService.options.logger))??console.warn,o,u)}error(o,...u){var a;this._logLevel<=v.LogLevelEnum.ERROR&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.error.bind(this._optionsService.options.logger))??console.error,o,u)}};i.LogService=f=m([g(0,v.IOptionsService)],f),i.setTraceLogger=function(o){b=o},i.traceCall=function(o,u,a){if(typeof a.value!="function")throw new Error("not supported");const h=a.value;a.value=function(...y){if(b.logLevel!==v.LogLevelEnum.TRACE)return h.apply(this,y);b.trace(`GlyphRenderer#${h.name}(${y.map((k=>JSON.stringify(k))).join(", ")})`);const L=h.apply(this,y);return b.trace(`GlyphRenderer#${h.name} return`,L),L}}},726:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;const c="di$target",m="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(g){return g[m]||[]},i.createDecorator=function(g){if(i.serviceRegistry.has(g))return i.serviceRegistry.get(g);const l=function(v,C,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,o,u){o[c]===o?o[m].push({id:f,index:u}):(o[m]=[{id:f,index:u}],o[c]=o)})(l,v,b)};return l.toString=()=>g,i.serviceRegistry.set(g,l),l}},97:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IDecorationService=i.IUnicodeService=i.IOscLinkService=i.IOptionsService=i.ILogService=i.LogLevelEnum=i.IInstantiationService=i.ICharsetService=i.ICoreService=i.ICoreMouseService=i.IBufferService=void 0;const m=c(726);var g;i.IBufferService=(0,m.createDecorator)("BufferService"),i.ICoreMouseService=(0,m.createDecorator)("CoreMouseService"),i.ICoreService=(0,m.createDecorator)("CoreService"),i.ICharsetService=(0,m.createDecorator)("CharsetService"),i.IInstantiationService=(0,m.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(g||(i.LogLevelEnum=g={})),i.ILogService=(0,m.createDecorator)("LogService"),i.IOptionsService=(0,m.createDecorator)("OptionsService"),i.IOscLinkService=(0,m.createDecorator)("OscLinkService"),i.IUnicodeService=(0,m.createDecorator)("UnicodeService"),i.IDecorationService=(0,m.createDecorator)("DecorationService")}},S={};function M(N){var i=S[N];if(i!==void 0)return i.exports;var c=S[N]={exports:{}};return p[N].call(c.exports,c,c.exports,M),c.exports}var P={};return(()=>{var N=P;Object.defineProperty(N,"__esModule",{value:!0}),N.WebglAddon=void 0;const i=M(345),c=M(859),m=M(399),g=M(666),l=M(776);class v extends c.Disposable{constructor(b){if(m.isSafari&&(0,m.getSafariVersion)()<16){const f={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",f))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=b,this._onChangeTextureAtlas=this.register(new i.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new i.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new i.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new i.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(b){const f=b._core;if(!b.element)return void this.register(f.onWillOpen((()=>this.activate(b))));this._terminal=b;const o=f.coreService,u=f.optionsService,a=f,h=a._renderService,y=a._characterJoinerService,L=a._charSizeService,k=a._coreBrowserService,A=a._decorationService,x=a._logService,E=a._themeService;(0,l.setTraceLogger)(x),this._renderer=this.register(new g.WebglRenderer(b,y,L,k,o,A,u,E,this._preserveDrawingBuffer)),this.register((0,i.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,i.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,i.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,i.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),h.setRenderer(this._renderer),this.register((0,c.toDisposable)((()=>{const T=this._terminal._core._renderService;T.setRenderer(this._terminal._core._createRenderer()),T.handleResize(b.cols,b.rows)})))}get textureAtlas(){var b;return(b=this._renderer)==null?void 0:b.textureAtlas}clearTextureAtlas(){var b;(b=this._renderer)==null||b.clearTextureAtlas()}}N.WebglAddon=v})(),P})()))})(ya)),ya.exports}var Vg=qg(),Sa={exports:{}},Hh;function Kg(){return Hh||(Hh=1,(function(n,s){(function(p,S){n.exports=S()})(globalThis,(()=>(()=>{var p={4567:function(N,i,c){var m=this&&this.__decorate||function(a,h,y,L){var k,A=arguments.length,x=A<3?h:L===null?L=Object.getOwnPropertyDescriptor(h,y):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,h,y,L);else for(var E=a.length-1;E>=0;E--)(k=a[E])&&(x=(A<3?k(x):A>3?k(h,y,x):k(h,y))||x);return A>3&&x&&Object.defineProperty(h,y,x),x},g=this&&this.__param||function(a,h){return function(y,L){h(y,L,a)}};Object.defineProperty(i,"__esModule",{value:!0}),i.AccessibilityManager=void 0;const l=c(9042),v=c(9924),C=c(844),b=c(4725),f=c(2585),o=c(3656);let u=i.AccessibilityManager=class extends C.Disposable{constructor(a,h,y,L){super(),this._terminal=a,this._coreBrowserService=y,this._renderService=L,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 k=0;k<this._terminal.rows;k++)this._rowElements[k]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[k]);if(this._topBoundaryFocusListener=k=>this._handleBoundaryFocus(k,0),this._bottomBoundaryFocusListener=k=>this._handleBoundaryFocus(k,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 v.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((k=>this._handleResize(k.rows)))),this.register(this._terminal.onRender((k=>this._refreshRows(k.start,k.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((k=>this._handleChar(k)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
104
- `)))),this.register(this._terminal.onA11yTab((k=>this._handleTab(k)))),this.register(this._terminal.onKey((k=>this._handleKey(k.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,o.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,C.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(a){for(let h=0;h<a;h++)this._handleChar(" ")}_handleChar(a){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==a&&(this._charsToAnnounce+=a):this._charsToAnnounce+=a,a===`
105
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=l.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(a){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(a)||this._charsToConsume.push(a)}_refreshRows(a,h){this._liveRegionDebouncer.refresh(a,h,this._terminal.rows)}_renderRows(a,h){const y=this._terminal.buffer,L=y.lines.length.toString();for(let k=a;k<=h;k++){const A=y.lines.get(y.ydisp+k),x=[],E=(A==null?void 0:A.translateToString(!0,void 0,void 0,x))||"",T=(y.ydisp+k+1).toString(),j=this._rowElements[k];j&&(E.length===0?(j.innerText=" ",this._rowColumns.set(j,[0,1])):(j.textContent=E,this._rowColumns.set(j,x)),j.setAttribute("aria-posinset",T),j.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(a,h){const y=a.target,L=this._rowElements[h===0?1:this._rowElements.length-2];if(y.getAttribute("aria-posinset")===(h===0?"1":`${this._terminal.buffer.lines.length}`)||a.relatedTarget!==L)return;let k,A;if(h===0?(k=y,A=this._rowElements.pop(),this._rowContainer.removeChild(A)):(k=this._rowElements.shift(),A=y,this._rowContainer.removeChild(k)),k.removeEventListener("focus",this._topBoundaryFocusListener),A.removeEventListener("focus",this._bottomBoundaryFocusListener),h===0){const x=this._createAccessibilityTreeNode();this._rowElements.unshift(x),this._rowContainer.insertAdjacentElement("afterbegin",x)}else{const x=this._createAccessibilityTreeNode();this._rowElements.push(x),this._rowContainer.appendChild(x)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(h===0?-1:1),this._rowElements[h===0?1:this._rowElements.length-2].focus(),a.preventDefault(),a.stopImmediatePropagation()}_handleSelectionChange(){var E;if(this._rowElements.length===0)return;const a=document.getSelection();if(!a)return;if(a.isCollapsed)return void(this._rowContainer.contains(a.anchorNode)&&this._terminal.clearSelection());if(!a.anchorNode||!a.focusNode)return void console.error("anchorNode and/or focusNode are null");let h={node:a.anchorNode,offset:a.anchorOffset},y={node:a.focusNode,offset:a.focusOffset};if((h.node.compareDocumentPosition(y.node)&Node.DOCUMENT_POSITION_PRECEDING||h.node===y.node&&h.offset>y.offset)&&([h,y]=[y,h]),h.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(h={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(h.node))return;const L=this._rowElements.slice(-1)[0];if(y.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(y={node:L,offset:((E=L.textContent)==null?void 0:E.length)??0}),!this._rowContainer.contains(y.node))return;const k=({node:T,offset:j})=>{const D=T instanceof Text?T.parentNode:T;let B=parseInt(D==null?void 0:D.getAttribute("aria-posinset"),10)-1;if(isNaN(B))return console.warn("row is invalid. Race condition?"),null;const z=this._rowColumns.get(D);if(!z)return console.warn("columns is null. Race condition?"),null;let X=j<z.length?z[j]:z.slice(-1)[0]+1;return X>=this._terminal.cols&&(++B,X=0),{row:B,column:X}},A=k(h),x=k(y);if(A&&x){if(A.row>x.row||A.row===x.row&&A.column>=x.column)throw new Error("invalid range");this._terminal.select(A.column,A.row,(x.row-A.row)*this._terminal.cols-A.column+x.column)}}_handleResize(a){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let h=this._rowContainer.children.length;h<this._terminal.rows;h++)this._rowElements[h]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[h]);for(;this._rowElements.length>a;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const a=this._coreBrowserService.mainDocument.createElement("div");return a.setAttribute("role","listitem"),a.tabIndex=-1,this._refreshRowDimensions(a),a}_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 a=0;a<this._terminal.rows;a++)this._refreshRowDimensions(this._rowElements[a])}}_refreshRowDimensions(a){a.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i.AccessibilityManager=u=m([g(1,f.IInstantiationService),g(2,b.ICoreBrowserService),g(3,b.IRenderService)],u)},3614:(N,i)=>{function c(v){return v.replace(/\r?\n/g,"\r")}function m(v,C){return C?"\x1B[200~"+v+"\x1B[201~":v}function g(v,C,b,f){v=m(v=c(v),b.decPrivateModes.bracketedPasteMode&&f.rawOptions.ignoreBracketedPasteMode!==!0),b.triggerDataEvent(v,!0),C.value=""}function l(v,C,b){const f=b.getBoundingClientRect(),o=v.clientX-f.left-10,u=v.clientY-f.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${o}px`,C.style.top=`${u}px`,C.style.zIndex="1000",C.focus()}Object.defineProperty(i,"__esModule",{value:!0}),i.rightClickHandler=i.moveTextAreaUnderMouseCursor=i.paste=i.handlePasteEvent=i.copyHandler=i.bracketTextForPaste=i.prepareTextForTerminal=void 0,i.prepareTextForTerminal=c,i.bracketTextForPaste=m,i.copyHandler=function(v,C){v.clipboardData&&v.clipboardData.setData("text/plain",C.selectionText),v.preventDefault()},i.handlePasteEvent=function(v,C,b,f){v.stopPropagation(),v.clipboardData&&g(v.clipboardData.getData("text/plain"),C,b,f)},i.paste=g,i.moveTextAreaUnderMouseCursor=l,i.rightClickHandler=function(v,C,b,f,o){l(v,C,b),o&&f.rightClickSelect(v),C.value=f.selectionText,C.select()}},7239:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorContrastCache=void 0;const m=c(1505);i.ColorContrastCache=class{constructor(){this._color=new m.TwoKeyMap,this._css=new m.TwoKeyMap}setCss(g,l,v){this._css.set(g,l,v)}getCss(g,l){return this._css.get(g,l)}setColor(g,l,v){this._color.set(g,l,v)}getColor(g,l){return this._color.get(g,l)}clear(){this._color.clear(),this._css.clear()}}},3656:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(c,m,g,l){c.addEventListener(m,g,l);let v=!1;return{dispose:()=>{v||(v=!0,c.removeEventListener(m,g,l))}}}},3551:function(N,i,c){var m=this&&this.__decorate||function(u,a,h,y){var L,k=arguments.length,A=k<3?a:y===null?y=Object.getOwnPropertyDescriptor(a,h):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(u,a,h,y);else for(var x=u.length-1;x>=0;x--)(L=u[x])&&(A=(k<3?L(A):k>3?L(a,h,A):L(a,h))||A);return k>3&&A&&Object.defineProperty(a,h,A),A},g=this&&this.__param||function(u,a){return function(h,y){a(h,y,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Linkifier=void 0;const l=c(3656),v=c(8460),C=c(844),b=c(2585),f=c(4725);let o=i.Linkifier=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(u,a,h,y,L){super(),this._element=u,this._mouseService=a,this._renderService=h,this._bufferService=y,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.toDisposable)((()=>{var k;this._lastMouseEvent=void 0,(k=this._activeProviderReplies)==null||k.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,l.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,l.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(u){this._lastMouseEvent=u;const a=this._positionFromMouseEvent(u,this._element,this._mouseService);if(!a)return;this._isMouseOut=!1;const h=u.composedPath();for(let y=0;y<h.length;y++){const L=h[y];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&a.x===this._lastBufferCell.x&&a.y===this._lastBufferCell.y||(this._handleHover(a),this._lastBufferCell=a)}_handleHover(u){if(this._activeLine!==u.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(u,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,u)||(this._clearCurrentLink(),this._askForLink(u,!0))}_askForLink(u,a){var y,L;this._activeProviderReplies&&a||((y=this._activeProviderReplies)==null||y.forEach((k=>{k==null||k.forEach((A=>{A.link.dispose&&A.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=u.y);let h=!1;for(const[k,A]of this._linkProviderService.linkProviders.entries())a?(L=this._activeProviderReplies)!=null&&L.get(k)&&(h=this._checkLinkProviderResult(k,u,h)):A.provideLinks(u.y,(x=>{var T,j;if(this._isMouseOut)return;const E=x==null?void 0:x.map((D=>({link:D})));(T=this._activeProviderReplies)==null||T.set(k,E),h=this._checkLinkProviderResult(k,u,h),((j=this._activeProviderReplies)==null?void 0:j.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(u.y,this._activeProviderReplies)}))}_removeIntersectingLinks(u,a){const h=new Set;for(let y=0;y<a.size;y++){const L=a.get(y);if(L)for(let k=0;k<L.length;k++){const A=L[k],x=A.link.range.start.y<u?0:A.link.range.start.x,E=A.link.range.end.y>u?this._bufferService.cols:A.link.range.end.x;for(let T=x;T<=E;T++){if(h.has(T)){L.splice(k--,1);break}h.add(T)}}}}_checkLinkProviderResult(u,a,h){var k;if(!this._activeProviderReplies)return h;const y=this._activeProviderReplies.get(u);let L=!1;for(let A=0;A<u;A++)this._activeProviderReplies.has(A)&&!this._activeProviderReplies.get(A)||(L=!0);if(!L&&y){const A=y.find((x=>this._linkAtPosition(x.link,a)));A&&(h=!0,this._handleNewLink(A))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!h)for(let A=0;A<this._activeProviderReplies.size;A++){const x=(k=this._activeProviderReplies.get(A))==null?void 0:k.find((E=>this._linkAtPosition(E.link,a)));if(x){h=!0,this._handleNewLink(x);break}}return h}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(u){if(!this._currentLink)return;const a=this._positionFromMouseEvent(u,this._element,this._mouseService);a&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,a)&&this._currentLink.link.activate(u,this._currentLink.link.text)}_clearCurrentLink(u,a){this._currentLink&&this._lastMouseEvent&&(!u||!a||this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=a)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(u){if(!this._lastMouseEvent)return;const a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._linkAtPosition(u.link,a)&&(this._currentLink=u,this._currentLink.state={decorations:{underline:u.link.decorations===void 0||u.link.decorations.underline,pointerCursor:u.link.decorations===void 0||u.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,u.link,this._lastMouseEvent),u.link.decorations={},Object.defineProperties(u.link.decorations,{pointerCursor:{get:()=>{var h,y;return(y=(h=this._currentLink)==null?void 0:h.state)==null?void 0:y.decorations.pointerCursor},set:h=>{var y;(y=this._currentLink)!=null&&y.state&&this._currentLink.state.decorations.pointerCursor!==h&&(this._currentLink.state.decorations.pointerCursor=h,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",h))}},underline:{get:()=>{var h,y;return(y=(h=this._currentLink)==null?void 0:h.state)==null?void 0:y.decorations.underline},set:h=>{var y,L,k;(y=this._currentLink)!=null&&y.state&&((k=(L=this._currentLink)==null?void 0:L.state)==null?void 0:k.decorations.underline)!==h&&(this._currentLink.state.decorations.underline=h,this._currentLink.state.isHovered&&this._fireUnderlineEvent(u.link,h))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((h=>{if(!this._currentLink)return;const y=h.start===0?0:h.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+h.end;if(this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(y,L),this._lastMouseEvent)){const k=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);k&&this._askForLink(k,!1)}}))))}_linkHover(u,a,h){var y;(y=this._currentLink)!=null&&y.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!0),this._currentLink.state.decorations.pointerCursor&&u.classList.add("xterm-cursor-pointer")),a.hover&&a.hover(h,a.text)}_fireUnderlineEvent(u,a){const h=u.range,y=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(h.start.x-1,h.start.y-y-1,h.end.x,h.end.y-y-1,void 0);(a?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(u,a,h){var y;(y=this._currentLink)!=null&&y.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!1),this._currentLink.state.decorations.pointerCursor&&u.classList.remove("xterm-cursor-pointer")),a.leave&&a.leave(h,a.text)}_linkAtPosition(u,a){const h=u.range.start.y*this._bufferService.cols+u.range.start.x,y=u.range.end.y*this._bufferService.cols+u.range.end.x,L=a.y*this._bufferService.cols+a.x;return h<=L&&L<=y}_positionFromMouseEvent(u,a,h){const y=h.getCoords(u,a,this._bufferService.cols,this._bufferService.rows);if(y)return{x:y[0],y:y[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(u,a,h,y,L){return{x1:u,y1:a,x2:h,y2:y,cols:this._bufferService.cols,fg:L}}};i.Linkifier=o=m([g(1,f.IMouseService),g(2,f.IRenderService),g(3,b.IBufferService),g(4,f.ILinkProviderService)],o)},9042:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tooMuchOutput=i.promptLabel=void 0,i.promptLabel="Terminal input",i.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(N,i,c){var m=this&&this.__decorate||function(f,o,u,a){var h,y=arguments.length,L=y<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,u):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(f,o,u,a);else for(var k=f.length-1;k>=0;k--)(h=f[k])&&(L=(y<3?h(L):y>3?h(o,u,L):h(o,u))||L);return y>3&&L&&Object.defineProperty(o,u,L),L},g=this&&this.__param||function(f,o){return function(u,a){o(u,a,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkProvider=void 0;const l=c(511),v=c(2585);let C=i.OscLinkProvider=class{constructor(f,o,u){this._bufferService=f,this._optionsService=o,this._oscLinkService=u}provideLinks(f,o){var E;const u=this._bufferService.buffer.lines.get(f-1);if(!u)return void o(void 0);const a=[],h=this._optionsService.rawOptions.linkHandler,y=new l.CellData,L=u.getTrimmedLength();let k=-1,A=-1,x=!1;for(let T=0;T<L;T++)if(A!==-1||u.hasContent(T)){if(u.loadCell(T,y),y.hasExtendedAttrs()&&y.extended.urlId){if(A===-1){A=T,k=y.extended.urlId;continue}x=y.extended.urlId!==k}else A!==-1&&(x=!0);if(x||A!==-1&&T===L-1){const j=(E=this._oscLinkService.getLinkData(k))==null?void 0:E.uri;if(j){const D={start:{x:A+1,y:f},end:{x:T+(x||T!==L-1?0:1),y:f}};let B=!1;if(!(h!=null&&h.allowNonHttpProtocols))try{const z=new URL(j);["http:","https:"].includes(z.protocol)||(B=!0)}catch{B=!0}B||a.push({text:j,range:D,activate:(z,X)=>h?h.activate(z,X,D):b(0,X),hover:(z,X)=>{var Z;return(Z=h==null?void 0:h.hover)==null?void 0:Z.call(h,z,X,D)},leave:(z,X)=>{var Z;return(Z=h==null?void 0:h.leave)==null?void 0:Z.call(h,z,X,D)}})}x=!1,y.hasExtendedAttrs()&&y.extended.urlId?(A=T,k=y.extended.urlId):(A=-1,k=-1)}}o(a)}};function b(f,o){if(confirm(`Do you want to navigate to ${o}?
106
-
107
- WARNING: This link could potentially be dangerous`)){const u=window.open();if(u){try{u.opener=null}catch{}u.location.href=o}else console.warn("Opening link blocked as opener could not be cleared")}}i.OscLinkProvider=C=m([g(0,v.IBufferService),g(1,v.IOptionsService),g(2,v.IOscLinkService)],C)},6193:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderDebouncer=void 0,i.RenderDebouncer=class{constructor(c,m){this._renderCallback=c,this._coreBrowserService=m,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,m,g){this._rowCount=g,c=c!==void 0?c:0,m=m!==void 0?m:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,m):m,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),m=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,m),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Terminal=void 0;const m=c(3614),g=c(3656),l=c(3551),v=c(9042),C=c(3730),b=c(1680),f=c(3107),o=c(5744),u=c(2950),a=c(1296),h=c(428),y=c(4269),L=c(5114),k=c(8934),A=c(3230),x=c(9312),E=c(4725),T=c(6731),j=c(8055),D=c(8969),B=c(8460),z=c(844),X=c(6114),Z=c(8437),Y=c(2584),V=c(7399),I=c(5941),$=c(9074),O=c(2585),U=c(5435),K=c(4567),ee=c(779);class ne extends D.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(q={}){super(q),this.browser=X,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new z.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($.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ee.LinkProviderService),this._instantiationService.setService(E.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((H,re)=>this.refresh(H,re)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((H=>this._reportWindowsOptions(H)))),this.register(this._inputHandler.onColor((H=>this._handleColorEvent(H)))),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((H=>this._afterResize(H.cols,H.rows)))),this.register((0,z.toDisposable)((()=>{var H,re;this._customKeyEventHandler=void 0,(re=(H=this.element)==null?void 0:H.parentNode)==null||re.removeChild(this.element)})))}_handleColorEvent(q){if(this._themeService)for(const H of q){let re,te="";switch(H.index){case 256:re="foreground",te="10";break;case 257:re="background",te="11";break;case 258:re="cursor",te="12";break;default:re="ansi",te="4;"+H.index}switch(H.type){case 0:const he=j.color.toColorRGB(re==="ansi"?this._themeService.colors.ansi[H.index]:this._themeService.colors[re]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${te};${(0,I.toRgbString)(he)}${Y.C1_ESCAPED.ST}`);break;case 1:if(re==="ansi")this._themeService.modifyColors((de=>de.ansi[H.index]=j.channels.toColor(...H.color)));else{const de=re;this._themeService.modifyColors((Te=>Te[de]=j.channels.toColor(...H.color)))}break;case 2:this._themeService.restoreColor(H.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(q){q?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(K.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var q;return(q=this.textarea)==null?void 0:q.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 q=this.buffer.ybase+this.buffer.y,H=this.buffer.lines.get(q);if(!H)return;const re=Math.min(this.buffer.x,this.cols-1),te=this._renderService.dimensions.css.cell.height,he=H.getWidth(re),de=this._renderService.dimensions.css.cell.width*he,Te=this.buffer.y*this._renderService.dimensions.css.cell.height,ke=re*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ke+"px",this.textarea.style.top=Te+"px",this.textarea.style.width=de+"px",this.textarea.style.height=te+"px",this.textarea.style.lineHeight=te+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(H=>{this.hasSelection()&&(0,m.copyHandler)(H,this._selectionService)})));const q=H=>(0,m.handlePasteEvent)(H,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",q)),this.register((0,g.addDisposableDomListener)(this.element,"paste",q)),X.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(H=>{H.button===2&&(0,m.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(H=>{(0,m.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),X.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(H=>{H.button===1&&(0,m.moveTextAreaUnderMouseCursor)(H,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(q=>this._keyUp(q)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(q=>this._keyDown(q)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(q=>this._keyPress(q)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(q=>this._compositionHelper.compositionupdate(q)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(q=>this._inputEvent(q)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(q){var re;if(!q)throw new Error("Terminal requires a parent element.");if(q.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((re=this.element)==null?void 0:re.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=q.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"),q.appendChild(this.element);const H=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),H.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,g.addDisposableDomListener)(this.screenElement,"mousemove",(te=>this.updateCursorStyle(te)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),H.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),X.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(L.CoreBrowserService,this.textarea,q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(E.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(te=>this._handleTextAreaFocus(te)))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(h.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(E.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(E.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(y.CharacterJoinerService),this._instantiationService.setService(E.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(A.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(E.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(u.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(k.MouseService),this._instantiationService.setService(E.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(l.Linkifier,this.screenElement)),this.element.appendChild(H);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(b.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(x.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(E.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,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(f.BufferDecorationRenderer,this.screenElement)),this.register((0,g.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(K.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(te=>this._handleScreenReaderModeOptionChange(te)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(te=>{!this._overviewRulerRenderer&&te&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(a.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const q=this,H=this.element;function re(de){const Te=q._mouseService.getMouseReportCoords(de,q.screenElement);if(!Te)return!1;let ke,He;switch(de.overrideType||de.type){case"mousemove":He=32,de.buttons===void 0?(ke=3,de.button!==void 0&&(ke=de.button<3?de.button:3)):ke=1&de.buttons?0:4&de.buttons?1:2&de.buttons?2:3;break;case"mouseup":He=0,ke=de.button<3?de.button:3;break;case"mousedown":He=1,ke=de.button<3?de.button:3;break;case"wheel":if(q._customWheelEventHandler&&q._customWheelEventHandler(de)===!1||q.viewport.getLinesScrolled(de)===0)return!1;He=de.deltaY<0?0:1,ke=4;break;default:return!1}return!(He===void 0||ke===void 0||ke>4)&&q.coreMouseService.triggerMouseEvent({col:Te.col,row:Te.row,x:Te.x,y:Te.y,button:ke,action:He,ctrl:de.ctrlKey,alt:de.altKey,shift:de.shiftKey})}const te={mouseup:null,wheel:null,mousedrag:null,mousemove:null},he={mouseup:de=>(re(de),de.buttons||(this._document.removeEventListener("mouseup",te.mouseup),te.mousedrag&&this._document.removeEventListener("mousemove",te.mousedrag)),this.cancel(de)),wheel:de=>(re(de),this.cancel(de,!0)),mousedrag:de=>{de.buttons&&re(de)},mousemove:de=>{de.buttons||re(de)}};this.register(this.coreMouseService.onProtocolChange((de=>{de?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(de)),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&de?te.mousemove||(H.addEventListener("mousemove",he.mousemove),te.mousemove=he.mousemove):(H.removeEventListener("mousemove",te.mousemove),te.mousemove=null),16&de?te.wheel||(H.addEventListener("wheel",he.wheel,{passive:!1}),te.wheel=he.wheel):(H.removeEventListener("wheel",te.wheel),te.wheel=null),2&de?te.mouseup||(te.mouseup=he.mouseup):(this._document.removeEventListener("mouseup",te.mouseup),te.mouseup=null),4&de?te.mousedrag||(te.mousedrag=he.mousedrag):(this._document.removeEventListener("mousemove",te.mousedrag),te.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(H,"mousedown",(de=>{if(de.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(de))return re(de),te.mouseup&&this._document.addEventListener("mouseup",te.mouseup),te.mousedrag&&this._document.addEventListener("mousemove",te.mousedrag),this.cancel(de)}))),this.register((0,g.addDisposableDomListener)(H,"wheel",(de=>{if(!te.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(de)===!1)return!1;if(!this.buffer.hasScrollback){const Te=this.viewport.getLinesScrolled(de);if(Te===0)return;const ke=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(de.deltaY<0?"A":"B");let He="";for(let Qe=0;Qe<Math.abs(Te);Qe++)He+=ke;return this.coreService.triggerDataEvent(He,!0),this.cancel(de,!0)}return this.viewport.handleWheel(de)?this.cancel(de):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(H,"touchstart",(de=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(de),this.cancel(de)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(H,"touchmove",(de=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(de)?void 0:this.cancel(de)}),{passive:!1}))}refresh(q,H){var re;(re=this._renderService)==null||re.refreshRows(q,H)}updateCursorStyle(q){var H;(H=this._selectionService)!=null&&H.shouldColumnSelect(q)?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(q,H,re=0){var te;re===1?(super.scrollLines(q,H,re),this.refresh(0,this.rows-1)):(te=this.viewport)==null||te.scrollLines(q)}paste(q){(0,m.paste)(q,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(q){this._customKeyEventHandler=q}attachCustomWheelEventHandler(q){this._customWheelEventHandler=q}registerLinkProvider(q){return this._linkProviderService.registerLinkProvider(q)}registerCharacterJoiner(q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const H=this._characterJoinerService.register(q);return this.refresh(0,this.rows-1),H}deregisterCharacterJoiner(q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(q)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(q){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+q)}registerDecoration(q){return this._decorationService.registerDecoration(q)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(q,H,re){this._selectionService.setSelection(q,H,re)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var q;(q=this._selectionService)==null||q.clearSelection()}selectAll(){var q;(q=this._selectionService)==null||q.selectAll()}selectLines(q,H){var re;(re=this._selectionService)==null||re.selectLines(q,H)}_keyDown(q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(q)===!1)return!1;const H=this.browser.isMac&&this.options.macOptionIsMeta&&q.altKey;if(!H&&!this._compositionHelper.keydown(q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;H||q.key!=="Dead"&&q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const re=(0,V.evaluateKeyboardEvent)(q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(q),re.type===3||re.type===2){const te=this.rows-1;return this.scrollLines(re.type===2?-te:te),this.cancel(q,!0)}return re.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,q)||(re.cancel&&this.cancel(q,!0),!re.key||!!(q.key&&!q.ctrlKey&&!q.altKey&&!q.metaKey&&q.key.length===1&&q.key.charCodeAt(0)>=65&&q.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(re.key!==Y.C0.ETX&&re.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:re.key,domEvent:q}),this._showCursor(),this.coreService.triggerDataEvent(re.key,!0),!this.optionsService.rawOptions.screenReaderMode||q.altKey||q.ctrlKey?this.cancel(q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(q,H){const re=q.isMac&&!this.options.macOptionIsMeta&&H.altKey&&!H.ctrlKey&&!H.metaKey||q.isWindows&&H.altKey&&H.ctrlKey&&!H.metaKey||q.isWindows&&H.getModifierState("AltGraph");return H.type==="keypress"?re:re&&(!H.keyCode||H.keyCode>47)}_keyUp(q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(q)===!1||((function(H){return H.keyCode===16||H.keyCode===17||H.keyCode===18})(q)||this.focus(),this.updateCursorStyle(q),this._keyPressHandled=!1)}_keyPress(q){let H;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(q)===!1)return!1;if(this.cancel(q),q.charCode)H=q.charCode;else if(q.which===null||q.which===void 0)H=q.keyCode;else{if(q.which===0||q.charCode===0)return!1;H=q.which}return!(!H||(q.altKey||q.ctrlKey||q.metaKey)&&!this._isThirdLevelShift(this.browser,q)||(H=String.fromCharCode(H),this._onKey.fire({key:H,domEvent:q}),this._showCursor(),this.coreService.triggerDataEvent(H,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(q){if(q.data&&q.inputType==="insertText"&&(!q.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const H=q.data;return this.coreService.triggerDataEvent(H,!0),this.cancel(q),!0}return!1}resize(q,H){q!==this.cols||H!==this.rows?super.resize(q,H):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(q,H){var re,te;(re=this._charSizeService)==null||re.measure(),(te=this.viewport)==null||te.syncScrollArea(!0)}clear(){var q;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 H=1;H<this.rows;H++)this.buffer.lines.push(this.buffer.getBlankLine(Z.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(q=this.viewport)==null||q.reset(),this.refresh(0,this.rows-1)}}reset(){var H,re;this.options.rows=this.rows,this.options.cols=this.cols;const q=this._customKeyEventHandler;this._setup(),super.reset(),(H=this._selectionService)==null||H.reset(),this._decorationService.reset(),(re=this.viewport)==null||re.reset(),this._customKeyEventHandler=q,this.refresh(0,this.rows-1)}clearTextureAtlas(){var q;(q=this._renderService)==null||q.clearTextureAtlas()}_reportFocus(){var q;(q=this.element)!=null&&q.classList.contains("focus")?this.coreService.triggerDataEvent(Y.C0.ESC+"[I"):this.coreService.triggerDataEvent(Y.C0.ESC+"[O")}_reportWindowsOptions(q){if(this._renderService)switch(q){case U.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const H=this._renderService.dimensions.css.canvas.width.toFixed(0),re=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${re};${H}t`);break;case U.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const te=this._renderService.dimensions.css.cell.width.toFixed(0),he=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[6;${he};${te}t`)}}cancel(q,H){if(this.options.cancelEvents||H)return q.preventDefault(),q.stopPropagation(),!1}}i.Terminal=ne},9924:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TimeBasedDebouncer=void 0,i.TimeBasedDebouncer=class{constructor(c,m=1e3){this._renderCallback=c,this._debounceThresholdMS=m,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,m,g){this._rowCount=g,c=c!==void 0?c:0,m=m!==void 0?m:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,m):m;const l=Date.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=l-this._lastRefreshMs,C=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),C)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),m=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,m)}}},1680:function(N,i,c){var m=this&&this.__decorate||function(u,a,h,y){var L,k=arguments.length,A=k<3?a:y===null?y=Object.getOwnPropertyDescriptor(a,h):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(u,a,h,y);else for(var x=u.length-1;x>=0;x--)(L=u[x])&&(A=(k<3?L(A):k>3?L(a,h,A):L(a,h))||A);return k>3&&A&&Object.defineProperty(a,h,A),A},g=this&&this.__param||function(u,a){return function(h,y){a(h,y,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Viewport=void 0;const l=c(3656),v=c(4725),C=c(8460),b=c(844),f=c(2585);let o=i.Viewport=class extends b.Disposable{constructor(u,a,h,y,L,k,A,x){super(),this._viewportElement=u,this._scrollArea=a,this._bufferService=h,this._optionsService=y,this._charSizeService=L,this._renderService=k,this._coreBrowserService=A,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 C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((E=>this._activeBuffer=E.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((E=>this._renderDimensions=E))),this._handleThemeChange(x.colors),this.register(x.onChangeColors((E=>this._handleThemeChange(E)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(u){this._viewportElement.style.backgroundColor=u.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(u){if(u)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const a=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==a&&(this._lastRecordedBufferHeight=a,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const u=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==u&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=u),this._refreshAnimationFrame=null}syncScrollArea(u=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(u);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(u)}_handleScroll(u){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const a=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const u=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(u*(this._smoothScrollState.target-this._smoothScrollState.origin)),u<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(u,a){const h=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(a<0&&this._viewportElement.scrollTop!==0||a>0&&h<this._lastRecordedBufferHeight)||(u.cancelable&&u.preventDefault(),!1)}handleWheel(u){const a=this._getPixelsScrolled(u);return a!==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+a:this._smoothScrollState.target+=a,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=a,this._bubbleScroll(u,a))}scrollLines(u){if(u!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const a=u*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+a,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:u,suppressScrollEvent:!1})}_getPixelsScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let a=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_LINE?a*=this._currentRowHeight:u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._currentRowHeight*this._bufferService.rows),a}getBufferElements(u,a){var x;let h,y="";const L=[],k=a??this._bufferService.buffer.lines.length,A=this._bufferService.buffer.lines;for(let E=u;E<k;E++){const T=A.get(E);if(!T)continue;const j=(x=A.get(E+1))==null?void 0:x.isWrapped;if(y+=T.translateToString(!j),!j||E===A.length-1){const D=document.createElement("div");D.textContent=y,L.push(D),y.length>0&&(h=D),y=""}}return{bufferElements:L,cursorElement:h}}getLinesScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let a=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=this._currentRowHeight+0,this._wheelPartialScroll+=a,a=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._bufferService.rows),a}_applyScrollModifier(u,a){const h=this._optionsService.rawOptions.fastScrollModifier;return h==="alt"&&a.altKey||h==="ctrl"&&a.ctrlKey||h==="shift"&&a.shiftKey?u*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:u*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(u){this._lastTouchY=u.touches[0].pageY}handleTouchMove(u){const a=this._lastTouchY-u.touches[0].pageY;return this._lastTouchY=u.touches[0].pageY,a!==0&&(this._viewportElement.scrollTop+=a,this._bubbleScroll(u,a))}};i.Viewport=o=m([g(2,f.IBufferService),g(3,f.IOptionsService),g(4,v.ICharSizeService),g(5,v.IRenderService),g(6,v.ICoreBrowserService),g(7,v.IThemeService)],o)},3107:function(N,i,c){var m=this&&this.__decorate||function(f,o,u,a){var h,y=arguments.length,L=y<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,u):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(f,o,u,a);else for(var k=f.length-1;k>=0;k--)(h=f[k])&&(L=(y<3?h(L):y>3?h(o,u,L):h(o,u))||L);return y>3&&L&&Object.defineProperty(o,u,L),L},g=this&&this.__param||function(f,o){return function(u,a){o(u,a,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferDecorationRenderer=void 0;const l=c(4725),v=c(844),C=c(2585);let b=i.BufferDecorationRenderer=class extends v.Disposable{constructor(f,o,u,a,h){super(),this._screenElement=f,this._bufferService=o,this._coreBrowserService=u,this._decorationService=a,this._renderService=h,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((y=>this._removeDecoration(y)))),this.register((0,v.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 f of this._decorationService.decorations)this._renderDecoration(f);this._dimensionsChanged=!1}_renderDecoration(f){this._refreshStyle(f),this._dimensionsChanged&&this._refreshXPosition(f)}_createElement(f){var a;const o=this._coreBrowserService.mainDocument.createElement("div");o.classList.add("xterm-decoration"),o.classList.toggle("xterm-decoration-top-layer",((a=f==null?void 0:f.options)==null?void 0:a.layer)==="top"),o.style.width=`${Math.round((f.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,o.style.height=(f.options.height||1)*this._renderService.dimensions.css.cell.height+"px",o.style.top=(f.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",o.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const u=f.options.x??0;return u&&u>this._bufferService.cols&&(o.style.display="none"),this._refreshXPosition(f,o),o}_refreshStyle(f){const o=f.marker.line-this._bufferService.buffers.active.ydisp;if(o<0||o>=this._bufferService.rows)f.element&&(f.element.style.display="none",f.onRenderEmitter.fire(f.element));else{let u=this._decorationElements.get(f);u||(u=this._createElement(f),f.element=u,this._decorationElements.set(f,u),this._container.appendChild(u),f.onDispose((()=>{this._decorationElements.delete(f),u.remove()}))),u.style.top=o*this._renderService.dimensions.css.cell.height+"px",u.style.display=this._altBufferIsActive?"none":"block",f.onRenderEmitter.fire(u)}}_refreshXPosition(f,o=f.element){if(!o)return;const u=f.options.x??0;(f.options.anchor||"left")==="right"?o.style.right=u?u*this._renderService.dimensions.css.cell.width+"px":"":o.style.left=u?u*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(f){var o;(o=this._decorationElements.get(f))==null||o.remove(),this._decorationElements.delete(f),f.dispose()}};i.BufferDecorationRenderer=b=m([g(1,C.IBufferService),g(2,l.ICoreBrowserService),g(3,C.IDecorationService),g(4,l.IRenderService)],b)},5871:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorZoneStore=void 0,i.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const m of this._zones)if(m.color===c.options.overviewRulerOptions.color&&m.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(m,c.marker.line))return;if(this._lineAdjacentToZone(m,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(m,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,m){return m>=c.startBufferLine&&m<=c.endBufferLine}_lineAdjacentToZone(c,m,g){return m>=c.startBufferLine-this._linePadding[g||"full"]&&m<=c.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(c,m){c.startBufferLine=Math.min(c.startBufferLine,m),c.endBufferLine=Math.max(c.endBufferLine,m)}}},5744:function(N,i,c){var m=this&&this.__decorate||function(h,y,L,k){var A,x=arguments.length,E=x<3?y:k===null?k=Object.getOwnPropertyDescriptor(y,L):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(h,y,L,k);else for(var T=h.length-1;T>=0;T--)(A=h[T])&&(E=(x<3?A(E):x>3?A(y,L,E):A(y,L))||E);return x>3&&E&&Object.defineProperty(y,L,E),E},g=this&&this.__param||function(h,y){return function(L,k){y(L,k,h)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OverviewRulerRenderer=void 0;const l=c(5871),v=c(4725),C=c(844),b=c(2585),f={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0};let a=i.OverviewRulerRenderer=class extends C.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(h,y,L,k,A,x,E){var j;super(),this._viewportElement=h,this._screenElement=y,this._bufferService=L,this._decorationService=k,this._renderService=A,this._optionsService=x,this._coreBrowserService=E,this._colorZoneStore=new l.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(j=this._viewportElement.parentElement)==null||j.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,C.toDisposable)((()=>{var D;(D=this._canvas)==null||D.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const h=Math.floor(this._canvas.width/3),y=Math.ceil(this._canvas.width/3);o.full=this._canvas.width,o.left=h,o.center=y,o.right=h,this._refreshDrawHeightConstants(),u.full=0,u.left=0,u.center=o.left,u.right=o.left+o.center}_refreshDrawHeightConstants(){f.full=Math.round(2*this._coreBrowserService.dpr);const h=this._canvas.height/this._bufferService.buffer.lines.length,y=Math.round(Math.max(Math.min(h,12),6)*this._coreBrowserService.dpr);f.left=y,f.center=y,f.right=y}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.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 y of this._decorationService.decorations)this._colorZoneStore.addDecoration(y);this._ctx.lineWidth=1;const h=this._colorZoneStore.zones;for(const y of h)y.position!=="full"&&this._renderColorZone(y);for(const y of h)y.position==="full"&&this._renderColorZone(y);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(h){this._ctx.fillStyle=h.color,this._ctx.fillRect(u[h.position||"full"],Math.round((this._canvas.height-1)*(h.startBufferLine/this._bufferService.buffers.active.lines.length)-f[h.position||"full"]/2),o[h.position||"full"],Math.round((this._canvas.height-1)*((h.endBufferLine-h.startBufferLine)/this._bufferService.buffers.active.lines.length)+f[h.position||"full"]))}_queueRefresh(h,y){this._shouldUpdateDimensions=h||this._shouldUpdateDimensions,this._shouldUpdateAnchor=y||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};i.OverviewRulerRenderer=a=m([g(2,b.IBufferService),g(3,b.IDecorationService),g(4,v.IRenderService),g(5,b.IOptionsService),g(6,v.ICoreBrowserService)],a)},2950:function(N,i,c){var m=this&&this.__decorate||function(f,o,u,a){var h,y=arguments.length,L=y<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,u):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(f,o,u,a);else for(var k=f.length-1;k>=0;k--)(h=f[k])&&(L=(y<3?h(L):y>3?h(o,u,L):h(o,u))||L);return y>3&&L&&Object.defineProperty(o,u,L),L},g=this&&this.__param||function(f,o){return function(u,a){o(u,a,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CompositionHelper=void 0;const l=c(4725),v=c(2585),C=c(2584);let b=i.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(f,o,u,a,h,y){this._textarea=f,this._compositionView=o,this._bufferService=u,this._optionsService=a,this._coreService=h,this._renderService=y,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(f){this._compositionView.textContent=f.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(f){if(this._isComposing||this._isSendingComposition){if(f.keyCode===229||f.keyCode===16||f.keyCode===17||f.keyCode===18)return!1;this._finalizeComposition(!1)}return f.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(f){if(this._compositionView.classList.remove("active"),this._isComposing=!1,f){const o={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let u;this._isSendingComposition=!1,o.start+=this._dataAlreadySent.length,u=this._isComposing?this._textarea.value.substring(o.start,o.end):this._textarea.value.substring(o.start),u.length>0&&this._coreService.triggerDataEvent(u,!0)}}),0)}else{this._isSendingComposition=!1;const o=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(o,!0)}}_handleAnyTextareaChanges(){const f=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const o=this._textarea.value,u=o.replace(f,"");this._dataAlreadySent=u,o.length>f.length?this._coreService.triggerDataEvent(u,!0):o.length<f.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):o.length===f.length&&o!==f&&this._coreService.triggerDataEvent(o,!0)}}),0)}updateCompositionElements(f){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const o=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),u=this._renderService.dimensions.css.cell.height,a=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,h=o*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=h+"px",this._compositionView.style.top=a+"px",this._compositionView.style.height=u+"px",this._compositionView.style.lineHeight=u+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const y=this._compositionView.getBoundingClientRect();this._textarea.style.left=h+"px",this._textarea.style.top=a+"px",this._textarea.style.width=Math.max(y.width,1)+"px",this._textarea.style.height=Math.max(y.height,1)+"px",this._textarea.style.lineHeight=y.height+"px"}f||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};i.CompositionHelper=b=m([g(2,v.IBufferService),g(3,v.IOptionsService),g(4,v.ICoreService),g(5,l.IRenderService)],b)},9806:(N,i)=>{function c(m,g,l){const v=l.getBoundingClientRect(),C=m.getComputedStyle(l),b=parseInt(C.getPropertyValue("padding-left")),f=parseInt(C.getPropertyValue("padding-top"));return[g.clientX-v.left-b,g.clientY-v.top-f]}Object.defineProperty(i,"__esModule",{value:!0}),i.getCoords=i.getCoordsRelativeToElement=void 0,i.getCoordsRelativeToElement=c,i.getCoords=function(m,g,l,v,C,b,f,o,u){if(!b)return;const a=c(m,g,l);return a?(a[0]=Math.ceil((a[0]+(u?f/2:0))/f),a[1]=Math.ceil(a[1]/o),a[0]=Math.min(Math.max(a[0],1),v+(u?1:0)),a[1]=Math.min(Math.max(a[1],1),C),a):void 0}},9504:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.moveToCellSequence=void 0;const m=c(2584);function g(o,u,a,h){const y=o-l(o,a),L=u-l(u,a),k=Math.abs(y-L)-(function(A,x,E){let T=0;const j=A-l(A,E),D=x-l(x,E);for(let B=0;B<Math.abs(j-D);B++){const z=v(A,x)==="A"?-1:1,X=E.buffer.lines.get(j+z*B);X!=null&&X.isWrapped&&T++}return T})(o,u,a);return f(k,b(v(o,u),h))}function l(o,u){let a=0,h=u.buffer.lines.get(o),y=h==null?void 0:h.isWrapped;for(;y&&o>=0&&o<u.rows;)a++,h=u.buffer.lines.get(--o),y=h==null?void 0:h.isWrapped;return a}function v(o,u){return o>u?"A":"B"}function C(o,u,a,h,y,L){let k=o,A=u,x="";for(;k!==a||A!==h;)k+=y?1:-1,y&&k>L.cols-1?(x+=L.buffer.translateBufferLineToString(A,!1,o,k),k=0,o=0,A++):!y&&k<0&&(x+=L.buffer.translateBufferLineToString(A,!1,0,o+1),k=L.cols-1,o=k,A--);return x+L.buffer.translateBufferLineToString(A,!1,o,k)}function b(o,u){const a=u?"O":"[";return m.C0.ESC+a+o}function f(o,u){o=Math.floor(o);let a="";for(let h=0;h<o;h++)a+=u;return a}i.moveToCellSequence=function(o,u,a,h){const y=a.buffer.x,L=a.buffer.y;if(!a.buffer.hasScrollback)return(function(x,E,T,j,D,B){return g(E,j,D,B).length===0?"":f(C(x,E,x,E-l(E,D),!1,D).length,b("D",B))})(y,L,0,u,a,h)+g(L,u,a,h)+(function(x,E,T,j,D,B){let z;z=g(E,j,D,B).length>0?j-l(j,D):E;const X=j,Z=(function(Y,V,I,$,O,U){let K;return K=g(I,$,O,U).length>0?$-l($,O):V,Y<I&&K<=$||Y>=I&&K<$?"C":"D"})(x,E,T,j,D,B);return f(C(x,z,T,X,Z==="C",D).length,b(Z,B))})(y,L,o,u,a,h);let k;if(L===u)return k=y>o?"D":"C",f(Math.abs(y-o),b(k,h));k=L>u?"D":"C";const A=Math.abs(L-u);return f((function(x,E){return E.cols-x})(L>u?o:y,a)+(A-1)*a.cols+1+((L>u?y:o)-1),b(k,h))}},1296:function(N,i,c){var m=this&&this.__decorate||function(B,z,X,Z){var Y,V=arguments.length,I=V<3?z:Z===null?Z=Object.getOwnPropertyDescriptor(z,X):Z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(B,z,X,Z);else for(var $=B.length-1;$>=0;$--)(Y=B[$])&&(I=(V<3?Y(I):V>3?Y(z,X,I):Y(z,X))||I);return V>3&&I&&Object.defineProperty(z,X,I),I},g=this&&this.__param||function(B,z){return function(X,Z){z(X,Z,B)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRenderer=void 0;const l=c(3787),v=c(2550),C=c(2223),b=c(6171),f=c(6052),o=c(4725),u=c(8055),a=c(8460),h=c(844),y=c(2585),L="xterm-dom-renderer-owner-",k="xterm-rows",A="xterm-fg-",x="xterm-bg-",E="xterm-focus",T="xterm-selection";let j=1,D=i.DomRenderer=class extends h.Disposable{constructor(B,z,X,Z,Y,V,I,$,O,U,K,ee,ne){super(),this._terminal=B,this._document=z,this._element=X,this._screenElement=Z,this._viewportElement=Y,this._helperContainer=V,this._linkifier2=I,this._charSizeService=O,this._optionsService=U,this._bufferService=K,this._coreBrowserService=ee,this._themeService=ne,this._terminalClass=j++,this._rowElements=[],this._selectionRenderModel=(0,f.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new a.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(k),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(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,b.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((Q=>this._injectCss(Q)))),this._injectCss(this._themeService.colors),this._rowFactory=$.createInstance(l.DomRendererRowFactory,document),this._element.classList.add(L+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((Q=>this._handleLinkHover(Q)))),this.register(this._linkifier2.onHideLinkUnderline((Q=>this._handleLinkLeave(Q)))),this.register((0,h.toDisposable)((()=>{this._element.classList.remove(L+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new v.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 X of this._rowElements)X.style.width=`${this.dimensions.css.canvas.width}px`,X.style.height=`${this.dimensions.css.cell.height}px`,X.style.lineHeight=`${this.dimensions.css.cell.height}px`,X.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const z=`${this._terminalSelector} .${k} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=z,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 z=`${this._terminalSelector} .${k} { color: ${B.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;z+=`${this._terminalSelector} .${k} .xterm-dim { color: ${u.color.multiplyOpacity(B.foreground,.5).css};}`,z+=`${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 X=`blink_underline_${this._terminalClass}`,Z=`blink_bar_${this._terminalClass}`,Y=`blink_block_${this._terminalClass}`;z+=`@keyframes ${X} { 50% { border-bottom-style: hidden; }}`,z+=`@keyframes ${Z} { 50% { box-shadow: none; }}`,z+=`@keyframes ${Y} { 0% { background-color: ${B.cursor.css}; color: ${B.cursorAccent.css}; } 50% { background-color: inherit; color: ${B.cursor.css}; }}`,z+=`${this._terminalSelector} .${k}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${k}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${Z} 1s step-end infinite;}${this._terminalSelector} .${k}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block { background-color: ${B.cursor.css}; color: ${B.cursorAccent.css};}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${B.cursor.css} !important; color: ${B.cursorAccent.css} !important;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${B.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${B.cursor.css} inset;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${B.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,z+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${B.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${B.selectionInactiveBackgroundOpaque.css};}`;for(const[V,I]of B.ansi.entries())z+=`${this._terminalSelector} .${A}${V} { color: ${I.css}; }${this._terminalSelector} .${A}${V}.xterm-dim { color: ${u.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${x}${V} { background-color: ${I.css}; }`;z+=`${this._terminalSelector} .${A}${C.INVERTED_DEFAULT_COLOR} { color: ${u.color.opaque(B.background).css}; }${this._terminalSelector} .${A}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${u.color.multiplyOpacity(u.color.opaque(B.background),.5).css}; }${this._terminalSelector} .${x}${C.INVERTED_DEFAULT_COLOR} { background-color: ${B.foreground.css}; }`,this._themeStyleElement.textContent=z}_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,z){for(let X=this._rowElements.length;X<=z;X++){const Z=this._document.createElement("div");this._rowContainer.appendChild(Z),this._rowElements.push(Z)}for(;this._rowElements.length>z;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(B,z){this._refreshRowElements(B,z),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(E),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(E),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(B,z,X){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(B,z,X),this.renderRows(0,this._bufferService.rows-1),!B||!z)return;this._selectionRenderModel.update(this._terminal,B,z,X);const Z=this._selectionRenderModel.viewportStartRow,Y=this._selectionRenderModel.viewportEndRow,V=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(V>=this._bufferService.rows||I<0)return;const $=this._document.createDocumentFragment();if(X){const O=B[0]>z[0];$.appendChild(this._createSelectionElement(V,O?z[0]:B[0],O?B[0]:z[0],I-V+1))}else{const O=Z===V?B[0]:0,U=V===Y?z[0]:this._bufferService.cols;$.appendChild(this._createSelectionElement(V,O,U));const K=I-V-1;if($.appendChild(this._createSelectionElement(V+1,0,this._bufferService.cols,K)),V!==I){const ee=Y===I?z[0]:this._bufferService.cols;$.appendChild(this._createSelectionElement(I,0,ee))}}this._selectionContainer.appendChild($)}_createSelectionElement(B,z,X,Z=1){const Y=this._document.createElement("div"),V=z*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(X-z);return V+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-V),Y.style.height=Z*this.dimensions.css.cell.height+"px",Y.style.top=B*this.dimensions.css.cell.height+"px",Y.style.left=`${V}px`,Y.style.width=`${I}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,z){const X=this._bufferService.buffer,Z=X.ybase+X.y,Y=Math.min(X.x,this._bufferService.cols-1),V=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,$=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=B;O<=z;O++){const U=O+X.ydisp,K=this._rowElements[O],ee=X.lines.get(U);if(!K||!ee)break;K.replaceChildren(...this._rowFactory.createRow(ee,U,U===Z,I,$,Y,V,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${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,z,X,Z,Y,V){X<0&&(B=0),Z<0&&(z=0);const I=this._bufferService.rows-1;X=Math.max(Math.min(X,I),0),Z=Math.max(Math.min(Z,I),0),Y=Math.min(Y,this._bufferService.cols);const $=this._bufferService.buffer,O=$.ybase+$.y,U=Math.min($.x,Y-1),K=this._optionsService.rawOptions.cursorBlink,ee=this._optionsService.rawOptions.cursorStyle,ne=this._optionsService.rawOptions.cursorInactiveStyle;for(let Q=X;Q<=Z;++Q){const q=Q+$.ydisp,H=this._rowElements[Q],re=$.lines.get(q);if(!H||!re)break;H.replaceChildren(...this._rowFactory.createRow(re,q,q===O,ee,ne,U,K,this.dimensions.css.cell.width,this._widthCache,V?Q===X?B:0:-1,V?(Q===Z?z:Y)-1:-1))}}};i.DomRenderer=D=m([g(7,y.IInstantiationService),g(8,o.ICharSizeService),g(9,y.IOptionsService),g(10,y.IBufferService),g(11,o.ICoreBrowserService),g(12,o.IThemeService)],D)},3787:function(N,i,c){var m=this&&this.__decorate||function(k,A,x,E){var T,j=arguments.length,D=j<3?A:E===null?E=Object.getOwnPropertyDescriptor(A,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(k,A,x,E);else for(var B=k.length-1;B>=0;B--)(T=k[B])&&(D=(j<3?T(D):j>3?T(A,x,D):T(A,x))||D);return j>3&&D&&Object.defineProperty(A,x,D),D},g=this&&this.__param||function(k,A){return function(x,E){A(x,E,k)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRendererRowFactory=void 0;const l=c(2223),v=c(643),C=c(511),b=c(2585),f=c(8055),o=c(4725),u=c(4269),a=c(6171),h=c(3734);let y=i.DomRendererRowFactory=class{constructor(k,A,x,E,T,j,D){this._document=k,this._characterJoinerService=A,this._optionsService=x,this._coreBrowserService=E,this._coreService=T,this._decorationService=j,this._themeService=D,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(k,A,x){this._selectionStart=k,this._selectionEnd=A,this._columnSelectMode=x}createRow(k,A,x,E,T,j,D,B,z,X,Z){const Y=[],V=this._characterJoinerService.getJoinedCharacters(A),I=this._themeService.colors;let $,O=k.getNoBgTrimmedLength();x&&O<j+1&&(O=j+1);let U=0,K="",ee=0,ne=0,Q=0,q=!1,H=0,re=!1,te=0;const he=[],de=X!==-1&&Z!==-1;for(let Te=0;Te<O;Te++){k.loadCell(Te,this._workCell);let ke=this._workCell.getWidth();if(ke===0)continue;let He=!1,Qe=Te,ce=this._workCell;if(V.length>0&&Te===V[0][0]){He=!0;const Ce=V.shift();ce=new u.JoinedCellData(this._workCell,k.translateToString(!0,Ce[0],Ce[1]),Ce[1]-Ce[0]),Qe=Ce[1]-1,ke=ce.getWidth()}const ze=this._isCellInSelection(Te,A),ot=x&&Te===j,Oe=de&&Te>=X&&Te<=Z;let Re=!1;this._decorationService.forEachDecorationAtCell(Te,A,void 0,(Ce=>{Re=!0}));let Ie=ce.getChars()||v.WHITESPACE_CELL_CHAR;if(Ie===" "&&(ce.isUnderline()||ce.isOverline())&&(Ie=" "),te=ke*B-z.get(Ie,ce.isBold(),ce.isItalic()),$){if(U&&(ze&&re||!ze&&!re&&ce.bg===ee)&&(ze&&re&&I.selectionForeground||ce.fg===ne)&&ce.extended.ext===Q&&Oe===q&&te===H&&!ot&&!He&&!Re){ce.isInvisible()?K+=v.WHITESPACE_CELL_CHAR:K+=Ie,U++;continue}U&&($.textContent=K),$=this._document.createElement("span"),U=0,K=""}else $=this._document.createElement("span");if(ee=ce.bg,ne=ce.fg,Q=ce.extended.ext,q=Oe,H=te,re=ze,He&&j>=Te&&j<=Qe&&(j=Te),!this._coreService.isCursorHidden&&ot&&this._coreService.isCursorInitialized){if(he.push("xterm-cursor"),this._coreBrowserService.isFocused)D&&he.push("xterm-cursor-blink"),he.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":he.push("xterm-cursor-outline");break;case"block":he.push("xterm-cursor-block");break;case"bar":he.push("xterm-cursor-bar");break;case"underline":he.push("xterm-cursor-underline")}}if(ce.isBold()&&he.push("xterm-bold"),ce.isItalic()&&he.push("xterm-italic"),ce.isDim()&&he.push("xterm-dim"),K=ce.isInvisible()?v.WHITESPACE_CELL_CHAR:ce.getChars()||v.WHITESPACE_CELL_CHAR,ce.isUnderline()&&(he.push(`xterm-underline-${ce.extended.underlineStyle}`),K===" "&&(K=" "),!ce.isUnderlineColorDefault()))if(ce.isUnderlineColorRGB())$.style.textDecorationColor=`rgb(${h.AttributeData.toColorRGB(ce.getUnderlineColor()).join(",")})`;else{let Ce=ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ce.isBold()&&Ce<8&&(Ce+=8),$.style.textDecorationColor=I.ansi[Ce].css}ce.isOverline()&&(he.push("xterm-overline"),K===" "&&(K=" ")),ce.isStrikethrough()&&he.push("xterm-strikethrough"),Oe&&($.style.textDecoration="underline");let we=ce.getFgColor(),We=ce.getFgColorMode(),et=ce.getBgColor(),Ve=ce.getBgColorMode();const ht=!!ce.isInverse();if(ht){const Ce=we;we=et,et=Ce;const rt=We;We=Ve,Ve=rt}let Je,St,tt,me=!1;switch(this._decorationService.forEachDecorationAtCell(Te,A,void 0,(Ce=>{Ce.options.layer!=="top"&&me||(Ce.backgroundColorRGB&&(Ve=50331648,et=Ce.backgroundColorRGB.rgba>>8&16777215,Je=Ce.backgroundColorRGB),Ce.foregroundColorRGB&&(We=50331648,we=Ce.foregroundColorRGB.rgba>>8&16777215,St=Ce.foregroundColorRGB),me=Ce.options.layer==="top")})),!me&&ze&&(Je=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,et=Je.rgba>>8&16777215,Ve=50331648,me=!0,I.selectionForeground&&(We=50331648,we=I.selectionForeground.rgba>>8&16777215,St=I.selectionForeground)),me&&he.push("xterm-decoration-top"),Ve){case 16777216:case 33554432:tt=I.ansi[et],he.push(`xterm-bg-${et}`);break;case 50331648:tt=f.channels.toColor(et>>16,et>>8&255,255&et),this._addStyle($,`background-color:#${L((et>>>0).toString(16),"0",6)}`);break;default:ht?(tt=I.foreground,he.push(`xterm-bg-${l.INVERTED_DEFAULT_COLOR}`)):tt=I.background}switch(Je||ce.isDim()&&(Je=f.color.multiplyOpacity(tt,.5)),We){case 16777216:case 33554432:ce.isBold()&&we<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(we+=8),this._applyMinimumContrast($,tt,I.ansi[we],ce,Je,void 0)||he.push(`xterm-fg-${we}`);break;case 50331648:const Ce=f.channels.toColor(we>>16&255,we>>8&255,255&we);this._applyMinimumContrast($,tt,Ce,ce,Je,St)||this._addStyle($,`color:#${L(we.toString(16),"0",6)}`);break;default:this._applyMinimumContrast($,tt,I.foreground,ce,Je,St)||ht&&he.push(`xterm-fg-${l.INVERTED_DEFAULT_COLOR}`)}he.length&&($.className=he.join(" "),he.length=0),ot||He||Re?$.textContent=K:U++,te!==this.defaultSpacing&&($.style.letterSpacing=`${te}px`),Y.push($),Te=Qe}return $&&U&&($.textContent=K),Y}_applyMinimumContrast(k,A,x,E,T,j){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,a.treatGlyphAsBackgroundColor)(E.getCode()))return!1;const D=this._getContrastCache(E);let B;if(T||j||(B=D.getColor(A.rgba,x.rgba)),B===void 0){const z=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);B=f.color.ensureContrastRatio(T||A,j||x,z),D.setColor((T||A).rgba,(j||x).rgba,B??null)}return!!B&&(this._addStyle(k,`color:${B.css}`),!0)}_getContrastCache(k){return k.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(k,A){k.setAttribute("style",`${k.getAttribute("style")||""}${A};`)}_isCellInSelection(k,A){const x=this._selectionStart,E=this._selectionEnd;return!(!x||!E)&&(this._columnSelectMode?x[0]<=E[0]?k>=x[0]&&A>=x[1]&&k<E[0]&&A<=E[1]:k<x[0]&&A>=x[1]&&k>=E[0]&&A<=E[1]:A>x[1]&&A<E[1]||x[1]===E[1]&&A===x[1]&&k>=x[0]&&k<E[0]||x[1]<E[1]&&A===E[1]&&k<E[0]||x[1]<E[1]&&A===x[1]&&k>=x[0])}};function L(k,A,x){for(;k.length<x;)k=A+k;return k}i.DomRendererRowFactory=y=m([g(1,o.ICharacterJoinerService),g(2,b.IOptionsService),g(3,o.ICoreBrowserService),g(4,b.ICoreService),g(5,b.IDecorationService),g(6,o.IThemeService)],y)},2550:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WidthCache=void 0,i.WidthCache=class{constructor(c,m){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const g=c.createElement("span");g.classList.add("xterm-char-measure-element");const l=c.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";const v=c.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontStyle="italic";const C=c.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontWeight="bold",C.style.fontStyle="italic",this._measureElements=[g,l,v,C],this._container.appendChild(g),this._container.appendChild(l),this._container.appendChild(v),this._container.appendChild(C),m.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,m,g,l){c===this._font&&m===this._fontSize&&g===this._weight&&l===this._weightBold||(this._font=c,this._fontSize=m,this._weight=g,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(c,m,g){let l=0;if(!m&&!g&&c.length===1&&(l=c.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];const b=this._measure(c,0);return b>0&&(this._flat[l]=b),b}let v=c;m&&(v+="B"),g&&(v+="I");let C=this._holey.get(v);if(C===void 0){let b=0;m&&(b|=1),g&&(b|=2),C=this._measure(c,b),C>0&&this._holey.set(v,C)}return C}_measure(c,m){const g=this._measureElements[m];return g.textContent=c.repeat(32),g.offsetWidth/32}}},2223:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;const m=c(6114);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=m.isFirefox||m.isLegacyEdge?"bottom":"ideographic"},6171:(N,i)=>{function c(g){return 57508<=g&&g<=57558}function m(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(i,"__esModule",{value:!0}),i.computeNextVariantOffset=i.createRenderDimensions=i.treatGlyphAsBackgroundColor=i.allowRescaling=i.isEmoji=i.isRestrictedPowerlineGlyph=i.isPowerlineGlyph=i.throwIfFalsy=void 0,i.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},i.isPowerlineGlyph=c,i.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},i.isEmoji=m,i.allowRescaling=function(g,l,v,C){return l===1&&v>Math.ceil(1.5*C)&&g!==void 0&&g>255&&!m(g)&&!c(g)&&!(function(b){return 57344<=b&&b<=63743})(g)},i.treatGlyphAsBackgroundColor=function(g){return c(g)||(function(l){return 9472<=l&&l<=9631})(g)},i.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}}}},i.computeNextVariantOffset=function(g,l,v=0){return(g-(2*Math.round(l)-v))%(2*Math.round(l))}},6052:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(g,l,v,C=!1){if(this.selectionStart=l,this.selectionEnd=v,!l||!v||l[0]===v[0]&&l[1]===v[1])return void this.clear();const b=g.buffers.active.ydisp,f=l[1]-b,o=v[1]-b,u=Math.max(f,0),a=Math.min(o,g.rows-1);u>=g.rows||a<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=f,this.viewportEndRow=o,this.viewportCappedStartRow=u,this.viewportCappedEndRow=a,this.startCol=l[0],this.endCol=v[0])}isCellSelected(g,l,v){return!!this.hasSelection&&(v-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&v>=this.viewportCappedStartRow&&l<this.endCol&&v<=this.viewportCappedEndRow:l<this.startCol&&v>=this.viewportCappedStartRow&&l>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&l>=this.startCol)}}i.createSelectionRenderModel=function(){return new c}},456:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionModel=void 0,i.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,m=this.selectionEnd;return!(!c||!m)&&(c[1]>m[1]||c[1]===m[1]&&c[0]>m[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(N,i,c){var m=this&&this.__decorate||function(a,h,y,L){var k,A=arguments.length,x=A<3?h:L===null?L=Object.getOwnPropertyDescriptor(h,y):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,h,y,L);else for(var E=a.length-1;E>=0;E--)(k=a[E])&&(x=(A<3?k(x):A>3?k(h,y,x):k(h,y))||x);return A>3&&x&&Object.defineProperty(h,y,x),x},g=this&&this.__param||function(a,h){return function(y,L){h(y,L,a)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharSizeService=void 0;const l=c(2585),v=c(8460),C=c(844);let b=i.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(a,h,y){super(),this._optionsService=y,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new u(this._optionsService))}catch{this._measureStrategy=this.register(new o(a,h,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const a=this._measureStrategy.measure();a.width===this.width&&a.height===this.height||(this.width=a.width,this.height=a.height,this._onCharSizeChange.fire())}};i.CharSizeService=b=m([g(2,l.IOptionsService)],b);class f extends C.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(h,y){h!==void 0&&h>0&&y!==void 0&&y>0&&(this._result.width=h,this._result.height=y)}}class o extends f{constructor(h,y,L){super(),this._document=h,this._parentElement=y,this._optionsService=L,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class u extends f{constructor(h){super(),this._optionsService=h,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const y=this._ctx.measureText("W");if(!("width"in y&&"fontBoundingBoxAscent"in y&&"fontBoundingBoxDescent"in y))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const h=this._ctx.measureText("W");return this._validateAndSet(h.width,h.fontBoundingBoxAscent+h.fontBoundingBoxDescent),this._result}}},4269:function(N,i,c){var m=this&&this.__decorate||function(u,a,h,y){var L,k=arguments.length,A=k<3?a:y===null?y=Object.getOwnPropertyDescriptor(a,h):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(u,a,h,y);else for(var x=u.length-1;x>=0;x--)(L=u[x])&&(A=(k<3?L(A):k>3?L(a,h,A):L(a,h))||A);return k>3&&A&&Object.defineProperty(a,h,A),A},g=this&&this.__param||function(u,a){return function(h,y){a(h,y,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharacterJoinerService=i.JoinedCellData=void 0;const l=c(3734),v=c(643),C=c(511),b=c(2585);class f extends l.AttributeData{constructor(a,h,y){super(),this.content=0,this.combinedData="",this.fg=a.fg,this.bg=a.bg,this.combinedData=h,this._width=y}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(a){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.JoinedCellData=f;let o=i.CharacterJoinerService=class qd{constructor(a){this._bufferService=a,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(a){const h={id:this._nextCharacterJoinerId++,handler:a};return this._characterJoiners.push(h),h.id}deregister(a){for(let h=0;h<this._characterJoiners.length;h++)if(this._characterJoiners[h].id===a)return this._characterJoiners.splice(h,1),!0;return!1}getJoinedCharacters(a){if(this._characterJoiners.length===0)return[];const h=this._bufferService.buffer.lines.get(a);if(!h||h.length===0)return[];const y=[],L=h.translateToString(!0);let k=0,A=0,x=0,E=h.getFg(0),T=h.getBg(0);for(let j=0;j<h.getTrimmedLength();j++)if(h.loadCell(j,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==T){if(j-k>1){const D=this._getJoinedRanges(L,x,A,h,k);for(let B=0;B<D.length;B++)y.push(D[B])}k=j,x=A,E=this._workCell.fg,T=this._workCell.bg}A+=this._workCell.getChars().length||v.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-k>1){const j=this._getJoinedRanges(L,x,A,h,k);for(let D=0;D<j.length;D++)y.push(j[D])}return y}_getJoinedRanges(a,h,y,L,k){const A=a.substring(h,y);let x=[];try{x=this._characterJoiners[0].handler(A)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const T=this._characterJoiners[E].handler(A);for(let j=0;j<T.length;j++)qd._mergeRanges(x,T[j])}catch(T){console.error(T)}return this._stringRangesToCellRanges(x,L,k),x}_stringRangesToCellRanges(a,h,y){let L=0,k=!1,A=0,x=a[L];if(x){for(let E=y;E<this._bufferService.cols;E++){const T=h.getWidth(E),j=h.getString(E).length||v.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!k&&x[0]<=A&&(x[0]=E,k=!0),x[1]<=A){if(x[1]=E,x=a[++L],!x)break;x[0]<=A?(x[0]=E,k=!0):k=!1}A+=j}}x&&(x[1]=this._bufferService.cols)}}static _mergeRanges(a,h){let y=!1;for(let L=0;L<a.length;L++){const k=a[L];if(y){if(h[1]<=k[0])return a[L-1][1]=h[1],a;if(h[1]<=k[1])return a[L-1][1]=Math.max(h[1],k[1]),a.splice(L,1),a;a.splice(L,1),L--}else{if(h[1]<=k[0])return a.splice(L,0,h),a;if(h[1]<=k[1])return k[0]=Math.min(h[0],k[0]),a;h[0]<k[1]&&(k[0]=Math.min(h[0],k[0]),y=!0)}}return y?a[a.length-1][1]=h[1]:a.push(h),a}};i.CharacterJoinerService=o=m([g(0,b.IBufferService)],o)},5114:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreBrowserService=void 0;const m=c(844),g=c(8460),l=c(3656);class v extends m.Disposable{constructor(f,o,u){super(),this._textarea=f,this._window=o,this.mainDocument=u,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new C(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((a=>this._screenDprMonitor.setWindow(a)))),this.register((0,g.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(f){this._window!==f&&(this._window=f,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}}i.CoreBrowserService=v;class C extends m.Disposable{constructor(f){super(),this._parentWindow=f,this._windowResizeListener=this.register(new m.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,m.toDisposable)((()=>this.clearListener())))}setWindow(f){this._parentWindow=f,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,l.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var f;this._outerListener&&((f=this._resolutionMediaMatchList)==null||f.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:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkProviderService=void 0;const m=c(844);class g extends m.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,m.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(v){return this.linkProviders.push(v),{dispose:()=>{const C=this.linkProviders.indexOf(v);C!==-1&&this.linkProviders.splice(C,1)}}}}i.LinkProviderService=g},8934:function(N,i,c){var m=this&&this.__decorate||function(b,f,o,u){var a,h=arguments.length,y=h<3?f:u===null?u=Object.getOwnPropertyDescriptor(f,o):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(b,f,o,u);else for(var L=b.length-1;L>=0;L--)(a=b[L])&&(y=(h<3?a(y):h>3?a(f,o,y):a(f,o))||y);return h>3&&y&&Object.defineProperty(f,o,y),y},g=this&&this.__param||function(b,f){return function(o,u){f(o,u,b)}};Object.defineProperty(i,"__esModule",{value:!0}),i.MouseService=void 0;const l=c(4725),v=c(9806);let C=i.MouseService=class{constructor(b,f){this._renderService=b,this._charSizeService=f}getCoords(b,f,o,u,a){return(0,v.getCoords)(window,b,f,o,u,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(b,f){const o=(0,v.getCoordsRelativeToElement)(window,b,f);if(this._charSizeService.hasValidSize)return o[0]=Math.min(Math.max(o[0],0),this._renderService.dimensions.css.canvas.width-1),o[1]=Math.min(Math.max(o[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(o[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(o[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(o[0]),y:Math.floor(o[1])}}};i.MouseService=C=m([g(0,l.IRenderService),g(1,l.ICharSizeService)],C)},3230:function(N,i,c){var m=this&&this.__decorate||function(a,h,y,L){var k,A=arguments.length,x=A<3?h:L===null?L=Object.getOwnPropertyDescriptor(h,y):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,h,y,L);else for(var E=a.length-1;E>=0;E--)(k=a[E])&&(x=(A<3?k(x):A>3?k(h,y,x):k(h,y))||x);return A>3&&x&&Object.defineProperty(h,y,x),x},g=this&&this.__param||function(a,h){return function(y,L){h(y,L,a)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RenderService=void 0;const l=c(6193),v=c(4725),C=c(8460),b=c(844),f=c(7226),o=c(2585);let u=i.RenderService=class extends b.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(a,h,y,L,k,A,x,E){super(),this._rowCount=a,this._charSizeService=L,this._renderer=this.register(new b.MutableDisposable),this._pausedResizeTask=new f.DebouncedIdleTask,this._observerDisposable=this.register(new b.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 C.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new C.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new C.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer(((T,j)=>this._renderRows(T,j)),x),this.register(this._renderDebouncer),this.register(x.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(A.onResize((()=>this._fullRefresh()))),this.register(A.buffers.onBufferActivate((()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()}))),this.register(y.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(k.onDecorationRegistered((()=>this._fullRefresh()))),this.register(k.onDecorationRemoved((()=>this._fullRefresh()))),this.register(y.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(A.cols,A.rows),this._fullRefresh()}))),this.register(y.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(A.buffer.y,A.buffer.y,!0)))),this.register(E.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(x.window,h),this.register(x.onWindowChange((T=>this._registerIntersectionObserver(T,h))))}_registerIntersectionObserver(a,h){if("IntersectionObserver"in a){const y=new a.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});y.observe(h),this._observerDisposable.value=(0,b.toDisposable)((()=>y.disconnect()))}}_handleIntersectionChange(a){this._isPaused=a.isIntersecting===void 0?a.intersectionRatio===0:!a.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(a,h,y=!1){this._isPaused?this._needsFullRefresh=!0:(y||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(a,h,this._rowCount))}_renderRows(a,h){this._renderer.value&&(a=Math.min(a,this._rowCount-1),h=Math.min(h,this._rowCount-1),this._renderer.value.renderRows(a,h),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:a,end:h}),this._onRender.fire({start:a,end:h}),this._isNextRenderRedrawOnly=!0)}resize(a,h){this._rowCount=h,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(a){this._renderer.value=a,this._renderer.value&&(this._renderer.value.onRequestRedraw((h=>this.refreshRows(h.start,h.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(a){return this._renderDebouncer.addRefreshCallback(a)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var a,h;this._renderer.value&&((h=(a=this._renderer.value).clearTextureAtlas)==null||h.call(a),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(a,h){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var y;return(y=this._renderer.value)==null?void 0:y.handleResize(a,h)})):this._renderer.value.handleResize(a,h),this._fullRefresh())}handleCharSizeChanged(){var a;(a=this._renderer.value)==null||a.handleCharSizeChanged()}handleBlur(){var a;(a=this._renderer.value)==null||a.handleBlur()}handleFocus(){var a;(a=this._renderer.value)==null||a.handleFocus()}handleSelectionChanged(a,h,y){var L;this._selectionState.start=a,this._selectionState.end=h,this._selectionState.columnSelectMode=y,(L=this._renderer.value)==null||L.handleSelectionChanged(a,h,y)}handleCursorMove(){var a;(a=this._renderer.value)==null||a.handleCursorMove()}clear(){var a;(a=this._renderer.value)==null||a.clear()}};i.RenderService=u=m([g(2,o.IOptionsService),g(3,v.ICharSizeService),g(4,o.IDecorationService),g(5,o.IBufferService),g(6,v.ICoreBrowserService),g(7,v.IThemeService)],u)},9312:function(N,i,c){var m=this&&this.__decorate||function(x,E,T,j){var D,B=arguments.length,z=B<3?E:j===null?j=Object.getOwnPropertyDescriptor(E,T):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(x,E,T,j);else for(var X=x.length-1;X>=0;X--)(D=x[X])&&(z=(B<3?D(z):B>3?D(E,T,z):D(E,T))||z);return B>3&&z&&Object.defineProperty(E,T,z),z},g=this&&this.__param||function(x,E){return function(T,j){E(T,j,x)}};Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionService=void 0;const l=c(9806),v=c(9504),C=c(456),b=c(4725),f=c(8460),o=c(844),u=c(6114),a=c(4841),h=c(511),y=c(2585),L=" ",k=new RegExp(L,"g");let A=i.SelectionService=class extends o.Disposable{constructor(x,E,T,j,D,B,z,X,Z){super(),this._element=x,this._screenElement=E,this._linkifier=T,this._bufferService=j,this._coreService=D,this._mouseService=B,this._optionsService=z,this._renderService=X,this._coreBrowserService=Z,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new h.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new f.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new f.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=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 C.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,o.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 x=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!(!x||!E||x[0]===E[0]&&x[1]===E[1])}get selectionText(){const x=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;if(!x||!E)return"";const T=this._bufferService.buffer,j=[];if(this._activeSelectionMode===3){if(x[0]===E[0])return"";const D=x[0]<E[0]?x[0]:E[0],B=x[0]<E[0]?E[0]:x[0];for(let z=x[1];z<=E[1];z++){const X=T.translateBufferLineToString(z,!0,D,B);j.push(X)}}else{const D=x[1]===E[1]?E[0]:void 0;j.push(T.translateBufferLineToString(x[1],!0,x[0],D));for(let B=x[1]+1;B<=E[1]-1;B++){const z=T.lines.get(B),X=T.translateBufferLineToString(B,!0);z!=null&&z.isWrapped?j[j.length-1]+=X:j.push(X)}if(x[1]!==E[1]){const B=T.lines.get(E[1]),z=T.translateBufferLineToString(E[1],!0,0,E[0]);B&&B.isWrapped?j[j.length-1]+=z:j.push(z)}}return j.map((D=>D.replace(k," "))).join(u.isWindows?`\r
108
- `:`
109
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(x){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),u.isLinux&&x&&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(x){const E=this._getMouseBufferCoords(x),T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!!(T&&j&&E)&&this._areCoordsInSelection(E,T,j)}isCellInSelection(x,E){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!T||!j)&&this._areCoordsInSelection([x,E],T,j)}_areCoordsInSelection(x,E,T){return x[1]>E[1]&&x[1]<T[1]||E[1]===T[1]&&x[1]===E[1]&&x[0]>=E[0]&&x[0]<T[0]||E[1]<T[1]&&x[1]===T[1]&&x[0]<T[0]||E[1]<T[1]&&x[1]===E[1]&&x[0]>=E[0]}_selectWordAtCursor(x,E){var D,B;const T=(B=(D=this._linkifier.currentLink)==null?void 0:D.link)==null?void 0:B.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,a.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const j=this._getMouseBufferCoords(x);return!!j&&(this._selectWordAt(j,E),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(x,E){this._model.clearSelection(),x=Math.max(x,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,x],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()}_handleTrim(x){this._model.handleTrim(x)&&this.refresh()}_getMouseBufferCoords(x){const E=this._mouseService.getCoords(x,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E}_getMouseEventScrollAmount(x){let E=(0,l.getCoordsRelativeToElement)(this._coreBrowserService.window,x,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=T?0:(E>T&&(E-=T),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}shouldForceSelection(x){return u.isMac?x.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:x.shiftKey}handleMouseDown(x){if(this._mouseDownTimeStamp=x.timeStamp,(x.button!==2||!this.hasSelection)&&x.button===0){if(!this._enabled){if(!this.shouldForceSelection(x))return;x.stopPropagation()}x.preventDefault(),this._dragScrollAmount=0,this._enabled&&x.shiftKey?this._handleIncrementalClick(x):x.detail===1?this._handleSingleClick(x):x.detail===2?this._handleDoubleClick(x):x.detail===3&&this._handleTripleClick(x),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(x){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(x))}_handleSingleClick(x){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(x)?3:0,this._model.selectionStart=this._getMouseBufferCoords(x),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.length!==this._model.selectionStart[0]&&E.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(x){this._selectWordAtCursor(x,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(x){const E=this._getMouseBufferCoords(x);E&&(this._activeSelectionMode=2,this._selectLineAt(E[1]))}shouldColumnSelect(x){return x.altKey&&!(u.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(x){if(x.stopImmediatePropagation(),!this._model.selectionStart)return;const E=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(x),!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(x),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const j=T.lines.get(this._model.selectionEnd[1]);j&&j.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}E&&E[0]===this._model.selectionEnd[0]&&E[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 x=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(x.ydisp+this._bufferService.rows,x.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=x.ydisp),this.refresh()}}_handleMouseUp(x){const E=x.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&E<500&&x.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(x,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const j=(0,v.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(j,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const x=this._model.finalSelectionStart,E=this._model.finalSelectionEnd,T=!(!x||!E||x[0]===E[0]&&x[1]===E[1]);T?x&&E&&(this._oldSelectionStart&&this._oldSelectionEnd&&x[0]===this._oldSelectionStart[0]&&x[1]===this._oldSelectionStart[1]&&E[0]===this._oldSelectionEnd[0]&&E[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(x,E,T)):this._oldHasSelection&&this._fireOnSelectionChange(x,E,T)}_fireOnSelectionChange(x,E,T){this._oldSelectionStart=x,this._oldSelectionEnd=E,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(x){this.clearSelection(),this._trimListener.dispose(),this._trimListener=x.activeBuffer.lines.onTrim((E=>this._handleTrim(E)))}_convertViewportColToCharacterIndex(x,E){let T=E;for(let j=0;E>=j;j++){const D=x.loadCell(j,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:D>1&&E!==j&&(T+=D-1)}return T}setSelection(x,E,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[x,E],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(x){this._isClickInSelection(x)||(this._selectWordAtCursor(x,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(x,E,T=!0,j=!0){if(x[0]>=this._bufferService.cols)return;const D=this._bufferService.buffer,B=D.lines.get(x[1]);if(!B)return;const z=D.translateBufferLineToString(x[1],!1);let X=this._convertViewportColToCharacterIndex(B,x[0]),Z=X;const Y=x[0]-X;let V=0,I=0,$=0,O=0;if(z.charAt(X)===" "){for(;X>0&&z.charAt(X-1)===" ";)X--;for(;Z<z.length&&z.charAt(Z+1)===" ";)Z++}else{let ee=x[0],ne=x[0];B.getWidth(ee)===0&&(V++,ee--),B.getWidth(ne)===2&&(I++,ne++);const Q=B.getString(ne).length;for(Q>1&&(O+=Q-1,Z+=Q-1);ee>0&&X>0&&!this._isCharWordSeparator(B.loadCell(ee-1,this._workCell));){B.loadCell(ee-1,this._workCell);const q=this._workCell.getChars().length;this._workCell.getWidth()===0?(V++,ee--):q>1&&($+=q-1,X-=q-1),X--,ee--}for(;ne<B.length&&Z+1<z.length&&!this._isCharWordSeparator(B.loadCell(ne+1,this._workCell));){B.loadCell(ne+1,this._workCell);const q=this._workCell.getChars().length;this._workCell.getWidth()===2?(I++,ne++):q>1&&(O+=q-1,Z+=q-1),Z++,ne++}}Z++;let U=X+Y-V+$,K=Math.min(this._bufferService.cols,Z-X+V+I-$-O);if(E||z.slice(X,Z).trim()!==""){if(T&&U===0&&B.getCodePoint(0)!==32){const ee=D.lines.get(x[1]-1);if(ee&&B.isWrapped&&ee.getCodePoint(this._bufferService.cols-1)!==32){const ne=this._getWordAt([this._bufferService.cols-1,x[1]-1],!1,!0,!1);if(ne){const Q=this._bufferService.cols-ne.start;U-=Q,K+=Q}}}if(j&&U+K===this._bufferService.cols&&B.getCodePoint(this._bufferService.cols-1)!==32){const ee=D.lines.get(x[1]+1);if(ee!=null&&ee.isWrapped&&ee.getCodePoint(0)!==32){const ne=this._getWordAt([0,x[1]+1],!1,!1,!0);ne&&(K+=ne.length)}}return{start:U,length:K}}}_selectWordAt(x,E){const T=this._getWordAt(x,E);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,x[1]--;this._model.selectionStart=[T.start,x[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(x){const E=this._getWordAt(x,!0);if(E){let T=x[1];for(;E.start<0;)E.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,T]}}_isCharWordSeparator(x){return x.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(x.getChars())>=0}_selectLineAt(x){const E=this._bufferService.buffer.getWrappedRangeForLine(x),T={start:{x:0,y:E.first},end:{x:this._bufferService.cols-1,y:E.last}};this._model.selectionStart=[0,E.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,a.getRangeLength)(T,this._bufferService.cols)}};i.SelectionService=A=m([g(3,y.IBufferService),g(4,y.ICoreService),g(5,b.IMouseService),g(6,y.IOptionsService),g(7,b.IRenderService),g(8,b.ICoreBrowserService)],A)},4725:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ILinkProviderService=i.IThemeService=i.ICharacterJoinerService=i.ISelectionService=i.IRenderService=i.IMouseService=i.ICoreBrowserService=i.ICharSizeService=void 0;const m=c(8343);i.ICharSizeService=(0,m.createDecorator)("CharSizeService"),i.ICoreBrowserService=(0,m.createDecorator)("CoreBrowserService"),i.IMouseService=(0,m.createDecorator)("MouseService"),i.IRenderService=(0,m.createDecorator)("RenderService"),i.ISelectionService=(0,m.createDecorator)("SelectionService"),i.ICharacterJoinerService=(0,m.createDecorator)("CharacterJoinerService"),i.IThemeService=(0,m.createDecorator)("ThemeService"),i.ILinkProviderService=(0,m.createDecorator)("LinkProviderService")},6731:function(N,i,c){var m=this&&this.__decorate||function(A,x,E,T){var j,D=arguments.length,B=D<3?x:T===null?T=Object.getOwnPropertyDescriptor(x,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(A,x,E,T);else for(var z=A.length-1;z>=0;z--)(j=A[z])&&(B=(D<3?j(B):D>3?j(x,E,B):j(x,E))||B);return D>3&&B&&Object.defineProperty(x,E,B),B},g=this&&this.__param||function(A,x){return function(E,T){x(E,T,A)}};Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeService=i.DEFAULT_ANSI_COLORS=void 0;const l=c(7239),v=c(8055),C=c(8460),b=c(844),f=c(2585),o=v.css.toColor("#ffffff"),u=v.css.toColor("#000000"),a=v.css.toColor("#ffffff"),h=v.css.toColor("#000000"),y={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};i.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const A=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],x=[0,95,135,175,215,255];for(let E=0;E<216;E++){const T=x[E/36%6|0],j=x[E/6%6|0],D=x[E%6];A.push({css:v.channels.toCss(T,j,D),rgba:v.channels.toRgba(T,j,D)})}for(let E=0;E<24;E++){const T=8+10*E;A.push({css:v.channels.toCss(T,T,T),rgba:v.channels.toRgba(T,T,T)})}return A})());let L=i.ThemeService=class extends b.Disposable{get colors(){return this._colors}constructor(A){super(),this._optionsService=A,this._contrastCache=new l.ColorContrastCache,this._halfContrastCache=new l.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:o,background:u,cursor:a,cursorAccent:h,selectionForeground:void 0,selectionBackgroundTransparent:y,selectionBackgroundOpaque:v.color.blend(u,y),selectionInactiveBackgroundTransparent:y,selectionInactiveBackgroundOpaque:v.color.blend(u,y),ansi:i.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(A={}){const x=this._colors;if(x.foreground=k(A.foreground,o),x.background=k(A.background,u),x.cursor=k(A.cursor,a),x.cursorAccent=k(A.cursorAccent,h),x.selectionBackgroundTransparent=k(A.selectionBackground,y),x.selectionBackgroundOpaque=v.color.blend(x.background,x.selectionBackgroundTransparent),x.selectionInactiveBackgroundTransparent=k(A.selectionInactiveBackground,x.selectionBackgroundTransparent),x.selectionInactiveBackgroundOpaque=v.color.blend(x.background,x.selectionInactiveBackgroundTransparent),x.selectionForeground=A.selectionForeground?k(A.selectionForeground,v.NULL_COLOR):void 0,x.selectionForeground===v.NULL_COLOR&&(x.selectionForeground=void 0),v.color.isOpaque(x.selectionBackgroundTransparent)&&(x.selectionBackgroundTransparent=v.color.opacity(x.selectionBackgroundTransparent,.3)),v.color.isOpaque(x.selectionInactiveBackgroundTransparent)&&(x.selectionInactiveBackgroundTransparent=v.color.opacity(x.selectionInactiveBackgroundTransparent,.3)),x.ansi=i.DEFAULT_ANSI_COLORS.slice(),x.ansi[0]=k(A.black,i.DEFAULT_ANSI_COLORS[0]),x.ansi[1]=k(A.red,i.DEFAULT_ANSI_COLORS[1]),x.ansi[2]=k(A.green,i.DEFAULT_ANSI_COLORS[2]),x.ansi[3]=k(A.yellow,i.DEFAULT_ANSI_COLORS[3]),x.ansi[4]=k(A.blue,i.DEFAULT_ANSI_COLORS[4]),x.ansi[5]=k(A.magenta,i.DEFAULT_ANSI_COLORS[5]),x.ansi[6]=k(A.cyan,i.DEFAULT_ANSI_COLORS[6]),x.ansi[7]=k(A.white,i.DEFAULT_ANSI_COLORS[7]),x.ansi[8]=k(A.brightBlack,i.DEFAULT_ANSI_COLORS[8]),x.ansi[9]=k(A.brightRed,i.DEFAULT_ANSI_COLORS[9]),x.ansi[10]=k(A.brightGreen,i.DEFAULT_ANSI_COLORS[10]),x.ansi[11]=k(A.brightYellow,i.DEFAULT_ANSI_COLORS[11]),x.ansi[12]=k(A.brightBlue,i.DEFAULT_ANSI_COLORS[12]),x.ansi[13]=k(A.brightMagenta,i.DEFAULT_ANSI_COLORS[13]),x.ansi[14]=k(A.brightCyan,i.DEFAULT_ANSI_COLORS[14]),x.ansi[15]=k(A.brightWhite,i.DEFAULT_ANSI_COLORS[15]),A.extendedAnsi){const E=Math.min(x.ansi.length-16,A.extendedAnsi.length);for(let T=0;T<E;T++)x.ansi[T+16]=k(A.extendedAnsi[T],i.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(A){this._restoreColor(A),this._onChangeColors.fire(this.colors)}_restoreColor(A){if(A!==void 0)switch(A){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[A]=this._restoreColors.ansi[A]}else for(let x=0;x<this._restoreColors.ansi.length;++x)this._colors.ansi[x]=this._restoreColors.ansi[x]}modifyColors(A){A(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 k(A,x){if(A!==void 0)try{return v.css.toColor(A)}catch{}return x}i.ThemeService=L=m([g(0,f.IOptionsService)],L)},6349:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CircularList=void 0;const m=c(8460),g=c(844);class l extends g.Disposable{constructor(C){super(),this._maxLength=C,this.onDeleteEmitter=this.register(new m.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new m.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new m.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(C){if(this._maxLength===C)return;const b=new Array(C);for(let f=0;f<Math.min(C,this.length);f++)b[f]=this._array[this._getCyclicIndex(f)];this._array=b,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let b=this._length;b<C;b++)this._array[b]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,b){this._array[this._getCyclicIndex(C)]=b}push(C){this._array[this._getCyclicIndex(this._length)]=C,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(C,b,...f){if(b){for(let o=C;o<this._length-b;o++)this._array[this._getCyclicIndex(o)]=this._array[this._getCyclicIndex(o+b)];this._length-=b,this.onDeleteEmitter.fire({index:C,amount:b})}for(let o=this._length-1;o>=C;o--)this._array[this._getCyclicIndex(o+f.length)]=this._array[this._getCyclicIndex(o)];for(let o=0;o<f.length;o++)this._array[this._getCyclicIndex(C+o)]=f[o];if(f.length&&this.onInsertEmitter.fire({index:C,amount:f.length}),this._length+f.length>this._maxLength){const o=this._length+f.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=f.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,b,f){if(!(b<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+f<0)throw new Error("Cannot shift elements in list beyond index 0");if(f>0){for(let u=b-1;u>=0;u--)this.set(C+u+f,this.get(C+u));const o=C+b+f-this._length;if(o>0)for(this._length+=o;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let o=0;o<b;o++)this.set(C+o+f,this.get(C+o))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}i.CircularList=l},1439:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clone=void 0,i.clone=function c(m,g=5){if(typeof m!="object")return m;const l=Array.isArray(m)?[]:{};for(const v in m)l[v]=g<=1?m[v]:m[v]&&c(m[v],g-1);return l}},8055:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.contrastRatio=i.toPaddedHex=i.rgba=i.rgb=i.css=i.color=i.channels=i.NULL_COLOR=void 0;let c=0,m=0,g=0,l=0;var v,C,b,f,o;function u(h){const y=h.toString(16);return y.length<2?"0"+y:y}function a(h,y){return h<y?(y+.05)/(h+.05):(h+.05)/(y+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},(function(h){h.toCss=function(y,L,k,A){return A!==void 0?`#${u(y)}${u(L)}${u(k)}${u(A)}`:`#${u(y)}${u(L)}${u(k)}`},h.toRgba=function(y,L,k,A=255){return(y<<24|L<<16|k<<8|A)>>>0},h.toColor=function(y,L,k,A){return{css:h.toCss(y,L,k,A),rgba:h.toRgba(y,L,k,A)}}})(v||(i.channels=v={})),(function(h){function y(L,k){return l=Math.round(255*k),[c,m,g]=o.toChannels(L.rgba),{css:v.toCss(c,m,g,l),rgba:v.toRgba(c,m,g,l)}}h.blend=function(L,k){if(l=(255&k.rgba)/255,l===1)return{css:k.css,rgba:k.rgba};const A=k.rgba>>24&255,x=k.rgba>>16&255,E=k.rgba>>8&255,T=L.rgba>>24&255,j=L.rgba>>16&255,D=L.rgba>>8&255;return c=T+Math.round((A-T)*l),m=j+Math.round((x-j)*l),g=D+Math.round((E-D)*l),{css:v.toCss(c,m,g),rgba:v.toRgba(c,m,g)}},h.isOpaque=function(L){return(255&L.rgba)==255},h.ensureContrastRatio=function(L,k,A){const x=o.ensureContrastRatio(L.rgba,k.rgba,A);if(x)return v.toColor(x>>24&255,x>>16&255,x>>8&255)},h.opaque=function(L){const k=(255|L.rgba)>>>0;return[c,m,g]=o.toChannels(k),{css:v.toCss(c,m,g),rgba:k}},h.opacity=y,h.multiplyOpacity=function(L,k){return l=255&L.rgba,y(L,l*k/255)},h.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(C||(i.color=C={})),(function(h){let y,L;try{const k=document.createElement("canvas");k.width=1,k.height=1;const A=k.getContext("2d",{willReadFrequently:!0});A&&(y=A,y.globalCompositeOperation="copy",L=y.createLinearGradient(0,0,1,1))}catch{}h.toColor=function(k){if(k.match(/#[\da-f]{3,8}/i))switch(k.length){case 4:return c=parseInt(k.slice(1,2).repeat(2),16),m=parseInt(k.slice(2,3).repeat(2),16),g=parseInt(k.slice(3,4).repeat(2),16),v.toColor(c,m,g);case 5:return c=parseInt(k.slice(1,2).repeat(2),16),m=parseInt(k.slice(2,3).repeat(2),16),g=parseInt(k.slice(3,4).repeat(2),16),l=parseInt(k.slice(4,5).repeat(2),16),v.toColor(c,m,g,l);case 7:return{css:k,rgba:(parseInt(k.slice(1),16)<<8|255)>>>0};case 9:return{css:k,rgba:parseInt(k.slice(1),16)>>>0}}const A=k.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(A)return c=parseInt(A[1]),m=parseInt(A[2]),g=parseInt(A[3]),l=Math.round(255*(A[5]===void 0?1:parseFloat(A[5]))),v.toColor(c,m,g,l);if(!y||!L)throw new Error("css.toColor: Unsupported css format");if(y.fillStyle=L,y.fillStyle=k,typeof y.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(y.fillRect(0,0,1,1),[c,m,g,l]=y.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:v.toRgba(c,m,g,l),css:k}}})(b||(i.css=b={})),(function(h){function y(L,k,A){const x=L/255,E=k/255,T=A/255;return .2126*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.7152*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}h.relativeLuminance=function(L){return y(L>>16&255,L>>8&255,255&L)},h.relativeLuminance2=y})(f||(i.rgb=f={})),(function(h){function y(k,A,x){const E=k>>24&255,T=k>>16&255,j=k>>8&255;let D=A>>24&255,B=A>>16&255,z=A>>8&255,X=a(f.relativeLuminance2(D,B,z),f.relativeLuminance2(E,T,j));for(;X<x&&(D>0||B>0||z>0);)D-=Math.max(0,Math.ceil(.1*D)),B-=Math.max(0,Math.ceil(.1*B)),z-=Math.max(0,Math.ceil(.1*z)),X=a(f.relativeLuminance2(D,B,z),f.relativeLuminance2(E,T,j));return(D<<24|B<<16|z<<8|255)>>>0}function L(k,A,x){const E=k>>24&255,T=k>>16&255,j=k>>8&255;let D=A>>24&255,B=A>>16&255,z=A>>8&255,X=a(f.relativeLuminance2(D,B,z),f.relativeLuminance2(E,T,j));for(;X<x&&(D<255||B<255||z<255);)D=Math.min(255,D+Math.ceil(.1*(255-D))),B=Math.min(255,B+Math.ceil(.1*(255-B))),z=Math.min(255,z+Math.ceil(.1*(255-z))),X=a(f.relativeLuminance2(D,B,z),f.relativeLuminance2(E,T,j));return(D<<24|B<<16|z<<8|255)>>>0}h.blend=function(k,A){if(l=(255&A)/255,l===1)return A;const x=A>>24&255,E=A>>16&255,T=A>>8&255,j=k>>24&255,D=k>>16&255,B=k>>8&255;return c=j+Math.round((x-j)*l),m=D+Math.round((E-D)*l),g=B+Math.round((T-B)*l),v.toRgba(c,m,g)},h.ensureContrastRatio=function(k,A,x){const E=f.relativeLuminance(k>>8),T=f.relativeLuminance(A>>8);if(a(E,T)<x){if(T<E){const B=y(k,A,x),z=a(E,f.relativeLuminance(B>>8));if(z<x){const X=L(k,A,x);return z>a(E,f.relativeLuminance(X>>8))?B:X}return B}const j=L(k,A,x),D=a(E,f.relativeLuminance(j>>8));if(D<x){const B=y(k,A,x);return D>a(E,f.relativeLuminance(B>>8))?j:B}return j}},h.reduceLuminance=y,h.increaseLuminance=L,h.toChannels=function(k){return[k>>24&255,k>>16&255,k>>8&255,255&k]}})(o||(i.rgba=o={})),i.toPaddedHex=u,i.contrastRatio=a},8969:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreTerminal=void 0;const m=c(844),g=c(2585),l=c(4348),v=c(7866),C=c(744),b=c(7302),f=c(6975),o=c(8460),u=c(1753),a=c(1480),h=c(7994),y=c(9282),L=c(5435),k=c(5981),A=c(2660);let x=!1;class E extends m.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new o.EventEmitter),this._onScroll.event((j=>{var D;(D=this._onScrollApi)==null||D.fire(j.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(j){for(const D in j)this.optionsService.options[D]=j[D]}constructor(j){super(),this._windowsWrappingHeuristics=this.register(new m.MutableDisposable),this._onBinary=this.register(new o.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new o.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new o.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new o.EventEmitter),this._instantiationService=new l.InstantiationService,this.optionsService=this.register(new b.OptionsService(j)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(f.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(u.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(a.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(h.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(A.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new L.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,o.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,o.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,o.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,o.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((D=>{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((D=>{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 k.WriteBuffer(((D,B)=>this._inputHandler.parse(D,B)))),this.register((0,o.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(j,D){this._writeBuffer.write(j,D)}writeSync(j,D){this._logService.logLevel<=g.LogLevelEnum.WARN&&!x&&(this._logService.warn("writeSync is unreliable and will be removed soon."),x=!0),this._writeBuffer.writeSync(j,D)}input(j,D=!0){this.coreService.triggerDataEvent(j,D)}resize(j,D){isNaN(j)||isNaN(D)||(j=Math.max(j,C.MINIMUM_COLS),D=Math.max(D,C.MINIMUM_ROWS),this._bufferService.resize(j,D))}scroll(j,D=!1){this._bufferService.scroll(j,D)}scrollLines(j,D,B){this._bufferService.scrollLines(j,D,B)}scrollPages(j){this.scrollLines(j*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(j){const D=j-this._bufferService.buffer.ydisp;D!==0&&this.scrollLines(D)}registerEscHandler(j,D){return this._inputHandler.registerEscHandler(j,D)}registerDcsHandler(j,D){return this._inputHandler.registerDcsHandler(j,D)}registerCsiHandler(j,D){return this._inputHandler.registerCsiHandler(j,D)}registerOscHandler(j,D){return this._inputHandler.registerOscHandler(j,D)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let j=!1;const D=this.optionsService.rawOptions.windowsPty;D&&D.buildNumber!==void 0&&D.buildNumber!==void 0?j=D.backend==="conpty"&&D.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(j=!0),j?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const j=[];j.push(this.onLineFeed(y.updateWindowsModeWrappedState.bind(null,this._bufferService))),j.push(this.registerCsiHandler({final:"H"},(()=>((0,y.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,m.toDisposable)((()=>{for(const D of j)D.dispose()}))}}}i.CoreTerminal=E},8460:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let m=0;m<this._listeners.length;m++)if(this._listeners[m]===c)return void this._listeners.splice(m,1)}}})),this._event}fire(c,m){const g=[];for(let l=0;l<this._listeners.length;l++)g.push(this._listeners[l]);for(let l=0;l<g.length;l++)g[l].call(void 0,c,m)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(c,m){return c((g=>m.fire(g)))},i.runAndSubscribe=function(c,m){return m(void 0),c((g=>m(g)))}},5435:function(N,i,c){var m=this&&this.__decorate||function(V,I,$,O){var U,K=arguments.length,ee=K<3?I:O===null?O=Object.getOwnPropertyDescriptor(I,$):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(V,I,$,O);else for(var ne=V.length-1;ne>=0;ne--)(U=V[ne])&&(ee=(K<3?U(ee):K>3?U(I,$,ee):U(I,$))||ee);return K>3&&ee&&Object.defineProperty(I,$,ee),ee},g=this&&this.__param||function(V,I){return function($,O){I($,O,V)}};Object.defineProperty(i,"__esModule",{value:!0}),i.InputHandler=i.WindowsOptionsReportType=void 0;const l=c(2584),v=c(7116),C=c(2015),b=c(844),f=c(482),o=c(8437),u=c(8460),a=c(643),h=c(511),y=c(3734),L=c(2585),k=c(1480),A=c(6242),x=c(6351),E=c(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},j=131072;function D(V,I){if(V>24)return I.setWinLines||!1;switch(V){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var B;(function(V){V[V.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",V[V.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(B||(i.WindowsOptionsReportType=B={}));let z=0;class X extends b.Disposable{getAttrData(){return this._curAttrData}constructor(I,$,O,U,K,ee,ne,Q,q=new C.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=$,this._coreService=O,this._logService=U,this._optionsService=K,this._oscLinkService=ee,this._coreMouseService=ne,this._unicodeService=Q,this._parser=q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new f.StringToUtf32,this._utf8Decoder=new f.Utf8ToUtf32,this._workCell=new h.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new u.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new u.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new u.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new u.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new u.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new u.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new u.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new u.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new u.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new u.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new u.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new Z(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((H=>this._activeBuffer=H.activeBuffer))),this._parser.setCsiHandlerFallback(((H,re)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(H),params:re.toArray()})})),this._parser.setEscHandlerFallback((H=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(H)})})),this._parser.setExecuteHandlerFallback((H=>{this._logService.debug("Unknown EXECUTE code: ",{code:H})})),this._parser.setOscHandlerFallback(((H,re,te)=>{this._logService.debug("Unknown OSC code: ",{identifier:H,action:re,data:te})})),this._parser.setDcsHandlerFallback(((H,re,te)=>{re==="HOOK"&&(te=te.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(H),action:re,payload:te})})),this._parser.setPrintHandler(((H,re,te)=>this.print(H,re,te))),this._parser.registerCsiHandler({final:"@"},(H=>this.insertChars(H))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(H=>this.scrollLeft(H))),this._parser.registerCsiHandler({final:"A"},(H=>this.cursorUp(H))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(H=>this.scrollRight(H))),this._parser.registerCsiHandler({final:"B"},(H=>this.cursorDown(H))),this._parser.registerCsiHandler({final:"C"},(H=>this.cursorForward(H))),this._parser.registerCsiHandler({final:"D"},(H=>this.cursorBackward(H))),this._parser.registerCsiHandler({final:"E"},(H=>this.cursorNextLine(H))),this._parser.registerCsiHandler({final:"F"},(H=>this.cursorPrecedingLine(H))),this._parser.registerCsiHandler({final:"G"},(H=>this.cursorCharAbsolute(H))),this._parser.registerCsiHandler({final:"H"},(H=>this.cursorPosition(H))),this._parser.registerCsiHandler({final:"I"},(H=>this.cursorForwardTab(H))),this._parser.registerCsiHandler({final:"J"},(H=>this.eraseInDisplay(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(H=>this.eraseInDisplay(H,!0))),this._parser.registerCsiHandler({final:"K"},(H=>this.eraseInLine(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(H=>this.eraseInLine(H,!0))),this._parser.registerCsiHandler({final:"L"},(H=>this.insertLines(H))),this._parser.registerCsiHandler({final:"M"},(H=>this.deleteLines(H))),this._parser.registerCsiHandler({final:"P"},(H=>this.deleteChars(H))),this._parser.registerCsiHandler({final:"S"},(H=>this.scrollUp(H))),this._parser.registerCsiHandler({final:"T"},(H=>this.scrollDown(H))),this._parser.registerCsiHandler({final:"X"},(H=>this.eraseChars(H))),this._parser.registerCsiHandler({final:"Z"},(H=>this.cursorBackwardTab(H))),this._parser.registerCsiHandler({final:"`"},(H=>this.charPosAbsolute(H))),this._parser.registerCsiHandler({final:"a"},(H=>this.hPositionRelative(H))),this._parser.registerCsiHandler({final:"b"},(H=>this.repeatPrecedingCharacter(H))),this._parser.registerCsiHandler({final:"c"},(H=>this.sendDeviceAttributesPrimary(H))),this._parser.registerCsiHandler({prefix:">",final:"c"},(H=>this.sendDeviceAttributesSecondary(H))),this._parser.registerCsiHandler({final:"d"},(H=>this.linePosAbsolute(H))),this._parser.registerCsiHandler({final:"e"},(H=>this.vPositionRelative(H))),this._parser.registerCsiHandler({final:"f"},(H=>this.hVPosition(H))),this._parser.registerCsiHandler({final:"g"},(H=>this.tabClear(H))),this._parser.registerCsiHandler({final:"h"},(H=>this.setMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(H=>this.setModePrivate(H))),this._parser.registerCsiHandler({final:"l"},(H=>this.resetMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(H=>this.resetModePrivate(H))),this._parser.registerCsiHandler({final:"m"},(H=>this.charAttributes(H))),this._parser.registerCsiHandler({final:"n"},(H=>this.deviceStatus(H))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(H=>this.deviceStatusPrivate(H))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(H=>this.softReset(H))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(H=>this.setCursorStyle(H))),this._parser.registerCsiHandler({final:"r"},(H=>this.setScrollRegion(H))),this._parser.registerCsiHandler({final:"s"},(H=>this.saveCursor(H))),this._parser.registerCsiHandler({final:"t"},(H=>this.windowOptions(H))),this._parser.registerCsiHandler({final:"u"},(H=>this.restoreCursor(H))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(H=>this.insertColumns(H))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(H=>this.deleteColumns(H))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(H=>this.selectProtected(H))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(H=>this.requestMode(H,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(H=>this.requestMode(H,!1))),this._parser.setExecuteHandler(l.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(l.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(l.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(l.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(l.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(l.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(l.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(l.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(l.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new A.OscHandler((H=>(this.setTitle(H),this.setIconName(H),!0)))),this._parser.registerOscHandler(1,new A.OscHandler((H=>this.setIconName(H)))),this._parser.registerOscHandler(2,new A.OscHandler((H=>this.setTitle(H)))),this._parser.registerOscHandler(4,new A.OscHandler((H=>this.setOrReportIndexedColor(H)))),this._parser.registerOscHandler(8,new A.OscHandler((H=>this.setHyperlink(H)))),this._parser.registerOscHandler(10,new A.OscHandler((H=>this.setOrReportFgColor(H)))),this._parser.registerOscHandler(11,new A.OscHandler((H=>this.setOrReportBgColor(H)))),this._parser.registerOscHandler(12,new A.OscHandler((H=>this.setOrReportCursorColor(H)))),this._parser.registerOscHandler(104,new A.OscHandler((H=>this.restoreIndexedColor(H)))),this._parser.registerOscHandler(110,new A.OscHandler((H=>this.restoreFgColor(H)))),this._parser.registerOscHandler(111,new A.OscHandler((H=>this.restoreBgColor(H)))),this._parser.registerOscHandler(112,new A.OscHandler((H=>this.restoreCursorColor(H)))),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 H in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:H},(()=>this.selectCharset("("+H))),this._parser.registerEscHandler({intermediates:")",final:H},(()=>this.selectCharset(")"+H))),this._parser.registerEscHandler({intermediates:"*",final:H},(()=>this.selectCharset("*"+H))),this._parser.registerEscHandler({intermediates:"+",final:H},(()=>this.selectCharset("+"+H))),this._parser.registerEscHandler({intermediates:"-",final:H},(()=>this.selectCharset("-"+H))),this._parser.registerEscHandler({intermediates:".",final:H},(()=>this.selectCharset("."+H))),this._parser.registerEscHandler({intermediates:"/",final:H},(()=>this.selectCharset("/"+H)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((H=>(this._logService.error("Parsing error: ",H),H))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new x.DcsHandler(((H,re)=>this.requestStatusString(H,re))))}_preserveStack(I,$,O,U){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=$,this._parseStack.decodedLength=O,this._parseStack.position=U}_logSlowResolvingAsync(I){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([I,new Promise((($,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch(($=>{if($!=="#SLOW_TIMEOUT")throw $;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,$){let O,U=this._activeBuffer.x,K=this._activeBuffer.y,ee=0;const ne=this._parseStack.paused;if(ne){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,$))return this._logSlowResolvingAsync(O),O;U=this._parseStack.cursorStartX,K=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>j&&(ee=this._parseStack.position+j)}if(this._logService.logLevel<=L.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(H=>String.fromCharCode(H))).join("")}"`),typeof I=="string"?I.split("").map((H=>H.charCodeAt(0))):I),this._parseBuffer.length<I.length&&this._parseBuffer.length<j&&(this._parseBuffer=new Uint32Array(Math.min(I.length,j))),ne||this._dirtyRowTracker.clearRange(),I.length>j)for(let H=ee;H<I.length;H+=j){const re=H+j<I.length?H+j:I.length,te=typeof I=="string"?this._stringDecoder.decode(I.substring(H,re),this._parseBuffer):this._utf8Decoder.decode(I.subarray(H,re),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,te))return this._preserveStack(U,K,te,H),this._logSlowResolvingAsync(O),O}else if(!ne){const H=typeof I=="string"?this._stringDecoder.decode(I,this._parseBuffer):this._utf8Decoder.decode(I,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,H))return this._preserveStack(U,K,H,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===U&&this._activeBuffer.y===K||this._onCursorMove.fire();const Q=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),q=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);q<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(q,this._bufferService.rows-1),Math.min(Q,this._bufferService.rows-1))}print(I,$,O){let U,K;const ee=this._charsetService.charset,ne=this._optionsService.rawOptions.screenReaderMode,Q=this._bufferService.cols,q=this._coreService.decPrivateModes.wraparound,H=this._coreService.modes.insertMode,re=this._curAttrData;let te=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&O-$>0&&te.getWidth(this._activeBuffer.x-1)===2&&te.setCellFromCodepoint(this._activeBuffer.x-1,0,1,re);let he=this._parser.precedingJoinState;for(let de=$;de<O;++de){if(U=I[de],U<127&&ee){const Qe=ee[String.fromCharCode(U)];Qe&&(U=Qe.charCodeAt(0))}const Te=this._unicodeService.charProperties(U,he);K=k.UnicodeService.extractWidth(Te);const ke=k.UnicodeService.extractShouldJoin(Te),He=ke?k.UnicodeService.extractWidth(he):0;if(he=Te,ne&&this._onA11yChar.fire((0,f.stringFromCodePoint)(U)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+K-He>Q){if(q){const Qe=te;let ce=this._activeBuffer.x-He;for(this._activeBuffer.x=He,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),He>0&&te instanceof o.BufferLine&&te.copyCellsFrom(Qe,ce,0,He,!1);ce<Q;)Qe.setCellFromCodepoint(ce++,0,1,re)}else if(this._activeBuffer.x=Q-1,K===2)continue}if(ke&&this._activeBuffer.x){const Qe=te.getWidth(this._activeBuffer.x-1)?1:2;te.addCodepointToCell(this._activeBuffer.x-Qe,U,K);for(let ce=K-He;--ce>=0;)te.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}else if(H&&(te.insertCells(this._activeBuffer.x,K-He,this._activeBuffer.getNullCell(re)),te.getWidth(Q-1)===2&&te.setCellFromCodepoint(Q-1,a.NULL_CELL_CODE,a.NULL_CELL_WIDTH,re)),te.setCellFromCodepoint(this._activeBuffer.x++,U,K,re),K>0)for(;--K;)te.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}this._parser.precedingJoinState=he,this._activeBuffer.x<Q&&O-$>0&&te.getWidth(this._activeBuffer.x)===0&&!te.hasContent(this._activeBuffer.x)&&te.setCellFromCodepoint(this._activeBuffer.x,0,1,re),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,$){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,$):this._parser.registerCsiHandler(I,(O=>!D(O.params[0],this._optionsService.rawOptions.windowOptions)||$(O)))}registerDcsHandler(I,$){return this._parser.registerDcsHandler(I,new x.DcsHandler($))}registerEscHandler(I,$){return this._parser.registerEscHandler(I,$)}registerOscHandler(I,$){return this._parser.registerOscHandler(I,new A.OscHandler($))}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 I;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&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);$.hasWidth(this._activeBuffer.x)&&!$.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,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(I,$){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+$):(this._activeBuffer.x=I,this._activeBuffer.y=$),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,$){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+$)}cursorUp(I){const $=this._activeBuffer.y-this._activeBuffer.scrollTop;return $>=0?this._moveCursor(0,-Math.min($,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const $=this._activeBuffer.scrollBottom-this._activeBuffer.y;return $>=0?this._moveCursor(0,Math.min($,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const $=I.params[0];return $===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:$===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=I.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=I.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const $=I.params[0];return $===1&&(this._curAttrData.bg|=536870912),$!==2&&$!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,$,O,U=!1,K=!1){const ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);ee.replaceCells($,O,this._activeBuffer.getNullCell(this._eraseAttrData()),K),U&&(ee.isWrapped=!1)}_resetBufferLine(I,$=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),$),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),O.isWrapped=!1)}eraseInDisplay(I,$=!1){let O;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,$);O<this._bufferService.rows;O++)this._resetBufferLine(O,$);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,$),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,$);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,$);this._dirtyRowTracker.markDirty(0);break;case 3:const U=this._activeBuffer.lines.length-this._bufferService.rows;U>0&&(this._activeBuffer.lines.trimStart(U),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-U,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-U,0),this._onScroll.fire(0))}return!0}eraseInLine(I,$=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,$);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,$);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,$)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let $=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,U=this._bufferService.rows-1-this._activeBuffer.scrollBottom,K=this._bufferService.rows-1+this._activeBuffer.ybase-U+1;for(;$--;)this._activeBuffer.lines.splice(K-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(I){this._restrictCursor();let $=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let U;for(U=this._bufferService.rows-1-this._activeBuffer.scrollBottom,U=this._bufferService.rows-1+this._activeBuffer.ybase-U;$--;)this._activeBuffer.lines.splice(O,1),this._activeBuffer.lines.splice(U,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(I){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.insertCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(I){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.deleteCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(I){let $=I.params[0]||1;for(;$--;)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(I){let $=I.params[0]||1;for(;$--;)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(o.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=I.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);U.deleteCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=I.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);U.insertCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=I.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);U.insertCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=I.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);U.deleteCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(I){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(I.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(I){const $=this._parser.precedingJoinState;if(!$)return!0;const O=I.params[0]||1,U=k.UnicodeService.extractWidth($),K=this._activeBuffer.x-U,ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(K),ne=new Uint32Array(ee.length*O);let Q=0;for(let H=0;H<ee.length;){const re=ee.codePointAt(H)||0;ne[Q++]=re,H+=re>65535?2:1}let q=Q;for(let H=1;H<O;++H)ne.copyWithin(q,0,Q),q+=Q;return this.print(ne,0,q),!0}sendDeviceAttributesPrimary(I){return I.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(l.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(l.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(l.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(l.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(l.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let $=0;$<I.length;$++)switch(I.params[$]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(I){for(let $=0;$<I.length;$++)switch(I.params[$]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(I){for(let $=0;$<I.length;$++)switch(I.params[$]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(I){for(let $=0;$<I.length;$++)switch(I.params[$]){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(),I.params[$]===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(I,$){const O=this._coreService.decPrivateModes,{activeProtocol:U,activeEncoding:K}=this._coreMouseService,ee=this._coreService,{buffers:ne,cols:Q}=this._bufferService,{active:q,alt:H}=ne,re=this._optionsService.rawOptions,te=ke=>ke?1:2,he=I.params[0];return de=he,Te=$?he===2?4:he===4?te(ee.modes.insertMode):he===12?3:he===20?te(re.convertEol):0:he===1?te(O.applicationCursorKeys):he===3?re.windowOptions.setWinLines?Q===80?2:Q===132?1:0:0:he===6?te(O.origin):he===7?te(O.wraparound):he===8?3:he===9?te(U==="X10"):he===12?te(re.cursorBlink):he===25?te(!ee.isCursorHidden):he===45?te(O.reverseWraparound):he===66?te(O.applicationKeypad):he===67?4:he===1e3?te(U==="VT200"):he===1002?te(U==="DRAG"):he===1003?te(U==="ANY"):he===1004?te(O.sendFocus):he===1005?4:he===1006?te(K==="SGR"):he===1015?4:he===1016?te(K==="SGR_PIXELS"):he===1048?1:he===47||he===1047||he===1049?te(q===H):he===2004?te(O.bracketedPasteMode):0,ee.triggerDataEvent(`${l.C0.ESC}[${$?"":"?"}${de};${Te}$y`),!0;var de,Te}_updateAttrColor(I,$,O,U,K){return $===2?(I|=50331648,I&=-16777216,I|=y.AttributeData.fromColorRGB([O,U,K])):$===5&&(I&=-50331904,I|=33554432|255&O),I}_extractColor(I,$,O){const U=[0,0,-1,0,0,0];let K=0,ee=0;do{if(U[ee+K]=I.params[$+ee],I.hasSubParams($+ee)){const ne=I.getSubParams($+ee);let Q=0;do U[1]===5&&(K=1),U[ee+Q+1+K]=ne[Q];while(++Q<ne.length&&Q+ee+1+K<U.length);break}if(U[1]===5&&ee+K>=2||U[1]===2&&ee+K>=5)break;U[1]&&(K=1)}while(++ee+$<I.length&&ee+K<U.length);for(let ne=2;ne<U.length;++ne)U[ne]===-1&&(U[ne]=0);switch(U[0]){case 38:O.fg=this._updateAttrColor(O.fg,U[1],U[3],U[4],U[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,U[1],U[3],U[4],U[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,U[1],U[3],U[4],U[5])}return ee}_processUnderline(I,$){$.extended=$.extended.clone(),(!~I||I>5)&&(I=1),$.extended.underlineStyle=I,$.fg|=268435456,I===0&&($.fg&=-268435457),$.updateExtended()}_processSGR0(I){I.fg=o.DEFAULT_ATTR_DATA.fg,I.bg=o.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const $=I.length;let O;const U=this._curAttrData;for(let K=0;K<$;K++)O=I.params[K],O>=30&&O<=37?(U.fg&=-50331904,U.fg|=16777216|O-30):O>=40&&O<=47?(U.bg&=-50331904,U.bg|=16777216|O-40):O>=90&&O<=97?(U.fg&=-50331904,U.fg|=16777224|O-90):O>=100&&O<=107?(U.bg&=-50331904,U.bg|=16777224|O-100):O===0?this._processSGR0(U):O===1?U.fg|=134217728:O===3?U.bg|=67108864:O===4?(U.fg|=268435456,this._processUnderline(I.hasSubParams(K)?I.getSubParams(K)[0]:1,U)):O===5?U.fg|=536870912:O===7?U.fg|=67108864:O===8?U.fg|=1073741824:O===9?U.fg|=2147483648:O===2?U.bg|=134217728:O===21?this._processUnderline(2,U):O===22?(U.fg&=-134217729,U.bg&=-134217729):O===23?U.bg&=-67108865:O===24?(U.fg&=-268435457,this._processUnderline(0,U)):O===25?U.fg&=-536870913:O===27?U.fg&=-67108865:O===28?U.fg&=-1073741825:O===29?U.fg&=2147483647:O===39?(U.fg&=-67108864,U.fg|=16777215&o.DEFAULT_ATTR_DATA.fg):O===49?(U.bg&=-67108864,U.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?K+=this._extractColor(I,K,U):O===53?U.bg|=1073741824:O===55?U.bg&=-1073741825:O===59?(U.extended=U.extended.clone(),U.extended.underlineColor=-1,U.updateExtended()):O===100?(U.fg&=-67108864,U.fg|=16777215&o.DEFAULT_ATTR_DATA.fg,U.bg&=-67108864,U.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${l.C0.ESC}[0n`);break;case 6:const $=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[${$};${O}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const $=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[?${$};${O}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=o.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(I){const $=I.params[0]||1;switch($){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 O=$%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(I){const $=I.params[0]||1;let O;return(I.length<2||(O=I.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>$&&(this._activeBuffer.scrollTop=$-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(I){if(!D(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const $=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:$!==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(`${l.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:$!==0&&$!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),$!==0&&$!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:$!==0&&$!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),$!==0&&$!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){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(I){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(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const $=[],O=I.split(";");for(;O.length>1;){const U=O.shift(),K=O.shift();if(/^\d+$/.exec(U)){const ee=parseInt(U);if(Y(ee))if(K==="?")$.push({type:0,index:ee});else{const ne=(0,E.parseColor)(K);ne&&$.push({type:1,index:ee,color:ne})}}}return $.length&&this._onColor.fire($),!0}setHyperlink(I){const $=I.split(";");return!($.length<2)&&($[1]?this._createHyperlink($[0],$[1]):!$[0]&&this._finishHyperlink())}_createHyperlink(I,$){this._getCurrentLinkId()&&this._finishHyperlink();const O=I.split(":");let U;const K=O.findIndex((ee=>ee.startsWith("id=")));return K!==-1&&(U=O[K].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:U,uri:$}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,$){const O=I.split(";");for(let U=0;U<O.length&&!($>=this._specialColors.length);++U,++$)if(O[U]==="?")this._onColor.fire([{type:0,index:this._specialColors[$]}]);else{const K=(0,E.parseColor)(O[U]);K&&this._onColor.fire([{type:1,index:this._specialColors[$],color:K}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const $=[],O=I.split(";");for(let U=0;U<O.length;++U)if(/^\d+$/.exec(O[U])){const K=parseInt(O[U]);Y(K)&&$.push({type:2,index:K})}return $.length&&this._onColor.fire($),!0}restoreFgColor(I){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(I){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(I){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),!0}selectCharset(I){return I.length!==2?(this.selectDefaultCharset(),!0):(I[0]==="/"||this._charsetService.setgCharset(T[I[0]],v.CHARSETS[I[1]]||v.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,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=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new h.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let $=0;$<this._bufferService.rows;++$){const O=this._activeBuffer.ybase+this._activeBuffer.y+$,U=this._activeBuffer.lines.get(O);U&&(U.fill(I),U.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(I,$){const O=this._bufferService.buffer,U=this._optionsService.rawOptions;return(K=>(this._coreService.triggerDataEvent(`${l.C0.ESC}${K}${l.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[U.cursorStyle]-(U.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,$){this._dirtyRowTracker.markRangeDirty(I,$)}}i.InputHandler=X;let Z=class{constructor(V){this._bufferService=V,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(V){V<this.start?this.start=V:V>this.end&&(this.end=V)}markRangeDirty(V,I){V>I&&(z=V,V=I,I=z),V<this.start&&(this.start=V),I>this.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(V){return 0<=V&&V<256}Z=m([g(0,L.IBufferService)],Z)},844:(N,i)=>{function c(m){for(const g of m)g.dispose();m.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const m of this._disposables)m.dispose();this._disposables.length=0}register(m){return this._disposables.push(m),m}unregister(m){const g=this._disposables.indexOf(m);g!==-1&&this._disposables.splice(g,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(m){var g;this._isDisposed||m===this._value||((g=this._value)==null||g.dispose(),this._value=m)}clear(){this.value=void 0}dispose(){var m;this._isDisposed=!0,(m=this._value)==null||m.dispose(),this._value=void 0}},i.toDisposable=function(m){return{dispose:m}},i.disposeArray=c,i.getDisposeArrayDisposable=function(m){return{dispose:()=>c(m)}}},1505:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,l,v){this._data[g]||(this._data[g]={}),this._data[g][l]=v}get(g,l){return this._data[g]?this._data[g][l]:void 0}clear(){this._data={}}}i.TwoKeyMap=c,i.FourKeyMap=class{constructor(){this._data=new c}set(m,g,l,v,C){this._data.get(m,g)||this._data.set(m,g,new c),this._data.get(m,g).set(l,v,C)}get(m,g,l,v){var C;return(C=this._data.get(m,g))==null?void 0:C.get(l,v)}clear(){this._data.clear()}}},6114:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isChromeOS=i.isLinux=i.isWindows=i.isIphone=i.isIpad=i.isMac=i.getSafariVersion=i.isSafari=i.isLegacyEdge=i.isFirefox=i.isNode=void 0,i.isNode=typeof process<"u"&&"title"in process;const c=i.isNode?"node":navigator.userAgent,m=i.isNode?"node":navigator.platform;i.isFirefox=c.includes("Firefox"),i.isLegacyEdge=c.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(c),i.getSafariVersion=function(){if(!i.isSafari)return 0;const g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(m),i.isIpad=m==="iPad",i.isIphone=m==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(m),i.isLinux=m.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(c)},6106:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SortedList=void 0;let c=0;i.SortedList=class{constructor(m){this._getKey=m,this._array=[]}clear(){this._array.length=0}insert(m){this._array.length!==0?(c=this._search(this._getKey(m)),this._array.splice(c,0,m)):this._array.push(m)}delete(m){if(this._array.length===0)return!1;const g=this._getKey(m);if(g===void 0||(c=this._search(g),c===-1)||this._getKey(this._array[c])!==g)return!1;do if(this._array[c]===m)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===g);return!1}*getKeyIterator(m){if(this._array.length!==0&&(c=this._search(m),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===m))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===m)}forEachByKey(m,g){if(this._array.length!==0&&(c=this._search(m),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===m))do g(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===m)}values(){return[...this._array].values()}_search(m){let g=0,l=this._array.length-1;for(;l>=g;){let v=g+l>>1;const C=this._getKey(this._array[v]);if(C>m)l=v-1;else{if(!(C<m)){for(;v>0&&this._getKey(this._array[v-1])===m;)v--;return v}g=v+1}}return g}}},7226:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;const m=c(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),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(C){this._idleCallback=void 0;let b=0,f=0,o=C.timeRemaining(),u=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),f=Math.max(b,f),u=C.timeRemaining(),1.5*f>u)return o-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(o-b))}ms`),void this._start();o=u}this.clear()}}class l extends g{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const b=Date.now()+C;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}i.PriorityTaskQueue=l,i.IdleTaskQueue=!m.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:l,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.updateWindowsModeWrappedState=void 0;const m=c(643);i.updateWindowsModeWrappedState=function(g){const l=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),v=l==null?void 0:l.get(g.cols-1),C=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);C&&v&&(C.isWrapped=v[m.CHAR_DATA_CODE_INDEX]!==m.NULL_CELL_CODE&&v[m.CHAR_DATA_CODE_INDEX]!==m.WHITESPACE_CELL_CODE)}},3734:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new m}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new c;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}i.AttributeData=c;class m{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,v=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=v}clone(){return new m(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=m},9092:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Buffer=i.MAX_BUFFER_SIZE=void 0;const m=c(6349),g=c(7226),l=c(3734),v=c(8437),C=c(4634),b=c(511),f=c(643),o=c(4863),u=c(7116);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(a,h,y){this._hasScrollback=a,this._optionsService=h,this._bufferService=y,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=u.DEFAULT_CHARSET,this.markers=[],this._nullCell=b.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]),this._whitespaceCell=b.CellData.fromCharData([0,f.WHITESPACE_CELL_CHAR,f.WHITESPACE_CELL_WIDTH,f.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new m.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(a){return a?(this._nullCell.fg=a.fg,this._nullCell.bg=a.bg,this._nullCell.extended=a.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new l.ExtendedAttrs),this._nullCell}getWhitespaceCell(a){return a?(this._whitespaceCell.fg=a.fg,this._whitespaceCell.bg=a.bg,this._whitespaceCell.extended=a.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new l.ExtendedAttrs),this._whitespaceCell}getBlankLine(a,h){return new v.BufferLine(this._bufferService.cols,this.getNullCell(a),h)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const a=this.ybase+this.y-this.ydisp;return a>=0&&a<this._rows}_getCorrectBufferLength(a){if(!this._hasScrollback)return a;const h=a+this._optionsService.rawOptions.scrollback;return h>i.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:h}fillViewportRows(a){if(this.lines.length===0){a===void 0&&(a=v.DEFAULT_ATTR_DATA);let h=this._rows;for(;h--;)this.lines.push(this.getBlankLine(a))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new m.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(a,h){const y=this.getNullCell(v.DEFAULT_ATTR_DATA);let L=0;const k=this._getCorrectBufferLength(h);if(k>this.lines.maxLength&&(this.lines.maxLength=k),this.lines.length>0){if(this._cols<a)for(let x=0;x<this.lines.length;x++)L+=+this.lines.get(x).resize(a,y);let A=0;if(this._rows<h)for(let x=this._rows;x<h;x++)this.lines.length<h+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(a,y)):this.ybase>0&&this.lines.length<=this.ybase+this.y+A+1?(this.ybase--,A++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(a,y)));else for(let x=this._rows;x>h;x--)this.lines.length>h+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(k<this.lines.maxLength){const x=this.lines.length-k;x>0&&(this.lines.trimStart(x),this.ybase=Math.max(this.ybase-x,0),this.ydisp=Math.max(this.ydisp-x,0),this.savedY=Math.max(this.savedY-x,0)),this.lines.maxLength=k}this.x=Math.min(this.x,a-1),this.y=Math.min(this.y,h-1),A&&(this.y+=A),this.savedX=Math.min(this.savedX,a-1),this.scrollTop=0}if(this.scrollBottom=h-1,this._isReflowEnabled&&(this._reflow(a,h),this._cols>a))for(let A=0;A<this.lines.length;A++)L+=+this.lines.get(A).resize(a,y);this._cols=a,this._rows=h,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let a=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,a=!1);let h=0;for(;this._memoryCleanupPosition<this.lines.length;)if(h+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),h>100)return!0;return a}get _isReflowEnabled(){const a=this._optionsService.rawOptions.windowsPty;return a&&a.buildNumber?this._hasScrollback&&a.backend==="conpty"&&a.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(a,h){this._cols!==a&&(a>this._cols?this._reflowLarger(a,h):this._reflowSmaller(a,h))}_reflowLarger(a,h){const y=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,a,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(y.length>0){const L=(0,C.reflowLargerCreateNewLayout)(this.lines,y);(0,C.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(a,h,L.countRemoved)}}_reflowLargerAdjustViewport(a,h,y){const L=this.getNullCell(v.DEFAULT_ATTR_DATA);let k=y;for(;k-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<h&&this.lines.push(new v.BufferLine(a,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-y,0)}_reflowSmaller(a,h){const y=this.getNullCell(v.DEFAULT_ATTR_DATA),L=[];let k=0;for(let A=this.lines.length-1;A>=0;A--){let x=this.lines.get(A);if(!x||!x.isWrapped&&x.getTrimmedLength()<=a)continue;const E=[x];for(;x.isWrapped&&A>0;)x=this.lines.get(--A),E.unshift(x);const T=this.ybase+this.y;if(T>=A&&T<A+E.length)continue;const j=E[E.length-1].getTrimmedLength(),D=(0,C.reflowSmallerGetNewLineLengths)(E,this._cols,a),B=D.length-E.length;let z;z=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 X=[];for(let O=0;O<B;O++){const U=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);X.push(U)}X.length>0&&(L.push({start:A+E.length+k,newLines:X}),k+=X.length),E.push(...X);let Z=D.length-1,Y=D[Z];Y===0&&(Z--,Y=D[Z]);let V=E.length-B-1,I=j;for(;V>=0;){const O=Math.min(I,Y);if(E[Z]===void 0)break;if(E[Z].copyCellsFrom(E[V],I-O,Y-O,O,!0),Y-=O,Y===0&&(Z--,Y=D[Z]),I-=O,I===0){V--;const U=Math.max(V,0);I=(0,C.getWrappedLineTrimmedLength)(E,U,this._cols)}}for(let O=0;O<E.length;O++)D[O]<a&&E[O].setCell(D[O],y);let $=B-z;for(;$-- >0;)this.ybase===0?this.y<h-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+k)-h&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+B,this.ybase+h-1)}if(L.length>0){const A=[],x=[];for(let Z=0;Z<this.lines.length;Z++)x.push(this.lines.get(Z));const E=this.lines.length;let T=E-1,j=0,D=L[j];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+k);let B=0;for(let Z=Math.min(this.lines.maxLength-1,E+k-1);Z>=0;Z--)if(D&&D.start>T+B){for(let Y=D.newLines.length-1;Y>=0;Y--)this.lines.set(Z--,D.newLines[Y]);Z++,A.push({index:T+1,amount:D.newLines.length}),B+=D.newLines.length,D=L[++j]}else this.lines.set(Z,x[T--]);let z=0;for(let Z=A.length-1;Z>=0;Z--)A[Z].index+=z,this.lines.onInsertEmitter.fire(A[Z]),z+=A[Z].amount;const X=Math.max(0,E+k-this.lines.maxLength);X>0&&this.lines.onTrimEmitter.fire(X)}}translateBufferLineToString(a,h,y=0,L){const k=this.lines.get(a);return k?k.translateToString(h,y,L):""}getWrappedRangeForLine(a){let h=a,y=a;for(;h>0&&this.lines.get(h).isWrapped;)h--;for(;y+1<this.lines.length&&this.lines.get(y+1).isWrapped;)y++;return{first:h,last:y}}setupTabStops(a){for(a!=null?this.tabs[a]||(a=this.prevStop(a)):(this.tabs={},a=0);a<this._cols;a+=this._optionsService.rawOptions.tabStopWidth)this.tabs[a]=!0}prevStop(a){for(a==null&&(a=this.x);!this.tabs[--a]&&a>0;);return a>=this._cols?this._cols-1:a<0?0:a}nextStop(a){for(a==null&&(a=this.x);!this.tabs[++a]&&a<this._cols;);return a>=this._cols?this._cols-1:a<0?0:a}clearMarkers(a){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].line===a&&(this.markers[h].dispose(),this.markers.splice(h--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let a=0;a<this.markers.length;a++)this.markers[a].dispose(),this.markers.splice(a--,1);this._isClearing=!1}addMarker(a){const h=new o.Marker(a);return this.markers.push(h),h.register(this.lines.onTrim((y=>{h.line-=y,h.line<0&&h.dispose()}))),h.register(this.lines.onInsert((y=>{h.line>=y.index&&(h.line+=y.amount)}))),h.register(this.lines.onDelete((y=>{h.line>=y.index&&h.line<y.index+y.amount&&h.dispose(),h.line>y.index&&(h.line-=y.amount)}))),h.register(h.onDispose((()=>this._removeMarker(h)))),h}_removeMarker(a){this._isClearing||this.markers.splice(this.markers.indexOf(a),1)}}},8437:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLine=i.DEFAULT_ATTR_DATA=void 0;const m=c(3734),g=c(511),l=c(643),v=c(482);i.DEFAULT_ATTR_DATA=Object.freeze(new m.AttributeData);let C=0;class b{constructor(o,u,a=!1){this.isWrapped=a,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*o);const h=u||g.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]);for(let y=0;y<o;++y)this.setCell(y,h);this.length=o}get(o){const u=this._data[3*o+0],a=2097151&u;return[this._data[3*o+1],2097152&u?this._combined[o]:a?(0,v.stringFromCodePoint)(a):"",u>>22,2097152&u?this._combined[o].charCodeAt(this._combined[o].length-1):a]}set(o,u){this._data[3*o+1]=u[l.CHAR_DATA_ATTR_INDEX],u[l.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[o]=u[1],this._data[3*o+0]=2097152|o|u[l.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*o+0]=u[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[l.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(o){return this._data[3*o+0]>>22}hasWidth(o){return 12582912&this._data[3*o+0]}getFg(o){return this._data[3*o+1]}getBg(o){return this._data[3*o+2]}hasContent(o){return 4194303&this._data[3*o+0]}getCodePoint(o){const u=this._data[3*o+0];return 2097152&u?this._combined[o].charCodeAt(this._combined[o].length-1):2097151&u}isCombined(o){return 2097152&this._data[3*o+0]}getString(o){const u=this._data[3*o+0];return 2097152&u?this._combined[o]:2097151&u?(0,v.stringFromCodePoint)(2097151&u):""}isProtected(o){return 536870912&this._data[3*o+2]}loadCell(o,u){return C=3*o,u.content=this._data[C+0],u.fg=this._data[C+1],u.bg=this._data[C+2],2097152&u.content&&(u.combinedData=this._combined[o]),268435456&u.bg&&(u.extended=this._extendedAttrs[o]),u}setCell(o,u){2097152&u.content&&(this._combined[o]=u.combinedData),268435456&u.bg&&(this._extendedAttrs[o]=u.extended),this._data[3*o+0]=u.content,this._data[3*o+1]=u.fg,this._data[3*o+2]=u.bg}setCellFromCodepoint(o,u,a,h){268435456&h.bg&&(this._extendedAttrs[o]=h.extended),this._data[3*o+0]=u|a<<22,this._data[3*o+1]=h.fg,this._data[3*o+2]=h.bg}addCodepointToCell(o,u,a){let h=this._data[3*o+0];2097152&h?this._combined[o]+=(0,v.stringFromCodePoint)(u):2097151&h?(this._combined[o]=(0,v.stringFromCodePoint)(2097151&h)+(0,v.stringFromCodePoint)(u),h&=-2097152,h|=2097152):h=u|4194304,a&&(h&=-12582913,h|=a<<22),this._data[3*o+0]=h}insertCells(o,u,a){if((o%=this.length)&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,a),u<this.length-o){const h=new g.CellData;for(let y=this.length-o-u-1;y>=0;--y)this.setCell(o+u+y,this.loadCell(o+y,h));for(let y=0;y<u;++y)this.setCell(o+y,a)}else for(let h=o;h<this.length;++h)this.setCell(h,a);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,a)}deleteCells(o,u,a){if(o%=this.length,u<this.length-o){const h=new g.CellData;for(let y=0;y<this.length-o-u;++y)this.setCell(o+y,this.loadCell(o+u+y,h));for(let y=this.length-u;y<this.length;++y)this.setCell(y,a)}else for(let h=o;h<this.length;++h)this.setCell(h,a);o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,a),this.getWidth(o)!==0||this.hasContent(o)||this.setCellFromCodepoint(o,0,1,a)}replaceCells(o,u,a,h=!1){if(h)for(o&&this.getWidth(o-1)===2&&!this.isProtected(o-1)&&this.setCellFromCodepoint(o-1,0,1,a),u<this.length&&this.getWidth(u-1)===2&&!this.isProtected(u)&&this.setCellFromCodepoint(u,0,1,a);o<u&&o<this.length;)this.isProtected(o)||this.setCell(o,a),o++;else for(o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,a),u<this.length&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u,0,1,a);o<u&&o<this.length;)this.setCell(o++,a)}resize(o,u){if(o===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const a=3*o;if(o>this.length){if(this._data.buffer.byteLength>=4*a)this._data=new Uint32Array(this._data.buffer,0,a);else{const h=new Uint32Array(a);h.set(this._data),this._data=h}for(let h=this.length;h<o;++h)this.setCell(h,u)}else{this._data=this._data.subarray(0,a);const h=Object.keys(this._combined);for(let L=0;L<h.length;L++){const k=parseInt(h[L],10);k>=o&&delete this._combined[k]}const y=Object.keys(this._extendedAttrs);for(let L=0;L<y.length;L++){const k=parseInt(y[L],10);k>=o&&delete this._extendedAttrs[k]}}return this.length=o,4*a*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const o=new Uint32Array(this._data.length);return o.set(this._data),this._data=o,1}return 0}fill(o,u=!1){if(u)for(let a=0;a<this.length;++a)this.isProtected(a)||this.setCell(a,o);else{this._combined={},this._extendedAttrs={};for(let a=0;a<this.length;++a)this.setCell(a,o)}}copyFrom(o){this.length!==o.length?this._data=new Uint32Array(o._data):this._data.set(o._data),this.length=o.length,this._combined={};for(const u in o._combined)this._combined[u]=o._combined[u];this._extendedAttrs={};for(const u in o._extendedAttrs)this._extendedAttrs[u]=o._extendedAttrs[u];this.isWrapped=o.isWrapped}clone(){const o=new b(0);o._data=new Uint32Array(this._data),o.length=this.length;for(const u in this._combined)o._combined[u]=this._combined[u];for(const u in this._extendedAttrs)o._extendedAttrs[u]=this._extendedAttrs[u];return o.isWrapped=this.isWrapped,o}getTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0])return o+(this._data[3*o+0]>>22);return 0}getNoBgTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0]||50331648&this._data[3*o+2])return o+(this._data[3*o+0]>>22);return 0}copyCellsFrom(o,u,a,h,y){const L=o._data;if(y)for(let A=h-1;A>=0;A--){for(let x=0;x<3;x++)this._data[3*(a+A)+x]=L[3*(u+A)+x];268435456&L[3*(u+A)+2]&&(this._extendedAttrs[a+A]=o._extendedAttrs[u+A])}else for(let A=0;A<h;A++){for(let x=0;x<3;x++)this._data[3*(a+A)+x]=L[3*(u+A)+x];268435456&L[3*(u+A)+2]&&(this._extendedAttrs[a+A]=o._extendedAttrs[u+A])}const k=Object.keys(o._combined);for(let A=0;A<k.length;A++){const x=parseInt(k[A],10);x>=u&&(this._combined[x-u+a]=o._combined[x])}}translateToString(o,u,a,h){u=u??0,a=a??this.length,o&&(a=Math.min(a,this.getTrimmedLength())),h&&(h.length=0);let y="";for(;u<a;){const L=this._data[3*u+0],k=2097151&L,A=2097152&L?this._combined[u]:k?(0,v.stringFromCodePoint)(k):l.WHITESPACE_CELL_CHAR;if(y+=A,h)for(let x=0;x<A.length;++x)h.push(u);u+=L>>22||1}return h&&h.push(u),y}}i.BufferLine=b},4841:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getRangeLength=void 0,i.getRangeLength=function(c,m){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return m*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(N,i)=>{function c(m,g,l){if(g===m.length-1)return m[g].getTrimmedLength();const v=!m[g].hasContent(l-1)&&m[g].getWidth(l-1)===1,C=m[g+1].getWidth(0)===2;return v&&C?l-1:l}Object.defineProperty(i,"__esModule",{value:!0}),i.getWrappedLineTrimmedLength=i.reflowSmallerGetNewLineLengths=i.reflowLargerApplyNewLayout=i.reflowLargerCreateNewLayout=i.reflowLargerGetLinesToRemove=void 0,i.reflowLargerGetLinesToRemove=function(m,g,l,v,C){const b=[];for(let f=0;f<m.length-1;f++){let o=f,u=m.get(++o);if(!u.isWrapped)continue;const a=[m.get(f)];for(;o<m.length&&u.isWrapped;)a.push(u),u=m.get(++o);if(v>=f&&v<o){f+=a.length-1;continue}let h=0,y=c(a,h,g),L=1,k=0;for(;L<a.length;){const x=c(a,L,g),E=x-k,T=l-y,j=Math.min(E,T);a[h].copyCellsFrom(a[L],k,y,j,!1),y+=j,y===l&&(h++,y=0),k+=j,k===x&&(L++,k=0),y===0&&h!==0&&a[h-1].getWidth(l-1)===2&&(a[h].copyCellsFrom(a[h-1],l-1,y++,1,!1),a[h-1].setCell(l-1,C))}a[h].replaceCells(y,l,C);let A=0;for(let x=a.length-1;x>0&&(x>h||a[x].getTrimmedLength()===0);x--)A++;A>0&&(b.push(f+a.length-A),b.push(A)),f+=a.length-1}return b},i.reflowLargerCreateNewLayout=function(m,g){const l=[];let v=0,C=g[v],b=0;for(let f=0;f<m.length;f++)if(C===f){const o=g[++v];m.onDeleteEmitter.fire({index:f-b,amount:o}),f+=o-1,b+=o,C=g[++v]}else l.push(f);return{layout:l,countRemoved:b}},i.reflowLargerApplyNewLayout=function(m,g){const l=[];for(let v=0;v<g.length;v++)l.push(m.get(g[v]));for(let v=0;v<l.length;v++)m.set(v,l[v]);m.length=g.length},i.reflowSmallerGetNewLineLengths=function(m,g,l){const v=[],C=m.map(((u,a)=>c(m,a,g))).reduce(((u,a)=>u+a));let b=0,f=0,o=0;for(;o<C;){if(C-o<l){v.push(C-o);break}b+=l;const u=c(m,f,g);b>u&&(b-=u,f++);const a=m[f].getWidth(b-1)===2;a&&b--;const h=a?l-1:l;v.push(h),o+=h}return v},i.getWrappedLineTrimmedLength=c},5295:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferSet=void 0;const m=c(8460),g=c(844),l=c(9092);class v extends g.Disposable{constructor(b,f){super(),this._optionsService=b,this._bufferService=f,this._onBufferActivate=this.register(new m.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new l.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new l.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(b){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(b),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(b,f){this._normal.resize(b,f),this._alt.resize(b,f),this.setupTabStops(b)}setupTabStops(b){this._normal.setupTabStops(b),this._alt.setupTabStops(b)}}i.BufferSet=v},511:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;const m=c(482),g=c(643),l=c(3734);class v extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const f=new v;return f.setFromCharData(b),f}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,m.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(b[g.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(b[g.CHAR_DATA_CHAR_INDEX].length===2){const o=b[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=o&&o<=56319){const u=b[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=u&&u<=57343?this.content=1024*(o-55296)+u-56320+65536|b[g.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=b[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[g.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=b[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=v},643:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WHITESPACE_CELL_CODE=i.WHITESPACE_CELL_WIDTH=i.WHITESPACE_CELL_CHAR=i.NULL_CELL_CODE=i.NULL_CELL_WIDTH=i.NULL_CELL_CHAR=i.CHAR_DATA_CODE_INDEX=i.CHAR_DATA_WIDTH_INDEX=i.CHAR_DATA_CHAR_INDEX=i.CHAR_DATA_ATTR_INDEX=i.DEFAULT_EXT=i.DEFAULT_ATTR=i.DEFAULT_COLOR=void 0,i.DEFAULT_COLOR=0,i.DEFAULT_ATTR=256|i.DEFAULT_COLOR<<9,i.DEFAULT_EXT=0,i.CHAR_DATA_ATTR_INDEX=0,i.CHAR_DATA_CHAR_INDEX=1,i.CHAR_DATA_WIDTH_INDEX=2,i.CHAR_DATA_CODE_INDEX=3,i.NULL_CELL_CHAR="",i.NULL_CELL_WIDTH=1,i.NULL_CELL_CODE=0,i.WHITESPACE_CELL_CHAR=" ",i.WHITESPACE_CELL_WIDTH=1,i.WHITESPACE_CELL_CODE=32},4863:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Marker=void 0;const m=c(8460),g=c(844);class l{get id(){return this._id}constructor(C){this.line=C,this.isDisposed=!1,this._disposables=[],this._id=l._nextId++,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(C){return this._disposables.push(C),C}}i.Marker=l,l._nextId=1},7116:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DEFAULT_CHARSET=i.CHARSETS=void 0,i.CHARSETS={},i.DEFAULT_CHARSET=i.CHARSETS.B,i.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:"≥","{":"π","|":"≠","}":"£","~":"·"},i.CHARSETS.A={"#":"£"},i.CHARSETS.B=void 0,i.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},i.CHARSETS.C=i.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},i.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},i.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},i.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},i.CHARSETS.E=i.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},i.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},i.CHARSETS.H=i.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(N,i)=>{var c,m,g;Object.defineProperty(i,"__esModule",{value:!0}),i.C1_ESCAPED=i.C1=i.C0=void 0,(function(l){l.NUL="\0",l.SOH="",l.STX="",l.ETX="",l.EOT="",l.ENQ="",l.ACK="",l.BEL="\x07",l.BS="\b",l.HT=" ",l.LF=`
110
- `,l.VT="\v",l.FF="\f",l.CR="\r",l.SO="",l.SI="",l.DLE="",l.DC1="",l.DC2="",l.DC3="",l.DC4="",l.NAK="",l.SYN="",l.ETB="",l.CAN="",l.EM="",l.SUB="",l.ESC="\x1B",l.FS="",l.GS="",l.RS="",l.US="",l.SP=" ",l.DEL=""})(c||(i.C0=c={})),(function(l){l.PAD="€",l.HOP="",l.BPH="‚",l.NBH="ƒ",l.IND="„",l.NEL="…",l.SSA="†",l.ESA="‡",l.HTS="ˆ",l.HTJ="‰",l.VTS="Š",l.PLD="‹",l.PLU="Œ",l.RI="",l.SS2="Ž",l.SS3="",l.DCS="",l.PU1="‘",l.PU2="’",l.STS="“",l.CCH="”",l.MW="•",l.SPA="–",l.EPA="—",l.SOS="˜",l.SGCI="™",l.SCI="š",l.CSI="›",l.ST="œ",l.OSC="",l.PM="ž",l.APC="Ÿ"})(m||(i.C1=m={})),(function(l){l.ST=`${c.ESC}\\`})(g||(i.C1_ESCAPED=g={}))},7399:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.evaluateKeyboardEvent=void 0;const m=c(2584),g={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};i.evaluateKeyboardEvent=function(l,v,C,b){const f={type:0,cancel:!1,key:void 0},o=(l.shiftKey?1:0)|(l.altKey?2:0)|(l.ctrlKey?4:0)|(l.metaKey?8:0);switch(l.keyCode){case 0:l.key==="UIKeyInputUpArrow"?f.key=v?m.C0.ESC+"OA":m.C0.ESC+"[A":l.key==="UIKeyInputLeftArrow"?f.key=v?m.C0.ESC+"OD":m.C0.ESC+"[D":l.key==="UIKeyInputRightArrow"?f.key=v?m.C0.ESC+"OC":m.C0.ESC+"[C":l.key==="UIKeyInputDownArrow"&&(f.key=v?m.C0.ESC+"OB":m.C0.ESC+"[B");break;case 8:f.key=l.ctrlKey?"\b":m.C0.DEL,l.altKey&&(f.key=m.C0.ESC+f.key);break;case 9:if(l.shiftKey){f.key=m.C0.ESC+"[Z";break}f.key=m.C0.HT,f.cancel=!0;break;case 13:f.key=l.altKey?m.C0.ESC+m.C0.CR:m.C0.CR,f.cancel=!0;break;case 27:f.key=m.C0.ESC,l.altKey&&(f.key=m.C0.ESC+m.C0.ESC),f.cancel=!0;break;case 37:if(l.metaKey)break;o?(f.key=m.C0.ESC+"[1;"+(o+1)+"D",f.key===m.C0.ESC+"[1;3D"&&(f.key=m.C0.ESC+(C?"b":"[1;5D"))):f.key=v?m.C0.ESC+"OD":m.C0.ESC+"[D";break;case 39:if(l.metaKey)break;o?(f.key=m.C0.ESC+"[1;"+(o+1)+"C",f.key===m.C0.ESC+"[1;3C"&&(f.key=m.C0.ESC+(C?"f":"[1;5C"))):f.key=v?m.C0.ESC+"OC":m.C0.ESC+"[C";break;case 38:if(l.metaKey)break;o?(f.key=m.C0.ESC+"[1;"+(o+1)+"A",C||f.key!==m.C0.ESC+"[1;3A"||(f.key=m.C0.ESC+"[1;5A")):f.key=v?m.C0.ESC+"OA":m.C0.ESC+"[A";break;case 40:if(l.metaKey)break;o?(f.key=m.C0.ESC+"[1;"+(o+1)+"B",C||f.key!==m.C0.ESC+"[1;3B"||(f.key=m.C0.ESC+"[1;5B")):f.key=v?m.C0.ESC+"OB":m.C0.ESC+"[B";break;case 45:l.shiftKey||l.ctrlKey||(f.key=m.C0.ESC+"[2~");break;case 46:f.key=o?m.C0.ESC+"[3;"+(o+1)+"~":m.C0.ESC+"[3~";break;case 36:f.key=o?m.C0.ESC+"[1;"+(o+1)+"H":v?m.C0.ESC+"OH":m.C0.ESC+"[H";break;case 35:f.key=o?m.C0.ESC+"[1;"+(o+1)+"F":v?m.C0.ESC+"OF":m.C0.ESC+"[F";break;case 33:l.shiftKey?f.type=2:l.ctrlKey?f.key=m.C0.ESC+"[5;"+(o+1)+"~":f.key=m.C0.ESC+"[5~";break;case 34:l.shiftKey?f.type=3:l.ctrlKey?f.key=m.C0.ESC+"[6;"+(o+1)+"~":f.key=m.C0.ESC+"[6~";break;case 112:f.key=o?m.C0.ESC+"[1;"+(o+1)+"P":m.C0.ESC+"OP";break;case 113:f.key=o?m.C0.ESC+"[1;"+(o+1)+"Q":m.C0.ESC+"OQ";break;case 114:f.key=o?m.C0.ESC+"[1;"+(o+1)+"R":m.C0.ESC+"OR";break;case 115:f.key=o?m.C0.ESC+"[1;"+(o+1)+"S":m.C0.ESC+"OS";break;case 116:f.key=o?m.C0.ESC+"[15;"+(o+1)+"~":m.C0.ESC+"[15~";break;case 117:f.key=o?m.C0.ESC+"[17;"+(o+1)+"~":m.C0.ESC+"[17~";break;case 118:f.key=o?m.C0.ESC+"[18;"+(o+1)+"~":m.C0.ESC+"[18~";break;case 119:f.key=o?m.C0.ESC+"[19;"+(o+1)+"~":m.C0.ESC+"[19~";break;case 120:f.key=o?m.C0.ESC+"[20;"+(o+1)+"~":m.C0.ESC+"[20~";break;case 121:f.key=o?m.C0.ESC+"[21;"+(o+1)+"~":m.C0.ESC+"[21~";break;case 122:f.key=o?m.C0.ESC+"[23;"+(o+1)+"~":m.C0.ESC+"[23~";break;case 123:f.key=o?m.C0.ESC+"[24;"+(o+1)+"~":m.C0.ESC+"[24~";break;default:if(!l.ctrlKey||l.shiftKey||l.altKey||l.metaKey)if(C&&!b||!l.altKey||l.metaKey)!C||l.altKey||l.ctrlKey||l.shiftKey||!l.metaKey?l.key&&!l.ctrlKey&&!l.altKey&&!l.metaKey&&l.keyCode>=48&&l.key.length===1?f.key=l.key:l.key&&l.ctrlKey&&(l.key==="_"&&(f.key=m.C0.US),l.key==="@"&&(f.key=m.C0.NUL)):l.keyCode===65&&(f.type=1);else{const u=g[l.keyCode],a=u==null?void 0:u[l.shiftKey?1:0];if(a)f.key=m.C0.ESC+a;else if(l.keyCode>=65&&l.keyCode<=90){const h=l.ctrlKey?l.keyCode-64:l.keyCode+32;let y=String.fromCharCode(h);l.shiftKey&&(y=y.toUpperCase()),f.key=m.C0.ESC+y}else if(l.keyCode===32)f.key=m.C0.ESC+(l.ctrlKey?m.C0.NUL:" ");else if(l.key==="Dead"&&l.code.startsWith("Key")){let h=l.code.slice(3,4);l.shiftKey||(h=h.toLowerCase()),f.key=m.C0.ESC+h,f.cancel=!0}}else l.keyCode>=65&&l.keyCode<=90?f.key=String.fromCharCode(l.keyCode-64):l.keyCode===32?f.key=m.C0.NUL:l.keyCode>=51&&l.keyCode<=55?f.key=String.fromCharCode(l.keyCode-51+27):l.keyCode===56?f.key=m.C0.DEL:l.keyCode===219?f.key=m.C0.ESC:l.keyCode===220?f.key=m.C0.FS:l.keyCode===221&&(f.key=m.C0.GS)}return f}},482:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Utf8ToUtf32=i.StringToUtf32=i.utf32ToString=i.stringFromCodePoint=void 0,i.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},i.utf32ToString=function(c,m=0,g=c.length){let l="";for(let v=m;v<g;++v){let C=c[v];C>65535?(C-=65536,l+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):l+=String.fromCharCode(C)}return l},i.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,m){const g=c.length;if(!g)return 0;let l=0,v=0;if(this._interim){const C=c.charCodeAt(v++);56320<=C&&C<=57343?m[l++]=1024*(this._interim-55296)+C-56320+65536:(m[l++]=this._interim,m[l++]=C),this._interim=0}for(let C=v;C<g;++C){const b=c.charCodeAt(C);if(55296<=b&&b<=56319){if(++C>=g)return this._interim=b,l;const f=c.charCodeAt(C);56320<=f&&f<=57343?m[l++]=1024*(b-55296)+f-56320+65536:(m[l++]=b,m[l++]=f)}else b!==65279&&(m[l++]=b)}return l}},i.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,m){const g=c.length;if(!g)return 0;let l,v,C,b,f=0,o=0,u=0;if(this.interim[0]){let y=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let k,A=0;for(;(k=63&this.interim[++A])&&A<4;)L<<=6,L|=k;const x=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=x-A;for(;u<E;){if(u>=g)return 0;if(k=c[u++],(192&k)!=128){u--,y=!0;break}this.interim[A++]=k,L<<=6,L|=63&k}y||(x===2?L<128?u--:m[f++]=L:x===3?L<2048||L>=55296&&L<=57343||L===65279||(m[f++]=L):L<65536||L>1114111||(m[f++]=L)),this.interim.fill(0)}const a=g-4;let h=u;for(;h<g;){for(;!(!(h<a)||128&(l=c[h])||128&(v=c[h+1])||128&(C=c[h+2])||128&(b=c[h+3]));)m[f++]=l,m[f++]=v,m[f++]=C,m[f++]=b,h+=4;if(l=c[h++],l<128)m[f++]=l;else if((224&l)==192){if(h>=g)return this.interim[0]=l,f;if(v=c[h++],(192&v)!=128){h--;continue}if(o=(31&l)<<6|63&v,o<128){h--;continue}m[f++]=o}else if((240&l)==224){if(h>=g)return this.interim[0]=l,f;if(v=c[h++],(192&v)!=128){h--;continue}if(h>=g)return this.interim[0]=l,this.interim[1]=v,f;if(C=c[h++],(192&C)!=128){h--;continue}if(o=(15&l)<<12|(63&v)<<6|63&C,o<2048||o>=55296&&o<=57343||o===65279)continue;m[f++]=o}else if((248&l)==240){if(h>=g)return this.interim[0]=l,f;if(v=c[h++],(192&v)!=128){h--;continue}if(h>=g)return this.interim[0]=l,this.interim[1]=v,f;if(C=c[h++],(192&C)!=128){h--;continue}if(h>=g)return this.interim[0]=l,this.interim[1]=v,this.interim[2]=C,f;if(b=c[h++],(192&b)!=128){h--;continue}if(o=(7&l)<<18|(63&v)<<12|(63&C)<<6|63&b,o<65536||o>1114111)continue;m[f++]=o}}return f}}},225:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeV6=void 0;const m=c(1480),g=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],l=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let v;i.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let C=0;C<g.length;++C)v.fill(0,g[C][0],g[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?v[C]:(function(b,f){let o,u=0,a=f.length-1;if(b<f[0][0]||b>f[a][1])return!1;for(;a>=u;)if(o=u+a>>1,b>f[o][1])u=o+1;else{if(!(b<f[o][0]))return!0;a=o-1}return!1})(C,l)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,b){let f=this.wcwidth(C),o=f===0&&b!==0;if(o){const u=m.UnicodeService.extractWidth(b);u===0?o=!1:u>f&&(f=u)}return m.UnicodeService.createPropertyValue(0,f,o)}}},5981:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WriteBuffer=void 0;const m=c(8460),g=c(844);class l extends g.Disposable{constructor(C){super(),this._action=C,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new m.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(C,b){if(b!==void 0&&this._syncCalls>b)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let f;for(this._isSyncWriting=!0;f=this._writeBuffer.shift();){this._action(f);const o=this._callbacks.shift();o&&o()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,b){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+=C.length,this._writeBuffer.push(C),this._callbacks.push(b),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(b)}_innerWrite(C=0,b=!0){const f=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const o=this._writeBuffer[this._bufferOffset],u=this._action(o,b);if(u){const h=y=>Date.now()-f>=12?setTimeout((()=>this._innerWrite(0,y))):this._innerWrite(f,y);return void u.catch((y=>(queueMicrotask((()=>{throw y})),Promise.resolve(!1)))).then(h)}const a=this._callbacks[this._bufferOffset];if(a&&a(),this._bufferOffset++,this._pendingData-=o.length,Date.now()-f>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}i.WriteBuffer=l},5941:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.toRgbString=i.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,m=/^[\da-f]+$/;function g(l,v){const C=l.toString(16),b=C.length<2?"0"+C:C;switch(v){case 4:return C[0];case 8:return b;case 12:return(b+b).slice(0,3);default:return b+b}}i.parseColor=function(l){if(!l)return;let v=l.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const C=c.exec(v);if(C){const b=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/b*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/b*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/b*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),m.exec(v)&&[3,6,9,12].includes(v.length))){const C=v.length/3,b=[0,0,0];for(let f=0;f<3;++f){const o=parseInt(v.slice(C*f,C*f+C),16);b[f]=C===1?o<<4:C===2?o:C===3?o>>4:o>>8}return b}},i.toRgbString=function(l,v=16){const[C,b,f]=l;return`rgb:${g(C,v)}/${g(b,v)}/${g(f,v)}`}},5770:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PAYLOAD_LIMIT=void 0,i.PAYLOAD_LIMIT=1e7},6351:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DcsHandler=i.DcsParser=void 0;const m=c(482),g=c(8742),l=c(5770),v=[];i.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(b,f){this._handlers[b]===void 0&&(this._handlers[b]=[]);const o=this._handlers[b];return o.push(f),{dispose:()=>{const u=o.indexOf(f);u!==-1&&o.splice(u,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}reset(){if(this._active.length)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(b,f){if(this.reset(),this._ident=b,this._active=this._handlers[b]||v,this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].hook(f);else this._handlerFb(this._ident,"HOOK",f)}put(b,f,o){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(b,f,o);else this._handlerFb(this._ident,"PUT",(0,m.utf32ToString)(b,f,o))}unhook(b,f=!0){if(this._active.length){let o=!1,u=this._active.length-1,a=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,o=f,a=this._stack.fallThrough,this._stack.paused=!1),!a&&o===!1){for(;u>=0&&(o=this._active[u].unhook(b),o!==!0);u--)if(o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,o;u--}for(;u>=0;u--)if(o=this._active[u].unhook(!1),o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,o}else this._handlerFb(this._ident,"UNHOOK",b);this._active=v,this._ident=0}};const C=new g.Params;C.addParam(0),i.DcsHandler=class{constructor(b){this._handler=b,this._data="",this._params=C,this._hitLimit=!1}hook(b){this._params=b.length>1||b.params[0]?b.clone():C,this._data="",this._hitLimit=!1}put(b,f,o){this._hitLimit||(this._data+=(0,m.utf32ToString)(b,f,o),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(b){let f=!1;if(this._hitLimit)f=!1;else if(b&&(f=this._handler(this._data,this._params),f instanceof Promise))return f.then((o=>(this._params=C,this._data="",this._hitLimit=!1,o)));return this._params=C,this._data="",this._hitLimit=!1,f}}},2015:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.EscapeSequenceParser=i.VT500_TRANSITION_TABLE=i.TransitionTable=void 0;const m=c(844),g=c(8742),l=c(6242),v=c(6351);class C{constructor(u){this.table=new Uint8Array(u)}setDefault(u,a){this.table.fill(u<<4|a)}add(u,a,h,y){this.table[a<<8|u]=h<<4|y}addMany(u,a,h,y){for(let L=0;L<u.length;L++)this.table[a<<8|u[L]]=h<<4|y}}i.TransitionTable=C;const b=160;i.VT500_TRANSITION_TABLE=(function(){const o=new C(4095),u=Array.apply(null,Array(256)).map(((A,x)=>x)),a=(A,x)=>u.slice(A,x),h=a(32,127),y=a(0,24);y.push(25),y.push.apply(y,a(28,32));const L=a(0,14);let k;for(k in o.setDefault(1,0),o.addMany(h,0,2,0),L)o.addMany([24,26,153,154],k,3,0),o.addMany(a(128,144),k,3,0),o.addMany(a(144,152),k,3,0),o.add(156,k,0,0),o.add(27,k,11,1),o.add(157,k,4,8),o.addMany([152,158,159],k,0,7),o.add(155,k,11,3),o.add(144,k,11,9);return o.addMany(y,0,3,0),o.addMany(y,1,3,1),o.add(127,1,0,1),o.addMany(y,8,0,8),o.addMany(y,3,3,3),o.add(127,3,0,3),o.addMany(y,4,3,4),o.add(127,4,0,4),o.addMany(y,6,3,6),o.addMany(y,5,3,5),o.add(127,5,0,5),o.addMany(y,2,3,2),o.add(127,2,0,2),o.add(93,1,4,8),o.addMany(h,8,5,8),o.add(127,8,5,8),o.addMany([156,27,24,26,7],8,6,0),o.addMany(a(28,32),8,0,8),o.addMany([88,94,95],1,0,7),o.addMany(h,7,0,7),o.addMany(y,7,0,7),o.add(156,7,0,0),o.add(127,7,0,7),o.add(91,1,11,3),o.addMany(a(64,127),3,7,0),o.addMany(a(48,60),3,8,4),o.addMany([60,61,62,63],3,9,4),o.addMany(a(48,60),4,8,4),o.addMany(a(64,127),4,7,0),o.addMany([60,61,62,63],4,0,6),o.addMany(a(32,64),6,0,6),o.add(127,6,0,6),o.addMany(a(64,127),6,0,0),o.addMany(a(32,48),3,9,5),o.addMany(a(32,48),5,9,5),o.addMany(a(48,64),5,0,6),o.addMany(a(64,127),5,7,0),o.addMany(a(32,48),4,9,5),o.addMany(a(32,48),1,9,2),o.addMany(a(32,48),2,9,2),o.addMany(a(48,127),2,10,0),o.addMany(a(48,80),1,10,0),o.addMany(a(81,88),1,10,0),o.addMany([89,90,92],1,10,0),o.addMany(a(96,127),1,10,0),o.add(80,1,11,9),o.addMany(y,9,0,9),o.add(127,9,0,9),o.addMany(a(28,32),9,0,9),o.addMany(a(32,48),9,9,12),o.addMany(a(48,60),9,8,10),o.addMany([60,61,62,63],9,9,10),o.addMany(y,11,0,11),o.addMany(a(32,128),11,0,11),o.addMany(a(28,32),11,0,11),o.addMany(y,10,0,10),o.add(127,10,0,10),o.addMany(a(28,32),10,0,10),o.addMany(a(48,60),10,8,10),o.addMany([60,61,62,63],10,0,11),o.addMany(a(32,48),10,9,12),o.addMany(y,12,0,12),o.add(127,12,0,12),o.addMany(a(28,32),12,0,12),o.addMany(a(32,48),12,9,12),o.addMany(a(48,64),12,0,11),o.addMany(a(64,127),12,12,13),o.addMany(a(64,127),10,12,13),o.addMany(a(64,127),9,12,13),o.addMany(y,13,13,13),o.addMany(h,13,13,13),o.add(127,13,0,13),o.addMany([27,156,24,26],13,14,0),o.add(b,0,2,0),o.add(b,8,5,8),o.add(b,6,0,6),o.add(b,11,0,11),o.add(b,13,13,13),o})();class f extends m.Disposable{constructor(u=i.VT500_TRANSITION_TABLE){super(),this._transitions=u,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(a,h,y)=>{},this._executeHandlerFb=a=>{},this._csiHandlerFb=(a,h)=>{},this._escHandlerFb=a=>{},this._errorHandlerFb=a=>a,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,m.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new l.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(u,a=[64,126]){let h=0;if(u.prefix){if(u.prefix.length>1)throw new Error("only one byte as prefix supported");if(h=u.prefix.charCodeAt(0),h&&60>h||h>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(u.intermediates){if(u.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let L=0;L<u.intermediates.length;++L){const k=u.intermediates.charCodeAt(L);if(32>k||k>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");h<<=8,h|=k}}if(u.final.length!==1)throw new Error("final must be a single byte");const y=u.final.charCodeAt(0);if(a[0]>y||y>a[1])throw new Error(`final must be in range ${a[0]} .. ${a[1]}`);return h<<=8,h|=y,h}identToString(u){const a=[];for(;u;)a.push(String.fromCharCode(255&u)),u>>=8;return a.reverse().join("")}setPrintHandler(u){this._printHandler=u}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(u,a){const h=this._identifier(u,[48,126]);this._escHandlers[h]===void 0&&(this._escHandlers[h]=[]);const y=this._escHandlers[h];return y.push(a),{dispose:()=>{const L=y.indexOf(a);L!==-1&&y.splice(L,1)}}}clearEscHandler(u){this._escHandlers[this._identifier(u,[48,126])]&&delete this._escHandlers[this._identifier(u,[48,126])]}setEscHandlerFallback(u){this._escHandlerFb=u}setExecuteHandler(u,a){this._executeHandlers[u.charCodeAt(0)]=a}clearExecuteHandler(u){this._executeHandlers[u.charCodeAt(0)]&&delete this._executeHandlers[u.charCodeAt(0)]}setExecuteHandlerFallback(u){this._executeHandlerFb=u}registerCsiHandler(u,a){const h=this._identifier(u);this._csiHandlers[h]===void 0&&(this._csiHandlers[h]=[]);const y=this._csiHandlers[h];return y.push(a),{dispose:()=>{const L=y.indexOf(a);L!==-1&&y.splice(L,1)}}}clearCsiHandler(u){this._csiHandlers[this._identifier(u)]&&delete this._csiHandlers[this._identifier(u)]}setCsiHandlerFallback(u){this._csiHandlerFb=u}registerDcsHandler(u,a){return this._dcsParser.registerHandler(this._identifier(u),a)}clearDcsHandler(u){this._dcsParser.clearHandler(this._identifier(u))}setDcsHandlerFallback(u){this._dcsParser.setHandlerFallback(u)}registerOscHandler(u,a){return this._oscParser.registerHandler(u,a)}clearOscHandler(u){this._oscParser.clearHandler(u)}setOscHandlerFallback(u){this._oscParser.setHandlerFallback(u)}setErrorHandler(u){this._errorHandler=u}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(u,a,h,y,L){this._parseStack.state=u,this._parseStack.handlers=a,this._parseStack.handlerPos=h,this._parseStack.transition=y,this._parseStack.chunkPos=L}parse(u,a,h){let y,L=0,k=0,A=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,A=this._parseStack.chunkPos+1;else{if(h===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const x=this._parseStack.handlers;let E=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(h===!1&&E>-1){for(;E>=0&&(y=x[E](this._params),y!==!0);E--)if(y instanceof Promise)return this._parseStack.handlerPos=E,y}this._parseStack.handlers=[];break;case 4:if(h===!1&&E>-1){for(;E>=0&&(y=x[E](),y!==!0);E--)if(y instanceof Promise)return this._parseStack.handlerPos=E,y}this._parseStack.handlers=[];break;case 6:if(L=u[this._parseStack.chunkPos],y=this._dcsParser.unhook(L!==24&&L!==26,h),y)return y;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=u[this._parseStack.chunkPos],y=this._oscParser.end(L!==24&&L!==26,h),y)return y;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,A=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let x=A;x<a;++x){switch(L=u[x],k=this._transitions.table[this.currentState<<8|(L<160?L:b)],k>>4){case 2:for(let B=x+1;;++B){if(B>=a||(L=u[B])<32||L>126&&L<b){this._printHandler(u,x,B),x=B-1;break}if(++B>=a||(L=u[B])<32||L>126&&L<b){this._printHandler(u,x,B),x=B-1;break}if(++B>=a||(L=u[B])<32||L>126&&L<b){this._printHandler(u,x,B),x=B-1;break}if(++B>=a||(L=u[B])<32||L>126&&L<b){this._printHandler(u,x,B),x=B-1;break}}break;case 3:this._executeHandlers[L]?this._executeHandlers[L]():this._executeHandlerFb(L),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:x,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const E=this._csiHandlers[this._collect<<8|L];let T=E?E.length-1:-1;for(;T>=0&&(y=E[T](this._params),y!==!0);T--)if(y instanceof Promise)return this._preserveStack(3,E,T,k,x),y;T<0&&this._csiHandlerFb(this._collect<<8|L,this._params),this.precedingJoinState=0;break;case 8:do switch(L){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(L-48)}while(++x<a&&(L=u[x])>47&&L<60);x--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const j=this._escHandlers[this._collect<<8|L];let D=j?j.length-1:-1;for(;D>=0&&(y=j[D](),y!==!0);D--)if(y instanceof Promise)return this._preserveStack(4,j,D,k,x),y;D<0&&this._escHandlerFb(this._collect<<8|L),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|L,this._params);break;case 13:for(let B=x+1;;++B)if(B>=a||(L=u[B])===24||L===26||L===27||L>127&&L<b){this._dcsParser.put(u,x,B),x=B-1;break}break;case 14:if(y=this._dcsParser.unhook(L!==24&&L!==26),y)return this._preserveStack(6,[],0,k,x),y;L===27&&(k|=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=x+1;;B++)if(B>=a||(L=u[B])<32||L>127&&L<b){this._oscParser.put(u,x,B),x=B-1;break}break;case 6:if(y=this._oscParser.end(L!==24&&L!==26),y)return this._preserveStack(5,[],0,k,x),y;L===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&k}}}i.EscapeSequenceParser=f},6242:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OscHandler=i.OscParser=void 0;const m=c(5770),g=c(482),l=[];i.OscParser=class{constructor(){this._state=0,this._active=l,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,C){this._handlers[v]===void 0&&(this._handlers[v]=[]);const b=this._handlers[v];return b.push(C),{dispose:()=>{const f=b.indexOf(C);f!==-1&&b.splice(f,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||l,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,C,b){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(v,C,b);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(v,C,b))}start(){this.reset(),this._state=1}put(v,C,b){if(this._state!==3){if(this._state===1)for(;C<b;){const f=v[C++];if(f===59){this._state=2,this._start();break}if(f<48||57<f)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+f-48}this._state===2&&b-C>0&&this._put(v,C,b)}}end(v,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let b=!1,f=this._active.length-1,o=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,b=C,o=this._stack.fallThrough,this._stack.paused=!1),!o&&b===!1){for(;f>=0&&(b=this._active[f].end(v),b!==!0);f--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,b;f--}for(;f>=0;f--)if(b=this._active[f].end(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,b}else this._handlerFb(this._id,"END",v);this._active=l,this._id=-1,this._state=0}}},i.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,C,b){this._hitLimit||(this._data+=(0,g.utf32ToString)(v,C,b),this._data.length>m.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let C=!1;if(this._hitLimit)C=!1;else if(v&&(C=this._handler(this._data),C instanceof Promise))return C.then((b=>(this._data="",this._hitLimit=!1,b)));return this._data="",this._hitLimit=!1,C}}},8742:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Params=void 0;const c=2147483647;class m{static fromArray(l){const v=new m;if(!l.length)return v;for(let C=Array.isArray(l[0])?1:0;C<l.length;++C){const b=l[C];if(Array.isArray(b))for(let f=0;f<b.length;++f)v.addSubParam(b[f]);else v.addParam(b)}return v}constructor(l=32,v=32){if(this.maxLength=l,this.maxSubParamsLength=v,v>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(l),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(l),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const l=new m(this.maxLength,this.maxSubParamsLength);return l.params.set(this.params),l.length=this.length,l._subParams.set(this._subParams),l._subParamsLength=this._subParamsLength,l._subParamsIdx.set(this._subParamsIdx),l._rejectDigits=this._rejectDigits,l._rejectSubDigits=this._rejectSubDigits,l._digitIsSub=this._digitIsSub,l}toArray(){const l=[];for(let v=0;v<this.length;++v){l.push(this.params[v]);const C=this._subParamsIdx[v]>>8,b=255&this._subParamsIdx[v];b-C>0&&l.push(Array.prototype.slice.call(this._subParams,C,b))}return l}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(l){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=l>c?c:l}}addSubParam(l){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=l>c?c:l,this._subParamsIdx[this.length-1]++}}hasSubParams(l){return(255&this._subParamsIdx[l])-(this._subParamsIdx[l]>>8)>0}getSubParams(l){const v=this._subParamsIdx[l]>>8,C=255&this._subParamsIdx[l];return C-v>0?this._subParams.subarray(v,C):null}getSubParamsAll(){const l={};for(let v=0;v<this.length;++v){const C=this._subParamsIdx[v]>>8,b=255&this._subParamsIdx[v];b-C>0&&(l[v]=this._subParams.slice(C,b))}return l}addDigit(l){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,b=C[v-1];C[v-1]=~b?Math.min(10*b+l,c):l}}i.Params=m},5741:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.AddonManager=void 0,i.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,m){const g={instance:m,dispose:m.dispose,isDisposed:!1};this._addons.push(g),m.dispose=()=>this._wrappedAddonDispose(g),m.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let m=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===c){m=g;break}if(m===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(m,1)}}},8771:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferApiView=void 0;const m=c(3785),g=c(511);i.BufferApiView=class{constructor(l,v){this._buffer=l,this.type=v}init(l){return this._buffer=l,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(l){const v=this._buffer.lines.get(l);if(v)return new m.BufferLineApiView(v)}getNullCell(){return new g.CellData}}},3785:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLineApiView=void 0;const m=c(511);i.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,l){if(!(g<0||g>=this._line.length))return l?(this._line.loadCell(g,l),l):this._line.loadCell(g,new m.CellData)}translateToString(g,l,v){return this._line.translateToString(g,l,v)}}},8285:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferNamespaceApi=void 0;const m=c(8771),g=c(8460),l=c(844);class v extends l.Disposable{constructor(b){super(),this._core=b,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new m.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new m.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)}}i.BufferNamespaceApi=v},7975:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ParserApi=void 0,i.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,m){return this._core.registerCsiHandler(c,(g=>m(g.toArray())))}addCsiHandler(c,m){return this.registerCsiHandler(c,m)}registerDcsHandler(c,m){return this._core.registerDcsHandler(c,((g,l)=>m(g,l.toArray())))}addDcsHandler(c,m){return this.registerDcsHandler(c,m)}registerEscHandler(c,m){return this._core.registerEscHandler(c,m)}addEscHandler(c,m){return this.registerEscHandler(c,m)}registerOscHandler(c,m){return this._core.registerOscHandler(c,m)}addOscHandler(c,m){return this.registerOscHandler(c,m)}}},7090:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeApi=void 0,i.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(N,i,c){var m=this&&this.__decorate||function(o,u,a,h){var y,L=arguments.length,k=L<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,a):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,u,a,h);else for(var A=o.length-1;A>=0;A--)(y=o[A])&&(k=(L<3?y(k):L>3?y(u,a,k):y(u,a))||k);return L>3&&k&&Object.defineProperty(u,a,k),k},g=this&&this.__param||function(o,u){return function(a,h){u(a,h,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferService=i.MINIMUM_ROWS=i.MINIMUM_COLS=void 0;const l=c(8460),v=c(844),C=c(5295),b=c(2585);i.MINIMUM_COLS=2,i.MINIMUM_ROWS=1;let f=i.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(o){super(),this.isUserScrolling=!1,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(o.rawOptions.cols||0,i.MINIMUM_COLS),this.rows=Math.max(o.rawOptions.rows||0,i.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(o,this))}resize(o,u){this.cols=o,this.rows=u,this.buffers.resize(o,u),this._onResize.fire({cols:o,rows:u})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(o,u=!1){const a=this.buffer;let h;h=this._cachedBlankLine,h&&h.length===this.cols&&h.getFg(0)===o.fg&&h.getBg(0)===o.bg||(h=a.getBlankLine(o,u),this._cachedBlankLine=h),h.isWrapped=u;const y=a.ybase+a.scrollTop,L=a.ybase+a.scrollBottom;if(a.scrollTop===0){const k=a.lines.isFull;L===a.lines.length-1?k?a.lines.recycle().copyFrom(h):a.lines.push(h.clone()):a.lines.splice(L+1,0,h.clone()),k?this.isUserScrolling&&(a.ydisp=Math.max(a.ydisp-1,0)):(a.ybase++,this.isUserScrolling||a.ydisp++)}else{const k=L-y+1;a.lines.shiftElements(y+1,k-1,-1),a.lines.set(L,h.clone())}this.isUserScrolling||(a.ydisp=a.ybase),this._onScroll.fire(a.ydisp)}scrollLines(o,u,a){const h=this.buffer;if(o<0){if(h.ydisp===0)return;this.isUserScrolling=!0}else o+h.ydisp>=h.ybase&&(this.isUserScrolling=!1);const y=h.ydisp;h.ydisp=Math.max(Math.min(h.ydisp+o,h.ybase),0),y!==h.ydisp&&(u||this._onScroll.fire(h.ydisp))}};i.BufferService=f=m([g(0,b.IOptionsService)],f)},7994:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CharsetService=void 0,i.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,m){this._charsets[c]=m,this.glevel===c&&(this.charset=m)}}},1753:function(N,i,c){var m=this&&this.__decorate||function(h,y,L,k){var A,x=arguments.length,E=x<3?y:k===null?k=Object.getOwnPropertyDescriptor(y,L):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(h,y,L,k);else for(var T=h.length-1;T>=0;T--)(A=h[T])&&(E=(x<3?A(E):x>3?A(y,L,E):A(y,L))||E);return x>3&&E&&Object.defineProperty(y,L,E),E},g=this&&this.__param||function(h,y){return function(L,k){y(L,k,h)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreMouseService=void 0;const l=c(2585),v=c(8460),C=c(844),b={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:h=>h.button!==4&&h.action===1&&(h.ctrl=!1,h.alt=!1,h.shift=!1,!0)},VT200:{events:19,restrict:h=>h.action!==32},DRAG:{events:23,restrict:h=>h.action!==32||h.button!==3},ANY:{events:31,restrict:h=>!0}};function f(h,y){let L=(h.ctrl?16:0)|(h.shift?4:0)|(h.alt?8:0);return h.button===4?(L|=64,L|=h.action):(L|=3&h.button,4&h.button&&(L|=64),8&h.button&&(L|=128),h.action===32?L|=32:h.action!==0||y||(L|=3)),L}const o=String.fromCharCode,u={DEFAULT:h=>{const y=[f(h,!1)+32,h.col+32,h.row+32];return y[0]>255||y[1]>255||y[2]>255?"":`\x1B[M${o(y[0])}${o(y[1])}${o(y[2])}`},SGR:h=>{const y=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${f(h,!0)};${h.col};${h.row}${y}`},SGR_PIXELS:h=>{const y=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${f(h,!0)};${h.x};${h.y}${y}`}};let a=i.CoreMouseService=class extends C.Disposable{constructor(h,y){super(),this._bufferService=h,this._coreService=y,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const L of Object.keys(b))this.addProtocol(L,b[L]);for(const L of Object.keys(u))this.addEncoding(L,u[L]);this.reset()}addProtocol(h,y){this._protocols[h]=y}addEncoding(h,y){this._encodings[h]=y}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(h){if(!this._protocols[h])throw new Error(`unknown protocol "${h}"`);this._activeProtocol=h,this._onProtocolChange.fire(this._protocols[h].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(h){if(!this._encodings[h])throw new Error(`unknown encoding "${h}"`);this._activeEncoding=h}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(h){if(h.col<0||h.col>=this._bufferService.cols||h.row<0||h.row>=this._bufferService.rows||h.button===4&&h.action===32||h.button===3&&h.action!==32||h.button!==4&&(h.action===2||h.action===3)||(h.col++,h.row++,h.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,h,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(h))return!1;const y=this._encodings[this._activeEncoding](h);return y&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(y):this._coreService.triggerDataEvent(y,!0)),this._lastEvent=h,!0}explainEvents(h){return{down:!!(1&h),up:!!(2&h),drag:!!(4&h),move:!!(8&h),wheel:!!(16&h)}}_equalEvents(h,y,L){if(L){if(h.x!==y.x||h.y!==y.y)return!1}else if(h.col!==y.col||h.row!==y.row)return!1;return h.button===y.button&&h.action===y.action&&h.ctrl===y.ctrl&&h.alt===y.alt&&h.shift===y.shift}};i.CoreMouseService=a=m([g(0,l.IBufferService),g(1,l.ICoreService)],a)},6975:function(N,i,c){var m=this&&this.__decorate||function(a,h,y,L){var k,A=arguments.length,x=A<3?h:L===null?L=Object.getOwnPropertyDescriptor(h,y):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,h,y,L);else for(var E=a.length-1;E>=0;E--)(k=a[E])&&(x=(A<3?k(x):A>3?k(h,y,x):k(h,y))||x);return A>3&&x&&Object.defineProperty(h,y,x),x},g=this&&this.__param||function(a,h){return function(y,L){h(y,L,a)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreService=void 0;const l=c(1439),v=c(8460),C=c(844),b=c(2585),f=Object.freeze({insertMode:!1}),o=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let u=i.CoreService=class extends C.Disposable{constructor(a,h,y){super(),this._bufferService=a,this._logService=h,this._optionsService=y,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,l.clone)(f),this.decPrivateModes=(0,l.clone)(o)}reset(){this.modes=(0,l.clone)(f),this.decPrivateModes=(0,l.clone)(o)}triggerDataEvent(a,h=!1){if(this._optionsService.rawOptions.disableStdin)return;const y=this._bufferService.buffer;h&&this._optionsService.rawOptions.scrollOnUserInput&&y.ybase!==y.ydisp&&this._onRequestScrollToBottom.fire(),h&&this._onUserInput.fire(),this._logService.debug(`sending data "${a}"`,(()=>a.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(a)}triggerBinaryEvent(a){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${a}"`,(()=>a.split("").map((h=>h.charCodeAt(0))))),this._onBinary.fire(a))}};i.CoreService=u=m([g(0,b.IBufferService),g(1,b.ILogService),g(2,b.IOptionsService)],u)},9074:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DecorationService=void 0;const m=c(8055),g=c(8460),l=c(844),v=c(6106);let C=0,b=0;class f extends l.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList((a=>a==null?void 0:a.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,l.toDisposable)((()=>this.reset())))}registerDecoration(a){if(a.marker.isDisposed)return;const h=new o(a);if(h){const y=h.marker.onDispose((()=>h.dispose()));h.onDispose((()=>{h&&(this._decorations.delete(h)&&this._onDecorationRemoved.fire(h),y.dispose())})),this._decorations.insert(h),this._onDecorationRegistered.fire(h)}return h}reset(){for(const a of this._decorations.values())a.dispose();this._decorations.clear()}*getDecorationsAtCell(a,h,y){let L=0,k=0;for(const A of this._decorations.getKeyIterator(h))L=A.options.x??0,k=L+(A.options.width??1),a>=L&&a<k&&(!y||(A.options.layer??"bottom")===y)&&(yield A)}forEachDecorationAtCell(a,h,y,L){this._decorations.forEachByKey(h,(k=>{C=k.options.x??0,b=C+(k.options.width??1),a>=C&&a<b&&(!y||(k.options.layer??"bottom")===y)&&L(k)}))}}i.DecorationService=f;class o extends l.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=m.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=m.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(a){super(),this.options=a,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=a.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.InstantiationService=i.ServiceCollection=void 0;const m=c(2585),g=c(8343);class l{constructor(...C){this._entries=new Map;for(const[b,f]of C)this.set(b,f)}set(C,b){const f=this._entries.get(C);return this._entries.set(C,b),f}forEach(C){for(const[b,f]of this._entries.entries())C(b,f)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}i.ServiceCollection=l,i.InstantiationService=class{constructor(){this._services=new l,this._services.set(m.IInstantiationService,this)}setService(v,C){this._services.set(v,C)}getService(v){return this._services.get(v)}createInstance(v,...C){const b=(0,g.getServiceDependencies)(v).sort(((u,a)=>u.index-a.index)),f=[];for(const u of b){const a=this._services.get(u.id);if(!a)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${u.id}.`);f.push(a)}const o=b.length>0?b[0].index:C.length;if(C.length!==o)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${o+1} conflicts with ${C.length} static arguments`);return new v(...C,...f)}}},7866:function(N,i,c){var m=this&&this.__decorate||function(o,u,a,h){var y,L=arguments.length,k=L<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,a):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,u,a,h);else for(var A=o.length-1;A>=0;A--)(y=o[A])&&(k=(L<3?y(k):L>3?y(u,a,k):y(u,a))||k);return L>3&&k&&Object.defineProperty(u,a,k),k},g=this&&this.__param||function(o,u){return function(a,h){u(a,h,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.traceCall=i.setTraceLogger=i.LogService=void 0;const l=c(844),v=c(2585),C={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let b,f=i.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(o){super(),this._optionsService=o,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),b=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(o){for(let u=0;u<o.length;u++)typeof o[u]=="function"&&(o[u]=o[u]())}_log(o,u,a){this._evalLazyOptionalParams(a),o.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+u,...a)}trace(o,...u){var a;this._logLevel<=v.LogLevelEnum.TRACE&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.trace.bind(this._optionsService.options.logger))??console.log,o,u)}debug(o,...u){var a;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.debug.bind(this._optionsService.options.logger))??console.log,o,u)}info(o,...u){var a;this._logLevel<=v.LogLevelEnum.INFO&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.info.bind(this._optionsService.options.logger))??console.info,o,u)}warn(o,...u){var a;this._logLevel<=v.LogLevelEnum.WARN&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.warn.bind(this._optionsService.options.logger))??console.warn,o,u)}error(o,...u){var a;this._logLevel<=v.LogLevelEnum.ERROR&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.error.bind(this._optionsService.options.logger))??console.error,o,u)}};i.LogService=f=m([g(0,v.IOptionsService)],f),i.setTraceLogger=function(o){b=o},i.traceCall=function(o,u,a){if(typeof a.value!="function")throw new Error("not supported");const h=a.value;a.value=function(...y){if(b.logLevel!==v.LogLevelEnum.TRACE)return h.apply(this,y);b.trace(`GlyphRenderer#${h.name}(${y.map((k=>JSON.stringify(k))).join(", ")})`);const L=h.apply(this,y);return b.trace(`GlyphRenderer#${h.name} return`,L),L}}},7302:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OptionsService=i.DEFAULT_OPTIONS=void 0;const m=c(8460),g=c(844),l=c(6114);i.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:l.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends g.Disposable{constructor(f){super(),this._onOptionChange=this.register(new m.EventEmitter),this.onOptionChange=this._onOptionChange.event;const o={...i.DEFAULT_OPTIONS};for(const u in f)if(u in o)try{const a=f[u];o[u]=this._sanitizeAndValidateOption(u,a)}catch(a){console.error(a)}this.rawOptions=o,this.options={...o},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(f,o){return this.onOptionChange((u=>{u===f&&o(this.rawOptions[f])}))}onMultipleOptionChange(f,o){return this.onOptionChange((u=>{f.indexOf(u)!==-1&&o()}))}_setupOptions(){const f=u=>{if(!(u in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);return this.rawOptions[u]},o=(u,a)=>{if(!(u in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);a=this._sanitizeAndValidateOption(u,a),this.rawOptions[u]!==a&&(this.rawOptions[u]=a,this._onOptionChange.fire(u))};for(const u in this.rawOptions){const a={get:f.bind(this,u),set:o.bind(this,u)};Object.defineProperty(this.options,u,a)}}_sanitizeAndValidateOption(f,o){switch(f){case"cursorStyle":if(o||(o=i.DEFAULT_OPTIONS[f]),!(function(u){return u==="block"||u==="underline"||u==="bar"})(o))throw new Error(`"${o}" is not a valid value for ${f}`);break;case"wordSeparator":o||(o=i.DEFAULT_OPTIONS[f]);break;case"fontWeight":case"fontWeightBold":if(typeof o=="number"&&1<=o&&o<=1e3)break;o=v.includes(o)?o:i.DEFAULT_OPTIONS[f];break;case"cursorWidth":o=Math.floor(o);case"lineHeight":case"tabStopWidth":if(o<1)throw new Error(`${f} cannot be less than 1, value: ${o}`);break;case"minimumContrastRatio":o=Math.max(1,Math.min(21,Math.round(10*o)/10));break;case"scrollback":if((o=Math.min(o,4294967295))<0)throw new Error(`${f} cannot be less than 0, value: ${o}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(o<=0)throw new Error(`${f} cannot be less than or equal to 0, value: ${o}`);break;case"rows":case"cols":if(!o&&o!==0)throw new Error(`${f} must be numeric, value: ${o}`);break;case"windowsPty":o=o??{}}return o}}i.OptionsService=C},2660:function(N,i,c){var m=this&&this.__decorate||function(C,b,f,o){var u,a=arguments.length,h=a<3?b:o===null?o=Object.getOwnPropertyDescriptor(b,f):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(C,b,f,o);else for(var y=C.length-1;y>=0;y--)(u=C[y])&&(h=(a<3?u(h):a>3?u(b,f,h):u(b,f))||h);return a>3&&h&&Object.defineProperty(b,f,h),h},g=this&&this.__param||function(C,b){return function(f,o){b(f,o,C)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkService=void 0;const l=c(2585);let v=i.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const b=this._bufferService.buffer;if(C.id===void 0){const y=b.addMarker(b.ybase+b.y),L={data:C,id:this._nextId++,lines:[y]};return y.onDispose((()=>this._removeMarkerFromLink(L,y))),this._dataByLinkId.set(L.id,L),L.id}const f=C,o=this._getEntryIdKey(f),u=this._entriesWithId.get(o);if(u)return this.addLineToLink(u.id,b.ybase+b.y),u.id;const a=b.addMarker(b.ybase+b.y),h={id:this._nextId++,key:this._getEntryIdKey(f),data:f,lines:[a]};return a.onDispose((()=>this._removeMarkerFromLink(h,a))),this._entriesWithId.set(h.key,h),this._dataByLinkId.set(h.id,h),h.id}addLineToLink(C,b){const f=this._dataByLinkId.get(C);if(f&&f.lines.every((o=>o.line!==b))){const o=this._bufferService.buffer.addMarker(b);f.lines.push(o),o.onDispose((()=>this._removeMarkerFromLink(f,o)))}}getLinkData(C){var b;return(b=this._dataByLinkId.get(C))==null?void 0:b.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,b){const f=C.lines.indexOf(b);f!==-1&&(C.lines.splice(f,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};i.OscLinkService=v=m([g(0,l.IBufferService)],v)},8343:(N,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;const c="di$target",m="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(g){return g[m]||[]},i.createDecorator=function(g){if(i.serviceRegistry.has(g))return i.serviceRegistry.get(g);const l=function(v,C,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,o,u){o[c]===o?o[m].push({id:f,index:u}):(o[m]=[{id:f,index:u}],o[c]=o)})(l,v,b)};return l.toString=()=>g,i.serviceRegistry.set(g,l),l}},2585:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IDecorationService=i.IUnicodeService=i.IOscLinkService=i.IOptionsService=i.ILogService=i.LogLevelEnum=i.IInstantiationService=i.ICharsetService=i.ICoreService=i.ICoreMouseService=i.IBufferService=void 0;const m=c(8343);var g;i.IBufferService=(0,m.createDecorator)("BufferService"),i.ICoreMouseService=(0,m.createDecorator)("CoreMouseService"),i.ICoreService=(0,m.createDecorator)("CoreService"),i.ICharsetService=(0,m.createDecorator)("CharsetService"),i.IInstantiationService=(0,m.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(g||(i.LogLevelEnum=g={})),i.ILogService=(0,m.createDecorator)("LogService"),i.IOptionsService=(0,m.createDecorator)("OptionsService"),i.IOscLinkService=(0,m.createDecorator)("OscLinkService"),i.IUnicodeService=(0,m.createDecorator)("UnicodeService"),i.IDecorationService=(0,m.createDecorator)("DecorationService")},1480:(N,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeService=void 0;const m=c(8460),g=c(225);class l{static extractShouldJoin(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,b,f=!1){return(16777215&C)<<3|(3&b)<<1|(f?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new m.EventEmitter,this.onChange=this._onChange.event;const C=new g.UnicodeV6;this.register(C),this._active=C.version,this._activeProvider=C}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(C){if(!this._providers[C])throw new Error(`unknown Unicode version "${C}"`);this._active=C,this._activeProvider=this._providers[C],this._onChange.fire(C)}register(C){this._providers[C.version]=C}wcwidth(C){return this._activeProvider.wcwidth(C)}getStringCellWidth(C){let b=0,f=0;const o=C.length;for(let u=0;u<o;++u){let a=C.charCodeAt(u);if(55296<=a&&a<=56319){if(++u>=o)return b+this.wcwidth(a);const L=C.charCodeAt(u);56320<=L&&L<=57343?a=1024*(a-55296)+L-56320+65536:b+=this.wcwidth(L)}const h=this.charProperties(a,f);let y=l.extractWidth(h);l.extractShouldJoin(h)&&(y-=l.extractWidth(f)),b+=y,f=h}return b}charProperties(C,b){return this._activeProvider.charProperties(C,b)}}i.UnicodeService=l}},S={};function M(N){var i=S[N];if(i!==void 0)return i.exports;var c=S[N]={exports:{}};return p[N].call(c.exports,c,c.exports,M),c.exports}var P={};return(()=>{var N=P;Object.defineProperty(N,"__esModule",{value:!0}),N.Terminal=void 0;const i=M(9042),c=M(3236),m=M(844),g=M(5741),l=M(8285),v=M(7975),C=M(7090),b=["cols","rows"];class f extends m.Disposable{constructor(u){super(),this._core=this.register(new c.Terminal(u)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const a=y=>this._core.options[y],h=(y,L)=>{this._checkReadonlyOptions(y),this._core.options[y]=L};for(const y in this._core.options){const L={get:a.bind(this,y),set:h.bind(this,y)};Object.defineProperty(this._publicOptions,y,L)}}_checkReadonlyOptions(u){if(b.includes(u))throw new Error(`Option "${u}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new C.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new l.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const u=this._core.coreService.decPrivateModes;let a="none";switch(this._core.coreMouseService.activeProtocol){case"X10":a="x10";break;case"VT200":a="vt200";break;case"DRAG":a="drag";break;case"ANY":a="any"}return{applicationCursorKeysMode:u.applicationCursorKeys,applicationKeypadMode:u.applicationKeypad,bracketedPasteMode:u.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:a,originMode:u.origin,reverseWraparoundMode:u.reverseWraparound,sendFocusMode:u.sendFocus,wraparoundMode:u.wraparound}}get options(){return this._publicOptions}set options(u){for(const a in u)this._publicOptions[a]=u[a]}blur(){this._core.blur()}focus(){this._core.focus()}input(u,a=!0){this._core.input(u,a)}resize(u,a){this._verifyIntegers(u,a),this._core.resize(u,a)}open(u){this._core.open(u)}attachCustomKeyEventHandler(u){this._core.attachCustomKeyEventHandler(u)}attachCustomWheelEventHandler(u){this._core.attachCustomWheelEventHandler(u)}registerLinkProvider(u){return this._core.registerLinkProvider(u)}registerCharacterJoiner(u){return this._checkProposedApi(),this._core.registerCharacterJoiner(u)}deregisterCharacterJoiner(u){this._checkProposedApi(),this._core.deregisterCharacterJoiner(u)}registerMarker(u=0){return this._verifyIntegers(u),this._core.registerMarker(u)}registerDecoration(u){return this._checkProposedApi(),this._verifyPositiveIntegers(u.x??0,u.width??0,u.height??0),this._core.registerDecoration(u)}hasSelection(){return this._core.hasSelection()}select(u,a,h){this._verifyIntegers(u,a,h),this._core.select(u,a,h)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(u,a){this._verifyIntegers(u,a),this._core.selectLines(u,a)}dispose(){super.dispose()}scrollLines(u){this._verifyIntegers(u),this._core.scrollLines(u)}scrollPages(u){this._verifyIntegers(u),this._core.scrollPages(u)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(u){this._verifyIntegers(u),this._core.scrollToLine(u)}clear(){this._core.clear()}write(u,a){this._core.write(u,a)}writeln(u,a){this._core.write(u),this._core.write(`\r
111
- `,a)}paste(u){this._core.paste(u)}refresh(u,a){this._verifyIntegers(u,a),this._core.refresh(u,a)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(u){this._addonManager.loadAddon(this,u)}static get strings(){return i}_verifyIntegers(...u){for(const a of u)if(a===1/0||isNaN(a)||a%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...u){for(const a of u)if(a&&(a===1/0||isNaN(a)||a%1!=0||a<0))throw new Error("This API only accepts positive integers")}}N.Terminal=f})(),P})()))})(Sa)),Sa.exports}var Gg=Kg();const Xg=60;function Yg(){return new URLSearchParams(window.location.search).get("renderer")==="webgl"?"webgl":"canvas"}const Wh={dark:{background:"#12141a",foreground:"#d8dee9",cursor:"#d8dee9",selectionBackground:"#2f3542"},light:{background:"#fbfbfd",foreground:"#22262e",cursor:"#22262e",selectionBackground:"#cfd8e3"}};function Vd({terminalId:n,connection:s,active:p,theme:S,autoFocus:M=!0}){const P=F.useRef(null),N=F.useRef(null),i=F.useRef(null),c=F.useRef(S);return c.current=S,F.useEffect(()=>{const m=P.current;if(m===null)return;const g=new Gg.Terminal({convertEol:!1,cursorBlink:!0,fontFamily:'"Cascadia Mono", "Consolas", "Menlo", "DejaVu Sans Mono", monospace',fontSize:14,lineHeight:1.2,scrollback:1e4,allowProposedApi:!0,theme:Wh[c.current]});N.current=g;const l=new Wg.FitAddon;i.current=l,g.loadAddon(l),g.loadAddon(new zg.WebLinksAddon),g.open(m);let v=!1;const C=()=>{if(!(v||Yg()!=="webgl")){v=!0;try{const E=new Vg.WebglAddon;E.onContextLoss(()=>E.dispose()),g.loadAddon(E)}catch{console.info("[terminal] WebGL no disponible; se usa el renderer por defecto.")}}};let b={cols:0,rows:0},f;const o=()=>m.clientWidth>0&&m.clientHeight>0,u=E=>{const{cols:T,rows:j}=g;T<=0||j<=0||T===b.cols&&j===b.rows||(b={cols:T,rows:j},s.send({type:"resize",terminalId:n,cols:T,rows:j}))},a=()=>{if(o()){try{l.fit()}catch{return}g.cols>0&&g.rows>0&&C(),u()}},h=()=>{window.clearTimeout(f),f=window.setTimeout(a,Xg)},y=new ResizeObserver(h);y.observe(m),window.addEventListener("resize",h);const L=g.onData(E=>{s.send({type:"input",terminalId:n,data:E})}),k=s.onMessage(E=>{switch(E.type){case"terminal.output":E.terminalId===n&&g.write(E.data);break;case"terminal.replay":if(E.terminalId!==n)break;g.reset(),E.truncated&&g.write(`\x1B[90m-- salida anterior recortada --\x1B[0m\r
112
- `),g.write(E.data);break;case"terminal.exit":if(E.terminalId!==n)break;g.write(`\r
113
- \x1B[90m-- el proceso termino (codigo ${E.exitCode}) --\x1B[0m\r
114
- `);break}}),A=()=>{if(o())try{l.fit()}catch{}const E=g.cols>0?g.cols:80,T=g.rows>0?g.rows:24;b={cols:E,rows:T},s.send({type:"terminal.attach",terminalId:n,cols:E,rows:T})};A();const x=s.onReopen(A);return()=>{window.clearTimeout(f),window.removeEventListener("resize",h),y.disconnect(),L.dispose(),k(),x(),s.send({type:"terminal.detach",terminalId:n}),g.dispose(),N.current=null,i.current=null}},[n,s]),F.useEffect(()=>{const m=N.current;m!==null&&(m.options.theme=Wh[S])},[S]),F.useEffect(()=>{if(!p)return;const m=N.current,g=i.current;if(m===null||g===null)return;const l=window.setTimeout(()=>{const v=P.current;if(!(v===null||v.clientWidth===0||v.clientHeight===0)){try{g.fit()}catch{return}M&&m.focus(),m.cols>0&&m.rows>0&&s.send({type:"resize",terminalId:n,cols:m.cols,rows:m.rows})}},0);return()=>window.clearTimeout(l)},[p,M,n,s]),_.jsx("div",{className:`terminal-surface${p?"":" terminal-surface-hidden"}`,ref:P})}function Qg({connection:n,shells:s,activeShellId:p,cwd:S,shellName:M,theme:P,onSelect:N,onOpen:i,onCloseShell:c,onCollapse:m}){const g=M??"Consola",l=s.find(v=>v.terminalId===p)??s[0]??null;return _.jsxs("section",{className:"console-pane",children:[_.jsxs("header",{className:"console-header",children:[_.jsxs("div",{className:"strip-tabs",children:[s.map((v,C)=>_.jsxs("div",{className:`strip-tab${v.terminalId===(l==null?void 0:l.terminalId)?" is-active":""}${v.alive?"":" is-dead"}`,children:[_.jsxs("button",{className:"strip-tab-label",onClick:()=>N(v.terminalId),title:v.alive?`${g} ${C+1} en ${S}`:`Terminada con codigo ${v.exitCode??"?"}`,children:["Terminal ",C+1]}),_.jsx("button",{className:"strip-tab-close",onClick:()=>c(v.terminalId),title:"Cerrar esta terminal y terminar su proceso",children:"×"})]},v.terminalId)),M!==null&&_.jsx("button",{className:"strip-tab-new",onClick:i,title:`Abrir otra ${g} en ${S}`,children:"+"})]}),_.jsx("span",{className:"strip-spacer"}),_.jsx("button",{className:"icon-button",onClick:m,title:"Plegar. Los procesos siguen vivos: para terminarlos, la × de cada terminal",children:"▾"})]}),_.jsx("div",{className:"console-body",children:s.length===0?_.jsx("div",{className:"console-empty",children:M===null?_.jsx("p",{className:"panel-note",children:"No se encontró ninguna consola del sistema para abrir."}):_.jsxs("button",{className:"link-button",onClick:i,children:["Abrir ",g," en ",S]})}):_.jsx("div",{className:"terminal-stack",children:s.map(v=>_.jsx(Vd,{terminalId:v.terminalId,connection:n,active:v.terminalId===(l==null?void 0:l.terminalId),theme:P},v.terminalId))})})]})}const Jg=.75,Zg=.9;function gr(n){if(n<1e3)return String(n);if(n<1e6){const s=n/1e3;return`${s<100?s.toFixed(1):Math.round(s)}k`}return`${(n/1e6).toFixed(2)}M`}function ev({usage:n,source:s,instructionsFile:p,fallbackWindow:S=null,compact:M=!1,statusLineState:P=null,onConfigure:N}){const{lastRequestTokens:i,contextWindow:c}=n;if(N!==void 0&&P!==null&&Qm(s,{state:P}))return _.jsxs("div",{className:`meter meter-idle${M?" meter-compact":""}`,title:Jm(P),children:[_.jsx("span",{className:"meter-label",children:"Contexto"}),_.jsx("span",{className:`meter-bar${M?" meter-bar-inline":""}`}),_.jsx("span",{className:"meter-value",children:"sin medir"}),_.jsx("button",{className:"link-button",onClick:N,children:"Configurar"})]});if(s===null)return _.jsxs("div",{className:`meter meter-idle${M?" meter-compact":""}`,title:"Esta CLI no publica cuantos tokens usa cada respuesta, asi que no hay nada que medir.",children:[_.jsx("span",{className:"meter-label",children:"Contexto"}),_.jsx("span",{className:`meter-bar${M?" meter-bar-inline":""}`}),_.jsx("span",{className:"meter-value",children:"esta CLI no publica tokens"})]});if(!Ym(s,n)){const C=eg(p,s),b=Xm(s,n,S);return _.jsxs("div",{className:`meter meter-idle${M?" meter-compact":""}`,title:C,children:[_.jsx("span",{className:"meter-label",children:"Contexto"}),_.jsx("span",{className:`meter-bar${M?" meter-bar-inline":""}`}),_.jsxs("span",{className:"meter-value",children:["sin medir",b!==null&&_.jsxs("span",{className:"meter-dim",children:[" / ",gr(b)]})]})]})}const m=c!==null&&c>0?Math.min(i/c,1):null,g=m===null?"unknown":m>=Zg?"danger":m>=Jg?"warn":"ok",l=c===null?"":` / ${gr(c)}${n.contextWindowEstimated?"+":""}`,v=Zm(s,n);if(M){const C=[n.lastModel===null?null:n.lastModel,v,m===null?"modelo no reconocido: sin tamano de ventana":`${Math.round(m*100)}% de la ventana`,`salida ${gr(n.lastOutputTokens)}`,s==="status-line"?`${n.assistantMessages} resp.`:`sesion ${gr(n.totalOutputTokens)} out · ${gr(n.totalCacheReadTokens)} cache · ${n.assistantMessages} resp.`].filter(b=>b!==null).join(" · ");return _.jsxs("div",{className:"meter meter-compact",title:C,children:[_.jsx("span",{className:"meter-label",children:"Contexto"}),m!==null&&_.jsx("span",{className:"meter-bar meter-bar-inline",children:_.jsx("span",{className:`meter-fill meter-fill-${g}`,style:{width:`${m*100}%`}})}),_.jsxs("span",{className:"meter-value",children:[gr(i),l.length>0&&_.jsx("span",{className:"meter-dim",children:l})]})]})}return _.jsxs("div",{className:"meter",children:[_.jsxs("div",{className:"meter-row",children:[_.jsx("span",{className:"meter-label",children:"Contexto"}),_.jsxs("span",{className:"meter-value",children:[gr(i),c!==null&&_.jsxs("span",{className:"meter-dim",title:n.lastModel===null?void 0:v!==null?`${n.lastModel} — ${v}`:n.lastModel,children:[" ","/ ",gr(c),n.contextWindowEstimated&&"+"]})]})]}),m!==null?_.jsx("div",{className:"meter-bar",title:`${Math.round(m*100)}% de la ventana`,children:_.jsx("div",{className:`meter-fill meter-fill-${g}`,style:{width:`${m*100}%`}})}):_.jsx("div",{className:"meter-note",title:n.lastModel??void 0,children:"modelo no reconocido: se muestran los tokens, no el tamano de la ventana"}),_.jsxs("div",{className:"meter-row meter-row-dim",children:[_.jsxs("span",{title:"Ultima respuesta del modelo",children:["salida ",gr(n.lastOutputTokens)]}),_.jsxs("span",{title:"Acumulado de toda la sesion",children:["sesion ",gr(n.totalOutputTokens)," out ·"," ",gr(n.totalCacheReadTokens)," cache · ",n.assistantMessages," resp."]})]})]})}function Kd({agents:n,preselected:s,anchor:p,label:S="Abrir con",onPick:M,onClose:P}){const N=F.useMemo(()=>Fd(n),[n]),[i,c]=F.useState(()=>og(N,s)),[m,g]=F.useState(null),l=F.useRef(null),v=F.useRef([]);return F.useLayoutEffect(()=>{const C=l.current;if(C===null)return;const b=p.getBoundingClientRect(),f=C.getBoundingClientRect();g(ag({left:b.left,top:b.top,bottom:b.bottom},{width:f.width,height:f.height},{width:window.innerWidth,height:window.innerHeight}))},[p]),F.useEffect(()=>{var C;(C=v.current[i])==null||C.focus()},[i,m]),F.useEffect(()=>{const C=o=>{if(!(o.altKey||o.ctrlKey||o.metaKey)){if(o.key==="Escape"){o.preventDefault(),o.stopPropagation(),P(),p.focus();return}if(o.key==="ArrowDown"||o.key==="ArrowUp"){o.preventDefault(),o.stopPropagation(),c(u=>lg(u,o.key==="ArrowDown"?1:-1,N.length));return}if(o.key==="Enter"){o.preventDefault(),o.stopPropagation();const u=N[i];u!==void 0&&M(u.id);return}o.key==="Tab"&&P()}},b=o=>{var a;const u=o.target;u instanceof Node&&((a=l.current)!=null&&a.contains(u)||p.contains(u))||P()},f=o=>{cg(o.target,p,l.current)&&P()};return window.addEventListener("keydown",C,!0),document.addEventListener("pointerdown",b,!0),window.addEventListener("scroll",f,!0),window.addEventListener("resize",P),()=>{window.removeEventListener("keydown",C,!0),document.removeEventListener("pointerdown",b,!0),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",P)}},[i,p,N,P,M]),Ud.createPortal(_.jsx("div",{ref:l,className:"agent-menu",role:"menu","aria-label":S,style:m===null?{left:0,top:0,visibility:"hidden"}:{left:`${m.left}px`,top:`${m.top}px`},children:N.map((C,b)=>_.jsxs("button",{ref:f=>{v.current[b]=f},className:`agent-menu-item${b===i?" agent-menu-item-active":""}`,role:"menuitem",tabIndex:b===i?0:-1,onMouseEnter:()=>c(b),onClick:()=>M(C.id),children:[_.jsx("span",{className:"agent-menu-label",children:C.label}),C.version!==null&&_.jsx("span",{className:"agent-menu-version",children:C.version})]},C.id))}),document.body)}function Gd({targets:n,className:s,text:p,blockedReason:S=null,onPick:M}){const[P,N]=F.useState(!1),i=F.useRef(null),c=F.useCallback(()=>N(!1),[]),m=F.useCallback(g=>{N(!1),M(g)},[M]);return n.length===0?null:_.jsxs(_.Fragment,{children:[_.jsx("button",{ref:i,className:s,onClick:()=>N(g=>!g),disabled:S!==null,"aria-haspopup":"menu","aria-expanded":P,title:S??ug,children:p}),P&&i.current!==null&&_.jsx(Kd,{agents:n,preselected:null,anchor:i.current,label:"Continuar con",onPick:m,onClose:c})]})}const Xd=String.raw`https?:\/\/[^\s<>"'\`]+`,tv=new RegExp([String.raw`(\`[^\`\n]+\`)`,String.raw`(\*\*[^*\n]+\*\*)`,String.raw`(__[^_\n]+__)`,String.raw`(\*[^*\n]+\*)`,String.raw`(~~[^~\n]+~~)`,String.raw`(\[[^\]\n]+\]\([^)\s]+\))`,`(${Xd})`].join("|")),rv=/^(https?:|mailto:)/i,sv=new RegExp(Xd);function nv(n){const s=sv.exec(n);if(s===null||s.index===void 0)return null;const p=Yd(s[0]);return{index:s.index,length:p.length,href:p}}function fo(n,s){let p=0;for(const S of n)S===s&&(p+=1);return p}function Yd(n){let s=n;for(;;){const p=s.slice(-1);if(p.length===0)return s;if(".,;:!?".includes(p)){s=s.slice(0,-1);continue}if(p===")"&&fo(s,"(")<fo(s,")")){s=s.slice(0,-1);continue}if(p==="]"&&fo(s,"[")<fo(s,"]")){s=s.slice(0,-1);continue}return s}}function iv(n){const s=tv.exec(n);if(s===null||s.index===void 0)return null;const p=s[0],S=s.index,M=(N,i=p.length)=>({index:S,length:i,token:N});if(p.startsWith("`"))return M({kind:"code",text:p.slice(1,-1)});if(p.startsWith("**")||p.startsWith("__"))return M({kind:"strong",text:p.slice(2,-2)});if(p.startsWith("~~"))return M({kind:"del",text:p.slice(2,-2)});if(p.startsWith("*"))return M({kind:"em",text:p.slice(1,-1)});if(p.startsWith("[")){const N=p.indexOf("]("),i=p.slice(1,N),c=p.slice(N+2,-1);return rv.test(c)?M({kind:"link",label:i,href:c}):M({kind:"plain",text:p})}const P=Yd(p);return M({kind:"link",label:P,href:P},P.length)}const ov="modulepreload",lv=function(n){return"/"+n},Uh={},Qd=function(s,p,S){let M=Promise.resolve();if(p&&p.length>0){let N=function(m){return Promise.all(m.map(g=>Promise.resolve(g).then(l=>({status:"fulfilled",value:l}),l=>({status:"rejected",reason:l}))))};document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),c=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));M=N(p.map(m=>{if(m=lv(m),m in Uh)return;Uh[m]=!0;const g=m.endsWith(".css"),l=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${l}`))return;const v=document.createElement("link");if(v.rel=g?"stylesheet":ov,g||(v.as="script"),v.crossOrigin="",v.href=m,c&&v.setAttribute("nonce",c),document.head.appendChild(v),g)return new Promise((C,b)=>{v.addEventListener("load",C),v.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${m}`)))})}))}function P(N){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=N,window.dispatchEvent(i),!i.defaultPrevented)throw N}return M.then(N=>{for(const i of N||[])i.status==="rejected"&&P(i.reason);return s().catch(P)})};function ss(n,s,p){if(s.length===0)return[n];const S=n.toLowerCase(),M=s.toLowerCase(),P=[];let N=0,i=S.indexOf(M),c=0;for(;i!==-1;)i>N&&P.push(n.slice(N,i)),P.push(_.jsx("mark",{children:n.slice(i,i+s.length)},`${p}-m${c++}`)),N=i+s.length,i=S.indexOf(M,N);return N<n.length&&P.push(n.slice(N)),P}const av=/^\[([^\]\n]+)\]\(([^)\s]+)\)$/;function cv(n,s){const p=av.exec(n);if(p===null)return null;const S=p[2]??"",M=s(S);return M===null?null:{label:p[1]??"",href:S,open:M}}function nn(n,s,p,S){const M=[];let P=n,N=0;for(;P.length>0;){const i=iv(P);if(i===null){M.push(...ss(P,s,`${p}-${N++}`));break}i.index>0&&M.push(...ss(P.slice(0,i.index),s,`${p}-${N++}`));const c=`${p}-i${N++}`,{token:m}=i;switch(m.kind){case"code":M.push(_.jsx("code",{children:m.text},c));break;case"strong":M.push(_.jsx("strong",{children:ss(m.text,s,c)},c));break;case"del":M.push(_.jsx("del",{children:ss(m.text,s,c)},c));break;case"em":M.push(_.jsx("em",{children:ss(m.text,s,c)},c));break;case"link":M.push(_.jsx("a",{href:m.href,target:"_blank",rel:"noreferrer noopener",children:ss(m.label,s,c)},c));break;default:{const g=S===void 0?null:cv(m.text,S);if(g!==null){M.push(_.jsx("button",{className:"md-local-link",onClick:g.open,title:g.href,children:ss(g.label,s,c)},c));break}M.push(_.jsx("span",{children:ss(m.text,s,c)},c));break}}P=P.slice(i.index+i.length)}return M}function uv({code:n,language:s}){const[p,S]=F.useState(null);return F.useEffect(()=>{let M=!0;return Qd(async()=>{const{highlightCode:P}=await import("./highlight-D9nIZ0qi.js");return{highlightCode:P}},[]).then(({highlightCode:P})=>{M&&S(P(n,s))}).catch(()=>{M&&S(null)}),()=>{M=!1}},[n,s]),_.jsxs("pre",{className:"md-code hljs",children:[s!==null&&_.jsx("span",{className:"md-code-lang",children:s}),p===null?_.jsx("code",{children:n}):_.jsx("code",{dangerouslySetInnerHTML:{__html:p}})]})}const zh=/^(#{1,6})\s+(.*)$/,Ca=/^\s{0,3}[-*+]\s+(.*)$/,po=/^\s{0,3}(\d{1,3})[.)]\s+(.*)$/,_o=/^>\s?(.*)$/,wa=/^\s*```(\S*)\s*$/,qh=/^\s*(-{3,}|\*{3,}|_{3,})\s*$/,xa=/^\s*\|.*\|\s*$/,hv=/^\s*\|[\s:|-]+\|\s*$/;function Vh(n){return n.trim().replace(/^\||\|$/g,"").split("|").map(s=>s.trim())}function za({text:n,needle:s="",localLink:p}){var N;const S=n.split(`
115
- `),M=[];let P=0;for(;P<S.length;){const i=S[P]??"",c=`b${P}`,m=wa.exec(i);if(m!==null){const v=(m[1]??"").length>0?m[1]:null,C=[];for(P+=1;P<S.length&&!wa.test(S[P]??"");)C.push(S[P]??""),P+=1;P+=1,M.push({key:c,node:_.jsx(uv,{code:C.join(`
116
- `),language:v},c)});continue}if(i.trim().length===0){P+=1;continue}if(qh.test(i)){M.push({key:c,node:_.jsx("hr",{className:"md-rule"},c)}),P+=1;continue}const g=zh.exec(i);if(g!==null){const v=Math.min((g[1]??"#").length,6);M.push({key:c,node:_.jsx("p",{className:`md-heading md-h${v}`,children:nn(g[2]??"",s,c,p)},c)}),P+=1;continue}if(xa.test(i)&&hv.test(S[P+1]??"")){const v=Vh(i);P+=2;const C=[];for(;P<S.length&&xa.test(S[P]??"");)C.push(Vh(S[P]??"")),P+=1;M.push({key:c,node:_.jsx("div",{className:"md-table-wrap",children:_.jsxs("table",{className:"md-table",children:[_.jsx("thead",{children:_.jsx("tr",{children:v.map((b,f)=>_.jsx("th",{children:nn(b,s,`${c}-h${f}`,p)},f))})}),_.jsx("tbody",{children:C.map((b,f)=>_.jsx("tr",{children:b.map((o,u)=>_.jsx("td",{children:nn(o,s,`${c}-${f}-${u}`,p)},u))},f))})]})},c)});continue}if(_o.test(i)){const v=[];for(;P<S.length&&_o.test(S[P]??"");)v.push(((N=_o.exec(S[P]??""))==null?void 0:N[1])??""),P+=1;M.push({key:c,node:_.jsx("blockquote",{className:"md-quote",children:nn(v.join(`
117
- `),s,c,p)},c)});continue}if(Ca.test(i)||po.test(i)){const v=po.test(i),C=[];for(;P<S.length;){const f=S[P]??"",o=Ca.exec(f),u=po.exec(f);if(v&&u!==null)C.push(u[2]??"");else if(!v&&o!==null)C.push(o[1]??"");else if(C.length>0&&/^\s{2,}\S/.test(f)&&o===null&&u===null)C[C.length-1]=`${C[C.length-1]??""} ${f.trim()}`;else break;P+=1}const b=C.map((f,o)=>_.jsx("li",{children:nn(f,s,`${c}-l${o}`,p)},o));M.push({key:c,node:v?_.jsx("ol",{className:"md-list",children:b},c):_.jsx("ul",{className:"md-list",children:b},c)});continue}const l=[];for(;P<S.length;){const v=S[P]??"";if(v.trim().length===0||wa.test(v)||zh.test(v)||Ca.test(v)||po.test(v)||_o.test(v)||qh.test(v)||xa.test(v))break;l.push(v),P+=1}M.push({key:c,node:_.jsx("p",{className:"md-paragraph",children:nn(l.join(`
118
- `),s,c,p)},c)})}return _.jsx("div",{className:"md",children:M.map(i=>i.node)})}const dv=[{key:"shell",names:["Bash","PowerShell","BashOutput","KillShell","shell_command","bash"],label:"comandos de consola"},{key:"read",names:["Read","NotebookRead","read"],label:"archivos leidos"},{key:"find",names:["Glob","Grep","LS","grep","glob","list"],label:"busquedas en el proyecto"},{key:"edit",names:["Edit","Write","NotebookEdit","MultiEdit","apply_patch","edit","write"],label:"ediciones"},{key:"web",names:["WebSearch","WebFetch","ToolSearch","webfetch","websearch","codesearch"],label:"busquedas"},{key:"agent",names:["Task","Agent","task"],label:"subagentes"},{key:"todo",names:["TodoWrite","update_plan","todowrite","todoread"],label:"listas de tareas"}];function ba(n){const s=dv.find(p=>p.names.includes(n));return s===void 0?{key:`name:${n}`,label:null}:s}const ka={model:null,effort:null,contextWindow:null},fv=200,pv=2e4,_v={},mv={};function ja(n,s,p){return`${n}:${p}:${s}`}function gv(n,s){const[p,S]=F.useState([]),[M,P]=F.useState(fa),[N,i]=F.useState(ka),[c,m]=F.useState("waiting"),[g,l]=F.useState(!1),[v,C]=F.useState(!1),[b,f]=F.useState({}),[o,u]=F.useState(null),[a,h]=F.useState(null),[y,L]=F.useState(!1),[k,A]=F.useState({}),[x,E]=F.useState({}),T=(s===null?void 0:k[s])??_v,j=(s===null?void 0:x[s])??mv,D=F.useRef(new Set),B=F.useRef(new Map),z=F.useRef(new Set),X=F.useCallback((K,ee,ne)=>{E(Q=>({...Q,[K]:{...Q[K]??{},[ee]:ne}}))},[]),Z=F.useCallback(K=>{E(ee=>{let ne=!1;const Q={};for(const[q,H]of Object.entries(ee))if(K in H){const re={...H};delete re[K],Q[q]=re,ne=!0}else Q[q]=H;return ne?Q:ee})},[]),Y=F.useCallback((K,ee)=>{E(ne=>{const Q=ne[K];if(Q===void 0||!(ee in Q))return ne;const q={...Q};return delete q[ee],{...ne,[K]:q}})},[]);F.useEffect(()=>{for(const K of p)for(const ee of K.parts){if(ee.kind!=="tool-result")continue;z.current.add(ee.toolUseId);const ne=B.current.get(ee.toolUseId);ne!==void 0&&(window.clearTimeout(ne),B.current.delete(ee.toolUseId)),Z(ee.toolUseId)}},[p,Z]),F.useEffect(()=>{const K=B.current;return()=>{for(const ee of K.values())window.clearTimeout(ee);K.clear()}},[]);const V=F.useRef(null);F.useEffect(()=>{if(s===null){S([]),P(fa),i(ka),m("waiting"),l(!1),V.current=null;return}S([]),P(fa),i(ka),m("waiting"),l(!1),C(!1),f({}),u(null),h(null),L(!1),D.current.clear(),V.current=null;const K=n.onMessage(ne=>{var Q;switch(ne.type){case"conversation.reset":if(ne.terminalId!==s)break;S(ne.events),P(ne.usage),i(ne.defaults),u(ne.permissionMode),h(ne.waitingFor),L(ne.openToolCall),m(ne.state),l(ne.hasMore),C(!1),V.current=((Q=ne.events[0])==null?void 0:Q.eventId)??null;break;case"conversation.append":{if(ne.terminalId!==s)break;S(q=>{var te;const H=new Set(q.map(he=>he.eventId)),re=ne.events.filter(he=>!H.has(he.eventId));return re.length===0?q:(V.current===null&&(V.current=((te=re[0])==null?void 0:te.eventId)??null),[...q,...re])}),P(ne.usage),ne.permissionMode!==null&&u(ne.permissionMode),m("live");break}case"conversation.page":{if(ne.terminalId!==s)break;S(q=>{var te;const H=new Set(q.map(he=>he.eventId)),re=ne.events.filter(he=>!H.has(he.eventId));return re.length===0?q:(V.current=((te=re[0])==null?void 0:te.eventId)??V.current,[...re,...q])}),l(ne.hasMore),C(!1);break}case"conversation.turns":{if(ne.terminalId!==s)break;const q=new Map(ne.turns.map(H=>[H.eventId,H.durationMs]));S(H=>H.map(re=>{const te=q.get(re.eventId);return te===void 0?re:{...re,durationMs:te}}));break}case"conversation.parts":{if(ne.terminalId!==s)break;const q=new Map(ne.updates.map(H=>[H.eventId,H.parts]));S(H=>H.map(re=>{const te=q.get(re.eventId);return te===void 0?re:{...re,parts:te}}));break}case"conversation.imageData":{if(ne.terminalId!==s)break;const q=ja(ne.eventId,ne.index,ne.source);f(H=>({...H,[q]:ne.data===null?null:`data:${ne.mediaType};base64,${ne.data}`}));break}case"conversation.state":if(ne.terminalId!==s)break;m(ne.state);break;case"conversation.mode":if(ne.terminalId!==s)break;u(ne.mode);break;case"conversation.waiting":if(ne.terminalId!==s)break;h(ne.waitingFor);break;case"conversation.toolCall":if(ne.terminalId!==s)break;L(ne.open);break;case"error":{if(ne.code!=="answer-failed"||s===null)break;for(const[q,H]of B.current)window.clearTimeout(H),B.current.delete(q),A(re=>{const te=re[s];if(te===void 0||!(q in te))return re;const he={...te};return delete he[q],{...re,[s]:he}}),X(s,q,ne.message);break}}});n.send({type:"conversation.subscribe",terminalId:s});const ee=n.onReopen(()=>{n.send({type:"conversation.subscribe",terminalId:s})});return()=>{K(),ee(),n.send({type:"conversation.unsubscribe",terminalId:s})}},[n,s,X]);const I=F.useCallback(()=>{const K=V.current;s===null||K===null||v||(C(!0),n.send({type:"conversation.loadMore",terminalId:s,beforeEventId:K,limit:fv}))},[n,s,v]),$=F.useCallback((K,ee,ne)=>{if(s===null)return;const Q=ja(K,ee,ne);D.current.has(Q)||(D.current.add(Q),n.send({type:"conversation.image",terminalId:s,eventId:K,index:ee,source:ne}))},[n,s]),O=F.useCallback((K,ee)=>{if(s===null)return;A(Q=>{const q=Q[s]??{};return K in q?Q:{...Q,[s]:{...q,[K]:ee}}}),Y(s,K),n.send({type:"agent.answer",terminalId:s,toolUseId:K,selections:ee});const ne=window.setTimeout(()=>{z.current.has(K)||(A(Q=>{const q=Q[s];if(q===void 0||!(K in q))return Q;const H={...q};return delete H[K],{...Q,[s]:H}}),X(s,K,"La CLI no confirmo esta respuesta. Probá de nuevo, o contestá en la solapa CLI."))},pv);B.current.set(K,ne)},[n,s,X,Y]),U=F.useCallback(K=>{s!==null&&n.send({type:"agent.mode",terminalId:s,mode:K})},[n,s]);return{events:p,usage:M,defaults:N,state:c,permissionMode:o,waitingFor:a,openToolCall:y,hasMore:g,loadingMore:v,loadMore:I,images:b,requestImage:$,answer:O,answered:T,answerFailed:j,setPermissionMode:U}}const vv=80,Kh=5;function mo(n){return!Array.isArray(n)}function Gh(n){const s=[];for(const p of n.parts){if(p.kind!=="tool-call")return null;s.push(p.name)}return s.length>0?s:null}function yv(n){const s=[];let p=0;for(;p<n.length;){const S=n[p];if(S===void 0)break;const M=Gh(S),P=M===null?null:ba(M[0]??"");if(!(M!==null&&P!==null&&M.every(l=>ba(l).key===P.key))||M===null||P===null){s.push({kind:"card",card:S}),p+=1;continue}const i=[S];let c=M.length,m=p+1;for(;m<n.length;){const l=n[m];if(l===void 0)break;const v=Gh(l);if(v===null||!v.every(C=>ba(C).key===P.key))break;i.push(l),c+=v.length,m+=1}if(c<2){s.push({kind:"card",card:S}),p+=1;continue}const g=P.label??`llamadas a ${M[0]??""}`;s.push({kind:"tools",id:`tools-${S.event.eventId}`,summary:`${c} ${g}`,at:S.event.at,cards:i}),p=m}return s}function Sv(n){switch(n.kind){case"text":return n.text;case"tool-call":return`${n.name} ${n.input}`;case"tool-result":return n.text;case"question":return n.questions.map(s=>`${s.question} ${s.options.map(p=>p.label).join(" ")}`).join(`
119
- `);case"notice":return Rd(n);case"thinking":case"image":return""}}function Xh(n,s){const p=[];for(const S of n.parts)if(p.push(Sv(S)),S.kind==="tool-call"){const M=s.get(S.toolUseId);M!==void 0&&p.push(M.text)}return p.join(`
120
- `)}function Jd(n){return n<=0?"":new Date(n).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function Cv(n){if(n<1e3)return`${n} ms`;const s=Math.round(n/1e3);if(s<60)return`${s} s`;const p=Math.floor(s/60),S=s%60;return S===0?`${p} min`:`${p} min ${S} s`}function ns(n,s){if(s.length===0)return _.jsx(_.Fragment,{children:n});const p=n.toLowerCase(),S=s.toLowerCase(),M=[];let P=0,N=p.indexOf(S),i=0;for(;N!==-1;)N>P&&M.push(_.jsx("span",{children:n.slice(P,N)},i++)),M.push(_.jsx("mark",{children:n.slice(N,N+s.length)},i++)),P=N+s.length,N=p.indexOf(S,P);return P<n.length&&M.push(_.jsx("span",{children:n.slice(P)},i++)),_.jsx(_.Fragment,{children:M})}function wv(n,s){const p=[];let S=n,M=0;for(;S.length>0;){const P=nv(S);if(P===null){p.push(_.jsx("span",{children:ns(S,s)},M++));break}P.index>0&&p.push(_.jsx("span",{children:ns(S.slice(0,P.index),s)},M++)),p.push(_.jsx("a",{href:P.href,target:"_blank",rel:"noreferrer noopener",children:ns(P.href,s)},M++)),S=S.slice(P.index+P.length)}return _.jsx(_.Fragment,{children:p})}function xv({view:n,onRewind:s,questionsAnswerable:p,contextWindowSource:S,instructionsFile:M,onGoToCli:P,cliPresence:N,exitCode:i,onWakeCli:c,waking:m,discovering:g=!1,toolCallNotice:l=null,serverClosed:v=null,statusLineState:C=null,onConfigureStatusLine:b,continueTargets:f=[],continueBlockedReason:o=null,onContinue:u,searchRequest:a=null,onSearchRequestApplied:h}){const{events:y,usage:L,defaults:k,state:A,waitingFor:x,hasMore:E,loadingMore:T,loadMore:j,images:D,requestImage:B,answer:z,answered:X,answerFailed:Z}=n,[Y,V]=F.useState(""),[I,$]=F.useState(0),[O,U]=F.useState(null);F.useEffect(()=>{a!==null&&(V(a.query),h==null||h(a.seq))},[a,h]);const K=F.useRef(null),ee=F.useRef(new Map),ne=F.useRef(!0),{cards:Q,results:q}=F.useMemo(()=>{const ce=new Map,ze=new Set;for(const Oe of y)for(const Re of Oe.parts)Re.kind==="tool-result"?ce.set(Re.toolUseId,Re):(Re.kind==="tool-call"||Re.kind==="question")&&ze.add(Re.toolUseId);const ot=[];for(const Oe of y){const Re=Oe.parts.filter(Ie=>Ie.kind!=="thinking"&&!(Ie.kind==="tool-result"&&ze.has(Ie.toolUseId)));Re.length!==0&&ot.push({event:Oe,parts:Re})}return{cards:ot,results:ce}},[y]),H=F.useMemo(()=>yv(Q),[Q]),re=Y.trim(),te=F.useMemo(()=>{if(re.length===0)return[];const ce=re.toLowerCase();return Q.filter(ze=>Xh(ze,q).toLowerCase().includes(ce)).map(ze=>ze.event.eventId)},[Q,q,re]);F.useEffect(()=>{$(0)},[re]);const he=F.useMemo(()=>new Set(te),[te]),de=te[I]??null;F.useEffect(()=>{var ce;de!==null&&((ce=ee.current.get(de))==null||ce.scrollIntoView({block:"center"}))},[de]),F.useLayoutEffect(()=>{const ce=K.current;ce===null||!ne.current||re.length>0||(ce.scrollTop=ce.scrollHeight)},[Q.length,re]);const Te=F.useCallback(()=>{const ce=K.current;if(ce===null)return;const ze=ce.scrollHeight-ce.scrollTop-ce.clientHeight;ne.current=ze<=vv},[]),ke=F.useCallback((ce,ze)=>{ze===null?ee.current.delete(ce):ee.current.set(ce,ze)},[]),He=F.useCallback(ce=>{const ze=Xh(ce,q);navigator.clipboard.writeText(ze).then(()=>{U(ce.event.eventId),window.setTimeout(()=>U(null),1200)}).catch(()=>U(null))},[q]),Qe=ce=>{te.length!==0&&$(ze=>(ze+ce+te.length)%te.length)};return _.jsxs("div",{className:"conversation-pane",children:[_.jsxs("div",{className:"conversation-search",children:[_.jsx("input",{className:"conversation-search-input",type:"search",placeholder:"Buscar en la conversacion",value:Y,onChange:ce=>V(ce.target.value),onKeyDown:ce=>{ce.key==="Enter"&&Qe(ce.shiftKey?-1:1),ce.stopPropagation()},spellCheck:!1}),re.length>0&&_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"conversation-matches",children:te.length===0?"sin resultados":`${I+1}/${te.length}`}),_.jsx("button",{className:"icon-button",onClick:()=>Qe(-1),disabled:te.length===0,title:"Anterior",children:"↑"}),_.jsx("button",{className:"icon-button",onClick:()=>Qe(1),disabled:te.length===0,title:"Siguiente",children:"↓"})]}),_.jsx("span",{className:"conversation-spacer"}),u!==void 0&&_.jsx(Gd,{targets:f,className:"icon-button conversation-continue",text:"↪ Continuar con…",blockedReason:o,onPick:u}),_.jsx(ev,{usage:L,source:S,instructionsFile:M,fallbackWindow:k.contextWindow,compact:!0,statusLineState:C,onConfigure:b})]}),_.jsxs("div",{className:"conversation-scroll",ref:K,onScroll:Te,children:[E&&_.jsx("button",{className:"conversation-more",onClick:j,disabled:T,children:T?"Cargando...":"Cargar mensajes anteriores"}),Q.length===0&&_.jsxs("p",{className:"conversation-empty",children:[A==="unavailable"?"Esta pestana no tiene un directorio conocido, asi que no hay archivo de sesion que seguir.":A==="no-transcript"?vg:A==="waiting"?"Esperando el primer mensaje. El archivo de la sesion se crea cuando la conversacion arranca.":"La sesion todavia no tiene mensajes.",A==="waiting"&&g&&_.jsxs(_.Fragment,{children:[_.jsx("br",{}),yg]})]}),H.map(ce=>{if(ce.kind==="card")return _.jsx(Yh,{card:ce.card,results:q,needle:re,isMatch:ce.card.event.eventId===de,copied:O===ce.card.event.eventId,images:D,onRequestImage:B,onCopy:()=>He(ce.card),onRewind:s,register:ke,answered:X,answerFailed:Z,answerable:p,onAnswer:z},ce.card.event.eventId);const ze=ce.cards.some(ot=>he.has(ot.event.eventId));return _.jsx(Rv,{summary:ce.summary,at:ce.at,open:ze,children:ce.cards.map(ot=>_.jsx(Yh,{card:ot,results:q,needle:re,isMatch:ot.event.eventId===de,copied:O===ot.event.eventId,images:D,onRequestImage:B,onCopy:()=>He(ot),onRewind:s,register:ke,answered:X,answerFailed:Z,answerable:p,onAnswer:z},ot.event.eventId))},ce.id)})]}),v!==null&&(v.state==="relaunching"||N==="live")?_.jsx(kv,{text:v.text,relaunching:v.state==="relaunching",onRelaunch:c}):N==="live"?x===null&&l!==null?_.jsx(Lv,{notice:l,onGoToCli:P}):_.jsx(Ev,{waitingFor:x,questionsAnswerable:p,onGoToCli:P}):_.jsx(bv,{presence:N,exitCode:i,waking:m,onWake:c})]})}function bv({presence:n,exitCode:s,waking:p,onWake:S}){const M=n==="sleeping"?"Esta conversación se lee sin la CLI abierta. Abrila para escribirle al agente.":`La CLI de esta pestaña se cerró${s===null?"":` (código ${s})`}.`;return _.jsxs("div",{className:"conversation-waiting conversation-wake",role:"status",children:[_.jsx("span",{className:"conversation-wake-dot","aria-hidden":"true"}),_.jsx("span",{children:M}),_.jsx("button",{className:"primary-button primary-button-small",onClick:S,disabled:p,children:p?"Abriendo…":"Abrir CLI"})]})}function kv({text:n,relaunching:s,onRelaunch:p}){return _.jsxs("div",{className:"conversation-waiting conversation-wake",role:"status",children:[_.jsx("span",{className:"conversation-wake-dot","aria-hidden":"true"}),_.jsx("span",{children:n}),_.jsx("button",{className:"primary-button primary-button-small",onClick:p,disabled:s,children:s?bg:xg})]})}function Ev({waitingFor:n,questionsAnswerable:s,onGoToCli:p}){if(n===null)return null;const S=Hd(n,s);return _.jsxs("div",{className:"conversation-waiting",role:"status",children:[_.jsx("span",{className:"conversation-waiting-dot","aria-hidden":"true"}),_.jsx("span",{children:S}),_.jsx("button",{className:"link-button",onClick:p,children:"Ir a la solapa CLI"})]})}function Lv({notice:n,onGoToCli:s}){return _.jsxs("div",{className:"conversation-waiting",role:"status",children:[_.jsx("span",{className:"conversation-waiting-dot","aria-hidden":"true"}),_.jsx("span",{children:n}),_.jsx("button",{className:"link-button",onClick:s,children:"Ir a la solapa CLI"})]})}function Yh({card:n,results:s,needle:p,isMatch:S,copied:M,images:P,onRequestImage:N,onCopy:i,onRewind:c,register:m,answered:g,answerFailed:l,answerable:v,onAnswer:C}){const{event:b}=n,f=b.role==="user",o=u=>{const a=g[u.toolUseId];return a!==void 0?a:s.has(u.toolUseId)?[]:null};return _.jsxs("article",{ref:u=>m(b.eventId,u),className:`turn turn-${b.role}${S?" turn-match":""}`,children:[_.jsxs("div",{className:"turn-actions",children:[_.jsx("button",{className:"icon-button",onClick:i,title:"Copiar el texto de este mensaje",children:M?"✓":"⧉"}),f&&c!==void 0&&_.jsx("button",{className:"icon-button",onClick:c,title:"Volver aqui — abre el menu de rewind de la CLI en la pestaña CLI (Esc Esc)",children:"↩"})]}),n.parts.map((u,a)=>_.jsx(Av,{part:u,eventId:b.eventId,mine:f,result:u.kind==="tool-call"?s.get(u.toolUseId)??null:null,needle:p,images:P,onRequestImage:N,answeredAt:u.kind==="question"?o(u):null,failure:u.kind==="question"?l[u.toolUseId]??null:null,answerable:v,onAnswer:C},a)),_.jsx(Mv,{event:b,mine:f})]})}function Rv({summary:n,at:s,open:p,children:S}){const M=Jd(s);return _.jsxs("details",{className:"tool-group",open:p,children:[_.jsxs("summary",{className:"tool-group-summary",children:[_.jsx("span",{className:"tool-group-chevron","aria-hidden":"true",children:"▸"}),_.jsx("span",{className:"tool-group-count",children:n}),M.length>0&&_.jsx("span",{className:"tool-group-time",children:M})]}),_.jsx("div",{className:"tool-group-body",children:S})]})}function Mv({event:n,mine:s}){const p=Jd(n.at),S=[];return n.durationMs!==null&&S.push(Cv(n.durationMs)),n.effort!==null&&S.push(`esfuerzo ${n.effort}`),_.jsxs("div",{className:"turn-meta",children:[s&&_.jsx("span",{className:"turn-who",children:"Vos"}),p.length>0&&_.jsx("span",{children:p}),n.queued&&_.jsx("span",{className:"turn-queued",title:"Lo escribiste con el agente trabajando: entro en el turno que ya estaba en curso",children:"enviado mientras trabajaba"}),S.map(M=>_.jsx("span",{className:"turn-meta-bit",children:M},M))]})}function Av({part:n,eventId:s,mine:p,result:S,needle:M,images:P,onRequestImage:N,answeredAt:i,failure:c,answerable:m,onAnswer:g}){switch(n.kind){case"text":return p?_.jsx(Dv,{text:n.text,truncated:n.truncated,needle:M}):_.jsxs("div",{className:"part-text",children:[_.jsx(za,{text:n.text,needle:M}),n.truncated&&_.jsx("span",{className:"part-truncated",children:" … (recortado)"})]});case"image":return _.jsx(Iv,{eventId:s,index:n.index,source:n.source,src:P[ja(s,n.index,n.source)],onRequest:N});case"thinking":return null;case"notice":return _.jsx("div",{className:`turn-notice turn-notice-${n.notice}`,children:ns(Rd(n),M)});case"question":return _.jsx(Tv,{part:n,answeredAt:i,failure:c,answerable:m,onAnswer:g,needle:M});case"tool-call":{const l=M.length>0&&`${n.name} ${n.input} ${(S==null?void 0:S.text)??""}`.toLowerCase().includes(M.toLowerCase());return _.jsxs("details",{className:"tool",open:l,children:[_.jsxs("summary",{className:"tool-summary",children:[_.jsx("span",{className:"tool-name",children:n.name}),S!==null&&S.isError&&_.jsx("span",{className:"tool-error",children:"error"}),S!==null&&S.imageCount>0&&_.jsxs("span",{className:"tool-images",children:[S.imageCount," img"]})]}),_.jsxs("div",{className:"tool-block",children:[_.jsx("span",{className:"tool-label",children:"entrada"}),_.jsxs("pre",{className:"tool-pre",children:[ns(n.input,M),n.truncated&&_.jsx("span",{className:"part-truncated",children:" … (recortado)"})]})]}),S!==null&&_.jsxs("div",{className:"tool-block",children:[_.jsx("span",{className:"tool-label",children:"resultado"}),_.jsxs("pre",{className:`tool-pre${S.isError?" tool-pre-error":""}`,children:[S.text.length>0?ns(S.text,M):S.imageCount>0?`(${S.imageCount} imagen(es): no se transportan al panel)`:"(sin salida)",S.truncated&&_.jsx("span",{className:"part-truncated",children:" … (recortado)"})]})]})]})}case"tool-result":return _.jsxs("div",{className:"tool-block",children:[_.jsx("span",{className:"tool-label",children:"resultado suelto"}),_.jsx("pre",{className:`tool-pre${n.isError?" tool-pre-error":""}`,children:ns(n.text,M)})]})}}function Tv({part:n,answeredAt:s,failure:p,answerable:S,onAnswer:M,needle:P}){var L;const[N,i]=F.useState(()=>n.questions.map(()=>[])),[c,m]=F.useState(null),[g,l]=F.useState(""),v=s!==null,C=v||!S,b=s??N,f=n.questions.length===1&&((L=n.questions[0])==null?void 0:L.multiSelect)===!1,o=b.every(k=>mo(k)?k.text.trim().length>0:k.length>0),u=k=>k===void 0||mo(k)?[]:k,a=(k,A)=>{if(C)return;const x=n.questions[k];if(x!==void 0){if(f){M(n.toolUseId,[[A]]);return}m(E=>E===k?null:E),i(E=>E.map((T,j)=>{if(j!==k)return T;const D=u(T);return x.multiSelect?D.includes(A)?D.filter(B=>B!==A):[...D,A]:[A]}))}},h=k=>{const A=g.trim();if(A.length===0||C)return;const x={kind:"free",text:A};if(f){M(n.toolUseId,[x]);return}i(E=>E.map((T,j)=>j===k?x:T)),m(null),l("")},y=k=>{if(C)return;const A=b[k];l(A!==void 0&&mo(A)?A.text:""),m(k)};return _.jsxs("div",{className:`question${v?" question-done":""}`,children:[n.questions.map((k,A)=>{const x=b[A],E=x!==void 0&&mo(x)?x.text:null;return _.jsxs("div",{className:"question-item",children:[_.jsxs("div",{className:"question-head",children:[k.header.length>0&&_.jsx("span",{className:"question-header",children:k.header}),_.jsx("span",{className:"question-text",children:ns(k.question,P)}),k.multiSelect&&_.jsx("span",{className:"question-hint",children:"varias"})]}),_.jsxs("div",{className:"question-options",children:[k.options.map((T,j)=>{const D=u(x).includes(j);return _.jsxs("button",{type:"button",className:`question-option${D?" question-option-picked":""}`,disabled:C,onClick:()=>a(A,j),children:[_.jsx("span",{className:"question-option-label",children:T.label}),T.description.length>0&&_.jsx("span",{className:"question-option-desc",children:T.description})]},j)}),c===A&&!C?_.jsxs("div",{className:"question-write",children:[_.jsx("textarea",{className:"question-write-input",autoFocus:!0,rows:2,value:g,placeholder:"Escribi tu respuesta",onChange:T=>l(T.target.value),onKeyDown:T=>{T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),h(A)),T.key==="Escape"&&m(null),T.stopPropagation()}}),_.jsxs("div",{className:"question-write-actions",children:[_.jsx("button",{type:"button",className:"question-send",disabled:g.trim().length===0,onClick:()=>h(A),children:f?"Enviar":"Usar este texto"}),_.jsx("button",{type:"button",className:"question-write-cancel",onClick:()=>m(null),children:"Cancelar"})]})]}):_.jsxs("button",{type:"button",className:`question-option question-option-write${E!==null?" question-option-picked":""}`,disabled:C,onClick:()=>y(A),children:[_.jsx("span",{className:"question-option-label",children:E!==null?E:"Escribir otra respuesta…"}),E===null&&_.jsx("span",{className:"question-option-desc",children:"Para proponer una alternativa, o dar mas contexto"})]})]})]},A)}),_.jsxs("div",{className:"question-foot",children:[p!==null&&_.jsx("span",{className:"question-failed",children:p}),v?_.jsx("span",{className:"question-sent",children:"Respondida"}):S?_.jsxs(_.Fragment,{children:[!f&&_.jsx("button",{type:"button",className:"question-send",disabled:!o,onClick:()=>M(n.toolUseId,N),children:"Enviar respuestas"}),_.jsxs("span",{className:"question-note",children:[f?"Elegí una opción":"Elegí en cada pregunta"," · también podés responder en la solapa CLI"]})]}):_.jsx("span",{className:"question-note",children:"Respondé en la solapa CLI"})]})]})}function Dv({text:n,truncated:s,needle:p}){const[S,M]=F.useState(!1),P=n.split(`
121
- `),N=p.length>0&&n.toLowerCase().includes(p.toLowerCase()),i=P.length>=Kh&&!N,c=i&&!S?P.slice(0,Kh-1).join(`
122
- `):n;return _.jsxs("div",{className:"part-text part-mine",children:[wv(c,p),s&&_.jsx("span",{className:"part-truncated",children:" … (recortado)"}),i&&_.jsx("button",{className:"fold-toggle",onClick:()=>M(m=>!m),children:S?"ver menos":`ver las ${P.length} lineas`})]})}function Iv({eventId:n,index:s,source:p,src:S,onRequest:M}){const[P,N]=F.useState(!1);return F.useEffect(()=>{S===void 0&&M(n,s,p)},[S,n,s,p,M]),S===void 0?_.jsx("div",{className:"conversation-image-placeholder",children:"cargando imagen…"}):S===null?_.jsx("div",{className:"conversation-image-placeholder",children:"la imagen ya no esta en el archivo"}):_.jsxs(_.Fragment,{children:[_.jsx("img",{className:"conversation-image",src:S,alt:"imagen del mensaje",onClick:()=>N(!0),title:"Clic para verla entera"}),P&&_.jsx(zd,{src:S,caption:"imagen del mensaje",onClose:()=>N(!1)})]})}function Qh({connection:n,title:s,confirmLabel:p,confirmTitle:S,onChoose:M,onClose:P}){const[N,i]=F.useState(null),[c,m]=F.useState(null),[g,l]=F.useState(!1),[v,C]=F.useState(""),b=F.useRef(null),f=F.useRef(null);F.useEffect(()=>{const h=n.onMessage(y=>{if(y.type==="picker.listing"){b.current=y.listing.pickerId,i(y.listing),m(null),l(!1),C("");return}y.type==="error"&&y.code==="picker-failed"&&m(y.message)});return n.send({type:"picker.open"}),()=>{h();const y=b.current;y!==null&&n.send({type:"picker.close",pickerId:y})}},[n]),F.useEffect(()=>{const h=y=>{y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),P())};return window.addEventListener("keydown",h,!0),()=>window.removeEventListener("keydown",h,!0)},[P]),F.useEffect(()=>{var h;g&&((h=f.current)==null||h.focus())},[g]);const o=F.useCallback(h=>{const y=b.current;y!==null&&n.send({type:"picker.enter",pickerId:y,name:h})},[n]),u=F.useCallback(h=>{const y=b.current;y!==null&&n.send({type:"picker.root",pickerId:y,rootIndex:h})},[n]),a=F.useCallback(()=>{const h=b.current,y=v.trim();h===null||y.length===0||n.send({type:"picker.create",pickerId:h,name:y})},[n,v]);return _.jsx("div",{className:"modal-backdrop",onClick:P,children:_.jsxs("div",{className:"modal picker-modal",role:"dialog","aria-label":s,onClick:h=>h.stopPropagation(),children:[_.jsxs("header",{className:"modal-header",children:[_.jsx("span",{className:"modal-title",children:s}),_.jsx("button",{className:"icon-button",onClick:P,title:"Cerrar",children:"×"})]}),N===null?_.jsx("p",{className:"panel-note",children:"Leyendo el disco..."}):_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"picker-roots",children:N.roots.map((h,y)=>_.jsx("button",{className:"picker-root",onClick:()=>u(y),title:`Ir a ${h}`,children:h},h))}),_.jsx("p",{className:"picker-path",title:N.path,children:N.path}),_.jsxs("div",{className:"picker-list",children:[N.canGoUp&&_.jsx("button",{className:"picker-entry picker-up",onClick:()=>o(".."),children:"‹ carpeta superior"}),N.entries.length===0&&!N.canGoUp&&_.jsx("p",{className:"panel-note",children:"No hay subcarpetas aca."}),N.entries.map(h=>_.jsx("button",{className:"picker-entry",onClick:()=>o(h),children:h},h)),N.truncated&&_.jsx("p",{className:"panel-note",children:"Hay mas subcarpetas de las que entran en la lista. Entra a una para acotar."})]}),c!==null&&_.jsx("p",{className:"picker-problem",children:c}),_.jsxs("footer",{className:"picker-footer",children:[g?_.jsxs("div",{className:"picker-create",children:[_.jsx("input",{ref:f,className:"picker-create-input",value:v,placeholder:"Nombre de la carpeta",onChange:h=>C(h.target.value),onKeyDown:h=>{h.key==="Enter"&&a(),h.key==="Escape"&&(h.stopPropagation(),l(!1)),h.stopPropagation()},spellCheck:!1}),_.jsx("button",{className:"link-button",onClick:a,children:"Crear"}),_.jsx("button",{className:"link-button",onClick:()=>l(!1),children:"Cancelar"})]}):_.jsx("button",{className:"link-button",onClick:()=>l(!0),children:"Crear una carpeta aca"}),_.jsx("span",{className:"composer-spacer"}),_.jsx("button",{className:"picker-open",onClick:()=>M(N.pickerId,N.path),title:S(N.path),children:p})]})]})]})})}function Nv(n,s){return Wa(n)&&s!==null&&s.sessions>0}const Pv="En títulos",jv="En conversaciones",Ov="Busca en el texto de las conversaciones guardadas en la copia propia, sin distinguir mayúsculas ni tildes";function Bv(n){return n==="conversations"?"Buscar en las conversaciones (Enter)":"Filtrar proyectos y sesiones"}const Fv=`Escribí al menos ${Id} caracteres y Enter.`;function $v(n){return[...n.trim()].length<Id}const Hv="La copia propia está apagada: se busca en lo que guardó mientras estuvo encendida.";function Wv(n){const s=new Map;for(const p of n){const S=`${p.agent}:${p.sessionId}`;let M=s.get(S);M===void 0&&(M={key:S,agent:p.agent,sessionId:p.sessionId,title:p.title,titleHit:null,hits:[],lastAt:null},s.set(S,M)),p.eventId===null?M.titleHit=p:M.hits.push(p),p.at!==null&&(M.lastAt=Math.max(M.lastAt??0,p.at))}return[...s.values()]}const Uv=40;function Zd(n,s=Uv){const p=n.matchStart+n.matchLength;let S=n.snippet.slice(0,n.matchStart);if(S.length>s){let M=S.length-s;const P=S.charCodeAt(M);P>=56320&&P<=57343&&(M+=1),S=`…${S.slice(M)}`}return{before:S,match:n.snippet.slice(n.matchStart,p),after:n.snippet.slice(p)}}function zv(n){return n.role==="user"?"Pedido":n.role==="assistant"?"Respuesta":"Título"}function ef(n){return Zd(n).match.trim()}function qv(n){const s=n.hits[0]??n.titleHit;return s===null?"":ef(s)}const Zn=(n,s,p)=>`${n} ${n===1?s:p}`;function Vv(n,s){return{query:s.query,hits:n===null?[...s.hits]:[...n.hits,...s.hits],sessionsScanned:s.sessionsScanned,sessionsTotal:s.sessionsTotal,truncated:null}}function Kv(n){const{result:s}=n;if(n.searching&&n.error===null){if(s===null)return"Buscando…";const S=`Buscando… ${s.sessionsScanned} de ${Zn(s.sessionsTotal,"sesión","sesiones")}`;return s.hits.length===0?`${S}.`:`${S}, ${Jh(s)} por ahora.`}if(n.error!==null)return n.error;if(s===null)return null;const p=s.hits.length===0?"Sin resultados":Jh(s);if(s.truncated===null&&s.hits.length===0&&s.sessionsScanned>0)return`Sin resultados en ${Zn(s.sessionsScanned,"sesión","sesiones")}.`;if(s.truncated==="results")return`${p}: son los primeros, afiná la búsqueda para ver el resto.`;if(s.truncated==="time"){const S=Math.max(0,s.sessionsTotal-s.sessionsScanned);return`${p}: la búsqueda se cortó a los ${Math.round(dm/1e3)} s y quedaron ${Zn(S,"sesión","sesiones")} sin mirar.`}return`${p}.`}function Jh(n){const s=new Set(n.hits.map(p=>`${p.agent}:${p.sessionId}`)).size;return`${Zn(n.hits.length,"acierto","aciertos")} en ${Zn(s,"sesión","sesiones")}`}function Gv(n,s){const p=s.terminals.find(S=>S.kind==="agent"&&S.agent===n.agent&&S.sessionId===n.sessionId);if(p!==void 0)return{kind:"activate",terminalId:p.terminalId};for(const S of s.projects){const M=S.sessions.find(P=>P.agent===n.agent&&P.sessionId===n.sessionId);if(M!==void 0)return Pa(M)&&S.cwdExists&&s.canResume(M.agent)?{kind:"resume",cwd:Pd(M.cwd,S.cwd,s.platform),session:M}:{kind:"copy"}}return{kind:"copy"}}const Xv=[{keys:"Alt + T",description:"Nueva pestaña en el directorio de la pestaña actual"},{keys:"Alt + W",description:"Cerrar la pestaña activa"},{keys:"Alt + ← / →",description:"Pestaña anterior / siguiente (también Alt + RePág / AvPág)"},{keys:"Alt + P",description:"Mostrar u ocultar el panel derecho"},{keys:"Shift + Tab",description:"Volver a la pestaña anterior (fuera de la terminal: adentro es de la CLI)"}];function Yv({agent:n,onClose:s}){return F.useEffect(()=>{const p=S=>{S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),s())};return window.addEventListener("keydown",p,!0),()=>window.removeEventListener("keydown",p,!0)},[s]),_.jsx("div",{className:"modal-backdrop",onClick:s,children:_.jsxs("div",{className:"modal",role:"dialog","aria-label":"Atajos de teclado",onClick:p=>p.stopPropagation(),children:[_.jsxs("header",{className:"modal-header",children:[_.jsx("span",{className:"modal-title",children:"Atajos"}),_.jsx("button",{className:"icon-button",onClick:s,title:"Cerrar",children:"×"})]}),_.jsxs("div",{className:"modal-body",children:[_.jsx("h3",{className:"modal-section",children:"De la aplicación"}),_.jsx(Ea,{shortcuts:Xv}),_.jsx("h3",{className:"modal-section",children:"En el cuadro de escritura"}),_.jsx(Ea,{shortcuts:Gm(n!==null&&n.capabilities.imagesByPath!==null)}),n!==null&&_.jsxs(_.Fragment,{children:[_.jsx("h3",{className:"modal-section",children:"De la CLI, dentro de la terminal"}),_.jsxs("p",{className:"modal-hint",children:["Estas las maneja la CLI. La aplicación no las intercepta: le llegan tal cual. En la terminal, el salto de línea sigue siendo ",_.jsx("kbd",{children:"Ctrl + J"})," y la imagen se pega con ",_.jsx("kbd",{children:"Alt + V"}),"; el cuadro de escritura es el que tiene las teclas de arriba."]}),_.jsx(Ea,{shortcuts:ln[n.id].shortcuts}),ln[n.id].shortcutsNote!==null&&_.jsx("p",{className:"modal-hint",children:ln[n.id].shortcutsNote})]}),_.jsxs("p",{className:"modal-hint",children:[_.jsx("strong",{children:"Ctrl+T"}),", ",_.jsx("strong",{children:"Ctrl+W"})," y ",_.jsx("strong",{children:"Ctrl+Tab"})," no se pueden usar: el navegador se los queda para sus propias pestañas y el evento nunca llega a la página."]}),_.jsxs("p",{className:"modal-hint",children:[_.jsx("strong",{children:"Alt + número"})," tampoco se usa, y es a propósito: en Windows, Alt con el teclado numérico es como se escriben los caracteres que no están en el teclado (",_.jsx("kbd",{children:"Alt + 164"})," = ñ). Interceptarlo rompe la escritura en español. Para cambiar de pestaña están ",_.jsx("kbd",{children:"Alt + ←"})," y ",_.jsx("kbd",{children:"Alt + →"}),"."]})]})]})})}function Ea({shortcuts:n}){return _.jsx("dl",{className:"shortcut-list",children:n.map(s=>_.jsxs("div",{className:"shortcut-row",children:[_.jsx("dt",{children:_.jsx("kbd",{children:s.keys})}),_.jsx("dd",{children:s.description})]},s.keys))})}const Qv=1e3,Jv=5e3;function Zv({info:n,agentLabel:s,onRefresh:p,onClose:S}){const[M,P]=F.useState(!1),[N,i]=F.useState(!1),c=F.useRef(null),m=F.useRef(null);F.useEffect(()=>{const C=b=>{b.key==="Escape"&&(b.preventDefault(),b.stopPropagation(),S())};return window.addEventListener("keydown",C,!0),()=>window.removeEventListener("keydown",C,!0)},[S]),F.useEffect(()=>{i(!1)},[n]),F.useEffect(()=>()=>{c.current!==null&&window.clearTimeout(c.current),m.current!==null&&window.clearTimeout(m.current)},[]);const g=C=>{navigator.clipboard.writeText(C).then(()=>{P(!0),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>P(!1),Qv)}).catch(()=>P(!1))},l=()=>{i(!0),p(),m.current!==null&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>i(!1),Jv)},v=n.state==="active";return _.jsx("div",{className:"modal-backdrop",onClick:S,children:_.jsxs("div",{className:"modal",role:"dialog","aria-label":`Status line de ${s}`,onClick:C=>C.stopPropagation(),children:[_.jsxs("header",{className:"modal-header",children:[_.jsxs("span",{className:"modal-title",children:["Status line de ",s]}),_.jsx("button",{className:"icon-button",onClick:S,title:"Cerrar",children:"×"})]}),_.jsxs("div",{className:"modal-body",children:[_.jsx("p",{className:`status-line-state${v?" status-line-state-active":""}`,children:Um(n.state)}),_.jsx("p",{className:"modal-hint",children:"Con la status line configurada, las pestañas de esta CLI muestran su estado, la barra de “esperando” cuando pide permiso para una herramienta, y el medidor de contexto con la ventana exacta. Sin ella no hay forma de saberlo: la CLI no lo deja en ningún otro archivo."}),_.jsx("h3",{className:"modal-section",children:"La línea"}),n.fragment===null?_.jsx("p",{className:"modal-hint",children:zm}):_.jsxs(_.Fragment,{children:[_.jsxs("p",{className:"modal-hint",children:["Fusionala con lo que ya tiene el archivo de abajo, sin reemplazarlo: si ya tiene llaves, agregá solo la clave ",_.jsx("kbd",{children:"statusLine"}),"."]}),_.jsxs("div",{className:"status-line-fragment",children:[_.jsx("pre",{className:"tool-pre",children:n.fragment}),_.jsx("button",{className:"link-button",onClick:()=>g(n.fragment??""),title:"Copiar la línea al portapapeles",children:M?"✓ Copiada":"Copiar"})]})]}),_.jsx("h3",{className:"modal-section",children:"Dónde"}),_.jsx("p",{className:"status-line-path",children:n.settingsPath}),_.jsx("p",{className:"modal-hint",children:"La app no toca ese archivo: lo editás vos."}),_.jsx("h3",{className:"modal-section",children:"Qué hace el script"}),_.jsx("p",{className:"modal-hint",children:"Guarda sólo estado, modelo y tokens de cada conversación, en la carpeta de la app. No guarda tu email, tu cuota ni el costo, que la CLI también le pasa, y no imprime nada: la línea propia de la CLI queda como está."}),_.jsx("p",{className:"status-line-path",children:n.scriptPath}),_.jsxs("p",{className:"modal-hint",children:["Con la línea puesta lo corre toda sesión de la CLI, también las que abras fuera de la app, y necesita ",_.jsx("kbd",{children:"node"})," en el PATH."]}),_.jsxs("div",{className:"status-line-actions",children:[_.jsx("button",{className:"primary-button",onClick:l,disabled:N,children:N?"Comprobando…":"Comprobar"}),_.jsx("span",{className:"modal-hint",children:"También se entera sola en un par de segundos."})]})]})]})})}function Oa({agent:n,agents:s}){return _.jsx("span",{className:"agent-badge",title:ti(n,s),children:Pm(n)})}function tf({className:n,text:s,title:p,disabled:S,offerAgentChoice:M,agents:P,agent:N,onOpen:i}){var b;const[c,m]=F.useState(!1),g=F.useRef(null),l=F.useCallback(()=>m(!1),[]),v=F.useCallback(f=>{m(!1),i(f)},[i]);if(!M)return _.jsx("button",{className:n,onClick:()=>i(),disabled:S,title:p,children:s});const C=((b=P.find(f=>f.id===N))==null?void 0:b.label)??null;return _.jsxs("span",{className:"split-button",children:[_.jsx("button",{className:`${n} split-button-main`,onClick:()=>i(N??void 0),disabled:S,title:C===null?p:`${p} — con ${C}`,children:s}),_.jsx("button",{ref:g,className:`${n} split-button-arrow`,onClick:()=>m(f=>!f),disabled:S,"aria-haspopup":"menu","aria-expanded":c,title:"Elegir con qué CLI abrir",children:"▾"}),c&&g.current!==null&&_.jsx(Kd,{agents:P,preselected:N,anchor:g.current,onPick:v,onClose:l})]})}function e0(n){const s=new Date(n);return s.setHours(0,0,0,0),s.getTime()}function rf(n,s,p,S){const M=new Set;for(const P of n)for(const N of P.sessions)N.agent===s&&(N.archived||N.updatedAt<p&&(S.has(N.sessionId)||M.add(N.sessionId)));return[...M]}function t0(n,s,p,S){const M=[];for(const i of n)for(const c of i.sessions)M.includes(c.agent)||M.push(c.agent);const P=S,N=i=>{const c=P.indexOf(i);return c===-1?S.length:c};return M.sort((i,c)=>N(i)-N(c)).map(i=>({agent:i,count:rf(n,i,s,p).length})).filter(i=>i.count>0)}function sf(n,s){const p=new Set;let S=0;for(const M of n.sessions)if(!M.archived){if(s.has(M.sessionId)){S+=1;continue}p.add(M.sessionId)}return{sessionIds:[...p],blocked:S}}function r0(n){const{sessionIds:s,blocked:p}=n;if(s.length===0)return p===1?"Su única conversación tiene una pestaña abierta. Cerrala primero.":`Sus ${p} conversaciones tienen una pestaña abierta. Cerralas primero.`;const S=s.length===1?"¿Archivar 1 conversación?":`¿Archivar las ${s.length} conversaciones?`;return p===0?S:p===1?`${S} Otra tiene una pestaña abierta y se queda.`:`${S} Otras ${p} tienen una pestaña abierta y se quedan.`}function is(n){if(n<=0)return"";const s=Math.floor((Date.now()-n)/6e4);if(s<1)return"recien";if(s<60)return`hace ${s} min`;const p=Math.floor(s/60);if(p<24)return`hace ${p} h`;const S=Math.floor(p/24);return S<30?`hace ${S} d`:new Date(n).toLocaleDateString()}const La="agent-workbench.notes-open",Zh="agent-workbench.notes-active",ed="agent-workbench.notes-height",Ra=160,s0=300;function Ma(n){try{return window.localStorage.getItem(n)}catch{return null}}function go(n,s){try{window.localStorage.setItem(n,s)}catch{}}function n0({notes:n,onSendNote:s,sendTargetCwd:p}){const[S,M]=F.useState(()=>Ma(La)==="true"),[P,N]=F.useState(()=>{const j=Number.parseInt(Ma(ed)??"",10);return Number.isFinite(j)?Math.max(j,Ra):s0}),[i,c]=F.useState(()=>Ma(Zh)),[m,g]=F.useState(null),[l,v]=F.useState(null),[C,b]=F.useState(0),f=F.useMemo(()=>n.notes.length===0?null:n.notes.find(j=>j.noteId===i)??n.notes[n.notes.length-1]??null,[n.notes,i]),o=F.useCallback(j=>{c(j),go(Zh,j),g(null)},[]),u=F.useCallback(()=>{M(j=>{const D=!j;return go(La,String(D)),D})},[]),a=F.useCallback(()=>{const j=n.create();o(j),S||(M(!0),go(La,"true")),b(D=>D+1)},[n,S,o]),h=F.useCallback(j=>{if(j.text.trim().length===0&&j.images.length===0){n.remove(j.noteId);return}o(j.noteId),g(j.noteId)},[n,o]),y=F.useCallback(()=>{m!==null&&n.remove(m),g(null)},[m,n]),L=F.useRef(null),k=F.useCallback(j=>{L.current={startY:j.clientY,startHeight:P},j.currentTarget.setPointerCapture(j.pointerId),j.preventDefault()},[P]),A=F.useCallback(j=>{const D=L.current;if(D===null)return;const B=Math.max(Ra,Math.floor(window.innerHeight*.8));N(Math.min(B,Math.max(Ra,D.startHeight+D.startY-j.clientY)))},[]),x=F.useCallback(j=>{L.current!==null&&(L.current=null,j.currentTarget.releasePointerCapture(j.pointerId),go(ed,String(P)))},[P]);F.useEffect(()=>{if(l===null)return;const j=D=>{D.key==="Escape"&&(D.stopPropagation(),v(null))};return window.addEventListener("keydown",j,!0),()=>window.removeEventListener("keydown",j,!0)},[l]);const E=l===null?void 0:n.images[l],T=n.notes.length;return _.jsxs("section",{className:`notes${S?" notes-open":""}`,style:S?{height:`${P}px`}:void 0,children:[S&&_.jsx("div",{className:"notes-resize",onPointerDown:k,onPointerMove:A,onPointerUp:x,onPointerCancel:x,title:"Arrastrar para cambiar el alto"}),S?_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"notes-header",children:[_.jsxs("div",{className:"strip-tabs",role:"tablist",children:[n.notes.map(j=>{const D=j.noteId===(f==null?void 0:f.noteId),B=cm(j);return _.jsxs("div",{className:`strip-tab${D?" is-active":""}`,role:"tab","aria-selected":D,children:[_.jsx("button",{className:"strip-tab-label",onClick:()=>o(j.noteId),title:B,children:B}),_.jsx("button",{className:"strip-tab-close",onClick:()=>h(j),title:"Cerrar la nota. Se borra, con sus imagenes",children:"×"})]},j.noteId)}),_.jsx("button",{className:"strip-tab-new",onClick:a,title:"Nueva nota",children:"+"})]}),_.jsx("span",{className:"strip-spacer"}),_.jsx("button",{className:"icon-button",onClick:u,title:"Plegar. Las notas no se pierden: cerrarlas es la × de cada solapa",children:"▾"})]}),_.jsx("div",{className:"notes-body",children:T===0||f===null?_.jsxs("p",{className:"notes-empty",children:["Sin notas. El ",_.jsx("b",{children:"+"})," abre una; sirven para anotar una idea sin salir de lo que estas haciendo."]}):_.jsx(l0,{note:f,notes:n,closing:m===f.noteId,focusRequest:C,onConfirmClose:y,onCancelClose:()=>g(null),onOpenImage:v,onSend:s===null?null:()=>s(f.noteId),sendTargetCwd:p},f.noteId)})]}):_.jsxs("button",{className:"strip-collapsed",onClick:u,title:"Desplegar las notas",children:[_.jsx("span",{className:"strip-collapsed-arrow",children:"▸"}),_.jsx("span",{children:"Notas"}),T>0&&_.jsx("span",{className:"strip-collapsed-count",children:T})]}),l!==null&&_.jsx("div",{className:"notes-lightbox",onClick:()=>v(null),title:"Clic para cerrar",children:typeof E=="string"?_.jsx("img",{src:E,alt:"imagen de la nota"}):_.jsx("span",{className:"notes-lightbox-missing",children:"la imagen no esta disponible"})})]})}function i0(){return _.jsx("svg",{viewBox:"0 0 24 24",width:"15",height:"15",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:_.jsx("path",{d:"M20 11.5 11.7 19.8a5 5 0 0 1-7.1-7.1l8.6-8.6a3.4 3.4 0 0 1 4.8 4.8l-8.5 8.5a1.8 1.8 0 0 1-2.5-2.5l7.9-7.9"})})}function o0(){return _.jsxs("svg",{viewBox:"0 0 24 24",width:"15",height:"15",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[_.jsx("path",{d:"M21.5 2.5 11 13"}),_.jsx("path",{d:"M21.5 2.5 15 21.5l-4-8.5-8.5-4z"})]})}function l0({note:n,notes:s,closing:p,focusRequest:S,onConfirmClose:M,onCancelClose:P,onOpenImage:N,onSend:i,sendTargetCwd:c}){const m=F.useRef(null),[g,l]=F.useState(!1),v=n.text.trim().length===0&&n.images.length===0;F.useEffect(()=>{var f;S>0&&((f=m.current)==null||f.focus())},[S]);const C=F.useCallback(f=>{const o=Array.from(f).filter(u=>u.type.startsWith("image/"));for(const u of o)s.addImage(n.noteId,u);return o.length>0},[s,n.noteId]),b=F.useCallback(f=>{f.clipboardData!==null&&C(f.clipboardData.files)&&f.preventDefault()},[C]);return _.jsxs("div",{className:`note-editor${g?" note-editor-dragging":""}`,onDragOver:f=>{Array.from(f.dataTransfer.types).includes("Files")&&(f.preventDefault(),l(!0))},onDragLeave:()=>l(!1),onDrop:f=>{f.preventDefault(),l(!1),C(f.dataTransfer.files)},children:[p&&_.jsxs("div",{className:"note-closing",children:[_.jsx("span",{children:"Cerrar esta nota la borra, con sus imagenes."}),_.jsx("button",{className:"link-button link-danger",onClick:M,children:"Cerrar"}),_.jsx("button",{className:"link-button",onClick:P,children:"Cancelar"})]}),s.problem!==null&&_.jsxs("div",{className:"composer-problem",children:[_.jsx("span",{children:s.problem}),_.jsx("button",{className:"icon-button",onClick:s.dismissProblem,title:"Cerrar",children:"×"})]}),_.jsx("textarea",{ref:m,className:"note-input",value:n.text,placeholder:"Anota una idea. Las imagenes se pegan o se arrastran aca.",onChange:f=>s.updateText(n.noteId,f.target.value),onPaste:b,spellCheck:!1}),n.images.length>0&&_.jsx("div",{className:"note-images",children:n.images.map(f=>_.jsx(a0,{image:f,src:s.images[f.imageId],onRequest:s.requestImage,onOpen:()=>N(f.imageId),onRemove:()=>s.removeImage(n.noteId,f.imageId)},f.imageId))}),_.jsxs("div",{className:"note-footer",children:[_.jsx("span",{className:"note-meta",children:is(n.updatedAt)}),_.jsx("span",{className:"composer-spacer"}),_.jsx("button",{className:"icon-button",onClick:()=>i==null?void 0:i(),disabled:i===null||v,title:rg(i!==null,c,v),children:_.jsx(o0,{})}),_.jsxs("label",{className:"icon-button note-attach",title:"Adjuntar una imagen desde un archivo",children:[_.jsx(i0,{}),_.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:f=>{f.target.files!==null&&C(f.target.files),f.target.value=""}})]})]})]})}function a0({image:n,src:s,onRequest:p,onOpen:S,onRemove:M}){return F.useEffect(()=>{s===void 0&&p(n.imageId)},[s,n.imageId,p]),_.jsxs("figure",{className:"chip chip-image note-thumb",title:c0(n.bytes),children:[typeof s=="string"?_.jsx("img",{src:s,alt:"imagen de la nota",onClick:S}):_.jsx("span",{className:"note-thumb-placeholder",children:s===null?"no esta":"…"}),_.jsx("button",{className:"chip-remove",onClick:M,title:"Quitar la imagen",children:"×"})]})}function c0(n){return n<1024?`${n} B`:n<1024*1024?`${Math.round(n/1024)} KB`:`${(n/1024/1024).toFixed(1)} MB`}const td=12;function u0(n){let s=2166136261;for(let p=0;p<n.length;p+=1)s^=n.charCodeAt(p),s=Math.imul(s,16777619);return s>>>0}function qa(n){const s=n.toLowerCase().replace(/[\\/]+/g,"/").replace(/\/+$/,"");return`hsl(${u0(s)%td*(360/td)} var(--project-color-s) var(--project-color-l))`}const an="Copia propia",h0="Guarda lo mismo que el historial de cada CLI —mensajes, entradas y resultados de herramientas, imágenes— en una carpeta tuya. Si la ponés en una carpeta sincronizada o en un repositorio, eso viaja con ella.",d0="Las sesiones archivadas no se copian, y archivar una ya copiada no borra su copia. La app nunca borra nada de esta carpeta.",f0="copia",rd="El historial de la CLI ya no tiene esta sesión. Se abre la copia propia, en Markdown.",p0="parcial",_0="Sólo se rescató la ficha y los documentos: el contenido de la conversación está cifrado.";function nf(n){return`${n} ${n===1?"sesión":"sesiones"}`}function Qn(n){return!Number.isFinite(n)||n<1024?`${Math.max(0,Math.round(n)||0)} B`:n<1024*1024?`${Math.round(n/1024)} KB`:n<1024*1024*1024?`${(n/(1024*1024)).toFixed(1)} MB`:`${(n/(1024*1024*1024)).toFixed(2)} GB`}function m0(n){if(!Number.isFinite(n)||n<1e3)return"menos de 1 s";const s=Math.round(n/1e3);if(s<60)return`${s} s`;const p=Math.floor(s/60),S=s%60;return S===0?`${p} min`:`${p} min ${S} s`}function Va(n){return n==="measuring"||n==="writing"||n==="moving"}function sd(n){return n.progress===null?"":` ${n.progress.done} / ${n.progress.total}`}function g0(n){switch(n.state){case"measuring":return`Midiendo…${sd(n)}`;case"writing":return`Copiando…${sd(n)}`;case"moving":return"Mudando de carpeta…";default:return n.enabled?"Encendida":"Apagada"}}function v0(n){if(n===null||!n.enabled)return null;const s=[an,nf(n.sessions)];return n.state==="writing"?s.push(n.progress===null?"copiando":`copiando ${n.progress.done} / ${n.progress.total}`):n.state==="moving"?s.push("mudando de carpeta"):n.state==="measuring"?s.push("midiendo"):s.push(n.lastPassAt===null?"sin copiar todavía":is(n.lastPassAt)),n.pending>0&&s.push(`${n.pending} esperando`),s.join(" · ")}function y0(n){return n===null?an:n.enabled?`${an}: encendida. Ver el estado y la carpeta`:`${an}: apagada. Configurar`}function S0(n){return n.enabled?"enabled":Va(n.state)?"busy":n.measurement!==null?"measured":n.passSessions>0?"existing":"needs-measure"}function C0(n,s){return Va(n.state)?"Hay una operación de la copia en curso. Esperá a que termine.":s?null:"Todavía se está leyendo el historial. Medí cuando termine."}function w0(n){return Va(n.state)?"Hay una operación de la copia en curso. Esperá a que termine.":null}function x0(n){return`La carpeta anterior quedó intacta: ${n}`}function nd(n,s,p){return`${n} ${n===1?s:p}`}function b0(n){const s=[];if(n.skippedEmpty>0&&s.push(nd(n.skippedEmpty,"vacía","vacías")),n.unsupported>0&&s.push(`${n.unsupported} sin lectura completa`),n.failed>0){const p=n.failureReasons.length>0?` (${n.failureReasons.join("; ")})`:"";s.push(`${nd(n.failed,"fallida","fallidas")}${p}`)}return s.length===0?null:`No se copian: ${s.join(" · ")}`}function k0(n,s){const p=n.byAgent.map(P=>({agent:P.agent,label:ti(P.agent,s),sessions:P.sessions,bytes:P.eventBytes+P.imageBytes,images:P.images,imageBytes:P.imageBytes,skippedArchived:P.skippedArchived,note:b0(P)})),S=p.reduce((P,N)=>({sessions:P.sessions+N.sessions,bytes:P.bytes+N.bytes,images:P.images+N.images,skippedArchived:P.skippedArchived+N.skippedArchived}),{sessions:0,bytes:n.memoryBytes,images:0,skippedArchived:0}),M=is(n.measuredAt);return{rows:p,memoryProjects:n.memoryProjects,memoryBytes:n.memoryBytes,total:S,summary:`Medido ${M.length>0?`${M}, `:""}en ${m0(n.durationMs)}`}}function E0(n){const s=n.storage==="vault";return{copy:s,partial:s&&n.partial}}function L0(n){switch(n){case"exporting":return"Exportando a Markdown…";case"done":return"Exportado: se abrió la carpeta";default:return"Exportar a Markdown las sesiones de este proyecto"}}const R0=1e3;function id({hit:n}){const{before:s,match:p,after:S}=Zd(n);return _.jsxs(_.Fragment,{children:[s,_.jsx("mark",{children:p}),S]})}function M0({project:n,openSessionIds:s,onConfirm:p,onCancel:S}){const M=sf(n,s);return _.jsxs("div",{className:"project-archive-confirm",role:"group",children:[_.jsx("span",{className:"archive-history-text",children:r0(M)}),M.sessionIds.length>0&&_.jsx("button",{className:"link-button",onClick:p,children:"Archivar"}),_.jsx("button",{className:"link-button",onClick:S,children:M.sessionIds.length>0?"Cancelar":"Cerrar"})]})}function Aa(n){if(n.cwd.length===0)return n.fallbackName;const s=n.cwd.split(/[\\/]/).filter(p=>p.length>0);return s[s.length-1]??n.cwd}function od({out:n}){return _.jsxs("svg",{className:"archive-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[_.jsx("rect",{x:"2.5",y:"3.5",width:"19",height:"5",rx:"1.2"}),_.jsx("path",{d:"M4.5 8.5v10a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-10"}),n?_.jsx("path",{d:"M12 18.5v-6M9.2 15.3 12 12.5l2.8 2.8"}):_.jsx("path",{d:"M10 12.5h4"})]})}function A0(){return _.jsxs("svg",{className:"archive-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[_.jsx("path",{d:"M8 6.5V4.5a1.5 1.5 0 0 1 1.5-1.5h9A1.5 1.5 0 0 1 20 4.5v11a1.5 1.5 0 0 1-1.5 1.5H17"}),_.jsx("rect",{x:"4",y:"7",width:"12",height:"14",rx:"1.5"}),_.jsx("path",{d:"M7.5 12h5M7.5 15.5h5"})]})}function T0({done:n}){return _.jsx("svg",{className:"archive-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n?_.jsx("path",{d:"M5 12.5l4.5 4.5L19 7.5"}):_.jsxs(_.Fragment,{children:[_.jsx("path",{d:"M14 3H7a1.5 1.5 0 0 0-1.5 1.5v15A1.5 1.5 0 0 0 7 21h10a1.5 1.5 0 0 0 1.5-1.5V7.5z"}),_.jsx("path",{d:"M12 10.5v6.5M9.2 14.2 12 17l2.8-2.8"})]})})}function Ba(n){return`${n} ${n===1?"sesión":"sesiones"}`}function D0({candidates:n,agents:s,onArchiveAgent:p,onClose:S,anchorRef:M}){const[P,N]=F.useState(null),i=F.useRef(null);return F.useEffect(()=>{const c=l=>{var v,C;return l instanceof Node&&(((v=i.current)==null?void 0:v.contains(l))===!0||((C=M.current)==null?void 0:C.contains(l))===!0)},m=l=>{l.key!=="Escape"||!c(document.activeElement)||(l.preventDefault(),l.stopPropagation(),S())},g=l=>{c(l.target)||S()};return window.addEventListener("keydown",m,!0),document.addEventListener("pointerdown",g,!0),()=>{window.removeEventListener("keydown",m,!0),document.removeEventListener("pointerdown",g,!0)}},[M,S]),_.jsxs("div",{ref:i,className:"archive-history",role:"region","aria-label":"Archivar historial",children:[_.jsxs("div",{className:"archive-history-header",children:[_.jsx("span",{children:"Archivar lo anterior a hoy"}),_.jsx("button",{className:"icon-button",onClick:S,title:"Cerrar (Esc)",children:"×"})]}),n.map(({agent:c,count:m})=>{const g=ti(c,s);return P===c?_.jsxs("div",{className:"archive-history-row archive-history-confirm",children:[_.jsxs("span",{className:"archive-history-text",children:["Se ",m===1?"esconde":"esconden"," ",Ba(m)," de ",g,"; no se borra nada"]}),_.jsx("button",{className:"link-button",onClick:()=>p(c),children:"Archivar"}),_.jsx("button",{className:"link-button",onClick:()=>N(null),children:"Cancelar"})]},c):_.jsxs("div",{className:"archive-history-row",children:[_.jsxs("span",{className:"archive-history-text",children:[_.jsx("span",{className:"archive-history-agent",children:g}),_.jsxs("span",{className:"archive-history-count",children:[Ba(m)," ",m===1?"anterior":"anteriores"," a hoy"]})]}),_.jsx("button",{className:"link-button",onClick:()=>N(c),children:"Archivar"})]},c)})]})}function I0({projects:n,indexStatus:s,disabled:p,openSessionIds:S,openBlocked:M,onOpenProject:P,agents:N,offerAgentChoice:i,agentForProject:c,onOpenSession:m,canResume:g,platform:l,onRefresh:v,onArchive:C,onHide:b,width:f,notes:o,onNewProject:u,onSendNote:a,sendNoteCwd:h,vault:y,onOpenVault:L,onOpenVaultSession:k,onExportProject:A,exporting:x,lastExported:E,onContinueSession:T,globalSearch:j,onOpenSearchHit:D}){const[B,z]=F.useState(new Set),[X,Z]=F.useState(null);F.useEffect(()=>{const ue=E===null?0:E.at+R0-Date.now();if(E===null||ue<=0)return;Z(E.projectKey);const De=window.setTimeout(()=>Z(null),ue);return()=>window.clearTimeout(De)},[E]);const Y=ue=>x.has(ue)?"exporting":X===ue?"done":"idle",V=v0(y),[I,$]=F.useState(""),[O,U]=F.useState(!1),[K,ee]=F.useState(new Set),[ne,Q]=F.useState("titles"),q=j===null?"titles":ne,[H,re]=F.useState(!1),te=j!==null&&q==="conversations"&&I.trim().length>0&&(H||j.submitted!==null),he=(j==null?void 0:j.result)??null,de=F.useMemo(()=>te&&he!==null?Wv(he.hits):[],[te,he]),Te=ue=>{Q(ue),re(!1),j==null||j.clear()},ke=()=>{if(j!==null){if($v(I)){re(!0),j.clear();return}re(!1),j.search(I.trim(),O)}},He=(j==null?void 0:j.submitted)??null,Qe=j==null?void 0:j.search;F.useEffect(()=>{q!=="conversations"||He===null||Qe===void 0||He.includeArchived!==O&&Qe(He.query,O)},[q,He,Qe,O]);const ce=F.useMemo(()=>n.reduce((ue,De)=>ue+De.sessions.filter(Fe=>Fe.archived).length,0),[n]),ze=F.useMemo(()=>{const ue=q==="titles"?I.trim().toLowerCase():"";return n.map(De=>{const Fe=O?De.sessions:De.sessions.filter(Cr=>!Cr.archived);if(Fe.length===0)return null;if(ue.length===0)return{...De,sessions:Fe};if(Aa(De).toLowerCase().includes(ue)||De.cwd.toLowerCase().includes(ue))return{...De,sessions:Fe};const qe=Fe.filter(Cr=>Cr.title.toLowerCase().includes(ue));return qe.length>0?{...De,sessions:qe}:null}).filter(De=>De!==null)},[n,I,O,q]),ot=q==="titles"&&I.trim().length>0,Oe=ue=>ue.archived||!S.has(ue.sessionId),[Re,Ie]=F.useState(!1),we=F.useRef(null),We=e0(Date.now()),et=F.useMemo(()=>N.map(ue=>ue.id),[N]),Ve=F.useMemo(()=>t0(n,We,S,et),[n,We,S,et]),[ht,Je]=F.useState(null);F.useEffect(()=>{Ve.length===0&&Ie(!1)},[Ve.length]);const St=F.useCallback(()=>Ie(!1),[]),tt=ue=>{const De=rf(n,ue,We,S);De.length>0&&(C(De,!0),Je({what:ti(ue,N),sessionIds:De})),Ie(!1)},[me,Ce]=F.useState(null),rt=ue=>{const De=sf(ue,S);De.sessionIds.length>0&&(C(De.sessionIds,!0),Je({what:Aa(ue),sessionIds:De.sessionIds})),Ce(null)},ye=()=>{ht!==null&&C(ht.sessionIds,!1),Je(null)},Ye=ue=>{ee(De=>{const Fe=new Set(De);return Fe.has(ue)?Fe.delete(ue):Fe.add(ue),Fe})},it=F.useMemo(()=>{const ue=[];for(const De of ze)for(const Fe of De.sessions)K.has(Fe.sessionId)&&ue.push(Fe);return ue},[ze,K]),dt=ue=>{const De=it.filter(Fe=>ue?Oe(Fe):!0).map(Fe=>Fe.sessionId);De.length>0&&C(De,ue),ee(new Set)},Ke=ue=>{z(De=>{const Fe=new Set(De);return Fe.has(ue)?Fe.delete(ue):Fe.add(ue),Fe})},lt=s.state==="scanning";return _.jsxs("aside",{className:"sidebar",style:{width:`${f}px`},children:[_.jsxs("div",{className:"sidebar-header",children:[_.jsx("input",{className:"sidebar-filter",type:"search",placeholder:Bv(q),value:I,onChange:ue=>{$(ue.target.value),q==="conversations"&&(re(!1),ue.target.value.trim().length===0&&(j==null||j.clear()))},onKeyDown:ue=>{q!=="conversations"||ue.key!=="Enter"||(ue.preventDefault(),ke())},spellCheck:!1}),_.jsx("button",{className:"icon-button",onClick:u,title:"Proyecto nuevo: elegir o crear una carpeta",disabled:p,children:"+"}),_.jsx("button",{className:"icon-button",onClick:v,title:"Reindexar el historial",disabled:lt,children:"⟳"}),_.jsx("button",{className:`icon-button${(y==null?void 0:y.enabled)===!0?" icon-button-on":""}`,onClick:L,title:y0(y),"aria-label":"Copia propia",children:_.jsx(A0,{})}),_.jsx("button",{className:"icon-button",onClick:b,title:"Ocultar los proyectos",children:"«"})]}),j!==null&&_.jsxs("div",{className:"sidebar-search-mode",role:"group","aria-label":"Dónde buscar",children:[_.jsx("button",{className:`sidebar-search-mode-option${q==="titles"?" is-on":""}`,"aria-pressed":q==="titles",onClick:()=>Te("titles"),title:"Filtra la lista por nombre de proyecto y título de sesión",children:Pv}),_.jsx("button",{className:`sidebar-search-mode-option${q==="conversations"?" is-on":""}`,"aria-pressed":q==="conversations",onClick:()=>Te("conversations"),title:Ov,children:jv})]}),lt&&_.jsxs("div",{className:"sidebar-progress",children:["Indexando ",s.scannedFiles," / ",s.totalFiles]}),(ce>0||Ve.length>0)&&_.jsxs("div",{className:"sidebar-archive-bar",children:[ce>0&&_.jsxs("button",{className:`sidebar-archived-toggle${O?" is-on":""}`,onClick:()=>U(ue=>!ue),title:"Las archivadas siguen en disco; esto solo las muestra u oculta",children:[O?"Ocultar":"Ver"," ",ce," archivada",ce===1?"":"s"]}),Ve.length>0&&_.jsx("button",{ref:we,className:`link-button sidebar-archive-history${Re?" is-on":""}`,onClick:()=>Ie(ue=>!ue),"aria-expanded":Re,title:"Esconder de una vez las sesiones de una CLI anteriores a hoy. No borra nada",children:"Archivar historial…"})]}),Re&&Ve.length>0&&_.jsx(D0,{candidates:Ve,agents:N,onArchiveAgent:tt,onClose:St,anchorRef:we}),ht!==null&&!Re&&_.jsxs("div",{className:"archive-history archive-history-undo",role:"status",children:[_.jsxs("span",{className:"archive-history-text",children:[ht.sessionIds.length===1?"Se archivó":"Se archivaron"," ",Ba(ht.sessionIds.length)," de ",ht.what]}),_.jsx("button",{className:"link-button",onClick:ye,children:"Deshacer"}),_.jsx("button",{className:"icon-button",onClick:()=>Je(null),title:"Cerrar el aviso; las sesiones siguen archivadas",children:"×"})]}),V!==null&&_.jsx("button",{className:`sidebar-vault-line${(y==null?void 0:y.lastError)!=null?" is-problem":""}`,onClick:L,title:(y==null?void 0:y.lastError)!=null?`Último error: ${y.lastError}`:"Ver el estado y la carpeta de la copia propia",children:V}),_.jsxs("div",{className:"sidebar-scroll",children:[te&&j!==null&&_.jsxs("div",{className:"search-results",children:[!j.vaultEnabled&&_.jsx("p",{className:"search-note",children:Hv}),_.jsx("p",{className:`search-status${j.error!==null?" is-problem":""}`,role:"status",children:H?Fv:Kv(j)}),!H&&de.map(ue=>{const De=ue.hits[0]??ue.titleHit;return De===null?null:_.jsxs("div",{className:"search-group",children:[_.jsxs("button",{className:"search-group-title",onClick:()=>D(De,qv(ue)),title:ue.title,children:[_.jsx(Oa,{agent:ue.agent,agents:N}),ue.titleHit!==null?_.jsx(id,{hit:ue.titleHit}):ue.title]}),ue.hits.map(Fe=>_.jsxs("button",{className:"search-hit",onClick:()=>D(Fe,ef(Fe)),children:[_.jsx("span",{className:"search-hit-snippet",children:_.jsx(id,{hit:Fe})}),_.jsxs("span",{className:"search-hit-meta",children:[zv(Fe),Fe.at!==null?` · ${is(Fe.at)}`:""]})]},Fe.eventId??"titulo"))]},ue.key)})]}),!te&&ze.length===0&&!lt&&_.jsx("p",{className:"sidebar-empty",children:n.length===0?"No se encontraron proyectos en el historial.":"Nada coincide con el filtro."}),!te&&ze.map(ue=>{const De=B.has(ue.key)||ot,Fe=!p&&ue.cwdExists,Sr=M(ue.cwd);return _.jsxs("div",{className:"project",children:[_.jsxs("div",{className:"project-row",children:[_.jsxs("button",{className:"project-toggle",onClick:()=>Ke(ue.key),title:ue.cwd.length>0?ue.cwd:ue.fallbackName,children:[_.jsx("span",{className:`chevron${De?" chevron-open":""}`,children:"›"}),_.jsx("span",{className:"project-swatch",style:{background:qa(ue.cwd)},"aria-hidden":"true"}),_.jsx("span",{className:"project-name",children:Aa(ue)}),_.jsx("span",{className:"project-count",children:ue.sessions.length})]}),_.jsxs("span",{className:"project-actions",children:[_.jsx("button",{className:`icon-button project-action${Y(ue.key)!=="idle"?" project-action-busy":""}`,onClick:()=>A(ue.key),disabled:Y(ue.key)==="exporting",title:L0(Y(ue.key)),"aria-label":"Exportar a Markdown",children:_.jsx(T0,{done:Y(ue.key)==="done"})}),_.jsx("button",{className:`icon-button project-action${me===ue.key?" project-action-busy":""}`,onClick:()=>Ce(qe=>qe===ue.key?null:ue.key),title:"Archivar el proyecto: esconde sus conversaciones de la barra. No borra nada","aria-label":"Archivar proyecto","aria-expanded":me===ue.key,children:_.jsx(od,{out:!1})})]}),_.jsx(tf,{className:"icon-button",text:"+",title:Sr?Wd:ue.cwdExists?"Nueva sesion en este proyecto":"La carpeta ya no existe en disco",disabled:!Fe||Sr,offerAgentChoice:i,agents:N,agent:i?c(ue):null,onOpen:qe=>P(ue.cwd,qe)})]}),!ue.cwdExists&&_.jsx("div",{className:"project-missing",title:ue.cwd,children:"carpeta no encontrada"}),me===ue.key&&_.jsx(M0,{project:ue,openSessionIds:S,onConfirm:()=>rt(ue),onCancel:()=>Ce(null)}),De&&_.jsx("ul",{className:"session-list",children:ue.sessions.map(qe=>{const Cr=K.has(qe.sessionId),os=!Oe(qe),Br=mg(qe.agent,N,i),or=E0(qe),Fr=Pa(qe)&&g(qe.agent),lr=or.copy||Fe&&Fr;return _.jsxs("li",{className:`session-row${qe.archived?" session-archived":""}${Cr?" session-selected":""}`,children:[_.jsxs("button",{className:"session-item",onClick:Pt=>{if(Pt.ctrlKey||Pt.metaKey){Ye(qe.sessionId);return}if(or.copy){k(qe);return}Pa(qe)&&(qe.archived&&C([qe.sessionId],!1),m(Pd(qe.cwd,ue.cwd,l),qe))},disabled:!lr,title:or.copy?`${qe.title}
123
- ${rd}`:Br.unavailableTitle??qe.title,children:[_.jsxs("span",{className:"session-title",children:[Br.badge&&_.jsx(Oa,{agent:qe.agent,agents:N}),or.copy&&_.jsx("span",{className:"session-vault-mark",title:rd,children:f0}),or.partial&&_.jsx("span",{className:"session-partial-mark",title:_0,children:p0}),qe.title]}),_.jsx("span",{className:"session-meta",children:is(qe.updatedAt)})]}),_.jsx(Gd,{targets:$d(N,qe.agent,qe.partial),className:"icon-button session-continue",text:"↪",onPick:Pt=>T(qe,Pt)}),_.jsx("button",{className:"icon-button session-action",onClick:()=>C([qe.sessionId],!qe.archived),disabled:os,title:qe.archived?"Restaurar a la lista":os?"Tiene una pestaña abierta. Cerrala primero.":"Archivar — la esconde de la lista, no borra nada",children:_.jsx(od,{out:qe.archived})})]},`${qe.agent}:${qe.sessionId}`)})})]},ue.key)})]}),it.length>0&&_.jsxs("div",{className:"sidebar-selection",children:[_.jsxs("span",{children:[it.length," seleccionada",it.length===1?"":"s"]}),it.some(ue=>!ue.archived)&&_.jsx("button",{className:"link-button",onClick:()=>dt(!0),children:"Archivar"}),it.some(ue=>ue.archived)&&_.jsx("button",{className:"link-button",onClick:()=>dt(!1),children:"Restaurar"}),_.jsx("button",{className:"link-button",onClick:()=>ee(new Set),children:"Cancelar"})]}),_.jsx(n0,{notes:o,onSendNote:a,sendTargetCwd:h})]})}function ld({x:n,y:s,items:p,onClose:S}){const M=F.useRef(null),[P,N]=F.useState({left:n,top:s});return F.useLayoutEffect(()=>{const i=M.current;if(i===null)return;const{width:c,height:m}=i.getBoundingClientRect();N({left:Math.max(4,Math.min(n,window.innerWidth-c-4)),top:Math.max(4,Math.min(s,window.innerHeight-m-4))})},[n,s]),F.useEffect(()=>{const i=c=>{c.key==="Escape"&&(c.stopPropagation(),S())};return window.addEventListener("keydown",i,!0),window.addEventListener("pointerdown",S,!0),window.addEventListener("scroll",S,!0),window.addEventListener("resize",S),()=>{window.removeEventListener("keydown",i,!0),window.removeEventListener("pointerdown",S,!0),window.removeEventListener("scroll",S,!0),window.removeEventListener("resize",S)}},[S]),_.jsx("div",{ref:M,className:"context-menu",style:{left:`${P.left}px`,top:`${P.top}px`},onPointerDown:i=>i.stopPropagation(),children:p.map(i=>_.jsx("button",{className:"context-menu-item",onClick:()=>{i.onSelect(),S()},children:i.label},i.label))})}function N0({preview:n}){const[s,p]=F.useState(null);F.useEffect(()=>{if(n.binary||n.language===null){p(null);return}let M=!1;return Qd(async()=>{const{highlightCode:P}=await import("./highlight-D9nIZ0qi.js");return{highlightCode:P}},[]).then(({highlightCode:P})=>{M||p(P(n.text,n.language))}).catch(()=>{M||p(null)}),()=>{M=!0,p(null)}},[n.text,n.language,n.binary]);const S=F.useMemo(()=>n.binary?0:n.text.split(`
124
- `).length,[n.text,n.binary]);return n.binary?_.jsx("p",{className:"panel-note",children:"Archivo binario: no se previsualiza. Se puede abrir con la app del sistema desde el menú contextual del árbol."}):_.jsxs("div",{className:"panel-scroll",children:[_.jsxs("div",{className:"preview",children:[_.jsx("div",{className:"preview-gutter","aria-hidden":"true",children:Array.from({length:S},(M,P)=>_.jsx("span",{children:P+1},P))}),s!==null?_.jsx("pre",{className:"preview-code hljs",dangerouslySetInnerHTML:{__html:s}}):_.jsx("pre",{className:"preview-code",children:n.text})]}),n.truncated&&_.jsx("p",{className:"panel-note",children:"El archivo se cortó por tamaño. Se ve completo abriéndolo con la app del sistema."})]})}function Ka(){return _.jsx("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:_.jsx("path",{d:"M1.5 3.5h4l1.2 1.6h7.8v7.4a1 1 0 0 1-1 1h-12a1 1 0 0 1-1-1V3.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function P0(){return _.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:[_.jsx("rect",{x:"5.5",y:"1.5",width:"9",height:"10",rx:"1.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),_.jsx("path",{d:"M10.5 13.2v.3a1 1 0 0 1-1 1h-7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h.3",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function j0({open:n}){return _.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:[_.jsx("path",{d:"M1.4 8S3.8 3.9 8 3.9 14.6 8 14.6 8 12.2 12.1 8 12.1 1.4 8 1.4 8z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),_.jsx("circle",{cx:"8",cy:"8",r:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),!n&&_.jsx("path",{d:"M2.6 13.4L13.4 2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function O0(){return _.jsx("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:_.jsx("path",{d:"M3 8.5l3.2 3.2L13 4.8",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function bo({className:n,title:s,onCopy:p}){const[S,M]=F.useState(!1),P=F.useRef(null);F.useEffect(()=>()=>{P.current!==null&&window.clearTimeout(P.current)},[]);const N=i=>{i.stopPropagation(),p(),M(!0),P.current!==null&&window.clearTimeout(P.current),P.current=window.setTimeout(()=>M(!1),1200)};return _.jsx("button",{className:S?`${n} tree-action-done`:n,onClick:N,title:S?"Copiado":s,children:S?_.jsx(O0,{}):_.jsx(P0,{})})}function Ga(n){return n<1024?`${n} B`:n<1024*1024?`${Math.round(n/1024)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function B0({view:n,cwd:s,platform:p,onInsert:S,onReveal:M}){const{listings:P,loading:N,preview:i,loadingPreview:c,closePreview:m,refresh:g,query:l,setQuery:v,showHidden:C,toggleHidden:b}=n,[f,o]=F.useState(null),u=p==="win32"?"\\":"/",a=F.useCallback(x=>{const E=x.split("/").join(u);return s.length===0?E:s.endsWith(u)?`${s}${E}`:`${s}${u}${E}`},[s,u]),h=F.useCallback(x=>{navigator.clipboard.writeText(x).catch(()=>{})},[]),y=F.useCallback(x=>h(`"${a(x)}"`),[a,h]),L=F.useCallback((x,E)=>{x.preventDefault(),x.stopPropagation(),o({x:x.clientX,y:x.clientY,items:[{label:"Copiar ruta absoluta",onSelect:()=>h(a(E))},{label:"Copiar ruta relativa",onSelect:()=>h(E)},...S===void 0?[]:[{label:"Insertar como @ruta",onSelect:()=>S(`@${E}`)}],{label:"Abrir con la app del sistema",onSelect:()=>M(E)}]})},[a,h,S,M]);if(i!==null||c)return _.jsxs("div",{className:"panel-body",children:[_.jsxs("div",{className:"panel-subhead",children:[_.jsx("button",{className:"link-button",onClick:m,children:"← Archivos"}),i!==null&&_.jsxs("span",{className:"panel-subhead-title",title:i.path,children:[i.path.split("/").pop(),_.jsxs("span",{className:"panel-tagline",children:[" ",Ga(i.sizeBytes)]})]})]}),c?_.jsx("p",{className:"panel-note",children:"Leyendo el archivo…"}):i!==null&&_.jsx(N0,{preview:i}),f!==null&&_.jsx(ld,{x:f.x,y:f.y,items:f.items,onClose:()=>o(null)})]});const k=P.get(""),A=l.trim();return _.jsxs("div",{className:"panel-body",children:[_.jsxs("div",{className:"panel-subhead",children:[_.jsx("span",{className:"panel-subhead-title",title:s,children:s.split(/[\\/]/).filter(x=>x.length>0).pop()??s}),_.jsx(bo,{className:"icon-button",title:"Copiar la ruta de esta carpeta entre comillas",onCopy:()=>y("")}),_.jsx("button",{className:C?"icon-button icon-button-on":"icon-button",onClick:b,title:C?"Esconder de nuevo lo que ocultan .gitignore y la lista fija":"Mostrar también lo que ocultan .gitignore y la lista fija",children:_.jsx(j0,{open:C})}),_.jsx("button",{className:"icon-button",onClick:()=>M(""),title:"Abrir esta carpeta en el explorador del sistema",children:_.jsx(Ka,{})}),_.jsx("button",{className:"icon-button",onClick:g,title:"Releer el árbol",children:"⟳"})]}),_.jsxs("div",{className:"tree-search",children:[_.jsx("input",{className:"tree-search-input",value:l,placeholder:"Buscar archivos por nombre…",onChange:x=>v(x.target.value),onKeyDown:x=>{x.key==="Escape"&&l.length>0&&(x.stopPropagation(),v(""))}}),l.length>0&&_.jsx("button",{className:"tree-search-clear",onClick:()=>v(""),title:"Limpiar (Esc)",children:"×"})]}),_.jsx("div",{className:"panel-scroll",children:A.length>0?_.jsx(F0,{view:n,onContextMenu:L,onReveal:M,onCopyPath:y}):k===void 0?_.jsx("p",{className:"panel-note",children:N.has("")?"Leyendo el directorio…":"No se pudo leer el directorio."}):_.jsx(of,{path:"",depth:0,view:n,onContextMenu:L,onReveal:M,onCopyPath:y})}),f!==null&&_.jsx(ld,{x:f.x,y:f.y,items:f.items,onClose:()=>o(null)})]})}function F0({view:n,onContextMenu:s,onReveal:p,onCopyPath:S}){const{results:M,searching:P,openFile:N,toggleDirectory:i}=n;return M===null?_.jsx("p",{className:"panel-note",children:P?"Buscando…":"Escribí para buscar."}):M.entries.length===0?_.jsx("p",{className:"panel-note",children:"Ningún archivo con ese nombre."}):_.jsxs("ul",{className:"tree tree-results",children:[M.entries.map(c=>_.jsx("li",{children:_.jsxs("div",{className:"tree-item",children:[_.jsxs("button",{className:`tree-row tree-row-${c.kind}${c.hidden===void 0?"":" tree-row-hidden"}`,onClick:()=>c.kind==="dir"?i(c.path):N(c.path),onContextMenu:m=>s(m,c.path,c.kind),title:c.path,children:[_.jsx("span",{className:"tree-chevron",children:c.kind==="dir"?"›":""}),_.jsxs("span",{className:"tree-result",children:[_.jsx("span",{className:"tree-name",children:c.name}),_.jsx("span",{className:"tree-result-path",children:c.path})]}),c.kind==="file"&&_.jsx("span",{className:"tree-size",children:Ga(c.sizeBytes)})]}),_.jsx(bo,{className:"tree-action",title:`Copiar la ruta de ${c.name} entre comillas`,onCopy:()=>S(c.path)}),c.kind==="dir"&&_.jsx("button",{className:"tree-action",onClick:()=>p(c.path),title:`Abrir ${c.name} en el explorador del sistema`,children:_.jsx(Ka,{})})]})},c.path)),M.truncated&&_.jsx("li",{className:"tree-hidden",title:"Acotá la búsqueda para verlos todos",children:"hay más resultados de los que se muestran"})]})}function of({path:n,depth:s,view:p,onContextMenu:S,onReveal:M,onCopyPath:P}){const{listings:N,loading:i}=p,c=N.get(n);return c===void 0?i.has(n)?_.jsx("div",{className:"tree-loading",children:"cargando…"}):null:_.jsxs("ul",{className:"tree",children:[c.entries.map(m=>_.jsx($0,{entry:m,depth:s,view:p,onContextMenu:S,onReveal:M,onCopyPath:P},m.path)),c.entries.length===0&&_.jsx("li",{className:"tree-empty",style:{paddingLeft:`${s*12+8}px`},children:c.hiddenCount>0?"todo el contenido está oculto":"vacío"}),(c.truncated||c.hiddenCount>0)&&c.entries.length>0&&_.jsx("li",{className:"tree-hidden",style:{paddingLeft:`${s*12+8}px`},title:"Se ocultan .git, node_modules, dist, bin, obj y lo que diga .gitignore",children:c.truncated?"hay más entradas de las que se muestran":`${c.hiddenCount} oculto(s)`})]})}function $0({entry:n,depth:s,view:p,onContextMenu:S,onReveal:M,onCopyPath:P}){const{expanded:N,toggleDirectory:i,openFile:c}=p,m=n.kind==="dir"&&N.has(n.path);return _.jsxs("li",{children:[_.jsxs("div",{className:"tree-item",children:[_.jsxs("button",{className:`tree-row tree-row-${n.kind}${n.hidden===void 0?"":" tree-row-hidden"}`,style:{paddingLeft:`${s*12+6}px`},onClick:()=>n.kind==="dir"?i(n.path):c(n.path),onContextMenu:g=>S(g,n.path,n.kind),title:n.hidden===void 0?n.path:`${n.path}
125
- ${n.hidden==="ignored"?"oculto por .gitignore":"oculto siempre: .git, node_modules, dist, bin, obj"}`,children:[_.jsx("span",{className:`tree-chevron${m?" tree-chevron-open":""}`,children:n.kind==="dir"?"›":""}),_.jsx("span",{className:"tree-name",children:n.name}),n.kind==="file"&&_.jsx("span",{className:"tree-size",children:Ga(n.sizeBytes)})]}),_.jsx(bo,{className:"tree-action",title:`Copiar la ruta de ${n.name} entre comillas`,onCopy:()=>P(n.path)}),n.kind==="dir"&&_.jsx("button",{className:"tree-action",onClick:()=>M(n.path),title:`Abrir ${n.name} en el explorador del sistema`,children:_.jsx(Ka,{})})]}),m&&_.jsx(of,{path:n.path,depth:s+1,view:p,onContextMenu:S,onReveal:M,onCopyPath:P})]})}const H0={added:"+",removed:"-",context:" ",hunk:"",meta:""};function W0({diff:n}){return n.binary?_.jsx("p",{className:"panel-note",children:"Archivo binario: no hay diff que mostrar."}):n.lines.length===0?_.jsx("p",{className:"panel-note",children:n.message??"Sin cambios."}):_.jsxs("div",{className:"panel-scroll",children:[_.jsx("div",{className:"diff",children:n.lines.map((s,p)=>_.jsxs("div",{className:`diff-line diff-line-${s.kind}`,children:[_.jsx("span",{className:"diff-num","aria-hidden":"true",children:s.oldLine??""}),_.jsx("span",{className:"diff-num","aria-hidden":"true",children:s.newLine??""}),_.jsx("span",{className:"diff-marker","aria-hidden":"true",children:H0[s.kind]}),_.jsx("span",{className:"diff-text",children:s.text})]},p))}),n.truncated&&_.jsx("p",{className:"panel-note",children:"El diff se cortó por tamaño. El archivo completo se ve mejor fuera de este panel."})]})}const U0={added:"A",modified:"M",deleted:"D",renamed:"R",copied:"C","type-changed":"T",untracked:"?",conflict:"!"},z0={added:"agregado",modified:"modificado",deleted:"borrado",renamed:"renombrado",copied:"copiado","type-changed":"cambio de tipo",untracked:"sin seguimiento",conflict:"en conflicto"},q0=[{stage:"conflict",title:"En conflicto",hint:"Hay que resolverlos antes de seguir"},{stage:"staged",title:"Preparado",hint:"Ya pasó por git add"},{stage:"unstaged",title:"Sin preparar",hint:"Modificado en el árbol de trabajo"},{stage:"untracked",title:"Sin seguimiento",hint:"Archivos nuevos que git no conoce"}];function ad(n){const s=n.endsWith("/"),p=s?n.slice(0,-1):n,S=p.lastIndexOf("/"),M=S===-1?p:p.slice(S+1);return{dir:S===-1?"":p.slice(0,S+1),name:s?`${M}/`:M,isDirectory:s}}function V0({status:n}){return _.jsxs("div",{className:"git-headline",children:[_.jsx("span",{className:"git-branch",title:n.repoRoot,children:n.branch??`HEAD desprendido${n.head!==null?` @ ${n.head}`:""}`}),n.upstream!==null&&_.jsx("span",{className:"git-upstream",title:`Rama de seguimiento: ${n.upstream}`,children:n.upstream}),(n.ahead>0||n.behind>0)&&_.jsxs("span",{className:"git-ab",title:"Commits de diferencia con la rama de seguimiento",children:[n.ahead>0&&_.jsxs("span",{className:"git-ahead",children:["↑",n.ahead]}),n.behind>0&&_.jsxs("span",{className:"git-behind",children:["↓",n.behind]})]})]})}function K0({view:n}){const{status:s,diff:p,loadingDiff:S,openDiff:M,closeDiff:P,refresh:N}=n;if(p!==null||S)return _.jsxs("div",{className:"panel-body",children:[_.jsxs("div",{className:"panel-subhead",children:[_.jsx("button",{className:"link-button",onClick:P,children:"← Cambios"}),p!==null&&_.jsxs("span",{className:"panel-subhead-title",title:p.path,children:[ad(p.path).name,p.staged&&_.jsx("span",{className:"panel-tagline",children:" preparado"})]})]}),S?_.jsx("p",{className:"panel-note",children:"Leyendo el diff…"}):p!==null&&_.jsx(W0,{diff:p})]});if(s.state!=="ready")return _.jsx("div",{className:"panel-body",children:_.jsx("p",{className:"panel-note",children:s.message??"Todavía no se conoce el estado del repositorio."})});const i=s.worktrees.filter(c=>!c.isCurrent);return _.jsxs("div",{className:"panel-body",children:[_.jsxs("div",{className:"panel-subhead",children:[_.jsx(V0,{status:s}),_.jsx("button",{className:"icon-button",onClick:N,title:"Releer el estado ahora",children:"⟳"})]}),_.jsxs("div",{className:"panel-scroll",children:[s.changes.length===0&&_.jsx("p",{className:"panel-note",children:"El árbol de trabajo está limpio."}),q0.map(c=>{const m=s.changes.filter(g=>g.stage===c.stage);return m.length===0?null:_.jsxs("section",{className:"git-group",children:[_.jsxs("h3",{className:"git-group-title",title:c.hint,children:[c.title,_.jsx("span",{className:"git-group-count",children:m.length})]}),_.jsx("ul",{className:"git-list",children:m.map(g=>{const{dir:l,name:v,isDirectory:C}=ad(g.path),b=g.oldPath!==null?`${g.oldPath} → ${g.path}`:C?`${g.path} — carpeta nueva; su contenido se ve en Archivos`:g.path,f=_.jsxs(_.Fragment,{children:[_.jsx("span",{className:`git-badge git-badge-${g.kind}`,title:z0[g.kind],children:U0[g.kind]}),_.jsxs("span",{className:"git-path",children:[_.jsx("span",{className:"git-path-name",children:v}),l.length>0&&_.jsx("span",{className:"git-path-dir",children:l})]})]});return _.jsx("li",{children:C?_.jsx("div",{className:"git-item git-item-static",title:b,children:f}):_.jsx("button",{className:"git-item",onClick:()=>M(g.path,g.stage==="staged"),title:b,children:f})},`${c.stage}:${g.path}`)})})]},c.stage)}),s.truncated&&_.jsxs("p",{className:"panel-note",children:["Hay más cambios de los que se muestran. Suele significar que falta una regla en"," ",_.jsx("code",{children:".gitignore"}),"."]}),i.length>0&&_.jsxs("section",{className:"git-group",children:[_.jsxs("h3",{className:"git-group-title",title:"Otros árboles de trabajo de este repositorio",children:["Otros worktrees",_.jsx("span",{className:"git-group-count",children:i.length})]}),_.jsx("ul",{className:"git-list",children:i.map(c=>_.jsx("li",{children:_.jsxs("div",{className:"git-worktree",title:c.path,children:[_.jsx("span",{className:"git-worktree-branch",children:c.branch??"detached"}),_.jsx("span",{className:"git-worktree-path",children:c.path})]})},c.path))})]})]})]})}function G0(n){return n<1024?`${n} B`:n<1024*1024?`${Math.round(n/1024)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function Fa(n,s,p){return`${n} ${n===1?s:p}`}const X0={create:"se crea","append-block":"se agrega el bloque al final","replace-block":"se reemplaza el bloque","append-lines":"se agregan líneas al final",copy:"se copia"},Y0={"AGENTS.md":"Codex, Antigravity y OpenCode","CLAUDE.md":"Claude Code"};function ko(n){return n.brokenBlock||n.problem!==null}function Q0(n){return n.problem==="outside"?"Es un enlace que apunta fuera del proyecto":n.problem==="encoding"?"No está en UTF-8":n.brokenBlock?"Tiene las marcas del bloque mal formadas":null}function J0(n){const s=n.files.filter(p=>!ko(p));return n.installed?{instructionFiles:s.filter(p=>p.hasBlock||p.exists).map(p=>p.name),gitMode:n.git.kind==="error"||n.git.kind==="repo"&&!n.git.ignored?"version":"ignore",importNative:!1,copyFromMainWorktree:!1}:{...em(n),instructionFiles:s.map(p=>p.name)}}function Z0(n){const s=n.files.filter(P=>P.hasBlock&&!P.blockCurrent),p=n.files.filter(P=>P.exists&&!P.hasBlock&&!ko(P)),S=[];if(s.length>0&&S.push(`${s.map(P=>P.name).join(" y ")} ${s.length===1?"tiene el bloque desactualizado":"tienen el bloque desactualizado"}`),p.length>0&&S.push(`falta el bloque en ${p.map(P=>P.name).join(" y ")}`),S.length===0)return null;const M=S.join("; ");return`${M.charAt(0).toUpperCase()}${M.slice(1)}.`}function ey(n){const s=n.replace(/^\uFEFF/,"").replace(/\r\n/g,`
126
- `),p=/^---\n[\s\S]*?\n---(?:\n|$)/.exec(s);return p===null?s:s.slice(p[0].length)}function ty(n){return n.split(/`([^`]+)`/).map((s,p)=>p%2===1?_.jsx("code",{children:s},p):s)}function ry({view:n}){var o;const{status:s,open:p,loading:S,error:M,closeNote:P,openNote:N}=n,[i,c]=F.useState(null),[m,g]=F.useState(!1),l=(s==null?void 0:s.cwd)??null;F.useEffect(()=>{c(null),g(!1)},[l]),F.useEffect(()=>{n.lastResult!==null&&(c(null),g(!1))},[n.lastResult]);const v=F.useCallback(u=>{if(s===null)return null;let a=u.replace(/^\.\//,"");try{a=decodeURIComponent(a)}catch{return null}return a===So||s.notes.some(y=>y.name===a)?()=>N(a):null},[s,N]);if(s===null)return _.jsx("div",{className:"panel-body",children:_.jsx("p",{className:"panel-note",children:M??"Leyendo la memoria…"})});if(p!==null||S!==null){const u=(p==null?void 0:p.name)??S??"",a=u===So?"Índice":((o=s.notes.find(h=>h.name===u))==null?void 0:o.title)??u;return _.jsxs("div",{className:"panel-body",children:[_.jsxs("div",{className:"panel-subhead",children:[_.jsx("button",{className:"link-button",onClick:P,children:"← Memoria"}),_.jsx("span",{className:"panel-subhead-title",title:u,children:a})]}),p===null?_.jsx("p",{className:"panel-note",children:"Leyendo la nota…"}):_.jsxs("div",{className:"panel-scroll",children:[_.jsx("div",{className:"plan-body",children:_.jsx(za,{text:ey(p.text),localLink:v})}),p.truncated&&_.jsx("p",{className:"panel-note",children:"La nota se cortó por tamaño."})]})]})}const C=i??J0(s),b=s.installed?Z0(s):null,f=!s.installed||m||n.planned!==null;return _.jsxs("div",{className:"panel-body",children:[_.jsx(sy,{reach:s.reach,onAdjust:s.installed&&!f&&b===null&&s.reach.some(u=>!u.reaches)?()=>g(!0):null}),_.jsxs("div",{className:"panel-scroll",children:[(M??n.lastResult)!==null&&_.jsxs("div",{className:`memory-message${M!==null?" memory-message-error":""}`,children:[_.jsx("span",{children:M??n.lastResult}),_.jsx("button",{className:"link-button",onClick:n.dismissMessage,title:"Cerrar el aviso",children:"×"})]}),s.git.kind==="error"&&_.jsxs("div",{className:"memory-warning",children:[_.jsxs("p",{className:"memory-warning-line",children:["git devolvió un error, así que no se sabe si la memoria está ignorada. Se puede instalar sin tocar ",_.jsx("code",{children:".gitignore"}),"."]}),_.jsx("pre",{className:"memory-git-message",children:s.git.message})]}),s.files.filter(ko).map(u=>_.jsxs("p",{className:"memory-warning",children:[_.jsx("code",{children:u.name})," ",u.problem==="outside"?"es un enlace que apunta fuera del proyecto: la app no lo lee ni lo escribe.":u.problem==="encoding"?_.jsxs(_.Fragment,{children:["no está en UTF-8 (parece UTF-16, lo que deja ",_.jsx("code",{children:">"})," en Windows PowerShell 5.1). Guardalo como UTF-8: la app no lo toca mientras tanto."]}):"tiene las marcas del bloque de memoria mal formadas: una sin su pareja, o el bloque repetido. La app no lo toca hasta que lo arregles a mano."]},u.name)),!s.installed&&_.jsxs("div",{className:"memory-intro",children:[_.jsx("p",{children:"La memoria compartida guarda lo que los agentes aprenden de este proyecto —decisiones, restricciones, trampas ya pisadas— para la próxima sesión."}),_.jsxs("p",{children:["Vive en ",_.jsx("code",{children:".agents/memory/"}),": una nota por archivo y un índice,"," ",_.jsx("code",{children:"MEMORY.md"}),". Las cuatro CLIs la leen por un bloque marcado en su archivo de instrucciones. Nada se escribe hasta que confirmes los cambios."]})]}),s.installed&&b!==null&&!f&&_.jsxs("div",{className:"memory-callout",children:[_.jsx("span",{children:b}),_.jsx("button",{className:"primary-button primary-button-small",onClick:()=>g(!0),children:"Actualizar el puente"})]}),f&&(n.planned===null?_.jsx(ny,{status:s,options:C,busy:n.busy,onChange:c,onPlan:()=>{c(C),n.requestPlan(C)},onCancel:s.installed?()=>{g(!1),c(null)}:null}):_.jsx(iy,{changes:n.planned,busy:n.busy,confirmLabel:s.installed?"Actualizar":"Instalar",onConfirm:n.install,onCancel:n.cancelPlan})),s.installed&&s.native.pending>0&&!f&&_.jsxs("div",{className:"memory-callout",children:[_.jsxs("span",{children:["La memoria propia de Claude Code tiene"," ",Fa(s.native.pending,"nota que no está","notas que no están")," acá."]}),_.jsx("button",{className:"primary-button primary-button-small",disabled:n.busy!==null,onClick:n.importNative,children:n.busy==="import"?"Importando…":`Importar ${Fa(s.native.pending,"nota","notas")}`})]}),s.installed&&_.jsx(oy,{notes:s.notes,indexExists:s.indexExists,onOpen:N}),s.globalFragments.length>0&&_.jsx(ly,{fragments:s.globalFragments})]})]})}function sy({reach:n,onAdjust:s}){return _.jsxs("div",{className:"memory-reach",children:[n.map(p=>_.jsxs("span",{className:`memory-reach-item${p.reaches?" memory-reach-on":""}`,title:`${p.label}: ${p.via}`,children:[_.jsx("span",{className:"memory-reach-mark","aria-hidden":"true",children:p.reaches?"✓":"—"}),p.label,_.jsx("span",{className:"visually-hidden",children:p.reaches?`: llega por ${p.via}`:`: no llega, ${p.via}`})]},p.agent)),s!==null&&_.jsx("button",{className:"link-button memory-reach-adjust",onClick:s,title:"Elegir de nuevo los archivos de instrucciones del puente",children:"Ajustar"})]})}function ny({status:n,options:s,busy:p,onChange:S,onPlan:M,onCancel:P}){const{git:N}=n,i=N.kind==="repo"?N.worktree:null,c=N.kind==="error"&&s.gitMode==="ignore",m=(g,l)=>{const v=new Set(s.instructionFiles);l?v.add(g):v.delete(g),S({...s,instructionFiles:Ua.filter(C=>v.has(C))})};return _.jsxs("div",{className:"memory-form",children:[_.jsx("p",{className:"memory-section-label",children:"Archivos de instrucciones"}),n.files.map(g=>_.jsxs("label",{className:"memory-option",title:Q0(g)??void 0,children:[_.jsx("input",{type:"checkbox",checked:s.instructionFiles.includes(g.name),disabled:ko(g),onChange:l=>m(g.name,l.target.checked)}),_.jsx("code",{children:g.name}),_.jsx("span",{className:"memory-option-hint",children:Y0[g.name]})]},g.name)),N.kind==="repo"&&_.jsxs(_.Fragment,{children:[_.jsx("p",{className:"memory-section-label",children:"Git"}),_.jsxs("label",{className:"memory-option",children:[_.jsx("input",{type:"radio",name:"memory-git-mode",checked:s.gitMode==="ignore",onChange:()=>S({...s,gitMode:"ignore"})}),"Ignorar la memoria",_.jsx("span",{className:"memory-option-hint",children:"recomendado"})]}),_.jsxs("label",{className:"memory-option",children:[_.jsx("input",{type:"radio",name:"memory-git-mode",checked:s.gitMode==="version",onChange:()=>S({...s,gitMode:"version"})}),"Versionarla",_.jsx("span",{className:"memory-option-hint",children:"para repos privados"})]}),N.ignored&&s.gitMode==="version"&&_.jsxs("p",{className:"memory-warning",children:["Este repo ya ignora ",_.jsx("code",{children:".agents/memory/"}),". Para versionarla hay que sacar esa regla del ",_.jsx("code",{children:".gitignore"})," a mano."]})]}),N.kind==="error"&&_.jsxs(_.Fragment,{children:[_.jsx("p",{className:"memory-section-label",children:"Git"}),_.jsxs("label",{className:"memory-option",children:[_.jsx("input",{type:"radio",name:"memory-git-mode",checked:s.gitMode==="version",onChange:()=>S({...s,gitMode:"version"})}),"No tocar ",_.jsx("code",{children:".gitignore"}),_.jsx("span",{className:"memory-option-hint",children:"git devolvió un error"})]})]}),(n.native.pending>0||(i==null?void 0:i.mainHasMemory)===!0)&&_.jsx("p",{className:"memory-section-label",children:"Notas existentes"}),n.native.pending>0&&_.jsxs("label",{className:"memory-option",children:[_.jsx("input",{type:"checkbox",checked:s.importNative,onChange:g=>S({...s,importNative:g.target.checked})}),"Importar ",Fa(n.native.pending,"nota","notas")," de la memoria de Claude Code"]}),(i==null?void 0:i.mainHasMemory)===!0&&_.jsxs("label",{className:"memory-option",title:i.mainPath,children:[_.jsx("input",{type:"checkbox",checked:s.copyFromMainWorktree,onChange:g=>S({...s,copyFromMainWorktree:g.target.checked})}),"Copiar las notas del worktree principal"]}),_.jsxs("div",{className:"memory-actions",children:[_.jsx("button",{className:"primary-button primary-button-small",disabled:p!==null||s.instructionFiles.length===0||c,onClick:M,title:s.instructionFiles.length===0?"Elegí al menos un archivo de instrucciones":c?"Con git en error solo se puede instalar sin tocar .gitignore":void 0,children:p==="plan"?"Calculando…":"Ver cambios"}),P!==null&&_.jsx("button",{className:"link-button",onClick:P,disabled:p!==null,children:"Cancelar"})]})]})}function iy({changes:n,busy:s,confirmLabel:p,onConfirm:S,onCancel:M}){const P=s==="install";return _.jsxs("div",{className:"memory-form",children:[_.jsx("p",{className:"memory-section-label",children:"Cambios"}),n.length===0?_.jsx("p",{className:"memory-empty",children:"No hay nada que cambiar: el puente ya está al día."}):_.jsx("ul",{className:"memory-change-list",children:n.map((N,i)=>_.jsxs("li",{className:"memory-change",children:[_.jsxs("div",{className:"memory-change-head",children:[_.jsx("code",{className:"memory-change-file",children:N.file}),_.jsx("span",{className:"memory-option-hint",children:X0[N.action]})]}),N.preview.length>0&&_.jsx("pre",{className:"memory-preview",children:N.preview})]},`${N.file}-${i}`))}),_.jsxs("div",{className:"memory-actions",children:[n.length>0&&_.jsx("button",{className:"primary-button primary-button-small",disabled:s!==null,onClick:S,children:P?"Escribiendo…":p}),_.jsx("button",{className:"link-button",onClick:M,disabled:P,children:n.length===0?"Volver":"Cancelar"})]})]})}function oy({notes:n,indexExists:s,onOpen:p}){return _.jsxs(_.Fragment,{children:[_.jsx("p",{className:"memory-section-label",children:"Notas"}),_.jsxs("ul",{className:"plan-list",children:[s&&_.jsx("li",{children:_.jsxs("button",{className:"plan-row",onClick:()=>p(So),children:[_.jsx("span",{className:"plan-name",children:"Índice"}),_.jsx("span",{className:"plan-meta",children:So})]})}),n.map(S=>_.jsx("li",{children:_.jsxs("button",{className:"plan-row",onClick:()=>p(S.name),title:S.name,children:[_.jsx("span",{className:"plan-name",children:S.title}),S.description.length>0&&_.jsx("span",{className:"memory-note-description",children:S.description}),_.jsxs("span",{className:"plan-meta",children:[is(S.modifiedAt)," · ",G0(S.sizeBytes)]})]})},S.name))]}),n.length===0&&_.jsx("p",{className:"memory-empty",children:"Todavía no hay notas. Los agentes las guardan acá cuando aprenden algo que sirve en otra sesión."})]})}function ly({fragments:n}){const s=F.useCallback(p=>{navigator.clipboard.writeText(p).catch(()=>{})},[]);return _.jsxs("details",{className:"memory-global",children:[_.jsx("summary",{className:"memory-global-summary",children:"Memoria global"}),_.jsxs("p",{className:"memory-empty",children:["Lo que vale para todos tus proyectos va en ",_.jsx("code",{children:"~/.agents/global.md"}),". La app no lo escribe: cada CLI lo lee si le agregás su fragmento."]}),n.map(p=>_.jsxs("div",{className:"memory-fragment",children:[_.jsxs("div",{className:"memory-change-head",children:[_.jsx("span",{className:"memory-fragment-label",children:p.label}),_.jsx("code",{className:"memory-fragment-target",title:p.target,children:p.target})]}),_.jsxs("div",{className:"memory-fragment-body",children:[_.jsx("pre",{className:"memory-preview",children:p.text}),_.jsx(bo,{className:"icon-button",title:"Copiar el fragmento",onCopy:()=>s(p.text)})]}),p.note.length>0&&_.jsx("p",{className:"memory-fragment-note",children:ty(p.note)})]},p.agent))]})}function ay(n){return n<1024?`${n} B`:n<1024*1024?`${Math.round(n/1024)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function cy(n){for(const s of n.split(`
127
- `,40)){const p=/^#{1,3}\s+(.+)$/.exec(s.trim());if(p!==null)return(p[1]??"").trim()}return null}function uy({view:n}){var N,i;const{plans:s,open:p,loading:S,openPlan:M,closePlan:P}=n;if(p!==null||S!==null){const c=((N=s.find(l=>l.fileName===(p==null?void 0:p.fileName)))==null?void 0:N.path)??null,m=((i=s.find(l=>l.fileName===(p==null?void 0:p.fileName)))==null?void 0:i.title)??null,g=p===null?S:cy(p.text)??m??S;return _.jsxs("div",{className:"panel-body",children:[_.jsxs("div",{className:"panel-subhead",children:[_.jsx("button",{className:"link-button",onClick:P,children:"← Planes"}),_.jsx("span",{className:"panel-subhead-title",title:c??void 0,children:g})]}),p===null?_.jsx("p",{className:"panel-note",children:"Leyendo el plan…"}):_.jsxs("div",{className:"panel-scroll",children:[_.jsx("div",{className:"plan-body",children:_.jsx(za,{text:p.text})}),p.truncated&&_.jsx("p",{className:"panel-note",children:"El plan se cortó por tamaño."})]})]})}return _.jsx("div",{className:"panel-body",children:_.jsx("div",{className:"panel-scroll",children:s.length===0?_.jsxs("p",{className:"panel-note",children:["Esta conversación todavía no escribió ningún documento. Aparecen acá los planes del modo plan y los ",_.jsx("code",{children:".md"})," que el agente guarda en el proyecto o en su carpeta temporal."]}):_.jsx("ul",{className:"plan-list",children:[...s].reverse().map(c=>_.jsx(hy,{plan:c,onOpen:()=>M(c)},c.fileName))})})})}function hy({plan:n,onOpen:s}){const p=n.path.length>0?n.path:null;return n.exists?_.jsx("li",{children:_.jsxs("button",{className:"plan-row",onClick:s,title:p??void 0,children:[_.jsx("span",{className:"plan-name",children:n.title}),p!==null&&_.jsx("span",{className:"plan-path",children:p}),_.jsxs("span",{className:"plan-meta",children:[is(n.modifiedAt)," · ",ay(n.sizeBytes)]})]})}):_.jsxs("li",{className:"plan-row plan-row-missing",title:p??"El archivo ya no está en disco",children:[_.jsx("span",{className:"plan-name",children:n.title}),p!==null&&_.jsx("span",{className:"plan-path",children:p}),_.jsx("span",{className:"plan-meta",children:"ya no está"})]})}const dy=[{id:"cli",label:"CLI"},{id:"git",label:"Cambios"},{id:"files",label:"Archivos"},{id:"plans",label:"Planes"},{id:"memory",label:"Memoria"}];function fy(n){return n.state!=="ready"?0:new Set(n.changes.map(s=>s.path)).size}function py({tab:n,plansAvailable:s,hidden:p,onTabChange:S,title:M,cwd:P,platform:N,cli:i,cliUnseen:c,expanded:m,onToggleExpanded:g,git:l,files:v,plans:C,memory:b,onInsert:f,onReveal:o,onHide:u}){var y;const a=fy(l.status),h=((y=b.status)==null?void 0:y.installed)===!0?b.status.notes.length:0;return _.jsxs("section",{className:`side-panel${p?" side-panel-hidden":""}`,"aria-hidden":p,children:[_.jsxs("header",{className:"side-panel-header",children:[_.jsx("span",{className:"side-panel-title",title:P,children:M}),_.jsx("button",{className:"icon-button",onClick:g,title:m?"Devolver la columna a su ancho":"Ensanchar la columna — la interfaz de la CLI necesita ancho para dibujar diffs y tablas",children:m?"⇥":"⇤"}),_.jsx("button",{className:"icon-button",onClick:u,title:"Ocultar el panel (Alt+P)",children:"×"})]}),_.jsx("nav",{className:"side-panel-tabs",children:qm(dy,s).map(L=>_.jsxs("button",{className:`side-panel-tab${L.id===n?" side-panel-tab-active":""}`,onClick:()=>S(L.id),title:L.label,children:[_.jsx("span",{className:"side-panel-tab-label",children:L.label}),L.id==="git"&&a>0&&_.jsx("span",{className:"side-panel-badge",children:a}),L.id==="plans"&&C.plans.length>0&&_.jsx("span",{className:"side-panel-badge",children:C.plans.length}),L.id==="memory"&&h>0&&_.jsx("span",{className:"side-panel-badge",children:h}),L.id==="cli"&&c&&n!=="cli"&&_.jsx("span",{className:"side-panel-dot",title:"La CLI escribio algo"})]},L.id))}),_.jsxs("div",{className:"side-panel-body",children:[_.jsx("div",{className:`cli-slot${n==="cli"?"":" cli-slot-hidden"}`,children:i}),n==="git"&&_.jsx(K0,{view:l}),n==="plans"&&_.jsx(uy,{view:C}),n==="memory"&&_.jsx(ry,{view:b}),n==="files"&&_.jsx(B0,{view:v,cwd:P,platform:N,onInsert:f,onReveal:o})]})]})}function _y({placement:n}){return _.jsxs("div",{className:"tab tab-pending","aria-busy":"true",title:`${n.pending.cwd}
128
- abriendo…`,style:{"--tab-project-color":qa(n.pending.cwd)},children:[_.jsx("span",{className:"tab-opening","aria-label":"abriendo",children:_.jsx("i",{})}),_.jsx("span",{className:"tab-label",children:n.label})]})}function my({terminal:n,activity:s,statusLine:p}){if(!n.alive){const S=n.sleeping;return _.jsx("span",{className:`tab-dot${S?" tab-dot-sleeping":" tab-dot-dead"}`,title:S?"Dormida: se lee, sin CLI abierta":"La CLI de esta pestaña se cerró"})}return s==="waiting"?_.jsx("span",{className:"tab-bang",title:"La CLI está esperando una respuesta tuya",children:"!"}):s==="busy"?_.jsxs("span",{className:"tab-working",title:"El agente está trabajando","aria-label":"trabajando",children:[_.jsx("i",{}),_.jsx("i",{}),_.jsx("i",{})]}):_.jsx("span",{className:"tab-dot",title:tg(s,p)})}function cd(n){if(n.label.length>0)return n.label;const s=n.cwd.split(/[\\/]/).filter(S=>S.length>0),p=s[s.length-1]??n.cwd;return n.resumed?`${p} ↩`:p}function gy({terminals:n,activeTerminalId:s,activity:p,canOpen:S,onSelect:M,onClose:P,onRename:N,onReorder:i,onNew:c,agents:m,offerAgentChoice:g,newTabAgent:l,pendingOpens:v,platform:C,newTabBlockedTitle:b}){const[f,o]=F.useState(null),[u,a]=F.useState(""),[h,y]=F.useState(null),L=F.useRef(null);F.useEffect(()=>{var D;f!==null&&((D=L.current)==null||D.select())},[f]);const k=D=>{o(D.terminalId),a(D.label.length>0?D.label:cd(D))},A=()=>{f!==null&&N(f,u.trim()),o(null)},x=D=>{if(h===null||h===D)return;const B=n.map(Z=>Z.terminalId),z=B.indexOf(h),X=B.indexOf(D);z===-1||X===-1||(B.splice(X,0,...B.splice(z,1)),i(B),y(null))},E=Mg(n,v,C),T=new Map;for(const D of E){const B=T.get(D.index);B===void 0?T.set(D.index,[D]):B.push(D)}const j=D=>(T.get(D)??[]).map(B=>_.jsx(_y,{placement:B},`pending:${B.pending.requestId}`));return _.jsxs("div",{className:"tab-bar",children:[n.map((D,B)=>{var Z;const z=D.terminalId===s,X=D.terminalId===f;return _.jsxs(Zp.Fragment,{children:[j(B),_.jsx("div",{className:`tab${z?" tab-active":""}${D.alive||D.sleeping?"":" tab-dead"}`,draggable:!X,onDragStart:()=>y(D.terminalId),onDragOver:Y=>Y.preventDefault(),onDrop:()=>x(D.terminalId),onDragEnd:()=>y(null),onClick:()=>M(D.terminalId),onDoubleClick:()=>k(D),title:`${D.cwd}
129
- ${D.alive?"activa":D.sleeping?"dormida":`terminada (codigo ${D.exitCode??"?"})`}`,style:{"--tab-project-color":qa(D.cwd)},children:X?_.jsx("input",{ref:L,className:"tab-input",value:u,onChange:Y=>a(Y.target.value),onBlur:A,onKeyDown:Y=>{Y.key==="Enter"&&A(),Y.key==="Escape"&&o(null),Y.stopPropagation()},onClick:Y=>Y.stopPropagation()}):_.jsxs(_.Fragment,{children:[_.jsx(my,{terminal:D,activity:p.get(D.terminalId),statusLine:((Z=m.find(Y=>Y.id===D.agent))==null?void 0:Z.statusLine)??null}),_.jsxs("span",{className:"tab-label",children:[D.agent!==null&&_g(g,D.agent)&&_.jsx(Oa,{agent:D.agent,agents:m}),cd(D)]}),_.jsx("button",{className:"tab-close",onClick:Y=>{Y.stopPropagation(),P(D.terminalId)},title:"Cerrar (Ctrl+W)",children:"×"})]})})]},D.terminalId)}),j(n.length),_.jsx(tf,{className:"tab-new",text:"+",title:b??"Nueva pestana (Ctrl+T)",disabled:!S||b!==null,offerAgentChoice:g,agents:m,agent:l,onOpen:c})]})}function vy(n,s,p){const[S,M]=F.useState(!1);return F.useEffect(()=>{if(M(!1),!(s===null||p))return n.onMessage(P=>{P.type==="terminal.output"&&P.terminalId===s&&M(!0)})},[n,s,p]),S&&!p}const yy=200,ud="agent-workbench.files.hidden";function Sy(n,s){const[p,S]=F.useState(new Map),[M,P]=F.useState(new Set),[N,i]=F.useState(new Set),[c,m]=F.useState(null),[g,l]=F.useState(!1),[v,C]=F.useState(""),[b,f]=F.useState(null),[o,u]=F.useState(!1),[a,h]=F.useState(()=>vr(ud,!1,D=>D==="true"?!0:D==="false"?!1:null)),y=F.useRef(new Set),L=F.useRef(a);L.current=a;const k=F.useCallback(D=>{s===null||y.current.has(D)||(y.current.add(D),i(B=>new Set(B).add(D)),n.send({type:"files.list",terminalId:s,path:D,includeHidden:L.current}))},[n,s]);F.useEffect(()=>{if(S(new Map),P(new Set),i(new Set),m(null),l(!1),C(""),f(null),u(!1),y.current=new Set,s===null)return;const D=n.onMessage(z=>{switch(z.type){case"files.listing":{if(z.terminalId!==s)break;const{listing:X}=z;y.current.delete(X.path),S(Z=>new Map(Z).set(X.path,X)),i(Z=>{const Y=new Set(Z);return Y.delete(X.path),Y});break}case"files.results":if(z.terminalId!==s)break;f(z.result),u(!1);break;case"files.preview":if(z.terminalId!==s)break;m(z.preview),l(!1);break;case"error":y.current=new Set,i(new Set),l(!1),u(!1);break}});n.send({type:"files.list",terminalId:s,path:"",includeHidden:L.current}),y.current.add(""),i(new Set([""]));const B=n.onReopen(()=>{y.current=new Set,n.send({type:"files.list",terminalId:s,path:"",includeHidden:L.current})});return()=>{D(),B()}},[n,s]),F.useEffect(()=>{const D=v.trim();if(s===null||D.length===0){f(null),u(!1);return}u(!0);const B=window.setTimeout(()=>{n.send({type:"files.search",terminalId:s,query:D,includeHidden:L.current})},yy);return()=>window.clearTimeout(B)},[n,s,v,a]);const A=F.useCallback(D=>{P(B=>{const z=new Set(B);return z.has(D)?z.delete(D):(z.add(D),k(D)),z})},[k]),x=F.useCallback(D=>{s!==null&&(l(!0),m(null),n.send({type:"files.read",terminalId:s,path:D}))},[n,s]),E=F.useCallback(()=>{m(null),l(!1)},[]),T=F.useCallback(()=>{if(s===null)return;y.current=new Set;const D=["",...M];for(const B of D)y.current.add(B),n.send({type:"files.list",terminalId:s,path:B,includeHidden:L.current});i(new Set(D))},[n,s,M]),j=F.useCallback(()=>{h(D=>{const B=!D;if(L.current=B,ir(ud,String(B)),s!==null){y.current=new Set;const z=["",...M];for(const X of z)y.current.add(X),n.send({type:"files.list",terminalId:s,path:X,includeHidden:B});i(new Set(z))}return B})},[n,s,M]);return{listings:p,expanded:M,loading:N,preview:c,loadingPreview:g,query:v,setQuery:C,results:b,searching:o,showHidden:a,toggleHidden:j,toggleDirectory:A,openFile:x,closePreview:E,refresh:T}}function Cy(n){const[s,p]=F.useState(!1),[S,M]=F.useState(null),[P,N]=F.useState(null),[i,c]=F.useState(null),m=F.useRef(null);F.useEffect(()=>{const v=n.onMessage(b=>{switch(b.type){case"search.progress":if(m.current===null||b.searchId!==m.current)break;M(f=>Vv(f,b.progress));break;case"search.results":if(m.current===null||b.searchId!==m.current)break;m.current=null,M(b.result),N(null),p(!1);break;case"error":if(b.code!=="search-failed"||m.current===null||b.requestId!==m.current)break;m.current=null,b.detail!==void 0&&console.error("[servidor]",b.detail),M(null),N(b.message),p(!1);break}}),C=n.onReopen(()=>{m.current!==null&&(m.current=null,p(!1),N("Se cortó la conexión con el servidor: volvé a buscar."))});return()=>{v(),C()}},[n]);const g=F.useCallback((v,C)=>{const b=crypto.randomUUID();m.current=b,c({query:v,includeArchived:C}),p(!0),N(null),M(null),n.send({type:"search.global",searchId:b,query:v,includeArchived:C})},[n]),l=F.useCallback(()=>{const v=m.current;m.current=null,v!==null&&n.send({type:"search.cancel",searchId:v}),c(null),p(!1),M(null),N(null)},[n]);return{searching:s,result:S,error:P,submitted:i,search:g,clear:l}}function wy(n,s){const[p,S]=F.useState([]),[M,P]=F.useState(null),[N,i]=F.useState(null);F.useEffect(()=>{if(S([]),P(null),i(null),s!==null)return n.onMessage(g=>{switch(g.type){case"conversation.plans":if(g.terminalId!==s)break;S(g.plans);break;case"plans.content":if(g.terminalId!==s)break;P(g.plan),i(null);break;case"error":i(null);break}})},[n,s]);const c=F.useCallback(g=>{s!==null&&(i(g.title),P(null),n.send({type:"plans.read",terminalId:s,fileName:g.fileName}))},[n,s]),m=F.useCallback(()=>{P(null),i(null)},[]);return{plans:p,open:M,loading:N,openPlan:c,closePlan:m}}function xy(n,s){const[p,S]=F.useState(_a),[M,P]=F.useState(null),[N,i]=F.useState(!1);F.useEffect(()=>{if(s===null){S(_a),P(null);return}S(_a),P(null),i(!1);const l=n.onMessage(C=>{switch(C.type){case"git.status":C.terminalId===s&&S(C.status);break;case"git.diff":if(C.terminalId!==s)break;P(C.diff),i(!1);break;case"error":i(!1);break}});n.send({type:"git.subscribe",terminalId:s});const v=n.onReopen(()=>{n.send({type:"git.subscribe",terminalId:s})});return()=>{l(),v(),n.send({type:"git.unsubscribe",terminalId:s})}},[n,s]);const c=F.useCallback((l,v)=>{s!==null&&(i(!0),P(null),n.send({type:"git.diff",terminalId:s,path:l,staged:v}))},[n,s]),m=F.useCallback(()=>{P(null),i(!1)},[]),g=F.useCallback(()=>{s!==null&&n.send({type:"git.refresh",terminalId:s})},[n,s]);return{status:p,diff:M,loadingDiff:N,openDiff:c,closeDiff:m,refresh:g}}const $a=new Set;function by(n){return n!==void 0&&$a.has(n)}function lf(n,s,p){return`${n} ${n===1?s:p}`}function ky(n){return n.length===0?"No había nada que cambiar: el puente ya estaba al día.":`Listo: ${lf(n.length,"archivo cambiado","archivos cambiados")}.`}function Ey(n,s){const p=n.length===0?"No había notas nuevas para importar.":`Importadas ${lf(n.length,"nota","notas")}.`;return s.length===0?p:`${p} No se pisaron, porque ya existían con otro contenido: ${s.join(", ")}.`}function Ly(n,s){const[p,S]=F.useState(null),[M,P]=F.useState(null),[N,i]=F.useState(null),[c,m]=F.useState(null),[g,l]=F.useState(null),[v,C]=F.useState(null),[b,f]=F.useState(null),o=F.useRef(new Map),u=F.useRef(new Set),a=F.useRef(null),h=F.useRef(!1),y=F.useCallback(z=>{const X=`memory-${crypto.randomUUID()}`;return o.current.set(X,z),u.current.add(X),$a.add(X),X},[]),L=F.useCallback(z=>{for(const[X,Z]of o.current)Z===z&&o.current.delete(X)},[]);F.useEffect(()=>{S(null),P(null),i(null),m(null),l(null),C(null),f(null),o.current.clear();for(const I of u.current)$a.delete(I);if(u.current.clear(),a.current=null,h.current=!1,s===null)return;const z=(I,$)=>I===void 0||o.current.get(I)!==$?!1:(o.current.delete(I),!0),X=n.onMessage(I=>{switch(I.type){case"memory.status":if(I.terminalId!==s)break;S(I.status),h.current&&(h.current=!1,f(null));break;case"memory.planned":if(I.terminalId!==s||!z(I.requestId,"plan"))break;m(I.changes),l(null);break;case"memory.installed":if(I.terminalId!==s||!z(I.requestId,"install"))break;a.current=null,m(null),l(null),C(ky(I.applied));break;case"memory.imported":if(I.terminalId!==s||!z(I.requestId,"import"))break;l(null),C(Ey(I.copied,I.skipped));break;case"memory.content":if(I.terminalId!==s||!z(I.requestId,"read"))break;P(I.note),i(null);break;case"error":{const $=I.requestId,O=$===void 0?void 0:o.current.get($);if($===void 0||O===void 0)break;o.current.delete($),O==="read"?i(null):O!=="subscribe"&&l(null),f(I.message),h.current=O==="subscribe";break}}}),Z=n.onStatus(I=>{if(I!=="reconnecting"&&I!=="failed")return;const $=new Set(o.current.values());o.current.clear(),l(null),i(null),($.has("install")||$.has("import"))&&(a.current=null,m(null),f("Se cortó la conexión antes de la respuesta. Al reconectar, el estado dice qué quedó escrito."))}),Y=()=>{n.send({type:"memory.subscribe",terminalId:s,requestId:y("subscribe")})};Y();const V=n.onReopen(Y);return()=>{X(),Z(),V(),n.send({type:"memory.unsubscribe",terminalId:s})}},[n,s,y]);const k=F.useCallback(()=>{h.current=!1,f(null),C(null)},[]),A=F.useCallback(z=>{s!==null&&(L("read"),k(),i(z),P(null),n.send({type:"memory.read",terminalId:s,name:z,requestId:y("read")}))},[n,s,k,L,y]),x=F.useCallback(()=>{L("read"),P(null),i(null)},[L]),E=F.useCallback(z=>{s!==null&&(k(),a.current=z,m(null),l("plan"),n.send({type:"memory.plan",terminalId:s,options:z,requestId:y("plan")}))},[n,s,k,y]),T=F.useCallback(()=>{const z=a.current;s===null||z===null||(k(),l("install"),n.send({type:"memory.install",terminalId:s,options:z,requestId:y("install")}))},[n,s,k,y]),j=F.useCallback(()=>{s!==null&&(k(),l("import"),n.send({type:"memory.import",terminalId:s,requestId:y("import")}))},[n,s,k,y]),D=F.useCallback(()=>{L("plan"),a.current=null,m(null)},[L]),B=F.useCallback(()=>{h.current=!1,f(null),C(null)},[]);return{status:p,open:M,loading:N,planned:c,busy:g,lastResult:v,error:b,openNote:A,closeNote:x,requestPlan:E,install:T,importNative:j,cancelPlan:D,dismissMessage:B}}function Ry(n){const[s,p]=F.useState([]),[S,M]=F.useState({}),[P,N]=F.useState(null),i=F.useRef(new Set);F.useEffect(()=>{const o=n.onMessage(a=>{switch(a.type){case"notes.list":p(a.notes);break;case"notes.imageData":i.current.add(a.imageId),M(h=>({...h,[a.imageId]:a.data===null?null:`data:${a.mediaType};base64,${a.data}`}));break;case"error":a.code==="notes-failed"&&N(a.message);break}}),u=n.onReopen(()=>{i.current.clear()});return()=>{o(),u()}},[n]);const c=F.useCallback(o=>{i.current.has(o)||(i.current.add(o),n.send({type:"notes.image",imageId:o}))},[n]),m=F.useCallback(()=>{const o=crypto.randomUUID(),u=Date.now();return p(a=>[...a,{noteId:o,text:"",images:[],createdAt:u,updatedAt:u}]),n.send({type:"notes.create",noteId:o}),o},[n]),g=F.useCallback((o,u)=>{p(a=>a.map(h=>h.noteId===o?{...h,text:u,updatedAt:Date.now()}:h)),n.send({type:"notes.update",noteId:o,text:u})},[n]),l=F.useCallback(o=>{p(u=>u.filter(a=>a.noteId!==o)),n.send({type:"notes.delete",noteId:o})},[n]),v=F.useCallback((o,u)=>{const a=s.find(y=>y.noteId===o);if(a!==void 0&&a.images.length>=Lh){N(`Hasta ${Lh} imagenes por nota.`);return}if(u.size>wo){N(`"${u.name||"la imagen"}" pesa ${Math.round(u.size/1024/1024)} MB; el maximo son ${wo/1024/1024} MB.`);return}const h=new FileReader;h.onload=()=>{const y=h.result;if(typeof y!="string")return;const L=y.indexOf(",");L!==-1&&n.send({type:"notes.addImage",noteId:o,image:{mediaType:u.type,data:y.slice(L+1)}})},h.onerror=()=>N("No se pudo leer la imagen."),h.readAsDataURL(u)},[n,s]),C=F.useCallback((o,u)=>{p(a=>a.map(h=>h.noteId===o?{...h,images:h.images.filter(y=>y.imageId!==u)}:h)),n.send({type:"notes.removeImage",noteId:o,imageId:u})},[n]),b=F.useCallback((o,u)=>{n.send({type:"notes.send",noteId:o,terminalId:u})},[n]),f=F.useCallback(()=>N(null),[]);return{notes:s,images:S,problem:P,requestImage:c,create:m,updateText:g,remove:l,addImage:v,removeImage:C,sendToAgent:b,dismissProblem:f}}const af="agent-workbench.theme",Ta=["system","light","dark"],My={system:"Tema del sistema",light:"Tema claro",dark:"Tema oscuro"},Ay={system:"◐",light:"☀",dark:"☾"};function Ty(){try{const n=window.localStorage.getItem(af);if(n==="light"||n==="dark"||n==="system")return n}catch{}return"system"}function Dy(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function Iy(){const[n,s]=F.useState(Ty),[p,S]=F.useState(Dy);F.useEffect(()=>{const N=window.matchMedia("(prefers-color-scheme: dark)"),i=c=>S(c.matches);return N.addEventListener("change",i),()=>N.removeEventListener("change",i)},[]);const M=n==="system"?p?"dark":"light":n;F.useEffect(()=>{document.documentElement.dataset.theme=M,document.documentElement.style.colorScheme=M},[M]);const P=F.useCallback(()=>{s(N=>{const i=Ta[(Ta.indexOf(N)+1)%Ta.length]??"system";try{window.localStorage.setItem(af,i)}catch{}return i})},[]);return{preference:n,resolved:M,cycle:P}}const Da=new Set;function Ny(n){const[s,p]=F.useState(null),[S,M]=F.useState(null),[P,N]=F.useState(Da),[i,c]=F.useState(null);F.useEffect(()=>{const o=n.onMessage(a=>{switch(a.type){case"vault.status":p(a.status);break;case"vault.exported":N(h=>{if(!h.has(a.projectKey))return h;const y=new Set(h);return y.delete(a.projectKey),y}),c({projectKey:a.projectKey,sessions:a.sessions,at:Date.now()});break;case"error":if(a.code!=="vault-failed")break;M(a.message),a.detail!==void 0&&console.error("[servidor]",a.detail),N(Da);break}}),u=n.onReopen(()=>N(Da));return()=>{o(),u()}},[n]);const m=F.useCallback(()=>{M(null),n.send({type:"vault.measure"})},[n]),g=F.useCallback(o=>{M(null),n.send({type:"vault.enable",enabled:o})},[n]),l=F.useCallback(o=>{M(null),n.send({type:"vault.setDir",pickerId:o})},[n]),v=F.useCallback(o=>{M(null),N(u=>new Set(u).add(o)),n.send({type:"vault.exportProject",projectKey:o})},[n]),C=F.useCallback((o,u)=>{M(null),n.send({type:"vault.openSession",agent:o,sessionId:u})},[n]),b=F.useCallback(()=>{M(null),n.send({type:"vault.reveal"})},[n]),f=F.useCallback(()=>M(null),[]);return{status:s,problem:S,exporting:P,lastExported:i,measure:m,setEnabled:g,chooseDir:l,exportProject:v,openSession:C,reveal:b,dismissProblem:f}}function Py(n){return`El servidor que esta corriendo es de una version anterior a esta pagina (protocolo ${n}, esta pagina usa el ${Co}). Reinicialo y recarga la pagina.`}function jy(n){const[s,...p]=n;return s===void 0||s.missingMessage===null?null:p.length===0?s.missingMessage:`${s.missingMessage}
130
- Tambien funciona con: ${p.map(S=>S.label).join(", ")}`}function Oy(n){const s=n.version??"?";return s.toLowerCase().includes(n.label.toLowerCase())?s:`${n.label} ${s}`}function By(n,s,p=Co){var N,i;if(s&&p<Co)return{cliAvailable:!1,cliVersion:null,cliMissingMessage:Py(p),environmentNotice:null};const S=n.filter(c=>c.available);let M=null;S.length===1?M=((N=S[0])==null?void 0:N.version)??null:S.length>1&&(M=S.map(Oy).join(" · "));const P=s&&S.length===0;return{cliAvailable:!s||S.length>0,cliVersion:M,cliMissingMessage:P?jy(n):null,environmentNotice:((i=n.find(c=>c.environmentNotice!==null))==null?void 0:i.environmentNotice)??null}}function Fy(){const n=new URLSearchParams(window.location.search),s=n.get(Na);if(s===null||s.length===0)return null;n.delete(Na);const p=n.toString();return window.history.replaceState(null,"",`${window.location.pathname}${p.length>0?`?${p}`:""}`),s}const hd=Fy(),$y=500,Hy=8e3;class Wy{constructor(){mr(this,"socket",null);mr(this,"status","connecting");mr(this,"attempt",0);mr(this,"closedByUs",!1);mr(this,"hasConnectedOnce",!1);mr(this,"reconnectTimer");mr(this,"messageHandlers",new Set);mr(this,"statusHandlers",new Set);mr(this,"reopenHandlers",new Set);mr(this,"outbox",[])}getStatus(){return this.status}onMessage(s){return this.messageHandlers.add(s),()=>this.messageHandlers.delete(s)}onStatus(s){return this.statusHandlers.add(s),()=>this.statusHandlers.delete(s)}onReopen(s){return this.reopenHandlers.add(s),()=>this.reopenHandlers.delete(s)}connect(){if(this.socket!==null)return;const s=new URL(Cm,window.location.href);s.protocol=window.location.protocol==="https:"?"wss:":"ws:",hd!==null&&s.searchParams.set(Na,hd);const p=new WebSocket(s);this.socket=p,p.onopen=()=>{for(this.attempt=0,this.setStatus("open");this.outbox.length>0;){const S=this.outbox.shift();S!==void 0&&p.send(Mh(S))}if(this.hasConnectedOnce)for(const S of this.reopenHandlers)S();this.hasConnectedOnce=!0},p.onmessage=S=>{const M=Em(S.data);if(M===null){console.warn("[conexion] mensaje del servidor no reconocido");return}for(const P of this.messageHandlers)P(M)},p.onclose=()=>{this.socket=null,!this.closedByUs&&(this.setStatus("reconnecting"),this.scheduleReconnect())},p.onerror=()=>{}}send(s){if(this.socket!==null&&this.socket.readyState===WebSocket.OPEN){this.socket.send(Mh(s));return}s.type!=="input"&&s.type!=="resize"&&this.outbox.push(s)}close(){var s;this.closedByUs=!0,window.clearTimeout(this.reconnectTimer),(s=this.socket)==null||s.close(),this.socket=null}setStatus(s){if(this.status!==s){this.status=s;for(const p of this.statusHandlers)p(s)}}scheduleReconnect(){if(this.attempt+=1,!this.hasConnectedOnce&&this.attempt>4){this.setStatus("failed");return}const s=Math.min($y*2**(this.attempt-1),Hy);window.clearTimeout(this.reconnectTimer),this.reconnectTimer=window.setTimeout(()=>this.connect(),s)}}const Uy={state:"idle",scannedFiles:0,totalFiles:0};function zy(n,s,p){const S=new Map(p?[]:n.map(M=>[M.key,M]));for(const M of s)S.set(M.key,M);return[...S.values()].sort((M,P)=>P.lastActivityAt-M.lastActivityAt)}function qy(){const n=F.useMemo(()=>new Wy,[]),[s,p]=F.useState("connecting"),[S,M]=F.useState([]),[P,N]=F.useState(null),[i,c]=F.useState(!1),[m,g]=F.useState(Co),[l,v]=F.useState(""),[C,b]=F.useState(""),[f,o]=F.useState(null),[u,a]=F.useState([]),[h,y]=F.useState([]),[L,k]=F.useState(Uy),[A,x]=F.useState(null),[E,T]=F.useState(new Set),[j,D]=F.useState(new Map),[B,z]=F.useState(new Map),X=F.useRef(new Map),Z=F.useRef(new Map),[Y,V]=F.useState(new Set),[I,$]=F.useState(null),[O,U]=F.useState([]),[K,ee]=F.useState(new Map),[ne,Q]=F.useState([]),q=F.useRef(1),H=F.useRef(new Set),re=F.useRef(new Map),te=F.useRef(new Map),he=F.useCallback(me=>{const Ce=te.current.get(me);Ce!==void 0&&(clearTimeout(Ce),te.current.delete(me)),U(rt=>rt.some(ye=>ye.requestId===me)?rt.filter(ye=>ye.requestId!==me):rt)},[]),de=F.useCallback(()=>{for(const me of te.current.values())clearTimeout(me);te.current.clear(),U(me=>me.length===0?me:[])},[]);F.useEffect(()=>{const me=n.onStatus(ye=>{p(ye),ye==="failed"&&$({message:"No se pudo conectar con el servidor local. Abri de nuevo la URL que imprimio al arrancar.",at:Date.now()})}),Ce=n.onMessage(ye=>{switch(ye.type){case"agents":M(ye.agents),N(ye.defaultAgent);break;case"hello":M(ye.agents),N(ye.defaultAgent),c(!0),g(ye.protocolVersion),v(ye.platform),b(ye.defaultCwd),o(ye.shellName);break;case"terminal.list":{a(ye.terminals);const Ye=kg(Z.current,ye.terminals),it=Ye.finished.length>0||[...Ye.phases].some(([Ke,lt])=>Z.current.get(Ke)!==lt);Z.current=Ye.phases,it&&V(new Set(Ye.phases.keys())),T(Ke=>{if(Ke.size===0)return Ke;const lt=new Set(Ke);for(const ue of Ke){if(Ye.phases.has(ue))continue;const De=ye.terminals.find(Fe=>Fe.terminalId===ue);(De===void 0||De.alive)&&lt.delete(ue)}return lt.size===Ke.size?Ke:lt}),z(Ke=>{if(Ke.size===0)return Ke;const lt=new Map([...Ke].filter(([ue])=>ye.terminals.some(De=>De.terminalId===ue)));return lt.size===Ke.size?Ke:(X.current=lt,lt)});const dt=ye.terminals.filter(Ke=>Ke.kind==="agent");x(Ke=>{var lt;return Ke!==null&&dt.some(ue=>ue.terminalId===Ke)?Ke:((lt=dt[0])==null?void 0:lt.terminalId)??null}),ee(Ke=>{if(Ke.size===0)return Ke;const lt=new Map(Ke);for(const ue of Ke.keys())ye.terminals.some(De=>De.terminalId===ue)||lt.delete(ue);return lt.size===Ke.size?Ke:lt});break}case"session.continued":ee(Ye=>new Map(Ye).set(ye.terminalId,{sourceAgent:ye.source.agent,includedTurns:ye.includedTurns,totalTurns:ye.totalTurns,totalTurnsIsMinimum:ye.totalTurnsIsMinimum,delivery:ye.delivery,prefillReason:null}));break;case"composer.prefill":{const Ye=q.current;q.current+=1,Q(it=>[...it,{id:Ye,terminalId:ye.terminalId,text:ye.text}]),ee(it=>{const dt=it.get(ye.terminalId);return dt===void 0?it:new Map(it).set(ye.terminalId,{...dt,delivery:"prefilled",prefillReason:ye.reason})});break}case"terminal.opened":{he(ye.requestId),H.current.delete(ye.requestId)&&ye.terminal.kind==="agent"&&x(ye.terminal.terminalId);const Ye=re.current.get(ye.requestId);Ye!==void 0&&(re.current.delete(ye.requestId),Ye(ye.terminal));break}case"terminal.activity":D(Ye=>Ye.get(ye.terminalId)===ye.activity?Ye:new Map(Ye).set(ye.terminalId,ye.activity)),z(Ye=>{const it=ye.offlineReason??null;if((Ye.get(ye.terminalId)??null)===it)return Ye;const dt=new Map(Ye);return it===null?dt.delete(ye.terminalId):dt.set(ye.terminalId,it),X.current=dt,dt});break;case"index.status":k(ye.status);break;case"index.projects":y(Ye=>zy(Ye,ye.projects,ye.replace));break;case"error":if(by(ye.requestId)){ye.detail!==void 0&&console.error("[servidor]",ye.detail);break}if(ye.code==="vault-failed"||ye.code==="search-failed")break;$({message:ye.message,at:Date.now()}),T(Ye=>Ye.size===0?Ye:new Set),Z.current.size>0&&(Z.current=new Map,V(new Set)),ye.detail!==void 0&&console.error("[servidor]",ye.detail),ye.requestId!==void 0&&(H.current.delete(ye.requestId),re.current.delete(ye.requestId),he(ye.requestId));break}}),rt=n.onReopen(()=>{de(),T(ye=>ye.size===0?ye:new Set),Z.current.size>0&&(Z.current=new Map,V(new Set))});return n.connect(),()=>{me(),Ce(),rt(),n.close()}},[n,he,de]),F.useEffect(()=>de,[de]);const Te=F.useCallback(me=>{const Ce=crypto.randomUUID();H.current.add(Ce),me.onOpened!==void 0&&re.current.set(Ce,me.onOpened),U(ye=>[...ye,{requestId:Ce,cwd:me.cwd,agent:me.agent??null,label:me.label??"",at:Date.now()}]);const rt=setTimeout(()=>he(Ce),Lg);te.current.set(Ce,rt),n.send({type:"terminal.open",requestId:Ce,cwd:me.cwd,...me.resumeSessionId!==void 0?{resumeSessionId:me.resumeSessionId}:{},...me.label!==void 0?{label:me.label}:{},...me.agent!==void 0?{agent:me.agent}:{}})},[n,he]),ke=F.useCallback(me=>{n.send({type:"terminal.open",requestId:crypto.randomUUID(),cwd:me,kind:"shell"})},[n]),He=F.useCallback(me=>n.send({type:"terminal.close",terminalId:me}),[n]),Qe=F.useCallback(me=>{T(Ce=>new Set(Ce).add(me)),X.current.get(me)==="server-closed"&&(Z.current=new Map(Z.current).set(me,"waiting-exit"),V(new Set(Z.current.keys()))),n.send({type:"terminal.wake",terminalId:me})},[n]),ce=F.useCallback((me,Ce)=>n.send({type:"terminal.rename",terminalId:me,label:Ce}),[n]),ze=F.useCallback(me=>n.send({type:"tabs.reorder",terminalIds:me}),[n]),ot=F.useCallback((me,Ce)=>n.send({type:"session.archive",sessionIds:me,archived:Ce}),[n]),Oe=F.useCallback((me,Ce)=>{const rt=crypto.randomUUID();H.current.add(rt),n.send({type:"session.continue",requestId:rt,agent:me.agent,sessionId:me.sessionId,target:Ce})},[n]),Re=F.useCallback(me=>{ee(Ce=>{if(!Ce.has(me))return Ce;const rt=new Map(Ce);return rt.delete(me),rt})},[]),Ie=F.useCallback(me=>{Q(Ce=>Ce.some(rt=>rt.id===me)?Ce.filter(rt=>rt.id!==me):Ce)},[]),we=F.useCallback(()=>n.send({type:"index.refresh"}),[n]),We=F.useCallback(()=>n.send({type:"agents.refresh"}),[n]),et=F.useCallback(()=>$(null),[]),Ve=F.useMemo(()=>u.filter(me=>me.kind==="agent"),[u]),ht=F.useMemo(()=>u.filter(me=>me.kind==="shell"),[u]),Je=F.useMemo(()=>By(S,i,m),[S,i,m]),St=F.useCallback(me=>{var Ce;return(me===null||(Ce=S.find(rt=>rt.id===me))==null?void 0:Ce.capabilities)??Ed},[S]),tt=F.useMemo(()=>Wa(S),[S]);return{connection:n,status:s,agents:S,defaultAgent:P,capabilitiesFor:St,offerAgentChoice:tt,cliAvailable:Je.cliAvailable,cliVersion:Je.cliVersion,cliMissingMessage:Je.cliMissingMessage,platform:l,defaultCwd:C,environmentNotice:Je.environmentNotice,shellName:f,terminals:Ve,shells:ht,pendingOpens:O,activeTerminalId:A,projects:h,indexStatus:L,error:I,dismissError:et,setActiveTerminal:x,openTerminal:Te,openShell:ke,closeTerminal:He,wakeTerminal:Qe,waking:E,activity:j,offlineReasons:B,relaunching:Y,renameTerminal:ce,reorderTabs:ze,refreshIndex:we,refreshAgents:We,archiveSessions:ot,continueSession:Oe,handoffs:K,dismissHandoff:Re,prefills:ne,prefillApplied:Ie}}function Vy({status:n,agents:s,indexReady:p,problem:S,covered:M,onMeasure:P,onSetEnabled:N,onChangeDir:i,onReveal:c,onDismissProblem:m,onClose:g}){return F.useEffect(()=>{if(M)return;const l=v=>{v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),g())};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[M,g]),_.jsx("div",{className:"modal-backdrop",onClick:g,children:_.jsxs("div",{className:"modal vault-modal",role:"dialog","aria-label":an,onClick:l=>l.stopPropagation(),children:[_.jsxs("header",{className:"modal-header",children:[_.jsx("span",{className:"modal-title",children:an}),n!==null&&_.jsx("span",{className:`vault-state${n.enabled?" vault-state-on":""}`,children:g0(n)}),_.jsx("button",{className:"icon-button",onClick:g,title:"Cerrar (Esc)",children:"×"})]}),_.jsxs("div",{className:"modal-body",children:[_.jsx("p",{className:"vault-lead",children:h0}),_.jsx("p",{className:"modal-hint",children:d0}),n===null?_.jsx("p",{className:"modal-hint",children:"Esperando el estado del servidor…"}):_.jsx(Ky,{status:n,agents:s,indexReady:p,onMeasure:P,onSetEnabled:N,onChangeDir:i,onReveal:c}),S!==null&&_.jsxs("div",{className:"vault-problem",role:"alert",children:[_.jsx("span",{children:S}),_.jsx("button",{className:"icon-button",onClick:m,title:"Cerrar el aviso",children:"×"})]})]})]})})}function Ky({status:n,agents:s,indexReady:p,onMeasure:S,onSetEnabled:M,onChangeDir:P,onReveal:N}){const i=C0(n,p),c=w0(n),m=S0(n),g=n.measurement===null?null:k0(n.measurement,s),l=n.progress;return _.jsxs(_.Fragment,{children:[n.enabled&&_.jsxs(_.Fragment,{children:[_.jsx("h3",{className:"modal-section",children:"En la carpeta"}),_.jsxs("p",{className:"vault-summary",children:[nf(n.sessions)," · ",Qn(n.bytes),n.lastPassAt!==null&&_.jsxs(_.Fragment,{children:[" · última pasada ",is(n.lastPassAt)]}),n.pending>0&&_.jsxs(_.Fragment,{children:[" · ",n.pending," esperando su minuto de calma"]})]})]}),l!==null&&l.total>0&&_.jsx("progress",{className:"vault-progress",value:l.done,max:l.total}),_.jsx("h3",{className:"modal-section",children:"Cuánto ocuparía"}),_.jsxs("div",{className:"vault-actions",children:[_.jsx("button",{className:"link-button vault-measure",onClick:S,disabled:i!==null,title:i??"Lee el historial entero sin escribir nada, ni la carpeta",children:n.state==="measuring"?"Midiendo…":g===null?"Medir":"Medir de nuevo"}),g!==null&&_.jsx("span",{className:"modal-hint",children:g.summary})]}),g!==null&&_.jsx("div",{className:"vault-table-wrap",children:_.jsxs("table",{className:"vault-table",children:[_.jsx("thead",{children:_.jsxs("tr",{children:[_.jsx("th",{children:"CLI"}),_.jsx("th",{children:"Sesiones"}),_.jsx("th",{children:"Tamaño"}),_.jsx("th",{children:"Imágenes"}),_.jsx("th",{title:"Las archivadas no se copian",children:"Archivadas"})]})}),_.jsxs("tbody",{children:[g.rows.map(v=>_.jsxs("tr",{children:[_.jsxs("td",{children:[v.label,v.note!==null&&_.jsx("span",{className:"vault-table-note",children:v.note})]}),_.jsx("td",{children:v.sessions}),_.jsx("td",{children:Qn(v.bytes)}),_.jsx("td",{title:v.images>0?Qn(v.imageBytes):void 0,children:v.images}),_.jsx("td",{children:v.skippedArchived})]},v.agent)),_.jsxs("tr",{children:[_.jsxs("td",{children:["Memoria de ",g.memoryProjects===1?"1 proyecto":`${g.memoryProjects} proyectos`]}),_.jsx("td",{}),_.jsx("td",{children:Qn(g.memoryBytes)}),_.jsx("td",{}),_.jsx("td",{})]})]}),_.jsx("tfoot",{children:_.jsxs("tr",{children:[_.jsx("td",{children:"Total"}),_.jsx("td",{children:g.total.sessions}),_.jsx("td",{children:Qn(g.total.bytes)}),_.jsx("td",{children:g.total.images}),_.jsx("td",{children:g.total.skippedArchived})]})})]})}),_.jsxs("div",{className:"vault-actions vault-switch",children:[m==="enabled"&&_.jsxs(_.Fragment,{children:[_.jsx("button",{className:"link-button",onClick:()=>M(!1),children:"Apagar"}),_.jsx("span",{className:"modal-hint",children:"Apagarla no borra nada: lo copiado queda en la carpeta."})]}),(m==="measured"||m==="existing")&&_.jsxs(_.Fragment,{children:[_.jsx("button",{className:"primary-button",onClick:()=>M(!0),title:m==="existing"?"La carpeta ya tiene una copia: encenderla la completa":"Copia ahora lo medido y, después, cada sesión que cambie",children:"Activar"}),_.jsx("span",{className:"modal-hint",children:m==="existing"?"La carpeta ya tiene una copia. Encendida, la completa y la mantiene al día.":"Copia todo lo medido y, después, cada sesión que cambie y lleve un minuto en calma."})]}),m==="needs-measure"&&_.jsx("span",{className:"modal-hint",children:"Medí primero cuánto ocuparía: después aparece “Activar”."})]}),_.jsx("h3",{className:"modal-section",children:"Carpeta"}),_.jsx("p",{className:"vault-dir",title:n.dir,children:n.dir}),n.isDefaultDir&&_.jsx("p",{className:"modal-hint",children:"Es la de por defecto, en la carpeta de la app."}),_.jsxs("div",{className:"vault-actions",children:[_.jsx("button",{className:"link-button",onClick:P,disabled:c!==null,title:c??"Elegir otra carpeta. Lo copiado se copia allá; esta queda intacta",children:"Cambiar carpeta…"}),_.jsx("button",{className:"link-button",onClick:N,title:"Abrir la carpeta con el explorador del sistema",children:"Abrir carpeta"})]}),n.previousDir!==null&&_.jsx("p",{className:"modal-hint",children:x0(n.previousDir)}),n.lastError!==null&&_.jsxs(_.Fragment,{children:[_.jsx("h3",{className:"modal-section",children:"Último error"}),_.jsx("p",{className:"vault-error",children:n.lastError})]})]})}const Gy={connecting:"Conectando",open:"Conectada",reconnecting:"Reconectando",failed:"Sin conexion"},dd=320,Xy=1400,Yy=640,fd=200,pd=560,Qy=270,Jy=120,Zy=720,eS=260,_d="agent-workbench.panel-width",md="agent-workbench.panel-visible",gd="agent-workbench.panel-tab",Ia="agent-workbench.panel-expanded",vd="agent-workbench.sidebar-visible",yd="agent-workbench.sidebar-width",Sd="agent-workbench.console-visible",Cd="agent-workbench.console-height",wd="agent-workbench.marker-notice-dismissed";function tS(){var Ps,hs;const n=qy(),{connection:s,status:p,agents:S,defaultAgent:M,capabilitiesFor:P,offerAgentChoice:N,cliAvailable:i,cliVersion:c,cliMissingMessage:m,platform:g,defaultCwd:l,environmentNotice:v,shellName:C,terminals:b,archiveSessions:f,shells:o,pendingOpens:u,activeTerminalId:a,projects:h,indexStatus:y,error:L,dismissError:k,setActiveTerminal:A,openTerminal:x,openShell:E,closeTerminal:T,wakeTerminal:j,waking:D,activity:B,offlineReasons:z,relaunching:X,renameTerminal:Z,reorderTabs:Y,refreshIndex:V,refreshAgents:I,continueSession:$,handoffs:O,dismissHandoff:U,prefills:K,prefillApplied:ee}=n,ne=Iy(),Q=b.find(ae=>ae.terminalId===a)??null,q=(Q==null?void 0:Q.agent)??null,H=P(q),re=F.useMemo(()=>Bm(H),[H]),te=S.find(ae=>ae.id===q)??null,he=(te==null?void 0:te.statusLine)??null,de=(Q==null?void 0:Q.cwd)??l,Te=F.useMemo(()=>N?ng(b,de,g,S,M):null,[N,b,de,g,S,M]),ke=F.useMemo(()=>Ih(u,de,g),[u,de,g]),He=ke?Wd:null,Qe=Ry(s),ce=Ny(s),[ze,ot]=F.useState(!1),Oe=Cy(s),Re=Nv(S,ce.status),[Ie,we]=F.useState(null),We=F.useRef(0),et=F.useCallback(ae=>{we(Se=>Se!==null&&Se.seq===ae?null:Se)},[]),Ve=(ae,Se)=>{const Ge=Gv(ae,{projects:h,terminals:b,platform:g,canResume:Mr=>Th(S,Mr)}),cr=()=>{Se.length!==0&&(We.current+=1,we({query:Se,seq:We.current}))};switch(Ge.kind){case"activate":A(Ge.terminalId),cr();break;case"resume":Ge.session.archived&&f([Ge.session.sessionId],!1),x({cwd:Ge.cwd,resumeSessionId:Ge.session.sessionId,agent:Ge.session.agent,label:Ge.session.title}),cr();break;case"copy":ce.openSession(ae.agent,ae.sessionId);break}},ht=F.useMemo(()=>new Set(b.map(ae=>ae.sessionId).filter(ae=>ae.length>0)),[b]),[Je,St]=F.useState(()=>vr(md,!0,ae=>ae==="true")),[tt,me]=F.useState(()=>vr(gd,"cli",ae=>ae==="git"||ae==="files"||ae==="cli"||ae==="plans"||ae==="memory"?ae:ae==="conversation"?"cli":null)),[Ce,rt]=F.useState(()=>vr(_d,Yy,ae=>{const Se=Number.parseInt(ae,10);return Number.isFinite(Se)?Math.max(Se,dd):null})),[ye,Ye]=F.useState(()=>vr(Ia,!1,ae=>ae==="true")),[it,dt]=F.useState(()=>vr(vd,!0,ae=>ae==="true")),[Ke,lt]=F.useState(()=>vr(yd,Qy,ae=>{const Se=Number.parseInt(ae,10);return Number.isFinite(Se)?Math.min(pd,Math.max(fd,Se)):null})),[ue,De]=F.useState(()=>vr(Sd,!1,ae=>ae==="true")),[Fe,Sr]=F.useState(()=>vr(Cd,eS,ae=>{const Se=Number.parseInt(ae,10);return Number.isFinite(Se)?Se:null})),[qe,Cr]=F.useState(()=>vr(wd,!0,ae=>ae!=="true")),[os,Br]=F.useState(!1),[or,Fr]=F.useState(!1);F.useEffect(()=>{he===null&&Fr(!1)},[he]);const[lr,Pt]=F.useState(null),ar=Je&&Q!==null,dn=Vm(tt,re.plansAvailable),Jt=Q!==null&&(Je||ue),jt=F.useMemo(()=>Q===null?[]:o.filter(ae=>ae.cwd===Q.cwd),[o,Q]),[bs,ks]=F.useState(null),fn=jt.find(ae=>ae.terminalId===bs)??jt[0]??null,Ot=gv(s,a),Eo=xy(s,ar?a:null),Rr=Sy(s,ar&&dn==="files"?a:null),ri=wy(s,a),si=Ly(s,ar?a:null),Lo=ar&&dn==="cli",pn=Ot.usage.lastModel,_n=Ot.usage.lastEffort??((Ps=[...Ot.events].reverse().find(ae=>ae.effort!==null))==null?void 0:Ps.effort)??null,mn=pn??Ot.defaults.model,gn=_n??Ot.defaults.effort,Ro=pn===null&&mn!==null,Mo=_n===null&&gn!==null,_t=vy(s,a,Lo),ni=a===null?null:B.get(a)??null,Es=Sg(H,Ot.openToolCall,(te==null?void 0:te.label)??null,(Q==null?void 0:Q.alive)??!1,ni),Ls=Cg({offlineReason:a===null?null:z.get(a)??null,alive:(Q==null?void 0:Q.alive)??!1,relaunching:a!==null&&X.has(a)}),$r=Ls===null?null:wg((te==null?void 0:te.label)??null),Ao=$r??Es??Eg(H,Ot.waitingFor,(Q==null?void 0:Q.alive)??!1),ii=!kd(H,ni),Rs=F.useMemo(()=>$d(S,q),[S,q]),Vt=Q!==null&&gg(q,Q.sessionId,H),wr=a===null?null:O.get(a)??null,Kt=wr===null?null:{text:dg(ti(wr.sourceAgent,S),wr.includedTurns,wr.totalTurns,wr.totalTurnsIsMinimum),status:wr.prefillReason!==null?pg(wr.prefillReason):wr.delivery==="sending"&&Ot.events.length===0?fg:null},ls=F.useCallback(()=>{St(ae=>{const Se=!ae;return ir(md,String(Se)),Se})},[]),oi=F.useCallback(()=>{dt(ae=>{const Se=!ae;return ir(vd,String(Se)),Se})},[]),li=F.useCallback(()=>{De(ae=>{const Se=!ae;return ir(Sd,String(Se)),Se})},[]),as=F.useCallback(ae=>{me(ae),ir(gd,ae)},[]),Ms=F.useCallback(()=>{Ye(ae=>{const Se=!ae;return ir(Ia,String(Se)),Se})},[]),cs=F.useCallback(()=>{a!==null&&s.send({type:"input",terminalId:a,data:"\x1B\x1B"})},[s,a]),As=F.useCallback(ae=>{a!==null&&s.send({type:"input",terminalId:a,data:`${ae} `})},[s,a]),To=F.useCallback(ae=>{a!==null&&s.send({type:"agent.submit",terminalId:a,text:ae,images:[]})},[s,a]),Do=F.useCallback(ae=>{a!==null&&s.send({type:"files.reveal",terminalId:a,path:ae})},[s,a]),xr=F.useRef(new Set);F.useEffect(()=>{if(!ue){xr.current.clear();return}if(Q===null)return;const{cwd:ae}=Q;if(o.some(Se=>Se.cwd===ae)){xr.current.delete(ae);return}xr.current.has(ae)||(xr.current.add(ae),E(ae))},[ue,Q,o,E]);const ai=F.useCallback(ae=>{const Se=jt.find(Ge=>Ge.terminalId===ae);Se!==void 0&&xr.current.delete(Se.cwd),T(ae)},[jt,T]),Ts=F.useRef(new Set);F.useEffect(()=>{const ae=jt.filter(Ge=>!Ts.current.has(Ge.terminalId));for(const Ge of jt)Ts.current.add(Ge.terminalId);const Se=ae[ae.length-1];Se!==void 0&&ks(Se.terminalId)},[jt]);const us=F.useCallback(()=>{Q!==null&&(xr.current.add(Q.cwd),E(Q.cwd))},[Q,E]),Io=yo({min:dd,max:Xy,value:Ce,measure:F.useCallback(ae=>window.innerWidth-ae.clientX,[]),onChange:rt,onCommit:F.useCallback(ae=>ir(_d,String(ae)),[]),onStart:F.useCallback(()=>{Ye(!1),ir(Ia,"false")},[])}),vn=yo({min:fd,max:pd,value:Ke,measure:F.useCallback(ae=>ae.clientX,[]),onChange:lt,onCommit:F.useCallback(ae=>ir(yd,String(ae)),[])}),nt=yo({min:Jy,max:Zy,value:Fe,measure:F.useCallback(ae=>window.innerHeight-ae.clientY,[]),onChange:Sr,onCommit:F.useCallback(ae=>ir(Cd,String(ae)),[])}),ci=F.useCallback(()=>{Cr(!1),ir(wd,"true")},[]),Ds=F.useCallback(ae=>{if(b.length===0)return;const Ge=(b.findIndex(Mr=>Mr.terminalId===a)+ae+b.length)%b.length,cr=b[Ge];cr!==void 0&&A(cr.terminalId)},[b,a,A]),Is=F.useRef(null),Ns=F.useRef(null);F.useEffect(()=>{a!==Ns.current&&(Is.current=Ns.current,Ns.current=a)},[a]);const yn=F.useCallback(()=>{const ae=Is.current;ae===null||ae===a||b.some(Se=>Se.terminalId===ae)&&A(ae)},[a,b,A]);F.useEffect(()=>{const ae=Se=>{if(Se.key!=="Tab"||!Se.shiftKey||Se.altKey||Se.ctrlKey||Se.metaKey)return;const Ge=document.activeElement;Ge instanceof Element&&Ge.closest(".xterm")!==null||(Se.preventDefault(),Se.stopPropagation(),yn())};return window.addEventListener("keydown",ae,!0),()=>window.removeEventListener("keydown",ae,!0)},[yn]),F.useEffect(()=>{const ae=Se=>{if(!Se.altKey||Se.ctrlKey||Se.metaKey)return;const Ge=Se.key.toLowerCase();if(Ge==="t"){i&&l.length>0&&!ke&&(Se.preventDefault(),Se.stopPropagation(),x({cwd:(Q==null?void 0:Q.cwd)??l}));return}if(Ge==="w"){a!==null&&(Se.preventDefault(),Se.stopPropagation(),T(a));return}if(Ge==="p"){Se.preventDefault(),Se.stopPropagation(),ls();return}if(Ge==="arrowright"||Ge==="pagedown"){Se.preventDefault(),Se.stopPropagation(),Ds(1);return}(Ge==="arrowleft"||Ge==="pageup")&&(Se.preventDefault(),Se.stopPropagation(),Ds(-1))};return window.addEventListener("keydown",ae,!0),()=>window.removeEventListener("keydown",ae,!0)},[Q,a,i,T,Ds,l,ke,x,ls]);const ui=Q===null?"Panel":Q.label.length>0?Q.label:Q.cwd.split(/[\\/]/).filter(ae=>ae.length>0).pop()??Q.cwd;return _.jsxs("div",{className:"app",children:[_.jsxs("header",{className:"app-header",children:[_.jsx("span",{className:"app-name",children:"Agent Workbench"}),_.jsx("span",{className:`status status-${p}`,children:Gy[p]}),Q!==null&&_.jsx("span",{className:"meta",title:Q.cwd,children:Q.cwd}),_.jsx("span",{className:"header-spacer"}),c!==null&&_.jsxs("span",{className:"meta meta-dim",children:["CLI ",c]}),_.jsx("button",{className:"icon-button",onClick:ne.cycle,title:`${My[ne.preference]} — clic para cambiar`,children:Ay[ne.preference]}),_.jsx("button",{className:"icon-button",onClick:()=>Br(!0),title:"Ver los atajos de teclado",children:"?"})]}),!i&&m!==null&&_.jsx("div",{className:"banner banner-error banner-lines",children:m}),v==="child-session-marker"&&qe&&_.jsxs("div",{className:"banner banner-notice",children:[_.jsxs("span",{children:["Este servidor se lanzo desde dentro de una sesion de la CLI. Se quito la variable"," ",_.jsx("code",{children:"CLAUDE_CODE_CHILD_SESSION"})," del entorno de las pestanas, que apaga el guardado del historial; sin eso no habria conversacion ni medidor. El resto del entorno va intacto."]}),_.jsx("button",{className:"banner-close",onClick:ci,title:"Entendido",children:"×"})]}),L!==null&&_.jsxs("div",{className:"banner banner-error",children:[_.jsx("span",{children:L.message}),_.jsx("button",{className:"banner-close",onClick:k,title:"Cerrar",children:"×"})]}),ce.problem!==null&&!ze&&_.jsxs("div",{className:"banner banner-error",children:[_.jsx("span",{children:ce.problem}),_.jsx("button",{className:"banner-close",onClick:ce.dismissProblem,title:"Cerrar",children:"×"})]}),_.jsxs("div",{className:"app-body",children:[!it&&_.jsxs("button",{className:"panel-peek panel-peek-left",onClick:oi,title:"Mostrar la lista de proyectos",children:[_.jsx("span",{className:"panel-peek-arrow",children:"›"}),_.jsx("span",{className:"panel-peek-label",children:"Proyectos"})]}),it&&_.jsx(I0,{projects:h,indexStatus:y,disabled:!i,onOpenProject:(ae,Se)=>x({cwd:ae,...Se!==void 0?{agent:Se}:{}}),agents:S,offerAgentChoice:N,agentForProject:ae=>ig(b,ae,g,S,M),onOpenSession:(ae,Se)=>x({cwd:ae,resumeSessionId:Se.sessionId,agent:Se.agent,label:Se.title}),canResume:ae=>Th(S,ae),platform:g,onRefresh:V,openSessionIds:ht,openBlocked:ae=>Ih(u,ae,g),onArchive:f,onHide:oi,width:Ke,notes:Qe,onNewProject:()=>Pt("project"),onSendNote:Q===null||!re.noteSendable?null:ae=>{const Se=Q.cwd;x({cwd:Se,...Q.agent!==null?{agent:Q.agent}:{},onOpened:Ge=>s.send({type:"notes.send",noteId:ae,terminalId:Ge.terminalId})})},sendNoteCwd:(Q==null?void 0:Q.cwd)??null,vault:ce.status,onOpenVault:()=>ot(!0),onOpenVaultSession:ae=>ce.openSession(ae.agent,ae.sessionId),onExportProject:ce.exportProject,exporting:ce.exporting,lastExported:ce.lastExported,onContinueSession:(ae,Se)=>$({agent:ae.agent,sessionId:ae.sessionId},Se),globalSearch:Re?{...Oe,vaultEnabled:((hs=ce.status)==null?void 0:hs.enabled)===!0}:null,onOpenSearchHit:Ve}),it&&_.jsx("div",{className:"divider",...vn,title:"Arrastrar para cambiar el ancho"}),_.jsxs("main",{className:`workspace${ye&&Jt?" workspace-narrow":""}`,children:[_.jsx(gy,{terminals:b,activeTerminalId:a,activity:B,canOpen:i&&l.length>0,onSelect:A,onClose:T,onRename:Z,onReorder:Y,onNew:ae=>x({cwd:de,...ae!==void 0?{agent:ae}:{}}),agents:S,offerAgentChoice:N,newTabAgent:Te,pendingOpens:u,platform:g,newTabBlockedTitle:He}),_.jsx("div",{className:"chat-stack",children:b.length===0?_.jsxs("div",{className:"empty-state",children:[_.jsx("p",{children:"No hay pestanas abiertas."}),_.jsx("p",{className:"empty-hint",children:"Elegi un proyecto de la izquierda, o abri una sesion del historial para retomarla."}),i&&l.length>0&&_.jsx("button",{className:"primary-button",onClick:()=>x({cwd:l}),disabled:ke,title:He??void 0,children:ke?"Abriendo…":`Nueva sesion en ${l}`})]}):_.jsx(xv,{view:Ot,onRewind:re.rewind?cs:void 0,questionsAnswerable:re.questionsAnswerable,contextWindowSource:re.contextWindowSource,instructionsFile:Om(q),onGoToCli:()=>{ar||ls(),as("cli")},cliPresence:Q===null||Q.alive?"live":Q.sleeping?"sleeping":"exited",exitCode:(Q==null?void 0:Q.exitCode)??null,waking:a!==null&&D.has(a),onWakeCli:()=>{a!==null&&j(a)},discovering:Vt,continueTargets:Rs,continueBlockedReason:hg((Q==null?void 0:Q.sessionId)??"",Vt,Ot.events.length>0),onContinue:Q===null||q===null?void 0:ae=>$({agent:q,sessionId:Q.sessionId},ae),searchRequest:Ie,onSearchRequestApplied:et,toolCallNotice:Es,serverClosed:Ls===null||$r===null?null:{state:Ls,text:$r},statusLineState:(he==null?void 0:he.state)??null,onConfigureStatusLine:he===null?void 0:()=>Fr(!0)})}),Q!==null&&_.jsx(Bg,{connection:s,terminalId:a,alive:Q.alive,sleeping:Q.sleeping,imagesAllowed:re.imagesAllowed,blockedReason:Ao,prefills:K,onPrefillApplied:ee,notice:Kt,onDismissNotice:a===null?void 0:()=>U(a),onSubmitted:U,leading:re.modeCycle===null?void 0:_.jsx(Tg,{mode:Ot.permissionMode,cycle:re.modeCycle,disabled:!Q.alive,waitingFor:Ot.waitingFor,statusKnown:ii,onChange:Ot.setPermissionMode}),controls:re.models===null&&re.efforts===null?void 0:_.jsx(Ag,{models:re.models,efforts:re.efforts,model:mn,effort:gn,modelProvisional:Ro,effortProvisional:Mo,choiceNote:jm(q),disabled:!Q.alive,onCommand:To})})]}),Q!==null&&_.jsxs(_.Fragment,{children:[!Jt&&_.jsxs("button",{className:"panel-peek",onClick:ls,title:"Mostrar el panel derecho (Alt+P)",children:[_.jsx("span",{className:"panel-peek-arrow",children:"‹"}),_.jsx("span",{className:"panel-peek-label",children:"Panel"})]}),Jt&&_.jsx("div",{className:"divider",...Io,title:"Arrastrar para cambiar el ancho"}),_.jsxs("div",{className:`panel-slot${Jt?"":" panel-slot-collapsed"}${Jt&&ye?" panel-slot-expanded":""}`,style:Jt&&!ye?{width:`${Ce}px`}:void 0,children:[_.jsx(py,{tab:dn,plansAvailable:re.plansAvailable,hidden:!Je,onTabChange:as,title:ui,cwd:Q.cwd,platform:g,cli:_.jsx("div",{className:"terminal-stack",children:b.map(ae=>_.jsx(Vd,{terminalId:ae.terminalId,connection:s,active:ae.terminalId===a,theme:ne.resolved,autoFocus:!1},ae.terminalId))}),cliUnseen:_t,expanded:ye,onToggleExpanded:Ms,git:Eo,files:Rr,plans:ri,memory:si,onInsert:re.fileMentions?As:void 0,onReveal:Do,onHide:ls}),ue?_.jsxs(_.Fragment,{children:[Je&&_.jsx("div",{className:"hdivider",...nt,title:"Arrastrar para cambiar el alto de la consola"}),_.jsx("div",{className:"console-slot",style:Je?{height:`${Fe}px`}:{flex:"1 1 auto"},children:_.jsx(Qg,{connection:s,shells:jt,activeShellId:(fn==null?void 0:fn.terminalId)??null,cwd:Q.cwd,shellName:C,theme:ne.resolved,onSelect:ks,onOpen:us,onCloseShell:ai,onCollapse:li})})]}):_.jsxs("button",{className:"strip-collapsed",onClick:li,title:`Abrir ${C??"una consola"} en ${Q.cwd}`,children:[_.jsx("span",{className:"strip-collapsed-arrow",children:"▸"}),_.jsx("span",{children:C??"Consola"}),jt.length>0&&_.jsx("span",{className:"strip-collapsed-count",children:jt.length})]})]})]})]}),or&&he!==null&&te!==null&&_.jsx(Zv,{info:he,agentLabel:te.label,onRefresh:I,onClose:()=>Fr(!1)}),os&&_.jsx(Yv,{agent:Km(q,S,M),onClose:()=>Br(!1)}),lr==="project"&&_.jsx(Qh,{connection:s,title:"Proyecto nuevo",confirmLabel:"Abrir aca",confirmTitle:ae=>`Abrir una pestana del agente en ${ae}`,onChoose:(ae,Se)=>{Pt(null),x({cwd:Se})},onClose:()=>Pt(null)}),ze&&_.jsx(Vy,{status:ce.status,agents:S,indexReady:y.state==="ready",problem:ce.problem,covered:lr==="vault",onMeasure:ce.measure,onSetEnabled:ce.setEnabled,onChangeDir:()=>Pt("vault"),onReveal:ce.reveal,onDismissProblem:ce.dismissProblem,onClose:()=>ot(!1)}),lr==="vault"&&_.jsx(Qh,{connection:s,title:"Carpeta de la copia propia",confirmLabel:"Usar esta carpeta",confirmTitle:ae=>`Mudar la copia propia a ${ae}. La carpeta de ahora queda intacta`,onChoose:ae=>{ce.chooseDir(ae),Pt(null)},onClose:()=>Pt(null)})]})}const cf=document.getElementById("root");if(cf===null)throw new Error("Falta el contenedor #root.");Jp.createRoot(cf).render(_.jsx(tS,{}));export{zp as g};