agent-workbench 0.5.4 → 0.6.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,139 +0,0 @@
1
- var O_=Object.defineProperty;var B_=(n,s,i)=>s in n?O_(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i;var Mt=(n,s,i)=>B_(n,typeof s!="symbol"?s+"":s,i);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const _ of document.querySelectorAll('link[rel="modulepreload"]'))u(_);new MutationObserver(_=>{for(const R of _)if(R.type==="childList")for(const x of R.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&u(x)}).observe(document,{childList:!0,subtree:!0});function i(_){const R={};return _.integrity&&(R.integrity=_.integrity),_.referrerPolicy&&(R.referrerPolicy=_.referrerPolicy),_.crossOrigin==="use-credentials"?R.credentials="include":_.crossOrigin==="anonymous"?R.credentials="omit":R.credentials="same-origin",R}function u(_){if(_.ep)return;_.ep=!0;const R=i(_);fetch(_.href,R)}})();function F_(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var gc={exports:{}},$i={},_c={exports:{}},lt={};/**
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 Bd;function H_(){if(Bd)return lt;Bd=1;var n=Symbol.for("react.element"),s=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),x=Symbol.for("react.context"),r=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),h=Symbol.iterator;function y(H){return H===null||typeof H!="object"?null:(H=h&&H[h]||H["@@iterator"],typeof H=="function"?H:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,f={};function a(H,K,te){this.props=H,this.context=K,this.refs=f,this.updater=te||S}a.prototype.isReactComponent={},a.prototype.setState=function(H,K){if(typeof H!="object"&&typeof H!="function"&&H!=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,H,K,"setState")},a.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function m(){}m.prototype=a.prototype;function p(H,K,te){this.props=H,this.context=K,this.refs=f,this.updater=te||S}var d=p.prototype=new m;d.constructor=p,E(d,a.prototype),d.isPureReactComponent=!0;var k=Array.isArray,I=Object.prototype.hasOwnProperty,L={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function b(H,K,te){var re,ae={},ue=null,G=null;if(K!=null)for(re in K.ref!==void 0&&(G=K.ref),K.key!==void 0&&(ue=""+K.key),K)I.call(K,re)&&!M.hasOwnProperty(re)&&(ae[re]=K[re]);var W=arguments.length-2;if(W===1)ae.children=te;else if(1<W){for(var J=Array(W),Z=0;Z<W;Z++)J[Z]=arguments[Z+2];ae.children=J}if(H&&H.defaultProps)for(re in W=H.defaultProps,W)ae[re]===void 0&&(ae[re]=W[re]);return{$$typeof:n,type:H,key:ue,ref:G,props:ae,_owner:L.current}}function T(H,K){return{$$typeof:n,type:H.type,key:K,ref:H.ref,props:H.props,_owner:H._owner}}function N(H){return typeof H=="object"&&H!==null&&H.$$typeof===n}function O(H){var K={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(te){return K[te]})}var B=/\/+/g;function F(H,K){return typeof H=="object"&&H!==null&&H.key!=null?O(""+H.key):K.toString(36)}function U(H,K,te,re,ae){var ue=typeof H;(ue==="undefined"||ue==="boolean")&&(H=null);var G=!1;if(H===null)G=!0;else switch(ue){case"string":case"number":G=!0;break;case"object":switch(H.$$typeof){case n:case s:G=!0}}if(G)return G=H,ae=ae(G),H=re===""?"."+F(G,0):re,k(ae)?(te="",H!=null&&(te=H.replace(B,"$&/")+"/"),U(ae,K,te,"",function(Z){return Z})):ae!=null&&(N(ae)&&(ae=T(ae,te+(!ae.key||G&&G.key===ae.key?"":(""+ae.key).replace(B,"$&/")+"/")+H)),K.push(ae)),1;if(G=0,re=re===""?".":re+":",k(H))for(var W=0;W<H.length;W++){ue=H[W];var J=re+F(ue,W);G+=U(ue,K,te,J,ae)}else if(J=y(H),typeof J=="function")for(H=J.call(H),W=0;!(ue=H.next()).done;)ue=ue.value,J=re+F(ue,W++),G+=U(ue,K,te,J,ae);else if(ue==="object")throw K=String(H),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.");return G}function V(H,K,te){if(H==null)return H;var re=[],ae=0;return U(H,re,"","",function(ue){return K.call(te,ue,ae++)}),re}function X(H){if(H._status===-1){var K=H._result;K=K(),K.then(function(te){(H._status===0||H._status===-1)&&(H._status=1,H._result=te)},function(te){(H._status===0||H._status===-1)&&(H._status=2,H._result=te)}),H._status===-1&&(H._status=0,H._result=K)}if(H._status===1)return H._result.default;throw H._result}var Y={current:null},q={transition:null},D={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:q,ReactCurrentOwner:L};function $(){throw Error("act(...) is not supported in production builds of React.")}return lt.Children={map:V,forEach:function(H,K,te){V(H,function(){K.apply(this,arguments)},te)},count:function(H){var K=0;return V(H,function(){K++}),K},toArray:function(H){return V(H,function(K){return K})||[]},only:function(H){if(!N(H))throw Error("React.Children.only expected to receive a single React element child.");return H}},lt.Component=a,lt.Fragment=i,lt.Profiler=_,lt.PureComponent=p,lt.StrictMode=u,lt.Suspense=c,lt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,lt.act=$,lt.cloneElement=function(H,K,te){if(H==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+H+".");var re=E({},H.props),ae=H.key,ue=H.ref,G=H._owner;if(K!=null){if(K.ref!==void 0&&(ue=K.ref,G=L.current),K.key!==void 0&&(ae=""+K.key),H.type&&H.type.defaultProps)var W=H.type.defaultProps;for(J in K)I.call(K,J)&&!M.hasOwnProperty(J)&&(re[J]=K[J]===void 0&&W!==void 0?W[J]:K[J])}var J=arguments.length-2;if(J===1)re.children=te;else if(1<J){W=Array(J);for(var Z=0;Z<J;Z++)W[Z]=arguments[Z+2];re.children=W}return{$$typeof:n,type:H.type,key:ae,ref:ue,props:re,_owner:G}},lt.createContext=function(H){return H={$$typeof:x,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},H.Provider={$$typeof:R,_context:H},H.Consumer=H},lt.createElement=b,lt.createFactory=function(H){var K=b.bind(null,H);return K.type=H,K},lt.createRef=function(){return{current:null}},lt.forwardRef=function(H){return{$$typeof:r,render:H}},lt.isValidElement=N,lt.lazy=function(H){return{$$typeof:v,_payload:{_status:-1,_result:H},_init:X}},lt.memo=function(H,K){return{$$typeof:g,type:H,compare:K===void 0?null:K}},lt.startTransition=function(H){var K=q.transition;q.transition={};try{H()}finally{q.transition=K}},lt.unstable_act=$,lt.useCallback=function(H,K){return Y.current.useCallback(H,K)},lt.useContext=function(H){return Y.current.useContext(H)},lt.useDebugValue=function(){},lt.useDeferredValue=function(H){return Y.current.useDeferredValue(H)},lt.useEffect=function(H,K){return Y.current.useEffect(H,K)},lt.useId=function(){return Y.current.useId()},lt.useImperativeHandle=function(H,K,te){return Y.current.useImperativeHandle(H,K,te)},lt.useInsertionEffect=function(H,K){return Y.current.useInsertionEffect(H,K)},lt.useLayoutEffect=function(H,K){return Y.current.useLayoutEffect(H,K)},lt.useMemo=function(H,K){return Y.current.useMemo(H,K)},lt.useReducer=function(H,K,te){return Y.current.useReducer(H,K,te)},lt.useRef=function(H){return Y.current.useRef(H)},lt.useState=function(H){return Y.current.useState(H)},lt.useSyncExternalStore=function(H,K,te){return Y.current.useSyncExternalStore(H,K,te)},lt.useTransition=function(){return Y.current.useTransition()},lt.version="18.3.1",lt}var Fd;function mu(){return Fd||(Fd=1,_c.exports=H_()),_c.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 Hd;function $_(){if(Hd)return $i;Hd=1;var n=mu(),s=Symbol.for("react.element"),i=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,_=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,R={key:!0,ref:!0,__self:!0,__source:!0};function x(r,c,g){var v,h={},y=null,S=null;g!==void 0&&(y=""+g),c.key!==void 0&&(y=""+c.key),c.ref!==void 0&&(S=c.ref);for(v in c)u.call(c,v)&&!R.hasOwnProperty(v)&&(h[v]=c[v]);if(r&&r.defaultProps)for(v in c=r.defaultProps,c)h[v]===void 0&&(h[v]=c[v]);return{$$typeof:s,type:r,key:y,ref:S,props:h,_owner:_.current}}return $i.Fragment=i,$i.jsx=x,$i.jsxs=x,$i}var $d;function U_(){return $d||($d=1,gc.exports=$_()),gc.exports}var l=U_(),_l={},vc={exports:{}},cn={},yc={exports:{}},wc={};/**
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 Ud;function W_(){return Ud||(Ud=1,(function(n){function s(q,D){var $=q.length;q.push(D);e:for(;0<$;){var H=$-1>>>1,K=q[H];if(0<_(K,D))q[H]=D,q[$]=K,$=H;else break e}}function i(q){return q.length===0?null:q[0]}function u(q){if(q.length===0)return null;var D=q[0],$=q.pop();if($!==D){q[0]=$;e:for(var H=0,K=q.length,te=K>>>1;H<te;){var re=2*(H+1)-1,ae=q[re],ue=re+1,G=q[ue];if(0>_(ae,$))ue<K&&0>_(G,ae)?(q[H]=G,q[ue]=$,H=ue):(q[H]=ae,q[re]=$,H=re);else if(ue<K&&0>_(G,$))q[H]=G,q[ue]=$,H=ue;else break e}}return D}function _(q,D){var $=q.sortIndex-D.sortIndex;return $!==0?$:q.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var R=performance;n.unstable_now=function(){return R.now()}}else{var x=Date,r=x.now();n.unstable_now=function(){return x.now()-r}}var c=[],g=[],v=1,h=null,y=3,S=!1,E=!1,f=!1,a=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(q){for(var D=i(g);D!==null;){if(D.callback===null)u(g);else if(D.startTime<=q)u(g),D.sortIndex=D.expirationTime,s(c,D);else break;D=i(g)}}function k(q){if(f=!1,d(q),!E)if(i(c)!==null)E=!0,X(I);else{var D=i(g);D!==null&&Y(k,D.startTime-q)}}function I(q,D){E=!1,f&&(f=!1,m(b),b=-1),S=!0;var $=y;try{for(d(D),h=i(c);h!==null&&(!(h.expirationTime>D)||q&&!O());){var H=h.callback;if(typeof H=="function"){h.callback=null,y=h.priorityLevel;var K=H(h.expirationTime<=D);D=n.unstable_now(),typeof K=="function"?h.callback=K:h===i(c)&&u(c),d(D)}else u(c);h=i(c)}if(h!==null)var te=!0;else{var re=i(g);re!==null&&Y(k,re.startTime-D),te=!1}return te}finally{h=null,y=$,S=!1}}var L=!1,M=null,b=-1,T=5,N=-1;function O(){return!(n.unstable_now()-N<T)}function B(){if(M!==null){var q=n.unstable_now();N=q;var D=!0;try{D=M(!0,q)}finally{D?F():(L=!1,M=null)}}else L=!1}var F;if(typeof p=="function")F=function(){p(B)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,V=U.port2;U.port1.onmessage=B,F=function(){V.postMessage(null)}}else F=function(){a(B,0)};function X(q){M=q,L||(L=!0,F())}function Y(q,D){b=a(function(){q(n.unstable_now())},D)}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(q){q.callback=null},n.unstable_continueExecution=function(){E||S||(E=!0,X(I))},n.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<q?Math.floor(1e3/q):5},n.unstable_getCurrentPriorityLevel=function(){return y},n.unstable_getFirstCallbackNode=function(){return i(c)},n.unstable_next=function(q){switch(y){case 1:case 2:case 3:var D=3;break;default:D=y}var $=y;y=D;try{return q()}finally{y=$}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(q,D){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var $=y;y=q;try{return D()}finally{y=$}},n.unstable_scheduleCallback=function(q,D,$){var H=n.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?H+$:H):$=H,q){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=$+K,q={id:v++,callback:D,priorityLevel:q,startTime:$,expirationTime:K,sortIndex:-1},$>H?(q.sortIndex=$,s(g,q),i(c)===null&&q===i(g)&&(f?(m(b),b=-1):f=!0,Y(k,$-H))):(q.sortIndex=K,s(c,q),E||S||(E=!0,X(I))),q},n.unstable_shouldYield=O,n.unstable_wrapCallback=function(q){var D=y;return function(){var $=y;y=D;try{return q.apply(this,arguments)}finally{y=$}}}})(wc)),wc}var Wd;function z_(){return Wd||(Wd=1,yc.exports=W_()),yc.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 zd;function V_(){if(zd)return cn;zd=1;var n=mu(),s=z_();function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o<arguments.length;o++)t+="&args[]="+encodeURIComponent(arguments[o]);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 u=new Set,_={};function R(e,t){x(e,t),x(e+"Capture",t)}function x(e,t){for(_[e]=t,e=0;e<t.length;e++)u.add(t[e])}var r=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,g=/^[: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]*$/,v={},h={};function y(e){return c.call(h,e)?!0:c.call(v,e)?!1:g.test(e)?h[e]=!0:(v[e]=!0,!1)}function S(e,t,o,w){if(o!==null&&o.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return w?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function E(e,t,o,w){if(t===null||typeof t>"u"||S(e,t,o,w))return!0;if(w)return!1;if(o!==null)switch(o.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,o,w,A,P,z){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=w,this.attributeNamespace=A,this.mustUseProperty=o,this.propertyName=e,this.type=t,this.sanitizeURL=P,this.removeEmptyString=z}var a={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){a[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];a[t]=new f(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){a[e]=new f(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){a[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){a[e]=new f(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){a[e]=new f(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){a[e]=new f(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){a[e]=new f(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){a[e]=new f(e,5,!1,e.toLowerCase(),null,!1,!1)});var m=/[\-:]([a-z])/g;function p(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(m,p);a[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(m,p);a[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(m,p);a[t]=new f(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){a[e]=new f(e,1,!1,e.toLowerCase(),null,!1,!1)}),a.xlinkHref=new f("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){a[e]=new f(e,1,!1,e.toLowerCase(),null,!0,!0)});function d(e,t,o,w){var A=a.hasOwnProperty(t)?a[t]:null;(A!==null?A.type!==0:w||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(E(t,o,A,w)&&(o=null),w||A===null?y(t)&&(o===null?e.removeAttribute(t):e.setAttribute(t,""+o)):A.mustUseProperty?e[A.propertyName]=o===null?A.type===3?!1:"":o:(t=A.attributeName,w=A.attributeNamespace,o===null?e.removeAttribute(t):(A=A.type,o=A===3||A===4&&o===!0?"":""+o,w?e.setAttributeNS(w,t,o):e.setAttribute(t,o))))}var k=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,I=Symbol.for("react.element"),L=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),O=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),q=Symbol.iterator;function D(e){return e===null||typeof e!="object"?null:(e=q&&e[q]||e["@@iterator"],typeof e=="function"?e:null)}var $=Object.assign,H;function K(e){if(H===void 0)try{throw Error()}catch(o){var t=o.stack.trim().match(/\n( *(at )?)/);H=t&&t[1]||""}return`
34
- `+H+e}var te=!1;function re(e,t){if(!e||te)return"";te=!0;var o=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(ce){var w=ce}Reflect.construct(e,[],t)}else{try{t.call()}catch(ce){w=ce}e.call(t.prototype)}else{try{throw Error()}catch(ce){w=ce}e()}}catch(ce){if(ce&&w&&typeof ce.stack=="string"){for(var A=ce.stack.split(`
35
- `),P=w.stack.split(`
36
- `),z=A.length-1,Q=P.length-1;1<=z&&0<=Q&&A[z]!==P[Q];)Q--;for(;1<=z&&0<=Q;z--,Q--)if(A[z]!==P[Q]){if(z!==1||Q!==1)do if(z--,Q--,0>Q||A[z]!==P[Q]){var ee=`
37
- `+A[z].replace(" at new "," at ");return e.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",e.displayName)),ee}while(1<=z&&0<=Q);break}}}finally{te=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?K(e):""}function ae(e){switch(e.tag){case 5:return K(e.type);case 16:return K("Lazy");case 13:return K("Suspense");case 19:return K("SuspenseList");case 0:case 2:case 15:return e=re(e.type,!1),e;case 11:return e=re(e.type.render,!1),e;case 1:return e=re(e.type,!0),e;default:return""}}function ue(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case M:return"Fragment";case L:return"Portal";case T:return"Profiler";case b:return"StrictMode";case F:return"Suspense";case U:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case O:return(e.displayName||"Context")+".Consumer";case N:return(e._context.displayName||"Context")+".Provider";case B:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case X:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}function G(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(t);case 8:return t===b?"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 W(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function J(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Z(e){var t=J(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),w=""+e[t];if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var A=o.get,P=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return A.call(this)},set:function(z){w=""+z,P.call(this,z)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return w},setValue:function(z){w=""+z},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function de(e){e._valueTracker||(e._valueTracker=Z(e))}function fe(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var o=t.getValue(),w="";return e&&(w=J(e)?e.checked?"true":"false":e.value),e=w,e!==o?(t.setValue(e),!0):!1}function se(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 Ee(e,t){var o=t.checked;return $({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function Me(e,t){var o=t.defaultValue==null?"":t.defaultValue,w=t.checked!=null?t.checked:t.defaultChecked;o=W(t.value!=null?t.value:o),e._wrapperState={initialChecked:w,initialValue:o,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Qe(e,t){t=t.checked,t!=null&&d(e,"checked",t,!1)}function Le(e,t){Qe(e,t);var o=W(t.value),w=t.type;if(o!=null)w==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(w==="submit"||w==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Re(e,t.type,o):t.hasOwnProperty("defaultValue")&&Re(e,t.type,W(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function pe(e,t,o){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var w=t.type;if(!(w!=="submit"&&w!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,o||t===e.value||(e.value=t),e.defaultValue=t}o=e.name,o!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,o!==""&&(e.name=o)}function Re(e,t,o){(t!=="number"||se(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var Ce=Array.isArray;function Te(e,t,o,w){if(e=e.options,t){t={};for(var A=0;A<o.length;A++)t["$"+o[A]]=!0;for(o=0;o<e.length;o++)A=t.hasOwnProperty("$"+e[o].value),e[o].selected!==A&&(e[o].selected=A),A&&w&&(e[o].defaultSelected=!0)}else{for(o=""+W(o),t=null,A=0;A<e.length;A++){if(e[A].value===o){e[A].selected=!0,w&&(e[A].defaultSelected=!0);return}t!==null||e[A].disabled||(t=e[A])}t!==null&&(t.selected=!0)}}function Pe(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(i(91));return $({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function xe(e,t){var o=t.value;if(o==null){if(o=t.children,t=t.defaultValue,o!=null){if(t!=null)throw Error(i(92));if(Ce(o)){if(1<o.length)throw Error(i(93));o=o[0]}t=o}t==null&&(t=""),o=t}e._wrapperState={initialValue:W(o)}}function Ie(e,t){var o=W(t.value),w=W(t.defaultValue);o!=null&&(o=""+o,o!==e.value&&(e.value=o),t.defaultValue==null&&e.defaultValue!==o&&(e.defaultValue=o)),w!=null&&(e.defaultValue=""+w)}function et(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ot(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 Ze(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ot(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ht,tt=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,o,w,A){MSApp.execUnsafeLocalFunction(function(){return e(t,o,w,A)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ht=ht||document.createElement("div"),ht.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ht.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function He(e,t){if(t){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=t;return}}e.textContent=t}var nt={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},Ve=["Webkit","ms","Moz","O"];Object.keys(nt).forEach(function(e){Ve.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),nt[t]=nt[e]})});function at(e,t,o){return t==null||typeof t=="boolean"||t===""?"":o||typeof t!="number"||t===0||nt.hasOwnProperty(e)&&nt[e]?(""+t).trim():t+"px"}function st(e,t){e=e.style;for(var o in t)if(t.hasOwnProperty(o)){var w=o.indexOf("--")===0,A=at(o,t[o],w);o==="float"&&(o="cssFloat"),w?e.setProperty(o,A):e[o]=A}}var ke=$({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ke(e,t){if(t){if(ke[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!="object")throw Error(i(62))}}function he(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 me=null;function Ae(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pt=null,Ne=null,qe=null;function ct(e){if(e=Ei(e)){if(typeof pt!="function")throw Error(i(280));var t=e.stateNode;t&&(t=No(t),pt(e.stateNode,e.type,t))}}function At(e){Ne?qe?qe.push(e):qe=[e]:Ne=e}function Tt(){if(Ne){var e=Ne,t=qe;if(qe=Ne=null,ct(e),t)for(e=0;e<t.length;e++)ct(t[e])}}function Cn(e,t){return e(t)}function Yn(){}var dn=!1;function ur(e,t,o){if(dn)return e(t,o);dn=!0;try{return Cn(e,t,o)}finally{dn=!1,(Ne!==null||qe!==null)&&(Yn(),Tt())}}function Xn(e,t){var o=e.stateNode;if(o===null)return null;var w=No(o);if(w===null)return null;o=w[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":(w=!w.disabled)||(e=e.type,w=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!w;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(i(231,t,typeof o));return o}var fs=!1;if(r)try{var Jt={};Object.defineProperty(Jt,"passive",{get:function(){fs=!0}}),window.addEventListener("test",Jt,Jt),window.removeEventListener("test",Jt,Jt)}catch{fs=!1}function $s(e,t,o,w,A,P,z,Q,ee){var ce=Array.prototype.slice.call(arguments,3);try{t.apply(o,ce)}catch(ve){this.onError(ve)}}var ge=!1,Ue=null,rt=!1,_t=null,xt={onError:function(e){ge=!0,Ue=e}};function xn(e,t,o,w,A,P,z,Q,ee){ge=!1,Ue=null,$s.apply(xt,arguments)}function ps(e,t,o,w,A,P,z,Q,ee){if(xn.apply(this,arguments),ge){if(ge){var ce=Ue;ge=!1,Ue=null}else throw Error(i(198));rt||(rt=!0,_t=ce)}}function Qn(e){var t=e,o=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(o=t.return),e=t.return;while(e)}return t.tag===3?o:null}function si(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 no(e){if(Qn(e)!==e)throw Error(i(188))}function $l(e){var t=e.alternate;if(!t){if(t=Qn(e),t===null)throw Error(i(188));return t!==e?null:e}for(var o=e,w=t;;){var A=o.return;if(A===null)break;var P=A.alternate;if(P===null){if(w=A.return,w!==null){o=w;continue}break}if(A.child===P.child){for(P=A.child;P;){if(P===o)return no(A),e;if(P===w)return no(A),t;P=P.sibling}throw Error(i(188))}if(o.return!==w.return)o=A,w=P;else{for(var z=!1,Q=A.child;Q;){if(Q===o){z=!0,o=A,w=P;break}if(Q===w){z=!0,w=A,o=P;break}Q=Q.sibling}if(!z){for(Q=P.child;Q;){if(Q===o){z=!0,o=P,w=A;break}if(Q===w){z=!0,w=P,o=A;break}Q=Q.sibling}if(!z)throw Error(i(189))}}if(o.alternate!==w)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?e:t}function so(e){return e=$l(e),e!==null?ri(e):null}function ri(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ri(e);if(t!==null)return t;e=e.sibling}return null}var ro=s.unstable_scheduleCallback,io=s.unstable_cancelCallback,Ul=s.unstable_shouldYield,Wl=s.unstable_requestPaint,wt=s.unstable_now,ii=s.unstable_getCurrentPriorityLevel,oi=s.unstable_ImmediatePriority,ms=s.unstable_UserBlockingPriority,Jn=s.unstable_NormalPriority,oo=s.unstable_LowPriority,li=s.unstable_IdlePriority,hr=null,nn=null;function ai(e){if(nn&&typeof nn.onCommitFiberRoot=="function")try{nn.onCommitFiberRoot(hr,e,void 0,(e.current.flags&128)===128)}catch{}}var Ot=Math.clz32?Math.clz32:pr,dr=Math.log,fr=Math.LN2;function pr(e){return e>>>=0,e===0?32:31-(dr(e)/fr|0)|0}var kn=64,gs=4194304;function Vt(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 mr(e,t){var o=e.pendingLanes;if(o===0)return 0;var w=0,A=e.suspendedLanes,P=e.pingedLanes,z=o&268435455;if(z!==0){var Q=z&~A;Q!==0?w=Vt(Q):(P&=z,P!==0&&(w=Vt(P)))}else z=o&~A,z!==0?w=Vt(z):P!==0&&(w=Vt(P));if(w===0)return 0;if(t!==0&&t!==w&&(t&A)===0&&(A=w&-w,P=t&-t,A>=P||A===16&&(P&4194240)!==0))return t;if((w&4)!==0&&(w|=o&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=w;0<t;)o=31-Ot(t),A=1<<o,w|=e[o],t&=~A;return w}function lo(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 _s(e,t){for(var o=e.suspendedLanes,w=e.pingedLanes,A=e.expirationTimes,P=e.pendingLanes;0<P;){var z=31-Ot(P),Q=1<<z,ee=A[z];ee===-1?((Q&o)===0||(Q&w)!==0)&&(A[z]=lo(Q,t)):ee<=t&&(e.expiredLanes|=Q),P&=~Q}}function vs(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function ao(){var e=kn;return kn<<=1,(kn&4194240)===0&&(kn=64),e}function Bt(e){for(var t=[],o=0;31>o;o++)t.push(e);return t}function Zn(e,t,o){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ot(t),e[t]=o}function co(e,t){var o=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 w=e.eventTimes;for(e=e.expirationTimes;0<o;){var A=31-Ot(o),P=1<<A;t[A]=0,w[A]=-1,e[A]=-1,o&=~P}}function ci(e,t){var o=e.entangledLanes|=t;for(e=e.entanglements;o;){var w=31-Ot(o),A=1<<w;A&t|e[w]&t&&(e[w]|=t),o&=~A}}var dt=0;function uo(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var ui,hi,gr,ho,di,_r=!1,Us=[],En=null,On=null,Bn=null,ys=new Map,es=new Map,Ln=[],fi="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 vr(e,t){switch(e){case"focusin":case"focusout":En=null;break;case"dragenter":case"dragleave":On=null;break;case"mouseover":case"mouseout":Bn=null;break;case"pointerover":case"pointerout":ys.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":es.delete(t.pointerId)}}function Ws(e,t,o,w,A,P){return e===null||e.nativeEvent!==P?(e={blockedOn:t,domEventName:o,eventSystemFlags:w,nativeEvent:P,targetContainers:[A]},t!==null&&(t=Ei(t),t!==null&&hi(t)),e):(e.eventSystemFlags|=w,t=e.targetContainers,A!==null&&t.indexOf(A)===-1&&t.push(A),e)}function zl(e,t,o,w,A){switch(t){case"focusin":return En=Ws(En,e,t,o,w,A),!0;case"dragenter":return On=Ws(On,e,t,o,w,A),!0;case"mouseover":return Bn=Ws(Bn,e,t,o,w,A),!0;case"pointerover":var P=A.pointerId;return ys.set(P,Ws(ys.get(P)||null,e,t,o,w,A)),!0;case"gotpointercapture":return P=A.pointerId,es.set(P,Ws(es.get(P)||null,e,t,o,w,A)),!0}return!1}function fo(e){var t=Xs(e.target);if(t!==null){var o=Qn(t);if(o!==null){if(t=o.tag,t===13){if(t=si(o),t!==null){e.blockedOn=t,di(e.priority,function(){gr(o)});return}}else if(t===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var o=mi(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(o===null){o=e.nativeEvent;var w=new o.constructor(o.type,o);me=w,o.target.dispatchEvent(w),me=null}else return t=Ei(o),t!==null&&hi(t),e.blockedOn=o,!1;t.shift()}return!0}function Tn(e,t,o){zs(e)&&o.delete(t)}function Vl(){_r=!1,En!==null&&zs(En)&&(En=null),On!==null&&zs(On)&&(On=null),Bn!==null&&zs(Bn)&&(Bn=null),ys.forEach(Tn),es.forEach(Tn)}function Rn(e,t){e.blockedOn===t&&(e.blockedOn=null,_r||(_r=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Vl)))}function ws(e){function t(A){return Rn(A,e)}if(0<Us.length){Rn(Us[0],e);for(var o=1;o<Us.length;o++){var w=Us[o];w.blockedOn===e&&(w.blockedOn=null)}}for(En!==null&&Rn(En,e),On!==null&&Rn(On,e),Bn!==null&&Rn(Bn,e),ys.forEach(t),es.forEach(t),o=0;o<Ln.length;o++)w=Ln[o],w.blockedOn===e&&(w.blockedOn=null);for(;0<Ln.length&&(o=Ln[0],o.blockedOn===null);)fo(o),o.blockedOn===null&&Ln.shift()}var ts=k.ReactCurrentBatchConfig,Vs=!0;function ql(e,t,o,w){var A=dt,P=ts.transition;ts.transition=null;try{dt=1,pi(e,t,o,w)}finally{dt=A,ts.transition=P}}function Kl(e,t,o,w){var A=dt,P=ts.transition;ts.transition=null;try{dt=4,pi(e,t,o,w)}finally{dt=A,ts.transition=P}}function pi(e,t,o,w){if(Vs){var A=mi(e,t,o,w);if(A===null)oa(e,t,w,ns,o),vr(e,w);else if(zl(A,e,t,o,w))w.stopPropagation();else if(vr(e,w),t&4&&-1<fi.indexOf(e)){for(;A!==null;){var P=Ei(A);if(P!==null&&ui(P),P=mi(e,t,o,w),P===null&&oa(e,t,w,ns,o),P===A)break;A=P}A!==null&&w.stopPropagation()}else oa(e,t,w,null,o)}}var ns=null;function mi(e,t,o,w){if(ns=null,e=Ae(w),e=Xs(e),e!==null)if(t=Qn(e),t===null)e=null;else if(o=t.tag,o===13){if(e=si(t),e!==null)return e;e=null}else if(o===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ns=e,null}function po(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(ii()){case oi:return 1;case ms:return 4;case Jn:case oo:return 16;case li:return 536870912;default:return 16}default:return 16}}var Fn=null,Hn=null,yr=null;function wr(){if(yr)return yr;var e,t=Hn,o=t.length,w,A="value"in Fn?Fn.value:Fn.textContent,P=A.length;for(e=0;e<o&&t[e]===A[e];e++);var z=o-e;for(w=1;w<=z&&t[o-w]===A[P-w];w++);return yr=A.slice(e,1<w?1-w:void 0)}function br(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 qs(){return!0}function mo(){return!1}function Zt(e){function t(o,w,A,P,z){this._reactName=o,this._targetInst=A,this.type=w,this.nativeEvent=P,this.target=z,this.currentTarget=null;for(var Q in e)e.hasOwnProperty(Q)&&(o=e[Q],this[Q]=o?o(P):P[Q]);return this.isDefaultPrevented=(P.defaultPrevented!=null?P.defaultPrevented:P.returnValue===!1)?qs:mo,this.isPropagationStopped=mo,this}return $(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=qs)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=qs)},persist:function(){},isPersistent:qs}),t}var bs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sr=Zt(bs),Ks=$({},bs,{view:0,detail:0}),Gl=Zt(Ks),Gs,Cr,ss,Ys=$({},Ks,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gn,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!==ss&&(ss&&e.type==="mousemove"?(Gs=e.screenX-ss.screenX,Cr=e.screenY-ss.screenY):Cr=Gs=0,ss=e),Gs)},movementY:function(e){return"movementY"in e?e.movementY:Cr}}),go=Zt(Ys),_o=$({},Ys,{dataTransfer:0}),vo=Zt(_o),yo=$({},Ks,{relatedTarget:0}),xr=Zt(yo),wo=$({},bs,{animationName:0,elapsedTime:0,pseudoElement:0}),bo=Zt(wo),Yl=$({},bs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),So=Zt(Yl),Co=$({},bs,{data:0}),gi=Zt(Co),xo={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ie={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"},ye={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function it(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ye[e])?!!t[e]:!1}function gn(){return it}var rs=$({},Ks,{key:function(e){if(e.key){var t=xo[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=br(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ie[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gn,charCode:function(e){return e.type==="keypress"?br(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?br(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),xg=Zt(rs),kg=$({},Ys,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ru=Zt(kg),Eg=$({},Ks,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gn}),Lg=Zt(Eg),Tg=$({},bs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Rg=Zt(Tg),Mg=$({},Ys,{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}),Ag=Zt(Mg),Ng=[9,13,27,32],Xl=r&&"CompositionEvent"in window,_i=null;r&&"documentMode"in document&&(_i=document.documentMode);var Dg=r&&"TextEvent"in window&&!_i,Mu=r&&(!Xl||_i&&8<_i&&11>=_i),Au=" ",Nu=!1;function Du(e,t){switch(e){case"keyup":return Ng.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Iu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var kr=!1;function Ig(e,t){switch(e){case"compositionend":return Iu(t);case"keypress":return t.which!==32?null:(Nu=!0,Au);case"textInput":return e=t.data,e===Au&&Nu?null:e;default:return null}}function jg(e,t){if(kr)return e==="compositionend"||!Xl&&Du(e,t)?(e=wr(),yr=Hn=Fn=null,kr=!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 Mu&&t.locale!=="ko"?null:t.data;default:return null}}var Pg={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 ju(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Pg[e.type]:t==="textarea"}function Pu(e,t,o,w){At(w),t=Ro(t,"onChange"),0<t.length&&(o=new Sr("onChange","change",null,o,w),e.push({event:o,listeners:t}))}var vi=null,yi=null;function Og(e){eh(e,0)}function ko(e){var t=Mr(e);if(fe(t))return e}function Bg(e,t){if(e==="change")return t}var Ou=!1;if(r){var Ql;if(r){var Jl="oninput"in document;if(!Jl){var Bu=document.createElement("div");Bu.setAttribute("oninput","return;"),Jl=typeof Bu.oninput=="function"}Ql=Jl}else Ql=!1;Ou=Ql&&(!document.documentMode||9<document.documentMode)}function Fu(){vi&&(vi.detachEvent("onpropertychange",Hu),yi=vi=null)}function Hu(e){if(e.propertyName==="value"&&ko(yi)){var t=[];Pu(t,yi,e,Ae(e)),ur(Og,t)}}function Fg(e,t,o){e==="focusin"?(Fu(),vi=t,yi=o,vi.attachEvent("onpropertychange",Hu)):e==="focusout"&&Fu()}function Hg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ko(yi)}function $g(e,t){if(e==="click")return ko(t)}function Ug(e,t){if(e==="input"||e==="change")return ko(t)}function Wg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Mn=typeof Object.is=="function"?Object.is:Wg;function wi(e,t){if(Mn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var o=Object.keys(e),w=Object.keys(t);if(o.length!==w.length)return!1;for(w=0;w<o.length;w++){var A=o[w];if(!c.call(t,A)||!Mn(e[A],t[A]))return!1}return!0}function $u(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Uu(e,t){var o=$u(e);e=0;for(var w;o;){if(o.nodeType===3){if(w=e+o.textContent.length,e<=t&&w>=t)return{node:o,offset:t-e};e=w}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=$u(o)}}function Wu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zu(){for(var e=window,t=se();t instanceof e.HTMLIFrameElement;){try{var o=typeof t.contentWindow.location.href=="string"}catch{o=!1}if(o)e=t.contentWindow;else break;t=se(e.document)}return t}function Zl(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 zg(e){var t=zu(),o=e.focusedElem,w=e.selectionRange;if(t!==o&&o&&o.ownerDocument&&Wu(o.ownerDocument.documentElement,o)){if(w!==null&&Zl(o)){if(t=w.start,e=w.end,e===void 0&&(e=t),"selectionStart"in o)o.selectionStart=t,o.selectionEnd=Math.min(e,o.value.length);else if(e=(t=o.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var A=o.textContent.length,P=Math.min(w.start,A);w=w.end===void 0?P:Math.min(w.end,A),!e.extend&&P>w&&(A=w,w=P,P=A),A=Uu(o,P);var z=Uu(o,w);A&&z&&(e.rangeCount!==1||e.anchorNode!==A.node||e.anchorOffset!==A.offset||e.focusNode!==z.node||e.focusOffset!==z.offset)&&(t=t.createRange(),t.setStart(A.node,A.offset),e.removeAllRanges(),P>w?(e.addRange(t),e.extend(z.node,z.offset)):(t.setEnd(z.node,z.offset),e.addRange(t)))}}for(t=[],e=o;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<t.length;o++)e=t[o],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Vg=r&&"documentMode"in document&&11>=document.documentMode,Er=null,ea=null,bi=null,ta=!1;function Vu(e,t,o){var w=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;ta||Er==null||Er!==se(w)||(w=Er,"selectionStart"in w&&Zl(w)?w={start:w.selectionStart,end:w.selectionEnd}:(w=(w.ownerDocument&&w.ownerDocument.defaultView||window).getSelection(),w={anchorNode:w.anchorNode,anchorOffset:w.anchorOffset,focusNode:w.focusNode,focusOffset:w.focusOffset}),bi&&wi(bi,w)||(bi=w,w=Ro(ea,"onSelect"),0<w.length&&(t=new Sr("onSelect","select",null,t,o),e.push({event:t,listeners:w}),t.target=Er)))}function Eo(e,t){var o={};return o[e.toLowerCase()]=t.toLowerCase(),o["Webkit"+e]="webkit"+t,o["Moz"+e]="moz"+t,o}var Lr={animationend:Eo("Animation","AnimationEnd"),animationiteration:Eo("Animation","AnimationIteration"),animationstart:Eo("Animation","AnimationStart"),transitionend:Eo("Transition","TransitionEnd")},na={},qu={};r&&(qu=document.createElement("div").style,"AnimationEvent"in window||(delete Lr.animationend.animation,delete Lr.animationiteration.animation,delete Lr.animationstart.animation),"TransitionEvent"in window||delete Lr.transitionend.transition);function Lo(e){if(na[e])return na[e];if(!Lr[e])return e;var t=Lr[e],o;for(o in t)if(t.hasOwnProperty(o)&&o in qu)return na[e]=t[o];return e}var Ku=Lo("animationend"),Gu=Lo("animationiteration"),Yu=Lo("animationstart"),Xu=Lo("transitionend"),Qu=new Map,Ju="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 Ss(e,t){Qu.set(e,t),R(t,[e])}for(var sa=0;sa<Ju.length;sa++){var ra=Ju[sa],qg=ra.toLowerCase(),Kg=ra[0].toUpperCase()+ra.slice(1);Ss(qg,"on"+Kg)}Ss(Ku,"onAnimationEnd"),Ss(Gu,"onAnimationIteration"),Ss(Yu,"onAnimationStart"),Ss("dblclick","onDoubleClick"),Ss("focusin","onFocus"),Ss("focusout","onBlur"),Ss(Xu,"onTransitionEnd"),x("onMouseEnter",["mouseout","mouseover"]),x("onMouseLeave",["mouseout","mouseover"]),x("onPointerEnter",["pointerout","pointerover"]),x("onPointerLeave",["pointerout","pointerover"]),R("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),R("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),R("onBeforeInput",["compositionend","keypress","textInput","paste"]),R("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),R("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),R("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Si="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(" "),Gg=new Set("cancel close invalid load scroll toggle".split(" ").concat(Si));function Zu(e,t,o){var w=e.type||"unknown-event";e.currentTarget=o,ps(w,t,void 0,e),e.currentTarget=null}function eh(e,t){t=(t&4)!==0;for(var o=0;o<e.length;o++){var w=e[o],A=w.event;w=w.listeners;e:{var P=void 0;if(t)for(var z=w.length-1;0<=z;z--){var Q=w[z],ee=Q.instance,ce=Q.currentTarget;if(Q=Q.listener,ee!==P&&A.isPropagationStopped())break e;Zu(A,Q,ce),P=ee}else for(z=0;z<w.length;z++){if(Q=w[z],ee=Q.instance,ce=Q.currentTarget,Q=Q.listener,ee!==P&&A.isPropagationStopped())break e;Zu(A,Q,ce),P=ee}}}if(rt)throw e=_t,rt=!1,_t=null,e}function bt(e,t){var o=t[da];o===void 0&&(o=t[da]=new Set);var w=e+"__bubble";o.has(w)||(th(t,e,2,!1),o.add(w))}function ia(e,t,o){var w=0;t&&(w|=4),th(o,e,w,t)}var To="_reactListening"+Math.random().toString(36).slice(2);function Ci(e){if(!e[To]){e[To]=!0,u.forEach(function(o){o!=="selectionchange"&&(Gg.has(o)||ia(o,!1,e),ia(o,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[To]||(t[To]=!0,ia("selectionchange",!1,t))}}function th(e,t,o,w){switch(po(t)){case 1:var A=ql;break;case 4:A=Kl;break;default:A=pi}o=A.bind(null,t,o,e),A=void 0,!fs||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(A=!0),w?A!==void 0?e.addEventListener(t,o,{capture:!0,passive:A}):e.addEventListener(t,o,!0):A!==void 0?e.addEventListener(t,o,{passive:A}):e.addEventListener(t,o,!1)}function oa(e,t,o,w,A){var P=w;if((t&1)===0&&(t&2)===0&&w!==null)e:for(;;){if(w===null)return;var z=w.tag;if(z===3||z===4){var Q=w.stateNode.containerInfo;if(Q===A||Q.nodeType===8&&Q.parentNode===A)break;if(z===4)for(z=w.return;z!==null;){var ee=z.tag;if((ee===3||ee===4)&&(ee=z.stateNode.containerInfo,ee===A||ee.nodeType===8&&ee.parentNode===A))return;z=z.return}for(;Q!==null;){if(z=Xs(Q),z===null)return;if(ee=z.tag,ee===5||ee===6){w=P=z;continue e}Q=Q.parentNode}}w=w.return}ur(function(){var ce=P,ve=Ae(o),be=[];e:{var _e=Qu.get(e);if(_e!==void 0){var De=Sr,Be=e;switch(e){case"keypress":if(br(o)===0)break e;case"keydown":case"keyup":De=xg;break;case"focusin":Be="focus",De=xr;break;case"focusout":Be="blur",De=xr;break;case"beforeblur":case"afterblur":De=xr;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":De=go;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":De=vo;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":De=Lg;break;case Ku:case Gu:case Yu:De=bo;break;case Xu:De=Rg;break;case"scroll":De=Gl;break;case"wheel":De=Ag;break;case"copy":case"cut":case"paste":De=So;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":De=Ru}var $e=(t&4)!==0,Nt=!$e&&e==="scroll",oe=$e?_e!==null?_e+"Capture":null:_e;$e=[];for(var ne=ce,le;ne!==null;){le=ne;var Se=le.stateNode;if(le.tag===5&&Se!==null&&(le=Se,oe!==null&&(Se=Xn(ne,oe),Se!=null&&$e.push(xi(ne,Se,le)))),Nt)break;ne=ne.return}0<$e.length&&(_e=new De(_e,Be,null,o,ve),be.push({event:_e,listeners:$e}))}}if((t&7)===0){e:{if(_e=e==="mouseover"||e==="pointerover",De=e==="mouseout"||e==="pointerout",_e&&o!==me&&(Be=o.relatedTarget||o.fromElement)&&(Xs(Be)||Be[is]))break e;if((De||_e)&&(_e=ve.window===ve?ve:(_e=ve.ownerDocument)?_e.defaultView||_e.parentWindow:window,De?(Be=o.relatedTarget||o.toElement,De=ce,Be=Be?Xs(Be):null,Be!==null&&(Nt=Qn(Be),Be!==Nt||Be.tag!==5&&Be.tag!==6)&&(Be=null)):(De=null,Be=ce),De!==Be)){if($e=go,Se="onMouseLeave",oe="onMouseEnter",ne="mouse",(e==="pointerout"||e==="pointerover")&&($e=Ru,Se="onPointerLeave",oe="onPointerEnter",ne="pointer"),Nt=De==null?_e:Mr(De),le=Be==null?_e:Mr(Be),_e=new $e(Se,ne+"leave",De,o,ve),_e.target=Nt,_e.relatedTarget=le,Se=null,Xs(ve)===ce&&($e=new $e(oe,ne+"enter",Be,o,ve),$e.target=le,$e.relatedTarget=Nt,Se=$e),Nt=Se,De&&Be)t:{for($e=De,oe=Be,ne=0,le=$e;le;le=Tr(le))ne++;for(le=0,Se=oe;Se;Se=Tr(Se))le++;for(;0<ne-le;)$e=Tr($e),ne--;for(;0<le-ne;)oe=Tr(oe),le--;for(;ne--;){if($e===oe||oe!==null&&$e===oe.alternate)break t;$e=Tr($e),oe=Tr(oe)}$e=null}else $e=null;De!==null&&nh(be,_e,De,$e,!1),Be!==null&&Nt!==null&&nh(be,Nt,Be,$e,!0)}}e:{if(_e=ce?Mr(ce):window,De=_e.nodeName&&_e.nodeName.toLowerCase(),De==="select"||De==="input"&&_e.type==="file")var We=Bg;else if(ju(_e))if(Ou)We=Ug;else{We=Hg;var Ge=Fg}else(De=_e.nodeName)&&De.toLowerCase()==="input"&&(_e.type==="checkbox"||_e.type==="radio")&&(We=$g);if(We&&(We=We(e,ce))){Pu(be,We,o,ve);break e}Ge&&Ge(e,_e,ce),e==="focusout"&&(Ge=_e._wrapperState)&&Ge.controlled&&_e.type==="number"&&Re(_e,"number",_e.value)}switch(Ge=ce?Mr(ce):window,e){case"focusin":(ju(Ge)||Ge.contentEditable==="true")&&(Er=Ge,ea=ce,bi=null);break;case"focusout":bi=ea=Er=null;break;case"mousedown":ta=!0;break;case"contextmenu":case"mouseup":case"dragend":ta=!1,Vu(be,o,ve);break;case"selectionchange":if(Vg)break;case"keydown":case"keyup":Vu(be,o,ve)}var Ye;if(Xl)e:{switch(e){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else kr?Du(e,o)&&(Xe="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(Xe="onCompositionStart");Xe&&(Mu&&o.locale!=="ko"&&(kr||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&kr&&(Ye=wr()):(Fn=ve,Hn="value"in Fn?Fn.value:Fn.textContent,kr=!0)),Ge=Ro(ce,Xe),0<Ge.length&&(Xe=new gi(Xe,e,null,o,ve),be.push({event:Xe,listeners:Ge}),Ye?Xe.data=Ye:(Ye=Iu(o),Ye!==null&&(Xe.data=Ye)))),(Ye=Dg?Ig(e,o):jg(e,o))&&(ce=Ro(ce,"onBeforeInput"),0<ce.length&&(ve=new gi("onBeforeInput","beforeinput",null,o,ve),be.push({event:ve,listeners:ce}),ve.data=Ye))}eh(be,t)})}function xi(e,t,o){return{instance:e,listener:t,currentTarget:o}}function Ro(e,t){for(var o=t+"Capture",w=[];e!==null;){var A=e,P=A.stateNode;A.tag===5&&P!==null&&(A=P,P=Xn(e,o),P!=null&&w.unshift(xi(e,P,A)),P=Xn(e,t),P!=null&&w.push(xi(e,P,A))),e=e.return}return w}function Tr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function nh(e,t,o,w,A){for(var P=t._reactName,z=[];o!==null&&o!==w;){var Q=o,ee=Q.alternate,ce=Q.stateNode;if(ee!==null&&ee===w)break;Q.tag===5&&ce!==null&&(Q=ce,A?(ee=Xn(o,P),ee!=null&&z.unshift(xi(o,ee,Q))):A||(ee=Xn(o,P),ee!=null&&z.push(xi(o,ee,Q)))),o=o.return}z.length!==0&&e.push({event:t,listeners:z})}var Yg=/\r\n?/g,Xg=/\u0000|\uFFFD/g;function sh(e){return(typeof e=="string"?e:""+e).replace(Yg,`
38
- `).replace(Xg,"")}function Mo(e,t,o){if(t=sh(t),sh(e)!==t&&o)throw Error(i(425))}function Ao(){}var la=null,aa=null;function ca(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 ua=typeof setTimeout=="function"?setTimeout:void 0,Qg=typeof clearTimeout=="function"?clearTimeout:void 0,rh=typeof Promise=="function"?Promise:void 0,Jg=typeof queueMicrotask=="function"?queueMicrotask:typeof rh<"u"?function(e){return rh.resolve(null).then(e).catch(Zg)}:ua;function Zg(e){setTimeout(function(){throw e})}function ha(e,t){var o=t,w=0;do{var A=o.nextSibling;if(e.removeChild(o),A&&A.nodeType===8)if(o=A.data,o==="/$"){if(w===0){e.removeChild(A),ws(t);return}w--}else o!=="$"&&o!=="$?"&&o!=="$!"||w++;o=A}while(o);ws(t)}function Cs(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 ih(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(t===0)return e;t--}else o==="/$"&&t++}e=e.previousSibling}return null}var Rr=Math.random().toString(36).slice(2),$n="__reactFiber$"+Rr,ki="__reactProps$"+Rr,is="__reactContainer$"+Rr,da="__reactEvents$"+Rr,e_="__reactListeners$"+Rr,t_="__reactHandles$"+Rr;function Xs(e){var t=e[$n];if(t)return t;for(var o=e.parentNode;o;){if(t=o[is]||o[$n]){if(o=t.alternate,t.child!==null||o!==null&&o.child!==null)for(e=ih(e);e!==null;){if(o=e[$n])return o;e=ih(e)}return t}e=o,o=e.parentNode}return null}function Ei(e){return e=e[$n]||e[is],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Mr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function No(e){return e[ki]||null}var fa=[],Ar=-1;function xs(e){return{current:e}}function St(e){0>Ar||(e.current=fa[Ar],fa[Ar]=null,Ar--)}function vt(e,t){Ar++,fa[Ar]=e.current,e.current=t}var ks={},qt=xs(ks),sn=xs(!1),Qs=ks;function Nr(e,t){var o=e.type.contextTypes;if(!o)return ks;var w=e.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===t)return w.__reactInternalMemoizedMaskedChildContext;var A={},P;for(P in o)A[P]=t[P];return w&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=A),A}function rn(e){return e=e.childContextTypes,e!=null}function Do(){St(sn),St(qt)}function oh(e,t,o){if(qt.current!==ks)throw Error(i(168));vt(qt,t),vt(sn,o)}function lh(e,t,o){var w=e.stateNode;if(t=t.childContextTypes,typeof w.getChildContext!="function")return o;w=w.getChildContext();for(var A in w)if(!(A in t))throw Error(i(108,G(e)||"Unknown",A));return $({},o,w)}function Io(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ks,Qs=qt.current,vt(qt,e),vt(sn,sn.current),!0}function ah(e,t,o){var w=e.stateNode;if(!w)throw Error(i(169));o?(e=lh(e,t,Qs),w.__reactInternalMemoizedMergedChildContext=e,St(sn),St(qt),vt(qt,e)):St(sn),vt(sn,o)}var os=null,jo=!1,pa=!1;function ch(e){os===null?os=[e]:os.push(e)}function n_(e){jo=!0,ch(e)}function Es(){if(!pa&&os!==null){pa=!0;var e=0,t=dt;try{var o=os;for(dt=1;e<o.length;e++){var w=o[e];do w=w(!0);while(w!==null)}os=null,jo=!1}catch(A){throw os!==null&&(os=os.slice(e+1)),ro(oi,Es),A}finally{dt=t,pa=!1}}return null}var Dr=[],Ir=0,Po=null,Oo=0,_n=[],vn=0,Js=null,ls=1,as="";function Zs(e,t){Dr[Ir++]=Oo,Dr[Ir++]=Po,Po=e,Oo=t}function uh(e,t,o){_n[vn++]=ls,_n[vn++]=as,_n[vn++]=Js,Js=e;var w=ls;e=as;var A=32-Ot(w)-1;w&=~(1<<A),o+=1;var P=32-Ot(t)+A;if(30<P){var z=A-A%5;P=(w&(1<<z)-1).toString(32),w>>=z,A-=z,ls=1<<32-Ot(t)+A|o<<A|w,as=P+e}else ls=1<<P|o<<A|w,as=e}function ma(e){e.return!==null&&(Zs(e,1),uh(e,1,0))}function ga(e){for(;e===Po;)Po=Dr[--Ir],Dr[Ir]=null,Oo=Dr[--Ir],Dr[Ir]=null;for(;e===Js;)Js=_n[--vn],_n[vn]=null,as=_n[--vn],_n[vn]=null,ls=_n[--vn],_n[vn]=null}var fn=null,pn=null,kt=!1,An=null;function hh(e,t){var o=Sn(5,null,null,0);o.elementType="DELETED",o.stateNode=t,o.return=e,t=e.deletions,t===null?(e.deletions=[o],e.flags|=16):t.push(o)}function dh(e,t){switch(e.tag){case 5:var o=e.type;return t=t.nodeType!==1||o.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,fn=e,pn=Cs(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,fn=e,pn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(o=Js!==null?{id:ls,overflow:as}:null,e.memoizedState={dehydrated:t,treeContext:o,retryLane:1073741824},o=Sn(18,null,null,0),o.stateNode=t,o.return=e,e.child=o,fn=e,pn=null,!0):!1;default:return!1}}function _a(e){return(e.mode&1)!==0&&(e.flags&128)===0}function va(e){if(kt){var t=pn;if(t){var o=t;if(!dh(e,t)){if(_a(e))throw Error(i(418));t=Cs(o.nextSibling);var w=fn;t&&dh(e,t)?hh(w,o):(e.flags=e.flags&-4097|2,kt=!1,fn=e)}}else{if(_a(e))throw Error(i(418));e.flags=e.flags&-4097|2,kt=!1,fn=e}}}function fh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;fn=e}function Bo(e){if(e!==fn)return!1;if(!kt)return fh(e),kt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ca(e.type,e.memoizedProps)),t&&(t=pn)){if(_a(e))throw ph(),Error(i(418));for(;t;)hh(e,t),t=Cs(t.nextSibling)}if(fh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var o=e.data;if(o==="/$"){if(t===0){pn=Cs(e.nextSibling);break e}t--}else o!=="$"&&o!=="$!"&&o!=="$?"||t++}e=e.nextSibling}pn=null}}else pn=fn?Cs(e.stateNode.nextSibling):null;return!0}function ph(){for(var e=pn;e;)e=Cs(e.nextSibling)}function jr(){pn=fn=null,kt=!1}function ya(e){An===null?An=[e]:An.push(e)}var s_=k.ReactCurrentBatchConfig;function Li(e,t,o){if(e=o.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(o._owner){if(o=o._owner,o){if(o.tag!==1)throw Error(i(309));var w=o.stateNode}if(!w)throw Error(i(147,e));var A=w,P=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===P?t.ref:(t=function(z){var Q=A.refs;z===null?delete Q[P]:Q[P]=z},t._stringRef=P,t)}if(typeof e!="string")throw Error(i(284));if(!o._owner)throw Error(i(290,e))}return e}function Fo(e,t){throw e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function mh(e){var t=e._init;return t(e._payload)}function gh(e){function t(oe,ne){if(e){var le=oe.deletions;le===null?(oe.deletions=[ne],oe.flags|=16):le.push(ne)}}function o(oe,ne){if(!e)return null;for(;ne!==null;)t(oe,ne),ne=ne.sibling;return null}function w(oe,ne){for(oe=new Map;ne!==null;)ne.key!==null?oe.set(ne.key,ne):oe.set(ne.index,ne),ne=ne.sibling;return oe}function A(oe,ne){return oe=Is(oe,ne),oe.index=0,oe.sibling=null,oe}function P(oe,ne,le){return oe.index=le,e?(le=oe.alternate,le!==null?(le=le.index,le<ne?(oe.flags|=2,ne):le):(oe.flags|=2,ne)):(oe.flags|=1048576,ne)}function z(oe){return e&&oe.alternate===null&&(oe.flags|=2),oe}function Q(oe,ne,le,Se){return ne===null||ne.tag!==6?(ne=uc(le,oe.mode,Se),ne.return=oe,ne):(ne=A(ne,le),ne.return=oe,ne)}function ee(oe,ne,le,Se){var We=le.type;return We===M?ve(oe,ne,le.props.children,Se,le.key):ne!==null&&(ne.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===X&&mh(We)===ne.type)?(Se=A(ne,le.props),Se.ref=Li(oe,ne,le),Se.return=oe,Se):(Se=cl(le.type,le.key,le.props,null,oe.mode,Se),Se.ref=Li(oe,ne,le),Se.return=oe,Se)}function ce(oe,ne,le,Se){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==le.containerInfo||ne.stateNode.implementation!==le.implementation?(ne=hc(le,oe.mode,Se),ne.return=oe,ne):(ne=A(ne,le.children||[]),ne.return=oe,ne)}function ve(oe,ne,le,Se,We){return ne===null||ne.tag!==7?(ne=lr(le,oe.mode,Se,We),ne.return=oe,ne):(ne=A(ne,le),ne.return=oe,ne)}function be(oe,ne,le){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ne=uc(""+ne,oe.mode,le),ne.return=oe,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case I:return le=cl(ne.type,ne.key,ne.props,null,oe.mode,le),le.ref=Li(oe,null,ne),le.return=oe,le;case L:return ne=hc(ne,oe.mode,le),ne.return=oe,ne;case X:var Se=ne._init;return be(oe,Se(ne._payload),le)}if(Ce(ne)||D(ne))return ne=lr(ne,oe.mode,le,null),ne.return=oe,ne;Fo(oe,ne)}return null}function _e(oe,ne,le,Se){var We=ne!==null?ne.key:null;if(typeof le=="string"&&le!==""||typeof le=="number")return We!==null?null:Q(oe,ne,""+le,Se);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case I:return le.key===We?ee(oe,ne,le,Se):null;case L:return le.key===We?ce(oe,ne,le,Se):null;case X:return We=le._init,_e(oe,ne,We(le._payload),Se)}if(Ce(le)||D(le))return We!==null?null:ve(oe,ne,le,Se,null);Fo(oe,le)}return null}function De(oe,ne,le,Se,We){if(typeof Se=="string"&&Se!==""||typeof Se=="number")return oe=oe.get(le)||null,Q(ne,oe,""+Se,We);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case I:return oe=oe.get(Se.key===null?le:Se.key)||null,ee(ne,oe,Se,We);case L:return oe=oe.get(Se.key===null?le:Se.key)||null,ce(ne,oe,Se,We);case X:var Ge=Se._init;return De(oe,ne,le,Ge(Se._payload),We)}if(Ce(Se)||D(Se))return oe=oe.get(le)||null,ve(ne,oe,Se,We,null);Fo(ne,Se)}return null}function Be(oe,ne,le,Se){for(var We=null,Ge=null,Ye=ne,Xe=ne=0,$t=null;Ye!==null&&Xe<le.length;Xe++){Ye.index>Xe?($t=Ye,Ye=null):$t=Ye.sibling;var ft=_e(oe,Ye,le[Xe],Se);if(ft===null){Ye===null&&(Ye=$t);break}e&&Ye&&ft.alternate===null&&t(oe,Ye),ne=P(ft,ne,Xe),Ge===null?We=ft:Ge.sibling=ft,Ge=ft,Ye=$t}if(Xe===le.length)return o(oe,Ye),kt&&Zs(oe,Xe),We;if(Ye===null){for(;Xe<le.length;Xe++)Ye=be(oe,le[Xe],Se),Ye!==null&&(ne=P(Ye,ne,Xe),Ge===null?We=Ye:Ge.sibling=Ye,Ge=Ye);return kt&&Zs(oe,Xe),We}for(Ye=w(oe,Ye);Xe<le.length;Xe++)$t=De(Ye,oe,Xe,le[Xe],Se),$t!==null&&(e&&$t.alternate!==null&&Ye.delete($t.key===null?Xe:$t.key),ne=P($t,ne,Xe),Ge===null?We=$t:Ge.sibling=$t,Ge=$t);return e&&Ye.forEach(function(js){return t(oe,js)}),kt&&Zs(oe,Xe),We}function $e(oe,ne,le,Se){var We=D(le);if(typeof We!="function")throw Error(i(150));if(le=We.call(le),le==null)throw Error(i(151));for(var Ge=We=null,Ye=ne,Xe=ne=0,$t=null,ft=le.next();Ye!==null&&!ft.done;Xe++,ft=le.next()){Ye.index>Xe?($t=Ye,Ye=null):$t=Ye.sibling;var js=_e(oe,Ye,ft.value,Se);if(js===null){Ye===null&&(Ye=$t);break}e&&Ye&&js.alternate===null&&t(oe,Ye),ne=P(js,ne,Xe),Ge===null?We=js:Ge.sibling=js,Ge=js,Ye=$t}if(ft.done)return o(oe,Ye),kt&&Zs(oe,Xe),We;if(Ye===null){for(;!ft.done;Xe++,ft=le.next())ft=be(oe,ft.value,Se),ft!==null&&(ne=P(ft,ne,Xe),Ge===null?We=ft:Ge.sibling=ft,Ge=ft);return kt&&Zs(oe,Xe),We}for(Ye=w(oe,Ye);!ft.done;Xe++,ft=le.next())ft=De(Ye,oe,Xe,ft.value,Se),ft!==null&&(e&&ft.alternate!==null&&Ye.delete(ft.key===null?Xe:ft.key),ne=P(ft,ne,Xe),Ge===null?We=ft:Ge.sibling=ft,Ge=ft);return e&&Ye.forEach(function(P_){return t(oe,P_)}),kt&&Zs(oe,Xe),We}function Nt(oe,ne,le,Se){if(typeof le=="object"&&le!==null&&le.type===M&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case I:e:{for(var We=le.key,Ge=ne;Ge!==null;){if(Ge.key===We){if(We=le.type,We===M){if(Ge.tag===7){o(oe,Ge.sibling),ne=A(Ge,le.props.children),ne.return=oe,oe=ne;break e}}else if(Ge.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===X&&mh(We)===Ge.type){o(oe,Ge.sibling),ne=A(Ge,le.props),ne.ref=Li(oe,Ge,le),ne.return=oe,oe=ne;break e}o(oe,Ge);break}else t(oe,Ge);Ge=Ge.sibling}le.type===M?(ne=lr(le.props.children,oe.mode,Se,le.key),ne.return=oe,oe=ne):(Se=cl(le.type,le.key,le.props,null,oe.mode,Se),Se.ref=Li(oe,ne,le),Se.return=oe,oe=Se)}return z(oe);case L:e:{for(Ge=le.key;ne!==null;){if(ne.key===Ge)if(ne.tag===4&&ne.stateNode.containerInfo===le.containerInfo&&ne.stateNode.implementation===le.implementation){o(oe,ne.sibling),ne=A(ne,le.children||[]),ne.return=oe,oe=ne;break e}else{o(oe,ne);break}else t(oe,ne);ne=ne.sibling}ne=hc(le,oe.mode,Se),ne.return=oe,oe=ne}return z(oe);case X:return Ge=le._init,Nt(oe,ne,Ge(le._payload),Se)}if(Ce(le))return Be(oe,ne,le,Se);if(D(le))return $e(oe,ne,le,Se);Fo(oe,le)}return typeof le=="string"&&le!==""||typeof le=="number"?(le=""+le,ne!==null&&ne.tag===6?(o(oe,ne.sibling),ne=A(ne,le),ne.return=oe,oe=ne):(o(oe,ne),ne=uc(le,oe.mode,Se),ne.return=oe,oe=ne),z(oe)):o(oe,ne)}return Nt}var Pr=gh(!0),_h=gh(!1),Ho=xs(null),$o=null,Or=null,wa=null;function ba(){wa=Or=$o=null}function Sa(e){var t=Ho.current;St(Ho),e._currentValue=t}function Ca(e,t,o){for(;e!==null;){var w=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,w!==null&&(w.childLanes|=t)):w!==null&&(w.childLanes&t)!==t&&(w.childLanes|=t),e===o)break;e=e.return}}function Br(e,t){$o=e,wa=Or=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(on=!0),e.firstContext=null)}function yn(e){var t=e._currentValue;if(wa!==e)if(e={context:e,memoizedValue:t,next:null},Or===null){if($o===null)throw Error(i(308));Or=e,$o.dependencies={lanes:0,firstContext:e}}else Or=Or.next=e;return t}var er=null;function xa(e){er===null?er=[e]:er.push(e)}function vh(e,t,o,w){var A=t.interleaved;return A===null?(o.next=o,xa(t)):(o.next=A.next,A.next=o),t.interleaved=o,cs(e,w)}function cs(e,t){e.lanes|=t;var o=e.alternate;for(o!==null&&(o.lanes|=t),o=e,e=e.return;e!==null;)e.childLanes|=t,o=e.alternate,o!==null&&(o.childLanes|=t),o=e,e=e.return;return o.tag===3?o.stateNode:null}var Ls=!1;function ka(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function yh(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 us(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ts(e,t,o){var w=e.updateQueue;if(w===null)return null;if(w=w.shared,(ut&2)!==0){var A=w.pending;return A===null?t.next=t:(t.next=A.next,A.next=t),w.pending=t,cs(e,o)}return A=w.interleaved,A===null?(t.next=t,xa(w)):(t.next=A.next,A.next=t),w.interleaved=t,cs(e,o)}function Uo(e,t,o){if(t=t.updateQueue,t!==null&&(t=t.shared,(o&4194240)!==0)){var w=t.lanes;w&=e.pendingLanes,o|=w,t.lanes=o,ci(e,o)}}function wh(e,t){var o=e.updateQueue,w=e.alternate;if(w!==null&&(w=w.updateQueue,o===w)){var A=null,P=null;if(o=o.firstBaseUpdate,o!==null){do{var z={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};P===null?A=P=z:P=P.next=z,o=o.next}while(o!==null);P===null?A=P=t:P=P.next=t}else A=P=t;o={baseState:w.baseState,firstBaseUpdate:A,lastBaseUpdate:P,shared:w.shared,effects:w.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=t:e.next=t,o.lastBaseUpdate=t}function Wo(e,t,o,w){var A=e.updateQueue;Ls=!1;var P=A.firstBaseUpdate,z=A.lastBaseUpdate,Q=A.shared.pending;if(Q!==null){A.shared.pending=null;var ee=Q,ce=ee.next;ee.next=null,z===null?P=ce:z.next=ce,z=ee;var ve=e.alternate;ve!==null&&(ve=ve.updateQueue,Q=ve.lastBaseUpdate,Q!==z&&(Q===null?ve.firstBaseUpdate=ce:Q.next=ce,ve.lastBaseUpdate=ee))}if(P!==null){var be=A.baseState;z=0,ve=ce=ee=null,Q=P;do{var _e=Q.lane,De=Q.eventTime;if((w&_e)===_e){ve!==null&&(ve=ve.next={eventTime:De,lane:0,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null});e:{var Be=e,$e=Q;switch(_e=t,De=o,$e.tag){case 1:if(Be=$e.payload,typeof Be=="function"){be=Be.call(De,be,_e);break e}be=Be;break e;case 3:Be.flags=Be.flags&-65537|128;case 0:if(Be=$e.payload,_e=typeof Be=="function"?Be.call(De,be,_e):Be,_e==null)break e;be=$({},be,_e);break e;case 2:Ls=!0}}Q.callback!==null&&Q.lane!==0&&(e.flags|=64,_e=A.effects,_e===null?A.effects=[Q]:_e.push(Q))}else De={eventTime:De,lane:_e,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},ve===null?(ce=ve=De,ee=be):ve=ve.next=De,z|=_e;if(Q=Q.next,Q===null){if(Q=A.shared.pending,Q===null)break;_e=Q,Q=_e.next,_e.next=null,A.lastBaseUpdate=_e,A.shared.pending=null}}while(!0);if(ve===null&&(ee=be),A.baseState=ee,A.firstBaseUpdate=ce,A.lastBaseUpdate=ve,t=A.shared.interleaved,t!==null){A=t;do z|=A.lane,A=A.next;while(A!==t)}else P===null&&(A.shared.lanes=0);sr|=z,e.lanes=z,e.memoizedState=be}}function bh(e,t,o){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var w=e[t],A=w.callback;if(A!==null){if(w.callback=null,w=o,typeof A!="function")throw Error(i(191,A));A.call(w)}}}var Ti={},Un=xs(Ti),Ri=xs(Ti),Mi=xs(Ti);function tr(e){if(e===Ti)throw Error(i(174));return e}function Ea(e,t){switch(vt(Mi,t),vt(Ri,e),vt(Un,Ti),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ze(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ze(t,e)}St(Un),vt(Un,t)}function Fr(){St(Un),St(Ri),St(Mi)}function Sh(e){tr(Mi.current);var t=tr(Un.current),o=Ze(t,e.type);t!==o&&(vt(Ri,e),vt(Un,o))}function La(e){Ri.current===e&&(St(Un),St(Ri))}var Et=xs(0);function zo(e){for(var t=e;t!==null;){if(t.tag===13){var o=t.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||o.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 Ta=[];function Ra(){for(var e=0;e<Ta.length;e++)Ta[e]._workInProgressVersionPrimary=null;Ta.length=0}var Vo=k.ReactCurrentDispatcher,Ma=k.ReactCurrentBatchConfig,nr=0,Lt=null,jt=null,Ft=null,qo=!1,Ai=!1,Ni=0,r_=0;function Kt(){throw Error(i(321))}function Aa(e,t){if(t===null)return!1;for(var o=0;o<t.length&&o<e.length;o++)if(!Mn(e[o],t[o]))return!1;return!0}function Na(e,t,o,w,A,P){if(nr=P,Lt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Vo.current=e===null||e.memoizedState===null?a_:c_,e=o(w,A),Ai){P=0;do{if(Ai=!1,Ni=0,25<=P)throw Error(i(301));P+=1,Ft=jt=null,t.updateQueue=null,Vo.current=u_,e=o(w,A)}while(Ai)}if(Vo.current=Yo,t=jt!==null&&jt.next!==null,nr=0,Ft=jt=Lt=null,qo=!1,t)throw Error(i(300));return e}function Da(){var e=Ni!==0;return Ni=0,e}function Wn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ft===null?Lt.memoizedState=Ft=e:Ft=Ft.next=e,Ft}function wn(){if(jt===null){var e=Lt.alternate;e=e!==null?e.memoizedState:null}else e=jt.next;var t=Ft===null?Lt.memoizedState:Ft.next;if(t!==null)Ft=t,jt=e;else{if(e===null)throw Error(i(310));jt=e,e={memoizedState:jt.memoizedState,baseState:jt.baseState,baseQueue:jt.baseQueue,queue:jt.queue,next:null},Ft===null?Lt.memoizedState=Ft=e:Ft=Ft.next=e}return Ft}function Di(e,t){return typeof t=="function"?t(e):t}function Ia(e){var t=wn(),o=t.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var w=jt,A=w.baseQueue,P=o.pending;if(P!==null){if(A!==null){var z=A.next;A.next=P.next,P.next=z}w.baseQueue=A=P,o.pending=null}if(A!==null){P=A.next,w=w.baseState;var Q=z=null,ee=null,ce=P;do{var ve=ce.lane;if((nr&ve)===ve)ee!==null&&(ee=ee.next={lane:0,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),w=ce.hasEagerState?ce.eagerState:e(w,ce.action);else{var be={lane:ve,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null};ee===null?(Q=ee=be,z=w):ee=ee.next=be,Lt.lanes|=ve,sr|=ve}ce=ce.next}while(ce!==null&&ce!==P);ee===null?z=w:ee.next=Q,Mn(w,t.memoizedState)||(on=!0),t.memoizedState=w,t.baseState=z,t.baseQueue=ee,o.lastRenderedState=w}if(e=o.interleaved,e!==null){A=e;do P=A.lane,Lt.lanes|=P,sr|=P,A=A.next;while(A!==e)}else A===null&&(o.lanes=0);return[t.memoizedState,o.dispatch]}function ja(e){var t=wn(),o=t.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var w=o.dispatch,A=o.pending,P=t.memoizedState;if(A!==null){o.pending=null;var z=A=A.next;do P=e(P,z.action),z=z.next;while(z!==A);Mn(P,t.memoizedState)||(on=!0),t.memoizedState=P,t.baseQueue===null&&(t.baseState=P),o.lastRenderedState=P}return[P,w]}function Ch(){}function xh(e,t){var o=Lt,w=wn(),A=t(),P=!Mn(w.memoizedState,A);if(P&&(w.memoizedState=A,on=!0),w=w.queue,Pa(Lh.bind(null,o,w,e),[e]),w.getSnapshot!==t||P||Ft!==null&&Ft.memoizedState.tag&1){if(o.flags|=2048,Ii(9,Eh.bind(null,o,w,A,t),void 0,null),Ht===null)throw Error(i(349));(nr&30)!==0||kh(o,t,A)}return A}function kh(e,t,o){e.flags|=16384,e={getSnapshot:t,value:o},t=Lt.updateQueue,t===null?(t={lastEffect:null,stores:null},Lt.updateQueue=t,t.stores=[e]):(o=t.stores,o===null?t.stores=[e]:o.push(e))}function Eh(e,t,o,w){t.value=o,t.getSnapshot=w,Th(t)&&Rh(e)}function Lh(e,t,o){return o(function(){Th(t)&&Rh(e)})}function Th(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!Mn(e,o)}catch{return!0}}function Rh(e){var t=cs(e,1);t!==null&&jn(t,e,1,-1)}function Mh(e){var t=Wn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:e},t.queue=e,e=e.dispatch=l_.bind(null,Lt,e),[t.memoizedState,e]}function Ii(e,t,o,w){return e={tag:e,create:t,destroy:o,deps:w,next:null},t=Lt.updateQueue,t===null?(t={lastEffect:null,stores:null},Lt.updateQueue=t,t.lastEffect=e.next=e):(o=t.lastEffect,o===null?t.lastEffect=e.next=e:(w=o.next,o.next=e,e.next=w,t.lastEffect=e)),e}function Ah(){return wn().memoizedState}function Ko(e,t,o,w){var A=Wn();Lt.flags|=e,A.memoizedState=Ii(1|t,o,void 0,w===void 0?null:w)}function Go(e,t,o,w){var A=wn();w=w===void 0?null:w;var P=void 0;if(jt!==null){var z=jt.memoizedState;if(P=z.destroy,w!==null&&Aa(w,z.deps)){A.memoizedState=Ii(t,o,P,w);return}}Lt.flags|=e,A.memoizedState=Ii(1|t,o,P,w)}function Nh(e,t){return Ko(8390656,8,e,t)}function Pa(e,t){return Go(2048,8,e,t)}function Dh(e,t){return Go(4,2,e,t)}function Ih(e,t){return Go(4,4,e,t)}function jh(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 Ph(e,t,o){return o=o!=null?o.concat([e]):null,Go(4,4,jh.bind(null,t,e),o)}function Oa(){}function Oh(e,t){var o=wn();t=t===void 0?null:t;var w=o.memoizedState;return w!==null&&t!==null&&Aa(t,w[1])?w[0]:(o.memoizedState=[e,t],e)}function Bh(e,t){var o=wn();t=t===void 0?null:t;var w=o.memoizedState;return w!==null&&t!==null&&Aa(t,w[1])?w[0]:(e=e(),o.memoizedState=[e,t],e)}function Fh(e,t,o){return(nr&21)===0?(e.baseState&&(e.baseState=!1,on=!0),e.memoizedState=o):(Mn(o,t)||(o=ao(),Lt.lanes|=o,sr|=o,e.baseState=!0),t)}function i_(e,t){var o=dt;dt=o!==0&&4>o?o:4,e(!0);var w=Ma.transition;Ma.transition={};try{e(!1),t()}finally{dt=o,Ma.transition=w}}function Hh(){return wn().memoizedState}function o_(e,t,o){var w=Ns(e);if(o={lane:w,action:o,hasEagerState:!1,eagerState:null,next:null},$h(e))Uh(t,o);else if(o=vh(e,t,o,w),o!==null){var A=tn();jn(o,e,w,A),Wh(o,t,w)}}function l_(e,t,o){var w=Ns(e),A={lane:w,action:o,hasEagerState:!1,eagerState:null,next:null};if($h(e))Uh(t,A);else{var P=e.alternate;if(e.lanes===0&&(P===null||P.lanes===0)&&(P=t.lastRenderedReducer,P!==null))try{var z=t.lastRenderedState,Q=P(z,o);if(A.hasEagerState=!0,A.eagerState=Q,Mn(Q,z)){var ee=t.interleaved;ee===null?(A.next=A,xa(t)):(A.next=ee.next,ee.next=A),t.interleaved=A;return}}catch{}finally{}o=vh(e,t,A,w),o!==null&&(A=tn(),jn(o,e,w,A),Wh(o,t,w))}}function $h(e){var t=e.alternate;return e===Lt||t!==null&&t===Lt}function Uh(e,t){Ai=qo=!0;var o=e.pending;o===null?t.next=t:(t.next=o.next,o.next=t),e.pending=t}function Wh(e,t,o){if((o&4194240)!==0){var w=t.lanes;w&=e.pendingLanes,o|=w,t.lanes=o,ci(e,o)}}var Yo={readContext:yn,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useInsertionEffect:Kt,useLayoutEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useMutableSource:Kt,useSyncExternalStore:Kt,useId:Kt,unstable_isNewReconciler:!1},a_={readContext:yn,useCallback:function(e,t){return Wn().memoizedState=[e,t===void 0?null:t],e},useContext:yn,useEffect:Nh,useImperativeHandle:function(e,t,o){return o=o!=null?o.concat([e]):null,Ko(4194308,4,jh.bind(null,t,e),o)},useLayoutEffect:function(e,t){return Ko(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ko(4,2,e,t)},useMemo:function(e,t){var o=Wn();return t=t===void 0?null:t,e=e(),o.memoizedState=[e,t],e},useReducer:function(e,t,o){var w=Wn();return t=o!==void 0?o(t):t,w.memoizedState=w.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},w.queue=e,e=e.dispatch=o_.bind(null,Lt,e),[w.memoizedState,e]},useRef:function(e){var t=Wn();return e={current:e},t.memoizedState=e},useState:Mh,useDebugValue:Oa,useDeferredValue:function(e){return Wn().memoizedState=e},useTransition:function(){var e=Mh(!1),t=e[0];return e=i_.bind(null,e[1]),Wn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,o){var w=Lt,A=Wn();if(kt){if(o===void 0)throw Error(i(407));o=o()}else{if(o=t(),Ht===null)throw Error(i(349));(nr&30)!==0||kh(w,t,o)}A.memoizedState=o;var P={value:o,getSnapshot:t};return A.queue=P,Nh(Lh.bind(null,w,P,e),[e]),w.flags|=2048,Ii(9,Eh.bind(null,w,P,o,t),void 0,null),o},useId:function(){var e=Wn(),t=Ht.identifierPrefix;if(kt){var o=as,w=ls;o=(w&~(1<<32-Ot(w)-1)).toString(32)+o,t=":"+t+"R"+o,o=Ni++,0<o&&(t+="H"+o.toString(32)),t+=":"}else o=r_++,t=":"+t+"r"+o.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},c_={readContext:yn,useCallback:Oh,useContext:yn,useEffect:Pa,useImperativeHandle:Ph,useInsertionEffect:Dh,useLayoutEffect:Ih,useMemo:Bh,useReducer:Ia,useRef:Ah,useState:function(){return Ia(Di)},useDebugValue:Oa,useDeferredValue:function(e){var t=wn();return Fh(t,jt.memoizedState,e)},useTransition:function(){var e=Ia(Di)[0],t=wn().memoizedState;return[e,t]},useMutableSource:Ch,useSyncExternalStore:xh,useId:Hh,unstable_isNewReconciler:!1},u_={readContext:yn,useCallback:Oh,useContext:yn,useEffect:Pa,useImperativeHandle:Ph,useInsertionEffect:Dh,useLayoutEffect:Ih,useMemo:Bh,useReducer:ja,useRef:Ah,useState:function(){return ja(Di)},useDebugValue:Oa,useDeferredValue:function(e){var t=wn();return jt===null?t.memoizedState=e:Fh(t,jt.memoizedState,e)},useTransition:function(){var e=ja(Di)[0],t=wn().memoizedState;return[e,t]},useMutableSource:Ch,useSyncExternalStore:xh,useId:Hh,unstable_isNewReconciler:!1};function Nn(e,t){if(e&&e.defaultProps){t=$({},t),e=e.defaultProps;for(var o in e)t[o]===void 0&&(t[o]=e[o]);return t}return t}function Ba(e,t,o,w){t=e.memoizedState,o=o(w,t),o=o==null?t:$({},t,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var Xo={isMounted:function(e){return(e=e._reactInternals)?Qn(e)===e:!1},enqueueSetState:function(e,t,o){e=e._reactInternals;var w=tn(),A=Ns(e),P=us(w,A);P.payload=t,o!=null&&(P.callback=o),t=Ts(e,P,A),t!==null&&(jn(t,e,A,w),Uo(t,e,A))},enqueueReplaceState:function(e,t,o){e=e._reactInternals;var w=tn(),A=Ns(e),P=us(w,A);P.tag=1,P.payload=t,o!=null&&(P.callback=o),t=Ts(e,P,A),t!==null&&(jn(t,e,A,w),Uo(t,e,A))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var o=tn(),w=Ns(e),A=us(o,w);A.tag=2,t!=null&&(A.callback=t),t=Ts(e,A,w),t!==null&&(jn(t,e,w,o),Uo(t,e,w))}};function zh(e,t,o,w,A,P,z){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(w,P,z):t.prototype&&t.prototype.isPureReactComponent?!wi(o,w)||!wi(A,P):!0}function Vh(e,t,o){var w=!1,A=ks,P=t.contextType;return typeof P=="object"&&P!==null?P=yn(P):(A=rn(t)?Qs:qt.current,w=t.contextTypes,P=(w=w!=null)?Nr(e,A):ks),t=new t(o,P),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Xo,e.stateNode=t,t._reactInternals=e,w&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=A,e.__reactInternalMemoizedMaskedChildContext=P),t}function qh(e,t,o,w){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(o,w),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(o,w),t.state!==e&&Xo.enqueueReplaceState(t,t.state,null)}function Fa(e,t,o,w){var A=e.stateNode;A.props=o,A.state=e.memoizedState,A.refs={},ka(e);var P=t.contextType;typeof P=="object"&&P!==null?A.context=yn(P):(P=rn(t)?Qs:qt.current,A.context=Nr(e,P)),A.state=e.memoizedState,P=t.getDerivedStateFromProps,typeof P=="function"&&(Ba(e,t,P,o),A.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(t=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),t!==A.state&&Xo.enqueueReplaceState(A,A.state,null),Wo(e,o,A,w),A.state=e.memoizedState),typeof A.componentDidMount=="function"&&(e.flags|=4194308)}function Hr(e,t){try{var o="",w=t;do o+=ae(w),w=w.return;while(w);var A=o}catch(P){A=`
39
- Error generating stack: `+P.message+`
40
- `+P.stack}return{value:e,source:t,stack:A,digest:null}}function Ha(e,t,o){return{value:e,source:null,stack:o??null,digest:t??null}}function $a(e,t){try{console.error(t.value)}catch(o){setTimeout(function(){throw o})}}var h_=typeof WeakMap=="function"?WeakMap:Map;function Kh(e,t,o){o=us(-1,o),o.tag=3,o.payload={element:null};var w=t.value;return o.callback=function(){sl||(sl=!0,nc=w),$a(e,t)},o}function Gh(e,t,o){o=us(-1,o),o.tag=3;var w=e.type.getDerivedStateFromError;if(typeof w=="function"){var A=t.value;o.payload=function(){return w(A)},o.callback=function(){$a(e,t)}}var P=e.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(o.callback=function(){$a(e,t),typeof w!="function"&&(Ms===null?Ms=new Set([this]):Ms.add(this));var z=t.stack;this.componentDidCatch(t.value,{componentStack:z!==null?z:""})}),o}function Yh(e,t,o){var w=e.pingCache;if(w===null){w=e.pingCache=new h_;var A=new Set;w.set(t,A)}else A=w.get(t),A===void 0&&(A=new Set,w.set(t,A));A.has(o)||(A.add(o),e=k_.bind(null,e,t,o),t.then(e,e))}function Xh(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 Qh(e,t,o,w,A){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,o.flags|=131072,o.flags&=-52805,o.tag===1&&(o.alternate===null?o.tag=17:(t=us(-1,1),t.tag=2,Ts(o,t,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=A,e)}var d_=k.ReactCurrentOwner,on=!1;function en(e,t,o,w){t.child=e===null?_h(t,null,o,w):Pr(t,e.child,o,w)}function Jh(e,t,o,w,A){o=o.render;var P=t.ref;return Br(t,A),w=Na(e,t,o,w,P,A),o=Da(),e!==null&&!on?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~A,hs(e,t,A)):(kt&&o&&ma(t),t.flags|=1,en(e,t,w,A),t.child)}function Zh(e,t,o,w,A){if(e===null){var P=o.type;return typeof P=="function"&&!cc(P)&&P.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(t.tag=15,t.type=P,ed(e,t,P,w,A)):(e=cl(o.type,null,w,t,t.mode,A),e.ref=t.ref,e.return=t,t.child=e)}if(P=e.child,(e.lanes&A)===0){var z=P.memoizedProps;if(o=o.compare,o=o!==null?o:wi,o(z,w)&&e.ref===t.ref)return hs(e,t,A)}return t.flags|=1,e=Is(P,w),e.ref=t.ref,e.return=t,t.child=e}function ed(e,t,o,w,A){if(e!==null){var P=e.memoizedProps;if(wi(P,w)&&e.ref===t.ref)if(on=!1,t.pendingProps=w=P,(e.lanes&A)!==0)(e.flags&131072)!==0&&(on=!0);else return t.lanes=e.lanes,hs(e,t,A)}return Ua(e,t,o,w,A)}function td(e,t,o){var w=t.pendingProps,A=w.children,P=e!==null?e.memoizedState:null;if(w.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},vt(Ur,mn),mn|=o;else{if((o&1073741824)===0)return e=P!==null?P.baseLanes|o:o,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,vt(Ur,mn),mn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=P!==null?P.baseLanes:o,vt(Ur,mn),mn|=w}else P!==null?(w=P.baseLanes|o,t.memoizedState=null):w=o,vt(Ur,mn),mn|=w;return en(e,t,A,o),t.child}function nd(e,t){var o=t.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(t.flags|=512,t.flags|=2097152)}function Ua(e,t,o,w,A){var P=rn(o)?Qs:qt.current;return P=Nr(t,P),Br(t,A),o=Na(e,t,o,w,P,A),w=Da(),e!==null&&!on?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~A,hs(e,t,A)):(kt&&w&&ma(t),t.flags|=1,en(e,t,o,A),t.child)}function sd(e,t,o,w,A){if(rn(o)){var P=!0;Io(t)}else P=!1;if(Br(t,A),t.stateNode===null)Jo(e,t),Vh(t,o,w),Fa(t,o,w,A),w=!0;else if(e===null){var z=t.stateNode,Q=t.memoizedProps;z.props=Q;var ee=z.context,ce=o.contextType;typeof ce=="object"&&ce!==null?ce=yn(ce):(ce=rn(o)?Qs:qt.current,ce=Nr(t,ce));var ve=o.getDerivedStateFromProps,be=typeof ve=="function"||typeof z.getSnapshotBeforeUpdate=="function";be||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(Q!==w||ee!==ce)&&qh(t,z,w,ce),Ls=!1;var _e=t.memoizedState;z.state=_e,Wo(t,w,z,A),ee=t.memoizedState,Q!==w||_e!==ee||sn.current||Ls?(typeof ve=="function"&&(Ba(t,o,ve,w),ee=t.memoizedState),(Q=Ls||zh(t,o,Q,w,_e,ee,ce))?(be||typeof z.UNSAFE_componentWillMount!="function"&&typeof z.componentWillMount!="function"||(typeof z.componentWillMount=="function"&&z.componentWillMount(),typeof z.UNSAFE_componentWillMount=="function"&&z.UNSAFE_componentWillMount()),typeof z.componentDidMount=="function"&&(t.flags|=4194308)):(typeof z.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=w,t.memoizedState=ee),z.props=w,z.state=ee,z.context=ce,w=Q):(typeof z.componentDidMount=="function"&&(t.flags|=4194308),w=!1)}else{z=t.stateNode,yh(e,t),Q=t.memoizedProps,ce=t.type===t.elementType?Q:Nn(t.type,Q),z.props=ce,be=t.pendingProps,_e=z.context,ee=o.contextType,typeof ee=="object"&&ee!==null?ee=yn(ee):(ee=rn(o)?Qs:qt.current,ee=Nr(t,ee));var De=o.getDerivedStateFromProps;(ve=typeof De=="function"||typeof z.getSnapshotBeforeUpdate=="function")||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(Q!==be||_e!==ee)&&qh(t,z,w,ee),Ls=!1,_e=t.memoizedState,z.state=_e,Wo(t,w,z,A);var Be=t.memoizedState;Q!==be||_e!==Be||sn.current||Ls?(typeof De=="function"&&(Ba(t,o,De,w),Be=t.memoizedState),(ce=Ls||zh(t,o,ce,w,_e,Be,ee)||!1)?(ve||typeof z.UNSAFE_componentWillUpdate!="function"&&typeof z.componentWillUpdate!="function"||(typeof z.componentWillUpdate=="function"&&z.componentWillUpdate(w,Be,ee),typeof z.UNSAFE_componentWillUpdate=="function"&&z.UNSAFE_componentWillUpdate(w,Be,ee)),typeof z.componentDidUpdate=="function"&&(t.flags|=4),typeof z.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof z.componentDidUpdate!="function"||Q===e.memoizedProps&&_e===e.memoizedState||(t.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||Q===e.memoizedProps&&_e===e.memoizedState||(t.flags|=1024),t.memoizedProps=w,t.memoizedState=Be),z.props=w,z.state=Be,z.context=ee,w=ce):(typeof z.componentDidUpdate!="function"||Q===e.memoizedProps&&_e===e.memoizedState||(t.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||Q===e.memoizedProps&&_e===e.memoizedState||(t.flags|=1024),w=!1)}return Wa(e,t,o,w,P,A)}function Wa(e,t,o,w,A,P){nd(e,t);var z=(t.flags&128)!==0;if(!w&&!z)return A&&ah(t,o,!1),hs(e,t,P);w=t.stateNode,d_.current=t;var Q=z&&typeof o.getDerivedStateFromError!="function"?null:w.render();return t.flags|=1,e!==null&&z?(t.child=Pr(t,e.child,null,P),t.child=Pr(t,null,Q,P)):en(e,t,Q,P),t.memoizedState=w.state,A&&ah(t,o,!0),t.child}function rd(e){var t=e.stateNode;t.pendingContext?oh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&oh(e,t.context,!1),Ea(e,t.containerInfo)}function id(e,t,o,w,A){return jr(),ya(A),t.flags|=256,en(e,t,o,w),t.child}var za={dehydrated:null,treeContext:null,retryLane:0};function Va(e){return{baseLanes:e,cachePool:null,transitions:null}}function od(e,t,o){var w=t.pendingProps,A=Et.current,P=!1,z=(t.flags&128)!==0,Q;if((Q=z)||(Q=e!==null&&e.memoizedState===null?!1:(A&2)!==0),Q?(P=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(A|=1),vt(Et,A&1),e===null)return va(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):(z=w.children,e=w.fallback,P?(w=t.mode,P=t.child,z={mode:"hidden",children:z},(w&1)===0&&P!==null?(P.childLanes=0,P.pendingProps=z):P=ul(z,w,0,null),e=lr(e,w,o,null),P.return=t,e.return=t,P.sibling=e,t.child=P,t.child.memoizedState=Va(o),t.memoizedState=za,e):qa(t,z));if(A=e.memoizedState,A!==null&&(Q=A.dehydrated,Q!==null))return f_(e,t,z,w,Q,A,o);if(P){P=w.fallback,z=t.mode,A=e.child,Q=A.sibling;var ee={mode:"hidden",children:w.children};return(z&1)===0&&t.child!==A?(w=t.child,w.childLanes=0,w.pendingProps=ee,t.deletions=null):(w=Is(A,ee),w.subtreeFlags=A.subtreeFlags&14680064),Q!==null?P=Is(Q,P):(P=lr(P,z,o,null),P.flags|=2),P.return=t,w.return=t,w.sibling=P,t.child=w,w=P,P=t.child,z=e.child.memoizedState,z=z===null?Va(o):{baseLanes:z.baseLanes|o,cachePool:null,transitions:z.transitions},P.memoizedState=z,P.childLanes=e.childLanes&~o,t.memoizedState=za,w}return P=e.child,e=P.sibling,w=Is(P,{mode:"visible",children:w.children}),(t.mode&1)===0&&(w.lanes=o),w.return=t,w.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=w,t.memoizedState=null,w}function qa(e,t){return t=ul({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Qo(e,t,o,w){return w!==null&&ya(w),Pr(t,e.child,null,o),e=qa(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function f_(e,t,o,w,A,P,z){if(o)return t.flags&256?(t.flags&=-257,w=Ha(Error(i(422))),Qo(e,t,z,w)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(P=w.fallback,A=t.mode,w=ul({mode:"visible",children:w.children},A,0,null),P=lr(P,A,z,null),P.flags|=2,w.return=t,P.return=t,w.sibling=P,t.child=w,(t.mode&1)!==0&&Pr(t,e.child,null,z),t.child.memoizedState=Va(z),t.memoizedState=za,P);if((t.mode&1)===0)return Qo(e,t,z,null);if(A.data==="$!"){if(w=A.nextSibling&&A.nextSibling.dataset,w)var Q=w.dgst;return w=Q,P=Error(i(419)),w=Ha(P,w,void 0),Qo(e,t,z,w)}if(Q=(z&e.childLanes)!==0,on||Q){if(w=Ht,w!==null){switch(z&-z){case 4:A=2;break;case 16:A=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:A=32;break;case 536870912:A=268435456;break;default:A=0}A=(A&(w.suspendedLanes|z))!==0?0:A,A!==0&&A!==P.retryLane&&(P.retryLane=A,cs(e,A),jn(w,e,A,-1))}return ac(),w=Ha(Error(i(421))),Qo(e,t,z,w)}return A.data==="$?"?(t.flags|=128,t.child=e.child,t=E_.bind(null,e),A._reactRetry=t,null):(e=P.treeContext,pn=Cs(A.nextSibling),fn=t,kt=!0,An=null,e!==null&&(_n[vn++]=ls,_n[vn++]=as,_n[vn++]=Js,ls=e.id,as=e.overflow,Js=t),t=qa(t,w.children),t.flags|=4096,t)}function ld(e,t,o){e.lanes|=t;var w=e.alternate;w!==null&&(w.lanes|=t),Ca(e.return,t,o)}function Ka(e,t,o,w,A){var P=e.memoizedState;P===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:w,tail:o,tailMode:A}:(P.isBackwards=t,P.rendering=null,P.renderingStartTime=0,P.last=w,P.tail=o,P.tailMode=A)}function ad(e,t,o){var w=t.pendingProps,A=w.revealOrder,P=w.tail;if(en(e,t,w.children,o),w=Et.current,(w&2)!==0)w=w&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&&ld(e,o,t);else if(e.tag===19)ld(e,o,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}w&=1}if(vt(Et,w),(t.mode&1)===0)t.memoizedState=null;else switch(A){case"forwards":for(o=t.child,A=null;o!==null;)e=o.alternate,e!==null&&zo(e)===null&&(A=o),o=o.sibling;o=A,o===null?(A=t.child,t.child=null):(A=o.sibling,o.sibling=null),Ka(t,!1,A,o,P);break;case"backwards":for(o=null,A=t.child,t.child=null;A!==null;){if(e=A.alternate,e!==null&&zo(e)===null){t.child=A;break}e=A.sibling,A.sibling=o,o=A,A=e}Ka(t,!0,o,null,P);break;case"together":Ka(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Jo(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function hs(e,t,o){if(e!==null&&(t.dependencies=e.dependencies),sr|=t.lanes,(o&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,o=Is(e,e.pendingProps),t.child=o,o.return=t;e.sibling!==null;)e=e.sibling,o=o.sibling=Is(e,e.pendingProps),o.return=t;o.sibling=null}return t.child}function p_(e,t,o){switch(t.tag){case 3:rd(t),jr();break;case 5:Sh(t);break;case 1:rn(t.type)&&Io(t);break;case 4:Ea(t,t.stateNode.containerInfo);break;case 10:var w=t.type._context,A=t.memoizedProps.value;vt(Ho,w._currentValue),w._currentValue=A;break;case 13:if(w=t.memoizedState,w!==null)return w.dehydrated!==null?(vt(Et,Et.current&1),t.flags|=128,null):(o&t.child.childLanes)!==0?od(e,t,o):(vt(Et,Et.current&1),e=hs(e,t,o),e!==null?e.sibling:null);vt(Et,Et.current&1);break;case 19:if(w=(o&t.childLanes)!==0,(e.flags&128)!==0){if(w)return ad(e,t,o);t.flags|=128}if(A=t.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),vt(Et,Et.current),w)break;return null;case 22:case 23:return t.lanes=0,td(e,t,o)}return hs(e,t,o)}var cd,Ga,ud,hd;cd=function(e,t){for(var o=t.child;o!==null;){if(o.tag===5||o.tag===6)e.appendChild(o.stateNode);else if(o.tag!==4&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break;for(;o.sibling===null;){if(o.return===null||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},Ga=function(){},ud=function(e,t,o,w){var A=e.memoizedProps;if(A!==w){e=t.stateNode,tr(Un.current);var P=null;switch(o){case"input":A=Ee(e,A),w=Ee(e,w),P=[];break;case"select":A=$({},A,{value:void 0}),w=$({},w,{value:void 0}),P=[];break;case"textarea":A=Pe(e,A),w=Pe(e,w),P=[];break;default:typeof A.onClick!="function"&&typeof w.onClick=="function"&&(e.onclick=Ao)}Ke(o,w);var z;o=null;for(ce in A)if(!w.hasOwnProperty(ce)&&A.hasOwnProperty(ce)&&A[ce]!=null)if(ce==="style"){var Q=A[ce];for(z in Q)Q.hasOwnProperty(z)&&(o||(o={}),o[z]="")}else ce!=="dangerouslySetInnerHTML"&&ce!=="children"&&ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&ce!=="autoFocus"&&(_.hasOwnProperty(ce)?P||(P=[]):(P=P||[]).push(ce,null));for(ce in w){var ee=w[ce];if(Q=A!=null?A[ce]:void 0,w.hasOwnProperty(ce)&&ee!==Q&&(ee!=null||Q!=null))if(ce==="style")if(Q){for(z in Q)!Q.hasOwnProperty(z)||ee&&ee.hasOwnProperty(z)||(o||(o={}),o[z]="");for(z in ee)ee.hasOwnProperty(z)&&Q[z]!==ee[z]&&(o||(o={}),o[z]=ee[z])}else o||(P||(P=[]),P.push(ce,o)),o=ee;else ce==="dangerouslySetInnerHTML"?(ee=ee?ee.__html:void 0,Q=Q?Q.__html:void 0,ee!=null&&Q!==ee&&(P=P||[]).push(ce,ee)):ce==="children"?typeof ee!="string"&&typeof ee!="number"||(P=P||[]).push(ce,""+ee):ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&(_.hasOwnProperty(ce)?(ee!=null&&ce==="onScroll"&&bt("scroll",e),P||Q===ee||(P=[])):(P=P||[]).push(ce,ee))}o&&(P=P||[]).push("style",o);var ce=P;(t.updateQueue=ce)&&(t.flags|=4)}},hd=function(e,t,o,w){o!==w&&(t.flags|=4)};function ji(e,t){if(!kt)switch(e.tailMode){case"hidden":t=e.tail;for(var o=null;t!==null;)t.alternate!==null&&(o=t),t=t.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var w=null;o!==null;)o.alternate!==null&&(w=o),o=o.sibling;w===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:w.sibling=null}}function Gt(e){var t=e.alternate!==null&&e.alternate.child===e.child,o=0,w=0;if(t)for(var A=e.child;A!==null;)o|=A.lanes|A.childLanes,w|=A.subtreeFlags&14680064,w|=A.flags&14680064,A.return=e,A=A.sibling;else for(A=e.child;A!==null;)o|=A.lanes|A.childLanes,w|=A.subtreeFlags,w|=A.flags,A.return=e,A=A.sibling;return e.subtreeFlags|=w,e.childLanes=o,t}function m_(e,t,o){var w=t.pendingProps;switch(ga(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gt(t),null;case 1:return rn(t.type)&&Do(),Gt(t),null;case 3:return w=t.stateNode,Fr(),St(sn),St(qt),Ra(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(e===null||e.child===null)&&(Bo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,An!==null&&(ic(An),An=null))),Ga(e,t),Gt(t),null;case 5:La(t);var A=tr(Mi.current);if(o=t.type,e!==null&&t.stateNode!=null)ud(e,t,o,w,A),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!w){if(t.stateNode===null)throw Error(i(166));return Gt(t),null}if(e=tr(Un.current),Bo(t)){w=t.stateNode,o=t.type;var P=t.memoizedProps;switch(w[$n]=t,w[ki]=P,e=(t.mode&1)!==0,o){case"dialog":bt("cancel",w),bt("close",w);break;case"iframe":case"object":case"embed":bt("load",w);break;case"video":case"audio":for(A=0;A<Si.length;A++)bt(Si[A],w);break;case"source":bt("error",w);break;case"img":case"image":case"link":bt("error",w),bt("load",w);break;case"details":bt("toggle",w);break;case"input":Me(w,P),bt("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!P.multiple},bt("invalid",w);break;case"textarea":xe(w,P),bt("invalid",w)}Ke(o,P),A=null;for(var z in P)if(P.hasOwnProperty(z)){var Q=P[z];z==="children"?typeof Q=="string"?w.textContent!==Q&&(P.suppressHydrationWarning!==!0&&Mo(w.textContent,Q,e),A=["children",Q]):typeof Q=="number"&&w.textContent!==""+Q&&(P.suppressHydrationWarning!==!0&&Mo(w.textContent,Q,e),A=["children",""+Q]):_.hasOwnProperty(z)&&Q!=null&&z==="onScroll"&&bt("scroll",w)}switch(o){case"input":de(w),pe(w,P,!0);break;case"textarea":de(w),et(w);break;case"select":case"option":break;default:typeof P.onClick=="function"&&(w.onclick=Ao)}w=A,t.updateQueue=w,w!==null&&(t.flags|=4)}else{z=A.nodeType===9?A:A.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ot(o)),e==="http://www.w3.org/1999/xhtml"?o==="script"?(e=z.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof w.is=="string"?e=z.createElement(o,{is:w.is}):(e=z.createElement(o),o==="select"&&(z=e,w.multiple?z.multiple=!0:w.size&&(z.size=w.size))):e=z.createElementNS(e,o),e[$n]=t,e[ki]=w,cd(e,t,!1,!1),t.stateNode=e;e:{switch(z=he(o,w),o){case"dialog":bt("cancel",e),bt("close",e),A=w;break;case"iframe":case"object":case"embed":bt("load",e),A=w;break;case"video":case"audio":for(A=0;A<Si.length;A++)bt(Si[A],e);A=w;break;case"source":bt("error",e),A=w;break;case"img":case"image":case"link":bt("error",e),bt("load",e),A=w;break;case"details":bt("toggle",e),A=w;break;case"input":Me(e,w),A=Ee(e,w),bt("invalid",e);break;case"option":A=w;break;case"select":e._wrapperState={wasMultiple:!!w.multiple},A=$({},w,{value:void 0}),bt("invalid",e);break;case"textarea":xe(e,w),A=Pe(e,w),bt("invalid",e);break;default:A=w}Ke(o,A),Q=A;for(P in Q)if(Q.hasOwnProperty(P)){var ee=Q[P];P==="style"?st(e,ee):P==="dangerouslySetInnerHTML"?(ee=ee?ee.__html:void 0,ee!=null&&tt(e,ee)):P==="children"?typeof ee=="string"?(o!=="textarea"||ee!=="")&&He(e,ee):typeof ee=="number"&&He(e,""+ee):P!=="suppressContentEditableWarning"&&P!=="suppressHydrationWarning"&&P!=="autoFocus"&&(_.hasOwnProperty(P)?ee!=null&&P==="onScroll"&&bt("scroll",e):ee!=null&&d(e,P,ee,z))}switch(o){case"input":de(e),pe(e,w,!1);break;case"textarea":de(e),et(e);break;case"option":w.value!=null&&e.setAttribute("value",""+W(w.value));break;case"select":e.multiple=!!w.multiple,P=w.value,P!=null?Te(e,!!w.multiple,P,!1):w.defaultValue!=null&&Te(e,!!w.multiple,w.defaultValue,!0);break;default:typeof A.onClick=="function"&&(e.onclick=Ao)}switch(o){case"button":case"input":case"select":case"textarea":w=!!w.autoFocus;break e;case"img":w=!0;break e;default:w=!1}}w&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Gt(t),null;case 6:if(e&&t.stateNode!=null)hd(e,t,e.memoizedProps,w);else{if(typeof w!="string"&&t.stateNode===null)throw Error(i(166));if(o=tr(Mi.current),tr(Un.current),Bo(t)){if(w=t.stateNode,o=t.memoizedProps,w[$n]=t,(P=w.nodeValue!==o)&&(e=fn,e!==null))switch(e.tag){case 3:Mo(w.nodeValue,o,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Mo(w.nodeValue,o,(e.mode&1)!==0)}P&&(t.flags|=4)}else w=(o.nodeType===9?o:o.ownerDocument).createTextNode(w),w[$n]=t,t.stateNode=w}return Gt(t),null;case 13:if(St(Et),w=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(kt&&pn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)ph(),jr(),t.flags|=98560,P=!1;else if(P=Bo(t),w!==null&&w.dehydrated!==null){if(e===null){if(!P)throw Error(i(318));if(P=t.memoizedState,P=P!==null?P.dehydrated:null,!P)throw Error(i(317));P[$n]=t}else jr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Gt(t),P=!1}else An!==null&&(ic(An),An=null),P=!0;if(!P)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=o,t):(w=w!==null,w!==(e!==null&&e.memoizedState!==null)&&w&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Et.current&1)!==0?Pt===0&&(Pt=3):ac())),t.updateQueue!==null&&(t.flags|=4),Gt(t),null);case 4:return Fr(),Ga(e,t),e===null&&Ci(t.stateNode.containerInfo),Gt(t),null;case 10:return Sa(t.type._context),Gt(t),null;case 17:return rn(t.type)&&Do(),Gt(t),null;case 19:if(St(Et),P=t.memoizedState,P===null)return Gt(t),null;if(w=(t.flags&128)!==0,z=P.rendering,z===null)if(w)ji(P,!1);else{if(Pt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(z=zo(e),z!==null){for(t.flags|=128,ji(P,!1),w=z.updateQueue,w!==null&&(t.updateQueue=w,t.flags|=4),t.subtreeFlags=0,w=o,o=t.child;o!==null;)P=o,e=w,P.flags&=14680066,z=P.alternate,z===null?(P.childLanes=0,P.lanes=e,P.child=null,P.subtreeFlags=0,P.memoizedProps=null,P.memoizedState=null,P.updateQueue=null,P.dependencies=null,P.stateNode=null):(P.childLanes=z.childLanes,P.lanes=z.lanes,P.child=z.child,P.subtreeFlags=0,P.deletions=null,P.memoizedProps=z.memoizedProps,P.memoizedState=z.memoizedState,P.updateQueue=z.updateQueue,P.type=z.type,e=z.dependencies,P.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),o=o.sibling;return vt(Et,Et.current&1|2),t.child}e=e.sibling}P.tail!==null&&wt()>Wr&&(t.flags|=128,w=!0,ji(P,!1),t.lanes=4194304)}else{if(!w)if(e=zo(z),e!==null){if(t.flags|=128,w=!0,o=e.updateQueue,o!==null&&(t.updateQueue=o,t.flags|=4),ji(P,!0),P.tail===null&&P.tailMode==="hidden"&&!z.alternate&&!kt)return Gt(t),null}else 2*wt()-P.renderingStartTime>Wr&&o!==1073741824&&(t.flags|=128,w=!0,ji(P,!1),t.lanes=4194304);P.isBackwards?(z.sibling=t.child,t.child=z):(o=P.last,o!==null?o.sibling=z:t.child=z,P.last=z)}return P.tail!==null?(t=P.tail,P.rendering=t,P.tail=t.sibling,P.renderingStartTime=wt(),t.sibling=null,o=Et.current,vt(Et,w?o&1|2:o&1),t):(Gt(t),null);case 22:case 23:return lc(),w=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==w&&(t.flags|=8192),w&&(t.mode&1)!==0?(mn&1073741824)!==0&&(Gt(t),t.subtreeFlags&6&&(t.flags|=8192)):Gt(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function g_(e,t){switch(ga(t),t.tag){case 1:return rn(t.type)&&Do(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fr(),St(sn),St(qt),Ra(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return La(t),null;case 13:if(St(Et),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));jr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return St(Et),null;case 4:return Fr(),null;case 10:return Sa(t.type._context),null;case 22:case 23:return lc(),null;case 24:return null;default:return null}}var Zo=!1,Yt=!1,__=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function $r(e,t){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(w){Rt(e,t,w)}else o.current=null}function Ya(e,t,o){try{o()}catch(w){Rt(e,t,w)}}var dd=!1;function v_(e,t){if(la=Vs,e=zu(),Zl(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var w=o.getSelection&&o.getSelection();if(w&&w.rangeCount!==0){o=w.anchorNode;var A=w.anchorOffset,P=w.focusNode;w=w.focusOffset;try{o.nodeType,P.nodeType}catch{o=null;break e}var z=0,Q=-1,ee=-1,ce=0,ve=0,be=e,_e=null;t:for(;;){for(var De;be!==o||A!==0&&be.nodeType!==3||(Q=z+A),be!==P||w!==0&&be.nodeType!==3||(ee=z+w),be.nodeType===3&&(z+=be.nodeValue.length),(De=be.firstChild)!==null;)_e=be,be=De;for(;;){if(be===e)break t;if(_e===o&&++ce===A&&(Q=z),_e===P&&++ve===w&&(ee=z),(De=be.nextSibling)!==null)break;be=_e,_e=be.parentNode}be=De}o=Q===-1||ee===-1?null:{start:Q,end:ee}}else o=null}o=o||{start:0,end:0}}else o=null;for(aa={focusedElem:e,selectionRange:o},Vs=!1,Oe=t;Oe!==null;)if(t=Oe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Oe=e;else for(;Oe!==null;){t=Oe;try{var Be=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(Be!==null){var $e=Be.memoizedProps,Nt=Be.memoizedState,oe=t.stateNode,ne=oe.getSnapshotBeforeUpdate(t.elementType===t.type?$e:Nn(t.type,$e),Nt);oe.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:var le=t.stateNode.containerInfo;le.nodeType===1?le.textContent="":le.nodeType===9&&le.documentElement&&le.removeChild(le.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(Se){Rt(t,t.return,Se)}if(e=t.sibling,e!==null){e.return=t.return,Oe=e;break}Oe=t.return}return Be=dd,dd=!1,Be}function Pi(e,t,o){var w=t.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var A=w=w.next;do{if((A.tag&e)===e){var P=A.destroy;A.destroy=void 0,P!==void 0&&Ya(t,o,P)}A=A.next}while(A!==w)}}function el(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var o=t=t.next;do{if((o.tag&e)===e){var w=o.create;o.destroy=w()}o=o.next}while(o!==t)}}function Xa(e){var t=e.ref;if(t!==null){var o=e.stateNode;switch(e.tag){case 5:e=o;break;default:e=o}typeof t=="function"?t(e):t.current=e}}function fd(e){var t=e.alternate;t!==null&&(e.alternate=null,fd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[$n],delete t[ki],delete t[da],delete t[e_],delete t[t_])),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 pd(e){return e.tag===5||e.tag===3||e.tag===4}function md(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||pd(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 Qa(e,t,o){var w=e.tag;if(w===5||w===6)e=e.stateNode,t?o.nodeType===8?o.parentNode.insertBefore(e,t):o.insertBefore(e,t):(o.nodeType===8?(t=o.parentNode,t.insertBefore(e,o)):(t=o,t.appendChild(e)),o=o._reactRootContainer,o!=null||t.onclick!==null||(t.onclick=Ao));else if(w!==4&&(e=e.child,e!==null))for(Qa(e,t,o),e=e.sibling;e!==null;)Qa(e,t,o),e=e.sibling}function Ja(e,t,o){var w=e.tag;if(w===5||w===6)e=e.stateNode,t?o.insertBefore(e,t):o.appendChild(e);else if(w!==4&&(e=e.child,e!==null))for(Ja(e,t,o),e=e.sibling;e!==null;)Ja(e,t,o),e=e.sibling}var Ut=null,Dn=!1;function Rs(e,t,o){for(o=o.child;o!==null;)gd(e,t,o),o=o.sibling}function gd(e,t,o){if(nn&&typeof nn.onCommitFiberUnmount=="function")try{nn.onCommitFiberUnmount(hr,o)}catch{}switch(o.tag){case 5:Yt||$r(o,t);case 6:var w=Ut,A=Dn;Ut=null,Rs(e,t,o),Ut=w,Dn=A,Ut!==null&&(Dn?(e=Ut,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):Ut.removeChild(o.stateNode));break;case 18:Ut!==null&&(Dn?(e=Ut,o=o.stateNode,e.nodeType===8?ha(e.parentNode,o):e.nodeType===1&&ha(e,o),ws(e)):ha(Ut,o.stateNode));break;case 4:w=Ut,A=Dn,Ut=o.stateNode.containerInfo,Dn=!0,Rs(e,t,o),Ut=w,Dn=A;break;case 0:case 11:case 14:case 15:if(!Yt&&(w=o.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){A=w=w.next;do{var P=A,z=P.destroy;P=P.tag,z!==void 0&&((P&2)!==0||(P&4)!==0)&&Ya(o,t,z),A=A.next}while(A!==w)}Rs(e,t,o);break;case 1:if(!Yt&&($r(o,t),w=o.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=o.memoizedProps,w.state=o.memoizedState,w.componentWillUnmount()}catch(Q){Rt(o,t,Q)}Rs(e,t,o);break;case 21:Rs(e,t,o);break;case 22:o.mode&1?(Yt=(w=Yt)||o.memoizedState!==null,Rs(e,t,o),Yt=w):Rs(e,t,o);break;default:Rs(e,t,o)}}function _d(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new __),t.forEach(function(w){var A=L_.bind(null,e,w);o.has(w)||(o.add(w),w.then(A,A))})}}function In(e,t){var o=t.deletions;if(o!==null)for(var w=0;w<o.length;w++){var A=o[w];try{var P=e,z=t,Q=z;e:for(;Q!==null;){switch(Q.tag){case 5:Ut=Q.stateNode,Dn=!1;break e;case 3:Ut=Q.stateNode.containerInfo,Dn=!0;break e;case 4:Ut=Q.stateNode.containerInfo,Dn=!0;break e}Q=Q.return}if(Ut===null)throw Error(i(160));gd(P,z,A),Ut=null,Dn=!1;var ee=A.alternate;ee!==null&&(ee.return=null),A.return=null}catch(ce){Rt(A,t,ce)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)vd(t,e),t=t.sibling}function vd(e,t){var o=e.alternate,w=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(In(t,e),zn(e),w&4){try{Pi(3,e,e.return),el(3,e)}catch($e){Rt(e,e.return,$e)}try{Pi(5,e,e.return)}catch($e){Rt(e,e.return,$e)}}break;case 1:In(t,e),zn(e),w&512&&o!==null&&$r(o,o.return);break;case 5:if(In(t,e),zn(e),w&512&&o!==null&&$r(o,o.return),e.flags&32){var A=e.stateNode;try{He(A,"")}catch($e){Rt(e,e.return,$e)}}if(w&4&&(A=e.stateNode,A!=null)){var P=e.memoizedProps,z=o!==null?o.memoizedProps:P,Q=e.type,ee=e.updateQueue;if(e.updateQueue=null,ee!==null)try{Q==="input"&&P.type==="radio"&&P.name!=null&&Qe(A,P),he(Q,z);var ce=he(Q,P);for(z=0;z<ee.length;z+=2){var ve=ee[z],be=ee[z+1];ve==="style"?st(A,be):ve==="dangerouslySetInnerHTML"?tt(A,be):ve==="children"?He(A,be):d(A,ve,be,ce)}switch(Q){case"input":Le(A,P);break;case"textarea":Ie(A,P);break;case"select":var _e=A._wrapperState.wasMultiple;A._wrapperState.wasMultiple=!!P.multiple;var De=P.value;De!=null?Te(A,!!P.multiple,De,!1):_e!==!!P.multiple&&(P.defaultValue!=null?Te(A,!!P.multiple,P.defaultValue,!0):Te(A,!!P.multiple,P.multiple?[]:"",!1))}A[ki]=P}catch($e){Rt(e,e.return,$e)}}break;case 6:if(In(t,e),zn(e),w&4){if(e.stateNode===null)throw Error(i(162));A=e.stateNode,P=e.memoizedProps;try{A.nodeValue=P}catch($e){Rt(e,e.return,$e)}}break;case 3:if(In(t,e),zn(e),w&4&&o!==null&&o.memoizedState.isDehydrated)try{ws(t.containerInfo)}catch($e){Rt(e,e.return,$e)}break;case 4:In(t,e),zn(e);break;case 13:In(t,e),zn(e),A=e.child,A.flags&8192&&(P=A.memoizedState!==null,A.stateNode.isHidden=P,!P||A.alternate!==null&&A.alternate.memoizedState!==null||(tc=wt())),w&4&&_d(e);break;case 22:if(ve=o!==null&&o.memoizedState!==null,e.mode&1?(Yt=(ce=Yt)||ve,In(t,e),Yt=ce):In(t,e),zn(e),w&8192){if(ce=e.memoizedState!==null,(e.stateNode.isHidden=ce)&&!ve&&(e.mode&1)!==0)for(Oe=e,ve=e.child;ve!==null;){for(be=Oe=ve;Oe!==null;){switch(_e=Oe,De=_e.child,_e.tag){case 0:case 11:case 14:case 15:Pi(4,_e,_e.return);break;case 1:$r(_e,_e.return);var Be=_e.stateNode;if(typeof Be.componentWillUnmount=="function"){w=_e,o=_e.return;try{t=w,Be.props=t.memoizedProps,Be.state=t.memoizedState,Be.componentWillUnmount()}catch($e){Rt(w,o,$e)}}break;case 5:$r(_e,_e.return);break;case 22:if(_e.memoizedState!==null){bd(be);continue}}De!==null?(De.return=_e,Oe=De):bd(be)}ve=ve.sibling}e:for(ve=null,be=e;;){if(be.tag===5){if(ve===null){ve=be;try{A=be.stateNode,ce?(P=A.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.display="none"):(Q=be.stateNode,ee=be.memoizedProps.style,z=ee!=null&&ee.hasOwnProperty("display")?ee.display:null,Q.style.display=at("display",z))}catch($e){Rt(e,e.return,$e)}}}else if(be.tag===6){if(ve===null)try{be.stateNode.nodeValue=ce?"":be.memoizedProps}catch($e){Rt(e,e.return,$e)}}else if((be.tag!==22&&be.tag!==23||be.memoizedState===null||be===e)&&be.child!==null){be.child.return=be,be=be.child;continue}if(be===e)break e;for(;be.sibling===null;){if(be.return===null||be.return===e)break e;ve===be&&(ve=null),be=be.return}ve===be&&(ve=null),be.sibling.return=be.return,be=be.sibling}}break;case 19:In(t,e),zn(e),w&4&&_d(e);break;case 21:break;default:In(t,e),zn(e)}}function zn(e){var t=e.flags;if(t&2){try{e:{for(var o=e.return;o!==null;){if(pd(o)){var w=o;break e}o=o.return}throw Error(i(160))}switch(w.tag){case 5:var A=w.stateNode;w.flags&32&&(He(A,""),w.flags&=-33);var P=md(e);Ja(e,P,A);break;case 3:case 4:var z=w.stateNode.containerInfo,Q=md(e);Qa(e,Q,z);break;default:throw Error(i(161))}}catch(ee){Rt(e,e.return,ee)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function y_(e,t,o){Oe=e,yd(e)}function yd(e,t,o){for(var w=(e.mode&1)!==0;Oe!==null;){var A=Oe,P=A.child;if(A.tag===22&&w){var z=A.memoizedState!==null||Zo;if(!z){var Q=A.alternate,ee=Q!==null&&Q.memoizedState!==null||Yt;Q=Zo;var ce=Yt;if(Zo=z,(Yt=ee)&&!ce)for(Oe=A;Oe!==null;)z=Oe,ee=z.child,z.tag===22&&z.memoizedState!==null?Sd(A):ee!==null?(ee.return=z,Oe=ee):Sd(A);for(;P!==null;)Oe=P,yd(P),P=P.sibling;Oe=A,Zo=Q,Yt=ce}wd(e)}else(A.subtreeFlags&8772)!==0&&P!==null?(P.return=A,Oe=P):wd(e)}}function wd(e){for(;Oe!==null;){var t=Oe;if((t.flags&8772)!==0){var o=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Yt||el(5,t);break;case 1:var w=t.stateNode;if(t.flags&4&&!Yt)if(o===null)w.componentDidMount();else{var A=t.elementType===t.type?o.memoizedProps:Nn(t.type,o.memoizedProps);w.componentDidUpdate(A,o.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var P=t.updateQueue;P!==null&&bh(t,P,w);break;case 3:var z=t.updateQueue;if(z!==null){if(o=null,t.child!==null)switch(t.child.tag){case 5:o=t.child.stateNode;break;case 1:o=t.child.stateNode}bh(t,z,o)}break;case 5:var Q=t.stateNode;if(o===null&&t.flags&4){o=Q;var ee=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":ee.autoFocus&&o.focus();break;case"img":ee.src&&(o.src=ee.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var ce=t.alternate;if(ce!==null){var ve=ce.memoizedState;if(ve!==null){var be=ve.dehydrated;be!==null&&ws(be)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}Yt||t.flags&512&&Xa(t)}catch(_e){Rt(t,t.return,_e)}}if(t===e){Oe=null;break}if(o=t.sibling,o!==null){o.return=t.return,Oe=o;break}Oe=t.return}}function bd(e){for(;Oe!==null;){var t=Oe;if(t===e){Oe=null;break}var o=t.sibling;if(o!==null){o.return=t.return,Oe=o;break}Oe=t.return}}function Sd(e){for(;Oe!==null;){var t=Oe;try{switch(t.tag){case 0:case 11:case 15:var o=t.return;try{el(4,t)}catch(ee){Rt(t,o,ee)}break;case 1:var w=t.stateNode;if(typeof w.componentDidMount=="function"){var A=t.return;try{w.componentDidMount()}catch(ee){Rt(t,A,ee)}}var P=t.return;try{Xa(t)}catch(ee){Rt(t,P,ee)}break;case 5:var z=t.return;try{Xa(t)}catch(ee){Rt(t,z,ee)}}}catch(ee){Rt(t,t.return,ee)}if(t===e){Oe=null;break}var Q=t.sibling;if(Q!==null){Q.return=t.return,Oe=Q;break}Oe=t.return}}var w_=Math.ceil,tl=k.ReactCurrentDispatcher,Za=k.ReactCurrentOwner,bn=k.ReactCurrentBatchConfig,ut=0,Ht=null,It=null,Wt=0,mn=0,Ur=xs(0),Pt=0,Oi=null,sr=0,nl=0,ec=0,Bi=null,ln=null,tc=0,Wr=1/0,ds=null,sl=!1,nc=null,Ms=null,rl=!1,As=null,il=0,Fi=0,sc=null,ol=-1,ll=0;function tn(){return(ut&6)!==0?wt():ol!==-1?ol:ol=wt()}function Ns(e){return(e.mode&1)===0?1:(ut&2)!==0&&Wt!==0?Wt&-Wt:s_.transition!==null?(ll===0&&(ll=ao()),ll):(e=dt,e!==0||(e=window.event,e=e===void 0?16:po(e.type)),e)}function jn(e,t,o,w){if(50<Fi)throw Fi=0,sc=null,Error(i(185));Zn(e,o,w),((ut&2)===0||e!==Ht)&&(e===Ht&&((ut&2)===0&&(nl|=o),Pt===4&&Ds(e,Wt)),an(e,w),o===1&&ut===0&&(t.mode&1)===0&&(Wr=wt()+500,jo&&Es()))}function an(e,t){var o=e.callbackNode;_s(e,t);var w=mr(e,e===Ht?Wt:0);if(w===0)o!==null&&io(o),e.callbackNode=null,e.callbackPriority=0;else if(t=w&-w,e.callbackPriority!==t){if(o!=null&&io(o),t===1)e.tag===0?n_(xd.bind(null,e)):ch(xd.bind(null,e)),Jg(function(){(ut&6)===0&&Es()}),o=null;else{switch(uo(w)){case 1:o=oi;break;case 4:o=ms;break;case 16:o=Jn;break;case 536870912:o=li;break;default:o=Jn}o=Nd(o,Cd.bind(null,e))}e.callbackPriority=t,e.callbackNode=o}}function Cd(e,t){if(ol=-1,ll=0,(ut&6)!==0)throw Error(i(327));var o=e.callbackNode;if(zr()&&e.callbackNode!==o)return null;var w=mr(e,e===Ht?Wt:0);if(w===0)return null;if((w&30)!==0||(w&e.expiredLanes)!==0||t)t=al(e,w);else{t=w;var A=ut;ut|=2;var P=Ed();(Ht!==e||Wt!==t)&&(ds=null,Wr=wt()+500,ir(e,t));do try{C_();break}catch(Q){kd(e,Q)}while(!0);ba(),tl.current=P,ut=A,It!==null?t=0:(Ht=null,Wt=0,t=Pt)}if(t!==0){if(t===2&&(A=vs(e),A!==0&&(w=A,t=rc(e,A))),t===1)throw o=Oi,ir(e,0),Ds(e,w),an(e,wt()),o;if(t===6)Ds(e,w);else{if(A=e.current.alternate,(w&30)===0&&!b_(A)&&(t=al(e,w),t===2&&(P=vs(e),P!==0&&(w=P,t=rc(e,P))),t===1))throw o=Oi,ir(e,0),Ds(e,w),an(e,wt()),o;switch(e.finishedWork=A,e.finishedLanes=w,t){case 0:case 1:throw Error(i(345));case 2:or(e,ln,ds);break;case 3:if(Ds(e,w),(w&130023424)===w&&(t=tc+500-wt(),10<t)){if(mr(e,0)!==0)break;if(A=e.suspendedLanes,(A&w)!==w){tn(),e.pingedLanes|=e.suspendedLanes&A;break}e.timeoutHandle=ua(or.bind(null,e,ln,ds),t);break}or(e,ln,ds);break;case 4:if(Ds(e,w),(w&4194240)===w)break;for(t=e.eventTimes,A=-1;0<w;){var z=31-Ot(w);P=1<<z,z=t[z],z>A&&(A=z),w&=~P}if(w=A,w=wt()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*w_(w/1960))-w,10<w){e.timeoutHandle=ua(or.bind(null,e,ln,ds),w);break}or(e,ln,ds);break;case 5:or(e,ln,ds);break;default:throw Error(i(329))}}}return an(e,wt()),e.callbackNode===o?Cd.bind(null,e):null}function rc(e,t){var o=Bi;return e.current.memoizedState.isDehydrated&&(ir(e,t).flags|=256),e=al(e,t),e!==2&&(t=ln,ln=o,t!==null&&ic(t)),e}function ic(e){ln===null?ln=e:ln.push.apply(ln,e)}function b_(e){for(var t=e;;){if(t.flags&16384){var o=t.updateQueue;if(o!==null&&(o=o.stores,o!==null))for(var w=0;w<o.length;w++){var A=o[w],P=A.getSnapshot;A=A.value;try{if(!Mn(P(),A))return!1}catch{return!1}}}if(o=t.child,t.subtreeFlags&16384&&o!==null)o.return=t,t=o;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 Ds(e,t){for(t&=~ec,t&=~nl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var o=31-Ot(t),w=1<<o;e[o]=-1,t&=~w}}function xd(e){if((ut&6)!==0)throw Error(i(327));zr();var t=mr(e,0);if((t&1)===0)return an(e,wt()),null;var o=al(e,t);if(e.tag!==0&&o===2){var w=vs(e);w!==0&&(t=w,o=rc(e,w))}if(o===1)throw o=Oi,ir(e,0),Ds(e,t),an(e,wt()),o;if(o===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,or(e,ln,ds),an(e,wt()),null}function oc(e,t){var o=ut;ut|=1;try{return e(t)}finally{ut=o,ut===0&&(Wr=wt()+500,jo&&Es())}}function rr(e){As!==null&&As.tag===0&&(ut&6)===0&&zr();var t=ut;ut|=1;var o=bn.transition,w=dt;try{if(bn.transition=null,dt=1,e)return e()}finally{dt=w,bn.transition=o,ut=t,(ut&6)===0&&Es()}}function lc(){mn=Ur.current,St(Ur)}function ir(e,t){e.finishedWork=null,e.finishedLanes=0;var o=e.timeoutHandle;if(o!==-1&&(e.timeoutHandle=-1,Qg(o)),It!==null)for(o=It.return;o!==null;){var w=o;switch(ga(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&Do();break;case 3:Fr(),St(sn),St(qt),Ra();break;case 5:La(w);break;case 4:Fr();break;case 13:St(Et);break;case 19:St(Et);break;case 10:Sa(w.type._context);break;case 22:case 23:lc()}o=o.return}if(Ht=e,It=e=Is(e.current,null),Wt=mn=t,Pt=0,Oi=null,ec=nl=sr=0,ln=Bi=null,er!==null){for(t=0;t<er.length;t++)if(o=er[t],w=o.interleaved,w!==null){o.interleaved=null;var A=w.next,P=o.pending;if(P!==null){var z=P.next;P.next=A,w.next=z}o.pending=w}er=null}return e}function kd(e,t){do{var o=It;try{if(ba(),Vo.current=Yo,qo){for(var w=Lt.memoizedState;w!==null;){var A=w.queue;A!==null&&(A.pending=null),w=w.next}qo=!1}if(nr=0,Ft=jt=Lt=null,Ai=!1,Ni=0,Za.current=null,o===null||o.return===null){Pt=1,Oi=t,It=null;break}e:{var P=e,z=o.return,Q=o,ee=t;if(t=Wt,Q.flags|=32768,ee!==null&&typeof ee=="object"&&typeof ee.then=="function"){var ce=ee,ve=Q,be=ve.tag;if((ve.mode&1)===0&&(be===0||be===11||be===15)){var _e=ve.alternate;_e?(ve.updateQueue=_e.updateQueue,ve.memoizedState=_e.memoizedState,ve.lanes=_e.lanes):(ve.updateQueue=null,ve.memoizedState=null)}var De=Xh(z);if(De!==null){De.flags&=-257,Qh(De,z,Q,P,t),De.mode&1&&Yh(P,ce,t),t=De,ee=ce;var Be=t.updateQueue;if(Be===null){var $e=new Set;$e.add(ee),t.updateQueue=$e}else Be.add(ee);break e}else{if((t&1)===0){Yh(P,ce,t),ac();break e}ee=Error(i(426))}}else if(kt&&Q.mode&1){var Nt=Xh(z);if(Nt!==null){(Nt.flags&65536)===0&&(Nt.flags|=256),Qh(Nt,z,Q,P,t),ya(Hr(ee,Q));break e}}P=ee=Hr(ee,Q),Pt!==4&&(Pt=2),Bi===null?Bi=[P]:Bi.push(P),P=z;do{switch(P.tag){case 3:P.flags|=65536,t&=-t,P.lanes|=t;var oe=Kh(P,ee,t);wh(P,oe);break e;case 1:Q=ee;var ne=P.type,le=P.stateNode;if((P.flags&128)===0&&(typeof ne.getDerivedStateFromError=="function"||le!==null&&typeof le.componentDidCatch=="function"&&(Ms===null||!Ms.has(le)))){P.flags|=65536,t&=-t,P.lanes|=t;var Se=Gh(P,Q,t);wh(P,Se);break e}}P=P.return}while(P!==null)}Td(o)}catch(We){t=We,It===o&&o!==null&&(It=o=o.return);continue}break}while(!0)}function Ed(){var e=tl.current;return tl.current=Yo,e===null?Yo:e}function ac(){(Pt===0||Pt===3||Pt===2)&&(Pt=4),Ht===null||(sr&268435455)===0&&(nl&268435455)===0||Ds(Ht,Wt)}function al(e,t){var o=ut;ut|=2;var w=Ed();(Ht!==e||Wt!==t)&&(ds=null,ir(e,t));do try{S_();break}catch(A){kd(e,A)}while(!0);if(ba(),ut=o,tl.current=w,It!==null)throw Error(i(261));return Ht=null,Wt=0,Pt}function S_(){for(;It!==null;)Ld(It)}function C_(){for(;It!==null&&!Ul();)Ld(It)}function Ld(e){var t=Ad(e.alternate,e,mn);e.memoizedProps=e.pendingProps,t===null?Td(e):It=t,Za.current=null}function Td(e){var t=e;do{var o=t.alternate;if(e=t.return,(t.flags&32768)===0){if(o=m_(o,t,mn),o!==null){It=o;return}}else{if(o=g_(o,t),o!==null){o.flags&=32767,It=o;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Pt=6,It=null;return}}if(t=t.sibling,t!==null){It=t;return}It=t=e}while(t!==null);Pt===0&&(Pt=5)}function or(e,t,o){var w=dt,A=bn.transition;try{bn.transition=null,dt=1,x_(e,t,o,w)}finally{bn.transition=A,dt=w}return null}function x_(e,t,o,w){do zr();while(As!==null);if((ut&6)!==0)throw Error(i(327));o=e.finishedWork;var A=e.finishedLanes;if(o===null)return null;if(e.finishedWork=null,e.finishedLanes=0,o===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var P=o.lanes|o.childLanes;if(co(e,P),e===Ht&&(It=Ht=null,Wt=0),(o.subtreeFlags&2064)===0&&(o.flags&2064)===0||rl||(rl=!0,Nd(Jn,function(){return zr(),null})),P=(o.flags&15990)!==0,(o.subtreeFlags&15990)!==0||P){P=bn.transition,bn.transition=null;var z=dt;dt=1;var Q=ut;ut|=4,Za.current=null,v_(e,o),vd(o,e),zg(aa),Vs=!!la,aa=la=null,e.current=o,y_(o),Wl(),ut=Q,dt=z,bn.transition=P}else e.current=o;if(rl&&(rl=!1,As=e,il=A),P=e.pendingLanes,P===0&&(Ms=null),ai(o.stateNode),an(e,wt()),t!==null)for(w=e.onRecoverableError,o=0;o<t.length;o++)A=t[o],w(A.value,{componentStack:A.stack,digest:A.digest});if(sl)throw sl=!1,e=nc,nc=null,e;return(il&1)!==0&&e.tag!==0&&zr(),P=e.pendingLanes,(P&1)!==0?e===sc?Fi++:(Fi=0,sc=e):Fi=0,Es(),null}function zr(){if(As!==null){var e=uo(il),t=bn.transition,o=dt;try{if(bn.transition=null,dt=16>e?16:e,As===null)var w=!1;else{if(e=As,As=null,il=0,(ut&6)!==0)throw Error(i(331));var A=ut;for(ut|=4,Oe=e.current;Oe!==null;){var P=Oe,z=P.child;if((Oe.flags&16)!==0){var Q=P.deletions;if(Q!==null){for(var ee=0;ee<Q.length;ee++){var ce=Q[ee];for(Oe=ce;Oe!==null;){var ve=Oe;switch(ve.tag){case 0:case 11:case 15:Pi(8,ve,P)}var be=ve.child;if(be!==null)be.return=ve,Oe=be;else for(;Oe!==null;){ve=Oe;var _e=ve.sibling,De=ve.return;if(fd(ve),ve===ce){Oe=null;break}if(_e!==null){_e.return=De,Oe=_e;break}Oe=De}}}var Be=P.alternate;if(Be!==null){var $e=Be.child;if($e!==null){Be.child=null;do{var Nt=$e.sibling;$e.sibling=null,$e=Nt}while($e!==null)}}Oe=P}}if((P.subtreeFlags&2064)!==0&&z!==null)z.return=P,Oe=z;else e:for(;Oe!==null;){if(P=Oe,(P.flags&2048)!==0)switch(P.tag){case 0:case 11:case 15:Pi(9,P,P.return)}var oe=P.sibling;if(oe!==null){oe.return=P.return,Oe=oe;break e}Oe=P.return}}var ne=e.current;for(Oe=ne;Oe!==null;){z=Oe;var le=z.child;if((z.subtreeFlags&2064)!==0&&le!==null)le.return=z,Oe=le;else e:for(z=ne;Oe!==null;){if(Q=Oe,(Q.flags&2048)!==0)try{switch(Q.tag){case 0:case 11:case 15:el(9,Q)}}catch(We){Rt(Q,Q.return,We)}if(Q===z){Oe=null;break e}var Se=Q.sibling;if(Se!==null){Se.return=Q.return,Oe=Se;break e}Oe=Q.return}}if(ut=A,Es(),nn&&typeof nn.onPostCommitFiberRoot=="function")try{nn.onPostCommitFiberRoot(hr,e)}catch{}w=!0}return w}finally{dt=o,bn.transition=t}}return!1}function Rd(e,t,o){t=Hr(o,t),t=Kh(e,t,1),e=Ts(e,t,1),t=tn(),e!==null&&(Zn(e,1,t),an(e,t))}function Rt(e,t,o){if(e.tag===3)Rd(e,e,o);else for(;t!==null;){if(t.tag===3){Rd(t,e,o);break}else if(t.tag===1){var w=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(Ms===null||!Ms.has(w))){e=Hr(o,e),e=Gh(t,e,1),t=Ts(t,e,1),e=tn(),t!==null&&(Zn(t,1,e),an(t,e));break}}t=t.return}}function k_(e,t,o){var w=e.pingCache;w!==null&&w.delete(t),t=tn(),e.pingedLanes|=e.suspendedLanes&o,Ht===e&&(Wt&o)===o&&(Pt===4||Pt===3&&(Wt&130023424)===Wt&&500>wt()-tc?ir(e,0):ec|=o),an(e,t)}function Md(e,t){t===0&&((e.mode&1)===0?t=1:(t=gs,gs<<=1,(gs&130023424)===0&&(gs=4194304)));var o=tn();e=cs(e,t),e!==null&&(Zn(e,t,o),an(e,o))}function E_(e){var t=e.memoizedState,o=0;t!==null&&(o=t.retryLane),Md(e,o)}function L_(e,t){var o=0;switch(e.tag){case 13:var w=e.stateNode,A=e.memoizedState;A!==null&&(o=A.retryLane);break;case 19:w=e.stateNode;break;default:throw Error(i(314))}w!==null&&w.delete(t),Md(e,o)}var Ad;Ad=function(e,t,o){if(e!==null)if(e.memoizedProps!==t.pendingProps||sn.current)on=!0;else{if((e.lanes&o)===0&&(t.flags&128)===0)return on=!1,p_(e,t,o);on=(e.flags&131072)!==0}else on=!1,kt&&(t.flags&1048576)!==0&&uh(t,Oo,t.index);switch(t.lanes=0,t.tag){case 2:var w=t.type;Jo(e,t),e=t.pendingProps;var A=Nr(t,qt.current);Br(t,o),A=Na(null,t,w,e,A,o);var P=Da();return t.flags|=1,typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,rn(w)?(P=!0,Io(t)):P=!1,t.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,ka(t),A.updater=Xo,t.stateNode=A,A._reactInternals=t,Fa(t,w,e,o),t=Wa(null,t,w,!0,P,o)):(t.tag=0,kt&&P&&ma(t),en(null,t,A,o),t=t.child),t;case 16:w=t.elementType;e:{switch(Jo(e,t),e=t.pendingProps,A=w._init,w=A(w._payload),t.type=w,A=t.tag=R_(w),e=Nn(w,e),A){case 0:t=Ua(null,t,w,e,o);break e;case 1:t=sd(null,t,w,e,o);break e;case 11:t=Jh(null,t,w,e,o);break e;case 14:t=Zh(null,t,w,Nn(w.type,e),o);break e}throw Error(i(306,w,""))}return t;case 0:return w=t.type,A=t.pendingProps,A=t.elementType===w?A:Nn(w,A),Ua(e,t,w,A,o);case 1:return w=t.type,A=t.pendingProps,A=t.elementType===w?A:Nn(w,A),sd(e,t,w,A,o);case 3:e:{if(rd(t),e===null)throw Error(i(387));w=t.pendingProps,P=t.memoizedState,A=P.element,yh(e,t),Wo(t,w,null,o);var z=t.memoizedState;if(w=z.element,P.isDehydrated)if(P={element:w,isDehydrated:!1,cache:z.cache,pendingSuspenseBoundaries:z.pendingSuspenseBoundaries,transitions:z.transitions},t.updateQueue.baseState=P,t.memoizedState=P,t.flags&256){A=Hr(Error(i(423)),t),t=id(e,t,w,o,A);break e}else if(w!==A){A=Hr(Error(i(424)),t),t=id(e,t,w,o,A);break e}else for(pn=Cs(t.stateNode.containerInfo.firstChild),fn=t,kt=!0,An=null,o=_h(t,null,w,o),t.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(jr(),w===A){t=hs(e,t,o);break e}en(e,t,w,o)}t=t.child}return t;case 5:return Sh(t),e===null&&va(t),w=t.type,A=t.pendingProps,P=e!==null?e.memoizedProps:null,z=A.children,ca(w,A)?z=null:P!==null&&ca(w,P)&&(t.flags|=32),nd(e,t),en(e,t,z,o),t.child;case 6:return e===null&&va(t),null;case 13:return od(e,t,o);case 4:return Ea(t,t.stateNode.containerInfo),w=t.pendingProps,e===null?t.child=Pr(t,null,w,o):en(e,t,w,o),t.child;case 11:return w=t.type,A=t.pendingProps,A=t.elementType===w?A:Nn(w,A),Jh(e,t,w,A,o);case 7:return en(e,t,t.pendingProps,o),t.child;case 8:return en(e,t,t.pendingProps.children,o),t.child;case 12:return en(e,t,t.pendingProps.children,o),t.child;case 10:e:{if(w=t.type._context,A=t.pendingProps,P=t.memoizedProps,z=A.value,vt(Ho,w._currentValue),w._currentValue=z,P!==null)if(Mn(P.value,z)){if(P.children===A.children&&!sn.current){t=hs(e,t,o);break e}}else for(P=t.child,P!==null&&(P.return=t);P!==null;){var Q=P.dependencies;if(Q!==null){z=P.child;for(var ee=Q.firstContext;ee!==null;){if(ee.context===w){if(P.tag===1){ee=us(-1,o&-o),ee.tag=2;var ce=P.updateQueue;if(ce!==null){ce=ce.shared;var ve=ce.pending;ve===null?ee.next=ee:(ee.next=ve.next,ve.next=ee),ce.pending=ee}}P.lanes|=o,ee=P.alternate,ee!==null&&(ee.lanes|=o),Ca(P.return,o,t),Q.lanes|=o;break}ee=ee.next}}else if(P.tag===10)z=P.type===t.type?null:P.child;else if(P.tag===18){if(z=P.return,z===null)throw Error(i(341));z.lanes|=o,Q=z.alternate,Q!==null&&(Q.lanes|=o),Ca(z,o,t),z=P.sibling}else z=P.child;if(z!==null)z.return=P;else for(z=P;z!==null;){if(z===t){z=null;break}if(P=z.sibling,P!==null){P.return=z.return,z=P;break}z=z.return}P=z}en(e,t,A.children,o),t=t.child}return t;case 9:return A=t.type,w=t.pendingProps.children,Br(t,o),A=yn(A),w=w(A),t.flags|=1,en(e,t,w,o),t.child;case 14:return w=t.type,A=Nn(w,t.pendingProps),A=Nn(w.type,A),Zh(e,t,w,A,o);case 15:return ed(e,t,t.type,t.pendingProps,o);case 17:return w=t.type,A=t.pendingProps,A=t.elementType===w?A:Nn(w,A),Jo(e,t),t.tag=1,rn(w)?(e=!0,Io(t)):e=!1,Br(t,o),Vh(t,w,A),Fa(t,w,A,o),Wa(null,t,w,!0,e,o);case 19:return ad(e,t,o);case 22:return td(e,t,o)}throw Error(i(156,t.tag))};function Nd(e,t){return ro(e,t)}function T_(e,t,o,w){this.tag=e,this.key=o,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=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sn(e,t,o,w){return new T_(e,t,o,w)}function cc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function R_(e){if(typeof e=="function")return cc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===B)return 11;if(e===V)return 14}return 2}function Is(e,t){var o=e.alternate;return o===null?(o=Sn(e.tag,t,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=t,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,t=e.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function cl(e,t,o,w,A,P){var z=2;if(w=e,typeof e=="function")cc(e)&&(z=1);else if(typeof e=="string")z=5;else e:switch(e){case M:return lr(o.children,A,P,t);case b:z=8,A|=8;break;case T:return e=Sn(12,o,t,A|2),e.elementType=T,e.lanes=P,e;case F:return e=Sn(13,o,t,A),e.elementType=F,e.lanes=P,e;case U:return e=Sn(19,o,t,A),e.elementType=U,e.lanes=P,e;case Y:return ul(o,A,P,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case N:z=10;break e;case O:z=9;break e;case B:z=11;break e;case V:z=14;break e;case X:z=16,w=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=Sn(z,o,t,A),t.elementType=e,t.type=w,t.lanes=P,t}function lr(e,t,o,w){return e=Sn(7,e,w,t),e.lanes=o,e}function ul(e,t,o,w){return e=Sn(22,e,w,t),e.elementType=Y,e.lanes=o,e.stateNode={isHidden:!1},e}function uc(e,t,o){return e=Sn(6,e,null,t),e.lanes=o,e}function hc(e,t,o){return t=Sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=o,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function M_(e,t,o,w,A){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=Bt(0),this.expirationTimes=Bt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bt(0),this.identifierPrefix=w,this.onRecoverableError=A,this.mutableSourceEagerHydrationData=null}function dc(e,t,o,w,A,P,z,Q,ee){return e=new M_(e,t,o,Q,ee),t===1?(t=1,P===!0&&(t|=8)):t=0,P=Sn(3,null,null,t),e.current=P,P.stateNode=e,P.memoizedState={element:w,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},ka(P),e}function A_(e,t,o){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:L,key:w==null?null:""+w,children:e,containerInfo:t,implementation:o}}function Dd(e){if(!e)return ks;e=e._reactInternals;e:{if(Qn(e)!==e||e.tag!==1)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(rn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(i(171))}if(e.tag===1){var o=e.type;if(rn(o))return lh(e,o,t)}return t}function Id(e,t,o,w,A,P,z,Q,ee){return e=dc(o,w,!0,e,A,P,z,Q,ee),e.context=Dd(null),o=e.current,w=tn(),A=Ns(o),P=us(w,A),P.callback=t??null,Ts(o,P,A),e.current.lanes=A,Zn(e,A,w),an(e,w),e}function hl(e,t,o,w){var A=t.current,P=tn(),z=Ns(A);return o=Dd(o),t.context===null?t.context=o:t.pendingContext=o,t=us(P,z),t.payload={element:e},w=w===void 0?null:w,w!==null&&(t.callback=w),e=Ts(A,t,z),e!==null&&(jn(e,A,z,P),Uo(e,A,z)),z}function dl(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 jd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<t?o:t}}function fc(e,t){jd(e,t),(e=e.alternate)&&jd(e,t)}function N_(){return null}var Pd=typeof reportError=="function"?reportError:function(e){console.error(e)};function pc(e){this._internalRoot=e}fl.prototype.render=pc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));hl(e,t,null,null)},fl.prototype.unmount=pc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;rr(function(){hl(null,e,null,null)}),t[is]=null}};function fl(e){this._internalRoot=e}fl.prototype.unstable_scheduleHydration=function(e){if(e){var t=ho();e={blockedOn:null,target:e,priority:t};for(var o=0;o<Ln.length&&t!==0&&t<Ln[o].priority;o++);Ln.splice(o,0,e),o===0&&fo(e)}};function mc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function pl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Od(){}function D_(e,t,o,w,A){if(A){if(typeof w=="function"){var P=w;w=function(){var ce=dl(z);P.call(ce)}}var z=Id(t,w,e,0,null,!1,!1,"",Od);return e._reactRootContainer=z,e[is]=z.current,Ci(e.nodeType===8?e.parentNode:e),rr(),z}for(;A=e.lastChild;)e.removeChild(A);if(typeof w=="function"){var Q=w;w=function(){var ce=dl(ee);Q.call(ce)}}var ee=dc(e,0,!1,null,null,!1,!1,"",Od);return e._reactRootContainer=ee,e[is]=ee.current,Ci(e.nodeType===8?e.parentNode:e),rr(function(){hl(t,ee,o,w)}),ee}function ml(e,t,o,w,A){var P=o._reactRootContainer;if(P){var z=P;if(typeof A=="function"){var Q=A;A=function(){var ee=dl(z);Q.call(ee)}}hl(t,z,e,A)}else z=D_(o,t,e,A,w);return dl(z)}ui=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var o=Vt(t.pendingLanes);o!==0&&(ci(t,o|1),an(t,wt()),(ut&6)===0&&(Wr=wt()+500,Es()))}break;case 13:rr(function(){var w=cs(e,1);if(w!==null){var A=tn();jn(w,e,1,A)}}),fc(e,1)}},hi=function(e){if(e.tag===13){var t=cs(e,134217728);if(t!==null){var o=tn();jn(t,e,134217728,o)}fc(e,134217728)}},gr=function(e){if(e.tag===13){var t=Ns(e),o=cs(e,t);if(o!==null){var w=tn();jn(o,e,t,w)}fc(e,t)}},ho=function(){return dt},di=function(e,t){var o=dt;try{return dt=e,t()}finally{dt=o}},pt=function(e,t,o){switch(t){case"input":if(Le(e,o),t=o.name,o.type==="radio"&&t!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<o.length;t++){var w=o[t];if(w!==e&&w.form===e.form){var A=No(w);if(!A)throw Error(i(90));fe(w),Le(w,A)}}}break;case"textarea":Ie(e,o);break;case"select":t=o.value,t!=null&&Te(e,!!o.multiple,t,!1)}},Cn=oc,Yn=rr;var I_={usingClientEntryPoint:!1,Events:[Ei,Mr,No,At,Tt,oc]},Hi={findFiberByHostInstance:Xs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},j_={bundleType:Hi.bundleType,version:Hi.version,rendererPackageName:Hi.rendererPackageName,rendererConfig:Hi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=so(e),e===null?null:e.stateNode},findFiberByHostInstance:Hi.findFiberByHostInstance||N_,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 gl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gl.isDisabled&&gl.supportsFiber)try{hr=gl.inject(j_),nn=gl}catch{}}return cn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I_,cn.createPortal=function(e,t){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mc(t))throw Error(i(200));return A_(e,t,null,o)},cn.createRoot=function(e,t){if(!mc(e))throw Error(i(299));var o=!1,w="",A=Pd;return t!=null&&(t.unstable_strictMode===!0&&(o=!0),t.identifierPrefix!==void 0&&(w=t.identifierPrefix),t.onRecoverableError!==void 0&&(A=t.onRecoverableError)),t=dc(e,1,!1,null,null,o,!1,w,A),e[is]=t.current,Ci(e.nodeType===8?e.parentNode:e),new pc(t)},cn.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(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=so(t),e=e===null?null:e.stateNode,e},cn.flushSync=function(e){return rr(e)},cn.hydrate=function(e,t,o){if(!pl(t))throw Error(i(200));return ml(null,e,t,!0,o)},cn.hydrateRoot=function(e,t,o){if(!mc(e))throw Error(i(405));var w=o!=null&&o.hydratedSources||null,A=!1,P="",z=Pd;if(o!=null&&(o.unstable_strictMode===!0&&(A=!0),o.identifierPrefix!==void 0&&(P=o.identifierPrefix),o.onRecoverableError!==void 0&&(z=o.onRecoverableError)),t=Id(t,null,e,1,o??null,A,!1,P,z),e[is]=t.current,Ci(e),w)for(e=0;e<w.length;e++)o=w[e],A=o._getVersion,A=A(o._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[o,A]:t.mutableSourceEagerHydrationData.push(o,A);return new fl(t)},cn.render=function(e,t,o){if(!pl(t))throw Error(i(200));return ml(null,e,t,!1,o)},cn.unmountComponentAtNode=function(e){if(!pl(e))throw Error(i(40));return e._reactRootContainer?(rr(function(){ml(null,null,e,!1,function(){e._reactRootContainer=null,e[is]=null})}),!0):!1},cn.unstable_batchedUpdates=oc,cn.unstable_renderSubtreeIntoContainer=function(e,t,o,w){if(!pl(o))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return ml(e,t,o,!1,w)},cn.version="18.3.1-next-f1338f8080-20240426",cn}var Vd;function Pp(){if(Vd)return vc.exports;Vd=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(),vc.exports=V_(),vc.exports}var qd;function q_(){if(qd)return _l;qd=1;var n=Pp();return _l.createRoot=n.createRoot,_l.hydrateRoot=n.hydrateRoot,_l}var K_=q_(),j=mu();const G_=F_(j);function Fe(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)?n:null}function je(n){return typeof n=="string"?n:null}function we(n){return typeof n=="string"&&n.length>0?n:null}function gt(n){return typeof n=="boolean"?n:null}function ze(n){return typeof n=="number"&&Number.isFinite(n)?n:null}function Cl(n){if(!Array.isArray(n))return null;const s=[];for(const i of n){if(typeof i!="string")return null;s.push(i)}return s}function Ct(n,s){if(!Array.isArray(n))return null;const i=[];for(const u of n){const _=s(u);if(_===null)return null;i.push(_)}return i}function un(n,s){if(!Array.isArray(n))return null;const i=[];for(const u of n){const _=s(u);_!==null&&i.push(_)}return i}function Je(n,s){return typeof n=="string"&&s.includes(n)?n:null}function Y_(n){try{return JSON.parse(n)}catch{return}}const X_=["auto","default","acceptEdits","plan"];function Yr(n){return typeof n=="string"&&X_.includes(n)}const Q_={agentUnknown:[],answerInterrupted:[],answerInvalid:[],answerNoFreeText:[],answerNotPending:[],answerSendFailed:[],answersUnsupported:[],archiveOpenTab:[],attachmentEmpty:["name"],attachmentExecutable:["name"],attachmentSaveFailed:[],attachmentTooLarge:["max","name","size"],badMessage:[],cliMissing:["command","url"],cliNotFound:[],cliNotInstalled:["label"],cliOpenFailed:[],continueFailed:[],continueHistoryMissing:[],continueNoFolder:[],continueNotInHistory:[],continueReadFailed:[],continueSameCli:[],continueTabFailed:[],continueTranscriptFailed:[],conversationNotFollowed:[],cwdMissing:["cwd"],cwdNotDir:["cwd"],diffBinaryUntracked:[],diffNewEmpty:[],diffNoStaged:[],diffNoUnstaged:[],diffReadFailed:[],dirReadFailed:[],dirSearchFailed:[],fileReadFailed:[],filesPerMessage:["max"],gitCommandFailed:["command"],gitMissing:[],gitNotFound:[],gitNotRepo:[],gitRunFailed:[],gitStatusUnknown:[],gitUnexpected:["command"],handoffEmpty:[],handoffNoTranscript:[],imageEmpty:[],imageTooLarge:["max","size"],imageTypeUnsupported:["type"],imageUnknownFormat:[],imagesPerMessage:["max"],imagesUnsupported:[],memoryAppeared:["file"],memoryBrokenBlock:["file"],memoryChooseFile:[],memoryGitFailed:["detail"],memoryHardLinks:["file"],memoryLinkOutside:["path"],memoryNotAFile:["label"],memoryNotInstalled:[],memoryNotUtf8:["file"],memoryNoteClaude:[],memoryNoteGone:[],memoryNoteHardLink:["path"],memoryNoteHardLinkCmd:["path"],memoryNoteName:[],memoryNoteOpenCode:[],memorySameFile:["file","other"],memoryViaEncoding:["file"],memoryViaFallback:[],memoryViaFile:["file"],memoryViaNoBlock:["file"],memoryViaNoBlockEither:[],memoryViaNoFolder:[],memoryViaNoIndex:[],memoryViaOutside:["file"],modePendingConfirmation:[],modeUnreachable:["key"],modesUnsupported:[],noteCliNotStarted:[],noteEmpty:[],noteExists:[],noteGone:[],noteIdInvalid:[],noteImageFailed:[],noteImagesMax:["max"],noteImagesUnsupported:[],noteInterrupted:[],noteNoAgent:[],noteNoReadySignal:[],noteSaveFailed:[],noteTooLong:["max"],notesMax:["max"],openToolSubmit:["label"],operationFailed:["detail"],pasteImageFailed:[],pathMissing:[],pathNotRelative:[],pathNullByte:[],pathOpenFailed:[],pathOutside:[],pendingSubmitAnswer:["label"],pendingSubmitPermission:["label"],pickerCliFolder:[],pickerClosed:[],pickerCreateFailed:[],pickerFolderExists:[],pickerListFailed:[],pickerNameChars:[],pickerNameInvalid:[],pickerNoProjectsHere:[],pickerNotListed:[],pickerRootMissing:[],pickerTooMany:[],planReadFailed:[],raw:["text"],relaunchCloseFailed:[],remoteDeviceGone:[],remoteFailed:[],remoteHostOnly:[],remoteNotActive:[],remoteOpensOnHost:[],remotePortInvalid:["max","min"],remoteTooManyDevices:["max"],searchFailed:[],settingsFailed:[],settingsHostOnly:[],settingsShellMissing:[],shellNotFound:[],submitInterrupted:[],submitStoppedTool:["label"],submitStoppedToolNoLabel:[],submitStoppedWaiting:["label"],submitStoppedWaitingNoLabel:[],tabClosedWhileOpening:[],tabDirGone:[],tabOpenFailed:[],terminalAsleep:[],terminalGone:[],terminalOpenFailed:[],tooManyTabs:["max"],vaultBusyMeasuring:[],vaultBusyMoving:[],vaultBusyWriting:[],vaultCannotWrite:[],vaultCurrentInsideTarget:[],vaultDiskFull:["detail"],vaultFailed:[],vaultIndexNotReady:[],vaultMeasureFirst:[],vaultMemoryFailed:["cwd","detail"],vaultMoveFailed:["detail"],vaultMoving:[],vaultNoCopyYet:[],vaultNotLoaded:[],vaultProjectGone:[],vaultReasonNewerFormat:[],vaultReasonOriginMissing:[],vaultReasonUnsafeId:[],vaultSessionFailed:["agent","detail","session"],vaultSessionMissing:[],vaultTargetCliFolder:[],vaultTargetInsideCurrent:[],vaultTargetNotAbsolute:[],waitingSubmit:["label"]};function J_(n){return Object.prototype.hasOwnProperty.call(Q_,n)}function Gn(n,s=0){const i=Fe(n);if(i===null)return null;const u=je(i.key);if(u===null||u.length===0)return null;const _=i.params;if(_===void 0)return{key:u};const R=Fe(_);if(R===null)return null;const x={};for(const[r,c]of Object.entries(R)){if(typeof c=="string"||typeof c=="number"&&Number.isFinite(c)){x[r]=c;continue}const g=s===0?Gn(c,s+1):null;if(g===null)return null;x[r]=g}return{key:u,params:x}}function Z_(n){if(!Array.isArray(n))return null;const s=[];for(const i of n){const u=Gn(i);if(u===null)return null;s.push(u)}return s}const Qr=["claude-code","codex","opencode","antigravity"],ev=["gemini-cli","antigravity-ide"],Ol=[...Qr,...ev],tv={"gemini-cli":"Gemini CLI","antigravity-ide":"Antigravity IDE"};function ti(n){return Qr.includes(n)}const nv=["at-quoted","bare-path-paste"],sv=["at"],rv=["usage-with-variants","token-count","usage-with-catalog","status-line"],iv=["child-session-marker"],ov=["active","missing","other-command","disabled","unreadable"];function Op(n,s=null){return!n.statusSource||s==="unknown"}const Bp={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 gu(n){return n.filter(s=>s.available).length>1}function lv(n){const s=Fe(n);if(s===null)return null;const i=s.modes;if(!Array.isArray(i)||i.length===0)return null;const u=[];for(const x of i){if(!Yr(x))return null;u.push(x)}const _=s.launchMode;if(!Yr(_)||!u.includes(_))return null;const R=we(s.keyLabel);return R===null?null:{modes:u,launchMode:_,keyLabel:R,approvesPendingOnCycle:s.approvesPendingOnCycle===!0}}function av(n){const s=Fe(n);if(s===null)return null;const i=Je(s.state,ov),u=we(s.settingsPath),_=we(s.scriptPath),R=s.fragment,x=R===null?null:we(R);return i===null||u===null||_===null||R!==null&&x===null?null:{state:i,settingsPath:u,scriptPath:_,fragment:x}}function cv(n){const s=Fe(n);if(s===null)return null;const i=we(s.value),u=je(s.label),_=je(s.family),R=gt(s.long),x=s.window,r=x===null?null:ze(x);return i===null||u===null||_===null||R===null||x!==null&&r===null?null:{value:i,label:u,family:_,long:R,window:r}}function uv(n){const s=Fe(n);if(s===null)return null;const i=we(s.value),u=je(s.label);return i===null||u===null?null:{value:i,label:u}}function Kd(n,s){const i=Ct(n,s);return i===null||i.length===0?null:i}function hv(n){const s=Fe(n);return s===null?{...Bp}:{sessionIdAtLaunch:s.sessionIdAtLaunch===!0,resume:s.resume===!0,statusSource:s.statusSource===!0,readySignal:s.readySignal===!0,permissionCycle:lv(s.permissionCycle),models:Kd(s.models,cv),efforts:Kd(s.efforts,uv),questionCards:s.questionCards===!0,imagesByPath:Je(s.imagesByPath,nv),fileMentions:Je(s.fileMentions,sv),rewind:s.rewind===!0,contextWindowSource:Je(s.contextWindowSource,rv),plans:s.plans===!0,waitingBlocksSubmit:s.waitingBlocksSubmit===!0}}function Gd(n){const s=Fe(n);if(s===null)return null;const i=Je(s.id,Qr),u=je(s.label),_=je(s.command),R=je(s.installUrl);return i===null||u===null||_===null||R===null?null:{id:i,label:u,command:_,available:s.available===!0,version:je(s.version),installUrl:R,missingMessage:Gn(s.missingMessage),capabilities:hv(s.capabilities),environmentNotice:Je(s.environmentNotice,iv),statusLine:av(s.statusLine)}}const dv=["custom","ai","first-message","none"],fv=["native","vault"],pv=["idle","scanning","ready"],mv=["agent","shell"],gv=["busy","idle","waiting","offline","unknown"],_v=["server-closed"];function vv(n){const s=Fe(n);if(s===null)return null;const i=we(s.sessionId),u=je(s.title),_=Je(s.titleSource,dv),R=ze(s.updatedAt),x=ze(s.sizeBytes);if(i===null||u===null||_===null||R===null||x===null)return null;const r=s.agent===void 0?"claude-code":Je(s.agent,Ol);if(r===null)return null;const c=je(s.cwd)??"";return{agent:r,sessionId:i,cwd:c,title:u,titleSource:_,updatedAt:R,sizeBytes:x,archived:s.archived===!0,storage:Je(s.storage,fv)??"native",partial:s.partial===!0}}function yv(n){const s=Fe(n);if(s===null)return null;const i=je(s.cwd),u=gt(s.cwdExists),_=un(s.sessions,vv),R=ze(s.lastActivityAt);if(i===null||u===null||_===null||R===null)return null;const x=we(s.key);if(x!==null)return{key:x,fallbackName:je(s.fallbackName)??"",cwd:i,cwdExists:u,sessions:_,lastActivityAt:R};const r=we(s.slug);return r===null?null:{key:r,fallbackName:i.length===0?r:"",cwd:i,cwdExists:u,sessions:_,lastActivityAt:R}}function wv(n){const s=Fe(n);if(s===null)return null;const i=Je(s.state,pv),u=ze(s.scannedFiles),_=ze(s.totalFiles);return i===null||u===null||_===null?null:{state:i,scannedFiles:u,totalFiles:_}}function Yd(n){const s=Fe(n);if(s===null)return null;const i=we(s.terminalId),u=Je(s.kind,mv)??"agent";let _=null;if(u==="agent"&&(_=s.agent===void 0?"claude-code":Je(s.agent,Qr),_===null))return null;const R=je(s.cwd),x=je(s.sessionId),r=je(s.label),c=gt(s.resumed),g=ze(s.createdAt),v=gt(s.alive);if(i===null||R===null||x===null||r===null||c===null||g===null||v===null)return null;const h=s.exitCode;return{terminalId:i,kind:u,agent:_,cwd:R,sessionId:x,label:r,resumed:c,createdAt:g,alive:v,exitCode:typeof h=="number"?h:null,sleeping:s.sleeping===!0,launchedAt:ze(s.launchedAt)}}const Fp=["user","assistant"],Hp=["content","attachment","pasted"],bv=["compacted","interrupted","error"],Sv=["cli-plans","project","scratch"],Cv=120,xv=20,bc={lastRequestTokens:0,lastOutputTokens:0,lastModel:null,contextWindow:null,contextWindowEstimated:!1,totalInputTokens:0,totalOutputTokens:0,totalCacheReadTokens:0,assistantMessages:0},Xd=["waiting","live","unavailable","no-transcript"];function kv(n){const s=Fe(n);if(s===null)return null;const i=ze(s.inputTokens),u=ze(s.outputTokens),_=ze(s.cacheCreationInputTokens),R=ze(s.cacheReadInputTokens);return i===null||u===null||_===null||R===null?null:{inputTokens:i,outputTokens:u,cacheCreationInputTokens:_,cacheReadInputTokens:R}}function Ev(n){const s=Fe(n);if(s===null)return null;const i=we(s.label);return i===null?null:{label:i,description:je(s.description)??""}}function Lv(n){const s=Fe(n);if(s===null)return null;const i=we(s.question),u=Ct(s.options,Ev);return i===null||u===null||u.length===0?null:{question:i,header:je(s.header)??"",multiSelect:s.multiSelect===!0,options:u}}function $p(n){const s=Fe(n);if(s===null)return null;switch(s.kind){case"text":{const i=je(s.text),u=gt(s.truncated);return i===null||u===null?null:{kind:"text",text:i,truncated:u}}case"tool-call":{const i=je(s.toolUseId),u=je(s.name),_=je(s.input),R=gt(s.truncated);return i===null||u===null||_===null||R===null?null:{kind:"tool-call",toolUseId:i,name:u,input:_,truncated:R}}case"tool-result":{const i=je(s.toolUseId),u=je(s.text),_=gt(s.isError),R=gt(s.truncated),x=ze(s.imageCount);return i===null||u===null||_===null||R===null||x===null?null:{kind:"tool-result",toolUseId:i,text:u,isError:_,truncated:R,imageCount:x}}case"thinking":return{kind:"thinking"};case"question":{const i=we(s.toolUseId),u=Ct(s.questions,Lv);return i===null||u===null||u.length===0?null:{kind:"question",toolUseId:i,questions:u}}case"image":{const i=ze(s.index),u=je(s.mediaType);if(i===null||u===null)return null;const _=Je(s.source,Hp)??"content";return{kind:"image",index:i,mediaType:u,source:_}}case"notice":{const i=Je(s.notice,bv);return i===null?null:{kind:"notice",notice:i,detail:je(s.detail)??""}}default:return null}}function Sc(n){const s=Fe(n);if(s===null)return null;const i=we(s.eventId),u=Je(s.role,Fp),_=ze(s.at),R=Ct(s.parts,$p);return i===null||u===null||_===null||R===null?null:{eventId:i,role:u,at:_,parts:R,model:je(s.model),usage:kv(s.usage),effort:je(s.effort),durationMs:ze(s.durationMs),queued:s.queued===!0}}function Tv(n){const s=Fe(n);if(s===null)return null;const i=we(s.toolUseId),u=je(s.description),_=ze(s.startedAt);return i===null||u===null||_===null?null:{toolUseId:i,description:u.slice(0,Cv),background:s.background===!0,startedAt:_}}function Qd(n){const s=Fe(n);if(s===null)return null;const i=ze(s.lastRequestTokens),u=ze(s.lastOutputTokens),_=ze(s.totalInputTokens),R=ze(s.totalOutputTokens),x=ze(s.totalCacheReadTokens),r=ze(s.assistantMessages);if(i===null||u===null||_===null||R===null||x===null||r===null)return null;const c=je(s.lastEffort);return{lastRequestTokens:i,lastOutputTokens:u,lastModel:je(s.lastModel),contextWindow:ze(s.contextWindow),contextWindowEstimated:s.contextWindowEstimated===!0,totalInputTokens:_,totalOutputTokens:R,totalCacheReadTokens:x,assistantMessages:r,...c!==null?{lastEffort:c}:{}}}function Rv(n){const s=Fe(n);if(s===null)return null;const i=we(s.fileName),u=we(s.title),_=ze(s.modifiedAt),R=ze(s.sizeBytes);if(i===null||u===null||_===null||R===null)return null;const x=s.origin,r=Sv.find(g=>g===x)??"cli-plans",c=je(s.path)??"";return{fileName:i,title:u,origin:r,path:c,exists:s.exists===!0,modifiedAt:_,sizeBytes:R}}function Mv(n){const s=Fe(n);if(s===null)return null;const i=we(s.fileName),u=je(s.text);return i===null||u===null?null:{fileName:i,text:u,truncated:s.truncated===!0}}const Up=[{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 Av(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 Nv(n,s=Up){const i=Dv(n,s);if(i===null||n===null)return null;const u=n.includes("[1m]");return s.find(_=>_.family===i&&_.long===u)??null}function Dv(n,s=Up){var u;return n===null||n.length===0?null:((u=s.filter(_=>_.family.length>0).sort((_,R)=>R.family.length-_.family.length).find(_=>n.includes(_.family)))==null?void 0:u.family)??null}function Iv(n){return`/model ${n}`}function jv(n){return`/effort ${n}`}const Pv=["staged","unstaged","untracked","conflict"],Ov=["added","modified","deleted","renamed","copied","type-changed","untracked","conflict"],Bv=["ready","not-a-repo","git-missing","error"],Cc={state:"not-a-repo",message:null,repoRoot:"",branch:null,head:null,upstream:null,ahead:0,behind:0,changes:[],worktrees:[],truncated:!1,updatedAt:0},Fv=["meta","hunk","context","added","removed"];function Hv(n){const s=Fe(n);if(s===null)return null;const i=we(s.path),u=Je(s.kind,Ov),_=Je(s.stage,Pv);return i===null||u===null||_===null?null:{path:i,kind:u,stage:_,oldPath:je(s.oldPath)}}function $v(n){const s=Fe(n);if(s===null)return null;const i=we(s.path);return i===null?null:{path:i,branch:je(s.branch),isCurrent:s.isCurrent===!0}}function Uv(n){const s=Fe(n);if(s===null)return null;const i=Je(s.state,Bv),u=je(s.repoRoot),_=ze(s.ahead),R=ze(s.behind),x=Ct(s.changes,Hv),r=Ct(s.worktrees,$v),c=ze(s.updatedAt);return i===null||u===null||_===null||R===null||x===null||r===null||c===null?null:{state:i,message:Gn(s.message),repoRoot:u,branch:je(s.branch),head:je(s.head),upstream:je(s.upstream),ahead:_,behind:R,changes:x,worktrees:r,truncated:s.truncated===!0,updatedAt:c}}function Wv(n){const s=Fe(n);if(s===null)return null;const i=Je(s.kind,Fv),u=je(s.text);return i===null||u===null?null:{kind:i,text:u,oldLine:ze(s.oldLine),newLine:ze(s.newLine)}}function zv(n){const s=Fe(n);if(s===null)return null;const i=we(s.path),u=gt(s.staged),_=Ct(s.lines,Wv);return i===null||u===null||_===null?null:{path:i,staged:u,lines:_,truncated:s.truncated===!0,binary:s.binary===!0,message:Gn(s.message)}}const Vv=["dir","file"],qv=["ignored","always"];function Wp(n){const s=Fe(n);if(s===null)return null;const i=we(s.name),u=we(s.path),_=Je(s.kind,Vv),R=ze(s.sizeBytes),x=ze(s.modifiedAt);if(i===null||u===null||_===null||R===null||x===null)return null;const r=Je(s.hidden,qv),c={name:i,path:u,kind:_,sizeBytes:R,modifiedAt:x};return r===null?c:{...c,hidden:r}}function Kv(n){const s=Fe(n);if(s===null)return null;const i=je(s.query),u=Ct(s.entries,Wp);return i===null||u===null?null:{query:i,entries:u,truncated:s.truncated===!0}}function Gv(n){const s=Fe(n);if(s===null)return null;const i=je(s.path),u=Ct(s.entries,Wp),_=ze(s.hiddenCount);return i===null||u===null||_===null?null:{path:i,entries:u,truncated:s.truncated===!0,hiddenCount:_}}function Yv(n){const s=Fe(n);if(s===null)return null;const i=we(s.path),u=je(s.text),_=ze(s.sizeBytes),R=gt(s.binary);return i===null||u===null||_===null||R===null?null:{path:i,language:je(s.language),text:u,sizeBytes:_,truncated:s.truncated===!0,binary:R}}function Xv(n){const s=Fe(n);if(s===null)return null;const i=we(s.pickerId),u=we(s.path),_=Ct(s.entries,x=>we(x)),R=Ct(s.roots,x=>we(x));return i===null||u===null||_===null||R===null?null:{pickerId:i,path:u,entries:_,roots:R,canGoUp:s.canGoUp===!0,truncated:s.truncated===!0}}const zp=1e6,Qv=100,Jv=999999;function Vp(n){return n.pasted.reduce((s,i)=>s+i.text.length,n.text.length)}function Ll(n){return n.text.trim().length===0&&n.pasted.every(s=>s.text.trim().length===0)}function qp(n,s){return n.text!==s.text||n.pasted.length!==s.pasted.length?!1:n.pasted.every((i,u)=>{const _=s.pasted[u];return _!==void 0&&_.number===i.number&&_.text===i.text})}function Zv(n){const s=Fe(n);if(s===null)return null;const i=s.number,u=je(s.text);return typeof i!="number"||!Number.isInteger(i)||i<1||i>Jv||u===null?null:{number:i,text:u}}function e0(n){const s=Fe(n);if(s===null)return null;const i=je(s.text),u=Ct(s.pasted,Zv);return i===null||u===null||u.length>Qv||new Set(u.map(_=>_.number)).size!==u.length?null:{text:i,pasted:u}}const Tl="MEMORY.md",_u=["AGENTS.md","CLAUDE.md"],Kp=["claude-code","codex","antigravity","opencode"],t0=["outside","encoding"],n0=["create","append-block","replace-block","append-lines","copy"];function s0(n){return{instructionFiles:[..._u],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 r0(n){const s=Fe(n);if(s===null)return null;const i=Je(s.name,_u),u=gt(s.exists),_=gt(s.hasBlock),R=gt(s.blockCurrent),x=gt(s.brokenBlock),r=s.problem,c=r===null?null:Je(r,t0);return i===null||u===null||_===null||R===null||x===null||r!==null&&c===null?null:{name:i,exists:u,hasBlock:_,blockCurrent:R,brokenBlock:x,problem:c}}function i0(n){const s=Fe(n);if(s===null)return null;switch(s.kind){case"not-repo":return{kind:"not-repo"};case"error":{const i=Gn(s.message);return i===null?null:{kind:"error",message:i}}case"repo":{const i=gt(s.ignored);if(i===null)return null;if(s.worktree===null)return{kind:"repo",ignored:i,worktree:null};const u=Fe(s.worktree);if(u===null)return null;const _=we(u.mainPath),R=gt(u.mainHasMemory);return _===null||R===null?null:{kind:"repo",ignored:i,worktree:{mainPath:_,mainHasMemory:R}}}default:return null}}function o0(n){const s=Fe(n);if(s===null)return null;const i=Je(s.agent,Kp),u=we(s.label),_=gt(s.reaches),R=Gn(s.via);return i===null||u===null||_===null||R===null?null:{agent:i,label:u,reaches:_,via:R}}function l0(n){const s=Fe(n);if(s===null)return null;const i=we(s.name),u=je(s.title),_=je(s.description),R=ze(s.sizeBytes),x=ze(s.modifiedAt);return i===null||u===null||_===null||R===null||x===null?null:{name:i,title:u,description:_,sizeBytes:R,modifiedAt:x}}const a0=["line","command","json"];function c0(n){const s=Fe(n);if(s===null)return null;const i=Je(s.agent,Kp),u=we(s.label),_=we(s.target),R=Je(s.kind,a0),x=we(s.text),r=Gn(s.note);return i===null||u===null||_===null||R===null||x===null||r===null?null:{agent:i,label:u,target:_,kind:R,text:x,note:r}}function u0(n){const s=Fe(n);if(s===null)return null;const i=we(s.cwd),u=gt(s.folderExists),_=gt(s.indexExists),R=gt(s.installed),x=Ct(s.notes,l0),r=Ct(s.files,r0),c=i0(s.git),g=Ct(s.reach,o0),v=Fe(s.native),h=v===null?null:ze(v.available),y=v===null?null:ze(v.pending),S=Ct(s.globalFragments,c0);return i===null||u===null||_===null||R===null||x===null||r===null||c===null||g===null||h===null||y===null||S===null?null:{cwd:i,folderExists:u,indexExists:_,installed:R,notes:x,files:r,git:c,reach:g,native:{available:h,pending:y},globalFragments:S}}function Jd(n){const s=Fe(n);if(s===null)return null;const i=we(s.file),u=Je(s.action,n0),_=je(s.preview),R=je(s.copiedFrom);return i===null||u===null||_===null?null:{file:i,action:u,preview:_,copiedFrom:R}}function h0(n){const s=Fe(n);if(s===null)return null;const i=we(s.name),u=je(s.text),_=gt(s.truncated);return i===null||u===null||_===null?null:{name:i,text:u,truncated:_}}const Zd=20;function d0(n,s="Nota"){const i=n.text.split(`
41
- `).map(u=>u.trim()).find(u=>u.length>0);return i===void 0?n.images.length>0?"Imagen":s:i.length>40?`${i.slice(0,40)}…`:i}function f0(n){const s=Fe(n);if(s===null)return null;const i=we(s.imageId),u=we(s.mediaType),_=ze(s.bytes);return i===null||u===null||_===null?null:{imageId:i,mediaType:u,bytes:_}}function p0(n){const s=Fe(n);if(s===null)return null;const i=we(s.noteId),u=je(s.text),_=Ct(s.images,f0),R=ze(s.createdAt),x=ze(s.updatedAt);return i===null||u===null||_===null?null:{noteId:i,text:u,images:_,createdAt:R??0,updatedAt:x??0}}const Gp=3,m0=3e4,g0=["results","time"];function Jr(n){return typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}function Vi(n,s){if(n==null)return null;const i=s(n);return i===null?void 0:i}function Yp(n){const s=Fe(n);if(s===null)return null;const i=Je(s.agent,Ol),u=we(s.sessionId),_=Vi(s.cwd,je),R=je(s.title),x=Vi(s.eventId,we),r=Vi(s.role,y=>Je(y,Fp)),c=Vi(s.at,ze),g=je(s.snippet),v=Jr(s.matchStart),h=Jr(s.matchLength);return i===null||u===null||_===void 0||R===null||x===void 0||r===void 0||c===void 0||g===null||v===null||h===null||v+h>g.length?null:{agent:i,sessionId:u,cwd:_,title:R,eventId:x,role:r,at:c,snippet:g,matchStart:v,matchLength:h}}function _0(n){const s=Fe(n);if(s===null)return null;const i=je(s.query),u=un(s.hits,Yp),_=Jr(s.sessionsScanned),R=Jr(s.sessionsTotal),x=Vi(s.truncated,r=>Je(r,g0));return i===null||u===null||_===null||R===null||_>R||x===void 0?null:{query:i,hits:u,sessionsScanned:_,sessionsTotal:R,truncated:x}}function v0(n){const s=Fe(n);if(s===null)return null;const i=je(s.query),u=un(s.hits,Yp),_=Jr(s.sessionsScanned),R=Jr(s.sessionsTotal);return i===null||u===null||_===null||R===null||_>R?null:{query:i,hits:u,sessionsScanned:_,sessionsTotal:R}}const y0=["off","idle","measuring","writing","moving"];function Qt(n){return typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}function Ui(n,s){if(n==null)return null;const i=s(n);return i===null?void 0:i}function w0(n){const s=Fe(n);if(s===null)return null;const i=Je(s.agent,Ol),u=Qt(s.sessions),_=Qt(s.eventBytes),R=Qt(s.images),x=Qt(s.imageBytes),r=Qt(s.skippedArchived),c=Qt(s.skippedEmpty),g=Qt(s.unsupported),v=Qt(s.failed),h=Z_(s.failureReasons);return i===null||u===null||_===null||R===null||x===null||r===null||c===null||g===null||v===null||h===null?null:{agent:i,sessions:u,eventBytes:_,images:R,imageBytes:x,skippedArchived:r,skippedEmpty:c,unsupported:g,failed:v,failureReasons:h}}function b0(n){const s=Fe(n);if(s===null)return null;const i=ze(s.measuredAt),u=ze(s.durationMs),_=un(s.byAgent,w0),R=Qt(s.memoryProjects),x=Qt(s.memoryBytes);return i===null||u===null||_===null||R===null||x===null?null:{measuredAt:i,durationMs:u,byAgent:_,memoryProjects:R,memoryBytes:x}}function S0(n){const s=Fe(n);if(s===null)return null;const i=Qt(s.done),u=Qt(s.total);return i===null||u===null?null:{done:i,total:u}}function C0(n){const s=Fe(n);if(s===null)return null;const i=gt(s.enabled),u=je(s.dir),_=gt(s.isDefaultDir),R=Je(s.state,y0),x=Qt(s.sessions),r=Qt(s.passSessions),c=Qt(s.bytes),g=Qt(s.pending),v=Ui(s.progress,S0),h=Ui(s.lastPassAt,ze),y=Ui(s.measurement,b0),S=Ui(s.previousDir,je),E=Ui(s.lastError,Gn);return i===null||u===null||_===null||R===null||x===null||r===null||c===null||g===null||v===void 0||h===void 0||y===void 0||S===void 0||E===void 0?null:{enabled:i,dir:u,isDefaultDir:_,state:R,progress:v,sessions:x,passSessions:r,bytes:c,lastPassAt:h,pending:g,measurement:y,previousDir:S,lastError:E}}const Xp=1024,Qp=65535,x0="pair",k0=4001;function E0(n){return typeof n=="number"&&Number.isInteger(n)&&n>=Xp&&n<=Qp}const L0=["off","active","restart-needed","port-busy"];function T0(n){const s=Fe(n);if(s===null)return null;const i=we(s.id),u=je(s.label),_=ze(s.createdAt),R=gt(s.connected);if(i===null||u===null||_===null||R===null)return null;const x=s.lastSeenAt,r=x==null?null:ze(x);return x!=null&&r===null?null:{id:i,label:u,createdAt:_,lastSeenAt:r,connected:R}}function R0(n){const s=Fe(n);if(s===null)return null;const i=gt(s.enabled),u=ze(s.port),_=Je(s.state,L0),R=ze(s.listeningPort),x=je(s.sshUser),r=Cl(s.hostNames),c=gt(s.pairingActive),g=Ct(s.devices,T0);return i===null||u===null||_===null||R===null||x===null||r===null||c===null||g===null?null:{enabled:i,port:u,state:_,listeningPort:R,sshUser:x,hostNames:r,pairingActive:c,devices:g}}function M0(n){const s=Fe(n);if(s===null)return null;const i=we(s.code),u=ze(s.expiresAt);return i===null||u===null?null:{code:i,expiresAt:u}}const A0=["powershell-admin","powershell","terminal"];function N0(n){const s=Fe(n);if(s===null)return null;const i=we(s.payload),u=we(s.authorizeCommand),_=Je(s.shell,A0),R=we(s.code),x=ze(s.expiresAt);return i===null||u===null||_===null||R===null||x===null?null:{payload:i,authorizeCommand:u,shell:_,code:R,expiresAt:x}}const D0=["auto","pwsh","powershell","cmd","git-bash","login","bash","sh","zsh"];function Jp(n){return Je(n,D0)}function I0(n){const s=Fe(n);if(s===null)return null;const i=Jp(s.id),u=we(s.label);return i===null||i==="auto"||u===null?null:{id:i,label:u}}function ef(n){return Array.isArray(n)?[...new Set(n.filter(s=>typeof s=="string"&&ti(s)))]:null}function j0(n){const s=Fe(n);if(s===null)return null;const i=Jp(s.consoleShell),u=un(s.consoleShells,I0),_=s.shellName,R=_===null?null:we(_),x=ef(s.disabledAgents),r=ef(s.disabledAtStart);return i===null||u===null||x===null||r===null||_!==null&&R===null?null:{consoleShell:i,consoleShells:u,shellName:R,disabledAgents:x,disabledAtStart:r}}const Kr=8,P0="/ws",Yc="token",Rl=12*1024*1024,xc=8,tf=10*1024*1024,kc=4,O0=["sending","prefilled"],B0=["no-delivery","not-ready","send-failed"],F0=["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","remote-failed","settings-failed","remote-refused","agent-unsupported","internal"];function H0(n){const s={model:null,effort:null,contextWindow:null};if(typeof n!="object"||n===null)return s;const i=n;return{model:we(i.model),effort:we(i.effort),contextWindow:ze(i.contextWindow)}}function $0(n){const s=Fe(n);if(s===null)return null;const i=we(s.terminalId),u=e0(s.draft);return i===null||u===null?null:{terminalId:i,draft:u}}function nf(n){return typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}function vl(n,s){const i=we(s.requestId);return i!==null&&(n.requestId=i),n}function sf(n){var s;return((s=un(n,Tv))==null?void 0:s.slice(0,xv))??null}function U0(n){const s=Fe(Y_(n));if(s===null)return null;switch(s.type){case"hello":{const i=ze(s.protocolVersion),u=je(s.platform),_=je(s.defaultCwd);return i===null||u===null||_===null?null:{type:"hello",protocolVersion:i,agents:un(s.agents,Gd)??[],defaultAgent:Je(s.defaultAgent,Qr),platform:u,defaultCwd:_,shellName:we(s.shellName),remoteClient:s.remoteClient===!0}}case"agents":{const i=un(s.agents,Gd);return i===null?null:{type:"agents",agents:i,defaultAgent:Je(s.defaultAgent,Qr)}}case"terminal.list":{const i=un(s.terminals,Yd),u=Cl(s.order);return i===null||u===null?null:{type:"terminal.list",terminals:i,order:u}}case"terminal.opened":{const i=we(s.requestId),u=Yd(s.terminal);return i===null||u===null?null:{type:"terminal.opened",requestId:i,terminal:u}}case"terminal.output":{const i=we(s.terminalId),u=je(s.data);return i===null||u===null?null:{type:"terminal.output",terminalId:i,data:u}}case"terminal.replay":{const i=we(s.terminalId),u=je(s.data);return i===null||u===null?null:{type:"terminal.replay",terminalId:i,data:u,truncated:s.truncated===!0}}case"terminal.exit":{const i=we(s.terminalId),u=ze(s.exitCode);if(i===null||u===null)return null;const _=s.signal;return{type:"terminal.exit",terminalId:i,exitCode:u,signal:typeof _=="number"?_:null}}case"terminal.closed":{const i=we(s.terminalId);return i===null?null:{type:"terminal.closed",terminalId:i}}case"terminal.activity":{const i=we(s.terminalId),u=Je(s.activity,gv);if(i===null||u===null)return null;const _=u==="offline"?Je(s.offlineReason,_v):null;return _===null?{type:"terminal.activity",terminalId:i,activity:u}:{type:"terminal.activity",terminalId:i,activity:u,offlineReason:_}}case"index.status":{const i=wv(s.status);return i===null?null:{type:"index.status",status:i}}case"index.projects":{const i=un(s.projects,yv);return i===null?null:{type:"index.projects",projects:i,replace:s.replace===!0}}case"conversation.reset":{const i=we(s.terminalId),u=je(s.sessionId),_=Je(s.state,Xd),R=un(s.events,Sc),x=Qd(s.usage);return i===null||u===null||_===null||R===null||x===null?null:{type:"conversation.reset",terminalId:i,sessionId:u,state:_,events:R,hasMore:s.hasMore===!0,usage:x,permissionMode:Yr(s.permissionMode)?s.permissionMode:null,defaults:H0(s.defaults),waitingFor:we(s.waitingFor),openToolCall:s.openToolCall===!0,subagents:sf(s.subagents)??[]}}case"conversation.subagents":{const i=we(s.terminalId),u=sf(s.subagents);return i===null||u===null?null:{type:"conversation.subagents",terminalId:i,subagents:u}}case"agent.submitted":{const i=we(s.terminalId),u=we(s.requestId),_=gt(s.delivered);return i===null||u===null||_===null?null:{type:"agent.submitted",terminalId:i,requestId:u,delivered:_}}case"conversation.append":{const i=we(s.terminalId),u=un(s.events,Sc),_=Qd(s.usage);return i===null||u===null||_===null?null:{type:"conversation.append",terminalId:i,events:u,usage:_,permissionMode:Yr(s.permissionMode)?s.permissionMode:null}}case"conversation.mode":{const i=we(s.terminalId),u=s.mode;return i===null||!Yr(u)?null:{type:"conversation.mode",terminalId:i,mode:u}}case"conversation.waiting":{const i=we(s.terminalId);return i===null?null:{type:"conversation.waiting",terminalId:i,waitingFor:we(s.waitingFor)}}case"conversation.toolCall":{const i=we(s.terminalId),u=gt(s.open);return i===null||u===null?null:{type:"conversation.toolCall",terminalId:i,open:u}}case"conversation.page":{const i=we(s.terminalId),u=un(s.events,Sc);return i===null||u===null?null:{type:"conversation.page",terminalId:i,events:u,hasMore:s.hasMore===!0}}case"conversation.turns":{const i=we(s.terminalId),u=Ct(s.turns,_=>{const R=Fe(_);if(R===null)return null;const x=we(R.eventId),r=ze(R.durationMs);return x===null||r===null?null:{eventId:x,durationMs:r}});return i===null||u===null?null:{type:"conversation.turns",terminalId:i,turns:u}}case"conversation.parts":{const i=we(s.terminalId),u=Ct(s.updates,_=>{const R=Fe(_);if(R===null)return null;const x=we(R.eventId),r=Ct(R.parts,$p);return x===null||r===null?null:{eventId:x,parts:r}});return i===null||u===null?null:{type:"conversation.parts",terminalId:i,updates:u}}case"conversation.imageData":{const i=we(s.terminalId),u=we(s.eventId),_=ze(s.index),R=je(s.mediaType);if(i===null||u===null||_===null||R===null)return null;const x=s.data;return{type:"conversation.imageData",terminalId:i,eventId:u,index:_,source:Je(s.source,Hp)??"content",mediaType:R,data:typeof x=="string"?x:null}}case"conversation.state":{const i=we(s.terminalId),u=Je(s.state,Xd);return i===null||u===null?null:{type:"conversation.state",terminalId:i,state:u}}case"git.status":{const i=we(s.terminalId),u=Uv(s.status);return i===null||u===null?null:{type:"git.status",terminalId:i,status:u}}case"git.diff":{const i=we(s.terminalId),u=zv(s.diff);return i===null||u===null?null:{type:"git.diff",terminalId:i,diff:u}}case"files.listing":{const i=we(s.terminalId),u=Gv(s.listing);return i===null||u===null?null:{type:"files.listing",terminalId:i,listing:u}}case"picker.listing":{const i=Xv(s.listing);return i===null?null:{type:"picker.listing",listing:i}}case"files.preview":{const i=we(s.terminalId),u=Yv(s.preview);return i===null||u===null?null:{type:"files.preview",terminalId:i,preview:u}}case"conversation.plans":{const i=we(s.terminalId),u=Ct(s.plans,Rv);return i===null||u===null?null:{type:"conversation.plans",terminalId:i,plans:u}}case"plans.content":{const i=we(s.terminalId),u=Mv(s.plan);return i===null||u===null?null:{type:"plans.content",terminalId:i,plan:u}}case"files.results":{const i=we(s.terminalId),u=Kv(s.result);return i===null||u===null?null:{type:"files.results",terminalId:i,result:u}}case"notes.list":{const i=Ct(s.notes,p0);return i===null?null:{type:"notes.list",notes:i}}case"notes.imageData":{const i=we(s.imageId),u=je(s.mediaType);if(i===null||u===null)return null;const _=s.data;return{type:"notes.imageData",imageId:i,mediaType:u,data:typeof _=="string"?_:null}}case"memory.status":{const i=we(s.terminalId),u=u0(s.status);return i===null||u===null?null:{type:"memory.status",terminalId:i,status:u}}case"memory.planned":{const i=we(s.terminalId),u=Ct(s.changes,Jd);return i===null||u===null?null:vl({type:"memory.planned",terminalId:i,changes:u},s)}case"memory.installed":{const i=we(s.terminalId),u=Ct(s.applied,Jd);return i===null||u===null?null:vl({type:"memory.installed",terminalId:i,applied:u},s)}case"memory.imported":{const i=we(s.terminalId),u=Cl(s.copied),_=Cl(s.skipped);return i===null||u===null||_===null?null:vl({type:"memory.imported",terminalId:i,copied:u,skipped:_},s)}case"memory.content":{const i=we(s.terminalId),u=h0(s.note);return i===null||u===null?null:vl({type:"memory.content",terminalId:i,note:u},s)}case"vault.status":{const i=C0(s.status);return i===null?null:{type:"vault.status",status:i}}case"vault.exported":{const i=we(s.projectKey),u=ze(s.sessions);return i===null||u===null?null:{type:"vault.exported",projectKey:i,sessions:u}}case"session.continued":{const i=we(s.requestId),u=we(s.terminalId),_=Fe(s.source),R=Je(_==null?void 0:_.agent,Ol),x=we(_==null?void 0:_.sessionId),r=je(_==null?void 0:_.title),c=nf(s.includedTurns),g=nf(s.totalTurns),v=Je(s.delivery,O0);return i===null||u===null||R===null||x===null||r===null||c===null||g===null||c>g||v===null?null:{type:"session.continued",requestId:i,terminalId:u,source:{agent:R,sessionId:x,title:r},includedTurns:c,totalTurns:g,totalTurnsIsMinimum:s.totalTurnsIsMinimum===!0,delivery:v}}case"composer.prefill":{const i=we(s.terminalId),u=we(s.text),_=Je(s.reason,B0);return i===null||u===null||_===null?null:{type:"composer.prefill",terminalId:i,text:u,reason:_}}case"composer.drafts":{const i=un(s.drafts,$0);return i===null?null:{type:"composer.drafts",drafts:i}}case"search.progress":{const i=we(s.searchId),u=v0(s.progress);return i===null||u===null?null:{type:"search.progress",searchId:i,progress:u}}case"remote.status":{const i=R0(s.status);return i===null?null:{type:"remote.status",status:i}}case"settings.status":{const i=j0(s.settings);return i===null?null:{type:"settings.status",settings:i}}case"remote.pairing.code":{const i=M0(s.pairing);return i===null?null:{type:"remote.pairing.code",pairing:i}}case"remote.phone.pairing":{const i=N0(s.pairing);return i===null?null:{type:"remote.phone.pairing",pairing:i}}case"search.results":{const i=we(s.searchId),u=_0(s.result);return i===null||u===null?null:{type:"search.results",searchId:i,result:u}}case"error":{const i=Gn(s.text);if(i===null)return null;const _={type:"error",code:Je(s.code,F0)??"internal",text:i},R=je(s.detail);R!==null&&(_.detail=R);const x=we(s.requestId);return x!==null&&(_.requestId=x),_}default:return null}}function rf(n){return JSON.stringify(n)}const W0=/^[A-Za-z]:\\$/;function Zr(n,s){return n.length===0?"":s==="win32"?z0(n):V0(n)}function z0(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("\\")&&!W0.test(s);)s=s.slice(0,-1);return s.toLowerCase()}function Zp(n,s,i){return n.length===0||i==="win32"&&n!==s&&n.toLowerCase()===s.toLowerCase()?s:n}function V0(n){let s=n.replace(/\/+/g,"/");for(;s.length>1&&s.endsWith("/");)s=s.slice(0,-1);return s}function q0(n,s,i,u){const _=Zr(i.cwd,u);let R=-1;for(const[x,r]of n.entries()){const c=s(r);c===void 0||c.kind!=="agent"||Zr(c.cwd,u)===_&&(R=x)}return R===-1?n.length:R+1}function em(n){return`[Pasted text #${n}]`}function K0(n){return`[Start of pasted text #${n}]`}function G0(n){return`[End of pasted text #${n}]`}function Y0(){return/(^|\n)\[Start of pasted text #(\d{1,6})\]\n([\s\S]*?)\n\[End of pasted text #\2\](?=\n|$)/g}function X0(){return/(^|\n)\[Start of pasted text #(\d{1,6})\]\n/}function Q0(){return/\[Pasted text #(\d{1,6})\]/g}const tm="https://buymeacoffee.com/cvelasquez",J0="modulepreload",Z0=function(n){return"/"+n},of={},Vn=function(s,i,u){let _=Promise.resolve();if(i&&i.length>0){let x=function(g){return Promise.all(g.map(v=>Promise.resolve(v).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),c=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));_=x(i.map(g=>{if(g=Z0(g),g in of)return;of[g]=!0;const v=g.endsWith(".css"),h=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${h}`))return;const y=document.createElement("link");if(y.rel=v?"stylesheet":J0,v||(y.as="script"),y.crossOrigin="",y.href=g,c&&y.setAttribute("nonce",c),document.head.appendChild(y),v)return new Promise((S,E)=>{y.addEventListener("load",S),y.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${g}`)))})}))}function R(x){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=x,window.dispatchEvent(r),!r.defaultPrevented)throw x}return _.then(x=>{for(const r of x||[])r.status==="rejected"&&R(r.reason);return s().catch(R)})},ey={"agent.composer.imagesRefused":"This CLI doesn't take images from the message box.","agent.continue.discovering":"The session isn't in the history yet: it shows up with the first message.","agent.continue.noConversation":"This tab doesn't have a conversation to continue yet.","agent.continue.noMessages":"This conversation doesn't have any messages to continue yet.","agent.continue.title":"Continue this conversation with another CLI","agent.dot.idle":"Ready, nothing in progress","agent.dot.noStatus":"This CLI doesn't publish its status","agent.dot.open":"CLI open","agent.dot.statusLineOnly":"This CLI only publishes its status with the status line configured","agent.dot.statusLinePending":"The status line hasn't published this conversation's status yet","agent.handoff.notice":"Continued from {{label}}: the agent starts from a transcript of {{turns}}, not from the context it had. Tool results are trimmed and images don't carry over.","agent.handoff.prefill.noDelivery":"The message is in the message box: check it and send it with Enter.","agent.handoff.prefill.notReady":"The CLI wasn't ready in time: the message is in the message box for you to send.","agent.handoff.prefill.sendFailed":"It couldn't be sent automatically: the message is in the message box for you to send.","agent.handoff.sending":"Sending the continuation…","agent.handoff.tabLabel":"Continued: {{title}}","agent.handoff.tabLabelNoTitle":"Continued","agent.handoff.turns.all_one":"the {{count}} turn","agent.handoff.turns.all_other":"the {{count}} turns","agent.handoff.turns.lastManyOfMore_one":"the last {{included}} of more than {{count}} turn","agent.handoff.turns.lastManyOfMore_other":"the last {{included}} of more than {{count}} turns","agent.handoff.turns.lastMany_one":"the last {{included}} of {{count}} turn","agent.handoff.turns.lastMany_other":"the last {{included}} of {{count}} turns","agent.handoff.turns.lastOne":"the last turn of {{total}}","agent.handoff.turns.lastOneOfMore":"the last turn of more than {{total}}","agent.handoff.turns.single":"the only turn","agent.meter.idle.noFile":"The session hasn't measured any response yet. It doesn't start at zero: the system prompt, the tools and the project's instructions file already take up context, and the real number shows up with the first response.","agent.meter.idle.statusLine":"The status line hasn't published tokens for this conversation yet. It doesn't start at zero: the number shows up when the CLI runs it, with the first message or when the session resumes.","agent.meter.idle.withFile":"The session hasn't measured any response yet. It doesn't start at zero: the system prompt, the tools and {{file}} already take up context, and the real number shows up with the first response.","agent.meter.origin.catalog":"limit from the CLI's model catalog","agent.meter.origin.estimated":"limit inferred from the measured tokens","agent.meter.setup.disabled":"This CLI only publishes its tokens through its status line, and the app's status line is disabled. Configure explains how.","agent.meter.setup.missing":"This CLI only publishes its tokens through its status line, and it isn't configured yet. Configure explains how.","agent.meter.setup.otherCommand":"This CLI only publishes its tokens through its status line, and you have another status line configured. Configure explains how.","agent.meter.setup.unreadable":"This CLI only publishes its tokens through its status line, and its settings.json couldn't be read. Configure explains how.","agent.mode.blocked":"There's a confirmation pending in the CLI: changing the mode now would approve it. Answer it in the CLI tab.","agent.mode.title":"{{mode}} mode: {{hint}}. Changing it sends {{key}} to the CLI tab","agent.mode.titleBlind":"{{title}}. Without status line data the app can't tell whether a confirmation is pending; changing the mode at that moment approves it","agent.note.empty":"The note is empty","agent.note.needsTab":"Open a tab first: the conversation opens in its project","agent.note.noReadySignal":"This tab's CLI doesn't say when it's ready, so the note can't be sent","agent.note.send":"Send the note to the agent in a new conversation in {{cwd}}","agent.openBlocked":"Opening a tab in this project…","agent.openTool.noLabel":"The CLI has a tool without a result: it may be asking for approval. Answer it in the CLI tab.","agent.openTool.withLabel":"{{label}} has a tool without a result: it may be asking for approval. Answer it in the CLI tab.","agent.serverClosed.noLabel":"The CLI server closed and this tab lost its connection.","agent.serverClosed.relaunch":"Relaunch","agent.serverClosed.relaunching":"Relaunching…","agent.serverClosed.withLabel":"The {{label}} server closed and this tab lost its connection.","agent.session.cliMissing":"{{label}} isn't installed.","agent.shortcuts.antigravity.answerPermission":"Answer a permission request: 1 allows it, 4 rejects it","agent.shortcuts.antigravity.cycleMode":"Change the mode: accept-edits, plan and default (with focus on the terminal)","agent.shortcuts.antigravity.help":"Show the CLI's shortcuts","agent.shortcuts.antigravity.interrupt":"Interrupt the current turn, or cancel a permission request","agent.shortcuts.claudeCode.cancel":"Cancel","agent.shortcuts.claudeCode.cycleMode":"Change the permission mode (with focus on the terminal)","agent.shortcuts.claudeCode.fullOutput":"Show the full output","agent.shortcuts.claudeCode.pasteImage":"Paste an image from the clipboard","agent.shortcuts.claudeCode.pasteText":"Paste text from the clipboard","agent.shortcuts.claudeCode.rewind":"Open the rewind menu","agent.shortcuts.claudeCode.searchHistory":"Search the command history","agent.shortcuts.codex.cycleMode":"Switch between the default mode and Plan (with focus on the terminal)","agent.shortcuts.codex.editPrevious":"Edit a previous message","agent.shortcuts.codex.effort":"Lower / raise the effort","agent.shortcuts.codex.externalEditor":"Edit the message in the external editor","agent.shortcuts.codex.interruptOrExit":"Interrupt, or exit if there's no turn","agent.shortcuts.codex.interruptTurn":"Interrupt the current turn","agent.shortcuts.codex.mention":"Mention a file, a skill or a plugin","agent.shortcuts.codex.note":"Alt + ← / → switch agents inside Codex, but here the app uses them to switch tabs.","agent.shortcuts.codex.queue":"Queue the message while the agent works","agent.shortcuts.codex.searchHistory":"Search the message history","agent.shortcuts.codex.transcript":"Show the transcript","agent.shortcuts.commands":"Commands","agent.shortcuts.composer.newline":"New line without sending","agent.shortcuts.composer.pasteText":"Paste text","agent.shortcuts.composer.pasteWithImages":"Paste text or an image (it stays as a thumbnail)","agent.shortcuts.composer.send":"Send the message","agent.shortcuts.interruptCli":"Interrupt whatever the CLI is doing","agent.shortcuts.leaderThen":"Ctrl + X, then {{key}}","agent.shortcuts.opencode.clearInput":"Clear the input; twice, exit","agent.shortcuts.opencode.commandList":"Command list, with the model variants","agent.shortcuts.opencode.cycleAgent":"Switch agent, build or plan (with focus on the terminal)","agent.shortcuts.opencode.interrupt":"Interrupt (the first press only warns)","agent.shortcuts.opencode.model":"Choose a model","agent.shortcuts.opencode.newSession":"New session: the tab stays tied to the session it was opened with","agent.shortcuts.opencode.newline":"New line","agent.shortcuts.opencode.note":"Ctrl + T switches the model variant inside OpenCode, but the browser keeps it for itself: it's under Ctrl + P.","agent.shortcuts.opencode.paste":"Paste","agent.statusLine.noFragment":"The app's folder has characters the console interprets (such as & % ! or quotes), and with them there's no line the CLI can run: on Windows it runs it with cmd /c and no quote gets through. Moving the configuration folder to a path without those characters fixes it.","agent.statusLine.state.active":"Configured","agent.statusLine.state.disabled":"Disabled (enabled: false)","agent.statusLine.state.missing":"Not configured","agent.statusLine.state.otherCommand":"You have another status line: pasting this one replaces it","agent.statusLine.state.unreadable":"Couldn't read settings.json","agent.thread.discovering":"The session shows up in the history with the first message.","agent.thread.noTranscript":"This conversation comes from a CLI version that didn't leave a readable transcript. It can be resumed from the sidebar, but there's nothing to show here.","agent.waiting.answer":"The CLI is waiting for an answer from you.","agent.waiting.permission":"The CLI is waiting for you to authorize a tool.","agent.waiting.question":"The agent asked you a question: answer it in the thread.","agentMenu.chooseTitle":"Choose which CLI to open with","agentMenu.openWith":"Open with","agentMenu.titleWithAgent":"{{title}} — with {{label}}","app.banner.revoked":"This device's access was revoked, or remote access was turned off. To come back, pair it again from the computer running Agent Workbench.","app.divider.consoleHeight":"Drag to change the console's height","app.divider.width":"Drag to change the width","app.empty.hint":"Pick a project on the left, or open a session from the history to resume it.","app.empty.newSession":"New session in {{cwd}}","app.empty.noTabs":"No open tabs.","app.empty.opening":"Opening…","app.header.cliVersion":"CLI {{version}}","app.header.remoteAccess":"Remote access","app.header.remoteBadge":"Remote","app.header.remoteBadgeTitle":"This window is connected from a paired device. Managing remote access, and anything that opens a file with the apps of the computer running Agent Workbench, is only available on that computer.","app.header.shortcuts":"Show keyboard shortcuts","app.markerNotice":"This server was started from inside a CLI session. The <code>{{variable}}</code> variable was removed from the tabs' environment: it turns off history saving, and without that there would be no conversation or context meter. The rest of the environment is left untouched.","app.panel.name":"Panel","app.panel.show":"Show the right panel (Alt+P)","app.picker.project.confirm":"Open here","app.picker.project.confirmTitle":"Open an agent tab in {{path}}","app.picker.project.title":"New project","app.picker.vault.confirm":"Use this folder","app.picker.vault.confirmTitle":"Move the backup to {{path}}. The current folder stays untouched","app.picker.vault.title":"Backup folder","app.sidebar.name":"Projects","app.sidebar.show":"Show the project list","app.status.connecting":"Connecting","app.status.failed":"No connection","app.status.open":"Connected","app.status.reconnecting":"Reconnecting","app.status.revoked":"Access revoked","archive.allBlocked_one":"Its only conversation has an open tab. Close it first.","archive.allBlocked_other":"Its {{count}} conversations have an open tab. Close them first.","archive.blockedStays_one":"Another one has an open tab and stays.","archive.blockedStays_other":"{{count}} others have an open tab and stay.","archive.confirm_one":"Archive {{count}} conversation?","archive.confirm_other":"Archive the {{count}} conversations?","archive.withBlocked":"{{confirm}} {{blocked}}","common.cancel":"Cancel","common.close":"Close","common.closeEsc":"Close (Esc)","common.copied":"Copied","common.copyCode":"Copy code","common.dismissNotice":"Dismiss the notice","common.gotIt":"Got it","composer.attach":"Attach a file","composer.attachTitle":"Attach a file: a log, a PDF, a document or an image","composer.chip.editHint":"Show and edit the pasted text","composer.chip.editorLabel":"Edit pasted text #{{number}}","composer.chip.pastedTextEmpty":"#{{number}} · Pasted text · empty, won't be sent","composer.chip.pastedText_one":"#{{number}} · Pasted text · {{count}} line","composer.chip.pastedText_other":"#{{number}} · Pasted text · {{count}} lines","composer.chip.remove":"Remove","composer.pastedImage":"pasted image","composer.placeholder.ended":"This tab's session has ended.","composer.placeholder.ready":"Type your message.","composer.placeholder.sleeping":"This tab doesn't have the CLI open yet.","composer.problem.draftTooLong":"This message is too long to keep as a draft: if you close Agent Workbench before sending it, it will be lost.","composer.problem.empty":'"{{name}}" is empty.',"composer.problem.imageTooBig":"The image is {{size}} MB; the maximum is {{max}} MB.","composer.problem.imageUnreadable":"Couldn't read the image from the clipboard.","composer.problem.tooBig":'"{{name}}" is {{size}} MB; the maximum is {{max}} MB.',"composer.problem.tooManyFiles_one":"Up to {{count}} file per message.","composer.problem.tooManyFiles_other":"Up to {{count}} files per message.","composer.problem.tooManyImages_one":"Up to {{count}} image per message.","composer.problem.tooManyImages_other":"Up to {{count}} images per message.","composer.problem.unreadable":`Couldn't read "{{name}}".`,"composer.resizeTitle":"Drag to resize the message box","composer.send":"Send","composer.sendTitle":"Send (Enter)","composer.stop":"Stop","composer.stopTitle":"Interrupt whatever the CLI is doing (Esc)","console.collapse":"Collapse. The processes keep running: to end them, use each terminal's ×","console.name":"Console","console.noShell":"No system console was found to open.","console.openAnother":"Open another {{shell}} in {{cwd}}","console.openAnyIn":"Open a console in {{cwd}}","console.openIn":"Open {{shell}} in {{cwd}}","console.tab.close":"Close this terminal and end its process","console.tab.exited":"Exited with code {{code}}","console.tab.label":"Terminal {{number}}","console.tab.title":"{{shell}} {{number}} in {{cwd}}","continue.menuLabel":"Continue with","controls.effort.high":"High","controls.effort.inUse":"Effort in use: {{effort}}. Changing it sends /effort to the CLI tab","controls.effort.inUseSaved":"Effort in use: {{effort}}. Changing it sends /effort to the CLI tab, and the CLI saves it as the default for the next tabs","controls.effort.low":"Low","controls.effort.max":"Max","controls.effort.medium":"Medium","controls.effort.noData":"Effort: no data. Not every model has levels — with haiku, /effort leaves no trace","controls.effort.placeholder":"effort — no data","controls.effort.provisional":"Effort from your configuration: {{effort}}. No response has confirmed it yet","controls.effort.xhigh":"Very high","controls.model.default":"Default","controls.model.inUse":"Model in use: {{model}}. Changing it sends /model to the CLI tab","controls.model.inUseSaved":"Model in use: {{model}}. Changing it sends /model to the CLI tab, and the CLI saves it as the default for the next tabs","controls.model.noData":"Model: there hasn't been any response in this session yet","controls.model.placeholder":"model — no data","controls.model.provisional":"Model from your configuration: {{model}}. No response has confirmed it yet","conversation.answerUnconfirmed":"The CLI didn't confirm this answer. Try again, or answer in the CLI tab.","diff.binary":"Binary file: there's no diff to show.","diff.noChanges":"No changes.","diff.truncated":"The diff was cut off because of its size. The full file is easier to read outside this panel.","docs.backToList":"Show the list","docs.failed":"Couldn't read the document. Use ⟳ to try again.","docs.mode.formatted":"Formatted","docs.mode.label":"How to show this Markdown","docs.mode.source":"Source","docs.reload":"Read the document again","docs.reloadFailed":"Couldn't read it again: this is the last version that arrived.","docs.search.placeholder":"Search this document","docs.tab.close":"Close this document","files.allHidden":"everything in it is hidden","files.empty":"empty","files.hidden.hide":"Hide again what .gitignore and the built-in list exclude","files.hidden.show":"Also show what .gitignore and the built-in list exclude","files.hiddenCount_one":"{{count}} hidden","files.hiddenCount_other":"{{count}} hidden","files.hiddenTitle":"Hidden: .git, node_modules, dist, bin, obj and whatever .gitignore says","files.insertFolderPath":"Put this folder's path in your message","files.insertPath":"Put the path of {{name}} in your message","files.loading":"loading…","files.menu.copyAbsolute":"Copy absolute path","files.menu.copyRelative":"Copy relative path","files.menu.insertMention":"Insert as @path","files.menu.openWithSystem":"Open with the default app","files.moreEntries":"there are more entries than shown","files.pathInserted":"Added to your message","files.preview.binary":"Binary file: no preview.","files.preview.insertPath":"Put the path in your message","files.preview.truncated":"The file was cut off because of its size. Open it with the default app to see all of it.","files.readDirFailed":"Couldn't read the directory.","files.readingDir":"Reading the directory…","files.readingFile":"Reading the file…","files.refresh":"Reload the tree","files.reveal":"Open {{name}} in the system's file explorer","files.revealFolder":"Open this folder in the system's file explorer","files.row.alwaysHidden":"always hidden: .git, node_modules, dist, bin, obj","files.row.ignored":"hidden by .gitignore","files.search.clear":"Clear (Esc)","files.search.more":"there are more results than shown","files.search.moreTitle":"Narrow the search to see them all","files.search.none":"No file with that name.","files.search.placeholder":"Search files by name…","files.search.prompt":"Type to search.","files.search.searching":"Searching…","format.bytes.b":"{{value}} B","format.bytes.gb":"{{value}} GB","format.bytes.kb":"{{value}} KB","format.bytes.mb":"{{value}} MB","format.duration.minutes":"{{value}} min","format.duration.minutesSeconds":"{{minutes}} min {{seconds}} s","format.duration.ms":"{{value}} ms","format.duration.seconds":"{{value}} s","format.duration.underSecond":"less than 1 s","git.aheadBehindTitle":"Commits ahead of and behind the upstream branch","git.backToChanges":"Changes","git.clean":"The working tree is clean.","git.detached":"Detached HEAD","git.detachedAt":"Detached HEAD @ {{head}}","git.group.conflict":"Conflicted","git.group.conflictHint":"They need to be resolved before going on","git.group.staged":"Staged","git.group.stagedHint":"Already added with git add","git.group.unstaged":"Unstaged","git.group.unstagedHint":"Modified in the working tree","git.group.untracked":"Untracked","git.group.untrackedHint":"New files git doesn't know about","git.kind.added":"added","git.kind.conflict":"conflicted","git.kind.copied":"copied","git.kind.deleted":"deleted","git.kind.modified":"modified","git.kind.renamed":"renamed","git.kind.typeChanged":"type changed","git.kind.untracked":"untracked","git.newFolderTitle":"{{path}} — new folder; its contents show up in Files","git.readingDiff":"Reading the diff…","git.refresh":"Refresh the status now","git.stagedTag":"staged","git.truncated":"There are more changes than shown. It usually means a rule is missing from <code>.gitignore</code>.","git.unknownState":"The repository's status isn't known yet.","git.upstreamTitle":"Upstream branch: {{upstream}}","git.worktrees.detached":"detached","git.worktrees.heading":"Other worktrees","git.worktrees.headingTitle":"Other working trees of this repository","header.locale.auto":"Automatic (browser: {{name}})","header.locale.title":"Language: {{name}}","header.locale.titleAuto":"Language: {{name}} (automatic, from the browser)","memory.action.appendBlock":"the block will be added at the end","memory.action.appendLines":"lines will be added at the end","memory.action.copy":"will be copied","memory.action.create":"will be created","memory.action.replaceBlock":"the block will be replaced","memory.back":"← Memory","memory.error.connectionLost":"The connection dropped before the response. Once it reconnects, the status shows what got written.","memory.form.copyFromMain":"Copy the notes from the main worktree","memory.form.existingNotes":"Existing notes","memory.form.files":"Instruction files","memory.form.importNative_one":"Import {{count}} note from Claude Code's memory","memory.form.importNative_other":"Import {{count}} notes from Claude Code's memory","memory.form.noFiles":"Choose at least one instruction file","memory.form.planning":"Calculating…","memory.form.preview":"Preview changes","memory.git.alreadyIgnored":"This repo already ignores <code>.agents/memory/</code>. To track it, that rule has to be removed from <code>.gitignore</code> by hand.","memory.git.blocked":"With git returning an error, it can only be installed without touching .gitignore","memory.git.dontTouch":"Don't touch <code>.gitignore</code>","memory.git.errorHint":"git returned an error","memory.git.errorWarning":"git returned an error, so there's no telling whether the memory is ignored. It can be installed without touching <code>.gitignore</code>.","memory.git.ignore":"Ignore the memory","memory.git.ignoreHint":"recommended","memory.git.version":"Track it","memory.git.versionHint":"for private repos","memory.global.copy":"Copy the snippet","memory.global.intro":"What applies to all your projects goes in <code>~/.agents/global.md</code>. The app doesn't write it: each CLI reads it once you add its snippet.","memory.global.title":"Global memory","memory.index":"Index","memory.intro.what":"Shared memory keeps what the agents learn about this project —decisions, constraints, pitfalls they already ran into— for the next session.","memory.intro.where":"It lives in <code>.agents/memory/</code>: one note per file and an index, <code>MEMORY.md</code>. The four CLIs read it through a marked block in their instructions file. Nothing is written until you confirm the changes.","memory.list.empty":"No notes yet. The agents save them here when they learn something that's useful in another session.","memory.list.notes":"Notes","memory.loading":"Reading the memory…","memory.native.import_one":"Import {{count}} note","memory.native.import_other":"Import {{count}} notes","memory.native.importing":"Importing…","memory.native.pending_one":"Claude Code's own memory has {{count}} note that isn't here.","memory.native.pending_other":"Claude Code's own memory has {{count}} notes that aren't here.","memory.note.loading":"Reading the note…","memory.note.truncated":"The note was cut off because of its size.","memory.plan.back":"Back","memory.plan.changes":"Changes","memory.plan.copiedFrom":"Copy of {{path}}","memory.plan.install":"Install","memory.plan.nothing":"There's nothing to change: the bridge is already up to date.","memory.plan.update":"Update","memory.plan.writing":"Writing…","memory.problem.brokenBlock":"Its block markers are malformed","memory.problem.brokenBlockWarning":"<code>{{file}}</code> has malformed memory block markers: one without its pair, or the block repeated. The app won't touch it until you fix it by hand.","memory.problem.encoding":"It isn't in UTF-8","memory.problem.encodingWarning":"<code>{{file}}</code> isn't in UTF-8 (it looks like UTF-16, which is what <code>></code> writes in Windows PowerShell 5.1). Save it as UTF-8: the app won't touch it until then.","memory.problem.outside":"It's a link that points outside the project","memory.problem.outsideWarning":"<code>{{file}}</code> is a link that points outside the project: the app doesn't read or write it.","memory.reach.adjust":"Adjust","memory.reach.adjustTitle":"Choose the bridge's instruction files again","memory.reach.doesNotReach":": doesn't reach the memory, {{via}}","memory.reach.reaches":": reaches the memory through {{via}}","memory.reach.title":"{{label}}: {{via}}","memory.result.imported_one":"Imported {{count}} note.","memory.result.imported_other":"Imported {{count}} notes.","memory.result.installed_one":"Done: {{count}} file changed.","memory.result.installed_other":"Done: {{count}} files changed.","memory.result.nothingChanged":"There was nothing to change: the bridge was already up to date.","memory.result.nothingImported":"There were no new notes to import.","memory.result.skipped_one":"Not overwritten because it already existed with different content: {{files}}.","memory.result.skipped_other":"Not overwritten because they already existed with different content: {{files}}.","memory.result.withSkipped":"{{result}} {{skipped}}","memory.update.button":"Update the bridge","memory.update.missing":"The block is missing from {{files}}.","memory.update.outdatedAndMissing_one":"{{outdated}} has an outdated block; the block is missing from {{missing}}.","memory.update.outdatedAndMissing_other":"{{outdated}} have an outdated block; the block is missing from {{missing}}.","memory.update.outdated_one":"{{files}} has an outdated block.","memory.update.outdated_other":"{{files}} have an outdated block.","meter.configure":"Configure","meter.label":"Context","meter.lastResponseTitle":"The model's last response","meter.modelWithOrigin":"{{model}} — {{origin}}","meter.noTokens":"this CLI doesn't publish tokens","meter.noTokensTitle":"This CLI doesn't publish how many tokens each response uses, so there's nothing to measure.","meter.output":"output {{tokens}}","meter.responses_one":"{{count}} response","meter.responses_other":"{{count}} responses","meter.sessionTitle":"Total for the whole session","meter.sessionTotals_one":"session {{output}} out · {{cache}} cache · {{count}} response","meter.sessionTotals_other":"session {{output}} out · {{cache}} cache · {{count}} responses","meter.unknownModel":"unrecognized model: showing the tokens, not the window size","meter.unknownModelShort":"unrecognized model: no window size","meter.unmeasured":"not measured","meter.windowPercent":"{{percent}}% of the window","mode.acceptEdits.hint":"Accepts file edits without asking","mode.acceptEdits.label":"Accept edits","mode.auto.hint":"The CLI decides on its own which tools to use, without asking","mode.auto.label":"Auto","mode.default.hint":"Asks before each tool that isn't allowed","mode.default.label":"Manual","mode.plan.hint":"Researches and proposes a plan, without touching anything until you approve it","mode.plan.label":"Plan","narrow.keys.ctrlO":"Ctrl+O (in Claude Code, expands what is shown cut short)","narrow.keys.ctrlX":"Ctrl+X","narrow.keys.down":"Down arrow","narrow.keys.esc":"Escape","narrow.keys.interrupt":"Ctrl+C: interrupt","narrow.keys.label":"Terminal keys","narrow.keys.left":"Left arrow","narrow.keys.right":"Right arrow","narrow.keys.shiftTab":"Shift+Tab (in Claude Code, cycles the permission mode)","narrow.keys.tab":"Tab","narrow.keys.up":"Up arrow","narrow.menu.chimePage":"This page","narrow.menu.chimeSystem":"System","narrow.menu.cli":"CLI","narrow.menu.connection":"Connection","narrow.menu.folder":"Folder","narrow.menu.language":"Language","narrow.menu.notifications":"System notifications","narrow.menu.phoneAppDisconnect":"Disconnect","narrow.menu.phoneAppSettings":"Settings","narrow.menu.shortcuts":"Keyboard shortcuts","narrow.menu.sound":"Notification sound","narrow.menu.theme":"Theme","narrow.more":"More","narrow.projects":"Projects","narrow.tabs.close":"Close tab","narrow.tabs.new":"New tab","narrow.tabs.none":"No tabs open.","narrow.tabs.open":"Tabs","narrow.tabs.rename":"Rename","narrow.view.chat":"Chat","notes.attach":"Attach an image from a file","notes.closeConfirm":"Closing this note deletes it, along with its images.","notes.closeNote":"Close the note. It's deleted, along with its images","notes.collapse":"Collapse. Notes aren't lost: the × on each tab is what closes them","notes.empty":"No notes. The <b>+</b> opens one; they're for jotting down an idea without leaving what you're doing.","notes.expand":"Expand the notes","notes.imageAlt":"note image","notes.imageFallbackName":"the image","notes.imageOnly":"Image","notes.imageTooBig":'"{{name}}" is {{size}} MB; the maximum is {{max}} MB.',"notes.imageUnavailable":"the image isn't available","notes.lightboxClose":"Click to close","notes.name":"Notes","notes.new":"New note","notes.placeholder":"Jot down an idea. Images can be pasted or dragged here.","notes.readFailed":"Couldn't read the image.","notes.removeImage":"Remove the image","notes.resize":"Drag to change the height","notes.thumbMissing":"missing","notes.tooManyImages_one":"Up to {{count}} image per note.","notes.tooManyImages_other":"Up to {{count}} images per note.","notes.untitled":"Note","notify.attention":"“{{tab}}” is waiting for you","notify.done":"“{{tab}}” finished","panel.cliUnseen":"The CLI wrote something","panel.hide":"Hide the panel (Alt+P)","panel.restoreWidth":"Restore the column's width","panel.tab.cli":"CLI","panel.tab.files":"Files","panel.tab.git":"Changes","panel.tab.memory":"Memory","panel.tab.plans":"Plans","panel.widen":"Widen the column — the CLI's interface needs room to draw diffs and tables","picker.create":"Create","picker.createHere":"Create a folder here","picker.empty":"There are no subfolders here.","picker.goTo":"Go to {{root}}","picker.loading":"Reading the disk...","picker.newFolderName":"Folder name","picker.truncated":"There are more subfolders than fit in the list. Open one to narrow it down.","picker.up":"parent folder","plans.empty":"This conversation hasn't written any documents yet. Plans from plan mode show up here, along with the <code>.md</code> files the agent saves in the project or in its temporary folder.","plans.loading":"Reading the plan…","plans.missing":"missing","plans.missingTitle":"The file is no longer on disk","plans.truncated":"The plan was cut off because of its size.","remote.address":"This computer's address","remote.copied":"Copied","remote.copy":"Copy","remote.device.connected":"Connected now","remote.device.lastSeen":"Last seen: {{when}}","remote.device.never":"Never connected","remote.device.paired":"Paired: {{when}}","remote.device.rename":"Rename","remote.device.revoke":"Revoke","remote.device.revokeConfirm":"Click again to revoke","remote.devices":"Paired devices","remote.devices.empty":"None yet.","remote.intro":"Use Agent Workbench from another computer on your network, or from your phone. Nothing is opened to the network: the connection goes through an SSH tunnel.","remote.onlyOnHost":"Only on the computer running Agent Workbench: it opens with that computer's apps.","remote.pair.after":"After that, the other computer just opens {{url}}.","remote.pair.cancel":"Cancel","remote.pair.expires":"It works once and expires in {{time}}.","remote.pair.needsActive":"You can pair once remote access is on and running.","remote.pair.open":"With the tunnel running, open this address in the other computer's browser:","remote.pair.start":"Pair a device","remote.phone.authorize.admin":"1. Authorize the phone's key: on this computer, paste this into PowerShell as administrator.","remote.phone.authorize.powershell":"1. Authorize the phone's key: on this computer, paste this into PowerShell.","remote.phone.authorize.terminal":"1. Authorize the phone's key: on this computer, paste this into a terminal.","remote.phone.authorizeOnce":"The key only opens the tunnel to Agent Workbench: no terminal and no commands. If you already pasted it, you don't need to do it again.","remote.phone.hint":"Using the Android app? It only needs step 1: it opens the tunnel and pairs itself.","remote.phone.qrLabel":"Code to scan with the phone","remote.phone.scan":"2. In the app, tap “Scan code” and point the camera here:","remote.phone.secret":"Don't share this code or a photo of it: it carries the phone's key.","remote.phone.start":"Pair a phone","remote.phone.title":"A phone","remote.port":"Port","remote.portInvalid":"A number between {{min}} and {{max}}.","remote.portSave":"Save","remote.restartHint":"Turning it on, or changing the port, takes effect when you restart Agent Workbench. Restarting closes the open CLIs: the tabs come back asleep.","remote.ssh.linux":"In a terminal (Ubuntu or Debian; on other distributions, install their OpenSSH server):","remote.ssh.macos":"System Settings → General → Sharing → turn on “Remote Login”.","remote.ssh.windows":"Open PowerShell as administrator and paste this. The first line downloads and installs the server: it takes a few minutes and shows “Running” meanwhile. Wait until the prompt comes back before moving on.","remote.state.active":"On, port {{port}}","remote.state.off":"Off","remote.state.portBusy":"Port {{port}} is busy, so remote access isn't working in this run. Close the other program (it may be another Agent Workbench) and restart, or choose another port.","remote.state.restartNeeded":"On, but it takes effect when you restart Agent Workbench","remote.step.host":"1. On this computer, once: turn on SSH","remote.step.hostHint":"It's a system setting that needs administrator rights, so the app doesn't do it for you. This computer's system is open:","remote.step.pair":"3. Pair it, once per device","remote.step.tunnel":"2. On the other computer, each time you use it","remote.step.tunnelHint":"Paste this command into its terminal and leave it open. It asks for the password of your user on this computer.","remote.title":"Remote access","remote.trouble":"Not connecting?","remote.trouble.network":"On Windows, check that this computer's Wi‑Fi network is set to Private.","remote.turnOff":"Turn off","remote.turnOffHint":"Turning it off takes effect right away: paired devices are disconnected, and stay paired.","remote.turnOn":"Turn on remote access","remote.userHint":"If SSH rejects “{{user}}”: with a Microsoft or work account, try the name of your user folder (C:\\Users\\<name>) and the account password, not the PIN.","remote.vpnHint":"A work VPN that blocks the local network cuts the connection while it's on. The app can't do anything about that.","search.found":"{{hits}} in {{sessions}}","search.hits_one":"{{count}} match","search.hits_other":"{{count}} matches","search.mode.conversations":"In conversations","search.mode.conversationsTitle":"Searches the text of the conversations saved in the backup, ignoring case and accents","search.mode.titles":"In titles","search.off":"The backup is off: the search covers what it saved while it was on.","search.placeholder.conversations":"Search the conversations (Enter)","search.placeholder.titles":"Filter projects and sessions","search.role.assistant":"Response","search.role.title":"Title","search.role.user":"Request","search.sessions_one":"{{count}} session","search.sessions_other":"{{count}} sessions","search.status.done":"{{found}}.","search.status.none":"No results","search.status.noneIn":"No results in {{sessions}}.","search.status.progressFound_one":"Searching… {{scanned}} of {{count}} session, {{found}} so far.","search.status.progressFound_other":"Searching… {{scanned}} of {{count}} sessions, {{found}} so far.","search.status.progress_one":"Searching… {{scanned}} of {{count}} session.","search.status.progress_other":"Searching… {{scanned}} of {{count}} sessions.","search.status.searching":"Searching…","search.status.truncatedResults":"{{found}}: these are the first ones, refine the search to see the rest.","search.status.truncatedTime":"{{found}}: the search stopped after {{seconds}} s and {{left}} were left unchecked.","search.tooShort":"Type at least {{min}} characters and press Enter.","searchHook.connectionLost":"The connection to the server was lost: search again.","server.agentUnknown":"This server doesn't know how to launch that CLI.","server.answerInterrupted":"The answer wasn't fully sent: the interruption cut it off.","server.answerInvalid":"The answer doesn't match the question.","server.answerNoFreeText":"This question doesn't accept a written answer: choose one of the options.","server.answerNotPending":"That question is no longer waiting for an answer.","server.answerSendFailed":"The answer couldn't be sent: answer it in the CLI tab.","server.answersUnsupported":"This CLI doesn't take answers from the conversation. Answer it in the CLI tab.","server.archiveOpenTab":"Sessions with an open tab aren't archived. Close it first.","server.attachmentEmpty":'"{{name}}" arrived empty.',"server.attachmentExecutable":`Executables aren't attached: "{{name}}".`,"server.attachmentSaveFailed":"The attached file couldn't be saved.","server.attachmentTooLarge":'"{{name}}" is {{size}} MB; the maximum is {{max}} MB.',"server.badMessage":"Message not recognized by the protocol.","server.cliMissing":`The "{{command}}" command wasn't found in the PATH. Agent Workbench uses the CLI you already have installed: it doesn't include or download it. Install it from {{url}} and start again.`,"server.cliNotFound":"The CLI isn't installed or wasn't found in the PATH.","server.cliNotInstalled":"{{label}} isn't installed or wasn't found in the PATH.","server.cliOpenFailed":"The tab's CLI couldn't be opened.","server.continueFailed":"The continuation couldn't be prepared.","server.continueHistoryMissing":"That conversation's history wasn't found.","server.continueNoFolder":"That conversation doesn't say which folder it ran in.","server.continueNotInHistory":"That conversation isn't in the history: if it just started, try again in a few seconds.","server.continueReadFailed":"That conversation couldn't be read.","server.continueSameCli":"That conversation already belongs to that CLI: to continue it, open it from the sidebar.","server.continueTabFailed":"The continuation's tab couldn't be opened.","server.continueTranscriptFailed":"The continuation's transcript couldn't be saved.","server.conversationNotFollowed":"That conversation is no longer being followed.","server.cwdMissing":"The directory doesn't exist: {{cwd}}","server.cwdNotDir":"It isn't a directory: {{cwd}}","server.diffBinaryUntracked":"Untracked binary file.","server.diffNewEmpty":"New, empty file.","server.diffNoStaged":"There are no staged changes for this file.","server.diffNoUnstaged":"There are no unstaged changes for this file.","server.diffReadFailed":"The diff couldn't be read.","server.dirReadFailed":"The directory couldn't be read.","server.dirSearchFailed":"The directory couldn't be searched.","server.fileReadFailed":"The file couldn't be read.","server.filesPerMessage":"You can attach up to {{max}} files per message.","server.gitCommandFailed":"git {{command}} failed.","server.gitMissing":"git wasn't found in the PATH. The Changes panel needs git installed; the rest of the app works the same.","server.gitNotFound":"git wasn't found in the PATH.","server.gitNotRepo":"This folder isn't inside a git repository.","server.gitRunFailed":"git couldn't be run to read the repository's status.","server.gitStatusUnknown":"The repository's status isn't known yet.","server.gitUnexpected":"Unexpected answer from git {{command}}.","server.handoffEmpty":"That conversation has no messages to continue.","server.handoffNoTranscript":"That conversation has no messages to continue: that CLI didn't leave a readable transcript.","server.imageEmpty":"The image arrived empty.","server.imageTooLarge":"The image is {{size}} MB; the maximum is {{max}} MB.","server.imageTypeUnsupported":"Image type not supported: {{type}}","server.imageUnknownFormat":"The content isn't an image in a known format.","server.imagesPerMessage":"You can attach up to {{max}} images per message.","server.imagesUnsupported":"This CLI doesn't take images from the message box.","server.memoryAppeared":"{{file}} appeared during the installation. Review the changes again.","server.memoryBrokenBlock":"{{file}} has malformed memory block markers (one without its pair, or the block repeated). Fix it by hand: the app won't touch that file in the meantime.","server.memoryChooseFile":"Choose at least one instructions file.","server.memoryGitFailed":"git couldn't be queried ({{detail}}). Without that, there's no telling whether .gitignore needs changes.","server.memoryHardLinks":"{{file}} has hard links: the app doesn't modify it, because writing it would break the link. Add the block by hand.","server.memoryLinkOutside":"{{path}} points outside the project (a link or a junction): the app doesn't write there.","server.memoryNotAFile":"{{label}} exists but isn't a file.","server.memoryNotInstalled":"Install the bridge first: the .agents/memory folder is missing.","server.memoryNotUtf8":"{{file}} isn't UTF-8 (it looks like UTF-16, which is what `>` leaves in Windows PowerShell 5.1). Save it as UTF-8: the app won't touch it in the meantime.","server.memoryNoteClaude":"Add this line at the end. Claude Code imports the file at startup.","server.memoryNoteGone":"That note no longer exists.","server.memoryNoteHardLink":"Hard link. `~/{{path}}` has to exist first, and the CLI's file must not: if it exists, move what it has into `global.md` and delete it. If your editor saves by replacing the file, the link breaks: in that case copy the content.","server.memoryNoteHardLinkCmd":"Hard link, in cmd. `~/{{path}}` has to exist first, and the CLI's file must not: if it exists, move what it has into `global.md` and delete it. If your editor saves by replacing the file, the link breaks: in that case copy the content.","server.memoryNoteName":"That name isn't a memory note.","server.memoryNoteOpenCode":"Inside the root object. Absolute path: OpenCode doesn't expand `~` in this key (unverified).","server.memorySameFile":"{{other}} and {{file}} are the same file (a link). Choose just one.","server.memoryViaEncoding":"{{file}} isn't UTF-8","server.memoryViaFallback":"CLAUDE.md (fallback)","server.memoryViaFile":"{{file}}","server.memoryViaNoBlock":"the block is missing in {{file}}","server.memoryViaNoBlockEither":"the block is missing in AGENTS.md or CLAUDE.md","server.memoryViaNoFolder":"the .agents/memory folder is missing","server.memoryViaNoIndex":".agents/memory/MEMORY.md is missing","server.memoryViaOutside":"{{file}} points outside the project","server.modePendingConfirmation":"There's a confirmation pending in the CLI: changing the mode now would approve it. Answer it in the CLI tab.","server.modeUnreachable":"That mode can't be reached from the current one. Change it with {{key}} in the CLI tab.","server.modesUnsupported":"This CLI has no permission modes to change from here.","server.noteCliNotStarted":"That tab's CLI didn't manage to start; the note wasn't sent.","server.noteEmpty":"The note is empty.","server.noteExists":"That note already exists.","server.noteGone":"The note no longer exists.","server.noteIdInvalid":"The note's id isn't valid.","server.noteImageFailed":"An image from the note couldn't be attached.","server.noteImagesMax":"Up to {{max}} images per note.","server.noteImagesUnsupported":"This CLI doesn't take images; the note wasn't sent.","server.noteInterrupted":"The note wasn't fully sent: the interruption cut it off.","server.noteNoAgent":"That tab has no agent to send the note to.","server.noteNoReadySignal":"This CLI doesn't say when it's ready; the note wasn't sent.","server.noteSaveFailed":"The note couldn't be saved.","server.noteTooLong":"A note holds up to {{max}} characters.","server.notesMax":"Up to {{max}} open notes. Close one first.","server.openToolSubmit":"{{label}} has a tool without a result: it may be asking for approval. Answer it in the CLI tab.","server.operationFailed":"The operation couldn't be completed: {{detail}}","server.pasteImageFailed":"The pasted image couldn't be saved.","server.pathMissing":"The path doesn't exist.","server.pathNotRelative":"Only paths relative to the tab's directory are accepted.","server.pathNullByte":"The path contains a null byte.","server.pathOpenFailed":"The path couldn't be opened.","server.pathOutside":"The path goes outside the tab's directory.","server.pendingSubmitAnswer":"{{label}} is waiting for an answer: the message's Enter would answer it. Answer it in the CLI tab.","server.pendingSubmitPermission":"{{label}} is waiting for you to authorize a tool: the message's Enter would approve it. Answer it in the CLI tab.","server.pickerCliFolder":"That folder belongs to the CLI and can't be opened from here.","server.pickerClosed":"That folder picker is no longer open.","server.pickerCreateFailed":"The folder couldn't be created there.","server.pickerFolderExists":"There's already a folder with that name.","server.pickerListFailed":"That folder couldn't be listed.","server.pickerNameChars":"The name has characters that can't be used.","server.pickerNameInvalid":"The folder name isn't valid.","server.pickerNoProjectsHere":"Projects aren't created there: it's the CLI's folder.","server.pickerNotListed":"That folder isn't in the current listing.","server.pickerRootMissing":"That root doesn't exist.","server.pickerTooMany":"Too many folder pickers are open.","server.planReadFailed":"The plan couldn't be read.","server.raw":"{{text}}","server.relaunchCloseFailed":"The tab's CLI couldn't be closed to relaunch it.","server.remoteDeviceGone":"That device is no longer paired.","server.remoteFailed":"The remote access change couldn't be made.","server.remoteHostOnly":"Remote access is managed only from the computer running Agent Workbench.","server.remoteNotActive":"Remote access isn't on and running yet. Turn it on and restart Agent Workbench.","server.remoteOpensOnHost":"That opens a window on the computer running Agent Workbench, so it isn't available from a remote device.","server.remotePortInvalid":"The port has to be a number between {{min}} and {{max}}.","server.remoteTooManyDevices":"There are already {{max}} paired devices. Revoke one first.","server.searchFailed":"The backup couldn't be searched.","server.settingsFailed":"Couldn't save the settings.","server.settingsHostOnly":"These settings can only be changed on the computer running Agent Workbench.","server.settingsShellMissing":"That console isn't installed anymore.","server.shellNotFound":"No system console was found to open.","server.submitInterrupted":"The message wasn't fully sent: the interruption cut it off.","server.submitStoppedTool":"The message wasn't fully sent: {{label}} opened a tool while it was being typed and may be asking for approval. Check the CLI tab.","server.submitStoppedToolNoLabel":"The message wasn't fully sent: the CLI opened a tool while it was being typed and may be asking for approval. Check the CLI tab.","server.submitStoppedWaiting":"The message wasn't fully sent: {{label}} started waiting for an answer while it was being typed. Answer it before sending another message.","server.submitStoppedWaitingNoLabel":"The message wasn't fully sent: the CLI started waiting for an answer while it was being typed. Answer it before sending another message.","server.tabClosedWhileOpening":"The tab closed while it was opening.","server.tabDirGone":"The tab's directory no longer exists.","server.tabOpenFailed":"The tab couldn't be opened.","server.terminalAsleep":"This tab doesn't have its CLI open. Open it to write to the agent.","server.terminalGone":"The terminal no longer exists.","server.terminalOpenFailed":"The terminal couldn't be opened.","server.tooManyTabs":"You can't open more than {{max}} tabs at once.","server.vaultBusyMeasuring":"The backup is busy measuring. Try again when it's done.","server.vaultBusyMoving":"The backup is busy moving to another folder. Try again when it's done.","server.vaultBusyWriting":"The backup is busy copying. Try again when it's done.","server.vaultCannotWrite":"That folder can't be written to.","server.vaultCurrentInsideTarget":"The current backup can't end up inside the new folder.","server.vaultDiskFull":"Disk full: the pass stopped ({{detail}})","server.vaultFailed":"The backup operation couldn't be completed.","server.vaultIndexNotReady":"The history is still being read. Measure when it's done.","server.vaultMeasureFirst":"First measure how much it would take.","server.vaultMemoryFailed":"memory of {{cwd}}: {{detail}}","server.vaultMoveFailed":"The backup couldn't be moved: {{detail}}","server.vaultMoving":"The backup is moving to another folder. Try again when it's done.","server.vaultNoCopyYet":"There's no backup yet.","server.vaultNotLoaded":"The backup isn't loaded.","server.vaultProjectGone":"That project is no longer in the sidebar.","server.vaultReasonNewerFormat":"the existing copy is in a newer format","server.vaultReasonOriginMissing":"the source wasn't found","server.vaultReasonUnsafeId":"a session id that can't be copied","server.vaultSessionFailed":"{{agent}}/{{session}}: {{detail}}","server.vaultSessionMissing":"That session isn't in the backup.","server.vaultTargetCliFolder":"That folder belongs to a CLI: the backup isn't kept there.","server.vaultTargetInsideCurrent":"The new folder can't be inside the current backup.","server.vaultTargetNotAbsolute":"The backup folder has to be an absolute path.","server.waitingSubmit":"{{label}} is waiting for an answer: answer it before sending another message.","session.untitled":"Untitled session","settings.cli.disabled":"Off","settings.cli.hint":"An unchecked CLI doesn't show in the menu or the sidebar, and its history isn't read.","settings.cli.install":"How to install it","settings.cli.notInstalled":"Not installed","settings.cli.restart":"Changes to the CLIs apply when you restart the app.","settings.console.auto":"Automatic","settings.console.autoWith":"Automatic ({{shell}})","settings.console.hint":"For consoles you open from now on; the open ones keep theirs.","settings.hiddenHint":"Hidden: {{name}}. You can show it again from ⚙ Settings.","settings.hide.console":"Hide the console (it comes back from ⚙ Settings)","settings.hide.notes":"Hide the notes (they come back from ⚙ Settings)","settings.hostOnly":"The console and the CLIs can only be changed on the computer running Agent Workbench.","settings.language":"Language","settings.more.open":"{{name}}…","settings.oldServer":"The server is from an older version: restart it to choose the console and the CLIs.","settings.open":"Settings","settings.panels.cliAlways":"The CLI tab is always shown: the agent's permissions and questions appear there.","settings.panels.consoleConfirmYes":"Hide and close","settings.panels.consoleConfirm_one":"Hiding the console closes {{count}} open terminal.","settings.panels.consoleConfirm_other":"Hiding the console closes {{count}} open terminals.","settings.section.appearance":"Appearance","settings.section.clis":"CLIs","settings.section.console":"Console","settings.section.more":"More","settings.section.panels":"Panels","settings.terminalTheme":"Terminal theme","settings.terminalTheme.dark":"Always dark","settings.terminalTheme.follow":"Follow the app's theme","settings.terminalTheme.hint":"CLIs pick their colors for a dark terminal: on a light one, some text is hard to read.","settings.title":"Settings","shortcuts.altNumber":"<strong>Alt + number</strong> isn't used either, on purpose: on Windows, Alt with the numeric keypad is how you type characters that aren't on the keyboard (<kbd>Alt + 164</kbd> = ñ). Intercepting it breaks typing accented characters. To switch tabs there are <kbd>Alt + ←</kbd> and <kbd>Alt + →</kbd>.","shortcuts.app.closeTab":"Close the active tab","shortcuts.app.newTab":"New tab in the current tab's directory","shortcuts.app.previousTab":"Go back to the previous tab (outside the terminal: inside, it goes to the CLI)","shortcuts.app.switchTab":"Previous / next tab (also Alt + PgUp / PgDn)","shortcuts.app.togglePanel":"Show or hide the right panel","shortcuts.ariaLabel":"Keyboard shortcuts","shortcuts.browserReserved":"<strong>Ctrl+T</strong>, <strong>Ctrl+W</strong> and <strong>Ctrl+Tab</strong> can't be used: the browser keeps them for its own tabs and the event never reaches the page.","shortcuts.cliHint":"The CLI handles these. The app doesn't intercept them: they reach it as they are. In the terminal, a new line is still <kbd>Ctrl + J</kbd> and images are pasted with <kbd>Alt + V</kbd>; the message box is the one with the keys above.","shortcuts.section.app":"Application","shortcuts.section.cli":"CLI, inside the terminal","shortcuts.section.composer":"In the message box","shortcuts.title":"Shortcuts","sidebar.action.archive":"Archive","sidebar.action.restore":"Restore","sidebar.action.undo":"Undo","sidebar.archived.hide_one":"Hide {{count}} archived","sidebar.archived.hide_other":"Hide {{count}} archived","sidebar.archived.show_one":"Show {{count}} archived","sidebar.archived.show_other":"Show {{count}} archived","sidebar.archived.toggleTitle":"Archived sessions stay on disk; this only shows or hides them","sidebar.empty.noMatch":"Nothing matches the filter.","sidebar.empty.noProjects":"No projects found in the history.","sidebar.hide":"Hide the projects","sidebar.history.button":"Archive history…","sidebar.history.buttonTitle":"Hide a CLI's sessions from before today in one go. Nothing is deleted","sidebar.history.confirm_one":"{{count}} {{label}} session will be hidden; nothing is deleted","sidebar.history.confirm_other":"{{count}} {{label}} sessions will be hidden; nothing is deleted","sidebar.history.count_one":"{{count}} session from before today","sidebar.history.count_other":"{{count}} sessions from before today","sidebar.history.heading":"Archive everything before today","sidebar.history.region":"Archive history","sidebar.indexing":"Indexing {{scanned}} / {{total}}","sidebar.newProject":"New project: choose or create a folder","sidebar.project.archive":"Archive project","sidebar.project.archiveTitle":"Archive the project: hides its conversations from the sidebar. Nothing is deleted","sidebar.project.export":"Export to Markdown","sidebar.project.folderGone":"The folder no longer exists on disk","sidebar.project.missing":"folder not found","sidebar.project.newSession":"New session in this project","sidebar.reindex":"Reindex the history","sidebar.searchMode.label":"Where to search","sidebar.searchMode.titlesTitle":"Filters the list by project name and session title","sidebar.selection.count_one":"{{count}} selected","sidebar.selection.count_other":"{{count}} selected","sidebar.session.archive":"Archive — hides it from the list, nothing is deleted","sidebar.session.blocked":"It has an open tab. Close it first.","sidebar.session.restore":"Restore to the list","sidebar.undo.dismissTitle":"Dismiss the notice; the sessions stay archived","sidebar.undo.text_one":"Archived {{count}} session from {{what}}","sidebar.undo.text_other":"Archived {{count}} sessions from {{what}}","sidebar.vaultLine.lastError":"Last error: {{error}}","sidebar.vaultLine.title":"See the backup's status and folder","sound.notify.blocked":"The browser is blocking this page's notifications. Allow them in the site's settings and click again.","sound.notify.off":"System notifications off — click to turn them on","sound.notify.on":"System notifications on — click to turn them off. They only show when this window isn't in view.","sound.off":"Notification sound muted — click to turn it on","sound.on":"Notification sound on — click to mute","sound.volume":"Notification sound volume","statusLine.benefit":"With the status line configured, this CLI's tabs show their status, the “waiting” bar when it asks for permission to use a tool, and the context meter with the exact window. Without it there's no way to know: the CLI doesn't leave it in any other file.","statusLine.check":"Check","statusLine.checkHint":"The app also notices on its own within a couple of seconds.","statusLine.checking":"Checking…","statusLine.copied":"Copied","statusLine.copy":"Copy","statusLine.copyTitle":"Copy the line to the clipboard","statusLine.lineSection":"The line","statusLine.mergeHint":"Merge it with what the file below already has, without replacing it: if it already has braces, add only the <kbd>statusLine</kbd> key.","statusLine.runsEverywhere":"With the line in place, every CLI session runs it, including the ones you open outside the app, and it needs <kbd>node</kbd> in the PATH.","statusLine.scriptHint":"It only saves the status, model and tokens of each conversation, in the app's folder. It doesn't save your email, your quota or the cost, which the CLI also passes to it, and it doesn't print anything: the CLI's own line stays as it is.","statusLine.scriptSection":"What the script does","statusLine.title":"{{agent}} status line","statusLine.whereHint":"The app doesn't touch that file: you edit it.","statusLine.whereSection":"Where","summary.alsoWorksWith":"Also works with: {{names}}","summary.newerServer":"The server is from a newer version than this page (protocol {{server}}, this page uses {{page}}). Reload the page with F5.","summary.outdatedServer":"The running server is from an older version than this page (protocol {{server}}, this page uses {{page}}). Restart it and reload the page.","support.dismiss":"Not now","support.link":"Support","support.notice":"If Agent Workbench is useful to you, consider supporting it.","tabs.aria.opening":"opening","tabs.aria.working":"working","tabs.close":"Close (Alt+W)","tabs.dot.busy":"The agent is working","tabs.dot.exited":"This tab's CLI has closed","tabs.dot.sleeping":"Sleeping: readable, no CLI open","tabs.dot.waiting":"The CLI is waiting for an answer from you","tabs.new":"New tab (Alt+T)","tabs.state.alive":"active","tabs.state.exited":"exited (code {{code}})","tabs.state.opening":"opening…","tabs.state.sleeping":"sleeping","terminal.exited":"the process exited (code {{code}})","terminal.replayTruncated":"earlier output trimmed","theme.dark":"Dark theme","theme.light":"Light theme","theme.system":"System theme","theme.title":"{{theme}} — click to change","thread.continueWith":"↪ Continue with…","thread.copyMessage":"Copy this message's text","thread.empty.noMessages":"The session doesn't have any messages yet.","thread.empty.unavailable":"This tab doesn't have a known directory, so there's no session file to follow.","thread.empty.waiting":"Waiting for the first message. The session file is created when the conversation starts.","thread.fold.less":"show less","thread.fold.more_one":"show {{count}} line","thread.fold.more_other":"show all {{count}} lines","thread.goToCli":"Go to the CLI tab","thread.image.alt":"message image","thread.image.gone":"the image is no longer in the file","thread.image.loading":"loading image…","thread.image.openTitle":"Click to see it full size","thread.jumpToEnd":"Jump to the end","thread.jumpToEndNew_one":"Jump to the end: {{count}} new message","thread.jumpToEndNew_other":"Jump to the end: {{count}} new messages","thread.jumpToOwn":"Jump to your previous message","thread.loadEarlier":"Load earlier messages","thread.loadingMore":"Loading...","thread.notice.compacted":"Context compacted","thread.notice.compactedAuto":"Context compacted automatically","thread.notice.error":"The CLI returned an error: {{detail}}","thread.notice.errorNoDetail":"The CLI returned an error","thread.notice.interrupted":"Interrupted","thread.pasted_one":"Pasted text #{{number}} · {{count}} line","thread.pasted_other":"Pasted text #{{number}} · {{count}} lines","thread.question.answerInCli":"Answer in the CLI tab","thread.question.answered":"Answered","thread.question.multi":"multiple","thread.question.pickEach":"Pick an option in each question · you can also answer in the CLI tab","thread.question.pickOne":"Pick an option · you can also answer in the CLI tab","thread.question.placeholder":"Write your answer","thread.question.send":"Send","thread.question.sendAnswers":"Send answers","thread.question.useText":"Use this text","thread.question.writeOther":"Write another answer…","thread.question.writeOtherHint":"To suggest an alternative, or give more context","thread.rewind":"Go back here — opens the CLI's rewind menu in the CLI tab (Esc Esc)","thread.search.next":"Next","thread.search.none":"no results","thread.search.placeholder":"Search the conversation","thread.search.previous":"Previous","thread.status.awaitingReply":"Delivered to the CLI · no reply yet · {{elapsed}}","thread.status.delivered":"Delivered to the CLI","thread.status.sending":"Sending to the CLI…","thread.status.subagent":"{{name}} ({{elapsed}})","thread.status.subagentUnnamed":"unnamed","thread.status.subagentsMore_one":"{{count}} more","thread.status.subagentsMore_other":"{{count}} more","thread.status.subagents_one":"{{count}} subagent still working: {{list}}","thread.status.subagents_other":"{{count}} subagents still working: {{list}}","thread.status.working":"The agent is working…","thread.status.workingDelivered":"The agent is working · message delivered","thread.status.workingFor":"The agent is working · {{elapsed}}","thread.status.workingForDelivered":"The agent is working · {{elapsed}} · message delivered","thread.tool.error":"error","thread.tool.imagesNotSent_one":"({{count}} image: not sent to the panel)","thread.tool.imagesNotSent_other":"({{count}} images: not sent to the panel)","thread.tool.images_one":"{{count}} image","thread.tool.images_other":"{{count}} images","thread.tool.input":"input","thread.tool.noOutput":"(no output)","thread.tool.orphanResult":"orphan result","thread.tool.result":"result","thread.truncated":"… (truncated)","thread.turn.effort":"effort {{effort}}","thread.turn.queued":"sent while it was working","thread.turn.queuedTitle":"You wrote it while the agent was working: it went into the turn already in progress","thread.turn.you":"You","thread.wake.exited":"This tab's CLI closed.","thread.wake.exitedWithCode":"This tab's CLI closed (exit code {{code}}).","thread.wake.open":"Open CLI","thread.wake.opening":"Opening…","thread.wake.sleeping":"You're reading this conversation without the CLI open. Open it to write to the agent.","threadFont.size.l":"large","threadFont.size.m":"normal","threadFont.size.s":"small","threadFont.title":"Font size: {{current}} (click: {{next}})","time.daysAgo":"{{count}} d ago","time.hoursAgo":"{{count}} h ago","time.justNow":"just now","time.minutesAgo":"{{count}} min ago","tools.run.agent_one":"{{count}} subagent","tools.run.agent_other":"{{count}} subagents","tools.run.callsTo_one":"{{count}} call to {{name}}","tools.run.callsTo_other":"{{count}} calls to {{name}}","tools.run.edit_one":"{{count}} edit","tools.run.edit_other":"{{count}} edits","tools.run.find_one":"{{count}} project search","tools.run.find_other":"{{count}} project searches","tools.run.read_one":"{{count}} file read","tools.run.read_other":"{{count}} files read","tools.run.shell_one":"{{count}} console command","tools.run.shell_other":"{{count}} console commands","tools.run.todo_one":"{{count}} to-do list","tools.run.todo_other":"{{count}} to-do lists","tools.run.web_one":"{{count}} search","tools.run.web_other":"{{count}} searches","vault.archived":"Archived sessions aren't copied, and archiving one that was already copied doesn't delete its copy. The app never deletes anything from this folder.","vault.busy":"A backup operation is in progress. Wait for it to finish.","vault.button.off":"Backup: off. Set it up","vault.button.on":"Backup: on. See the status and the folder","vault.dialog.activate":"Turn on","vault.dialog.activateExistingHint":"The folder already has a backup. Once on, it completes it and keeps it up to date.","vault.dialog.activateExistingTitle":"The folder already has a backup: turning it on completes it","vault.dialog.activateMeasuredHint":"Copies everything measured and, after that, every session that changes and stays quiet for a minute.","vault.dialog.activateMeasuredTitle":"Copies what was measured now and, after that, every session that changes","vault.dialog.changeDir":"Change folder…","vault.dialog.changeDirTitle":"Choose another folder. What was copied gets copied there; this one stays untouched","vault.dialog.defaultDir":"It's the default one, in the app's folder.","vault.dialog.folderSection":"Folder","vault.dialog.inFolder":"In the folder","vault.dialog.lastError":"Last error","vault.dialog.lastPass":"last pass {{when}}","vault.dialog.measure":"Measure","vault.dialog.measureAgain":"Measure again","vault.dialog.measureTitle":"Reads the whole history without writing anything, not even the folder","vault.dialog.needsMeasure":"First measure how much it would take: then “{{activate}}” shows up.","vault.dialog.openFolder":"Open folder","vault.dialog.openFolderTitle":"Open the folder in the system's file explorer","vault.dialog.pendingCalm_one":"{{count}} waiting for its quiet minute","vault.dialog.pendingCalm_other":"{{count}} waiting for their quiet minute","vault.dialog.sizeSection":"How much it would take","vault.dialog.table.archived":"Archived","vault.dialog.table.archivedTitle":"Archived sessions aren't copied","vault.dialog.table.images":"Images","vault.dialog.table.memory_one":"Memory of {{count}} project","vault.dialog.table.memory_other":"Memory of {{count}} projects","vault.dialog.table.sessions":"Sessions","vault.dialog.table.size":"Size","vault.dialog.table.total":"Total","vault.dialog.turnOff":"Turn off","vault.dialog.turnOffHint":"Turning it off doesn't delete anything: what was copied stays in the folder.","vault.dialog.waiting":"Waiting for the server's status…","vault.export.done":"Exported: the folder was opened","vault.export.exporting":"Exporting to Markdown…","vault.export.idle":"Export this project's sessions to Markdown","vault.indexNotReady":"The history is still being read. Measure when it's done.","vault.line.copying":"copying","vault.line.copyingProgress":"copying {{done}} / {{total}}","vault.line.measuring":"measuring","vault.line.moving":"moving to another folder","vault.line.neverCopied":"not copied yet","vault.line.pending_one":"{{count}} waiting","vault.line.pending_other":"{{count}} waiting","vault.mark.copy":"backup","vault.mark.copyTitle":"The CLI's history no longer has this session. The backup opens, in Markdown.","vault.mark.partial":"partial","vault.mark.partialTitle":"Only the summary and the documents were recovered: the conversation's content is encrypted.","vault.measure.summary":"Measured {{when}}, in {{duration}}","vault.measure.summaryNoWhen":"Measured in {{duration}}","vault.name":"Backup","vault.note.empty_one":"{{count}} empty","vault.note.empty_other":"{{count}} empty","vault.note.failedWithReasons_one":"{{count}} failed ({{reasons}})","vault.note.failedWithReasons_other":"{{count}} failed ({{reasons}})","vault.note.failed_one":"{{count}} failed","vault.note.failed_other":"{{count}} failed","vault.note.notCopied":"Not copied: {{parts}}","vault.note.unsupported_one":"{{count}} without a full read","vault.note.unsupported_other":"{{count}} without a full read","vault.previousDir":"The previous folder was left untouched: {{dir}}","vault.privacy":"It keeps the same as each CLI's history —messages, tool inputs and results, images— in a folder of yours. If you put it in a synced folder or in a repository, all that travels with it.","vault.sessions_one":"{{count}} session","vault.sessions_other":"{{count}} sessions","vault.state.measuring":"Measuring…","vault.state.measuringProgress":"Measuring… {{done}} / {{total}}","vault.state.moving":"Moving to another folder…","vault.state.off":"Off","vault.state.on":"On","vault.state.writing":"Copying…","vault.state.writingProgress":"Copying… {{done}} / {{total}}","workspace.connectFailed":"Couldn't connect to the local server. Open the URL it printed at startup again."},vu=["en","es","de","fr","pt-BR","ru","ja","ko","zh-CN"],nm="en",Ec={en:"English",es:"Español",de:"Deutsch",fr:"Français","pt-BR":"Português (Brasil)",ru:"Русский",ja:"日本語",ko:"한국어","zh-CN":"简体中文"},ty={en:"EN",es:"ES",de:"DE",fr:"FR","pt-BR":"PT",ru:"RU",ja:"JA",ko:"KO","zh-CN":"ZH"},yu={en:"en-US",es:"es-419",de:"de-DE",fr:"fr-FR","pt-BR":"pt-BR",ru:"ru-RU",ja:"ja-JP",ko:"ko-KR","zh-CN":"zh-CN"},ny={es:()=>Vn(()=>import("./es-ssi17uPF.js"),[]),de:()=>Vn(()=>import("./de-Dn90shDf.js"),[]),fr:()=>Vn(()=>import("./fr-CqnouzuH.js"),[]),"pt-BR":()=>Vn(()=>import("./pt-BR-BC8Km40N.js"),[]),ru:()=>Vn(()=>import("./ru-DFCLMfWY.js"),[]),ja:()=>Vn(()=>import("./ja-1U-Ks_ON.js"),[]),ko:()=>Vn(()=>import("./ko-Ce2gOy44.js"),[]),"zh-CN":()=>Vn(()=>import("./zh-CN-VwZ7SeiK.js"),[])},sm=ey,Xc=new Map([["en",sm]]),lf=new Map,Qc=new Set;let Gi=nm,Jc=yu[nm],af=0;function rm(n){return vu.includes(n)}function Zc(){return Gi}function Bl(){return Jc}function sy(n){return yu[n]}function im(n){return Qc.add(n),()=>Qc.delete(n)}async function om(n,s=yu[n]){const i=++af;if(!Xc.has(n)&&n!=="en"){const u=await ny[n]();Xc.set(n,u.default)}if(i===af&&!(Gi===n&&Jc===s)){Gi=n,Jc=s;for(const u of Qc)u()}}function ry(n,s){let i=lf.get(n);return i===void 0&&(i=new Intl.PluralRules(n),lf.set(n,i)),i.select(s)}function cf(n,s,i,u){if(u!==void 0){const _=n[`${i}_${ry(s,u)}`]??n[`${i}_other`];if(_!==void 0)return _}return n[i]}function iy(n,s,i,u){const _=u==null?void 0:u.count,R=typeof _=="number"?_:void 0;return(n===void 0?void 0:cf(n,s,i,R))??cf(sm,"en",i,R)??i}function xl(n,s){return s===void 0?n:n.replace(/\{\{\s*([A-Za-z0-9_]+)\s*\}\}/g,(i,u)=>{const _=s[u];return _===void 0?i:String(_)})}function lm(n,s){return iy(Xc.get(Gi),Gi,n,s)}function C(n,s){return xl(lm(n,s),s)}function oy(){return[{keys:"Esc",description:C("agent.shortcuts.codex.interruptTurn")},{keys:"Esc Esc",description:C("agent.shortcuts.codex.editPrevious")},{keys:"Ctrl + C",description:C("agent.shortcuts.codex.interruptOrExit")},{keys:"Alt + , / Alt + .",description:C("agent.shortcuts.codex.effort")},{keys:"Shift + Tab",description:C("agent.shortcuts.codex.cycleMode")},{keys:"Tab",description:C("agent.shortcuts.codex.queue")},{keys:"Ctrl + T",description:C("agent.shortcuts.codex.transcript")},{keys:"Ctrl + R",description:C("agent.shortcuts.codex.searchHistory")},{keys:"@",description:C("agent.shortcuts.codex.mention")},{keys:"/",description:C("agent.shortcuts.commands")},{keys:"Ctrl + G",description:C("agent.shortcuts.codex.externalEditor")}]}function ly(){return[{keys:"Esc Esc",description:C("agent.shortcuts.opencode.interrupt")},{keys:"Tab / Shift + Tab",description:C("agent.shortcuts.opencode.cycleAgent")},{keys:"Ctrl + P",description:C("agent.shortcuts.opencode.commandList")},{keys:C("agent.shortcuts.leaderThen",{key:"M"}),description:C("agent.shortcuts.opencode.model")},{keys:C("agent.shortcuts.leaderThen",{key:"N"}),description:C("agent.shortcuts.opencode.newSession")},{keys:"Ctrl + J",description:C("agent.shortcuts.opencode.newline")},{keys:"Ctrl + C",description:C("agent.shortcuts.opencode.clearInput")},{keys:"Ctrl + V",description:C("agent.shortcuts.opencode.paste")}]}function ay(){return[{keys:"Esc",description:C("agent.shortcuts.antigravity.interrupt")},{keys:"Shift + Tab",description:C("agent.shortcuts.antigravity.cycleMode")},{keys:"1 … 4",description:C("agent.shortcuts.antigravity.answerPermission")},{keys:"/",description:C("agent.shortcuts.commands")},{keys:"?",description:C("agent.shortcuts.antigravity.help")}]}function cy(){return[{keys:"Esc",description:C("agent.shortcuts.interruptCli")},{keys:"Esc Esc",description:C("agent.shortcuts.claudeCode.rewind")},{keys:"Ctrl + C",description:C("agent.shortcuts.claudeCode.cancel")},{keys:"Ctrl + R",description:C("agent.shortcuts.claudeCode.searchHistory")},{keys:"Ctrl + O",description:C("agent.shortcuts.claudeCode.fullOutput")},{keys:"Shift + Tab",description:C("agent.shortcuts.claudeCode.cycleMode")},{keys:"Alt + V",description:C("agent.shortcuts.claudeCode.pasteImage")},{keys:"Ctrl + V",description:C("agent.shortcuts.claudeCode.pasteText")}]}const Xr={"claude-code":{shortLabel:"CC",get shortcuts(){return cy()},shortcutsNote:null,instructionsFile:"CLAUDE.md",savesModelChoice:!1},codex:{shortLabel:"CX",get shortcuts(){return oy()},get shortcutsNote(){return C("agent.shortcuts.codex.note")},instructionsFile:"AGENTS.md",savesModelChoice:!1},opencode:{shortLabel:"OC",get shortcuts(){return ly()},get shortcutsNote(){return C("agent.shortcuts.opencode.note")},instructionsFile:"AGENTS.md",savesModelChoice:!1},antigravity:{shortLabel:"AG",get shortcuts(){return ay()},shortcutsNote:null,instructionsFile:"AGENTS.md",savesModelChoice:!0}},uy={"gemini-cli":"GC","antigravity-ide":"AI"};function hy(n){return ti(n)?Xr[n].shortLabel:uy[n]}function Zi(n,s){var i;return ti(n)?((i=s.find(u=>u.id===n))==null?void 0:i.label)??n:tv[n]}const am="Sesion sin titulo";function qn(n,s){return s==="none"||n===am?C("session.untitled"):n}function dy(n,s){const i=new Map;for(const _ of s)_.titleSource==="none"||_.title===am||i.set(`${_.agent}\0${_.sessionId}`,_.title);const u=new Map;for(const _ of n){if(_.agent===null||_.sessionId.length===0)continue;const R=i.get(`${_.agent}\0${_.sessionId}`);R!==void 0&&u.set(_.terminalId,R)}return u}function eu(n){return n.storage==="native"&&ti(n.agent)}function fy(n){return n!==null&&Xr[n].savesModelChoice}function py(n,s,i){if(s!=null)return s;for(let u=n.length-1;u>=0;u-=1){const _=n[u];if(!(_===void 0||_.effort===null))return i===null||_.at>=i?_.effort:null}return null}function my(n){return n===null?null:Xr[n].instructionsFile}function gy(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 _y(n,s){const i=Nv(s,n);return i===null?null:n.find(u=>u.value===i.value)??null}function vy(n,s){return n??s.launchMode}const yy={auto:"mode.auto.label",default:"mode.default.label",acceptEdits:"mode.acceptEdits.label",plan:"mode.plan.label"},wy={auto:"mode.auto.hint",default:"mode.default.hint",acceptEdits:"mode.acceptEdits.hint",plan:"mode.plan.hint"};function cm(n){return C(yy[n])}function by(n){return C(wy[n])}function Sy(n,s){return C("agent.mode.title",{mode:cm(n),hint:by(n),key:s.keyLabel})}function um(n,s){return n.approvesPendingOnCycle&&s!==null}function Cy(n,s,i,u){if(um(s,u))return C("agent.mode.blocked");const _=Sy(n,s);return!s.approvesPendingOnCycle||i?_:C("agent.mode.titleBlind",{title:_})}const xy={active:"agent.statusLine.state.active",missing:"agent.statusLine.state.missing","other-command":"agent.statusLine.state.otherCommand",disabled:"agent.statusLine.state.disabled",unreadable:"agent.statusLine.state.unreadable"};function ky(n){return C(xy[n])}function Ey(){return C("agent.statusLine.noFragment")}function Ly(n,s,i=new Set){return n.filter(u=>(s||u.id!=="plans")&&(u.id==="cli"||!i.has(u.id)))}function Ty(n,s,i=new Set){return n==="plans"&&!s||n!=="cli"&&i.has(n)?"cli":n}function Ry(n,s,i){const u=_=>_===null?void 0:s.find(R=>R.id===_);return u(n)??u(i)??s[0]??null}function My(n){return[{keys:"Enter",description:C("agent.shortcuts.composer.send")},{keys:"Shift + Enter",description:C("agent.shortcuts.composer.newline")},{keys:"Ctrl + V",description:C(n?"agent.shortcuts.composer.pasteWithImages":"agent.shortcuts.composer.pasteText")},{keys:"Esc",description:C("agent.shortcuts.interruptCli")}]}function Ay(){return C("agent.composer.imagesRefused")}function Ny(n,s,i){return i??(n==="token-count"||n==="status-line"?s.contextWindow:null)}function Dy(n,s){return n==="status-line"?s.lastRequestTokens>0:s.assistantMessages>0}function Iy(n,s){return n===null&&s!==null&&s.state!=="active"}function jy(n){return C(n==="other-command"?"agent.meter.setup.otherCommand":n==="disabled"?"agent.meter.setup.disabled":n==="unreadable"?"agent.meter.setup.unreadable":"agent.meter.setup.missing")}function Py(n,s){return s.contextWindowEstimated?C("agent.meter.origin.estimated"):n==="usage-with-catalog"&&s.contextWindow!==null?C("agent.meter.origin.catalog"):null}function Oy(n,s=null){return s==="status-line"?C("agent.meter.idle.statusLine"):n===null?C("agent.meter.idle.noFile"):C("agent.meter.idle.withFile",{file:n})}function By(n,s=null){return n==="idle"?C("agent.dot.idle"):n==="unknown"?s===null?C("agent.dot.noStatus"):s.state==="active"?C("agent.dot.statusLinePending"):C("agent.dot.statusLineOnly"):C("agent.dot.open")}function uf(n,s){return n.length===0?!0:n.some(i=>i.id===s&&i.available&&i.capabilities.resume)}function Fy(n,s,i){return n?i?C("agent.note.empty"):C("agent.note.send",{cwd:s??""}):C(s===null?"agent.note.needsTab":"agent.note.noReadySignal")}function hm(n,s,i){const u=Zr(s,i);let _=null;for(const R of n)R.kind!=="agent"||R.agent===null||Zr(R.cwd,i)===u&&(_=R.agent);return _}function dm(n,s){var u;const i=s.filter(_=>_.available);for(const _ of n)if(_!==null&&i.some(R=>R.id===_))return _;return((u=i[0])==null?void 0:u.id)??null}function Hy(n){let s=null;for(const i of n){const u=i.agent;ti(u)&&(s===null||i.updatedAt>s.updatedAt)&&(s={agent:u,updatedAt:i.updatedAt})}return(s==null?void 0:s.agent)??null}function $y(n,s,i,u,_){return dm([hm(n,s,i),_],u)}function Uy(n,s,i,u,_){return dm([hm(n,s.cwd,i),Hy(s.sessions),_],u)}function fm(n){return n.filter(s=>s.available)}function Wy(n,s){const i=n.findIndex(u=>u.id===s);return i===-1?0:i}function zy(n,s,i){return i<=0?0:((n+s)%i+i)%i}function Vy(n,s,i,u=4){const _=n.bottom+2,R=n.top-2-s.height,x=_+s.height+u<=i.height||R<u?Math.max(u,Math.min(_,i.height-s.height-u)):R;return{left:Math.max(u,Math.min(n.left,i.width-s.width-u)),top:x}}function qy(n,s,i){const u=n;return u===null||typeof u!="object"||typeof u.contains!="function"?!0:i!==null&&i.contains(n)?!1:u.contains(s)}function pm(n,s,i=!1){return s===null||i||!gu(n)?[]:fm(n).filter(u=>u.id!==s)}function Ky(){return C("agent.continue.title")}function Gy(n,s,i){return s?C("agent.continue.discovering"):n.length===0?C("agent.continue.noConversation"):i?null:C("agent.continue.noMessages")}function Yy(n,s,i,u){const _=s>=i&&!u?i===1?C("agent.handoff.turns.single"):C("agent.handoff.turns.all",{count:i}):s===1?u?C("agent.handoff.turns.lastOneOfMore",{total:i}):C("agent.handoff.turns.lastOne",{total:i}):u?C("agent.handoff.turns.lastManyOfMore",{count:i,included:s}):C("agent.handoff.turns.lastMany",{count:i,included:s});return C("agent.handoff.notice",{label:n,turns:_})}const hf=40;function df(n){const s=n.replace(/\s+/g," ").trim(),i=[...s],u=i.length>hf?`${i.slice(0,hf).join("").trimEnd()}…`:s;return u.length>0?C("agent.handoff.tabLabel",{title:u}):C("agent.handoff.tabLabelNoTitle")}function Xy(){return C("agent.handoff.sending")}function Qy(n){switch(n){case"no-delivery":return C("agent.handoff.prefill.noDelivery");case"not-ready":return C("agent.handoff.prefill.notReady");case"send-failed":return C("agent.handoff.prefill.sendFailed")}}function ff(n,s){return n.trim().length===0?s:`${s}
42
-
43
- ${n}`}function Jy(n,s){return n&&s!==null}function Zy(n,s,i){if(!ti(n))return{badge:!0,unavailableTitle:null};const u=s.find(x=>x.id===n),_=s.some(x=>x.available),R=u!==void 0&&!u.available&&_;return{badge:i||R,unavailableTitle:R?C("agent.session.cliMissing",{label:u.label}):null}}function ew(n,s,i){return n!==null&&s===""&&!i.sessionIdAtLaunch}function tw(){return C("agent.thread.noTranscript")}function nw(){return C("agent.thread.discovering")}function sw(n,s,i,u,_=null){return!u||!Op(n,_)||!s?null:i===null?C("agent.openTool.noLabel"):C("agent.openTool.withLabel",{label:i})}function mm(n,s=!1){return C(n==="permission prompt"?"agent.waiting.permission":n==="question"&&s?"agent.waiting.question":"agent.waiting.answer")}function rw(n){return n.relaunching?"relaunching":n.offlineReason==="server-closed"&&n.alive?"offer":null}function iw(n){return n===null?C("agent.serverClosed.noLabel"):C("agent.serverClosed.withLabel",{label:n})}function ow(){return C("agent.serverClosed.relaunch")}function lw(){return C("agent.serverClosed.relaunching")}function aw(n,s){const i=new Map,u=[];for(const[_,R]of n){const x=s.find(r=>r.terminalId===_);x===void 0||x.alive&&R==="exited"?u.push(_):i.set(_,x.alive?R:"exited")}return{phases:i,finished:u}}function cw(n,s,i){var u;return!i||s===null||((u=n.permissionCycle)==null?void 0:u.approvesPendingOnCycle)!==!0&&!n.waitingBlocksSubmit?null:mm(s,n.questionCards)}const uw=2e4;function hw(n){if(n.label.length>0)return n.label;const s=n.cwd.split(/[\\/]/).filter(i=>i.length>0);return s[s.length-1]??n.cwd}function dw(n,s,i){const u=n.map(R=>({terminalId:R.terminalId,kind:R.kind,cwd:R.cwd})),_=[];for(const R of s){const x=q0(u.map(r=>r.terminalId),r=>u.find(c=>c.terminalId===r),{cwd:R.cwd},i);_.push({pending:R,index:x,label:hw(R)}),u.splice(x,0,{terminalId:`pending:${R.requestId}`,kind:"agent",cwd:R.cwd})}return _}function pf(n,s,i){const u=Zr(s,i);return n.some(_=>Zr(_.cwd,i)===u)}function gm(){return C("agent.openBlocked")}const fw={low:"controls.effort.low",medium:"controls.effort.medium",high:"controls.effort.high",xhigh:"controls.effort.xhigh",max:"controls.effort.max"};function pw(n){const s=fw[n.value];return s===void 0?n.label:C(s)}function mw(n){return n.value==="default"?C("controls.model.default"):Av(n)}function gw({models:n,efforts:s,model:i,effort:u,modelProvisional:_=!1,effortProvisional:R=!1,savesChoice:x=!1,disabled:r,onCommand:c}){const g=n===null?null:_y(n,i),v=g===null&&i!==null;return l.jsxs(l.Fragment,{children:[n!==null&&l.jsxs("select",{className:"agent-select",value:(g==null?void 0:g.value)??"",disabled:r,onChange:h=>{h.target.value.length>0&&c(Iv(h.target.value))},title:i===null?C("controls.model.noData"):_?C("controls.model.provisional",{model:i}):x?C("controls.model.inUseSaved",{model:i}):C("controls.model.inUse",{model:i}),children:[g===null&&l.jsx("option",{value:"",children:v?i??"":C("controls.model.placeholder")}),n.map(h=>l.jsx("option",{value:h.value,children:mw(h)},h.value))]}),s!==null&&l.jsxs("select",{className:"agent-select",value:u??"",disabled:r,onChange:h=>{h.target.value.length>0&&c(jv(h.target.value))},title:u===null?C("controls.effort.noData"):R?C("controls.effort.provisional",{effort:u}):x?C("controls.effort.inUseSaved",{effort:u}):C("controls.effort.inUse",{effort:u}),children:[u===null&&l.jsx("option",{value:"",children:C("controls.effort.placeholder")}),s.map(h=>l.jsx("option",{value:h.value,children:pw(h)},h.value))]})]})}function _w({mode:n,cycle:s,disabled:i,waitingFor:u=null,statusKnown:_=!0,onChange:R}){const x=vy(n,s);return l.jsx("select",{className:"agent-select agent-select-mode",value:x,disabled:i||um(s,u),onChange:r=>{Yr(r.target.value)&&R(r.target.value)},title:Cy(x,s,_,u),children:s.modes.map(r=>l.jsx("option",{value:r,children:cm(r)},r))})}function Ml(n){const s=n.replace(/(\r?\n)+$/,"");return s.length===0?0:s.split(`
44
- `).length}function vw(n,s){return s===0?C("composer.chip.pastedTextEmpty",{number:n}):C("composer.chip.pastedText",{number:n,count:s})}function yw(n){return n.length===0?1:Math.max(...n)+1}function ww(n){const s=new Set;for(const i of n.matchAll(Q0()))s.add(Number(i[1]));return[...s].sort((i,u)=>i-u)}const bw=/[^\s([{"'¿¡«]/u,Sw=/[\p{L}\p{N}]/u;function Cw(n,s,i,u){const{start:_,end:R,before:x,after:r}=_m(n,s,i),c=`${x!==""&&bw.test(x)?" ":""}${em(u)}${r!==""&&Sw.test(r)?" ":""}`;return vm(n,_,R,c)}const xw=/[^\s([{¿¡«]/u,kw=/[\p{L}\p{N}"'«]/u;function mf(n,s,i,u){const{start:_,end:R,before:x,after:r}=_m(n,s,i),c=x!==""&&xw.test(x),g=r===""||kw.test(r),v=`${c?" ":""}${u}${g?" ":""}`;return vm(n,_,R,v)}function _m(n,s,i){const u=Math.max(0,Math.min(s,n.length)),_=Math.max(u,Math.min(i,n.length));return{start:u,end:_,before:u>0?n.charAt(u-1):"",after:_<n.length?n.charAt(_):""}}function vm(n,s,i,u){return{text:`${n.slice(0,s)}${u}${n.slice(i)}`,inserted:u,caret:s+u.length}}function ym(n,s){const i=new RegExp(`( ?)${Tw(em(s))}( ?)`,"g");return n.replace(i,(u,_,R)=>_!==""&&R!==""?" ":"")}function Ew(n,s){let i=s;const u=[];for(const _ of n){const R=_.text.replace(/\r\n?/g,`
45
- `).replace(/\n+$/,"");if(R.trim().length===0){i=ym(i,_.number);continue}u.push(`${K0(_.number)}
46
- ${R}
47
- ${G0(_.number)}`)}return i.trim().length>0&&u.push(i),u.join(`
48
-
49
- `)}function Lw(n,s=!1){const i=n.replace(/\r\n?/g,`
50
- `),u=[],_=c=>{const g=c.replace(/^\n+|\n+$/g,"");g.trim().length>0&&u.push({kind:"text",text:g})};let R=0;for(const c of i.matchAll(Y0())){const g=c[1]??"",v=(c.index??0)+g.length;_(i.slice(R,v)),u.push({kind:"pasted",number:Number(c[2]),text:c[3]??"",complete:!0}),R=(c.index??0)+c[0].length}const x=i.slice(R),r=s?X0().exec(x):null;if(r!==null){const c=r.index+(r[1]??"").length;_(x.slice(0,c)),u.push({kind:"pasted",number:Number(r[2]),text:x.slice(r.index+r[0].length),complete:!1})}else _(x);return u.some(c=>c.kind==="pasted")?u:[{kind:"text",text:n}]}function Tw(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const Rw=800;function kl(n){return{text:n.text,pasted:n.items.flatMap(s=>s.kind==="text"?[{number:s.number,text:s.text}]:[])}}function Mw(n,s){return{text:n.text,items:n.pasted.map(i=>({id:s(),kind:"text",number:i.number,text:i.text,lines:Ml(i.text)}))}}function Aw(n,s){if(s===void 0)return{start:n,end:n,direction:"forward",scrollTop:"end"};const i=R=>Math.min(Math.max(0,R),n),u=i(s.selectionStart),_=Math.max(u,i(s.selectionEnd));return{start:u,end:_,direction:s.backward?"backward":"forward",scrollTop:Math.max(0,s.scrollTop)}}function Nw(n){return Vp(kl(n))>zp}function Vr(n,s){return n===void 0||Ll(n)?Ll(s):qp(n,s)}const gf={text:"",pasted:[]};function Dw(n,s,i){const u=Mw(n,i),_=((s==null?void 0:s.items)??[]).filter(R=>R.kind!=="text");return{text:u.text,items:[...u.items,..._]}}class Iw{constructor(s){Mt(this,"local",new Map);Mt(this,"views",new Map);Mt(this,"saved",new Map);Mt(this,"heard",new Map);Mt(this,"unconfirmed",new Map);Mt(this,"submitting",new Map);Mt(this,"pending",new Map);Mt(this,"listeners",new Set);Mt(this,"serverKeeps",!1);this.deps=s}get(s){return this.local.get(s)}put(s,i){this.local.set(s,i),this.schedule(s,kl(i))}rememberView(s,i){this.views.set(s,i)}viewOf(s){return this.views.get(s)}submitted(s,i){this.cancel(s),this.local.delete(s),this.views.delete(s),this.saved.delete(s),this.unconfirmed.delete(s),this.submitting.set(s,i?"sent":"queued")}restore(s){const i=!this.serverKeeps;this.serverKeeps=!0;const u=[];for(const{terminalId:_,draft:R}of s)this.receive(_,R,i)&&u.push(_);for(const _ of u)for(const R of this.listeners)R(_);for(const[_,R]of[...this.pending])R.handle===null&&this.sendNow(_)}reconnected(){this.serverKeeps=!1;for(const[s,i]of[...this.submitting])i==="sent"?this.submitting.delete(s):this.submitting.set(s,"sent")}retain(s){const i=new Set(s);for(const u of new Set([...this.local.keys(),...this.views.keys(),...this.saved.keys(),...this.heard.keys(),...this.unconfirmed.keys(),...this.submitting.keys(),...this.pending.keys()]))i.has(u)||(this.cancel(u),this.local.delete(u),this.views.delete(u),this.saved.delete(u),this.heard.delete(u),this.unconfirmed.delete(u),this.submitting.delete(u))}flushAll(){for(const s of[...this.pending.keys()])this.sendNow(s)}onRestored(s){return this.listeners.add(s),()=>this.listeners.delete(s)}receive(s,i,u){const _=this.heard.get(s);if(this.heard.set(s,i),this.submitting.has(s)){if(!Ll(i))return!1;this.submitting.delete(s)}const R=this.unconfirmed.get(s);if(R!==void 0)if(Vr(R,i))this.unconfirmed.delete(s);else if(u)if(Vr(_,i)){this.unconfirmed.delete(s),this.setSaved(s,i);const g=this.local.get(s);return g!==void 0&&this.schedule(s,kl(g)),!1}else this.unconfirmed.delete(s);else return!1;const x=this.local.get(s),r=x===void 0?gf:kl(x),c=Vr(this.saved.get(s),r);return this.setSaved(s,i),this.pending.has(s)||!c||Vr(i,r)?!1:(this.local.set(s,Dw(i,x,this.deps.newId)),this.views.delete(s),!0)}setSaved(s,i){Ll(i)?this.saved.delete(s):this.saved.set(s,i)}schedule(s,i){const u=this.pending.get(s);if(u!==void 0&&qp(u.draft,i)||(this.cancel(s),Vr(this.saved.get(s),i)))return;const _=this.deps.setTimer(()=>this.sendNow(s),this.deps.delayMs??Rw);this.pending.set(s,{handle:_,draft:i})}cancel(s){const i=this.pending.get(s);i!==void 0&&(i.handle!==null&&this.deps.clearTimer(i.handle),this.pending.delete(s))}sendNow(s){const i=this.pending.get(s);if(i===void 0)return;if(i.handle!==null&&this.deps.clearTimer(i.handle),!this.serverKeeps||!this.deps.connected()){this.pending.set(s,{handle:null,draft:i.draft});return}this.pending.delete(s);const u=Vp(i.draft)>zp?gf:i.draft;Vr(this.saved.get(s),u)||(this.deps.send(s,u),this.unconfirmed.set(s,u),this.setSaved(s,u))}}const tu=1024,nu=tu*1024,_f=nu*1024;function Gr(n,s=0){return new Intl.NumberFormat(Bl(),{minimumFractionDigits:s,maximumFractionDigits:s,useGrouping:!1}).format(n)}function hn(n){return!Number.isFinite(n)||n<tu?C("format.bytes.b",{value:Gr(Math.max(0,Math.round(n)||0))}):n<nu?C("format.bytes.kb",{value:Gr(Math.round(n/tu))}):n<_f?C("format.bytes.mb",{value:Gr(n/nu,1)}):C("format.bytes.gb",{value:Gr(n/_f,2)})}function wm(n){const s=Math.floor(n/60),i=n%60;return i===0?C("format.duration.minutes",{value:s}):C("format.duration.minutesSeconds",{minutes:s,seconds:i})}function jw(n){if(n<1e3)return C("format.duration.ms",{value:n});const s=Math.round(n/1e3);return s<60?C("format.duration.seconds",{value:s}):wm(s)}function Yi(n){if(!Number.isFinite(n)||n<1e3)return C("format.duration.underSecond");const s=Math.round(n/1e3);return s<60?C("format.duration.seconds",{value:s}):wm(s)}function Kn(n,s=Date.now()){if(n<=0)return"";const i=Math.floor((s-n)/6e4);if(i<1)return C("time.justNow");if(i<60)return C("time.minutesAgo",{count:i});const u=Math.floor(i/60);if(u<24)return C("time.hoursAgo",{count:u});const _=Math.floor(u/24);return _<30?C("time.daysAgo",{count:_}):Pw(n)}function Pw(n){return new Date(n).toLocaleDateString(Bl())}function bm(n){return new Date(n).toLocaleTimeString(Bl(),{hour:"2-digit",minute:"2-digit"})}function wu(n){return new Intl.ListFormat(Bl(),{type:"conjunction"}).format(n)}var Sm=Pp();function Cm({src:n,caption:s,onClose:i}){return j.useEffect(()=>{const u=_=>{_.key==="Escape"&&(_.preventDefault(),_.stopPropagation(),i())};return window.addEventListener("keydown",u,!0),()=>window.removeEventListener("keydown",u,!0)},[i]),Sm.createPortal(l.jsxs("div",{className:"viewer",onClick:i,role:"presentation",children:[l.jsx("div",{className:"viewer-frame",onClick:u=>u.stopPropagation(),children:l.jsx("img",{className:"viewer-image",src:n,alt:s})}),l.jsxs("div",{className:"viewer-bar",children:[l.jsx("span",{className:"viewer-caption",children:s}),l.jsx("button",{className:"viewer-close",onClick:i,title:C("common.closeEsc"),children:"×"})]})]}),document.body)}const Ow=768,Bw=`(max-width: ${Ow}px)`,Fw="(hover: none)",vf="agent-workbench.narrow-view",xm="tab",km=["chat","cli","git","files","plans","memory","notes","console"];function Hw(n){return typeof n=="string"&&km.includes(n)}function $w(n){return Hw(n)?n:null}function Uw(n){const s=n.hidden??new Set,i=u=>u==="chat"||u==="cli"||!s.has(u);return n.hasTab?km.filter(u=>(u!=="plans"||n.plansAvailable)&&i(u)):["chat","notes"].filter(i)}function Ww(n,s){return s.includes(n)?n:"chat"}function yf(n){switch(n){case"cli":case"git":case"files":case"plans":case"memory":return n;default:return null}}const zw={chat:"narrow.view.chat",cli:"panel.tab.cli",git:"panel.tab.git",files:"panel.tab.files",plans:"panel.tab.plans",memory:"panel.tab.memory",notes:"notes.name",console:"console.name"};function Vw(n){return zw[n]}const qw=/^[A-Za-z0-9_-]{1,80}$/;function Kw(n){const s=new URLSearchParams(n).get(xm);return s!==null&&qw.test(s)?s:null}function Gw(n,s){const i=new URLSearchParams(n);for(const _ of s)i.delete(_);const u=i.toString();return u.length>0?`?${u}`:""}const Yw=[{id:"esc",label:"Esc",data:"\x1B",titleKey:"narrow.keys.esc"},{id:"tab",label:"Tab",data:" ",titleKey:"narrow.keys.tab"},{id:"shift-tab",label:"⇧Tab",data:"\x1B[Z",titleKey:"narrow.keys.shiftTab"},{id:"up",label:"↑",data:"\x1B[A",titleKey:"narrow.keys.up"},{id:"down",label:"↓",data:"\x1B[B",titleKey:"narrow.keys.down"},{id:"left",label:"←",data:"\x1B[D",titleKey:"narrow.keys.left"},{id:"right",label:"→",data:"\x1B[C",titleKey:"narrow.keys.right"},{id:"interrupt",label:"^C",data:"",titleKey:"narrow.keys.interrupt"},{id:"ctrl-o",label:"^O",data:"",titleKey:"narrow.keys.ctrlO"},{id:"ctrl-x",label:"^X",data:"",titleKey:"narrow.keys.ctrlX"}];function Xw(n,s){return n.shiftKey||n.altKey?!1:!s||n.ctrlKey||n.metaKey}const Qw="AgentWorkbenchAndroid/",Jw="agentworkbench://settings",Zw="agentworkbench://disconnect",wf="agentWorkbenchBack";function Em(n){return n.includes(Qw)}function e1(n){return n.dialogOpen?"close-dialog":n.sheetOpen?"close-sheet":n.drawerOpen?"close-drawer":n.view!=="chat"?"show-chat":null}const t1=6e4,n1=10*6e4,s1=15e3,r1=4e3,i1=3,Lm={runStartedAt:null,busySeenAt:null};function o1(){return`submit-${typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}`}function l1(n,s){var u;let i=0;if(n!==null){const _=s.findIndex(R=>R.eventId===n);if(_===-1)return!0;i=_+1}for(let _=i;_<s.length;_+=1)if(((u=s[_])==null?void 0:u.role)==="assistant")return!0;return!1}function a1(n,s,i,u){const _=s==="busy"||n==="busy"?u:i.busySeenAt;let R=null;return s==="busy"?n==="idle"?R=u:(n==="busy"||n==="waiting")&&(R=i.runStartedAt):s==="waiting"&&(R=i.runStartedAt),{runStartedAt:R,busySeenAt:_}}function c1(n,s,i,u){const _=new Map;for(const[R,x]of s){const r=n.get(R),c=i.get(R);_.set(R,c!==void 0&&r===x?c:a1(r,x,c??Lm,u))}return _}function u1(n,s){const i=new Map;for(const[u,_]of n)_.phase!=="sending"?i.set(u,_):_.queued&&i.set(u,{..._,queued:!1,sentAt:s});return i}function h1(n,s,i){const u=n.get(s.terminalId);if(u===void 0||u.requestId!==s.requestId)return n;const _=new Map(n);return s.delivered?_.set(s.terminalId,{...u,phase:"delivered",queued:!1,deliveredAt:i}):_.delete(s.terminalId),_}function d1(n){if(!n.live||n.waitingFor!==null)return null;const{receipt:s,activity:i,now:u}=n,_=n.clock??Lm;if((s==null?void 0:s.phase)==="sending"&&(s.queued||u-s.sentAt<t1))return{kind:"sending"};const R=(s==null?void 0:s.phase)==="delivered"?s.deliveredAt:null;return i==="busy"?{kind:"working",since:_.runStartedAt,justDelivered:R!==null&&u-R<r1}:s===null||R===null||l1(s.afterEventId,n.events)?null:i==="unknown"?u-R<n1?{kind:"awaiting-reply",since:R}:null:i!=="idle"&&i!==null||_.busySeenAt!==null&&_.busySeenAt>=s.sentAt?null:u-R<s1?{kind:"delivered"}:null}function f1(n,s){switch(n.kind){case"sending":return C("thread.status.sending");case"delivered":return C("thread.status.delivered");case"working":{const i=n.since===null?0:s-n.since;if(i<1e3)return n.justDelivered?C("thread.status.workingDelivered"):C("thread.status.working");const u={elapsed:Yi(i)};return n.justDelivered?C("thread.status.workingForDelivered",u):C("thread.status.workingFor",u)}case"awaiting-reply":{const i=s-n.since;return i<1e3?C("thread.status.delivered"):C("thread.status.awaitingReply",{elapsed:Yi(i)})}}}function p1(n,s){const i=n.slice(0,i1).map(_=>C("thread.status.subagent",{name:_.description.length>0?_.description:C("thread.status.subagentUnnamed"),elapsed:Yi(Math.max(0,s-_.startedAt))})),u=n.length-i.length;return u>0&&i.push(C("thread.status.subagentsMore",{count:u})),C("thread.status.subagents",{count:n.length,list:wu(i)})}const m1=5,g1=1200;function Lc(){return crypto.randomUUID()}function _1(n=!0){const[s,i]=j.useState([]),[u,_]=j.useState(null),R=j.useCallback(E=>{if(s.filter(a=>a.kind==="image").length>=xc){_(C("composer.problem.tooManyImages",{count:xc}));return}if(E.size>Rl){const a=Math.round(E.size/1024/1024),m=Rl/1024/1024;_(E.name.length>0?C("composer.problem.tooBig",{name:E.name,size:a,max:m}):C("composer.problem.imageTooBig",{size:a,max:m}));return}const f=new FileReader;f.onload=()=>{const a=f.result;if(typeof a!="string")return;const m=a.indexOf(",");m!==-1&&i(p=>p.filter(d=>d.kind==="image").length>=xc?p:[...p,{id:Lc(),kind:"image",mediaType:E.type,base64:a.slice(m+1),dataUrl:a,bytes:E.size,name:E.name.length>0?E.name:C("composer.pastedImage")}])},f.onerror=()=>_(C("composer.problem.imageUnreadable")),f.readAsDataURL(E)},[s]),x=j.useCallback(E=>{if(s.filter(a=>a.kind==="file").length>=kc){_(C("composer.problem.tooManyFiles",{count:kc}));return}if(E.size===0){_(C("composer.problem.empty",{name:E.name}));return}if(E.size>tf){_(C("composer.problem.tooBig",{name:E.name,size:Math.round(E.size/1024/1024),max:tf/1024/1024}));return}const f=new FileReader;f.onload=()=>{const a=f.result;if(typeof a!="string")return;const m=a.indexOf(",");m!==-1&&i(p=>p.filter(d=>d.kind==="file").length>=kc?p:[...p,{id:Lc(),kind:"file",name:E.name.length>0?E.name:"archivo",base64:a.slice(m+1),bytes:E.size}])},f.onerror=()=>_(C("composer.problem.unreadable",{name:E.name})),f.readAsDataURL(E)},[s]),r=j.useCallback(E=>{const f=Array.from(E),a=f.filter(p=>p.type.startsWith("image/")),m=f.filter(p=>!p.type.startsWith("image/"));if(a.length>0&&!n)_(Ay());else for(const p of a)R(p);for(const p of m)x(p)},[R,x,n]),c=j.useCallback((E,f=[])=>{if(E.files.length>0)return r(E.files),{consumed:!0,pastedNumber:null};const a=E.getData("text/plain");if(a.length===0)return{consumed:!1,pastedNumber:null};if(a.split(`
51
- `).length<m1&&a.length<g1)return{consumed:!1,pastedNumber:null};const m=yw([...s.flatMap(p=>p.kind==="text"?[p.number]:[]),...f]);return i(p=>[...p,{id:Lc(),kind:"text",number:m,text:a,lines:Ml(a)}]),{consumed:!0,pastedNumber:m}},[r,s]),g=j.useCallback(E=>{i(f=>f.filter(a=>a.id!==E))},[]),v=j.useCallback((E,f)=>{i(a=>a.map(m=>m.id===E&&m.kind==="text"?{...m,text:f,lines:Ml(f)}:m))},[]),h=j.useCallback(E=>{i(E),_(null)},[]),y=j.useCallback(()=>h([]),[h]),S=j.useCallback(()=>_(null),[]);return{items:s,problem:u,acceptPaste:c,acceptFiles:r,remove:g,updateText:v,replace:h,clear:y,dismissProblem:S}}function El({min:n,max:s,value:i,measure:u,onChange:_,onCommit:R,onStart:x}){const r=j.useRef(!1),c=j.useRef(i),g=j.useCallback(y=>{r.current=!0,c.current=i,x==null||x(y),y.currentTarget.setPointerCapture(y.pointerId),y.preventDefault()},[x,i]),v=j.useCallback(y=>{if(!r.current)return;const S=Math.min(s,Math.max(n,u(y)));c.current=S,_(S)},[s,n,u,_]),h=j.useCallback(y=>{r.current&&(r.current=!1,y.currentTarget.releasePointerCapture(y.pointerId),R(c.current))},[R]);return{onPointerDown:g,onPointerMove:v,onPointerUp:h,onPointerCancel:h}}function Tm(n){const[s,i]=j.useState(()=>typeof window<"u"&&window.matchMedia(n).matches);return j.useEffect(()=>{const u=window.matchMedia(n),_=()=>i(u.matches);return _(),u.addEventListener("change",_),()=>u.removeEventListener("change",_)},[n]),s}function v1(){return Tm(Bw)}function y1(){return Tm(Fw)}const Rm="agent_workbench_prefs",su="agent-workbench.",Mm=/^[a-z0-9][a-z0-9.-]{0,59}$/,Am=200,w1=400*24*60*60,b1=3500;function S1(n){const s=new Map;for(const i of n.split(";")){const u=i.indexOf("=");if(u===-1||i.slice(0,u).trim()!==Rm)continue;let _;try{_=JSON.parse(decodeURIComponent(i.slice(u+1).trim()))}catch{return s}if(_===null||typeof _!="object"||Array.isArray(_))return s;for(const[R,x]of Object.entries(_))!Mm.test(R)||typeof x!="string"||x.length>Am||s.set(`${su}${R}`,x);return s}return s}function C1(n){const s={};for(const[u,_]of n){if(!u.startsWith(su))continue;const R=u.slice(su.length);!Mm.test(R)||_.length>Am||(s[R]=_)}const i=encodeURIComponent(JSON.stringify(s));return i.length>b1?null:i}function x1(n){return`${Rm}=${n}; Path=/; Max-Age=${w1}; SameSite=Strict`}function Nm(){try{return S1(document.cookie)}catch{return new Map}}function Dm(n,s){const i=Nm();if(i.get(n)===s)return;i.set(n,s);const u=C1(i);if(u!==null)try{document.cookie=x1(u)}catch{}}function yt(n,s,i){const u=Nm().get(n);if(u!==void 0){const _=i(u);if(_!==null)return _}try{const _=window.localStorage.getItem(n);if(_===null)return s;const R=i(_);return R===null?s:(u===void 0&&Dm(n,_),R)}catch{return s}}function mt(n,s){Dm(n,s);try{window.localStorage.setItem(n,s)}catch{}}function k1(n,s,i){const u=Number.parseInt(n,10);return Number.isFinite(u)&&u>=s&&u<=i?u:null}const bf=90,E1=260,Sf=720,Cf="agent-workbench.composer-height";function xf(n){return{selectionStart:n.selectionStart,selectionEnd:n.selectionEnd,backward:n.selectionDirection==="backward",scrollTop:n.scrollTop}}function L1({connection:n,drafts:s,terminalId:i,alive:u,sleeping:_=!1,projectColor:R,activity:x,controls:r,leading:c,imagesAllowed:g=!0,blockedReason:v=null,prefills:h,onPrefillApplied:y,notice:S=null,onDismissNotice:E,onSubmitted:f,fontSize:a,insertRef:m}){const[p,d]=j.useState(""),[k,I]=j.useState(!1),L=_1(g),M=j.useRef(null),b=y1(),[T,N]=j.useState(()=>yt(Cf,E1,pe=>k1(pe,bf,Sf))),[O,B]=j.useState(!1),F=j.useCallback(()=>{const pe=M.current;if(pe===null)return;pe.style.height="auto";const Re=pe.offsetHeight-pe.clientHeight,Ce=pe.scrollHeight+Re,Te=O?T:Math.min(Ce,T);pe.style.height=`${Te}px`,pe.style.overflowY=Ce>Te?"auto":"hidden"},[T,O]);j.useEffect(F,[p,F,a]);const U=j.useRef(0),V=j.useRef(0),X=El({min:bf,max:Sf,value:T,measure:j.useCallback(pe=>U.current-pe.clientY-V.current,[]),onChange:N,onCommit:j.useCallback(pe=>{B(!1),mt(Cf,String(pe))},[]),onStart:j.useCallback(pe=>{const Re=M.current,Ce=Re==null?void 0:Re.getBoundingClientRect();U.current=(Ce==null?void 0:Ce.bottom)??pe.clientY,V.current=((Ce==null?void 0:Ce.bottom)??pe.clientY)-pe.clientY-((Ce==null?void 0:Ce.height)??0),B(!0)},[])}),Y=j.useRef(null),[q,D]=j.useState(0),$=j.useCallback(()=>D(pe=>pe+1),[]),H=j.useRef(p);H.current=p;const K=j.useRef(L.items);K.current=L.items;const{replace:te}=L;j.useEffect(()=>{const pe=Y.current;pe!==null&&s.put(pe,{text:p,items:L.items})},[p,L.items,s]),j.useEffect(()=>{var Ce;const pe=Y.current;if(pe===i)return;if(Y.current=i,pe!==null){s.put(pe,{text:H.current,items:K.current});const Te=M.current;Te!==null&&s.rememberView(pe,xf(Te))}const Re=i===null?void 0:s.get(i);d((Re==null?void 0:Re.text)??""),te((Re==null?void 0:Re.items)??[]),$(),i!==null&&((Ce=M.current)==null||Ce.focus())},[i,te,s,$]),j.useEffect(()=>()=>{const pe=Y.current;pe!==null&&s.put(pe,{text:H.current,items:K.current})},[s]),j.useLayoutEffect(()=>()=>{const pe=Y.current,Re=M.current;pe!==null&&Re!==null&&s.rememberView(pe,xf(Re))},[s]),j.useEffect(()=>{if(q===0)return;const pe=Y.current,Re=M.current;if(pe===null||Re===null)return;const Ce=Aw(Re.value.length,s.viewOf(pe));Re.setSelectionRange(Ce.start,Ce.end,Ce.direction),Re.scrollTop=Ce.scrollTop==="end"?Re.scrollHeight:Ce.scrollTop},[q,s]),j.useEffect(()=>s.onRestored(pe=>{if(pe!==Y.current)return;const Re=s.get(pe);Re!==void 0&&(d(Re.text),te(Re.items),$())}),[s,te,$]);const re=j.useRef(new Set);j.useEffect(()=>{if(!(h===void 0||h.length===0)){for(const pe of h)if(!re.current.has(pe.id)){if(re.current.add(pe.id),pe.terminalId===Y.current)d(Re=>ff(Re,pe.text));else{const Re=s.get(pe.terminalId);s.put(pe.terminalId,{text:ff((Re==null?void 0:Re.text)??"",pe.text),items:(Re==null?void 0:Re.items)??[]})}y==null||y(pe.id)}}},[h,y,s]);const ae=j.useCallback(()=>{if(i===null||v!==null)return;const pe=L.items.filter(Ie=>Ie.kind==="text").map(Ie=>({number:Ie.number,text:Ie.text})),Re=L.items.filter(Ie=>Ie.kind==="image").map(Ie=>({mediaType:Ie.mediaType,data:Ie.base64})),Ce=L.items.filter(Ie=>Ie.kind==="file").map(Ie=>({name:Ie.name,data:Ie.base64})),Te=Ew(pe,p);if(Te.length===0&&Re.length===0&&Ce.length===0)return;const Pe=o1(),xe=n.send({type:"agent.submit",terminalId:i,text:Te,images:Re,...Ce.length>0?{files:Ce}:{},requestId:Pe});s.submitted(i,xe),d(""),L.clear(),f==null||f(i,Pe,!xe)},[n,s,i,p,L,v,f]),ue=j.useCallback(()=>{i!==null&&n.send({type:"agent.interrupt",terminalId:i})},[n,i]),G=j.useCallback(pe=>{if(pe.key==="Enter"&&Xw(pe,b)){pe.preventDefault(),ae();return}pe.key==="Escape"&&(pe.preventDefault(),ue())},[ae,ue,b]),W=j.useCallback((pe,Re)=>{const{inserted:Ce}=Cw(pe.value,pe.selectionStart,pe.selectionEnd,Re);let Te=!1;try{Te=document.execCommand("insertText",!1,Ce)}catch{Te=!1}Te||(pe.setRangeText(Ce,pe.selectionStart,pe.selectionEnd,"end"),d(pe.value))},[]),J=j.useCallback((pe,Re)=>{const Ce=M.current;if(Ce===null||Ce.disabled){d(xe=>mf(xe,xe.length,xe.length,pe).text);return}const{inserted:Te}=mf(Ce.value,Ce.selectionStart,Ce.selectionEnd,pe);let Pe=!1;if(Re){Ce.focus();try{Pe=document.execCommand("insertText",!1,Te)}catch{Pe=!1}}Pe||(Ce.setRangeText(Te,Ce.selectionStart,Ce.selectionEnd,"end"),d(Ce.value))},[]);j.useEffect(()=>{if(m!==void 0)return m.current=J,()=>{m.current===J&&(m.current=null)}},[m,J]);const Z=j.useCallback(pe=>{if(pe.clipboardData===null)return;const Re=L.acceptPaste(pe.clipboardData,ww(pe.currentTarget.value));Re.consumed&&(pe.preventDefault(),Re.pastedNumber!==null&&W(pe.currentTarget,Re.pastedNumber))},[L,W]),de=j.useCallback(pe=>{L.remove(pe.id),pe.kind==="text"&&d(Re=>ym(Re,pe.number))},[L]),fe=j.useRef(null),se=i===null||!u,Ee=p.trim().length>0||L.items.some(pe=>pe.kind!=="text"||pe.text.trim().length>0),Me=u&&x!=="idle",Qe=Ee||!Me,Le=Nw({text:p,items:L.items});return l.jsxs("div",{className:`composer${k?" composer-dragging":""}`,style:R===void 0?void 0:{"--composer-accent":R},onDragOver:pe=>{Array.from(pe.dataTransfer.types).includes("Files")&&(pe.preventDefault(),I(!0))},onDragLeave:()=>I(!1),onDrop:pe=>{pe.preventDefault(),I(!1),L.acceptFiles(pe.dataTransfer.files)},children:[l.jsx("div",{className:"hdivider composer-divider",...X,title:C("composer.resizeTitle")}),S!==null&&l.jsxs("div",{className:"handoff-notice",role:"status",children:[l.jsxs("span",{className:"handoff-notice-text",children:[S.text,S.status!==null&&l.jsx("span",{className:"handoff-notice-status",children:S.status})]}),E!==void 0&&l.jsx("button",{className:"icon-button",onClick:E,title:C("common.dismissNotice"),children:"×"})]}),L.problem!==null&&l.jsxs("div",{className:"composer-problem",children:[l.jsx("span",{children:L.problem}),l.jsx("button",{className:"icon-button",onClick:L.dismissProblem,title:C("common.close"),children:"×"})]}),Le&&l.jsx("div",{className:"composer-problem",role:"status",children:l.jsx("span",{children:C("composer.problem.draftTooLong")})}),L.items.length>0&&l.jsx("div",{className:"composer-chips",children:L.items.map(pe=>l.jsx(T1,{item:pe,onRemove:()=>de(pe),onEdit:Re=>L.updateText(pe.id,Re),onDoneEditing:()=>{var Re;return(Re=M.current)==null?void 0:Re.focus()}},pe.id))}),l.jsxs("div",{className:`composer-field${Me&&Qe?" composer-field-two":""}`,children:[l.jsx("textarea",{ref:M,className:"composer-input",value:p,rows:1,placeholder:C(se?_?"composer.placeholder.sleeping":"composer.placeholder.ended":"composer.placeholder.ready"),disabled:se,onChange:pe=>d(pe.target.value),onKeyDown:G,onPaste:Z,spellCheck:!1}),l.jsxs("div",{className:"composer-field-actions",children:[Me&&l.jsx("button",{className:"composer-icon composer-stop",onClick:ue,disabled:se,title:C("composer.stopTitle"),"aria-label":C("composer.stop"),children:l.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true",children:l.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2",fill:"currentColor"})})}),Qe&&l.jsx("button",{className:"composer-icon composer-send",onClick:ae,disabled:se||!Ee||v!==null,title:v??C("composer.sendTitle"),"aria-label":C("composer.send"),children:l.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true",children:l.jsx("path",{d:"M12 19V5M5.5 11.5 12 5l6.5 6.5",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),l.jsxs("div",{className:"composer-bar",children:[l.jsx("input",{ref:fe,type:"file",multiple:!0,hidden:!0,onChange:pe=>{pe.target.files!==null&&L.acceptFiles(pe.target.files),pe.target.value=""}}),l.jsx("button",{className:"icon-button composer-attach",onClick:()=>{var pe;return(pe=fe.current)==null?void 0:pe.click()},disabled:se,title:C("composer.attachTitle"),"aria-label":C("composer.attach"),children:l.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true",children:l.jsx("path",{d:"M21.4 11.1 12.3 20.2a6 6 0 0 1-8.5-8.5l9.2-9.2a4 4 0 0 1 5.7 5.7l-9.2 9.2a2 2 0 0 1-2.8-2.8l8.5-8.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),c,l.jsx("span",{className:"composer-spacer"}),r]})]})}function T1({item:n,onRemove:s,onEdit:i,onDoneEditing:u}){const[_,R]=j.useState(!1);if(n.kind==="image"){const x=`${n.name} · ${hn(n.bytes)}`;return l.jsxs("figure",{className:"chip chip-image",title:x,children:[l.jsx("img",{src:n.dataUrl,alt:n.name,onClick:()=>R(!0)}),l.jsx("button",{className:"chip-remove",onClick:s,title:C("composer.chip.remove"),children:"×"}),_&&l.jsx(Cm,{src:n.dataUrl,caption:x,onClose:()=>R(!1)})]})}return n.kind==="file"?l.jsxs("div",{className:"chip chip-text chip-file",title:`${n.name} · ${hn(n.bytes)}`,children:[l.jsxs("span",{className:"chip-toggle chip-file-label",children:[l.jsx("span",{className:"chip-icon",children:"▤"}),l.jsx("span",{className:"chip-file-name",children:n.name}),l.jsx("span",{className:"chip-file-size",children:hn(n.bytes)})]}),l.jsx("button",{className:"chip-remove",onClick:s,title:C("composer.chip.remove"),children:"×"})]}):l.jsxs("div",{className:`chip chip-text${_?" chip-open":""}`,children:[l.jsxs("button",{className:"chip-toggle",onClick:()=>R(x=>!x),title:C("composer.chip.editHint"),"aria-expanded":_,children:[l.jsx("span",{className:"chip-icon",children:"¶"}),vw(n.number,n.lines),l.jsx("span",{className:"chip-chevron",children:_?"▾":"▸"})]}),l.jsx("button",{className:"chip-remove",onClick:s,title:C("composer.chip.remove"),children:"×"}),_&&l.jsx("textarea",{className:"chip-editor",value:n.text,onChange:x=>i(x.target.value),onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),R(!1),u())},"aria-label":C("composer.chip.editorLabel",{number:n.number}),spellCheck:!1,autoFocus:!0})]})}var Tc={exports:{}},kf;function R1(){return kf||(kf=1,(function(n,s){(function(i,u){n.exports=u()})(self,(()=>(()=>{var i={};return(()=>{var u=i;Object.defineProperty(u,"__esModule",{value:!0}),u.FitAddon=void 0,u.FitAddon=class{activate(_){this._terminal=_}dispose(){}fit(){const _=this.proposeDimensions();if(!_||!this._terminal||isNaN(_.cols)||isNaN(_.rows))return;const R=this._terminal._core;this._terminal.rows===_.rows&&this._terminal.cols===_.cols||(R._renderService.clear(),this._terminal.resize(_.cols,_.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const _=this._terminal._core,R=_._renderService.dimensions;if(R.css.cell.width===0||R.css.cell.height===0)return;const x=this._terminal.options.scrollback===0?0:_.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(r.getPropertyValue("height")),g=Math.max(0,parseInt(r.getPropertyValue("width"))),v=window.getComputedStyle(this._terminal.element),h=c-(parseInt(v.getPropertyValue("padding-top"))+parseInt(v.getPropertyValue("padding-bottom"))),y=g-(parseInt(v.getPropertyValue("padding-right"))+parseInt(v.getPropertyValue("padding-left")))-x;return{cols:Math.max(2,Math.floor(y/R.css.cell.width)),rows:Math.max(1,Math.floor(h/R.css.cell.height))}}}})(),i})()))})(Tc)),Tc.exports}var M1=R1(),Rc={exports:{}},Ef;function A1(){return Ef||(Ef=1,(function(n,s){(function(i,u){n.exports=u()})(self,(()=>(()=>{var i={6:(x,r)=>{function c(v){try{const h=new URL(v),y=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return v.toLocaleLowerCase().startsWith(y.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(r,"__esModule",{value:!0}),r.LinkComputer=r.WebLinkProvider=void 0,r.WebLinkProvider=class{constructor(v,h,y,S={}){this._terminal=v,this._regex=h,this._handler=y,this._options=S}provideLinks(v,h){const y=g.computeLink(v,this._regex,this._terminal,this._handler);h(this._addCallbacks(y))}_addCallbacks(v){return v.map((h=>(h.leave=this._options.leave,h.hover=(y,S)=>{if(this._options.hover){const{range:E}=h;this._options.hover(y,S,E)}},h)))}};class g{static computeLink(h,y,S,E){const f=new RegExp(y.source,(y.flags||"")+"g"),[a,m]=g._getWindowedLineStrings(h-1,S),p=a.join("");let d;const k=[];for(;d=f.exec(p);){const I=d[0];if(!c(I))continue;const[L,M]=g._mapStrIdx(S,m,0,d.index),[b,T]=g._mapStrIdx(S,L,M,I.length);if(L===-1||M===-1||b===-1||T===-1)continue;const N={start:{x:M+1,y:L+1},end:{x:T,y:b+1}};k.push({range:N,text:I,activate:E})}return k}static _getWindowedLineStrings(h,y){let S,E=h,f=h,a=0,m="";const p=[];if(S=y.buffer.active.getLine(h)){const d=S.translateToString(!0);if(S.isWrapped&&d[0]!==" "){for(a=0;(S=y.buffer.active.getLine(--E))&&a<2048&&(m=S.translateToString(!0),a+=m.length,p.push(m),S.isWrapped&&m.indexOf(" ")===-1););p.reverse()}for(p.push(d),a=0;(S=y.buffer.active.getLine(++f))&&S.isWrapped&&a<2048&&(m=S.translateToString(!0),a+=m.length,p.push(m),m.indexOf(" ")===-1););}return[p,E]}static _mapStrIdx(h,y,S,E){const f=h.buffer.active,a=f.getNullCell();let m=S;for(;E;){const p=f.getLine(y);if(!p)return[-1,-1];for(let d=m;d<p.length;++d){p.getCell(d,a);const k=a.getChars();if(a.getWidth()&&(E-=k.length||1,d===p.length-1&&k==="")){const I=f.getLine(y+1);I&&I.isWrapped&&(I.getCell(0,a),a.getWidth()===2&&(E+=1))}if(E<0)return[y,d]}y++,m=0}return[y,m]}}r.LinkComputer=g}},u={};function _(x){var r=u[x];if(r!==void 0)return r.exports;var c=u[x]={exports:{}};return i[x](c,c.exports,_),c.exports}var R={};return(()=>{var x=R;Object.defineProperty(x,"__esModule",{value:!0}),x.WebLinksAddon=void 0;const r=_(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function g(v,h){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}x.WebLinksAddon=class{constructor(v=g,h={}){this._handler=v,this._options=h}activate(v){this._terminal=v;const h=this._options,y=h.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new r.WebLinkProvider(this._terminal,y,this._handler,h))}dispose(){var v;(v=this._linkProvider)==null||v.dispose()}}})(),R})()))})(Rc)),Rc.exports}var N1=A1(),Mc={exports:{}},Lf;function D1(){return Lf||(Lf=1,(function(n,s){(function(i,u){n.exports=u()})(self,(()=>(()=>{var i={965:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GlyphRenderer=void 0;const g=c(374),v=c(509),h=c(855),y=c(859),S=c(381),E=11,f=E*Float32Array.BYTES_PER_ELEMENT;let a,m=0,p=0,d=0;class k extends y.Disposable{constructor(L,M,b,T){super(),this._terminal=L,this._gl=M,this._dimensions=b,this._optionsService=T,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const N=this._gl;v.TextureAtlas.maxAtlasPages===void 0&&(v.TextureAtlas.maxAtlasPages=Math.min(32,(0,g.throwIfFalsy)(N.getParameter(N.MAX_TEXTURE_IMAGE_UNITS))),v.TextureAtlas.maxTextureSize=(0,g.throwIfFalsy)(N.getParameter(N.MAX_TEXTURE_SIZE))),this._program=(0,g.throwIfFalsy)((0,S.createProgram)(N,`#version 300 es
52
- layout (location = 0) in vec2 a_unitquad;
53
- layout (location = 1) in vec2 a_cellpos;
54
- layout (location = 2) in vec2 a_offset;
55
- layout (location = 3) in vec2 a_size;
56
- layout (location = 4) in float a_texpage;
57
- layout (location = 5) in vec2 a_texcoord;
58
- layout (location = 6) in vec2 a_texsize;
59
-
60
- uniform mat4 u_projection;
61
- uniform vec2 u_resolution;
62
-
63
- out vec2 v_texcoord;
64
- flat out int v_texpage;
65
-
66
- void main() {
67
- vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
68
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
69
- v_texpage = int(a_texpage);
70
- v_texcoord = a_texcoord + a_unitquad * a_texsize;
71
- }`,(function(X){let Y="";for(let q=1;q<X;q++)Y+=` else if (v_texpage == ${q}) { outColor = texture(u_texture[${q}], v_texcoord); }`;return`#version 300 es
72
- precision lowp float;
73
-
74
- in vec2 v_texcoord;
75
- flat in int v_texpage;
76
-
77
- uniform sampler2D u_texture[${X}];
78
-
79
- out vec4 outColor;
80
-
81
- void main() {
82
- if (v_texpage == 0) {
83
- outColor = texture(u_texture[0], v_texcoord);
84
- } ${Y}
85
- }`})(v.TextureAtlas.maxAtlasPages))),this.register((0,y.toDisposable)((()=>N.deleteProgram(this._program)))),this._projectionLocation=(0,g.throwIfFalsy)(N.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,g.throwIfFalsy)(N.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,g.throwIfFalsy)(N.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=N.createVertexArray(),N.bindVertexArray(this._vertexArrayObject);const O=new Float32Array([0,0,1,0,0,1,1,1]),B=N.createBuffer();this.register((0,y.toDisposable)((()=>N.deleteBuffer(B)))),N.bindBuffer(N.ARRAY_BUFFER,B),N.bufferData(N.ARRAY_BUFFER,O,N.STATIC_DRAW),N.enableVertexAttribArray(0),N.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const F=new Uint8Array([0,1,2,3]),U=N.createBuffer();this.register((0,y.toDisposable)((()=>N.deleteBuffer(U)))),N.bindBuffer(N.ELEMENT_ARRAY_BUFFER,U),N.bufferData(N.ELEMENT_ARRAY_BUFFER,F,N.STATIC_DRAW),this._attributesBuffer=(0,g.throwIfFalsy)(N.createBuffer()),this.register((0,y.toDisposable)((()=>N.deleteBuffer(this._attributesBuffer)))),N.bindBuffer(N.ARRAY_BUFFER,this._attributesBuffer),N.enableVertexAttribArray(2),N.vertexAttribPointer(2,2,N.FLOAT,!1,f,0),N.vertexAttribDivisor(2,1),N.enableVertexAttribArray(3),N.vertexAttribPointer(3,2,N.FLOAT,!1,f,2*Float32Array.BYTES_PER_ELEMENT),N.vertexAttribDivisor(3,1),N.enableVertexAttribArray(4),N.vertexAttribPointer(4,1,N.FLOAT,!1,f,4*Float32Array.BYTES_PER_ELEMENT),N.vertexAttribDivisor(4,1),N.enableVertexAttribArray(5),N.vertexAttribPointer(5,2,N.FLOAT,!1,f,5*Float32Array.BYTES_PER_ELEMENT),N.vertexAttribDivisor(5,1),N.enableVertexAttribArray(6),N.vertexAttribPointer(6,2,N.FLOAT,!1,f,7*Float32Array.BYTES_PER_ELEMENT),N.vertexAttribDivisor(6,1),N.enableVertexAttribArray(1),N.vertexAttribPointer(1,2,N.FLOAT,!1,f,9*Float32Array.BYTES_PER_ELEMENT),N.vertexAttribDivisor(1,1),N.useProgram(this._program);const V=new Int32Array(v.TextureAtlas.maxAtlasPages);for(let X=0;X<v.TextureAtlas.maxAtlasPages;X++)V[X]=X;N.uniform1iv(this._textureLocation,V),N.uniformMatrix4fv(this._projectionLocation,!1,S.PROJECTION_MATRIX),this._atlasTextures=[];for(let X=0;X<v.TextureAtlas.maxAtlasPages;X++){const Y=new S.GLTexture((0,g.throwIfFalsy)(N.createTexture()));this.register((0,y.toDisposable)((()=>N.deleteTexture(Y.texture)))),N.activeTexture(N.TEXTURE0+X),N.bindTexture(N.TEXTURE_2D,Y.texture),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_S,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_T,N.CLAMP_TO_EDGE),N.texImage2D(N.TEXTURE_2D,0,N.RGBA,1,1,0,N.RGBA,N.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[X]=Y}N.enable(N.BLEND),N.blendFunc(N.SRC_ALPHA,N.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(L,M,b,T,N,O,B,F,U){this._updateCell(this._vertices.attributes,L,M,b,T,N,O,B,F,U)}_updateCell(L,M,b,T,N,O,B,F,U,V){m=(b*this._terminal.cols+M)*E,T!==h.NULL_CELL_CODE&&T!==void 0?this._atlas&&(a=F&&F.length>1?this._atlas.getRasterizedGlyphCombinedChar(F,N,O,B,!1):this._atlas.getRasterizedGlyph(T,N,O,B,!1),p=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),N!==V&&a.offset.x>p?(d=a.offset.x-p,L[m]=-(a.offset.x-d)+this._dimensions.device.char.left,L[m+1]=-a.offset.y+this._dimensions.device.char.top,L[m+2]=(a.size.x-d)/this._dimensions.device.canvas.width,L[m+3]=a.size.y/this._dimensions.device.canvas.height,L[m+4]=a.texturePage,L[m+5]=a.texturePositionClipSpace.x+d/this._atlas.pages[a.texturePage].canvas.width,L[m+6]=a.texturePositionClipSpace.y,L[m+7]=a.sizeClipSpace.x-d/this._atlas.pages[a.texturePage].canvas.width,L[m+8]=a.sizeClipSpace.y):(L[m]=-a.offset.x+this._dimensions.device.char.left,L[m+1]=-a.offset.y+this._dimensions.device.char.top,L[m+2]=a.size.x/this._dimensions.device.canvas.width,L[m+3]=a.size.y/this._dimensions.device.canvas.height,L[m+4]=a.texturePage,L[m+5]=a.texturePositionClipSpace.x,L[m+6]=a.texturePositionClipSpace.y,L[m+7]=a.sizeClipSpace.x,L[m+8]=a.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,g.allowRescaling)(T,U,a.size.x,this._dimensions.device.cell.width)&&(L[m+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):L.fill(0,m,m+E-1-2)}clear(){const L=this._terminal,M=L.cols*L.rows*E;this._vertices.count!==M?this._vertices.attributes=new Float32Array(M):this._vertices.attributes.fill(0);let b=0;for(;b<this._vertices.attributesBuffers.length;b++)this._vertices.count!==M?this._vertices.attributesBuffers[b]=new Float32Array(M):this._vertices.attributesBuffers[b].fill(0);this._vertices.count=M,b=0;for(let T=0;T<L.rows;T++)for(let N=0;N<L.cols;N++)this._vertices.attributes[b+9]=N/L.cols,this._vertices.attributes[b+10]=T/L.rows,b+=E}handleResize(){const L=this._gl;L.useProgram(this._program),L.viewport(0,0,L.canvas.width,L.canvas.height),L.uniform2f(this._resolutionLocation,L.canvas.width,L.canvas.height),this.clear()}render(L){if(!this._atlas)return;const M=this._gl;M.useProgram(this._program),M.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const b=this._vertices.attributesBuffers[this._activeBuffer];let T=0;for(let N=0;N<L.lineLengths.length;N++){const O=N*this._terminal.cols*E,B=this._vertices.attributes.subarray(O,O+L.lineLengths[N]*E);b.set(B,T),T+=B.length}M.bindBuffer(M.ARRAY_BUFFER,this._attributesBuffer),M.bufferData(M.ARRAY_BUFFER,b.subarray(0,T),M.STREAM_DRAW);for(let N=0;N<this._atlas.pages.length;N++)this._atlas.pages[N].version!==this._atlasTextures[N].version&&this._bindAtlasPageTexture(M,this._atlas,N);M.drawElementsInstanced(M.TRIANGLE_STRIP,4,M.UNSIGNED_BYTE,0,T/E)}setAtlas(L){this._atlas=L;for(const M of this._atlasTextures)M.version=-1}_bindAtlasPageTexture(L,M,b){L.activeTexture(L.TEXTURE0+b),L.bindTexture(L.TEXTURE_2D,this._atlasTextures[b].texture),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_S,L.CLAMP_TO_EDGE),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_T,L.CLAMP_TO_EDGE),L.texImage2D(L.TEXTURE_2D,0,L.RGBA,L.RGBA,L.UNSIGNED_BYTE,M.pages[b].canvas),L.generateMipmap(L.TEXTURE_2D),this._atlasTextures[b].version=M.pages[b].version}setDimensions(L){this._dimensions=L}}r.GlyphRenderer=k},742:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RectangleRenderer=void 0;const g=c(374),v=c(859),h=c(310),y=c(381),S=8*Float32Array.BYTES_PER_ELEMENT;class E{constructor(){this.attributes=new Float32Array(160),this.count=0}}let f=0,a=0,m=0,p=0,d=0,k=0,I=0;class L extends v.Disposable{constructor(b,T,N,O){super(),this._terminal=b,this._gl=T,this._dimensions=N,this._themeService=O,this._vertices=new E,this._verticesCursor=new E;const B=this._gl;this._program=(0,g.throwIfFalsy)((0,y.createProgram)(B,`#version 300 es
86
- layout (location = 0) in vec2 a_position;
87
- layout (location = 1) in vec2 a_size;
88
- layout (location = 2) in vec4 a_color;
89
- layout (location = 3) in vec2 a_unitquad;
90
-
91
- uniform mat4 u_projection;
92
-
93
- out vec4 v_color;
94
-
95
- void main() {
96
- vec2 zeroToOne = a_position + (a_unitquad * a_size);
97
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
98
- v_color = a_color;
99
- }`,`#version 300 es
100
- precision lowp float;
101
-
102
- in vec4 v_color;
103
-
104
- out vec4 outColor;
105
-
106
- void main() {
107
- outColor = v_color;
108
- }`)),this.register((0,v.toDisposable)((()=>B.deleteProgram(this._program)))),this._projectionLocation=(0,g.throwIfFalsy)(B.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=B.createVertexArray(),B.bindVertexArray(this._vertexArrayObject);const F=new Float32Array([0,0,1,0,0,1,1,1]),U=B.createBuffer();this.register((0,v.toDisposable)((()=>B.deleteBuffer(U)))),B.bindBuffer(B.ARRAY_BUFFER,U),B.bufferData(B.ARRAY_BUFFER,F,B.STATIC_DRAW),B.enableVertexAttribArray(3),B.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const V=new Uint8Array([0,1,2,3]),X=B.createBuffer();this.register((0,v.toDisposable)((()=>B.deleteBuffer(X)))),B.bindBuffer(B.ELEMENT_ARRAY_BUFFER,X),B.bufferData(B.ELEMENT_ARRAY_BUFFER,V,B.STATIC_DRAW),this._attributesBuffer=(0,g.throwIfFalsy)(B.createBuffer()),this.register((0,v.toDisposable)((()=>B.deleteBuffer(this._attributesBuffer)))),B.bindBuffer(B.ARRAY_BUFFER,this._attributesBuffer),B.enableVertexAttribArray(0),B.vertexAttribPointer(0,2,B.FLOAT,!1,S,0),B.vertexAttribDivisor(0,1),B.enableVertexAttribArray(1),B.vertexAttribPointer(1,2,B.FLOAT,!1,S,2*Float32Array.BYTES_PER_ELEMENT),B.vertexAttribDivisor(1,1),B.enableVertexAttribArray(2),B.vertexAttribPointer(2,4,B.FLOAT,!1,S,4*Float32Array.BYTES_PER_ELEMENT),B.vertexAttribDivisor(2,1),this._updateCachedColors(O.colors),this.register(this._themeService.onChangeColors((Y=>{this._updateCachedColors(Y),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(b){const T=this._gl;T.useProgram(this._program),T.bindVertexArray(this._vertexArrayObject),T.uniformMatrix4fv(this._projectionLocation,!1,y.PROJECTION_MATRIX),T.bindBuffer(T.ARRAY_BUFFER,this._attributesBuffer),T.bufferData(T.ARRAY_BUFFER,b.attributes,T.DYNAMIC_DRAW),T.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,T.UNSIGNED_BYTE,0,b.count)}handleResize(){this._updateViewportRectangle()}setDimensions(b){this._dimensions=b}_updateCachedColors(b){this._bgFloat=this._colorToFloat32Array(b.background),this._cursorFloat=this._colorToFloat32Array(b.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(b){const T=this._terminal,N=this._vertices;let O,B,F,U,V,X,Y,q,D,$,H,K=1;for(O=0;O<T.rows;O++){for(F=-1,U=0,V=0,X=!1,B=0;B<T.cols;B++)Y=(O*T.cols+B)*h.RENDER_MODEL_INDICIES_PER_CELL,q=b.cells[Y+h.RENDER_MODEL_BG_OFFSET],D=b.cells[Y+h.RENDER_MODEL_FG_OFFSET],$=!!(67108864&D),(q!==U||D!==V&&(X||$))&&((U!==0||X&&V!==0)&&(H=8*K++,this._updateRectangle(N,H,V,U,F,B,O)),F=B,U=q,V=D,X=$);(U!==0||X&&V!==0)&&(H=8*K++,this._updateRectangle(N,H,V,U,F,T.cols,O))}N.count=K}updateCursor(b){const T=this._verticesCursor,N=b.cursor;if(!N||N.style==="block")return void(T.count=0);let O,B=0;N.style!=="bar"&&N.style!=="outline"||(O=8*B++,this._addRectangleFloat(T.attributes,O,N.x*this._dimensions.device.cell.width,N.y*this._dimensions.device.cell.height,N.style==="bar"?N.dpr*N.cursorWidth:N.dpr,this._dimensions.device.cell.height,this._cursorFloat)),N.style!=="underline"&&N.style!=="outline"||(O=8*B++,this._addRectangleFloat(T.attributes,O,N.x*this._dimensions.device.cell.width,(N.y+1)*this._dimensions.device.cell.height-N.dpr,N.width*this._dimensions.device.cell.width,N.dpr,this._cursorFloat)),N.style==="outline"&&(O=8*B++,this._addRectangleFloat(T.attributes,O,N.x*this._dimensions.device.cell.width,N.y*this._dimensions.device.cell.height,N.width*this._dimensions.device.cell.width,N.dpr,this._cursorFloat),O=8*B++,this._addRectangleFloat(T.attributes,O,(N.x+N.width)*this._dimensions.device.cell.width-N.dpr,N.y*this._dimensions.device.cell.height,N.dpr,this._dimensions.device.cell.height,this._cursorFloat)),T.count=B}_updateRectangle(b,T,N,O,B,F,U){if(67108864&N)switch(50331648&N){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&N].rgba;break;case 50331648:f=(16777215&N)<<8;break;default:f=this._themeService.colors.foreground.rgba}else switch(50331648&O){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&O].rgba;break;case 50331648:f=(16777215&O)<<8;break;default:f=this._themeService.colors.background.rgba}b.attributes.length<T+4&&(b.attributes=(0,y.expandFloat32Array)(b.attributes,this._terminal.rows*this._terminal.cols*8)),a=B*this._dimensions.device.cell.width,m=U*this._dimensions.device.cell.height,p=(f>>24&255)/255,d=(f>>16&255)/255,k=(f>>8&255)/255,I=1,this._addRectangle(b.attributes,T,a,m,(F-B)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,p,d,k,I)}_addRectangle(b,T,N,O,B,F,U,V,X,Y){b[T]=N/this._dimensions.device.canvas.width,b[T+1]=O/this._dimensions.device.canvas.height,b[T+2]=B/this._dimensions.device.canvas.width,b[T+3]=F/this._dimensions.device.canvas.height,b[T+4]=U,b[T+5]=V,b[T+6]=X,b[T+7]=Y}_addRectangleFloat(b,T,N,O,B,F,U){b[T]=N/this._dimensions.device.canvas.width,b[T+1]=O/this._dimensions.device.canvas.height,b[T+2]=B/this._dimensions.device.canvas.width,b[T+3]=F/this._dimensions.device.canvas.height,b[T+4]=U[0],b[T+5]=U[1],b[T+6]=U[2],b[T+7]=U[3]}_colorToFloat32Array(b){return new Float32Array([(b.rgba>>24&255)/255,(b.rgba>>16&255)/255,(b.rgba>>8&255)/255,(255&b.rgba)/255])}}r.RectangleRenderer=L},310:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderModel=r.COMBINED_CHAR_BIT_MASK=r.RENDER_MODEL_EXT_OFFSET=r.RENDER_MODEL_FG_OFFSET=r.RENDER_MODEL_BG_OFFSET=r.RENDER_MODEL_INDICIES_PER_CELL=void 0;const g=c(296);r.RENDER_MODEL_INDICIES_PER_CELL=4,r.RENDER_MODEL_BG_OFFSET=1,r.RENDER_MODEL_FG_OFFSET=2,r.RENDER_MODEL_EXT_OFFSET=3,r.COMBINED_CHAR_BIT_MASK=2147483648,r.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,g.createSelectionRenderModel)()}resize(v,h){const y=v*h*r.RENDER_MODEL_INDICIES_PER_CELL;y!==this.cells.length&&(this.cells=new Uint32Array(y),this.lineLengths=new Uint32Array(h))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.JoinedCellData=r.WebglRenderer=void 0;const g=c(820),v=c(274),h=c(627),y=c(457),S=c(56),E=c(374),f=c(345),a=c(859),m=c(147),p=c(782),d=c(855),k=c(965),I=c(742),L=c(310),M=c(733);class b extends a.Disposable{constructor(B,F,U,V,X,Y,q,D,$){super(),this._terminal=B,this._characterJoinerService=F,this._charSizeService=U,this._coreBrowserService=V,this._coreService=X,this._decorationService=Y,this._optionsService=q,this._themeService=D,this._cursorBlinkStateManager=new a.MutableDisposable,this._charAtlasDisposable=this.register(new a.MutableDisposable),this._observerDisposable=this.register(new a.MutableDisposable),this._model=new L.RenderModel,this._workCell=new p.CellData,this._workCell2=new p.CellData,this._rectangleRenderer=this.register(new a.MutableDisposable),this._glyphRenderer=this.register(new a.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 v.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new M.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,q,this._themeService)],this.dimensions=(0,E.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(q.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const H={antialias:!1,depth:!1,preserveDrawingBuffer:$};if(this._gl=this._canvas.getContext("webgl2",H),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextlost",(K=>{console.log("webglcontextlost event received"),K.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(K)}),3e3)}))),this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextrestored",(K=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,h.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,S.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((K,te)=>this._setCanvasDevicePixelDimensions(K,te))),this.register(this._coreBrowserService.onWindowChange((K=>{this._observerDisposable.value=(0,S.observeDevicePixelDimensions)(this._canvas,K,((te,re)=>this._setCanvasDevicePixelDimensions(te,re)))}))),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,a.toDisposable)((()=>{var K;for(const te of this._renderLayers)te.dispose();(K=this._canvas.parentElement)==null||K.removeChild(this._canvas),(0,h.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var B;return(B=this._charAtlas)==null?void 0:B.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(B,F){var U,V,X,Y;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const q of this._renderLayers)q.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`,(U=this._rectangleRenderer.value)==null||U.setDimensions(this.dimensions),(V=this._rectangleRenderer.value)==null||V.handleResize(),(X=this._glyphRenderer.value)==null||X.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 B;for(const F of this._renderLayers)F.handleBlur(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.pause(),this._requestRedrawViewport()}handleFocus(){var B;for(const F of this._renderLayers)F.handleFocus(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.resume(),this._requestRedrawViewport()}handleSelectionChanged(B,F,U){for(const V of this._renderLayers)V.handleSelectionChanged(this._terminal,B,F,U);this._model.selection.update(this._core,B,F,U),this._requestRedrawViewport()}handleCursorMove(){var B;for(const F of this._renderLayers)F.handleCursorMove(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new I.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new k.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var F;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const B=(0,h.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!==B&&(this._onChangeTextureAtlas.fire(B.pages[0].canvas),this._charAtlasDisposable.value=(0,a.getDisposeArrayDisposable)([(0,f.forwardEvent)(B.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,f.forwardEvent)(B.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=B,this._charAtlas.warmUp(),(F=this._glyphRenderer.value)==null||F.setAtlas(this._charAtlas)}_clearModel(B){var F;this._model.clear(),B&&((F=this._glyphRenderer.value)==null||F.clear())}clearTextureAtlas(){var B;(B=this._charAtlas)==null||B.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var B;this._clearModel(!0);for(const F of this._renderLayers)F.reset(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(B){return-1}deregisterCharacterJoiner(B){return!1}renderRows(B,F){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const U of this._renderLayers)U.handleGridChanged(this._terminal,B,F);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(B,F),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new y.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(B,F){const U=this._core;let V,X,Y,q,D,$,H,K,te,re,ae,ue,G,W,J=this._workCell;B=N(B,U.rows-1,0),F=N(F,U.rows-1,0);const Z=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,de=Z-U.buffer.ydisp,fe=Math.min(this._terminal.buffer.active.cursorX,U.cols-1);let se=-1;const Ee=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Me=!1;for(X=B;X<=F;X++)for(Y=X+U.buffer.ydisp,q=U.buffer.lines.get(Y),this._model.lineLengths[X]=0,D=this._characterJoinerService.getJoinedCharacters(Y),G=0;G<U.cols;G++)if(V=this._cellColorResolver.result.bg,q.loadCell(G,J),G===0&&(V=this._cellColorResolver.result.bg),$=!1,H=G,D.length>0&&G===D[0][0]&&($=!0,K=D.shift(),J=new T(J,q.translateToString(!0,K[0],K[1]),K[1]-K[0]),H=K[1]-1),te=J.getChars(),re=J.getCode(),ue=(X*U.cols+G)*L.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(J,G,Y,this.dimensions.device.cell.width),Ee&&Y===Z&&(G===fe&&(this._model.cursor={x:fe,y:de,width:J.getWidth(),style:this._coreBrowserService.isFocused?U.options.cursorStyle||"block":U.options.cursorInactiveStyle,cursorWidth:U.options.cursorWidth,dpr:this._devicePixelRatio},se=fe+J.getWidth()-1),G>=fe&&G<=se&&(this._coreBrowserService.isFocused&&(U.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&U.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)),re!==d.NULL_CELL_CODE&&(this._model.lineLengths[X]=G+1),(this._model.cells[ue]!==re||this._model.cells[ue+L.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[ue+L.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[ue+L.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Me=!0,te.length>1&&(re|=L.COMBINED_CHAR_BIT_MASK),this._model.cells[ue]=re,this._model.cells[ue+L.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[ue+L.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[ue+L.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,ae=J.getWidth(),this._glyphRenderer.value.updateCell(G,X,re,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,te,ae,V),$))for(J=this._workCell,G++;G<H;G++)W=(X*U.cols+G)*L.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(G,X,d.NULL_CELL_CODE,0,0,0,d.NULL_CELL_CHAR,0,0),this._model.cells[W]=d.NULL_CELL_CODE,this._model.cells[W+L.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[W+L.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[W+L.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Me&&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(B,F){this._canvas.width===B&&this._canvas.height===F||(this._canvas.width=B,this._canvas.height=F,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const B=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:B,end:B})}}r.WebglRenderer=b;class T extends m.AttributeData{constructor(B,F,U){super(),this.content=0,this.combinedData="",this.fg=B.fg,this.bg=B.bg,this.combinedData=F,this._width=U}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(B){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function N(O,B,F=0){return Math.max(Math.min(O,B),F)}r.JoinedCellData=T},381:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GLTexture=r.expandFloat32Array=r.createShader=r.createProgram=r.PROJECTION_MATRIX=void 0;const g=c(374);function v(h,y,S){const E=(0,g.throwIfFalsy)(h.createShader(y));if(h.shaderSource(E,S),h.compileShader(E),h.getShaderParameter(E,h.COMPILE_STATUS))return E;console.error(h.getShaderInfoLog(E)),h.deleteShader(E)}r.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),r.createProgram=function(h,y,S){const E=(0,g.throwIfFalsy)(h.createProgram());if(h.attachShader(E,(0,g.throwIfFalsy)(v(h,h.VERTEX_SHADER,y))),h.attachShader(E,(0,g.throwIfFalsy)(v(h,h.FRAGMENT_SHADER,S))),h.linkProgram(E),h.getProgramParameter(E,h.LINK_STATUS))return E;console.error(h.getProgramInfoLog(E)),h.deleteProgram(E)},r.createShader=v,r.expandFloat32Array=function(h,y){const S=Math.min(2*h.length,y),E=new Float32Array(S);for(let f=0;f<h.length;f++)E[f]=h[f];return E},r.GLTexture=class{constructor(h){this.texture=h,this.version=-1}}},592:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BaseRenderLayer=void 0;const g=c(627),v=c(237),h=c(374),y=c(859);class S extends y.Disposable{constructor(f,a,m,p,d,k,I,L){super(),this._container=a,this._alpha=d,this._coreBrowserService=k,this._optionsService=I,this._themeService=L,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-${m}-layer`),this._canvas.style.zIndex=p.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((M=>{this._refreshCharAtlas(f,M),this.reset(f)}))),this.register((0,y.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,h.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(f){}handleFocus(f){}handleCursorMove(f){}handleGridChanged(f,a,m){}handleSelectionChanged(f,a,m,p=!1){}_setTransparency(f,a){if(a===this._alpha)return;const m=this._canvas;this._alpha=a,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,m),this._refreshCharAtlas(f,this._themeService.colors),this.handleGridChanged(f,0,f.rows-1)}_refreshCharAtlas(f,a){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,g.acquireTextureAtlas)(f,this._optionsService.rawOptions,a,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(f,a){this._deviceCellWidth=a.device.cell.width,this._deviceCellHeight=a.device.cell.height,this._deviceCharWidth=a.device.char.width,this._deviceCharHeight=a.device.char.height,this._deviceCharLeft=a.device.char.left,this._deviceCharTop=a.device.char.top,this._canvas.width=a.device.canvas.width,this._canvas.height=a.device.canvas.height,this._canvas.style.width=`${a.css.canvas.width}px`,this._canvas.style.height=`${a.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(f,this._themeService.colors)}_fillBottomLineAtCells(f,a,m=1){this._ctx.fillRect(f*this._deviceCellWidth,(a+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,m*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,a,m,p){this._alpha?this._ctx.clearRect(f*this._deviceCellWidth,a*this._deviceCellHeight,m*this._deviceCellWidth,p*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(f*this._deviceCellWidth,a*this._deviceCellHeight,m*this._deviceCellWidth,p*this._deviceCellHeight))}_fillCharTrueColor(f,a,m,p){this._ctx.font=this._getFont(f,!1,!1),this._ctx.textBaseline=v.TEXT_BASELINE,this._clipCell(m,p,a.getWidth()),this._ctx.fillText(a.getChars(),m*this._deviceCellWidth+this._deviceCharLeft,p*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(f,a,m){this._ctx.beginPath(),this._ctx.rect(f*this._deviceCellWidth,a*this._deviceCellHeight,m*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(f,a,m){return`${m?"italic":""} ${a?f.options.fontWeightBold:f.options.fontWeight} ${f.options.fontSize*this._coreBrowserService.dpr}px ${f.options.fontFamily}`}}r.BaseRenderLayer=S},733:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkRenderLayer=void 0;const g=c(197),v=c(237),h=c(592);class y extends h.BaseRenderLayer{constructor(E,f,a,m,p,d,k){super(a,E,"link",f,!0,p,d,k),this.register(m.onShowLinkUnderline((I=>this._handleShowLinkUnderline(I)))),this.register(m.onHideLinkUnderline((I=>this._handleHideLinkUnderline(I))))}resize(E,f){super.resize(E,f),this._state=void 0}reset(E){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const E=this._state.y2-this._state.y1-1;E>0&&this._clearCells(0,this._state.y1+1,this._state.cols,E),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(E){if(E.fg===v.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:E.fg!==void 0&&(0,g.is256Color)(E.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[E.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,E.y1===E.y2)this._fillBottomLineAtCells(E.x1,E.y1,E.x2-E.x1);else{this._fillBottomLineAtCells(E.x1,E.y1,E.cols-E.x1);for(let f=E.y1+1;f<E.y2;f++)this._fillBottomLineAtCells(0,f,E.cols);this._fillBottomLineAtCells(0,E.y2,E.x2)}this._state=E}_handleHideLinkUnderline(E){this._clearCurrentLink()}}r.LinkRenderLayer=y},820:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(c,g,v,h){c.addEventListener(g,v,h);let y=!1;return{dispose:()=>{y||(y=!0,c.removeEventListener(g,v,h))}}}},274:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellColorResolver=void 0;const g=c(855),v=c(160),h=c(374);let y,S=0,E=0,f=!1,a=!1,m=!1,p=0;r.CellColorResolver=class{constructor(d,k,I,L,M,b){this._terminal=d,this._optionService=k,this._selectionRenderModel=I,this._decorationService=L,this._coreBrowserService=M,this._themeService=b,this.result={fg:0,bg:0,ext:0}}resolve(d,k,I,L){if(this.result.bg=d.bg,this.result.fg=d.fg,this.result.ext=268435456&d.bg?d.extended.ext:0,E=0,S=0,a=!1,f=!1,m=!1,y=this._themeService.colors,p=0,d.getCode()!==g.NULL_CELL_CODE&&d.extended.underlineStyle===4){const M=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));p=k*L%(2*Math.round(M))}if(this._decorationService.forEachDecorationAtCell(k,I,"bottom",(M=>{M.backgroundColorRGB&&(E=M.backgroundColorRGB.rgba>>8&16777215,a=!0),M.foregroundColorRGB&&(S=M.foregroundColorRGB.rgba>>8&16777215,f=!0)})),m=this._selectionRenderModel.isCellSelected(this._terminal,k,I),m){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:E=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:E=(16777215&this.result.fg)<<8|255;break;default:E=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:E=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:E=(16777215&this.result.bg)<<8|255}E=v.rgba.blend(E,4294967040&(this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else E=(this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(a=!0,y.selectionForeground&&(S=y.selectionForeground.rgba>>8&16777215,f=!0),(0,h.treatGlyphAsBackgroundColor)(d.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)S=(this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:S=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:S=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:S=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:S=(16777215&this.result.fg)<<8|255;break;default:S=this._themeService.colors.foreground.rgba}S=v.rgba.blend(S,4294967040&(this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}f=!0}}this._decorationService.forEachDecorationAtCell(k,I,"top",(M=>{M.backgroundColorRGB&&(E=M.backgroundColorRGB.rgba>>8&16777215,a=!0),M.foregroundColorRGB&&(S=M.foregroundColorRGB.rgba>>8&16777215,f=!0)})),a&&(E=m?-16777216&d.bg&-134217729|E|50331648:-16777216&d.bg|E|50331648),f&&(S=-16777216&d.fg&-67108865|S|50331648),67108864&this.result.fg&&(a&&!f&&(S=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&y.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,f=!0),!a&&f&&(E=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&y.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,a=!0)),y=void 0,this.result.bg=a?E:this.result.bg,this.result.fg=f?S:this.result.fg,this.result.ext&=536870911,this.result.ext|=p<<29&3758096384}}},627:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.removeTerminalFromCache=r.acquireTextureAtlas=void 0;const g=c(509),v=c(197),h=[];r.acquireTextureAtlas=function(y,S,E,f,a,m,p,d){const k=(0,v.generateConfig)(f,a,m,p,S,E,d);for(let M=0;M<h.length;M++){const b=h[M],T=b.ownedBy.indexOf(y);if(T>=0){if((0,v.configEquals)(b.config,k))return b.atlas;b.ownedBy.length===1?(b.atlas.dispose(),h.splice(M,1)):b.ownedBy.splice(T,1);break}}for(let M=0;M<h.length;M++){const b=h[M];if((0,v.configEquals)(b.config,k))return b.ownedBy.push(y),b.atlas}const I=y._core,L={atlas:new g.TextureAtlas(document,k,I.unicodeService),config:k,ownedBy:[y]};return h.push(L),L.atlas},r.removeTerminalFromCache=function(y){for(let S=0;S<h.length;S++){const E=h[S].ownedBy.indexOf(y);if(E!==-1){h[S].ownedBy.length===1?(h[S].atlas.dispose(),h.splice(S,1)):h[S].ownedBy.splice(E,1);break}}}},197:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.is256Color=r.configEquals=r.generateConfig=void 0;const g=c(160);r.generateConfig=function(v,h,y,S,E,f,a){const m={foreground:f.foreground,background:f.background,cursor:g.NULL_COLOR,cursorAccent:g.NULL_COLOR,selectionForeground:g.NULL_COLOR,selectionBackgroundTransparent:g.NULL_COLOR,selectionBackgroundOpaque:g.NULL_COLOR,selectionInactiveBackgroundTransparent:g.NULL_COLOR,selectionInactiveBackgroundOpaque:g.NULL_COLOR,ansi:f.ansi.slice(),contrastCache:f.contrastCache,halfContrastCache:f.halfContrastCache};return{customGlyphs:E.customGlyphs,devicePixelRatio:a,letterSpacing:E.letterSpacing,lineHeight:E.lineHeight,deviceCellWidth:v,deviceCellHeight:h,deviceCharWidth:y,deviceCharHeight:S,fontFamily:E.fontFamily,fontSize:E.fontSize,fontWeight:E.fontWeight,fontWeightBold:E.fontWeightBold,allowTransparency:E.allowTransparency,drawBoldTextInBrightColors:E.drawBoldTextInBrightColors,minimumContrastRatio:E.minimumContrastRatio,colors:m}},r.configEquals=function(v,h){for(let y=0;y<v.colors.ansi.length;y++)if(v.colors.ansi[y].rgba!==h.colors.ansi[y].rgba)return!1;return v.devicePixelRatio===h.devicePixelRatio&&v.customGlyphs===h.customGlyphs&&v.lineHeight===h.lineHeight&&v.letterSpacing===h.letterSpacing&&v.fontFamily===h.fontFamily&&v.fontSize===h.fontSize&&v.fontWeight===h.fontWeight&&v.fontWeightBold===h.fontWeightBold&&v.allowTransparency===h.allowTransparency&&v.deviceCharWidth===h.deviceCharWidth&&v.deviceCharHeight===h.deviceCharHeight&&v.drawBoldTextInBrightColors===h.drawBoldTextInBrightColors&&v.minimumContrastRatio===h.minimumContrastRatio&&v.colors.foreground.rgba===h.colors.foreground.rgba&&v.colors.background.rgba===h.colors.background.rgba},r.is256Color=function(v){return(50331648&v)==16777216||(50331648&v)==33554432}},237:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const g=c(399);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=g.isFirefox||g.isLegacyEdge?"bottom":"ideographic"},457:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CursorBlinkStateManager=void 0,r.CursorBlinkStateManager=class{constructor(c,g){this._renderCallback=c,this._coreBrowserService=g,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 g=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,g>0)return void this._restartInterval(g)}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 g=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(g)}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:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tryDrawCustomChar=r.powerlineDefinitions=r.boxDrawingDefinitions=r.blockElementDefinitions=void 0;const g=c(374);r.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 v={"░":[[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]]};r.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,a)=>`M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a}`},"║":{1:(f,a)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╒":{1:(f,a)=>`M.5,1 L.5,${.5-a} L1,${.5-a} M.5,${.5+a} L1,${.5+a}`},"╓":{1:(f,a)=>`M${.5-f},1 L${.5-f},.5 L1,.5 M${.5+f},.5 L${.5+f},1`},"╔":{1:(f,a)=>`M1,${.5-a} L${.5-f},${.5-a} L${.5-f},1 M1,${.5+a} L${.5+f},${.5+a} L${.5+f},1`},"╕":{1:(f,a)=>`M0,${.5-a} L.5,${.5-a} L.5,1 M0,${.5+a} L.5,${.5+a}`},"╖":{1:(f,a)=>`M${.5+f},1 L${.5+f},.5 L0,.5 M${.5-f},.5 L${.5-f},1`},"╗":{1:(f,a)=>`M0,${.5+a} L${.5-f},${.5+a} L${.5-f},1 M0,${.5-a} L${.5+f},${.5-a} L${.5+f},1`},"╘":{1:(f,a)=>`M.5,0 L.5,${.5+a} L1,${.5+a} M.5,${.5-a} L1,${.5-a}`},"╙":{1:(f,a)=>`M1,.5 L${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╚":{1:(f,a)=>`M1,${.5-a} L${.5+f},${.5-a} L${.5+f},0 M1,${.5+a} L${.5-f},${.5+a} L${.5-f},0`},"╛":{1:(f,a)=>`M0,${.5+a} L.5,${.5+a} L.5,0 M0,${.5-a} L.5,${.5-a}`},"╜":{1:(f,a)=>`M0,.5 L${.5+f},.5 L${.5+f},0 M${.5-f},.5 L${.5-f},0`},"╝":{1:(f,a)=>`M0,${.5-a} L${.5-f},${.5-a} L${.5-f},0 M0,${.5+a} L${.5+f},${.5+a} L${.5+f},0`},"╞":{1:(f,a)=>`M.5,0 L.5,1 M.5,${.5-a} L1,${.5-a} M.5,${.5+a} L1,${.5+a}`},"╟":{1:(f,a)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1 M${.5+f},.5 L1,.5`},"╠":{1:(f,a)=>`M${.5-f},0 L${.5-f},1 M1,${.5+a} L${.5+f},${.5+a} L${.5+f},1 M1,${.5-a} L${.5+f},${.5-a} L${.5+f},0`},"╡":{1:(f,a)=>`M.5,0 L.5,1 M0,${.5-a} L.5,${.5-a} M0,${.5+a} L.5,${.5+a}`},"╢":{1:(f,a)=>`M0,.5 L${.5-f},.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╣":{1:(f,a)=>`M${.5+f},0 L${.5+f},1 M0,${.5+a} L${.5-f},${.5+a} L${.5-f},1 M0,${.5-a} L${.5-f},${.5-a} L${.5-f},0`},"╤":{1:(f,a)=>`M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a} M.5,${.5+a} L.5,1`},"╥":{1:(f,a)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},1 M${.5+f},.5 L${.5+f},1`},"╦":{1:(f,a)=>`M0,${.5-a} L1,${.5-a} M0,${.5+a} L${.5-f},${.5+a} L${.5-f},1 M1,${.5+a} L${.5+f},${.5+a} L${.5+f},1`},"╧":{1:(f,a)=>`M.5,0 L.5,${.5-a} M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a}`},"╨":{1:(f,a)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╩":{1:(f,a)=>`M0,${.5+a} L1,${.5+a} M0,${.5-a} L${.5-f},${.5-a} L${.5-f},0 M1,${.5-a} L${.5+f},${.5-a} L${.5+f},0`},"╪":{1:(f,a)=>`M.5,0 L.5,1 M0,${.5-a} L1,${.5-a} M0,${.5+a} L1,${.5+a}`},"╫":{1:(f,a)=>`M0,.5 L1,.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╬":{1:(f,a)=>`M0,${.5+a} L${.5-f},${.5+a} L${.5-f},1 M1,${.5+a} L${.5+f},${.5+a} L${.5+f},1 M0,${.5-a} L${.5-f},${.5-a} L${.5-f},0 M1,${.5-a} L${.5+f},${.5-a} 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,a)=>`M.5,1 L.5,${.5+a/.15*.5} C.5,${.5+a/.15*.5},.5,.5,1,.5`},"╮":{1:(f,a)=>`M.5,1 L.5,${.5+a/.15*.5} C.5,${.5+a/.15*.5},.5,.5,0,.5`},"╯":{1:(f,a)=>`M.5,0 L.5,${.5-a/.15*.5} C.5,${.5-a/.15*.5},.5,.5,0,.5`},"╰":{1:(f,a)=>`M.5,0 L.5,${.5-a/.15*.5} C.5,${.5-a/.15*.5},.5,.5,1,.5`}},r.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}},r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.tryDrawCustomChar=function(f,a,m,p,d,k,I,L){const M=r.blockElementDefinitions[a];if(M)return(function(O,B,F,U,V,X){for(let Y=0;Y<B.length;Y++){const q=B[Y],D=V/8,$=X/8;O.fillRect(F+q.x*D,U+q.y*$,q.w*D,q.h*$)}})(f,M,m,p,d,k),!0;const b=v[a];if(b)return(function(O,B,F,U,V,X){let Y=h.get(B);Y||(Y=new Map,h.set(B,Y));const q=O.fillStyle;if(typeof q!="string")throw new Error(`Unexpected fillStyle type "${q}"`);let D=Y.get(q);if(!D){const $=B[0].length,H=B.length,K=O.canvas.ownerDocument.createElement("canvas");K.width=$,K.height=H;const te=(0,g.throwIfFalsy)(K.getContext("2d")),re=new ImageData($,H);let ae,ue,G,W;if(q.startsWith("#"))ae=parseInt(q.slice(1,3),16),ue=parseInt(q.slice(3,5),16),G=parseInt(q.slice(5,7),16),W=q.length>7&&parseInt(q.slice(7,9),16)||1;else{if(!q.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${q}" when drawing pattern glyph`);[ae,ue,G,W]=q.substring(5,q.length-1).split(",").map((J=>parseFloat(J)))}for(let J=0;J<H;J++)for(let Z=0;Z<$;Z++)re.data[4*(J*$+Z)]=ae,re.data[4*(J*$+Z)+1]=ue,re.data[4*(J*$+Z)+2]=G,re.data[4*(J*$+Z)+3]=B[J][Z]*(255*W);te.putImageData(re,0,0),D=(0,g.throwIfFalsy)(O.createPattern(K,null)),Y.set(q,D)}O.fillStyle=D,O.fillRect(F,U,V,X)})(f,b,m,p,d,k),!0;const T=r.boxDrawingDefinitions[a];if(T)return(function(O,B,F,U,V,X,Y){O.strokeStyle=O.fillStyle;for(const[q,D]of Object.entries(B)){let $;O.beginPath(),O.lineWidth=Y*Number.parseInt(q),$=typeof D=="function"?D(.15,.15/X*V):D;for(const H of $.split(" ")){const K=H[0],te=S[K];if(!te){console.error(`Could not find drawing instructions for "${K}"`);continue}const re=H.substring(1).split(",");re[0]&&re[1]&&te(O,E(re,V,X,F,U,!0,Y))}O.stroke(),O.closePath()}})(f,T,m,p,d,k,L),!0;const N=r.powerlineDefinitions[a];return!!N&&((function(O,B,F,U,V,X,Y,q){const D=new Path2D;D.rect(F,U,V,X),O.clip(D),O.beginPath();const $=Y/12;O.lineWidth=q*$;for(const H of B.d.split(" ")){const K=H[0],te=S[K];if(!te){console.error(`Could not find drawing instructions for "${K}"`);continue}const re=H.substring(1).split(",");re[0]&&re[1]&&te(O,E(re,V,X,F,U,!1,q,(B.leftPadding??0)*($/2),(B.rightPadding??0)*($/2)))}B.type===1?(O.strokeStyle=O.fillStyle,O.stroke()):O.fill(),O.closePath()})(f,N,m,p,d,k,I,L),!0)};const h=new Map;function y(f,a,m=0){return Math.max(Math.min(f,a),m)}const S={C:(f,a)=>f.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]),L:(f,a)=>f.lineTo(a[0],a[1]),M:(f,a)=>f.moveTo(a[0],a[1])};function E(f,a,m,p,d,k,I,L=0,M=0){const b=f.map((T=>parseFloat(T)||parseInt(T)));if(b.length<2)throw new Error("Too few arguments for instruction");for(let T=0;T<b.length;T+=2)b[T]*=a-L*I-M*I,k&&b[T]!==0&&(b[T]=y(Math.round(b[T]+.5)-.5,a,0)),b[T]+=p+L*I;for(let T=1;T<b.length;T+=2)b[T]*=m,k&&b[T]!==0&&(b[T]=y(Math.round(b[T]+.5)-.5,m,0)),b[T]+=d;return b}},56:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.observeDevicePixelDimensions=void 0;const g=c(859);r.observeDevicePixelDimensions=function(v,h,y){let S=new h.ResizeObserver((E=>{const f=E.find((p=>p.target===v));if(!f)return;if(!("devicePixelContentBoxSize"in f))return S==null||S.disconnect(),void(S=void 0);const a=f.devicePixelContentBoxSize[0].inlineSize,m=f.devicePixelContentBoxSize[0].blockSize;a>0&&m>0&&y(a,m)}));try{S.observe(v,{box:["device-pixel-content-box"]})}catch{S.disconnect(),S=void 0}return(0,g.toDisposable)((()=>S==null?void 0:S.disconnect()))}},374:(x,r)=>{function c(v){return 57508<=v&&v<=57558}function g(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(r,"__esModule",{value:!0}),r.computeNextVariantOffset=r.createRenderDimensions=r.treatGlyphAsBackgroundColor=r.allowRescaling=r.isEmoji=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},r.isPowerlineGlyph=c,r.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},r.isEmoji=g,r.allowRescaling=function(v,h,y,S){return h===1&&y>Math.ceil(1.5*S)&&v!==void 0&&v>255&&!g(v)&&!c(v)&&!(function(E){return 57344<=E&&E<=63743})(v)},r.treatGlyphAsBackgroundColor=function(v){return c(v)||(function(h){return 9472<=h&&h<=9631})(v)},r.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}}}},r.computeNextVariantOffset=function(v,h,y=0){return(v-(2*Math.round(h)-y))%(2*Math.round(h))}},296:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.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(v,h,y,S=!1){if(this.selectionStart=h,this.selectionEnd=y,!h||!y||h[0]===y[0]&&h[1]===y[1])return void this.clear();const E=v.buffers.active.ydisp,f=h[1]-E,a=y[1]-E,m=Math.max(f,0),p=Math.min(a,v.rows-1);m>=v.rows||p<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=f,this.viewportEndRow=a,this.viewportCappedStartRow=m,this.viewportCappedEndRow=p,this.startCol=h[0],this.endCol=y[0])}isCellSelected(v,h,y){return!!this.hasSelection&&(y-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&y>=this.viewportCappedStartRow&&h<this.endCol&&y<=this.viewportCappedEndRow:h<this.startCol&&y>=this.viewportCappedStartRow&&h>=this.endCol&&y<=this.viewportCappedEndRow:y>this.viewportStartRow&&y<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&y===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportStartRow&&h>=this.startCol)}}r.createSelectionRenderModel=function(){return new c}},509:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TextureAtlas=void 0;const g=c(237),v=c(860),h=c(374),y=c(160),S=c(345),E=c(485),f=c(385),a=c(147),m=c(855),p={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 d;class k{get pages(){return this._pages}constructor(T,N,O){this._document=T,this._config=N,this._unicodeService=O,this._didWarmUp=!1,this._cacheMap=new E.FourKeyMap,this._cacheMapCombined=new E.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new a.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new S.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new S.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=M(T,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,h.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const T of this.pages)T.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const T=new f.IdleTaskQueue;for(let N=33;N<126;N++)T.enqueue((()=>{if(!this._cacheMap.get(N,m.DEFAULT_COLOR,m.DEFAULT_COLOR,m.DEFAULT_EXT)){const O=this._drawToCache(N,m.DEFAULT_COLOR,m.DEFAULT_COLOR,m.DEFAULT_EXT);this._cacheMap.set(N,m.DEFAULT_COLOR,m.DEFAULT_COLOR,m.DEFAULT_EXT,O)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const T of this._pages)T.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(k.maxAtlasPages&&this._pages.length>=Math.max(4,k.maxAtlasPages)){const N=this._pages.filter((Y=>2*Y.canvas.width<=(k.maxTextureSize||4096))).sort(((Y,q)=>q.canvas.width!==Y.canvas.width?q.canvas.width-Y.canvas.width:q.percentageUsed-Y.percentageUsed));let O=-1,B=0;for(let Y=0;Y<N.length;Y++)if(N[Y].canvas.width!==B)O=Y,B=N[Y].canvas.width;else if(Y-O==3)break;const F=N.slice(O,O+4),U=F.map((Y=>Y.glyphs[0].texturePage)).sort(((Y,q)=>Y>q?1:-1)),V=this.pages.length-F.length,X=this._mergePages(F,V);X.version++;for(let Y=U.length-1;Y>=0;Y--)this._deletePage(U[Y]);this.pages.push(X),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(X.canvas)}const T=new I(this._document,this._textureSize);return this._pages.push(T),this._activePages.push(T),this._onAddTextureAtlasCanvas.fire(T.canvas),T}_mergePages(T,N){const O=2*T[0].canvas.width,B=new I(this._document,O,T);for(const[F,U]of T.entries()){const V=F*U.canvas.width%O,X=Math.floor(F/2)*U.canvas.height;B.ctx.drawImage(U.canvas,V,X);for(const q of U.glyphs)q.texturePage=N,q.sizeClipSpace.x=q.size.x/O,q.sizeClipSpace.y=q.size.y/O,q.texturePosition.x+=V,q.texturePosition.y+=X,q.texturePositionClipSpace.x=q.texturePosition.x/O,q.texturePositionClipSpace.y=q.texturePosition.y/O;this._onRemoveTextureAtlasCanvas.fire(U.canvas);const Y=this._activePages.indexOf(U);Y!==-1&&this._activePages.splice(Y,1)}return B}_deletePage(T){this._pages.splice(T,1);for(let N=T;N<this._pages.length;N++){const O=this._pages[N];for(const B of O.glyphs)B.texturePage--;O.version++}}getRasterizedGlyphCombinedChar(T,N,O,B,F){return this._getFromCacheMap(this._cacheMapCombined,T,N,O,B,F)}getRasterizedGlyph(T,N,O,B,F){return this._getFromCacheMap(this._cacheMap,T,N,O,B,F)}_getFromCacheMap(T,N,O,B,F,U=!1){return d=T.get(N,O,B,F),d||(d=this._drawToCache(N,O,B,F,U),T.set(N,O,B,F,d)),d}_getColorFromAnsiIndex(T){if(T>=this._config.colors.ansi.length)throw new Error("No color found for idx "+T);return this._config.colors.ansi[T]}_getBackgroundColor(T,N,O,B){if(this._config.allowTransparency)return y.NULL_COLOR;let F;switch(T){case 16777216:case 33554432:F=this._getColorFromAnsiIndex(N);break;case 50331648:const U=a.AttributeData.toColorRGB(N);F=y.channels.toColor(U[0],U[1],U[2]);break;default:F=O?y.color.opaque(this._config.colors.foreground):this._config.colors.background}return F}_getForegroundColor(T,N,O,B,F,U,V,X,Y,q){const D=this._getMinimumContrastColor(T,N,O,B,F,U,V,Y,X,q);if(D)return D;let $;switch(F){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&Y&&U<8&&(U+=8),$=this._getColorFromAnsiIndex(U);break;case 50331648:const H=a.AttributeData.toColorRGB(U);$=y.channels.toColor(H[0],H[1],H[2]);break;default:$=V?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&($=y.color.opaque($)),X&&($=y.color.multiplyOpacity($,g.DIM_OPACITY)),$}_resolveBackgroundRgba(T,N,O){switch(T){case 16777216:case 33554432:return this._getColorFromAnsiIndex(N).rgba;case 50331648:return N<<8;default:return O?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(T,N,O,B){switch(T){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&B&&N<8&&(N+=8),this._getColorFromAnsiIndex(N).rgba;case 50331648:return N<<8;default:return O?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(T,N,O,B,F,U,V,X,Y,q){if(this._config.minimumContrastRatio===1||q)return;const D=this._getContrastCache(Y),$=D.getColor(T,B);if($!==void 0)return $||void 0;const H=this._resolveBackgroundRgba(N,O,V),K=this._resolveForegroundRgba(F,U,V,X),te=y.rgba.ensureContrastRatio(H,K,this._config.minimumContrastRatio/(Y?2:1));if(!te)return void D.setColor(T,B,null);const re=y.channels.toColor(te>>24&255,te>>16&255,te>>8&255);return D.setColor(T,B,re),re}_getContrastCache(T){return T?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(T,N,O,B,F=!1){const U=typeof T=="number"?String.fromCharCode(T):T,V=Math.min(this._config.deviceCellWidth*Math.max(U.length,2)+4,this._textureSize);this._tmpCanvas.width<V&&(this._tmpCanvas.width=V);const X=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<X&&(this._tmpCanvas.height=X),this._tmpCtx.save(),this._workAttributeData.fg=O,this._workAttributeData.bg=N,this._workAttributeData.extended.ext=B,this._workAttributeData.isInvisible())return p;const Y=!!this._workAttributeData.isBold(),q=!!this._workAttributeData.isInverse(),D=!!this._workAttributeData.isDim(),$=!!this._workAttributeData.isItalic(),H=!!this._workAttributeData.isUnderline(),K=!!this._workAttributeData.isStrikethrough(),te=!!this._workAttributeData.isOverline();let re=this._workAttributeData.getFgColor(),ae=this._workAttributeData.getFgColorMode(),ue=this._workAttributeData.getBgColor(),G=this._workAttributeData.getBgColorMode();if(q){const xe=re;re=ue,ue=xe;const Ie=ae;ae=G,G=Ie}const W=this._getBackgroundColor(G,ue,q,D);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=W.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const J=Y?this._config.fontWeightBold:this._config.fontWeight,Z=$?"italic":"";this._tmpCtx.font=`${Z} ${J} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=g.TEXT_BASELINE;const de=U.length===1&&(0,h.isPowerlineGlyph)(U.charCodeAt(0)),fe=U.length===1&&(0,h.isRestrictedPowerlineGlyph)(U.charCodeAt(0)),se=this._getForegroundColor(N,G,ue,O,ae,re,q,D,Y,(0,h.treatGlyphAsBackgroundColor)(U.charCodeAt(0)));this._tmpCtx.fillStyle=se.css;const Ee=fe?0:4;let Me=!1;this._config.customGlyphs!==!1&&(Me=(0,v.tryDrawCustomChar)(this._tmpCtx,U,Ee,Ee,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let Qe,Le=!de;if(Qe=typeof T=="number"?this._unicodeService.wcwidth(T):this._unicodeService.getStringCellWidth(T),H){this._tmpCtx.save();const xe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Ie=xe%2==1?.5:0;if(this._tmpCtx.lineWidth=xe,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())Le=!1,this._tmpCtx.strokeStyle=`rgb(${a.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{Le=!1;let He=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&He<8&&(He+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(He).css}this._tmpCtx.beginPath();const et=Ee,ot=Math.ceil(Ee+this._config.deviceCharHeight)-Ie-(F?2*xe:0),Ze=ot+xe,ht=ot+2*xe;let tt=this._workAttributeData.getUnderlineVariantOffset();for(let He=0;He<Qe;He++){this._tmpCtx.save();const nt=et+He*this._config.deviceCellWidth,Ve=et+(He+1)*this._config.deviceCellWidth,at=nt+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(nt,ot),this._tmpCtx.lineTo(Ve,ot),this._tmpCtx.moveTo(nt,ht),this._tmpCtx.lineTo(Ve,ht);break;case 3:const st=xe<=1?ht:Math.ceil(Ee+this._config.deviceCharHeight-xe/2)-Ie,ke=xe<=1?ot:Math.ceil(Ee+this._config.deviceCharHeight+xe/2)-Ie,Ke=new Path2D;Ke.rect(nt,ot,this._config.deviceCellWidth,ht-ot),this._tmpCtx.clip(Ke),this._tmpCtx.moveTo(nt-this._config.deviceCellWidth/2,Ze),this._tmpCtx.bezierCurveTo(nt-this._config.deviceCellWidth/2,ke,nt,ke,nt,Ze),this._tmpCtx.bezierCurveTo(nt,st,at,st,at,Ze),this._tmpCtx.bezierCurveTo(at,ke,Ve,ke,Ve,Ze),this._tmpCtx.bezierCurveTo(Ve,st,Ve+this._config.deviceCellWidth/2,st,Ve+this._config.deviceCellWidth/2,Ze);break;case 4:const he=tt===0?0:tt>=xe?2*xe-tt:xe-tt;tt>=xe||he===0?(this._tmpCtx.setLineDash([Math.round(xe),Math.round(xe)]),this._tmpCtx.moveTo(nt+he,ot),this._tmpCtx.lineTo(Ve,ot)):(this._tmpCtx.setLineDash([Math.round(xe),Math.round(xe)]),this._tmpCtx.moveTo(nt,ot),this._tmpCtx.lineTo(nt+he,ot),this._tmpCtx.moveTo(nt+he+xe,ot),this._tmpCtx.lineTo(Ve,ot)),tt=(0,h.computeNextVariantOffset)(Ve-nt,xe,tt);break;case 5:const me=.6,Ae=.3,pt=Ve-nt,Ne=Math.floor(me*pt),qe=Math.floor(Ae*pt),ct=pt-Ne-qe;this._tmpCtx.setLineDash([Ne,qe,ct]),this._tmpCtx.moveTo(nt,ot),this._tmpCtx.lineTo(Ve,ot);break;default:this._tmpCtx.moveTo(nt,ot),this._tmpCtx.lineTo(Ve,ot)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Me&&this._config.fontSize>=12&&!this._config.allowTransparency&&U!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const He=this._tmpCtx.measureText(U);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in He&&He.actualBoundingBoxDescent>0){this._tmpCtx.save();const nt=new Path2D;nt.rect(et,ot-Math.ceil(xe/2),this._config.deviceCellWidth*Qe,ht-ot+Math.ceil(xe/2)),this._tmpCtx.clip(nt),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=W.css,this._tmpCtx.strokeText(U,Ee,Ee+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(te){const xe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Ie=xe%2==1?.5:0;this._tmpCtx.lineWidth=xe,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Ee,Ee+Ie),this._tmpCtx.lineTo(Ee+this._config.deviceCharWidth*Qe,Ee+Ie),this._tmpCtx.stroke()}if(Me||this._tmpCtx.fillText(U,Ee,Ee+this._config.deviceCharHeight),U==="_"&&!this._config.allowTransparency){let xe=L(this._tmpCtx.getImageData(Ee,Ee,this._config.deviceCellWidth,this._config.deviceCellHeight),W,se,Le);if(xe)for(let Ie=1;Ie<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=W.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(U,Ee,Ee+this._config.deviceCharHeight-Ie),xe=L(this._tmpCtx.getImageData(Ee,Ee,this._config.deviceCellWidth,this._config.deviceCellHeight),W,se,Le),xe);Ie++);}if(K){const xe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Ie=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=xe,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Ee,Ee+Math.floor(this._config.deviceCharHeight/2)-Ie),this._tmpCtx.lineTo(Ee+this._config.deviceCharWidth*Qe,Ee+Math.floor(this._config.deviceCharHeight/2)-Ie),this._tmpCtx.stroke()}this._tmpCtx.restore();const pe=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Re;if(Re=this._config.allowTransparency?(function(xe){for(let Ie=0;Ie<xe.data.length;Ie+=4)if(xe.data[Ie+3]>0)return!1;return!0})(pe):L(pe,W,se,Le),Re)return p;const Ce=this._findGlyphBoundingBox(pe,this._workBoundingBox,V,fe,Me,Ee);let Te,Pe;for(;;){if(this._activePages.length===0){const xe=this._createNewPage();Te=xe,Pe=xe.currentRow,Pe.height=Ce.size.y;break}Te=this._activePages[this._activePages.length-1],Pe=Te.currentRow;for(const xe of this._activePages)Ce.size.y<=xe.currentRow.height&&(Te=xe,Pe=xe.currentRow);for(let xe=this._activePages.length-1;xe>=0;xe--)for(const Ie of this._activePages[xe].fixedRows)Ie.height<=Pe.height&&Ce.size.y<=Ie.height&&(Te=this._activePages[xe],Pe=Ie);if(Pe.y+Ce.size.y>=Te.canvas.height||Pe.height>Ce.size.y+2){let xe=!1;if(Te.currentRow.y+Te.currentRow.height+Ce.size.y>=Te.canvas.height){let Ie;for(const et of this._activePages)if(et.currentRow.y+et.currentRow.height+Ce.size.y<et.canvas.height){Ie=et;break}if(Ie)Te=Ie;else if(k.maxAtlasPages&&this._pages.length>=k.maxAtlasPages&&Pe.y+Ce.size.y<=Te.canvas.height&&Pe.height>=Ce.size.y&&Pe.x+Ce.size.x<=Te.canvas.width)xe=!0;else{const et=this._createNewPage();Te=et,Pe=et.currentRow,Pe.height=Ce.size.y,xe=!0}}xe||(Te.currentRow.height>0&&Te.fixedRows.push(Te.currentRow),Pe={x:0,y:Te.currentRow.y+Te.currentRow.height,height:Ce.size.y},Te.fixedRows.push(Pe),Te.currentRow={x:0,y:Pe.y+Pe.height,height:0})}if(Pe.x+Ce.size.x<=Te.canvas.width)break;Pe===Te.currentRow?(Pe.x=0,Pe.y+=Pe.height,Pe.height=0):Te.fixedRows.splice(Te.fixedRows.indexOf(Pe),1)}return Ce.texturePage=this._pages.indexOf(Te),Ce.texturePosition.x=Pe.x,Ce.texturePosition.y=Pe.y,Ce.texturePositionClipSpace.x=Pe.x/Te.canvas.width,Ce.texturePositionClipSpace.y=Pe.y/Te.canvas.height,Ce.sizeClipSpace.x/=Te.canvas.width,Ce.sizeClipSpace.y/=Te.canvas.height,Pe.height=Math.max(Pe.height,Ce.size.y),Pe.x+=Ce.size.x,Te.ctx.putImageData(pe,Ce.texturePosition.x-this._workBoundingBox.left,Ce.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Ce.size.x,Ce.size.y),Te.addGlyph(Ce),Te.version++,Ce}_findGlyphBoundingBox(T,N,O,B,F,U){N.top=0;const V=B?this._config.deviceCellHeight:this._tmpCanvas.height,X=B?this._config.deviceCellWidth:O;let Y=!1;for(let q=0;q<V;q++){for(let D=0;D<X;D++){const $=q*this._tmpCanvas.width*4+4*D+3;if(T.data[$]!==0){N.top=q,Y=!0;break}}if(Y)break}N.left=0,Y=!1;for(let q=0;q<U+X;q++){for(let D=0;D<V;D++){const $=D*this._tmpCanvas.width*4+4*q+3;if(T.data[$]!==0){N.left=q,Y=!0;break}}if(Y)break}N.right=X,Y=!1;for(let q=U+X-1;q>=U;q--){for(let D=0;D<V;D++){const $=D*this._tmpCanvas.width*4+4*q+3;if(T.data[$]!==0){N.right=q,Y=!0;break}}if(Y)break}N.bottom=V,Y=!1;for(let q=V-1;q>=0;q--){for(let D=0;D<X;D++){const $=q*this._tmpCanvas.width*4+4*D+3;if(T.data[$]!==0){N.bottom=q,Y=!0;break}}if(Y)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:N.right-N.left+1,y:N.bottom-N.top+1},sizeClipSpace:{x:N.right-N.left+1,y:N.bottom-N.top+1},offset:{x:-N.left+U+(B||F?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-N.top+U+(B||F?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}r.TextureAtlas=k;class I{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(T){this._glyphs.push(T),this._usedPixels+=T.size.x*T.size.y}constructor(T,N,O){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],O)for(const B of O)this._glyphs.push(...B.glyphs),this._usedPixels+=B._usedPixels;this.canvas=M(T,N,N),this.ctx=(0,h.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 L(b,T,N,O){const B=T.rgba>>>24,F=T.rgba>>>16&255,U=T.rgba>>>8&255,V=N.rgba>>>24,X=N.rgba>>>16&255,Y=N.rgba>>>8&255,q=Math.floor((Math.abs(B-V)+Math.abs(F-X)+Math.abs(U-Y))/12);let D=!0;for(let $=0;$<b.data.length;$+=4)b.data[$]===B&&b.data[$+1]===F&&b.data[$+2]===U||O&&Math.abs(b.data[$]-B)+Math.abs(b.data[$+1]-F)+Math.abs(b.data[$+2]-U)<q?b.data[$+3]=0:D=!1;return D}function M(b,T,N){const O=b.createElement("canvas");return O.width=T,O.height=N,O}},160:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;let c=0,g=0,v=0,h=0;var y,S,E,f,a;function m(d){const k=d.toString(16);return k.length<2?"0"+k:k}function p(d,k){return d<k?(k+.05)/(d+.05):(d+.05)/(k+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(d){d.toCss=function(k,I,L,M){return M!==void 0?`#${m(k)}${m(I)}${m(L)}${m(M)}`:`#${m(k)}${m(I)}${m(L)}`},d.toRgba=function(k,I,L,M=255){return(k<<24|I<<16|L<<8|M)>>>0},d.toColor=function(k,I,L,M){return{css:d.toCss(k,I,L,M),rgba:d.toRgba(k,I,L,M)}}})(y||(r.channels=y={})),(function(d){function k(I,L){return h=Math.round(255*L),[c,g,v]=a.toChannels(I.rgba),{css:y.toCss(c,g,v,h),rgba:y.toRgba(c,g,v,h)}}d.blend=function(I,L){if(h=(255&L.rgba)/255,h===1)return{css:L.css,rgba:L.rgba};const M=L.rgba>>24&255,b=L.rgba>>16&255,T=L.rgba>>8&255,N=I.rgba>>24&255,O=I.rgba>>16&255,B=I.rgba>>8&255;return c=N+Math.round((M-N)*h),g=O+Math.round((b-O)*h),v=B+Math.round((T-B)*h),{css:y.toCss(c,g,v),rgba:y.toRgba(c,g,v)}},d.isOpaque=function(I){return(255&I.rgba)==255},d.ensureContrastRatio=function(I,L,M){const b=a.ensureContrastRatio(I.rgba,L.rgba,M);if(b)return y.toColor(b>>24&255,b>>16&255,b>>8&255)},d.opaque=function(I){const L=(255|I.rgba)>>>0;return[c,g,v]=a.toChannels(L),{css:y.toCss(c,g,v),rgba:L}},d.opacity=k,d.multiplyOpacity=function(I,L){return h=255&I.rgba,k(I,h*L/255)},d.toColorRGB=function(I){return[I.rgba>>24&255,I.rgba>>16&255,I.rgba>>8&255]}})(S||(r.color=S={})),(function(d){let k,I;try{const L=document.createElement("canvas");L.width=1,L.height=1;const M=L.getContext("2d",{willReadFrequently:!0});M&&(k=M,k.globalCompositeOperation="copy",I=k.createLinearGradient(0,0,1,1))}catch{}d.toColor=function(L){if(L.match(/#[\da-f]{3,8}/i))switch(L.length){case 4:return c=parseInt(L.slice(1,2).repeat(2),16),g=parseInt(L.slice(2,3).repeat(2),16),v=parseInt(L.slice(3,4).repeat(2),16),y.toColor(c,g,v);case 5:return c=parseInt(L.slice(1,2).repeat(2),16),g=parseInt(L.slice(2,3).repeat(2),16),v=parseInt(L.slice(3,4).repeat(2),16),h=parseInt(L.slice(4,5).repeat(2),16),y.toColor(c,g,v,h);case 7:return{css:L,rgba:(parseInt(L.slice(1),16)<<8|255)>>>0};case 9:return{css:L,rgba:parseInt(L.slice(1),16)>>>0}}const M=L.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return c=parseInt(M[1]),g=parseInt(M[2]),v=parseInt(M[3]),h=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),y.toColor(c,g,v,h);if(!k||!I)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=I,k.fillStyle=L,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[c,g,v,h]=k.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(c,g,v,h),css:L}}})(E||(r.css=E={})),(function(d){function k(I,L,M){const b=I/255,T=L/255,N=M/255;return .2126*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.7152*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.0722*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))}d.relativeLuminance=function(I){return k(I>>16&255,I>>8&255,255&I)},d.relativeLuminance2=k})(f||(r.rgb=f={})),(function(d){function k(L,M,b){const T=L>>24&255,N=L>>16&255,O=L>>8&255;let B=M>>24&255,F=M>>16&255,U=M>>8&255,V=p(f.relativeLuminance2(B,F,U),f.relativeLuminance2(T,N,O));for(;V<b&&(B>0||F>0||U>0);)B-=Math.max(0,Math.ceil(.1*B)),F-=Math.max(0,Math.ceil(.1*F)),U-=Math.max(0,Math.ceil(.1*U)),V=p(f.relativeLuminance2(B,F,U),f.relativeLuminance2(T,N,O));return(B<<24|F<<16|U<<8|255)>>>0}function I(L,M,b){const T=L>>24&255,N=L>>16&255,O=L>>8&255;let B=M>>24&255,F=M>>16&255,U=M>>8&255,V=p(f.relativeLuminance2(B,F,U),f.relativeLuminance2(T,N,O));for(;V<b&&(B<255||F<255||U<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),F=Math.min(255,F+Math.ceil(.1*(255-F))),U=Math.min(255,U+Math.ceil(.1*(255-U))),V=p(f.relativeLuminance2(B,F,U),f.relativeLuminance2(T,N,O));return(B<<24|F<<16|U<<8|255)>>>0}d.blend=function(L,M){if(h=(255&M)/255,h===1)return M;const b=M>>24&255,T=M>>16&255,N=M>>8&255,O=L>>24&255,B=L>>16&255,F=L>>8&255;return c=O+Math.round((b-O)*h),g=B+Math.round((T-B)*h),v=F+Math.round((N-F)*h),y.toRgba(c,g,v)},d.ensureContrastRatio=function(L,M,b){const T=f.relativeLuminance(L>>8),N=f.relativeLuminance(M>>8);if(p(T,N)<b){if(N<T){const F=k(L,M,b),U=p(T,f.relativeLuminance(F>>8));if(U<b){const V=I(L,M,b);return U>p(T,f.relativeLuminance(V>>8))?F:V}return F}const O=I(L,M,b),B=p(T,f.relativeLuminance(O>>8));if(B<b){const F=k(L,M,b);return B>p(T,f.relativeLuminance(F>>8))?O:F}return O}},d.reduceLuminance=k,d.increaseLuminance=I,d.toChannels=function(L){return[L>>24&255,L>>16&255,L>>8&255,255&L]}})(a||(r.rgba=a={})),r.toPaddedHex=m,r.contrastRatio=p},345:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.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 g=0;g<this._listeners.length;g++)if(this._listeners[g]===c)return void this._listeners.splice(g,1)}}})),this._event}fire(c,g){const v=[];for(let h=0;h<this._listeners.length;h++)v.push(this._listeners[h]);for(let h=0;h<v.length;h++)v[h].call(void 0,c,g)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(c,g){return c((v=>g.fire(v)))},r.runAndSubscribe=function(c,g){return g(void 0),c((v=>g(v)))}},859:(x,r)=>{function c(g){for(const v of g)v.dispose();g.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const g of this._disposables)g.dispose();this._disposables.length=0}register(g){return this._disposables.push(g),g}unregister(g){const v=this._disposables.indexOf(g);v!==-1&&this._disposables.splice(v,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(g){var v;this._isDisposed||g===this._value||((v=this._value)==null||v.dispose(),this._value=g)}clear(){this.value=void 0}dispose(){var g;this._isDisposed=!0,(g=this._value)==null||g.dispose(),this._value=void 0}},r.toDisposable=function(g){return{dispose:g}},r.disposeArray=c,r.getDisposeArrayDisposable=function(g){return{dispose:()=>c(g)}}},485:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(v,h,y){this._data[v]||(this._data[v]={}),this._data[v][h]=y}get(v,h){return this._data[v]?this._data[v][h]:void 0}clear(){this._data={}}}r.TwoKeyMap=c,r.FourKeyMap=class{constructor(){this._data=new c}set(g,v,h,y,S){this._data.get(g,v)||this._data.set(g,v,new c),this._data.get(g,v).set(h,y,S)}get(g,v,h,y){var S;return(S=this._data.get(g,v))==null?void 0:S.get(h,y)}clear(){this._data.clear()}}},399:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof process<"u"&&"title"in process;const c=r.isNode?"node":navigator.userAgent,g=r.isNode?"node":navigator.platform;r.isFirefox=c.includes("Firefox"),r.isLegacyEdge=c.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(c),r.getSafariVersion=function(){if(!r.isSafari)return 0;const v=c.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(g),r.isIpad=g==="iPad",r.isIphone=g==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(g),r.isLinux=g.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(c)},385:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const g=c(399);class v{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(S){this._idleCallback=void 0;let E=0,f=0,a=S.timeRemaining(),m=0;for(;this._i<this._tasks.length;){if(E=Date.now(),this._tasks[this._i]()||this._i++,E=Math.max(1,Date.now()-E),f=Math.max(E,f),m=S.timeRemaining(),1.5*f>m)return a-E<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-E))}ms`),void this._start();a=m}this.clear()}}class h extends v{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const E=Date.now()+S;return{timeRemaining:()=>Math.max(0,E-Date.now())}}}r.PriorityTaskQueue=h,r.IdleTaskQueue=!g.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(y){return requestIdleCallback(y)}_cancelCallback(y){cancelIdleCallback(y)}}:h,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(y){this._queue.clear(),this._queue.enqueue(y)}flush(){this._queue.flush()}}},147:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new g}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new c;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}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}}r.AttributeData=c;class g{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,y=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=y}clone(){return new g(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=g},782:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const g=c(133),v=c(855),h=c(147);class y extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(E){const f=new y;return f.setFromCharData(E),f}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,g.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(E){this.fg=E[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(E[v.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(E[v.CHAR_DATA_CHAR_INDEX].length===2){const a=E[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=a&&a<=56319){const m=E[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=m&&m<=57343?this.content=1024*(a-55296)+m-56320+65536|E[v.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=E[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[v.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=E[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|E[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=y},855:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},133:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},r.utf32ToString=function(c,g=0,v=c.length){let h="";for(let y=g;y<v;++y){let S=c[y];S>65535?(S-=65536,h+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):h+=String.fromCharCode(S)}return h},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,g){const v=c.length;if(!v)return 0;let h=0,y=0;if(this._interim){const S=c.charCodeAt(y++);56320<=S&&S<=57343?g[h++]=1024*(this._interim-55296)+S-56320+65536:(g[h++]=this._interim,g[h++]=S),this._interim=0}for(let S=y;S<v;++S){const E=c.charCodeAt(S);if(55296<=E&&E<=56319){if(++S>=v)return this._interim=E,h;const f=c.charCodeAt(S);56320<=f&&f<=57343?g[h++]=1024*(E-55296)+f-56320+65536:(g[h++]=E,g[h++]=f)}else E!==65279&&(g[h++]=E)}return h}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,g){const v=c.length;if(!v)return 0;let h,y,S,E,f=0,a=0,m=0;if(this.interim[0]){let k=!1,I=this.interim[0];I&=(224&I)==192?31:(240&I)==224?15:7;let L,M=0;for(;(L=63&this.interim[++M])&&M<4;)I<<=6,I|=L;const b=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=b-M;for(;m<T;){if(m>=v)return 0;if(L=c[m++],(192&L)!=128){m--,k=!0;break}this.interim[M++]=L,I<<=6,I|=63&L}k||(b===2?I<128?m--:g[f++]=I:b===3?I<2048||I>=55296&&I<=57343||I===65279||(g[f++]=I):I<65536||I>1114111||(g[f++]=I)),this.interim.fill(0)}const p=v-4;let d=m;for(;d<v;){for(;!(!(d<p)||128&(h=c[d])||128&(y=c[d+1])||128&(S=c[d+2])||128&(E=c[d+3]));)g[f++]=h,g[f++]=y,g[f++]=S,g[f++]=E,d+=4;if(h=c[d++],h<128)g[f++]=h;else if((224&h)==192){if(d>=v)return this.interim[0]=h,f;if(y=c[d++],(192&y)!=128){d--;continue}if(a=(31&h)<<6|63&y,a<128){d--;continue}g[f++]=a}else if((240&h)==224){if(d>=v)return this.interim[0]=h,f;if(y=c[d++],(192&y)!=128){d--;continue}if(d>=v)return this.interim[0]=h,this.interim[1]=y,f;if(S=c[d++],(192&S)!=128){d--;continue}if(a=(15&h)<<12|(63&y)<<6|63&S,a<2048||a>=55296&&a<=57343||a===65279)continue;g[f++]=a}else if((248&h)==240){if(d>=v)return this.interim[0]=h,f;if(y=c[d++],(192&y)!=128){d--;continue}if(d>=v)return this.interim[0]=h,this.interim[1]=y,f;if(S=c[d++],(192&S)!=128){d--;continue}if(d>=v)return this.interim[0]=h,this.interim[1]=y,this.interim[2]=S,f;if(E=c[d++],(192&E)!=128){d--;continue}if(a=(7&h)<<18|(63&y)<<12|(63&S)<<6|63&E,a<65536||a>1114111)continue;g[f++]=a}}return f}}},776:function(x,r,c){var g=this&&this.__decorate||function(a,m,p,d){var k,I=arguments.length,L=I<3?m:d===null?d=Object.getOwnPropertyDescriptor(m,p):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(a,m,p,d);else for(var M=a.length-1;M>=0;M--)(k=a[M])&&(L=(I<3?k(L):I>3?k(m,p,L):k(m,p))||L);return I>3&&L&&Object.defineProperty(m,p,L),L},v=this&&this.__param||function(a,m){return function(p,d){m(p,d,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const h=c(859),y=c(97),S={trace:y.LogLevelEnum.TRACE,debug:y.LogLevelEnum.DEBUG,info:y.LogLevelEnum.INFO,warn:y.LogLevelEnum.WARN,error:y.LogLevelEnum.ERROR,off:y.LogLevelEnum.OFF};let E,f=r.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(a){super(),this._optionsService=a,this._logLevel=y.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(a){for(let m=0;m<a.length;m++)typeof a[m]=="function"&&(a[m]=a[m]())}_log(a,m,p){this._evalLazyOptionalParams(p),a.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+m,...p)}trace(a,...m){var p;this._logLevel<=y.LogLevelEnum.TRACE&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.trace.bind(this._optionsService.options.logger))??console.log,a,m)}debug(a,...m){var p;this._logLevel<=y.LogLevelEnum.DEBUG&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.debug.bind(this._optionsService.options.logger))??console.log,a,m)}info(a,...m){var p;this._logLevel<=y.LogLevelEnum.INFO&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.info.bind(this._optionsService.options.logger))??console.info,a,m)}warn(a,...m){var p;this._logLevel<=y.LogLevelEnum.WARN&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.warn.bind(this._optionsService.options.logger))??console.warn,a,m)}error(a,...m){var p;this._logLevel<=y.LogLevelEnum.ERROR&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.error.bind(this._optionsService.options.logger))??console.error,a,m)}};r.LogService=f=g([v(0,y.IOptionsService)],f),r.setTraceLogger=function(a){E=a},r.traceCall=function(a,m,p){if(typeof p.value!="function")throw new Error("not supported");const d=p.value;p.value=function(...k){if(E.logLevel!==y.LogLevelEnum.TRACE)return d.apply(this,k);E.trace(`GlyphRenderer#${d.name}(${k.map((L=>JSON.stringify(L))).join(", ")})`);const I=d.apply(this,k);return E.trace(`GlyphRenderer#${d.name} return`,I),I}}},726:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const c="di$target",g="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(v){return v[g]||[]},r.createDecorator=function(v){if(r.serviceRegistry.has(v))return r.serviceRegistry.get(v);const h=function(y,S,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,a,m){a[c]===a?a[g].push({id:f,index:m}):(a[g]=[{id:f,index:m}],a[c]=a)})(h,y,E)};return h.toString=()=>v,r.serviceRegistry.set(v,h),h}},97:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const g=c(726);var v;r.IBufferService=(0,g.createDecorator)("BufferService"),r.ICoreMouseService=(0,g.createDecorator)("CoreMouseService"),r.ICoreService=(0,g.createDecorator)("CoreService"),r.ICharsetService=(0,g.createDecorator)("CharsetService"),r.IInstantiationService=(0,g.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(v||(r.LogLevelEnum=v={})),r.ILogService=(0,g.createDecorator)("LogService"),r.IOptionsService=(0,g.createDecorator)("OptionsService"),r.IOscLinkService=(0,g.createDecorator)("OscLinkService"),r.IUnicodeService=(0,g.createDecorator)("UnicodeService"),r.IDecorationService=(0,g.createDecorator)("DecorationService")}},u={};function _(x){var r=u[x];if(r!==void 0)return r.exports;var c=u[x]={exports:{}};return i[x].call(c.exports,c,c.exports,_),c.exports}var R={};return(()=>{var x=R;Object.defineProperty(x,"__esModule",{value:!0}),x.WebglAddon=void 0;const r=_(345),c=_(859),g=_(399),v=_(666),h=_(776);class y extends c.Disposable{constructor(E){if(g.isSafari&&(0,g.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=E,this._onChangeTextureAtlas=this.register(new r.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new r.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new r.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new r.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(E){const f=E._core;if(!E.element)return void this.register(f.onWillOpen((()=>this.activate(E))));this._terminal=E;const a=f.coreService,m=f.optionsService,p=f,d=p._renderService,k=p._characterJoinerService,I=p._charSizeService,L=p._coreBrowserService,M=p._decorationService,b=p._logService,T=p._themeService;(0,h.setTraceLogger)(b),this._renderer=this.register(new v.WebglRenderer(E,k,I,L,a,M,m,T,this._preserveDrawingBuffer)),this.register((0,r.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,r.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,r.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,r.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),d.setRenderer(this._renderer),this.register((0,c.toDisposable)((()=>{const N=this._terminal._core._renderService;N.setRenderer(this._terminal._core._createRenderer()),N.handleResize(E.cols,E.rows)})))}get textureAtlas(){var E;return(E=this._renderer)==null?void 0:E.textureAtlas}clearTextureAtlas(){var E;(E=this._renderer)==null||E.clearTextureAtlas()}}x.WebglAddon=y})(),R})()))})(Mc)),Mc.exports}var I1=D1(),Ac={exports:{}},Tf;function j1(){return Tf||(Tf=1,(function(n,s){(function(i,u){n.exports=u()})(globalThis,(()=>(()=>{var i={4567:function(x,r,c){var g=this&&this.__decorate||function(p,d,k,I){var L,M=arguments.length,b=M<3?d:I===null?I=Object.getOwnPropertyDescriptor(d,k):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(p,d,k,I);else for(var T=p.length-1;T>=0;T--)(L=p[T])&&(b=(M<3?L(b):M>3?L(d,k,b):L(d,k))||b);return M>3&&b&&Object.defineProperty(d,k,b),b},v=this&&this.__param||function(p,d){return function(k,I){d(k,I,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const h=c(9042),y=c(9924),S=c(844),E=c(4725),f=c(2585),a=c(3656);let m=r.AccessibilityManager=class extends S.Disposable{constructor(p,d,k,I){super(),this._terminal=p,this._coreBrowserService=k,this._renderService=I,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 L=0;L<this._terminal.rows;L++)this._rowElements[L]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[L]);if(this._topBoundaryFocusListener=L=>this._handleBoundaryFocus(L,0),this._bottomBoundaryFocusListener=L=>this._handleBoundaryFocus(L,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 y.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((L=>this._handleResize(L.rows)))),this.register(this._terminal.onRender((L=>this._refreshRows(L.start,L.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((L=>this._handleChar(L)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
109
- `)))),this.register(this._terminal.onA11yTab((L=>this._handleTab(L)))),this.register(this._terminal.onKey((L=>this._handleKey(L.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,a.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,S.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(p){for(let d=0;d<p;d++)this._handleChar(" ")}_handleChar(p){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==p&&(this._charsToAnnounce+=p):this._charsToAnnounce+=p,p===`
110
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(p){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(p)||this._charsToConsume.push(p)}_refreshRows(p,d){this._liveRegionDebouncer.refresh(p,d,this._terminal.rows)}_renderRows(p,d){const k=this._terminal.buffer,I=k.lines.length.toString();for(let L=p;L<=d;L++){const M=k.lines.get(k.ydisp+L),b=[],T=(M==null?void 0:M.translateToString(!0,void 0,void 0,b))||"",N=(k.ydisp+L+1).toString(),O=this._rowElements[L];O&&(T.length===0?(O.innerText=" ",this._rowColumns.set(O,[0,1])):(O.textContent=T,this._rowColumns.set(O,b)),O.setAttribute("aria-posinset",N),O.setAttribute("aria-setsize",I))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(p,d){const k=p.target,I=this._rowElements[d===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(d===0?"1":`${this._terminal.buffer.lines.length}`)||p.relatedTarget!==I)return;let L,M;if(d===0?(L=k,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(L=this._rowElements.shift(),M=k,this._rowContainer.removeChild(L)),L.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),d===0){const b=this._createAccessibilityTreeNode();this._rowElements.unshift(b),this._rowContainer.insertAdjacentElement("afterbegin",b)}else{const b=this._createAccessibilityTreeNode();this._rowElements.push(b),this._rowContainer.appendChild(b)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(d===0?-1:1),this._rowElements[d===0?1:this._rowElements.length-2].focus(),p.preventDefault(),p.stopImmediatePropagation()}_handleSelectionChange(){var T;if(this._rowElements.length===0)return;const p=document.getSelection();if(!p)return;if(p.isCollapsed)return void(this._rowContainer.contains(p.anchorNode)&&this._terminal.clearSelection());if(!p.anchorNode||!p.focusNode)return void console.error("anchorNode and/or focusNode are null");let d={node:p.anchorNode,offset:p.anchorOffset},k={node:p.focusNode,offset:p.focusOffset};if((d.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||d.node===k.node&&d.offset>k.offset)&&([d,k]=[k,d]),d.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(d={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(d.node))return;const I=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(I)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:I,offset:((T=I.textContent)==null?void 0:T.length)??0}),!this._rowContainer.contains(k.node))return;const L=({node:N,offset:O})=>{const B=N instanceof Text?N.parentNode:N;let F=parseInt(B==null?void 0:B.getAttribute("aria-posinset"),10)-1;if(isNaN(F))return console.warn("row is invalid. Race condition?"),null;const U=this._rowColumns.get(B);if(!U)return console.warn("columns is null. Race condition?"),null;let V=O<U.length?U[O]:U.slice(-1)[0]+1;return V>=this._terminal.cols&&(++F,V=0),{row:F,column:V}},M=L(d),b=L(k);if(M&&b){if(M.row>b.row||M.row===b.row&&M.column>=b.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(b.row-M.row)*this._terminal.cols-M.column+b.column)}}_handleResize(p){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let d=this._rowContainer.children.length;d<this._terminal.rows;d++)this._rowElements[d]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[d]);for(;this._rowElements.length>p;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const p=this._coreBrowserService.mainDocument.createElement("div");return p.setAttribute("role","listitem"),p.tabIndex=-1,this._refreshRowDimensions(p),p}_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 p=0;p<this._terminal.rows;p++)this._refreshRowDimensions(this._rowElements[p])}}_refreshRowDimensions(p){p.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=m=g([v(1,f.IInstantiationService),v(2,E.ICoreBrowserService),v(3,E.IRenderService)],m)},3614:(x,r)=>{function c(y){return y.replace(/\r?\n/g,"\r")}function g(y,S){return S?"\x1B[200~"+y+"\x1B[201~":y}function v(y,S,E,f){y=g(y=c(y),E.decPrivateModes.bracketedPasteMode&&f.rawOptions.ignoreBracketedPasteMode!==!0),E.triggerDataEvent(y,!0),S.value=""}function h(y,S,E){const f=E.getBoundingClientRect(),a=y.clientX-f.left-10,m=y.clientY-f.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${a}px`,S.style.top=`${m}px`,S.style.zIndex="1000",S.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=c,r.bracketTextForPaste=g,r.copyHandler=function(y,S){y.clipboardData&&y.clipboardData.setData("text/plain",S.selectionText),y.preventDefault()},r.handlePasteEvent=function(y,S,E,f){y.stopPropagation(),y.clipboardData&&v(y.clipboardData.getData("text/plain"),S,E,f)},r.paste=v,r.moveTextAreaUnderMouseCursor=h,r.rightClickHandler=function(y,S,E,f,a){h(y,S,E),a&&f.rightClickSelect(y),S.value=f.selectionText,S.select()}},7239:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const g=c(1505);r.ColorContrastCache=class{constructor(){this._color=new g.TwoKeyMap,this._css=new g.TwoKeyMap}setCss(v,h,y){this._css.set(v,h,y)}getCss(v,h){return this._css.get(v,h)}setColor(v,h,y){this._color.set(v,h,y)}getColor(v,h){return this._color.get(v,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(c,g,v,h){c.addEventListener(g,v,h);let y=!1;return{dispose:()=>{y||(y=!0,c.removeEventListener(g,v,h))}}}},3551:function(x,r,c){var g=this&&this.__decorate||function(m,p,d,k){var I,L=arguments.length,M=L<3?p:k===null?k=Object.getOwnPropertyDescriptor(p,d):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(m,p,d,k);else for(var b=m.length-1;b>=0;b--)(I=m[b])&&(M=(L<3?I(M):L>3?I(p,d,M):I(p,d))||M);return L>3&&M&&Object.defineProperty(p,d,M),M},v=this&&this.__param||function(m,p){return function(d,k){p(d,k,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;const h=c(3656),y=c(8460),S=c(844),E=c(2585),f=c(4725);let a=r.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(m,p,d,k,I){super(),this._element=m,this._mouseService=p,this._renderService=d,this._bufferService=k,this._linkProviderService=I,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new y.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new y.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)((()=>{var L;this._lastMouseEvent=void 0,(L=this._activeProviderReplies)==null||L.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(m){this._lastMouseEvent=m;const p=this._positionFromMouseEvent(m,this._element,this._mouseService);if(!p)return;this._isMouseOut=!1;const d=m.composedPath();for(let k=0;k<d.length;k++){const I=d[k];if(I.classList.contains("xterm"))break;if(I.classList.contains("xterm-hover"))return}this._lastBufferCell&&p.x===this._lastBufferCell.x&&p.y===this._lastBufferCell.y||(this._handleHover(p),this._lastBufferCell=p)}_handleHover(m){if(this._activeLine!==m.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(m,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,m)||(this._clearCurrentLink(),this._askForLink(m,!0))}_askForLink(m,p){var k,I;this._activeProviderReplies&&p||((k=this._activeProviderReplies)==null||k.forEach((L=>{L==null||L.forEach((M=>{M.link.dispose&&M.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=m.y);let d=!1;for(const[L,M]of this._linkProviderService.linkProviders.entries())p?(I=this._activeProviderReplies)!=null&&I.get(L)&&(d=this._checkLinkProviderResult(L,m,d)):M.provideLinks(m.y,(b=>{var N,O;if(this._isMouseOut)return;const T=b==null?void 0:b.map((B=>({link:B})));(N=this._activeProviderReplies)==null||N.set(L,T),d=this._checkLinkProviderResult(L,m,d),((O=this._activeProviderReplies)==null?void 0:O.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(m.y,this._activeProviderReplies)}))}_removeIntersectingLinks(m,p){const d=new Set;for(let k=0;k<p.size;k++){const I=p.get(k);if(I)for(let L=0;L<I.length;L++){const M=I[L],b=M.link.range.start.y<m?0:M.link.range.start.x,T=M.link.range.end.y>m?this._bufferService.cols:M.link.range.end.x;for(let N=b;N<=T;N++){if(d.has(N)){I.splice(L--,1);break}d.add(N)}}}}_checkLinkProviderResult(m,p,d){var L;if(!this._activeProviderReplies)return d;const k=this._activeProviderReplies.get(m);let I=!1;for(let M=0;M<m;M++)this._activeProviderReplies.has(M)&&!this._activeProviderReplies.get(M)||(I=!0);if(!I&&k){const M=k.find((b=>this._linkAtPosition(b.link,p)));M&&(d=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!d)for(let M=0;M<this._activeProviderReplies.size;M++){const b=(L=this._activeProviderReplies.get(M))==null?void 0:L.find((T=>this._linkAtPosition(T.link,p)));if(b){d=!0,this._handleNewLink(b);break}}return d}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(m){if(!this._currentLink)return;const p=this._positionFromMouseEvent(m,this._element,this._mouseService);p&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,p)&&this._currentLink.link.activate(m,this._currentLink.link.text)}_clearCurrentLink(m,p){this._currentLink&&this._lastMouseEvent&&(!m||!p||this._currentLink.link.range.start.y>=m&&this._currentLink.link.range.end.y<=p)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(m){if(!this._lastMouseEvent)return;const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._linkAtPosition(m.link,p)&&(this._currentLink=m,this._currentLink.state={decorations:{underline:m.link.decorations===void 0||m.link.decorations.underline,pointerCursor:m.link.decorations===void 0||m.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,m.link,this._lastMouseEvent),m.link.decorations={},Object.defineProperties(m.link.decorations,{pointerCursor:{get:()=>{var d,k;return(k=(d=this._currentLink)==null?void 0:d.state)==null?void 0:k.decorations.pointerCursor},set:d=>{var k;(k=this._currentLink)!=null&&k.state&&this._currentLink.state.decorations.pointerCursor!==d&&(this._currentLink.state.decorations.pointerCursor=d,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",d))}},underline:{get:()=>{var d,k;return(k=(d=this._currentLink)==null?void 0:d.state)==null?void 0:k.decorations.underline},set:d=>{var k,I,L;(k=this._currentLink)!=null&&k.state&&((L=(I=this._currentLink)==null?void 0:I.state)==null?void 0:L.decorations.underline)!==d&&(this._currentLink.state.decorations.underline=d,this._currentLink.state.isHovered&&this._fireUnderlineEvent(m.link,d))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((d=>{if(!this._currentLink)return;const k=d.start===0?0:d.start+1+this._bufferService.buffer.ydisp,I=this._bufferService.buffer.ydisp+1+d.end;if(this._currentLink.link.range.start.y>=k&&this._currentLink.link.range.end.y<=I&&(this._clearCurrentLink(k,I),this._lastMouseEvent)){const L=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);L&&this._askForLink(L,!1)}}))))}_linkHover(m,p,d){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!0),this._currentLink.state.decorations.pointerCursor&&m.classList.add("xterm-cursor-pointer")),p.hover&&p.hover(d,p.text)}_fireUnderlineEvent(m,p){const d=m.range,k=this._bufferService.buffer.ydisp,I=this._createLinkUnderlineEvent(d.start.x-1,d.start.y-k-1,d.end.x,d.end.y-k-1,void 0);(p?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(I)}_linkLeave(m,p,d){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!1),this._currentLink.state.decorations.pointerCursor&&m.classList.remove("xterm-cursor-pointer")),p.leave&&p.leave(d,p.text)}_linkAtPosition(m,p){const d=m.range.start.y*this._bufferService.cols+m.range.start.x,k=m.range.end.y*this._bufferService.cols+m.range.end.x,I=p.y*this._bufferService.cols+p.x;return d<=I&&I<=k}_positionFromMouseEvent(m,p,d){const k=d.getCoords(m,p,this._bufferService.cols,this._bufferService.rows);if(k)return{x:k[0],y:k[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(m,p,d,k,I){return{x1:m,y1:p,x2:d,y2:k,cols:this._bufferService.cols,fg:I}}};r.Linkifier=a=g([v(1,f.IMouseService),v(2,f.IRenderService),v(3,E.IBufferService),v(4,f.ILinkProviderService)],a)},9042:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(x,r,c){var g=this&&this.__decorate||function(f,a,m,p){var d,k=arguments.length,I=k<3?a:p===null?p=Object.getOwnPropertyDescriptor(a,m):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(f,a,m,p);else for(var L=f.length-1;L>=0;L--)(d=f[L])&&(I=(k<3?d(I):k>3?d(a,m,I):d(a,m))||I);return k>3&&I&&Object.defineProperty(a,m,I),I},v=this&&this.__param||function(f,a){return function(m,p){a(m,p,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const h=c(511),y=c(2585);let S=r.OscLinkProvider=class{constructor(f,a,m){this._bufferService=f,this._optionsService=a,this._oscLinkService=m}provideLinks(f,a){var T;const m=this._bufferService.buffer.lines.get(f-1);if(!m)return void a(void 0);const p=[],d=this._optionsService.rawOptions.linkHandler,k=new h.CellData,I=m.getTrimmedLength();let L=-1,M=-1,b=!1;for(let N=0;N<I;N++)if(M!==-1||m.hasContent(N)){if(m.loadCell(N,k),k.hasExtendedAttrs()&&k.extended.urlId){if(M===-1){M=N,L=k.extended.urlId;continue}b=k.extended.urlId!==L}else M!==-1&&(b=!0);if(b||M!==-1&&N===I-1){const O=(T=this._oscLinkService.getLinkData(L))==null?void 0:T.uri;if(O){const B={start:{x:M+1,y:f},end:{x:N+(b||N!==I-1?0:1),y:f}};let F=!1;if(!(d!=null&&d.allowNonHttpProtocols))try{const U=new URL(O);["http:","https:"].includes(U.protocol)||(F=!0)}catch{F=!0}F||p.push({text:O,range:B,activate:(U,V)=>d?d.activate(U,V,B):E(0,V),hover:(U,V)=>{var X;return(X=d==null?void 0:d.hover)==null?void 0:X.call(d,U,V,B)},leave:(U,V)=>{var X;return(X=d==null?void 0:d.leave)==null?void 0:X.call(d,U,V,B)}})}b=!1,k.hasExtendedAttrs()&&k.extended.urlId?(M=N,L=k.extended.urlId):(M=-1,L=-1)}}a(p)}};function E(f,a){if(confirm(`Do you want to navigate to ${a}?
111
-
112
- WARNING: This link could potentially be dangerous`)){const m=window.open();if(m){try{m.opener=null}catch{}m.location.href=a}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=S=g([v(0,y.IBufferService),v(1,y.IOptionsService),v(2,y.IOscLinkService)],S)},6193:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(c,g){this._renderCallback=c,this._coreBrowserService=g,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,g,v){this._rowCount=v,c=c!==void 0?c:0,g=g!==void 0?g: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,g):g,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),g=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,g),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const g=c(3614),v=c(3656),h=c(3551),y=c(9042),S=c(3730),E=c(1680),f=c(3107),a=c(5744),m=c(2950),p=c(1296),d=c(428),k=c(4269),I=c(5114),L=c(8934),M=c(3230),b=c(9312),T=c(4725),N=c(6731),O=c(8055),B=c(8969),F=c(8460),U=c(844),V=c(6114),X=c(8437),Y=c(2584),q=c(7399),D=c(5941),$=c(9074),H=c(2585),K=c(5435),te=c(4567),re=c(779);class ae extends B.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(G={}){super(G),this.browser=V,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new U.MutableDisposable),this._onCursorMove=this.register(new F.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new F.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new F.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new F.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new F.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new F.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new F.EventEmitter),this._onBlur=this.register(new F.EventEmitter),this._onA11yCharEmitter=this.register(new F.EventEmitter),this._onA11yTabEmitter=this.register(new F.EventEmitter),this._onWillOpen=this.register(new F.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance($.DecorationService),this._instantiationService.setService(H.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(re.LinkProviderService),this._instantiationService.setService(T.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((W,J)=>this.refresh(W,J)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((W=>this._reportWindowsOptions(W)))),this.register(this._inputHandler.onColor((W=>this._handleColorEvent(W)))),this.register((0,F.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,F.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((W=>this._afterResize(W.cols,W.rows)))),this.register((0,U.toDisposable)((()=>{var W,J;this._customKeyEventHandler=void 0,(J=(W=this.element)==null?void 0:W.parentNode)==null||J.removeChild(this.element)})))}_handleColorEvent(G){if(this._themeService)for(const W of G){let J,Z="";switch(W.index){case 256:J="foreground",Z="10";break;case 257:J="background",Z="11";break;case 258:J="cursor",Z="12";break;default:J="ansi",Z="4;"+W.index}switch(W.type){case 0:const de=O.color.toColorRGB(J==="ansi"?this._themeService.colors.ansi[W.index]:this._themeService.colors[J]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${Z};${(0,D.toRgbString)(de)}${Y.C1_ESCAPED.ST}`);break;case 1:if(J==="ansi")this._themeService.modifyColors((fe=>fe.ansi[W.index]=O.channels.toColor(...W.color)));else{const fe=J;this._themeService.modifyColors((se=>se[fe]=O.channels.toColor(...W.color)))}break;case 2:this._themeService.restoreColor(W.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(G){G?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(te.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(G){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var G;return(G=this.textarea)==null?void 0:G.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 G=this.buffer.ybase+this.buffer.y,W=this.buffer.lines.get(G);if(!W)return;const J=Math.min(this.buffer.x,this.cols-1),Z=this._renderService.dimensions.css.cell.height,de=W.getWidth(J),fe=this._renderService.dimensions.css.cell.width*de,se=this.buffer.y*this._renderService.dimensions.css.cell.height,Ee=J*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ee+"px",this.textarea.style.top=se+"px",this.textarea.style.width=fe+"px",this.textarea.style.height=Z+"px",this.textarea.style.lineHeight=Z+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",(W=>{this.hasSelection()&&(0,g.copyHandler)(W,this._selectionService)})));const G=W=>(0,g.handlePasteEvent)(W,this.textarea,this.coreService,this.optionsService);this.register((0,v.addDisposableDomListener)(this.textarea,"paste",G)),this.register((0,v.addDisposableDomListener)(this.element,"paste",G)),V.isFirefox?this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(W=>{W.button===2&&(0,g.rightClickHandler)(W,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",(W=>{(0,g.rightClickHandler)(W,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),V.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",(W=>{W.button===1&&(0,g.moveTextAreaUnderMouseCursor)(W,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,v.addDisposableDomListener)(this.textarea,"keyup",(G=>this._keyUp(G)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keydown",(G=>this._keyDown(G)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keypress",(G=>this._keyPress(G)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionupdate",(G=>this._compositionHelper.compositionupdate(G)))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,v.addDisposableDomListener)(this.textarea,"input",(G=>this._inputEvent(G)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(G){var J;if(!G)throw new Error("Terminal requires a parent element.");if(G.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((J=this.element)==null?void 0:J.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=G.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"),G.appendChild(this.element);const W=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),W.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,v.addDisposableDomListener)(this.screenElement,"mousemove",(Z=>this.updateCursorStyle(Z)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),W.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",y.promptLabel),V.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(I.CoreBrowserService,this.textarea,G.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(T.ICoreBrowserService,this._coreBrowserService),this.register((0,v.addDisposableDomListener)(this.textarea,"focus",(Z=>this._handleTextAreaFocus(Z)))),this.register((0,v.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(d.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(T.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(N.ThemeService),this._instantiationService.setService(T.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(k.CharacterJoinerService),this._instantiationService.setService(T.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(T.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((Z=>this._onRender.fire(Z)))),this.onResize((Z=>this._renderService.resize(Z.cols,Z.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(m.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(L.MouseService),this._instantiationService.setService(T.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(W);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(E.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((Z=>this.scrollLines(Z.amount,Z.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(b.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(T.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((Z=>this.scrollLines(Z.amount,Z.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((Z=>this._renderService.handleSelectionChanged(Z.start,Z.end,Z.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((Z=>{this.textarea.value=Z,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((Z=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,v.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(f.BufferDecorationRenderer,this.screenElement)),this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(Z=>this._selectionService.handleMouseDown(Z)))),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(te.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(Z=>this._handleScreenReaderModeOptionChange(Z)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(a.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(Z=>{!this._overviewRulerRenderer&&Z&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(a.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(p.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const G=this,W=this.element;function J(fe){const se=G._mouseService.getMouseReportCoords(fe,G.screenElement);if(!se)return!1;let Ee,Me;switch(fe.overrideType||fe.type){case"mousemove":Me=32,fe.buttons===void 0?(Ee=3,fe.button!==void 0&&(Ee=fe.button<3?fe.button:3)):Ee=1&fe.buttons?0:4&fe.buttons?1:2&fe.buttons?2:3;break;case"mouseup":Me=0,Ee=fe.button<3?fe.button:3;break;case"mousedown":Me=1,Ee=fe.button<3?fe.button:3;break;case"wheel":if(G._customWheelEventHandler&&G._customWheelEventHandler(fe)===!1||G.viewport.getLinesScrolled(fe)===0)return!1;Me=fe.deltaY<0?0:1,Ee=4;break;default:return!1}return!(Me===void 0||Ee===void 0||Ee>4)&&G.coreMouseService.triggerMouseEvent({col:se.col,row:se.row,x:se.x,y:se.y,button:Ee,action:Me,ctrl:fe.ctrlKey,alt:fe.altKey,shift:fe.shiftKey})}const Z={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de={mouseup:fe=>(J(fe),fe.buttons||(this._document.removeEventListener("mouseup",Z.mouseup),Z.mousedrag&&this._document.removeEventListener("mousemove",Z.mousedrag)),this.cancel(fe)),wheel:fe=>(J(fe),this.cancel(fe,!0)),mousedrag:fe=>{fe.buttons&&J(fe)},mousemove:fe=>{fe.buttons||J(fe)}};this.register(this.coreMouseService.onProtocolChange((fe=>{fe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(fe)),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&fe?Z.mousemove||(W.addEventListener("mousemove",de.mousemove),Z.mousemove=de.mousemove):(W.removeEventListener("mousemove",Z.mousemove),Z.mousemove=null),16&fe?Z.wheel||(W.addEventListener("wheel",de.wheel,{passive:!1}),Z.wheel=de.wheel):(W.removeEventListener("wheel",Z.wheel),Z.wheel=null),2&fe?Z.mouseup||(Z.mouseup=de.mouseup):(this._document.removeEventListener("mouseup",Z.mouseup),Z.mouseup=null),4&fe?Z.mousedrag||(Z.mousedrag=de.mousedrag):(this._document.removeEventListener("mousemove",Z.mousedrag),Z.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)(W,"mousedown",(fe=>{if(fe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(fe))return J(fe),Z.mouseup&&this._document.addEventListener("mouseup",Z.mouseup),Z.mousedrag&&this._document.addEventListener("mousemove",Z.mousedrag),this.cancel(fe)}))),this.register((0,v.addDisposableDomListener)(W,"wheel",(fe=>{if(!Z.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(fe)===!1)return!1;if(!this.buffer.hasScrollback){const se=this.viewport.getLinesScrolled(fe);if(se===0)return;const Ee=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(fe.deltaY<0?"A":"B");let Me="";for(let Qe=0;Qe<Math.abs(se);Qe++)Me+=Ee;return this.coreService.triggerDataEvent(Me,!0),this.cancel(fe,!0)}return this.viewport.handleWheel(fe)?this.cancel(fe):void 0}}),{passive:!1})),this.register((0,v.addDisposableDomListener)(W,"touchstart",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(fe),this.cancel(fe)}),{passive:!0})),this.register((0,v.addDisposableDomListener)(W,"touchmove",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(fe)?void 0:this.cancel(fe)}),{passive:!1}))}refresh(G,W){var J;(J=this._renderService)==null||J.refreshRows(G,W)}updateCursorStyle(G){var W;(W=this._selectionService)!=null&&W.shouldColumnSelect(G)?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(G,W,J=0){var Z;J===1?(super.scrollLines(G,W,J),this.refresh(0,this.rows-1)):(Z=this.viewport)==null||Z.scrollLines(G)}paste(G){(0,g.paste)(G,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(G){this._customKeyEventHandler=G}attachCustomWheelEventHandler(G){this._customWheelEventHandler=G}registerLinkProvider(G){return this._linkProviderService.registerLinkProvider(G)}registerCharacterJoiner(G){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const W=this._characterJoinerService.register(G);return this.refresh(0,this.rows-1),W}deregisterCharacterJoiner(G){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(G)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(G){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+G)}registerDecoration(G){return this._decorationService.registerDecoration(G)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(G,W,J){this._selectionService.setSelection(G,W,J)}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 G;(G=this._selectionService)==null||G.clearSelection()}selectAll(){var G;(G=this._selectionService)==null||G.selectAll()}selectLines(G,W){var J;(J=this._selectionService)==null||J.selectLines(G,W)}_keyDown(G){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1)return!1;const W=this.browser.isMac&&this.options.macOptionIsMeta&&G.altKey;if(!W&&!this._compositionHelper.keydown(G))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;W||G.key!=="Dead"&&G.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const J=(0,q.evaluateKeyboardEvent)(G,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(G),J.type===3||J.type===2){const Z=this.rows-1;return this.scrollLines(J.type===2?-Z:Z),this.cancel(G,!0)}return J.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,G)||(J.cancel&&this.cancel(G,!0),!J.key||!!(G.key&&!G.ctrlKey&&!G.altKey&&!G.metaKey&&G.key.length===1&&G.key.charCodeAt(0)>=65&&G.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(J.key!==Y.C0.ETX&&J.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:J.key,domEvent:G}),this._showCursor(),this.coreService.triggerDataEvent(J.key,!0),!this.optionsService.rawOptions.screenReaderMode||G.altKey||G.ctrlKey?this.cancel(G,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(G,W){const J=G.isMac&&!this.options.macOptionIsMeta&&W.altKey&&!W.ctrlKey&&!W.metaKey||G.isWindows&&W.altKey&&W.ctrlKey&&!W.metaKey||G.isWindows&&W.getModifierState("AltGraph");return W.type==="keypress"?J:J&&(!W.keyCode||W.keyCode>47)}_keyUp(G){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1||((function(W){return W.keyCode===16||W.keyCode===17||W.keyCode===18})(G)||this.focus(),this.updateCursorStyle(G),this._keyPressHandled=!1)}_keyPress(G){let W;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1)return!1;if(this.cancel(G),G.charCode)W=G.charCode;else if(G.which===null||G.which===void 0)W=G.keyCode;else{if(G.which===0||G.charCode===0)return!1;W=G.which}return!(!W||(G.altKey||G.ctrlKey||G.metaKey)&&!this._isThirdLevelShift(this.browser,G)||(W=String.fromCharCode(W),this._onKey.fire({key:W,domEvent:G}),this._showCursor(),this.coreService.triggerDataEvent(W,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(G){if(G.data&&G.inputType==="insertText"&&(!G.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const W=G.data;return this.coreService.triggerDataEvent(W,!0),this.cancel(G),!0}return!1}resize(G,W){G!==this.cols||W!==this.rows?super.resize(G,W):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(G,W){var J,Z;(J=this._charSizeService)==null||J.measure(),(Z=this.viewport)==null||Z.syncScrollArea(!0)}clear(){var G;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 W=1;W<this.rows;W++)this.buffer.lines.push(this.buffer.getBlankLine(X.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(G=this.viewport)==null||G.reset(),this.refresh(0,this.rows-1)}}reset(){var W,J;this.options.rows=this.rows,this.options.cols=this.cols;const G=this._customKeyEventHandler;this._setup(),super.reset(),(W=this._selectionService)==null||W.reset(),this._decorationService.reset(),(J=this.viewport)==null||J.reset(),this._customKeyEventHandler=G,this.refresh(0,this.rows-1)}clearTextureAtlas(){var G;(G=this._renderService)==null||G.clearTextureAtlas()}_reportFocus(){var G;(G=this.element)!=null&&G.classList.contains("focus")?this.coreService.triggerDataEvent(Y.C0.ESC+"[I"):this.coreService.triggerDataEvent(Y.C0.ESC+"[O")}_reportWindowsOptions(G){if(this._renderService)switch(G){case K.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const W=this._renderService.dimensions.css.canvas.width.toFixed(0),J=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${J};${W}t`);break;case K.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const Z=this._renderService.dimensions.css.cell.width.toFixed(0),de=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[6;${de};${Z}t`)}}cancel(G,W){if(this.options.cancelEvents||W)return G.preventDefault(),G.stopPropagation(),!1}}r.Terminal=ae},9924:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(c,g=1e3){this._renderCallback=c,this._debounceThresholdMS=g,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,g,v){this._rowCount=v,c=c!==void 0?c:0,g=g!==void 0?g: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,g):g;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const y=h-this._lastRefreshMs,S=this._debounceThresholdMS-y;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),S)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),g=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,g)}}},1680:function(x,r,c){var g=this&&this.__decorate||function(m,p,d,k){var I,L=arguments.length,M=L<3?p:k===null?k=Object.getOwnPropertyDescriptor(p,d):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(m,p,d,k);else for(var b=m.length-1;b>=0;b--)(I=m[b])&&(M=(L<3?I(M):L>3?I(p,d,M):I(p,d))||M);return L>3&&M&&Object.defineProperty(p,d,M),M},v=this&&this.__param||function(m,p){return function(d,k){p(d,k,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const h=c(3656),y=c(4725),S=c(8460),E=c(844),f=c(2585);let a=r.Viewport=class extends E.Disposable{constructor(m,p,d,k,I,L,M,b){super(),this._viewportElement=m,this._scrollArea=p,this._bufferService=d,this._optionsService=k,this._charSizeService=I,this._renderService=L,this._coreBrowserService=M,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((T=>this._activeBuffer=T.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((T=>this._renderDimensions=T))),this._handleThemeChange(b.colors),this.register(b.onChangeColors((T=>this._handleThemeChange(T)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(m){this._viewportElement.style.backgroundColor=m.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(m){if(m)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 p=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==p&&(this._lastRecordedBufferHeight=p,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const m=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==m&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=m),this._refreshAnimationFrame=null}syncScrollArea(m=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(m);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(m)}_handleScroll(m){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 p=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const m=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(m*(this._smoothScrollState.target-this._smoothScrollState.origin)),m<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(m,p){const d=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(p<0&&this._viewportElement.scrollTop!==0||p>0&&d<this._lastRecordedBufferHeight)||(m.cancelable&&m.preventDefault(),!1)}handleWheel(m){const p=this._getPixelsScrolled(m);return p!==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+p:this._smoothScrollState.target+=p,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=p,this._bubbleScroll(m,p))}scrollLines(m){if(m!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const p=m*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+p,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:m,suppressScrollEvent:!1})}_getPixelsScrolled(m){if(m.deltaY===0||m.shiftKey)return 0;let p=this._applyScrollModifier(m.deltaY,m);return m.deltaMode===WheelEvent.DOM_DELTA_LINE?p*=this._currentRowHeight:m.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._currentRowHeight*this._bufferService.rows),p}getBufferElements(m,p){var b;let d,k="";const I=[],L=p??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let T=m;T<L;T++){const N=M.get(T);if(!N)continue;const O=(b=M.get(T+1))==null?void 0:b.isWrapped;if(k+=N.translateToString(!O),!O||T===M.length-1){const B=document.createElement("div");B.textContent=k,I.push(B),k.length>0&&(d=B),k=""}}return{bufferElements:I,cursorElement:d}}getLinesScrolled(m){if(m.deltaY===0||m.shiftKey)return 0;let p=this._applyScrollModifier(m.deltaY,m);return m.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(p/=this._currentRowHeight+0,this._wheelPartialScroll+=p,p=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):m.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._bufferService.rows),p}_applyScrollModifier(m,p){const d=this._optionsService.rawOptions.fastScrollModifier;return d==="alt"&&p.altKey||d==="ctrl"&&p.ctrlKey||d==="shift"&&p.shiftKey?m*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:m*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(m){this._lastTouchY=m.touches[0].pageY}handleTouchMove(m){const p=this._lastTouchY-m.touches[0].pageY;return this._lastTouchY=m.touches[0].pageY,p!==0&&(this._viewportElement.scrollTop+=p,this._bubbleScroll(m,p))}};r.Viewport=a=g([v(2,f.IBufferService),v(3,f.IOptionsService),v(4,y.ICharSizeService),v(5,y.IRenderService),v(6,y.ICoreBrowserService),v(7,y.IThemeService)],a)},3107:function(x,r,c){var g=this&&this.__decorate||function(f,a,m,p){var d,k=arguments.length,I=k<3?a:p===null?p=Object.getOwnPropertyDescriptor(a,m):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(f,a,m,p);else for(var L=f.length-1;L>=0;L--)(d=f[L])&&(I=(k<3?d(I):k>3?d(a,m,I):d(a,m))||I);return k>3&&I&&Object.defineProperty(a,m,I),I},v=this&&this.__param||function(f,a){return function(m,p){a(m,p,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const h=c(4725),y=c(844),S=c(2585);let E=r.BufferDecorationRenderer=class extends y.Disposable{constructor(f,a,m,p,d){super(),this._screenElement=f,this._bufferService=a,this._coreBrowserService=m,this._decorationService=p,this._renderService=d,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((k=>this._removeDecoration(k)))),this.register((0,y.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 p;const a=this._coreBrowserService.mainDocument.createElement("div");a.classList.add("xterm-decoration"),a.classList.toggle("xterm-decoration-top-layer",((p=f==null?void 0:f.options)==null?void 0:p.layer)==="top"),a.style.width=`${Math.round((f.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,a.style.height=(f.options.height||1)*this._renderService.dimensions.css.cell.height+"px",a.style.top=(f.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",a.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const m=f.options.x??0;return m&&m>this._bufferService.cols&&(a.style.display="none"),this._refreshXPosition(f,a),a}_refreshStyle(f){const a=f.marker.line-this._bufferService.buffers.active.ydisp;if(a<0||a>=this._bufferService.rows)f.element&&(f.element.style.display="none",f.onRenderEmitter.fire(f.element));else{let m=this._decorationElements.get(f);m||(m=this._createElement(f),f.element=m,this._decorationElements.set(f,m),this._container.appendChild(m),f.onDispose((()=>{this._decorationElements.delete(f),m.remove()}))),m.style.top=a*this._renderService.dimensions.css.cell.height+"px",m.style.display=this._altBufferIsActive?"none":"block",f.onRenderEmitter.fire(m)}}_refreshXPosition(f,a=f.element){if(!a)return;const m=f.options.x??0;(f.options.anchor||"left")==="right"?a.style.right=m?m*this._renderService.dimensions.css.cell.width+"px":"":a.style.left=m?m*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(f){var a;(a=this._decorationElements.get(f))==null||a.remove(),this._decorationElements.delete(f),f.dispose()}};r.BufferDecorationRenderer=E=g([v(1,S.IBufferService),v(2,h.ICoreBrowserService),v(3,S.IDecorationService),v(4,h.IRenderService)],E)},5871:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.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 g of this._zones)if(g.color===c.options.overviewRulerOptions.color&&g.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(g,c.marker.line))return;if(this._lineAdjacentToZone(g,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(g,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,g){return g>=c.startBufferLine&&g<=c.endBufferLine}_lineAdjacentToZone(c,g,v){return g>=c.startBufferLine-this._linePadding[v||"full"]&&g<=c.endBufferLine+this._linePadding[v||"full"]}_addLineToZone(c,g){c.startBufferLine=Math.min(c.startBufferLine,g),c.endBufferLine=Math.max(c.endBufferLine,g)}}},5744:function(x,r,c){var g=this&&this.__decorate||function(d,k,I,L){var M,b=arguments.length,T=b<3?k:L===null?L=Object.getOwnPropertyDescriptor(k,I):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(d,k,I,L);else for(var N=d.length-1;N>=0;N--)(M=d[N])&&(T=(b<3?M(T):b>3?M(k,I,T):M(k,I))||T);return b>3&&T&&Object.defineProperty(k,I,T),T},v=this&&this.__param||function(d,k){return function(I,L){k(I,L,d)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const h=c(5871),y=c(4725),S=c(844),E=c(2585),f={full:0,left:0,center:0,right:0},a={full:0,left:0,center:0,right:0},m={full:0,left:0,center:0,right:0};let p=r.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(d,k,I,L,M,b,T){var O;super(),this._viewportElement=d,this._screenElement=k,this._bufferService=I,this._decorationService=L,this._renderService=M,this._optionsService=b,this._coreBrowserService=T,this._colorZoneStore=new h.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(),(O=this._viewportElement.parentElement)==null||O.insertBefore(this._canvas,this._viewportElement);const N=this._canvas.getContext("2d");if(!N)throw new Error("Ctx cannot be null");this._ctx=N,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)((()=>{var B;(B=this._canvas)==null||B.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const d=Math.floor(this._canvas.width/3),k=Math.ceil(this._canvas.width/3);a.full=this._canvas.width,a.left=d,a.center=k,a.right=d,this._refreshDrawHeightConstants(),m.full=0,m.left=0,m.center=a.left,m.right=a.left+a.center}_refreshDrawHeightConstants(){f.full=Math.round(2*this._coreBrowserService.dpr);const d=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(d,12),6)*this._coreBrowserService.dpr);f.left=k,f.center=k,f.right=k}_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 k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const d=this._colorZoneStore.zones;for(const k of d)k.position!=="full"&&this._renderColorZone(k);for(const k of d)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(d){this._ctx.fillStyle=d.color,this._ctx.fillRect(m[d.position||"full"],Math.round((this._canvas.height-1)*(d.startBufferLine/this._bufferService.buffers.active.lines.length)-f[d.position||"full"]/2),a[d.position||"full"],Math.round((this._canvas.height-1)*((d.endBufferLine-d.startBufferLine)/this._bufferService.buffers.active.lines.length)+f[d.position||"full"]))}_queueRefresh(d,k){this._shouldUpdateDimensions=d||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};r.OverviewRulerRenderer=p=g([v(2,E.IBufferService),v(3,E.IDecorationService),v(4,y.IRenderService),v(5,E.IOptionsService),v(6,y.ICoreBrowserService)],p)},2950:function(x,r,c){var g=this&&this.__decorate||function(f,a,m,p){var d,k=arguments.length,I=k<3?a:p===null?p=Object.getOwnPropertyDescriptor(a,m):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(f,a,m,p);else for(var L=f.length-1;L>=0;L--)(d=f[L])&&(I=(k<3?d(I):k>3?d(a,m,I):d(a,m))||I);return k>3&&I&&Object.defineProperty(a,m,I),I},v=this&&this.__param||function(f,a){return function(m,p){a(m,p,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const h=c(4725),y=c(2585),S=c(2584);let E=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(f,a,m,p,d,k){this._textarea=f,this._compositionView=a,this._bufferService=m,this._optionsService=p,this._coreService=d,this._renderService=k,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 a={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let m;this._isSendingComposition=!1,a.start+=this._dataAlreadySent.length,m=this._isComposing?this._textarea.value.substring(a.start,a.end):this._textarea.value.substring(a.start),m.length>0&&this._coreService.triggerDataEvent(m,!0)}}),0)}else{this._isSendingComposition=!1;const a=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(a,!0)}}_handleAnyTextareaChanges(){const f=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const a=this._textarea.value,m=a.replace(f,"");this._dataAlreadySent=m,a.length>f.length?this._coreService.triggerDataEvent(m,!0):a.length<f.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):a.length===f.length&&a!==f&&this._coreService.triggerDataEvent(a,!0)}}),0)}updateCompositionElements(f){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const a=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),m=this._renderService.dimensions.css.cell.height,p=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,d=a*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=d+"px",this._compositionView.style.top=p+"px",this._compositionView.style.height=m+"px",this._compositionView.style.lineHeight=m+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const k=this._compositionView.getBoundingClientRect();this._textarea.style.left=d+"px",this._textarea.style.top=p+"px",this._textarea.style.width=Math.max(k.width,1)+"px",this._textarea.style.height=Math.max(k.height,1)+"px",this._textarea.style.lineHeight=k.height+"px"}f||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};r.CompositionHelper=E=g([v(2,y.IBufferService),v(3,y.IOptionsService),v(4,y.ICoreService),v(5,h.IRenderService)],E)},9806:(x,r)=>{function c(g,v,h){const y=h.getBoundingClientRect(),S=g.getComputedStyle(h),E=parseInt(S.getPropertyValue("padding-left")),f=parseInt(S.getPropertyValue("padding-top"));return[v.clientX-y.left-E,v.clientY-y.top-f]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=c,r.getCoords=function(g,v,h,y,S,E,f,a,m){if(!E)return;const p=c(g,v,h);return p?(p[0]=Math.ceil((p[0]+(m?f/2:0))/f),p[1]=Math.ceil(p[1]/a),p[0]=Math.min(Math.max(p[0],1),y+(m?1:0)),p[1]=Math.min(Math.max(p[1],1),S),p):void 0}},9504:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const g=c(2584);function v(a,m,p,d){const k=a-h(a,p),I=m-h(m,p),L=Math.abs(k-I)-(function(M,b,T){let N=0;const O=M-h(M,T),B=b-h(b,T);for(let F=0;F<Math.abs(O-B);F++){const U=y(M,b)==="A"?-1:1,V=T.buffer.lines.get(O+U*F);V!=null&&V.isWrapped&&N++}return N})(a,m,p);return f(L,E(y(a,m),d))}function h(a,m){let p=0,d=m.buffer.lines.get(a),k=d==null?void 0:d.isWrapped;for(;k&&a>=0&&a<m.rows;)p++,d=m.buffer.lines.get(--a),k=d==null?void 0:d.isWrapped;return p}function y(a,m){return a>m?"A":"B"}function S(a,m,p,d,k,I){let L=a,M=m,b="";for(;L!==p||M!==d;)L+=k?1:-1,k&&L>I.cols-1?(b+=I.buffer.translateBufferLineToString(M,!1,a,L),L=0,a=0,M++):!k&&L<0&&(b+=I.buffer.translateBufferLineToString(M,!1,0,a+1),L=I.cols-1,a=L,M--);return b+I.buffer.translateBufferLineToString(M,!1,a,L)}function E(a,m){const p=m?"O":"[";return g.C0.ESC+p+a}function f(a,m){a=Math.floor(a);let p="";for(let d=0;d<a;d++)p+=m;return p}r.moveToCellSequence=function(a,m,p,d){const k=p.buffer.x,I=p.buffer.y;if(!p.buffer.hasScrollback)return(function(b,T,N,O,B,F){return v(T,O,B,F).length===0?"":f(S(b,T,b,T-h(T,B),!1,B).length,E("D",F))})(k,I,0,m,p,d)+v(I,m,p,d)+(function(b,T,N,O,B,F){let U;U=v(T,O,B,F).length>0?O-h(O,B):T;const V=O,X=(function(Y,q,D,$,H,K){let te;return te=v(D,$,H,K).length>0?$-h($,H):q,Y<D&&te<=$||Y>=D&&te<$?"C":"D"})(b,T,N,O,B,F);return f(S(b,U,N,V,X==="C",B).length,E(X,F))})(k,I,a,m,p,d);let L;if(I===m)return L=k>a?"D":"C",f(Math.abs(k-a),E(L,d));L=I>m?"D":"C";const M=Math.abs(I-m);return f((function(b,T){return T.cols-b})(I>m?a:k,p)+(M-1)*p.cols+1+((I>m?k:a)-1),E(L,d))}},1296:function(x,r,c){var g=this&&this.__decorate||function(F,U,V,X){var Y,q=arguments.length,D=q<3?U:X===null?X=Object.getOwnPropertyDescriptor(U,V):X;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(F,U,V,X);else for(var $=F.length-1;$>=0;$--)(Y=F[$])&&(D=(q<3?Y(D):q>3?Y(U,V,D):Y(U,V))||D);return q>3&&D&&Object.defineProperty(U,V,D),D},v=this&&this.__param||function(F,U){return function(V,X){U(V,X,F)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const h=c(3787),y=c(2550),S=c(2223),E=c(6171),f=c(6052),a=c(4725),m=c(8055),p=c(8460),d=c(844),k=c(2585),I="xterm-dom-renderer-owner-",L="xterm-rows",M="xterm-fg-",b="xterm-bg-",T="xterm-focus",N="xterm-selection";let O=1,B=r.DomRenderer=class extends d.Disposable{constructor(F,U,V,X,Y,q,D,$,H,K,te,re,ae){super(),this._terminal=F,this._document=U,this._element=V,this._screenElement=X,this._viewportElement=Y,this._helperContainer=q,this._linkifier2=D,this._charSizeService=H,this._optionsService=K,this._bufferService=te,this._coreBrowserService=re,this._themeService=ae,this._terminalClass=O++,this._rowElements=[],this._selectionRenderModel=(0,f.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new p.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(L),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(N),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,E.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ue=>this._injectCss(ue)))),this._injectCss(this._themeService.colors),this._rowFactory=$.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(I+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ue=>this._handleLinkHover(ue)))),this.register(this._linkifier2.onHideLinkUnderline((ue=>this._handleLinkLeave(ue)))),this.register((0,d.toDisposable)((()=>{this._element.classList.remove(I+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new y.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 F=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*F,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*F),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/F),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/F),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 V of this._rowElements)V.style.width=`${this.dimensions.css.canvas.width}px`,V.style.height=`${this.dimensions.css.cell.height}px`,V.style.lineHeight=`${this.dimensions.css.cell.height}px`,V.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const U=`${this._terminalSelector} .${L} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=U,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(F){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let U=`${this._terminalSelector} .${L} { color: ${F.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;U+=`${this._terminalSelector} .${L} .xterm-dim { color: ${m.color.multiplyOpacity(F.foreground,.5).css};}`,U+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const V=`blink_underline_${this._terminalClass}`,X=`blink_bar_${this._terminalClass}`,Y=`blink_block_${this._terminalClass}`;U+=`@keyframes ${V} { 50% { border-bottom-style: hidden; }}`,U+=`@keyframes ${X} { 50% { box-shadow: none; }}`,U+=`@keyframes ${Y} { 0% { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css}; } 50% { background-color: inherit; color: ${F.cursor.css}; }}`,U+=`${this._terminalSelector} .${L}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${L}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${L}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css};}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${F.cursor.css} !important; color: ${F.cursorAccent.css} !important;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${F.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${F.cursor.css} inset;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${F.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,U+=`${this._terminalSelector} .${N} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${N} div { position: absolute; background-color: ${F.selectionBackgroundOpaque.css};}${this._terminalSelector} .${N} div { position: absolute; background-color: ${F.selectionInactiveBackgroundOpaque.css};}`;for(const[q,D]of F.ansi.entries())U+=`${this._terminalSelector} .${M}${q} { color: ${D.css}; }${this._terminalSelector} .${M}${q}.xterm-dim { color: ${m.color.multiplyOpacity(D,.5).css}; }${this._terminalSelector} .${b}${q} { background-color: ${D.css}; }`;U+=`${this._terminalSelector} .${M}${S.INVERTED_DEFAULT_COLOR} { color: ${m.color.opaque(F.background).css}; }${this._terminalSelector} .${M}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${m.color.multiplyOpacity(m.color.opaque(F.background),.5).css}; }${this._terminalSelector} .${b}${S.INVERTED_DEFAULT_COLOR} { background-color: ${F.foreground.css}; }`,this._themeStyleElement.textContent=U}_setDefaultSpacing(){const F=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${F}px`,this._rowFactory.defaultSpacing=F}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(F,U){for(let V=this._rowElements.length;V<=U;V++){const X=this._document.createElement("div");this._rowContainer.appendChild(X),this._rowElements.push(X)}for(;this._rowElements.length>U;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(F,U){this._refreshRowElements(F,U),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(T),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(T),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(F,U,V){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(F,U,V),this.renderRows(0,this._bufferService.rows-1),!F||!U)return;this._selectionRenderModel.update(this._terminal,F,U,V);const X=this._selectionRenderModel.viewportStartRow,Y=this._selectionRenderModel.viewportEndRow,q=this._selectionRenderModel.viewportCappedStartRow,D=this._selectionRenderModel.viewportCappedEndRow;if(q>=this._bufferService.rows||D<0)return;const $=this._document.createDocumentFragment();if(V){const H=F[0]>U[0];$.appendChild(this._createSelectionElement(q,H?U[0]:F[0],H?F[0]:U[0],D-q+1))}else{const H=X===q?F[0]:0,K=q===Y?U[0]:this._bufferService.cols;$.appendChild(this._createSelectionElement(q,H,K));const te=D-q-1;if($.appendChild(this._createSelectionElement(q+1,0,this._bufferService.cols,te)),q!==D){const re=Y===D?U[0]:this._bufferService.cols;$.appendChild(this._createSelectionElement(D,0,re))}}this._selectionContainer.appendChild($)}_createSelectionElement(F,U,V,X=1){const Y=this._document.createElement("div"),q=U*this.dimensions.css.cell.width;let D=this.dimensions.css.cell.width*(V-U);return q+D>this.dimensions.css.canvas.width&&(D=this.dimensions.css.canvas.width-q),Y.style.height=X*this.dimensions.css.cell.height+"px",Y.style.top=F*this.dimensions.css.cell.height+"px",Y.style.left=`${q}px`,Y.style.width=`${D}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 F of this._rowElements)F.replaceChildren()}renderRows(F,U){const V=this._bufferService.buffer,X=V.ybase+V.y,Y=Math.min(V.x,this._bufferService.cols-1),q=this._optionsService.rawOptions.cursorBlink,D=this._optionsService.rawOptions.cursorStyle,$=this._optionsService.rawOptions.cursorInactiveStyle;for(let H=F;H<=U;H++){const K=H+V.ydisp,te=this._rowElements[H],re=V.lines.get(K);if(!te||!re)break;te.replaceChildren(...this._rowFactory.createRow(re,K,K===X,D,$,Y,q,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${I}${this._terminalClass}`}_handleLinkHover(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!0)}_handleLinkLeave(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!1)}_setCellUnderline(F,U,V,X,Y,q){V<0&&(F=0),X<0&&(U=0);const D=this._bufferService.rows-1;V=Math.max(Math.min(V,D),0),X=Math.max(Math.min(X,D),0),Y=Math.min(Y,this._bufferService.cols);const $=this._bufferService.buffer,H=$.ybase+$.y,K=Math.min($.x,Y-1),te=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,ae=this._optionsService.rawOptions.cursorInactiveStyle;for(let ue=V;ue<=X;++ue){const G=ue+$.ydisp,W=this._rowElements[ue],J=$.lines.get(G);if(!W||!J)break;W.replaceChildren(...this._rowFactory.createRow(J,G,G===H,re,ae,K,te,this.dimensions.css.cell.width,this._widthCache,q?ue===V?F:0:-1,q?(ue===X?U:Y)-1:-1))}}};r.DomRenderer=B=g([v(7,k.IInstantiationService),v(8,a.ICharSizeService),v(9,k.IOptionsService),v(10,k.IBufferService),v(11,a.ICoreBrowserService),v(12,a.IThemeService)],B)},3787:function(x,r,c){var g=this&&this.__decorate||function(L,M,b,T){var N,O=arguments.length,B=O<3?M:T===null?T=Object.getOwnPropertyDescriptor(M,b):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(L,M,b,T);else for(var F=L.length-1;F>=0;F--)(N=L[F])&&(B=(O<3?N(B):O>3?N(M,b,B):N(M,b))||B);return O>3&&B&&Object.defineProperty(M,b,B),B},v=this&&this.__param||function(L,M){return function(b,T){M(b,T,L)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const h=c(2223),y=c(643),S=c(511),E=c(2585),f=c(8055),a=c(4725),m=c(4269),p=c(6171),d=c(3734);let k=r.DomRendererRowFactory=class{constructor(L,M,b,T,N,O,B){this._document=L,this._characterJoinerService=M,this._optionsService=b,this._coreBrowserService=T,this._coreService=N,this._decorationService=O,this._themeService=B,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(L,M,b){this._selectionStart=L,this._selectionEnd=M,this._columnSelectMode=b}createRow(L,M,b,T,N,O,B,F,U,V,X){const Y=[],q=this._characterJoinerService.getJoinedCharacters(M),D=this._themeService.colors;let $,H=L.getNoBgTrimmedLength();b&&H<O+1&&(H=O+1);let K=0,te="",re=0,ae=0,ue=0,G=!1,W=0,J=!1,Z=0;const de=[],fe=V!==-1&&X!==-1;for(let se=0;se<H;se++){L.loadCell(se,this._workCell);let Ee=this._workCell.getWidth();if(Ee===0)continue;let Me=!1,Qe=se,Le=this._workCell;if(q.length>0&&se===q[0][0]){Me=!0;const Ve=q.shift();Le=new m.JoinedCellData(this._workCell,L.translateToString(!0,Ve[0],Ve[1]),Ve[1]-Ve[0]),Qe=Ve[1]-1,Ee=Le.getWidth()}const pe=this._isCellInSelection(se,M),Re=b&&se===O,Ce=fe&&se>=V&&se<=X;let Te=!1;this._decorationService.forEachDecorationAtCell(se,M,void 0,(Ve=>{Te=!0}));let Pe=Le.getChars()||y.WHITESPACE_CELL_CHAR;if(Pe===" "&&(Le.isUnderline()||Le.isOverline())&&(Pe=" "),Z=Ee*F-U.get(Pe,Le.isBold(),Le.isItalic()),$){if(K&&(pe&&J||!pe&&!J&&Le.bg===re)&&(pe&&J&&D.selectionForeground||Le.fg===ae)&&Le.extended.ext===ue&&Ce===G&&Z===W&&!Re&&!Me&&!Te){Le.isInvisible()?te+=y.WHITESPACE_CELL_CHAR:te+=Pe,K++;continue}K&&($.textContent=te),$=this._document.createElement("span"),K=0,te=""}else $=this._document.createElement("span");if(re=Le.bg,ae=Le.fg,ue=Le.extended.ext,G=Ce,W=Z,J=pe,Me&&O>=se&&O<=Qe&&(O=se),!this._coreService.isCursorHidden&&Re&&this._coreService.isCursorInitialized){if(de.push("xterm-cursor"),this._coreBrowserService.isFocused)B&&de.push("xterm-cursor-blink"),de.push(T==="bar"?"xterm-cursor-bar":T==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(N)switch(N){case"outline":de.push("xterm-cursor-outline");break;case"block":de.push("xterm-cursor-block");break;case"bar":de.push("xterm-cursor-bar");break;case"underline":de.push("xterm-cursor-underline")}}if(Le.isBold()&&de.push("xterm-bold"),Le.isItalic()&&de.push("xterm-italic"),Le.isDim()&&de.push("xterm-dim"),te=Le.isInvisible()?y.WHITESPACE_CELL_CHAR:Le.getChars()||y.WHITESPACE_CELL_CHAR,Le.isUnderline()&&(de.push(`xterm-underline-${Le.extended.underlineStyle}`),te===" "&&(te=" "),!Le.isUnderlineColorDefault()))if(Le.isUnderlineColorRGB())$.style.textDecorationColor=`rgb(${d.AttributeData.toColorRGB(Le.getUnderlineColor()).join(",")})`;else{let Ve=Le.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Le.isBold()&&Ve<8&&(Ve+=8),$.style.textDecorationColor=D.ansi[Ve].css}Le.isOverline()&&(de.push("xterm-overline"),te===" "&&(te=" ")),Le.isStrikethrough()&&de.push("xterm-strikethrough"),Ce&&($.style.textDecoration="underline");let xe=Le.getFgColor(),Ie=Le.getFgColorMode(),et=Le.getBgColor(),ot=Le.getBgColorMode();const Ze=!!Le.isInverse();if(Ze){const Ve=xe;xe=et,et=Ve;const at=Ie;Ie=ot,ot=at}let ht,tt,He,nt=!1;switch(this._decorationService.forEachDecorationAtCell(se,M,void 0,(Ve=>{Ve.options.layer!=="top"&&nt||(Ve.backgroundColorRGB&&(ot=50331648,et=Ve.backgroundColorRGB.rgba>>8&16777215,ht=Ve.backgroundColorRGB),Ve.foregroundColorRGB&&(Ie=50331648,xe=Ve.foregroundColorRGB.rgba>>8&16777215,tt=Ve.foregroundColorRGB),nt=Ve.options.layer==="top")})),!nt&&pe&&(ht=this._coreBrowserService.isFocused?D.selectionBackgroundOpaque:D.selectionInactiveBackgroundOpaque,et=ht.rgba>>8&16777215,ot=50331648,nt=!0,D.selectionForeground&&(Ie=50331648,xe=D.selectionForeground.rgba>>8&16777215,tt=D.selectionForeground)),nt&&de.push("xterm-decoration-top"),ot){case 16777216:case 33554432:He=D.ansi[et],de.push(`xterm-bg-${et}`);break;case 50331648:He=f.channels.toColor(et>>16,et>>8&255,255&et),this._addStyle($,`background-color:#${I((et>>>0).toString(16),"0",6)}`);break;default:Ze?(He=D.foreground,de.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):He=D.background}switch(ht||Le.isDim()&&(ht=f.color.multiplyOpacity(He,.5)),Ie){case 16777216:case 33554432:Le.isBold()&&xe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(xe+=8),this._applyMinimumContrast($,He,D.ansi[xe],Le,ht,void 0)||de.push(`xterm-fg-${xe}`);break;case 50331648:const Ve=f.channels.toColor(xe>>16&255,xe>>8&255,255&xe);this._applyMinimumContrast($,He,Ve,Le,ht,tt)||this._addStyle($,`color:#${I(xe.toString(16),"0",6)}`);break;default:this._applyMinimumContrast($,He,D.foreground,Le,ht,tt)||Ze&&de.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}de.length&&($.className=de.join(" "),de.length=0),Re||Me||Te?$.textContent=te:K++,Z!==this.defaultSpacing&&($.style.letterSpacing=`${Z}px`),Y.push($),se=Qe}return $&&K&&($.textContent=te),Y}_applyMinimumContrast(L,M,b,T,N,O){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,p.treatGlyphAsBackgroundColor)(T.getCode()))return!1;const B=this._getContrastCache(T);let F;if(N||O||(F=B.getColor(M.rgba,b.rgba)),F===void 0){const U=this._optionsService.rawOptions.minimumContrastRatio/(T.isDim()?2:1);F=f.color.ensureContrastRatio(N||M,O||b,U),B.setColor((N||M).rgba,(O||b).rgba,F??null)}return!!F&&(this._addStyle(L,`color:${F.css}`),!0)}_getContrastCache(L){return L.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(L,M){L.setAttribute("style",`${L.getAttribute("style")||""}${M};`)}_isCellInSelection(L,M){const b=this._selectionStart,T=this._selectionEnd;return!(!b||!T)&&(this._columnSelectMode?b[0]<=T[0]?L>=b[0]&&M>=b[1]&&L<T[0]&&M<=T[1]:L<b[0]&&M>=b[1]&&L>=T[0]&&M<=T[1]:M>b[1]&&M<T[1]||b[1]===T[1]&&M===b[1]&&L>=b[0]&&L<T[0]||b[1]<T[1]&&M===T[1]&&L<T[0]||b[1]<T[1]&&M===b[1]&&L>=b[0])}};function I(L,M,b){for(;L.length<b;)L=M+L;return L}r.DomRendererRowFactory=k=g([v(1,a.ICharacterJoinerService),v(2,E.IOptionsService),v(3,a.ICoreBrowserService),v(4,E.ICoreService),v(5,E.IDecorationService),v(6,a.IThemeService)],k)},2550:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(c,g){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 v=c.createElement("span");v.classList.add("xterm-char-measure-element");const h=c.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const y=c.createElement("span");y.classList.add("xterm-char-measure-element"),y.style.fontStyle="italic";const S=c.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[v,h,y,S],this._container.appendChild(v),this._container.appendChild(h),this._container.appendChild(y),this._container.appendChild(S),g.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,g,v,h){c===this._font&&g===this._fontSize&&v===this._weight&&h===this._weightBold||(this._font=c,this._fontSize=g,this._weight=v,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(c,g,v){let h=0;if(!g&&!v&&c.length===1&&(h=c.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const E=this._measure(c,0);return E>0&&(this._flat[h]=E),E}let y=c;g&&(y+="B"),v&&(y+="I");let S=this._holey.get(y);if(S===void 0){let E=0;g&&(E|=1),v&&(E|=2),S=this._measure(c,E),S>0&&this._holey.set(y,S)}return S}_measure(c,g){const v=this._measureElements[g];return v.textContent=c.repeat(32),v.offsetWidth/32}}},2223:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const g=c(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=g.isFirefox||g.isLegacyEdge?"bottom":"ideographic"},6171:(x,r)=>{function c(v){return 57508<=v&&v<=57558}function g(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(r,"__esModule",{value:!0}),r.computeNextVariantOffset=r.createRenderDimensions=r.treatGlyphAsBackgroundColor=r.allowRescaling=r.isEmoji=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},r.isPowerlineGlyph=c,r.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},r.isEmoji=g,r.allowRescaling=function(v,h,y,S){return h===1&&y>Math.ceil(1.5*S)&&v!==void 0&&v>255&&!g(v)&&!c(v)&&!(function(E){return 57344<=E&&E<=63743})(v)},r.treatGlyphAsBackgroundColor=function(v){return c(v)||(function(h){return 9472<=h&&h<=9631})(v)},r.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}}}},r.computeNextVariantOffset=function(v,h,y=0){return(v-(2*Math.round(h)-y))%(2*Math.round(h))}},6052:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.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(v,h,y,S=!1){if(this.selectionStart=h,this.selectionEnd=y,!h||!y||h[0]===y[0]&&h[1]===y[1])return void this.clear();const E=v.buffers.active.ydisp,f=h[1]-E,a=y[1]-E,m=Math.max(f,0),p=Math.min(a,v.rows-1);m>=v.rows||p<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=f,this.viewportEndRow=a,this.viewportCappedStartRow=m,this.viewportCappedEndRow=p,this.startCol=h[0],this.endCol=y[0])}isCellSelected(v,h,y){return!!this.hasSelection&&(y-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&y>=this.viewportCappedStartRow&&h<this.endCol&&y<=this.viewportCappedEndRow:h<this.startCol&&y>=this.viewportCappedStartRow&&h>=this.endCol&&y<=this.viewportCappedEndRow:y>this.viewportStartRow&&y<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&y===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportStartRow&&h>=this.startCol)}}r.createSelectionRenderModel=function(){return new c}},456:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.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,g=this.selectionEnd;return!(!c||!g)&&(c[1]>g[1]||c[1]===g[1]&&c[0]>g[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(x,r,c){var g=this&&this.__decorate||function(p,d,k,I){var L,M=arguments.length,b=M<3?d:I===null?I=Object.getOwnPropertyDescriptor(d,k):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(p,d,k,I);else for(var T=p.length-1;T>=0;T--)(L=p[T])&&(b=(M<3?L(b):M>3?L(d,k,b):L(d,k))||b);return M>3&&b&&Object.defineProperty(d,k,b),b},v=this&&this.__param||function(p,d){return function(k,I){d(k,I,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const h=c(2585),y=c(8460),S=c(844);let E=r.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(p,d,k){super(),this._optionsService=k,this.width=0,this.height=0,this._onCharSizeChange=this.register(new y.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new m(this._optionsService))}catch{this._measureStrategy=this.register(new a(p,d,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const p=this._measureStrategy.measure();p.width===this.width&&p.height===this.height||(this.width=p.width,this.height=p.height,this._onCharSizeChange.fire())}};r.CharSizeService=E=g([v(2,h.IOptionsService)],E);class f extends S.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(d,k){d!==void 0&&d>0&&k!==void 0&&k>0&&(this._result.width=d,this._result.height=k)}}class a extends f{constructor(d,k,I){super(),this._document=d,this._parentElement=k,this._optionsService=I,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 m extends f{constructor(d){super(),this._optionsService=d,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const k=this._ctx.measureText("W");if(!("width"in k&&"fontBoundingBoxAscent"in k&&"fontBoundingBoxDescent"in k))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const d=this._ctx.measureText("W");return this._validateAndSet(d.width,d.fontBoundingBoxAscent+d.fontBoundingBoxDescent),this._result}}},4269:function(x,r,c){var g=this&&this.__decorate||function(m,p,d,k){var I,L=arguments.length,M=L<3?p:k===null?k=Object.getOwnPropertyDescriptor(p,d):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(m,p,d,k);else for(var b=m.length-1;b>=0;b--)(I=m[b])&&(M=(L<3?I(M):L>3?I(p,d,M):I(p,d))||M);return L>3&&M&&Object.defineProperty(p,d,M),M},v=this&&this.__param||function(m,p){return function(d,k){p(d,k,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const h=c(3734),y=c(643),S=c(511),E=c(2585);class f extends h.AttributeData{constructor(p,d,k){super(),this.content=0,this.combinedData="",this.fg=p.fg,this.bg=p.bg,this.combinedData=d,this._width=k}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(p){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=f;let a=r.CharacterJoinerService=class Im{constructor(p){this._bufferService=p,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(p){const d={id:this._nextCharacterJoinerId++,handler:p};return this._characterJoiners.push(d),d.id}deregister(p){for(let d=0;d<this._characterJoiners.length;d++)if(this._characterJoiners[d].id===p)return this._characterJoiners.splice(d,1),!0;return!1}getJoinedCharacters(p){if(this._characterJoiners.length===0)return[];const d=this._bufferService.buffer.lines.get(p);if(!d||d.length===0)return[];const k=[],I=d.translateToString(!0);let L=0,M=0,b=0,T=d.getFg(0),N=d.getBg(0);for(let O=0;O<d.getTrimmedLength();O++)if(d.loadCell(O,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==T||this._workCell.bg!==N){if(O-L>1){const B=this._getJoinedRanges(I,b,M,d,L);for(let F=0;F<B.length;F++)k.push(B[F])}L=O,b=M,T=this._workCell.fg,N=this._workCell.bg}M+=this._workCell.getChars().length||y.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-L>1){const O=this._getJoinedRanges(I,b,M,d,L);for(let B=0;B<O.length;B++)k.push(O[B])}return k}_getJoinedRanges(p,d,k,I,L){const M=p.substring(d,k);let b=[];try{b=this._characterJoiners[0].handler(M)}catch(T){console.error(T)}for(let T=1;T<this._characterJoiners.length;T++)try{const N=this._characterJoiners[T].handler(M);for(let O=0;O<N.length;O++)Im._mergeRanges(b,N[O])}catch(N){console.error(N)}return this._stringRangesToCellRanges(b,I,L),b}_stringRangesToCellRanges(p,d,k){let I=0,L=!1,M=0,b=p[I];if(b){for(let T=k;T<this._bufferService.cols;T++){const N=d.getWidth(T),O=d.getString(T).length||y.WHITESPACE_CELL_CHAR.length;if(N!==0){if(!L&&b[0]<=M&&(b[0]=T,L=!0),b[1]<=M){if(b[1]=T,b=p[++I],!b)break;b[0]<=M?(b[0]=T,L=!0):L=!1}M+=O}}b&&(b[1]=this._bufferService.cols)}}static _mergeRanges(p,d){let k=!1;for(let I=0;I<p.length;I++){const L=p[I];if(k){if(d[1]<=L[0])return p[I-1][1]=d[1],p;if(d[1]<=L[1])return p[I-1][1]=Math.max(d[1],L[1]),p.splice(I,1),p;p.splice(I,1),I--}else{if(d[1]<=L[0])return p.splice(I,0,d),p;if(d[1]<=L[1])return L[0]=Math.min(d[0],L[0]),p;d[0]<L[1]&&(L[0]=Math.min(d[0],L[0]),k=!0)}}return k?p[p.length-1][1]=d[1]:p.push(d),p}};r.CharacterJoinerService=a=g([v(0,E.IBufferService)],a)},5114:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0;const g=c(844),v=c(8460),h=c(3656);class y extends g.Disposable{constructor(f,a,m){super(),this._textarea=f,this._window=a,this.mainDocument=m,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new S(this._window),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new v.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((p=>this._screenDprMonitor.setWindow(p)))),this.register((0,v.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}}r.CoreBrowserService=y;class S extends g.Disposable{constructor(f){super(),this._parentWindow=f,this._windowResizeListener=this.register(new g.MutableDisposable),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,g.toDisposable)((()=>this.clearListener())))}setWindow(f){this._parentWindow=f,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.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:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkProviderService=void 0;const g=c(844);class v extends g.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,g.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(y){return this.linkProviders.push(y),{dispose:()=>{const S=this.linkProviders.indexOf(y);S!==-1&&this.linkProviders.splice(S,1)}}}}r.LinkProviderService=v},8934:function(x,r,c){var g=this&&this.__decorate||function(E,f,a,m){var p,d=arguments.length,k=d<3?f:m===null?m=Object.getOwnPropertyDescriptor(f,a):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(E,f,a,m);else for(var I=E.length-1;I>=0;I--)(p=E[I])&&(k=(d<3?p(k):d>3?p(f,a,k):p(f,a))||k);return d>3&&k&&Object.defineProperty(f,a,k),k},v=this&&this.__param||function(E,f){return function(a,m){f(a,m,E)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const h=c(4725),y=c(9806);let S=r.MouseService=class{constructor(E,f){this._renderService=E,this._charSizeService=f}getCoords(E,f,a,m,p){return(0,y.getCoords)(window,E,f,a,m,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,p)}getMouseReportCoords(E,f){const a=(0,y.getCoordsRelativeToElement)(window,E,f);if(this._charSizeService.hasValidSize)return a[0]=Math.min(Math.max(a[0],0),this._renderService.dimensions.css.canvas.width-1),a[1]=Math.min(Math.max(a[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(a[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(a[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(a[0]),y:Math.floor(a[1])}}};r.MouseService=S=g([v(0,h.IRenderService),v(1,h.ICharSizeService)],S)},3230:function(x,r,c){var g=this&&this.__decorate||function(p,d,k,I){var L,M=arguments.length,b=M<3?d:I===null?I=Object.getOwnPropertyDescriptor(d,k):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(p,d,k,I);else for(var T=p.length-1;T>=0;T--)(L=p[T])&&(b=(M<3?L(b):M>3?L(d,k,b):L(d,k))||b);return M>3&&b&&Object.defineProperty(d,k,b),b},v=this&&this.__param||function(p,d){return function(k,I){d(k,I,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const h=c(6193),y=c(4725),S=c(8460),E=c(844),f=c(7226),a=c(2585);let m=r.RenderService=class extends E.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(p,d,k,I,L,M,b,T){super(),this._rowCount=p,this._charSizeService=I,this._renderer=this.register(new E.MutableDisposable),this._pausedResizeTask=new f.DebouncedIdleTask,this._observerDisposable=this.register(new E.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new S.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new S.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new S.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new S.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer(((N,O)=>this._renderRows(N,O)),b),this.register(this._renderDebouncer),this.register(b.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>{var N;return(N=this._renderer.value)==null?void 0:N.clear()}))),this.register(k.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(L.onDecorationRegistered((()=>this._fullRefresh()))),this.register(L.onDecorationRemoved((()=>this._fullRefresh()))),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(T.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(b.window,d),this.register(b.onWindowChange((N=>this._registerIntersectionObserver(N,d))))}_registerIntersectionObserver(p,d){if("IntersectionObserver"in p){const k=new p.IntersectionObserver((I=>this._handleIntersectionChange(I[I.length-1])),{threshold:0});k.observe(d),this._observerDisposable.value=(0,E.toDisposable)((()=>k.disconnect()))}}_handleIntersectionChange(p){this._isPaused=p.isIntersecting===void 0?p.intersectionRatio===0:!p.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(p,d,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(p,d,this._rowCount))}_renderRows(p,d){this._renderer.value&&(p=Math.min(p,this._rowCount-1),d=Math.min(d,this._rowCount-1),this._renderer.value.renderRows(p,d),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:p,end:d}),this._onRender.fire({start:p,end:d}),this._isNextRenderRedrawOnly=!0)}resize(p,d){this._rowCount=d,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(p){this._renderer.value=p,this._renderer.value&&(this._renderer.value.onRequestRedraw((d=>this.refreshRows(d.start,d.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(p){return this._renderDebouncer.addRefreshCallback(p)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var p,d;this._renderer.value&&((d=(p=this._renderer.value).clearTextureAtlas)==null||d.call(p),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(p,d){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var k;return(k=this._renderer.value)==null?void 0:k.handleResize(p,d)})):this._renderer.value.handleResize(p,d),this._fullRefresh())}handleCharSizeChanged(){var p;(p=this._renderer.value)==null||p.handleCharSizeChanged()}handleBlur(){var p;(p=this._renderer.value)==null||p.handleBlur()}handleFocus(){var p;(p=this._renderer.value)==null||p.handleFocus()}handleSelectionChanged(p,d,k){var I;this._selectionState.start=p,this._selectionState.end=d,this._selectionState.columnSelectMode=k,(I=this._renderer.value)==null||I.handleSelectionChanged(p,d,k)}handleCursorMove(){var p;(p=this._renderer.value)==null||p.handleCursorMove()}clear(){var p;(p=this._renderer.value)==null||p.clear()}};r.RenderService=m=g([v(2,a.IOptionsService),v(3,y.ICharSizeService),v(4,a.IDecorationService),v(5,a.IBufferService),v(6,y.ICoreBrowserService),v(7,y.IThemeService)],m)},9312:function(x,r,c){var g=this&&this.__decorate||function(b,T,N,O){var B,F=arguments.length,U=F<3?T:O===null?O=Object.getOwnPropertyDescriptor(T,N):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(b,T,N,O);else for(var V=b.length-1;V>=0;V--)(B=b[V])&&(U=(F<3?B(U):F>3?B(T,N,U):B(T,N))||U);return F>3&&U&&Object.defineProperty(T,N,U),U},v=this&&this.__param||function(b,T){return function(N,O){T(N,O,b)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const h=c(9806),y=c(9504),S=c(456),E=c(4725),f=c(8460),a=c(844),m=c(6114),p=c(4841),d=c(511),k=c(2585),I=" ",L=new RegExp(I,"g");let M=r.SelectionService=class extends a.Disposable{constructor(b,T,N,O,B,F,U,V,X){super(),this._element=b,this._screenElement=T,this._linkifier=N,this._bufferService=O,this._coreService=B,this._mouseService=F,this._optionsService=U,this._renderService=V,this._coreBrowserService=X,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new d.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 S.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,a.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 b=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!(!b||!T||b[0]===T[0]&&b[1]===T[1])}get selectionText(){const b=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;if(!b||!T)return"";const N=this._bufferService.buffer,O=[];if(this._activeSelectionMode===3){if(b[0]===T[0])return"";const B=b[0]<T[0]?b[0]:T[0],F=b[0]<T[0]?T[0]:b[0];for(let U=b[1];U<=T[1];U++){const V=N.translateBufferLineToString(U,!0,B,F);O.push(V)}}else{const B=b[1]===T[1]?T[0]:void 0;O.push(N.translateBufferLineToString(b[1],!0,b[0],B));for(let F=b[1]+1;F<=T[1]-1;F++){const U=N.lines.get(F),V=N.translateBufferLineToString(F,!0);U!=null&&U.isWrapped?O[O.length-1]+=V:O.push(V)}if(b[1]!==T[1]){const F=N.lines.get(T[1]),U=N.translateBufferLineToString(T[1],!0,0,T[0]);F&&F.isWrapped?O[O.length-1]+=U:O.push(U)}}return O.map((B=>B.replace(L," "))).join(m.isWindows?`\r
113
- `:`
114
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(b){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),m.isLinux&&b&&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(b){const T=this._getMouseBufferCoords(b),N=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!!(N&&O&&T)&&this._areCoordsInSelection(T,N,O)}isCellInSelection(b,T){const N=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!N||!O)&&this._areCoordsInSelection([b,T],N,O)}_areCoordsInSelection(b,T,N){return b[1]>T[1]&&b[1]<N[1]||T[1]===N[1]&&b[1]===T[1]&&b[0]>=T[0]&&b[0]<N[0]||T[1]<N[1]&&b[1]===N[1]&&b[0]<N[0]||T[1]<N[1]&&b[1]===T[1]&&b[0]>=T[0]}_selectWordAtCursor(b,T){var B,F;const N=(F=(B=this._linkifier.currentLink)==null?void 0:B.link)==null?void 0:F.range;if(N)return this._model.selectionStart=[N.start.x-1,N.start.y-1],this._model.selectionStartLength=(0,p.getRangeLength)(N,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const O=this._getMouseBufferCoords(b);return!!O&&(this._selectWordAt(O,T),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(b,T){this._model.clearSelection(),b=Math.max(b,0),T=Math.min(T,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,b],this._model.selectionEnd=[this._bufferService.cols,T],this.refresh(),this._onSelectionChange.fire()}_handleTrim(b){this._model.handleTrim(b)&&this.refresh()}_getMouseBufferCoords(b){const T=this._mouseService.getCoords(b,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(T)return T[0]--,T[1]--,T[1]+=this._bufferService.buffer.ydisp,T}_getMouseEventScrollAmount(b){let T=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,b,this._screenElement)[1];const N=this._renderService.dimensions.css.canvas.height;return T>=0&&T<=N?0:(T>N&&(T-=N),T=Math.min(Math.max(T,-50),50),T/=50,T/Math.abs(T)+Math.round(14*T))}shouldForceSelection(b){return m.isMac?b.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:b.shiftKey}handleMouseDown(b){if(this._mouseDownTimeStamp=b.timeStamp,(b.button!==2||!this.hasSelection)&&b.button===0){if(!this._enabled){if(!this.shouldForceSelection(b))return;b.stopPropagation()}b.preventDefault(),this._dragScrollAmount=0,this._enabled&&b.shiftKey?this._handleIncrementalClick(b):b.detail===1?this._handleSingleClick(b):b.detail===2?this._handleDoubleClick(b):b.detail===3&&this._handleTripleClick(b),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(b){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(b))}_handleSingleClick(b){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(b)?3:0,this._model.selectionStart=this._getMouseBufferCoords(b),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const T=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);T&&T.length!==this._model.selectionStart[0]&&T.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(b){this._selectWordAtCursor(b,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(b){const T=this._getMouseBufferCoords(b);T&&(this._activeSelectionMode=2,this._selectLineAt(T[1]))}shouldColumnSelect(b){return b.altKey&&!(m.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(b){if(b.stopImmediatePropagation(),!this._model.selectionStart)return;const T=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(b),!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(b),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const N=this._bufferService.buffer;if(this._model.selectionEnd[1]<N.lines.length){const O=N.lines.get(this._model.selectionEnd[1]);O&&O.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}T&&T[0]===this._model.selectionEnd[0]&&T[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 b=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(b.ydisp+this._bufferService.rows,b.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=b.ydisp),this.refresh()}}_handleMouseUp(b){const T=b.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&T<500&&b.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const N=this._mouseService.getCoords(b,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(N&&N[0]!==void 0&&N[1]!==void 0){const O=(0,y.moveToCellSequence)(N[0]-1,N[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(O,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const b=this._model.finalSelectionStart,T=this._model.finalSelectionEnd,N=!(!b||!T||b[0]===T[0]&&b[1]===T[1]);N?b&&T&&(this._oldSelectionStart&&this._oldSelectionEnd&&b[0]===this._oldSelectionStart[0]&&b[1]===this._oldSelectionStart[1]&&T[0]===this._oldSelectionEnd[0]&&T[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(b,T,N)):this._oldHasSelection&&this._fireOnSelectionChange(b,T,N)}_fireOnSelectionChange(b,T,N){this._oldSelectionStart=b,this._oldSelectionEnd=T,this._oldHasSelection=N,this._onSelectionChange.fire()}_handleBufferActivate(b){this.clearSelection(),this._trimListener.dispose(),this._trimListener=b.activeBuffer.lines.onTrim((T=>this._handleTrim(T)))}_convertViewportColToCharacterIndex(b,T){let N=T;for(let O=0;T>=O;O++){const B=b.loadCell(O,this._workCell).getChars().length;this._workCell.getWidth()===0?N--:B>1&&T!==O&&(N+=B-1)}return N}setSelection(b,T,N){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[b,T],this._model.selectionStartLength=N,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(b){this._isClickInSelection(b)||(this._selectWordAtCursor(b,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(b,T,N=!0,O=!0){if(b[0]>=this._bufferService.cols)return;const B=this._bufferService.buffer,F=B.lines.get(b[1]);if(!F)return;const U=B.translateBufferLineToString(b[1],!1);let V=this._convertViewportColToCharacterIndex(F,b[0]),X=V;const Y=b[0]-V;let q=0,D=0,$=0,H=0;if(U.charAt(V)===" "){for(;V>0&&U.charAt(V-1)===" ";)V--;for(;X<U.length&&U.charAt(X+1)===" ";)X++}else{let re=b[0],ae=b[0];F.getWidth(re)===0&&(q++,re--),F.getWidth(ae)===2&&(D++,ae++);const ue=F.getString(ae).length;for(ue>1&&(H+=ue-1,X+=ue-1);re>0&&V>0&&!this._isCharWordSeparator(F.loadCell(re-1,this._workCell));){F.loadCell(re-1,this._workCell);const G=this._workCell.getChars().length;this._workCell.getWidth()===0?(q++,re--):G>1&&($+=G-1,V-=G-1),V--,re--}for(;ae<F.length&&X+1<U.length&&!this._isCharWordSeparator(F.loadCell(ae+1,this._workCell));){F.loadCell(ae+1,this._workCell);const G=this._workCell.getChars().length;this._workCell.getWidth()===2?(D++,ae++):G>1&&(H+=G-1,X+=G-1),X++,ae++}}X++;let K=V+Y-q+$,te=Math.min(this._bufferService.cols,X-V+q+D-$-H);if(T||U.slice(V,X).trim()!==""){if(N&&K===0&&F.getCodePoint(0)!==32){const re=B.lines.get(b[1]-1);if(re&&F.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const ae=this._getWordAt([this._bufferService.cols-1,b[1]-1],!1,!0,!1);if(ae){const ue=this._bufferService.cols-ae.start;K-=ue,te+=ue}}}if(O&&K+te===this._bufferService.cols&&F.getCodePoint(this._bufferService.cols-1)!==32){const re=B.lines.get(b[1]+1);if(re!=null&&re.isWrapped&&re.getCodePoint(0)!==32){const ae=this._getWordAt([0,b[1]+1],!1,!1,!0);ae&&(te+=ae.length)}}return{start:K,length:te}}}_selectWordAt(b,T){const N=this._getWordAt(b,T);if(N){for(;N.start<0;)N.start+=this._bufferService.cols,b[1]--;this._model.selectionStart=[N.start,b[1]],this._model.selectionStartLength=N.length}}_selectToWordAt(b){const T=this._getWordAt(b,!0);if(T){let N=b[1];for(;T.start<0;)T.start+=this._bufferService.cols,N--;if(!this._model.areSelectionValuesReversed())for(;T.start+T.length>this._bufferService.cols;)T.length-=this._bufferService.cols,N++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?T.start:T.start+T.length,N]}}_isCharWordSeparator(b){return b.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(b.getChars())>=0}_selectLineAt(b){const T=this._bufferService.buffer.getWrappedRangeForLine(b),N={start:{x:0,y:T.first},end:{x:this._bufferService.cols-1,y:T.last}};this._model.selectionStart=[0,T.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,p.getRangeLength)(N,this._bufferService.cols)}};r.SelectionService=M=g([v(3,k.IBufferService),v(4,k.ICoreService),v(5,E.IMouseService),v(6,k.IOptionsService),v(7,E.IRenderService),v(8,E.ICoreBrowserService)],M)},4725:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ILinkProviderService=r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const g=c(8343);r.ICharSizeService=(0,g.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,g.createDecorator)("CoreBrowserService"),r.IMouseService=(0,g.createDecorator)("MouseService"),r.IRenderService=(0,g.createDecorator)("RenderService"),r.ISelectionService=(0,g.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,g.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,g.createDecorator)("ThemeService"),r.ILinkProviderService=(0,g.createDecorator)("LinkProviderService")},6731:function(x,r,c){var g=this&&this.__decorate||function(M,b,T,N){var O,B=arguments.length,F=B<3?b:N===null?N=Object.getOwnPropertyDescriptor(b,T):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(M,b,T,N);else for(var U=M.length-1;U>=0;U--)(O=M[U])&&(F=(B<3?O(F):B>3?O(b,T,F):O(b,T))||F);return B>3&&F&&Object.defineProperty(b,T,F),F},v=this&&this.__param||function(M,b){return function(T,N){b(T,N,M)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const h=c(7239),y=c(8055),S=c(8460),E=c(844),f=c(2585),a=y.css.toColor("#ffffff"),m=y.css.toColor("#000000"),p=y.css.toColor("#ffffff"),d=y.css.toColor("#000000"),k={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[y.css.toColor("#2e3436"),y.css.toColor("#cc0000"),y.css.toColor("#4e9a06"),y.css.toColor("#c4a000"),y.css.toColor("#3465a4"),y.css.toColor("#75507b"),y.css.toColor("#06989a"),y.css.toColor("#d3d7cf"),y.css.toColor("#555753"),y.css.toColor("#ef2929"),y.css.toColor("#8ae234"),y.css.toColor("#fce94f"),y.css.toColor("#729fcf"),y.css.toColor("#ad7fa8"),y.css.toColor("#34e2e2"),y.css.toColor("#eeeeec")],b=[0,95,135,175,215,255];for(let T=0;T<216;T++){const N=b[T/36%6|0],O=b[T/6%6|0],B=b[T%6];M.push({css:y.channels.toCss(N,O,B),rgba:y.channels.toRgba(N,O,B)})}for(let T=0;T<24;T++){const N=8+10*T;M.push({css:y.channels.toCss(N,N,N),rgba:y.channels.toRgba(N,N,N)})}return M})());let I=r.ThemeService=class extends E.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:a,background:m,cursor:p,cursorAccent:d,selectionForeground:void 0,selectionBackgroundTransparent:k,selectionBackgroundOpaque:y.color.blend(m,k),selectionInactiveBackgroundTransparent:k,selectionInactiveBackgroundOpaque:y.color.blend(m,k),ansi:r.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(M={}){const b=this._colors;if(b.foreground=L(M.foreground,a),b.background=L(M.background,m),b.cursor=L(M.cursor,p),b.cursorAccent=L(M.cursorAccent,d),b.selectionBackgroundTransparent=L(M.selectionBackground,k),b.selectionBackgroundOpaque=y.color.blend(b.background,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundTransparent=L(M.selectionInactiveBackground,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundOpaque=y.color.blend(b.background,b.selectionInactiveBackgroundTransparent),b.selectionForeground=M.selectionForeground?L(M.selectionForeground,y.NULL_COLOR):void 0,b.selectionForeground===y.NULL_COLOR&&(b.selectionForeground=void 0),y.color.isOpaque(b.selectionBackgroundTransparent)&&(b.selectionBackgroundTransparent=y.color.opacity(b.selectionBackgroundTransparent,.3)),y.color.isOpaque(b.selectionInactiveBackgroundTransparent)&&(b.selectionInactiveBackgroundTransparent=y.color.opacity(b.selectionInactiveBackgroundTransparent,.3)),b.ansi=r.DEFAULT_ANSI_COLORS.slice(),b.ansi[0]=L(M.black,r.DEFAULT_ANSI_COLORS[0]),b.ansi[1]=L(M.red,r.DEFAULT_ANSI_COLORS[1]),b.ansi[2]=L(M.green,r.DEFAULT_ANSI_COLORS[2]),b.ansi[3]=L(M.yellow,r.DEFAULT_ANSI_COLORS[3]),b.ansi[4]=L(M.blue,r.DEFAULT_ANSI_COLORS[4]),b.ansi[5]=L(M.magenta,r.DEFAULT_ANSI_COLORS[5]),b.ansi[6]=L(M.cyan,r.DEFAULT_ANSI_COLORS[6]),b.ansi[7]=L(M.white,r.DEFAULT_ANSI_COLORS[7]),b.ansi[8]=L(M.brightBlack,r.DEFAULT_ANSI_COLORS[8]),b.ansi[9]=L(M.brightRed,r.DEFAULT_ANSI_COLORS[9]),b.ansi[10]=L(M.brightGreen,r.DEFAULT_ANSI_COLORS[10]),b.ansi[11]=L(M.brightYellow,r.DEFAULT_ANSI_COLORS[11]),b.ansi[12]=L(M.brightBlue,r.DEFAULT_ANSI_COLORS[12]),b.ansi[13]=L(M.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),b.ansi[14]=L(M.brightCyan,r.DEFAULT_ANSI_COLORS[14]),b.ansi[15]=L(M.brightWhite,r.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const T=Math.min(b.ansi.length-16,M.extendedAnsi.length);for(let N=0;N<T;N++)b.ansi[N+16]=L(M.extendedAnsi[N],r.DEFAULT_ANSI_COLORS[N+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(M){this._restoreColor(M),this._onChangeColors.fire(this.colors)}_restoreColor(M){if(M!==void 0)switch(M){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[M]=this._restoreColors.ansi[M]}else for(let b=0;b<this._restoreColors.ansi.length;++b)this._colors.ansi[b]=this._restoreColors.ansi[b]}modifyColors(M){M(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 L(M,b){if(M!==void 0)try{return y.css.toColor(M)}catch{}return b}r.ThemeService=I=g([v(0,f.IOptionsService)],I)},6349:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const g=c(8460),v=c(844);class h extends v.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new g.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new g.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new g.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(S){if(this._maxLength===S)return;const E=new Array(S);for(let f=0;f<Math.min(S,this.length);f++)E[f]=this._array[this._getCyclicIndex(f)];this._array=E,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let E=this._length;E<S;E++)this._array[E]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,E){this._array[this._getCyclicIndex(S)]=E}push(S){this._array[this._getCyclicIndex(this._length)]=S,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(S,E,...f){if(E){for(let a=S;a<this._length-E;a++)this._array[this._getCyclicIndex(a)]=this._array[this._getCyclicIndex(a+E)];this._length-=E,this.onDeleteEmitter.fire({index:S,amount:E})}for(let a=this._length-1;a>=S;a--)this._array[this._getCyclicIndex(a+f.length)]=this._array[this._getCyclicIndex(a)];for(let a=0;a<f.length;a++)this._array[this._getCyclicIndex(S+a)]=f[a];if(f.length&&this.onInsertEmitter.fire({index:S,amount:f.length}),this._length+f.length>this._maxLength){const a=this._length+f.length-this._maxLength;this._startIndex+=a,this._length=this._maxLength,this.onTrimEmitter.fire(a)}else this._length+=f.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,E,f){if(!(E<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+f<0)throw new Error("Cannot shift elements in list beyond index 0");if(f>0){for(let m=E-1;m>=0;m--)this.set(S+m+f,this.get(S+m));const a=S+E+f-this._length;if(a>0)for(this._length+=a;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let a=0;a<E;a++)this.set(S+a+f,this.get(S+a))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}r.CircularList=h},1439:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function c(g,v=5){if(typeof g!="object")return g;const h=Array.isArray(g)?[]:{};for(const y in g)h[y]=v<=1?g[y]:g[y]&&c(g[y],v-1);return h}},8055:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;let c=0,g=0,v=0,h=0;var y,S,E,f,a;function m(d){const k=d.toString(16);return k.length<2?"0"+k:k}function p(d,k){return d<k?(k+.05)/(d+.05):(d+.05)/(k+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(d){d.toCss=function(k,I,L,M){return M!==void 0?`#${m(k)}${m(I)}${m(L)}${m(M)}`:`#${m(k)}${m(I)}${m(L)}`},d.toRgba=function(k,I,L,M=255){return(k<<24|I<<16|L<<8|M)>>>0},d.toColor=function(k,I,L,M){return{css:d.toCss(k,I,L,M),rgba:d.toRgba(k,I,L,M)}}})(y||(r.channels=y={})),(function(d){function k(I,L){return h=Math.round(255*L),[c,g,v]=a.toChannels(I.rgba),{css:y.toCss(c,g,v,h),rgba:y.toRgba(c,g,v,h)}}d.blend=function(I,L){if(h=(255&L.rgba)/255,h===1)return{css:L.css,rgba:L.rgba};const M=L.rgba>>24&255,b=L.rgba>>16&255,T=L.rgba>>8&255,N=I.rgba>>24&255,O=I.rgba>>16&255,B=I.rgba>>8&255;return c=N+Math.round((M-N)*h),g=O+Math.round((b-O)*h),v=B+Math.round((T-B)*h),{css:y.toCss(c,g,v),rgba:y.toRgba(c,g,v)}},d.isOpaque=function(I){return(255&I.rgba)==255},d.ensureContrastRatio=function(I,L,M){const b=a.ensureContrastRatio(I.rgba,L.rgba,M);if(b)return y.toColor(b>>24&255,b>>16&255,b>>8&255)},d.opaque=function(I){const L=(255|I.rgba)>>>0;return[c,g,v]=a.toChannels(L),{css:y.toCss(c,g,v),rgba:L}},d.opacity=k,d.multiplyOpacity=function(I,L){return h=255&I.rgba,k(I,h*L/255)},d.toColorRGB=function(I){return[I.rgba>>24&255,I.rgba>>16&255,I.rgba>>8&255]}})(S||(r.color=S={})),(function(d){let k,I;try{const L=document.createElement("canvas");L.width=1,L.height=1;const M=L.getContext("2d",{willReadFrequently:!0});M&&(k=M,k.globalCompositeOperation="copy",I=k.createLinearGradient(0,0,1,1))}catch{}d.toColor=function(L){if(L.match(/#[\da-f]{3,8}/i))switch(L.length){case 4:return c=parseInt(L.slice(1,2).repeat(2),16),g=parseInt(L.slice(2,3).repeat(2),16),v=parseInt(L.slice(3,4).repeat(2),16),y.toColor(c,g,v);case 5:return c=parseInt(L.slice(1,2).repeat(2),16),g=parseInt(L.slice(2,3).repeat(2),16),v=parseInt(L.slice(3,4).repeat(2),16),h=parseInt(L.slice(4,5).repeat(2),16),y.toColor(c,g,v,h);case 7:return{css:L,rgba:(parseInt(L.slice(1),16)<<8|255)>>>0};case 9:return{css:L,rgba:parseInt(L.slice(1),16)>>>0}}const M=L.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return c=parseInt(M[1]),g=parseInt(M[2]),v=parseInt(M[3]),h=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),y.toColor(c,g,v,h);if(!k||!I)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=I,k.fillStyle=L,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[c,g,v,h]=k.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(c,g,v,h),css:L}}})(E||(r.css=E={})),(function(d){function k(I,L,M){const b=I/255,T=L/255,N=M/255;return .2126*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.7152*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.0722*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))}d.relativeLuminance=function(I){return k(I>>16&255,I>>8&255,255&I)},d.relativeLuminance2=k})(f||(r.rgb=f={})),(function(d){function k(L,M,b){const T=L>>24&255,N=L>>16&255,O=L>>8&255;let B=M>>24&255,F=M>>16&255,U=M>>8&255,V=p(f.relativeLuminance2(B,F,U),f.relativeLuminance2(T,N,O));for(;V<b&&(B>0||F>0||U>0);)B-=Math.max(0,Math.ceil(.1*B)),F-=Math.max(0,Math.ceil(.1*F)),U-=Math.max(0,Math.ceil(.1*U)),V=p(f.relativeLuminance2(B,F,U),f.relativeLuminance2(T,N,O));return(B<<24|F<<16|U<<8|255)>>>0}function I(L,M,b){const T=L>>24&255,N=L>>16&255,O=L>>8&255;let B=M>>24&255,F=M>>16&255,U=M>>8&255,V=p(f.relativeLuminance2(B,F,U),f.relativeLuminance2(T,N,O));for(;V<b&&(B<255||F<255||U<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),F=Math.min(255,F+Math.ceil(.1*(255-F))),U=Math.min(255,U+Math.ceil(.1*(255-U))),V=p(f.relativeLuminance2(B,F,U),f.relativeLuminance2(T,N,O));return(B<<24|F<<16|U<<8|255)>>>0}d.blend=function(L,M){if(h=(255&M)/255,h===1)return M;const b=M>>24&255,T=M>>16&255,N=M>>8&255,O=L>>24&255,B=L>>16&255,F=L>>8&255;return c=O+Math.round((b-O)*h),g=B+Math.round((T-B)*h),v=F+Math.round((N-F)*h),y.toRgba(c,g,v)},d.ensureContrastRatio=function(L,M,b){const T=f.relativeLuminance(L>>8),N=f.relativeLuminance(M>>8);if(p(T,N)<b){if(N<T){const F=k(L,M,b),U=p(T,f.relativeLuminance(F>>8));if(U<b){const V=I(L,M,b);return U>p(T,f.relativeLuminance(V>>8))?F:V}return F}const O=I(L,M,b),B=p(T,f.relativeLuminance(O>>8));if(B<b){const F=k(L,M,b);return B>p(T,f.relativeLuminance(F>>8))?O:F}return O}},d.reduceLuminance=k,d.increaseLuminance=I,d.toChannels=function(L){return[L>>24&255,L>>16&255,L>>8&255,255&L]}})(a||(r.rgba=a={})),r.toPaddedHex=m,r.contrastRatio=p},8969:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const g=c(844),v=c(2585),h=c(4348),y=c(7866),S=c(744),E=c(7302),f=c(6975),a=c(8460),m=c(1753),p=c(1480),d=c(7994),k=c(9282),I=c(5435),L=c(5981),M=c(2660);let b=!1;class T extends g.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new a.EventEmitter),this._onScroll.event((O=>{var B;(B=this._onScrollApi)==null||B.fire(O.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(O){for(const B in O)this.optionsService.options[B]=O[B]}constructor(O){super(),this._windowsWrappingHeuristics=this.register(new g.MutableDisposable),this._onBinary=this.register(new a.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new a.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new a.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new a.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new E.OptionsService(O)),this._instantiationService.setService(v.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(v.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(y.LogService)),this._instantiationService.setService(v.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(f.CoreService)),this._instantiationService.setService(v.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(m.CoreMouseService)),this._instantiationService.setService(v.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(p.UnicodeService)),this._instantiationService.setService(v.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(d.CharsetService),this._instantiationService.setService(v.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(v.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new I.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,a.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,a.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,a.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,a.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((B=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((B=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new L.WriteBuffer(((B,F)=>this._inputHandler.parse(B,F)))),this.register((0,a.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(O,B){this._writeBuffer.write(O,B)}writeSync(O,B){this._logService.logLevel<=v.LogLevelEnum.WARN&&!b&&(this._logService.warn("writeSync is unreliable and will be removed soon."),b=!0),this._writeBuffer.writeSync(O,B)}input(O,B=!0){this.coreService.triggerDataEvent(O,B)}resize(O,B){isNaN(O)||isNaN(B)||(O=Math.max(O,S.MINIMUM_COLS),B=Math.max(B,S.MINIMUM_ROWS),this._bufferService.resize(O,B))}scroll(O,B=!1){this._bufferService.scroll(O,B)}scrollLines(O,B,F){this._bufferService.scrollLines(O,B,F)}scrollPages(O){this.scrollLines(O*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(O){const B=O-this._bufferService.buffer.ydisp;B!==0&&this.scrollLines(B)}registerEscHandler(O,B){return this._inputHandler.registerEscHandler(O,B)}registerDcsHandler(O,B){return this._inputHandler.registerDcsHandler(O,B)}registerCsiHandler(O,B){return this._inputHandler.registerCsiHandler(O,B)}registerOscHandler(O,B){return this._inputHandler.registerOscHandler(O,B)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let O=!1;const B=this.optionsService.rawOptions.windowsPty;B&&B.buildNumber!==void 0&&B.buildNumber!==void 0?O=B.backend==="conpty"&&B.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(O=!0),O?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const O=[];O.push(this.onLineFeed(k.updateWindowsModeWrappedState.bind(null,this._bufferService))),O.push(this.registerCsiHandler({final:"H"},(()=>((0,k.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,g.toDisposable)((()=>{for(const B of O)B.dispose()}))}}}r.CoreTerminal=T},8460:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.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 g=0;g<this._listeners.length;g++)if(this._listeners[g]===c)return void this._listeners.splice(g,1)}}})),this._event}fire(c,g){const v=[];for(let h=0;h<this._listeners.length;h++)v.push(this._listeners[h]);for(let h=0;h<v.length;h++)v[h].call(void 0,c,g)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(c,g){return c((v=>g.fire(v)))},r.runAndSubscribe=function(c,g){return g(void 0),c((v=>g(v)))}},5435:function(x,r,c){var g=this&&this.__decorate||function(q,D,$,H){var K,te=arguments.length,re=te<3?D:H===null?H=Object.getOwnPropertyDescriptor(D,$):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(q,D,$,H);else for(var ae=q.length-1;ae>=0;ae--)(K=q[ae])&&(re=(te<3?K(re):te>3?K(D,$,re):K(D,$))||re);return te>3&&re&&Object.defineProperty(D,$,re),re},v=this&&this.__param||function(q,D){return function($,H){D($,H,q)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const h=c(2584),y=c(7116),S=c(2015),E=c(844),f=c(482),a=c(8437),m=c(8460),p=c(643),d=c(511),k=c(3734),I=c(2585),L=c(1480),M=c(6242),b=c(6351),T=c(5941),N={"(":0,")":1,"*":2,"+":3,"-":1,".":2},O=131072;function B(q,D){if(q>24)return D.setWinLines||!1;switch(q){case 1:return!!D.restoreWin;case 2:return!!D.minimizeWin;case 3:return!!D.setWinPosition;case 4:return!!D.setWinSizePixels;case 5:return!!D.raiseWin;case 6:return!!D.lowerWin;case 7:return!!D.refreshWin;case 8:return!!D.setWinSizeChars;case 9:return!!D.maximizeWin;case 10:return!!D.fullscreenWin;case 11:return!!D.getWinState;case 13:return!!D.getWinPosition;case 14:return!!D.getWinSizePixels;case 15:return!!D.getScreenSizePixels;case 16:return!!D.getCellSizePixels;case 18:return!!D.getWinSizeChars;case 19:return!!D.getScreenSizeChars;case 20:return!!D.getIconTitle;case 21:return!!D.getWinTitle;case 22:return!!D.pushTitle;case 23:return!!D.popTitle;case 24:return!!D.setWinLines}return!1}var F;(function(q){q[q.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",q[q.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(F||(r.WindowsOptionsReportType=F={}));let U=0;class V extends E.Disposable{getAttrData(){return this._curAttrData}constructor(D,$,H,K,te,re,ae,ue,G=new S.EscapeSequenceParser){super(),this._bufferService=D,this._charsetService=$,this._coreService=H,this._logService=K,this._optionsService=te,this._oscLinkService=re,this._coreMouseService=ae,this._unicodeService=ue,this._parser=G,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new f.StringToUtf32,this._utf8Decoder=new f.Utf8ToUtf32,this._workCell=new d.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new m.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new m.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new m.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new m.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new m.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new m.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new m.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new m.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new m.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new m.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new m.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new m.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new m.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 X(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((W=>this._activeBuffer=W.activeBuffer))),this._parser.setCsiHandlerFallback(((W,J)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(W),params:J.toArray()})})),this._parser.setEscHandlerFallback((W=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(W)})})),this._parser.setExecuteHandlerFallback((W=>{this._logService.debug("Unknown EXECUTE code: ",{code:W})})),this._parser.setOscHandlerFallback(((W,J,Z)=>{this._logService.debug("Unknown OSC code: ",{identifier:W,action:J,data:Z})})),this._parser.setDcsHandlerFallback(((W,J,Z)=>{J==="HOOK"&&(Z=Z.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(W),action:J,payload:Z})})),this._parser.setPrintHandler(((W,J,Z)=>this.print(W,J,Z))),this._parser.registerCsiHandler({final:"@"},(W=>this.insertChars(W))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(W=>this.scrollLeft(W))),this._parser.registerCsiHandler({final:"A"},(W=>this.cursorUp(W))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(W=>this.scrollRight(W))),this._parser.registerCsiHandler({final:"B"},(W=>this.cursorDown(W))),this._parser.registerCsiHandler({final:"C"},(W=>this.cursorForward(W))),this._parser.registerCsiHandler({final:"D"},(W=>this.cursorBackward(W))),this._parser.registerCsiHandler({final:"E"},(W=>this.cursorNextLine(W))),this._parser.registerCsiHandler({final:"F"},(W=>this.cursorPrecedingLine(W))),this._parser.registerCsiHandler({final:"G"},(W=>this.cursorCharAbsolute(W))),this._parser.registerCsiHandler({final:"H"},(W=>this.cursorPosition(W))),this._parser.registerCsiHandler({final:"I"},(W=>this.cursorForwardTab(W))),this._parser.registerCsiHandler({final:"J"},(W=>this.eraseInDisplay(W,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(W=>this.eraseInDisplay(W,!0))),this._parser.registerCsiHandler({final:"K"},(W=>this.eraseInLine(W,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(W=>this.eraseInLine(W,!0))),this._parser.registerCsiHandler({final:"L"},(W=>this.insertLines(W))),this._parser.registerCsiHandler({final:"M"},(W=>this.deleteLines(W))),this._parser.registerCsiHandler({final:"P"},(W=>this.deleteChars(W))),this._parser.registerCsiHandler({final:"S"},(W=>this.scrollUp(W))),this._parser.registerCsiHandler({final:"T"},(W=>this.scrollDown(W))),this._parser.registerCsiHandler({final:"X"},(W=>this.eraseChars(W))),this._parser.registerCsiHandler({final:"Z"},(W=>this.cursorBackwardTab(W))),this._parser.registerCsiHandler({final:"`"},(W=>this.charPosAbsolute(W))),this._parser.registerCsiHandler({final:"a"},(W=>this.hPositionRelative(W))),this._parser.registerCsiHandler({final:"b"},(W=>this.repeatPrecedingCharacter(W))),this._parser.registerCsiHandler({final:"c"},(W=>this.sendDeviceAttributesPrimary(W))),this._parser.registerCsiHandler({prefix:">",final:"c"},(W=>this.sendDeviceAttributesSecondary(W))),this._parser.registerCsiHandler({final:"d"},(W=>this.linePosAbsolute(W))),this._parser.registerCsiHandler({final:"e"},(W=>this.vPositionRelative(W))),this._parser.registerCsiHandler({final:"f"},(W=>this.hVPosition(W))),this._parser.registerCsiHandler({final:"g"},(W=>this.tabClear(W))),this._parser.registerCsiHandler({final:"h"},(W=>this.setMode(W))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(W=>this.setModePrivate(W))),this._parser.registerCsiHandler({final:"l"},(W=>this.resetMode(W))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(W=>this.resetModePrivate(W))),this._parser.registerCsiHandler({final:"m"},(W=>this.charAttributes(W))),this._parser.registerCsiHandler({final:"n"},(W=>this.deviceStatus(W))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(W=>this.deviceStatusPrivate(W))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(W=>this.softReset(W))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(W=>this.setCursorStyle(W))),this._parser.registerCsiHandler({final:"r"},(W=>this.setScrollRegion(W))),this._parser.registerCsiHandler({final:"s"},(W=>this.saveCursor(W))),this._parser.registerCsiHandler({final:"t"},(W=>this.windowOptions(W))),this._parser.registerCsiHandler({final:"u"},(W=>this.restoreCursor(W))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(W=>this.insertColumns(W))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(W=>this.deleteColumns(W))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(W=>this.selectProtected(W))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(W=>this.requestMode(W,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(W=>this.requestMode(W,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler((W=>(this.setTitle(W),this.setIconName(W),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((W=>this.setIconName(W)))),this._parser.registerOscHandler(2,new M.OscHandler((W=>this.setTitle(W)))),this._parser.registerOscHandler(4,new M.OscHandler((W=>this.setOrReportIndexedColor(W)))),this._parser.registerOscHandler(8,new M.OscHandler((W=>this.setHyperlink(W)))),this._parser.registerOscHandler(10,new M.OscHandler((W=>this.setOrReportFgColor(W)))),this._parser.registerOscHandler(11,new M.OscHandler((W=>this.setOrReportBgColor(W)))),this._parser.registerOscHandler(12,new M.OscHandler((W=>this.setOrReportCursorColor(W)))),this._parser.registerOscHandler(104,new M.OscHandler((W=>this.restoreIndexedColor(W)))),this._parser.registerOscHandler(110,new M.OscHandler((W=>this.restoreFgColor(W)))),this._parser.registerOscHandler(111,new M.OscHandler((W=>this.restoreBgColor(W)))),this._parser.registerOscHandler(112,new M.OscHandler((W=>this.restoreCursorColor(W)))),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 W in y.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:W},(()=>this.selectCharset("("+W))),this._parser.registerEscHandler({intermediates:")",final:W},(()=>this.selectCharset(")"+W))),this._parser.registerEscHandler({intermediates:"*",final:W},(()=>this.selectCharset("*"+W))),this._parser.registerEscHandler({intermediates:"+",final:W},(()=>this.selectCharset("+"+W))),this._parser.registerEscHandler({intermediates:"-",final:W},(()=>this.selectCharset("-"+W))),this._parser.registerEscHandler({intermediates:".",final:W},(()=>this.selectCharset("."+W))),this._parser.registerEscHandler({intermediates:"/",final:W},(()=>this.selectCharset("/"+W)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((W=>(this._logService.error("Parsing error: ",W),W))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new b.DcsHandler(((W,J)=>this.requestStatusString(W,J))))}_preserveStack(D,$,H,K){this._parseStack.paused=!0,this._parseStack.cursorStartX=D,this._parseStack.cursorStartY=$,this._parseStack.decodedLength=H,this._parseStack.position=K}_logSlowResolvingAsync(D){this._logService.logLevel<=I.LogLevelEnum.WARN&&Promise.race([D,new Promise((($,H)=>setTimeout((()=>H("#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(D,$){let H,K=this._activeBuffer.x,te=this._activeBuffer.y,re=0;const ae=this._parseStack.paused;if(ae){if(H=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,$))return this._logSlowResolvingAsync(H),H;K=this._parseStack.cursorStartX,te=this._parseStack.cursorStartY,this._parseStack.paused=!1,D.length>O&&(re=this._parseStack.position+O)}if(this._logService.logLevel<=I.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof D=="string"?` "${D}"`:` "${Array.prototype.map.call(D,(W=>String.fromCharCode(W))).join("")}"`),typeof D=="string"?D.split("").map((W=>W.charCodeAt(0))):D),this._parseBuffer.length<D.length&&this._parseBuffer.length<O&&(this._parseBuffer=new Uint32Array(Math.min(D.length,O))),ae||this._dirtyRowTracker.clearRange(),D.length>O)for(let W=re;W<D.length;W+=O){const J=W+O<D.length?W+O:D.length,Z=typeof D=="string"?this._stringDecoder.decode(D.substring(W,J),this._parseBuffer):this._utf8Decoder.decode(D.subarray(W,J),this._parseBuffer);if(H=this._parser.parse(this._parseBuffer,Z))return this._preserveStack(K,te,Z,W),this._logSlowResolvingAsync(H),H}else if(!ae){const W=typeof D=="string"?this._stringDecoder.decode(D,this._parseBuffer):this._utf8Decoder.decode(D,this._parseBuffer);if(H=this._parser.parse(this._parseBuffer,W))return this._preserveStack(K,te,W,0),this._logSlowResolvingAsync(H),H}this._activeBuffer.x===K&&this._activeBuffer.y===te||this._onCursorMove.fire();const ue=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),G=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);G<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(G,this._bufferService.rows-1),Math.min(ue,this._bufferService.rows-1))}print(D,$,H){let K,te;const re=this._charsetService.charset,ae=this._optionsService.rawOptions.screenReaderMode,ue=this._bufferService.cols,G=this._coreService.decPrivateModes.wraparound,W=this._coreService.modes.insertMode,J=this._curAttrData;let Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&H-$>0&&Z.getWidth(this._activeBuffer.x-1)===2&&Z.setCellFromCodepoint(this._activeBuffer.x-1,0,1,J);let de=this._parser.precedingJoinState;for(let fe=$;fe<H;++fe){if(K=D[fe],K<127&&re){const Qe=re[String.fromCharCode(K)];Qe&&(K=Qe.charCodeAt(0))}const se=this._unicodeService.charProperties(K,de);te=L.UnicodeService.extractWidth(se);const Ee=L.UnicodeService.extractShouldJoin(se),Me=Ee?L.UnicodeService.extractWidth(de):0;if(de=se,ae&&this._onA11yChar.fire((0,f.stringFromCodePoint)(K)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+te-Me>ue){if(G){const Qe=Z;let Le=this._activeBuffer.x-Me;for(this._activeBuffer.x=Me,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),Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Me>0&&Z instanceof a.BufferLine&&Z.copyCellsFrom(Qe,Le,0,Me,!1);Le<ue;)Qe.setCellFromCodepoint(Le++,0,1,J)}else if(this._activeBuffer.x=ue-1,te===2)continue}if(Ee&&this._activeBuffer.x){const Qe=Z.getWidth(this._activeBuffer.x-1)?1:2;Z.addCodepointToCell(this._activeBuffer.x-Qe,K,te);for(let Le=te-Me;--Le>=0;)Z.setCellFromCodepoint(this._activeBuffer.x++,0,0,J)}else if(W&&(Z.insertCells(this._activeBuffer.x,te-Me,this._activeBuffer.getNullCell(J)),Z.getWidth(ue-1)===2&&Z.setCellFromCodepoint(ue-1,p.NULL_CELL_CODE,p.NULL_CELL_WIDTH,J)),Z.setCellFromCodepoint(this._activeBuffer.x++,K,te,J),te>0)for(;--te;)Z.setCellFromCodepoint(this._activeBuffer.x++,0,0,J)}this._parser.precedingJoinState=de,this._activeBuffer.x<ue&&H-$>0&&Z.getWidth(this._activeBuffer.x)===0&&!Z.hasContent(this._activeBuffer.x)&&Z.setCellFromCodepoint(this._activeBuffer.x,0,1,J),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(D,$){return D.final!=="t"||D.prefix||D.intermediates?this._parser.registerCsiHandler(D,$):this._parser.registerCsiHandler(D,(H=>!B(H.params[0],this._optionsService.rawOptions.windowOptions)||$(H)))}registerDcsHandler(D,$){return this._parser.registerDcsHandler(D,new b.DcsHandler($))}registerEscHandler(D,$){return this._parser.registerEscHandler(D,$)}registerOscHandler(D,$){return this._parser.registerOscHandler(D,new M.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 D;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&&((D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&D.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 D=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-D),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(D=this._bufferService.cols-1){this._activeBuffer.x=Math.min(D,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(D,$){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=D,this._activeBuffer.y=this._activeBuffer.scrollTop+$):(this._activeBuffer.x=D,this._activeBuffer.y=$),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(D,$){this._restrictCursor(),this._setCursor(this._activeBuffer.x+D,this._activeBuffer.y+$)}cursorUp(D){const $=this._activeBuffer.y-this._activeBuffer.scrollTop;return $>=0?this._moveCursor(0,-Math.min($,D.params[0]||1)):this._moveCursor(0,-(D.params[0]||1)),!0}cursorDown(D){const $=this._activeBuffer.scrollBottom-this._activeBuffer.y;return $>=0?this._moveCursor(0,Math.min($,D.params[0]||1)):this._moveCursor(0,D.params[0]||1),!0}cursorForward(D){return this._moveCursor(D.params[0]||1,0),!0}cursorBackward(D){return this._moveCursor(-(D.params[0]||1),0),!0}cursorNextLine(D){return this.cursorDown(D),this._activeBuffer.x=0,!0}cursorPrecedingLine(D){return this.cursorUp(D),this._activeBuffer.x=0,!0}cursorCharAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(D){return this._setCursor(D.length>=2?(D.params[1]||1)-1:0,(D.params[0]||1)-1),!0}charPosAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(D){return this._moveCursor(D.params[0]||1,0),!0}linePosAbsolute(D){return this._setCursor(this._activeBuffer.x,(D.params[0]||1)-1),!0}vPositionRelative(D){return this._moveCursor(0,D.params[0]||1),!0}hVPosition(D){return this.cursorPosition(D),!0}tabClear(D){const $=D.params[0];return $===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:$===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=D.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=D.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(D){const $=D.params[0];return $===1&&(this._curAttrData.bg|=536870912),$!==2&&$!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(D,$,H,K=!1,te=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);re.replaceCells($,H,this._activeBuffer.getNullCell(this._eraseAttrData()),te),K&&(re.isWrapped=!1)}_resetBufferLine(D,$=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);H&&(H.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),$),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+D),H.isWrapped=!1)}eraseInDisplay(D,$=!1){let H;switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:for(H=this._activeBuffer.y,this._dirtyRowTracker.markDirty(H),this._eraseInBufferLine(H++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,$);H<this._bufferService.rows;H++)this._resetBufferLine(H,$);this._dirtyRowTracker.markDirty(H);break;case 1:for(H=this._activeBuffer.y,this._dirtyRowTracker.markDirty(H),this._eraseInBufferLine(H,0,this._activeBuffer.x+1,!0,$),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(H+1).isWrapped=!1);H--;)this._resetBufferLine(H,$);this._dirtyRowTracker.markDirty(0);break;case 2:for(H=this._bufferService.rows,this._dirtyRowTracker.markDirty(H-1);H--;)this._resetBufferLine(H,$);this._dirtyRowTracker.markDirty(0);break;case 3:const K=this._activeBuffer.lines.length-this._bufferService.rows;K>0&&(this._activeBuffer.lines.trimStart(K),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-K,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-K,0),this._onScroll.fire(0))}return!0}eraseInLine(D,$=!1){switch(this._restrictCursor(this._bufferService.cols),D.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(D){this._restrictCursor();let $=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=this._activeBuffer.ybase+this._activeBuffer.y,K=this._bufferService.rows-1-this._activeBuffer.scrollBottom,te=this._bufferService.rows-1+this._activeBuffer.ybase-K+1;for(;$--;)this._activeBuffer.lines.splice(te-1,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(D){this._restrictCursor();let $=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=this._activeBuffer.ybase+this._activeBuffer.y;let K;for(K=this._bufferService.rows-1-this._activeBuffer.scrollBottom,K=this._bufferService.rows-1+this._activeBuffer.ybase-K;$--;)this._activeBuffer.lines.splice(H,1),this._activeBuffer.lines.splice(K,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(D){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.insertCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(D){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.deleteCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(D){let $=D.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(D){let $=D.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(a.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=D.params[0]||1;for(let H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);K.deleteCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData())),K.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=D.params[0]||1;for(let H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);K.insertCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData())),K.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=D.params[0]||1;for(let H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);K.insertCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData())),K.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=D.params[0]||1;for(let H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);K.deleteCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData())),K.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(D){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(D.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(D){const $=this._parser.precedingJoinState;if(!$)return!0;const H=D.params[0]||1,K=L.UnicodeService.extractWidth($),te=this._activeBuffer.x-K,re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(te),ae=new Uint32Array(re.length*H);let ue=0;for(let W=0;W<re.length;){const J=re.codePointAt(W)||0;ae[ue++]=J,W+=J>65535?2:1}let G=ue;for(let W=1;W<H;++W)ae.copyWithin(G,0,ue),G+=ue;return this.print(ae,0,G),!0}sendDeviceAttributesPrimary(D){return D.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(D){return D.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(D.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(D){return(this._optionsService.rawOptions.termName+"").indexOf(D)===0}setMode(D){for(let $=0;$<D.length;$++)switch(D.params[$]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(D){for(let $=0;$<D.length;$++)switch(D.params[$]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,y.DEFAULT_CHARSET),this._charsetService.setgCharset(1,y.DEFAULT_CHARSET),this._charsetService.setgCharset(2,y.DEFAULT_CHARSET),this._charsetService.setgCharset(3,y.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(D){for(let $=0;$<D.length;$++)switch(D.params[$]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(D){for(let $=0;$<D.length;$++)switch(D.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(),D.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(D,$){const H=this._coreService.decPrivateModes,{activeProtocol:K,activeEncoding:te}=this._coreMouseService,re=this._coreService,{buffers:ae,cols:ue}=this._bufferService,{active:G,alt:W}=ae,J=this._optionsService.rawOptions,Z=Ee=>Ee?1:2,de=D.params[0];return fe=de,se=$?de===2?4:de===4?Z(re.modes.insertMode):de===12?3:de===20?Z(J.convertEol):0:de===1?Z(H.applicationCursorKeys):de===3?J.windowOptions.setWinLines?ue===80?2:ue===132?1:0:0:de===6?Z(H.origin):de===7?Z(H.wraparound):de===8?3:de===9?Z(K==="X10"):de===12?Z(J.cursorBlink):de===25?Z(!re.isCursorHidden):de===45?Z(H.reverseWraparound):de===66?Z(H.applicationKeypad):de===67?4:de===1e3?Z(K==="VT200"):de===1002?Z(K==="DRAG"):de===1003?Z(K==="ANY"):de===1004?Z(H.sendFocus):de===1005?4:de===1006?Z(te==="SGR"):de===1015?4:de===1016?Z(te==="SGR_PIXELS"):de===1048?1:de===47||de===1047||de===1049?Z(G===W):de===2004?Z(H.bracketedPasteMode):0,re.triggerDataEvent(`${h.C0.ESC}[${$?"":"?"}${fe};${se}$y`),!0;var fe,se}_updateAttrColor(D,$,H,K,te){return $===2?(D|=50331648,D&=-16777216,D|=k.AttributeData.fromColorRGB([H,K,te])):$===5&&(D&=-50331904,D|=33554432|255&H),D}_extractColor(D,$,H){const K=[0,0,-1,0,0,0];let te=0,re=0;do{if(K[re+te]=D.params[$+re],D.hasSubParams($+re)){const ae=D.getSubParams($+re);let ue=0;do K[1]===5&&(te=1),K[re+ue+1+te]=ae[ue];while(++ue<ae.length&&ue+re+1+te<K.length);break}if(K[1]===5&&re+te>=2||K[1]===2&&re+te>=5)break;K[1]&&(te=1)}while(++re+$<D.length&&re+te<K.length);for(let ae=2;ae<K.length;++ae)K[ae]===-1&&(K[ae]=0);switch(K[0]){case 38:H.fg=this._updateAttrColor(H.fg,K[1],K[3],K[4],K[5]);break;case 48:H.bg=this._updateAttrColor(H.bg,K[1],K[3],K[4],K[5]);break;case 58:H.extended=H.extended.clone(),H.extended.underlineColor=this._updateAttrColor(H.extended.underlineColor,K[1],K[3],K[4],K[5])}return re}_processUnderline(D,$){$.extended=$.extended.clone(),(!~D||D>5)&&(D=1),$.extended.underlineStyle=D,$.fg|=268435456,D===0&&($.fg&=-268435457),$.updateExtended()}_processSGR0(D){D.fg=a.DEFAULT_ATTR_DATA.fg,D.bg=a.DEFAULT_ATTR_DATA.bg,D.extended=D.extended.clone(),D.extended.underlineStyle=0,D.extended.underlineColor&=-67108864,D.updateExtended()}charAttributes(D){if(D.length===1&&D.params[0]===0)return this._processSGR0(this._curAttrData),!0;const $=D.length;let H;const K=this._curAttrData;for(let te=0;te<$;te++)H=D.params[te],H>=30&&H<=37?(K.fg&=-50331904,K.fg|=16777216|H-30):H>=40&&H<=47?(K.bg&=-50331904,K.bg|=16777216|H-40):H>=90&&H<=97?(K.fg&=-50331904,K.fg|=16777224|H-90):H>=100&&H<=107?(K.bg&=-50331904,K.bg|=16777224|H-100):H===0?this._processSGR0(K):H===1?K.fg|=134217728:H===3?K.bg|=67108864:H===4?(K.fg|=268435456,this._processUnderline(D.hasSubParams(te)?D.getSubParams(te)[0]:1,K)):H===5?K.fg|=536870912:H===7?K.fg|=67108864:H===8?K.fg|=1073741824:H===9?K.fg|=2147483648:H===2?K.bg|=134217728:H===21?this._processUnderline(2,K):H===22?(K.fg&=-134217729,K.bg&=-134217729):H===23?K.bg&=-67108865:H===24?(K.fg&=-268435457,this._processUnderline(0,K)):H===25?K.fg&=-536870913:H===27?K.fg&=-67108865:H===28?K.fg&=-1073741825:H===29?K.fg&=2147483647:H===39?(K.fg&=-67108864,K.fg|=16777215&a.DEFAULT_ATTR_DATA.fg):H===49?(K.bg&=-67108864,K.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):H===38||H===48||H===58?te+=this._extractColor(D,te,K):H===53?K.bg|=1073741824:H===55?K.bg&=-1073741825:H===59?(K.extended=K.extended.clone(),K.extended.underlineColor=-1,K.updateExtended()):H===100?(K.fg&=-67108864,K.fg|=16777215&a.DEFAULT_ATTR_DATA.fg,K.bg&=-67108864,K.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",H);return!0}deviceStatus(D){switch(D.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const $=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${$};${H}R`)}return!0}deviceStatusPrivate(D){if(D.params[0]===6){const $=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${$};${H}R`)}return!0}softReset(D){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=a.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(D){const $=D.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 H=$%2==1;return this._optionsService.options.cursorBlink=H,!0}setScrollRegion(D){const $=D.params[0]||1;let H;return(D.length<2||(H=D.params[1])>this._bufferService.rows||H===0)&&(H=this._bufferService.rows),H>$&&(this._activeBuffer.scrollTop=$-1,this._activeBuffer.scrollBottom=H-1,this._setCursor(0,0)),!0}windowOptions(D){if(!B(D.params[0],this._optionsService.rawOptions.windowOptions))return!0;const $=D.length>1?D.params[1]:0;switch(D.params[0]){case 14:$!==2&&this._onRequestWindowsOptionsReport.fire(F.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(F.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.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(D){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(D){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(D){return this._windowTitle=D,this._onTitleChange.fire(D),!0}setIconName(D){return this._iconName=D,!0}setOrReportIndexedColor(D){const $=[],H=D.split(";");for(;H.length>1;){const K=H.shift(),te=H.shift();if(/^\d+$/.exec(K)){const re=parseInt(K);if(Y(re))if(te==="?")$.push({type:0,index:re});else{const ae=(0,T.parseColor)(te);ae&&$.push({type:1,index:re,color:ae})}}}return $.length&&this._onColor.fire($),!0}setHyperlink(D){const $=D.split(";");return!($.length<2)&&($[1]?this._createHyperlink($[0],$[1]):!$[0]&&this._finishHyperlink())}_createHyperlink(D,$){this._getCurrentLinkId()&&this._finishHyperlink();const H=D.split(":");let K;const te=H.findIndex((re=>re.startsWith("id=")));return te!==-1&&(K=H[te].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:K,uri:$}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(D,$){const H=D.split(";");for(let K=0;K<H.length&&!($>=this._specialColors.length);++K,++$)if(H[K]==="?")this._onColor.fire([{type:0,index:this._specialColors[$]}]);else{const te=(0,T.parseColor)(H[K]);te&&this._onColor.fire([{type:1,index:this._specialColors[$],color:te}])}return!0}setOrReportFgColor(D){return this._setOrReportSpecialColor(D,0)}setOrReportBgColor(D){return this._setOrReportSpecialColor(D,1)}setOrReportCursorColor(D){return this._setOrReportSpecialColor(D,2)}restoreIndexedColor(D){if(!D)return this._onColor.fire([{type:2}]),!0;const $=[],H=D.split(";");for(let K=0;K<H.length;++K)if(/^\d+$/.exec(H[K])){const te=parseInt(H[K]);Y(te)&&$.push({type:2,index:te})}return $.length&&this._onColor.fire($),!0}restoreFgColor(D){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(D){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(D){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,y.DEFAULT_CHARSET),!0}selectCharset(D){return D.length!==2?(this.selectDefaultCharset(),!0):(D[0]==="/"||this._charsetService.setgCharset(N[D[0]],y.CHARSETS[D[1]]||y.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 D=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,D,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=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(D){return this._charsetService.setgLevel(D),!0}screenAlignmentPattern(){const D=new d.CellData;D.content=4194373,D.fg=this._curAttrData.fg,D.bg=this._curAttrData.bg,this._setCursor(0,0);for(let $=0;$<this._bufferService.rows;++$){const H=this._activeBuffer.ybase+this._activeBuffer.y+$,K=this._activeBuffer.lines.get(H);K&&(K.fill(D),K.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(D,$){const H=this._bufferService.buffer,K=this._optionsService.rawOptions;return(te=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${te}${h.C0.ESC}\\`),!0))(D==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:D==='"p'?'P1$r61;1"p':D==="r"?`P1$r${H.scrollTop+1};${H.scrollBottom+1}r`:D==="m"?"P1$r0m":D===" q"?`P1$r${{block:2,underline:4,bar:6}[K.cursorStyle]-(K.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(D,$){this._dirtyRowTracker.markRangeDirty(D,$)}}r.InputHandler=V;let X=class{constructor(q){this._bufferService=q,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(q){q<this.start?this.start=q:q>this.end&&(this.end=q)}markRangeDirty(q,D){q>D&&(U=q,q=D,D=U),q<this.start&&(this.start=q),D>this.end&&(this.end=D)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(q){return 0<=q&&q<256}X=g([v(0,I.IBufferService)],X)},844:(x,r)=>{function c(g){for(const v of g)v.dispose();g.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const g of this._disposables)g.dispose();this._disposables.length=0}register(g){return this._disposables.push(g),g}unregister(g){const v=this._disposables.indexOf(g);v!==-1&&this._disposables.splice(v,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(g){var v;this._isDisposed||g===this._value||((v=this._value)==null||v.dispose(),this._value=g)}clear(){this.value=void 0}dispose(){var g;this._isDisposed=!0,(g=this._value)==null||g.dispose(),this._value=void 0}},r.toDisposable=function(g){return{dispose:g}},r.disposeArray=c,r.getDisposeArrayDisposable=function(g){return{dispose:()=>c(g)}}},1505:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(v,h,y){this._data[v]||(this._data[v]={}),this._data[v][h]=y}get(v,h){return this._data[v]?this._data[v][h]:void 0}clear(){this._data={}}}r.TwoKeyMap=c,r.FourKeyMap=class{constructor(){this._data=new c}set(g,v,h,y,S){this._data.get(g,v)||this._data.set(g,v,new c),this._data.get(g,v).set(h,y,S)}get(g,v,h,y){var S;return(S=this._data.get(g,v))==null?void 0:S.get(h,y)}clear(){this._data.clear()}}},6114:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof process<"u"&&"title"in process;const c=r.isNode?"node":navigator.userAgent,g=r.isNode?"node":navigator.platform;r.isFirefox=c.includes("Firefox"),r.isLegacyEdge=c.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(c),r.getSafariVersion=function(){if(!r.isSafari)return 0;const v=c.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(g),r.isIpad=g==="iPad",r.isIphone=g==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(g),r.isLinux=g.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(c)},6106:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let c=0;r.SortedList=class{constructor(g){this._getKey=g,this._array=[]}clear(){this._array.length=0}insert(g){this._array.length!==0?(c=this._search(this._getKey(g)),this._array.splice(c,0,g)):this._array.push(g)}delete(g){if(this._array.length===0)return!1;const v=this._getKey(g);if(v===void 0||(c=this._search(v),c===-1)||this._getKey(this._array[c])!==v)return!1;do if(this._array[c]===g)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===v);return!1}*getKeyIterator(g){if(this._array.length!==0&&(c=this._search(g),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===g))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===g)}forEachByKey(g,v){if(this._array.length!==0&&(c=this._search(g),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===g))do v(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===g)}values(){return[...this._array].values()}_search(g){let v=0,h=this._array.length-1;for(;h>=v;){let y=v+h>>1;const S=this._getKey(this._array[y]);if(S>g)h=y-1;else{if(!(S<g)){for(;y>0&&this._getKey(this._array[y-1])===g;)y--;return y}v=y+1}}return v}}},7226:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const g=c(6114);class v{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(S){this._idleCallback=void 0;let E=0,f=0,a=S.timeRemaining(),m=0;for(;this._i<this._tasks.length;){if(E=Date.now(),this._tasks[this._i]()||this._i++,E=Math.max(1,Date.now()-E),f=Math.max(E,f),m=S.timeRemaining(),1.5*f>m)return a-E<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-E))}ms`),void this._start();a=m}this.clear()}}class h extends v{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const E=Date.now()+S;return{timeRemaining:()=>Math.max(0,E-Date.now())}}}r.PriorityTaskQueue=h,r.IdleTaskQueue=!g.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(y){return requestIdleCallback(y)}_cancelCallback(y){cancelIdleCallback(y)}}:h,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(y){this._queue.clear(),this._queue.enqueue(y)}flush(){this._queue.flush()}}},9282:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const g=c(643);r.updateWindowsModeWrappedState=function(v){const h=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),y=h==null?void 0:h.get(v.cols-1),S=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);S&&y&&(S.isWrapped=y[g.CHAR_DATA_CODE_INDEX]!==g.NULL_CELL_CODE&&y[g.CHAR_DATA_CODE_INDEX]!==g.WHITESPACE_CELL_CODE)}},3734:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new g}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new c;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}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}}r.AttributeData=c;class g{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,y=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=y}clone(){return new g(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=g},9092:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const g=c(6349),v=c(7226),h=c(3734),y=c(8437),S=c(4634),E=c(511),f=c(643),a=c(4863),m=c(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(p,d,k){this._hasScrollback=p,this._optionsService=d,this._bufferService=k,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=y.DEFAULT_ATTR_DATA.clone(),this.savedCharset=m.DEFAULT_CHARSET,this.markers=[],this._nullCell=E.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]),this._whitespaceCell=E.CellData.fromCharData([0,f.WHITESPACE_CELL_CHAR,f.WHITESPACE_CELL_WIDTH,f.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new v.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new g.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(p){return p?(this._nullCell.fg=p.fg,this._nullCell.bg=p.bg,this._nullCell.extended=p.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(p){return p?(this._whitespaceCell.fg=p.fg,this._whitespaceCell.bg=p.bg,this._whitespaceCell.extended=p.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(p,d){return new y.BufferLine(this._bufferService.cols,this.getNullCell(p),d)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const p=this.ybase+this.y-this.ydisp;return p>=0&&p<this._rows}_getCorrectBufferLength(p){if(!this._hasScrollback)return p;const d=p+this._optionsService.rawOptions.scrollback;return d>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:d}fillViewportRows(p){if(this.lines.length===0){p===void 0&&(p=y.DEFAULT_ATTR_DATA);let d=this._rows;for(;d--;)this.lines.push(this.getBlankLine(p))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new g.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(p,d){const k=this.getNullCell(y.DEFAULT_ATTR_DATA);let I=0;const L=this._getCorrectBufferLength(d);if(L>this.lines.maxLength&&(this.lines.maxLength=L),this.lines.length>0){if(this._cols<p)for(let b=0;b<this.lines.length;b++)I+=+this.lines.get(b).resize(p,k);let M=0;if(this._rows<d)for(let b=this._rows;b<d;b++)this.lines.length<d+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new y.BufferLine(p,k)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new y.BufferLine(p,k)));else for(let b=this._rows;b>d;b--)this.lines.length>d+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(L<this.lines.maxLength){const b=this.lines.length-L;b>0&&(this.lines.trimStart(b),this.ybase=Math.max(this.ybase-b,0),this.ydisp=Math.max(this.ydisp-b,0),this.savedY=Math.max(this.savedY-b,0)),this.lines.maxLength=L}this.x=Math.min(this.x,p-1),this.y=Math.min(this.y,d-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,p-1),this.scrollTop=0}if(this.scrollBottom=d-1,this._isReflowEnabled&&(this._reflow(p,d),this._cols>p))for(let M=0;M<this.lines.length;M++)I+=+this.lines.get(M).resize(p,k);this._cols=p,this._rows=d,this._memoryCleanupQueue.clear(),I>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let p=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,p=!1);let d=0;for(;this._memoryCleanupPosition<this.lines.length;)if(d+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),d>100)return!0;return p}get _isReflowEnabled(){const p=this._optionsService.rawOptions.windowsPty;return p&&p.buildNumber?this._hasScrollback&&p.backend==="conpty"&&p.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(p,d){this._cols!==p&&(p>this._cols?this._reflowLarger(p,d):this._reflowSmaller(p,d))}_reflowLarger(p,d){const k=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,p,this.ybase+this.y,this.getNullCell(y.DEFAULT_ATTR_DATA));if(k.length>0){const I=(0,S.reflowLargerCreateNewLayout)(this.lines,k);(0,S.reflowLargerApplyNewLayout)(this.lines,I.layout),this._reflowLargerAdjustViewport(p,d,I.countRemoved)}}_reflowLargerAdjustViewport(p,d,k){const I=this.getNullCell(y.DEFAULT_ATTR_DATA);let L=k;for(;L-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<d&&this.lines.push(new y.BufferLine(p,I))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-k,0)}_reflowSmaller(p,d){const k=this.getNullCell(y.DEFAULT_ATTR_DATA),I=[];let L=0;for(let M=this.lines.length-1;M>=0;M--){let b=this.lines.get(M);if(!b||!b.isWrapped&&b.getTrimmedLength()<=p)continue;const T=[b];for(;b.isWrapped&&M>0;)b=this.lines.get(--M),T.unshift(b);const N=this.ybase+this.y;if(N>=M&&N<M+T.length)continue;const O=T[T.length-1].getTrimmedLength(),B=(0,S.reflowSmallerGetNewLineLengths)(T,this._cols,p),F=B.length-T.length;let U;U=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+F):Math.max(0,this.lines.length-this.lines.maxLength+F);const V=[];for(let H=0;H<F;H++){const K=this.getBlankLine(y.DEFAULT_ATTR_DATA,!0);V.push(K)}V.length>0&&(I.push({start:M+T.length+L,newLines:V}),L+=V.length),T.push(...V);let X=B.length-1,Y=B[X];Y===0&&(X--,Y=B[X]);let q=T.length-F-1,D=O;for(;q>=0;){const H=Math.min(D,Y);if(T[X]===void 0)break;if(T[X].copyCellsFrom(T[q],D-H,Y-H,H,!0),Y-=H,Y===0&&(X--,Y=B[X]),D-=H,D===0){q--;const K=Math.max(q,0);D=(0,S.getWrappedLineTrimmedLength)(T,K,this._cols)}}for(let H=0;H<T.length;H++)B[H]<p&&T[H].setCell(B[H],k);let $=F-U;for(;$-- >0;)this.ybase===0?this.y<d-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+L)-d&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+F,this.ybase+d-1)}if(I.length>0){const M=[],b=[];for(let X=0;X<this.lines.length;X++)b.push(this.lines.get(X));const T=this.lines.length;let N=T-1,O=0,B=I[O];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+L);let F=0;for(let X=Math.min(this.lines.maxLength-1,T+L-1);X>=0;X--)if(B&&B.start>N+F){for(let Y=B.newLines.length-1;Y>=0;Y--)this.lines.set(X--,B.newLines[Y]);X++,M.push({index:N+1,amount:B.newLines.length}),F+=B.newLines.length,B=I[++O]}else this.lines.set(X,b[N--]);let U=0;for(let X=M.length-1;X>=0;X--)M[X].index+=U,this.lines.onInsertEmitter.fire(M[X]),U+=M[X].amount;const V=Math.max(0,T+L-this.lines.maxLength);V>0&&this.lines.onTrimEmitter.fire(V)}}translateBufferLineToString(p,d,k=0,I){const L=this.lines.get(p);return L?L.translateToString(d,k,I):""}getWrappedRangeForLine(p){let d=p,k=p;for(;d>0&&this.lines.get(d).isWrapped;)d--;for(;k+1<this.lines.length&&this.lines.get(k+1).isWrapped;)k++;return{first:d,last:k}}setupTabStops(p){for(p!=null?this.tabs[p]||(p=this.prevStop(p)):(this.tabs={},p=0);p<this._cols;p+=this._optionsService.rawOptions.tabStopWidth)this.tabs[p]=!0}prevStop(p){for(p==null&&(p=this.x);!this.tabs[--p]&&p>0;);return p>=this._cols?this._cols-1:p<0?0:p}nextStop(p){for(p==null&&(p=this.x);!this.tabs[++p]&&p<this._cols;);return p>=this._cols?this._cols-1:p<0?0:p}clearMarkers(p){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].line===p&&(this.markers[d].dispose(),this.markers.splice(d--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let p=0;p<this.markers.length;p++)this.markers[p].dispose(),this.markers.splice(p--,1);this._isClearing=!1}addMarker(p){const d=new a.Marker(p);return this.markers.push(d),d.register(this.lines.onTrim((k=>{d.line-=k,d.line<0&&d.dispose()}))),d.register(this.lines.onInsert((k=>{d.line>=k.index&&(d.line+=k.amount)}))),d.register(this.lines.onDelete((k=>{d.line>=k.index&&d.line<k.index+k.amount&&d.dispose(),d.line>k.index&&(d.line-=k.amount)}))),d.register(d.onDispose((()=>this._removeMarker(d)))),d}_removeMarker(p){this._isClearing||this.markers.splice(this.markers.indexOf(p),1)}}},8437:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const g=c(3734),v=c(511),h=c(643),y=c(482);r.DEFAULT_ATTR_DATA=Object.freeze(new g.AttributeData);let S=0;class E{constructor(a,m,p=!1){this.isWrapped=p,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*a);const d=m||v.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let k=0;k<a;++k)this.setCell(k,d);this.length=a}get(a){const m=this._data[3*a+0],p=2097151&m;return[this._data[3*a+1],2097152&m?this._combined[a]:p?(0,y.stringFromCodePoint)(p):"",m>>22,2097152&m?this._combined[a].charCodeAt(this._combined[a].length-1):p]}set(a,m){this._data[3*a+1]=m[h.CHAR_DATA_ATTR_INDEX],m[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[a]=m[1],this._data[3*a+0]=2097152|a|m[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*a+0]=m[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|m[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(a){return this._data[3*a+0]>>22}hasWidth(a){return 12582912&this._data[3*a+0]}getFg(a){return this._data[3*a+1]}getBg(a){return this._data[3*a+2]}hasContent(a){return 4194303&this._data[3*a+0]}getCodePoint(a){const m=this._data[3*a+0];return 2097152&m?this._combined[a].charCodeAt(this._combined[a].length-1):2097151&m}isCombined(a){return 2097152&this._data[3*a+0]}getString(a){const m=this._data[3*a+0];return 2097152&m?this._combined[a]:2097151&m?(0,y.stringFromCodePoint)(2097151&m):""}isProtected(a){return 536870912&this._data[3*a+2]}loadCell(a,m){return S=3*a,m.content=this._data[S+0],m.fg=this._data[S+1],m.bg=this._data[S+2],2097152&m.content&&(m.combinedData=this._combined[a]),268435456&m.bg&&(m.extended=this._extendedAttrs[a]),m}setCell(a,m){2097152&m.content&&(this._combined[a]=m.combinedData),268435456&m.bg&&(this._extendedAttrs[a]=m.extended),this._data[3*a+0]=m.content,this._data[3*a+1]=m.fg,this._data[3*a+2]=m.bg}setCellFromCodepoint(a,m,p,d){268435456&d.bg&&(this._extendedAttrs[a]=d.extended),this._data[3*a+0]=m|p<<22,this._data[3*a+1]=d.fg,this._data[3*a+2]=d.bg}addCodepointToCell(a,m,p){let d=this._data[3*a+0];2097152&d?this._combined[a]+=(0,y.stringFromCodePoint)(m):2097151&d?(this._combined[a]=(0,y.stringFromCodePoint)(2097151&d)+(0,y.stringFromCodePoint)(m),d&=-2097152,d|=2097152):d=m|4194304,p&&(d&=-12582913,d|=p<<22),this._data[3*a+0]=d}insertCells(a,m,p){if((a%=this.length)&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a-1,0,1,p),m<this.length-a){const d=new v.CellData;for(let k=this.length-a-m-1;k>=0;--k)this.setCell(a+m+k,this.loadCell(a+k,d));for(let k=0;k<m;++k)this.setCell(a+k,p)}else for(let d=a;d<this.length;++d)this.setCell(d,p);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,p)}deleteCells(a,m,p){if(a%=this.length,m<this.length-a){const d=new v.CellData;for(let k=0;k<this.length-a-m;++k)this.setCell(a+k,this.loadCell(a+m+k,d));for(let k=this.length-m;k<this.length;++k)this.setCell(k,p)}else for(let d=a;d<this.length;++d)this.setCell(d,p);a&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a-1,0,1,p),this.getWidth(a)!==0||this.hasContent(a)||this.setCellFromCodepoint(a,0,1,p)}replaceCells(a,m,p,d=!1){if(d)for(a&&this.getWidth(a-1)===2&&!this.isProtected(a-1)&&this.setCellFromCodepoint(a-1,0,1,p),m<this.length&&this.getWidth(m-1)===2&&!this.isProtected(m)&&this.setCellFromCodepoint(m,0,1,p);a<m&&a<this.length;)this.isProtected(a)||this.setCell(a,p),a++;else for(a&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a-1,0,1,p),m<this.length&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m,0,1,p);a<m&&a<this.length;)this.setCell(a++,p)}resize(a,m){if(a===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const p=3*a;if(a>this.length){if(this._data.buffer.byteLength>=4*p)this._data=new Uint32Array(this._data.buffer,0,p);else{const d=new Uint32Array(p);d.set(this._data),this._data=d}for(let d=this.length;d<a;++d)this.setCell(d,m)}else{this._data=this._data.subarray(0,p);const d=Object.keys(this._combined);for(let I=0;I<d.length;I++){const L=parseInt(d[I],10);L>=a&&delete this._combined[L]}const k=Object.keys(this._extendedAttrs);for(let I=0;I<k.length;I++){const L=parseInt(k[I],10);L>=a&&delete this._extendedAttrs[L]}}return this.length=a,4*p*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const a=new Uint32Array(this._data.length);return a.set(this._data),this._data=a,1}return 0}fill(a,m=!1){if(m)for(let p=0;p<this.length;++p)this.isProtected(p)||this.setCell(p,a);else{this._combined={},this._extendedAttrs={};for(let p=0;p<this.length;++p)this.setCell(p,a)}}copyFrom(a){this.length!==a.length?this._data=new Uint32Array(a._data):this._data.set(a._data),this.length=a.length,this._combined={};for(const m in a._combined)this._combined[m]=a._combined[m];this._extendedAttrs={};for(const m in a._extendedAttrs)this._extendedAttrs[m]=a._extendedAttrs[m];this.isWrapped=a.isWrapped}clone(){const a=new E(0);a._data=new Uint32Array(this._data),a.length=this.length;for(const m in this._combined)a._combined[m]=this._combined[m];for(const m in this._extendedAttrs)a._extendedAttrs[m]=this._extendedAttrs[m];return a.isWrapped=this.isWrapped,a}getTrimmedLength(){for(let a=this.length-1;a>=0;--a)if(4194303&this._data[3*a+0])return a+(this._data[3*a+0]>>22);return 0}getNoBgTrimmedLength(){for(let a=this.length-1;a>=0;--a)if(4194303&this._data[3*a+0]||50331648&this._data[3*a+2])return a+(this._data[3*a+0]>>22);return 0}copyCellsFrom(a,m,p,d,k){const I=a._data;if(k)for(let M=d-1;M>=0;M--){for(let b=0;b<3;b++)this._data[3*(p+M)+b]=I[3*(m+M)+b];268435456&I[3*(m+M)+2]&&(this._extendedAttrs[p+M]=a._extendedAttrs[m+M])}else for(let M=0;M<d;M++){for(let b=0;b<3;b++)this._data[3*(p+M)+b]=I[3*(m+M)+b];268435456&I[3*(m+M)+2]&&(this._extendedAttrs[p+M]=a._extendedAttrs[m+M])}const L=Object.keys(a._combined);for(let M=0;M<L.length;M++){const b=parseInt(L[M],10);b>=m&&(this._combined[b-m+p]=a._combined[b])}}translateToString(a,m,p,d){m=m??0,p=p??this.length,a&&(p=Math.min(p,this.getTrimmedLength())),d&&(d.length=0);let k="";for(;m<p;){const I=this._data[3*m+0],L=2097151&I,M=2097152&I?this._combined[m]:L?(0,y.stringFromCodePoint)(L):h.WHITESPACE_CELL_CHAR;if(k+=M,d)for(let b=0;b<M.length;++b)d.push(m);m+=I>>22||1}return d&&d.push(m),k}}r.BufferLine=E},4841:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(c,g){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 g*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(x,r)=>{function c(g,v,h){if(v===g.length-1)return g[v].getTrimmedLength();const y=!g[v].hasContent(h-1)&&g[v].getWidth(h-1)===1,S=g[v+1].getWidth(0)===2;return y&&S?h-1:h}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(g,v,h,y,S){const E=[];for(let f=0;f<g.length-1;f++){let a=f,m=g.get(++a);if(!m.isWrapped)continue;const p=[g.get(f)];for(;a<g.length&&m.isWrapped;)p.push(m),m=g.get(++a);if(y>=f&&y<a){f+=p.length-1;continue}let d=0,k=c(p,d,v),I=1,L=0;for(;I<p.length;){const b=c(p,I,v),T=b-L,N=h-k,O=Math.min(T,N);p[d].copyCellsFrom(p[I],L,k,O,!1),k+=O,k===h&&(d++,k=0),L+=O,L===b&&(I++,L=0),k===0&&d!==0&&p[d-1].getWidth(h-1)===2&&(p[d].copyCellsFrom(p[d-1],h-1,k++,1,!1),p[d-1].setCell(h-1,S))}p[d].replaceCells(k,h,S);let M=0;for(let b=p.length-1;b>0&&(b>d||p[b].getTrimmedLength()===0);b--)M++;M>0&&(E.push(f+p.length-M),E.push(M)),f+=p.length-1}return E},r.reflowLargerCreateNewLayout=function(g,v){const h=[];let y=0,S=v[y],E=0;for(let f=0;f<g.length;f++)if(S===f){const a=v[++y];g.onDeleteEmitter.fire({index:f-E,amount:a}),f+=a-1,E+=a,S=v[++y]}else h.push(f);return{layout:h,countRemoved:E}},r.reflowLargerApplyNewLayout=function(g,v){const h=[];for(let y=0;y<v.length;y++)h.push(g.get(v[y]));for(let y=0;y<h.length;y++)g.set(y,h[y]);g.length=v.length},r.reflowSmallerGetNewLineLengths=function(g,v,h){const y=[],S=g.map(((m,p)=>c(g,p,v))).reduce(((m,p)=>m+p));let E=0,f=0,a=0;for(;a<S;){if(S-a<h){y.push(S-a);break}E+=h;const m=c(g,f,v);E>m&&(E-=m,f++);const p=g[f].getWidth(E-1)===2;p&&E--;const d=p?h-1:h;y.push(d),a+=d}return y},r.getWrappedLineTrimmedLength=c},5295:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const g=c(8460),v=c(844),h=c(9092);class y extends v.Disposable{constructor(E,f){super(),this._optionsService=E,this._bufferService=f,this._onBufferActivate=this.register(new g.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 h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.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(E){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(E),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(E,f){this._normal.resize(E,f),this._alt.resize(E,f),this.setupTabStops(E)}setupTabStops(E){this._normal.setupTabStops(E),this._alt.setupTabStops(E)}}r.BufferSet=y},511:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const g=c(482),v=c(643),h=c(3734);class y extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(E){const f=new y;return f.setFromCharData(E),f}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,g.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(E){this.fg=E[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(E[v.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(E[v.CHAR_DATA_CHAR_INDEX].length===2){const a=E[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=a&&a<=56319){const m=E[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=m&&m<=57343?this.content=1024*(a-55296)+m-56320+65536|E[v.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=E[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[v.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=E[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|E[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=y},643:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const g=c(8460),v=c(844);class h{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,v.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}r.Marker=h,h._nextId=1},7116:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.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:"≥","{":"π","|":"≠","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(x,r)=>{var c,g,v;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
115
- `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(c||(r.C0=c={})),(function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"})(g||(r.C1=g={})),(function(h){h.ST=`${c.ESC}\\`})(v||(r.C1_ESCAPED=v={}))},7399:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const g=c(2584),v={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:["'",'"']};r.evaluateKeyboardEvent=function(h,y,S,E){const f={type:0,cancel:!1,key:void 0},a=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?f.key=y?g.C0.ESC+"OA":g.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?f.key=y?g.C0.ESC+"OD":g.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?f.key=y?g.C0.ESC+"OC":g.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(f.key=y?g.C0.ESC+"OB":g.C0.ESC+"[B");break;case 8:f.key=h.ctrlKey?"\b":g.C0.DEL,h.altKey&&(f.key=g.C0.ESC+f.key);break;case 9:if(h.shiftKey){f.key=g.C0.ESC+"[Z";break}f.key=g.C0.HT,f.cancel=!0;break;case 13:f.key=h.altKey?g.C0.ESC+g.C0.CR:g.C0.CR,f.cancel=!0;break;case 27:f.key=g.C0.ESC,h.altKey&&(f.key=g.C0.ESC+g.C0.ESC),f.cancel=!0;break;case 37:if(h.metaKey)break;a?(f.key=g.C0.ESC+"[1;"+(a+1)+"D",f.key===g.C0.ESC+"[1;3D"&&(f.key=g.C0.ESC+(S?"b":"[1;5D"))):f.key=y?g.C0.ESC+"OD":g.C0.ESC+"[D";break;case 39:if(h.metaKey)break;a?(f.key=g.C0.ESC+"[1;"+(a+1)+"C",f.key===g.C0.ESC+"[1;3C"&&(f.key=g.C0.ESC+(S?"f":"[1;5C"))):f.key=y?g.C0.ESC+"OC":g.C0.ESC+"[C";break;case 38:if(h.metaKey)break;a?(f.key=g.C0.ESC+"[1;"+(a+1)+"A",S||f.key!==g.C0.ESC+"[1;3A"||(f.key=g.C0.ESC+"[1;5A")):f.key=y?g.C0.ESC+"OA":g.C0.ESC+"[A";break;case 40:if(h.metaKey)break;a?(f.key=g.C0.ESC+"[1;"+(a+1)+"B",S||f.key!==g.C0.ESC+"[1;3B"||(f.key=g.C0.ESC+"[1;5B")):f.key=y?g.C0.ESC+"OB":g.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(f.key=g.C0.ESC+"[2~");break;case 46:f.key=a?g.C0.ESC+"[3;"+(a+1)+"~":g.C0.ESC+"[3~";break;case 36:f.key=a?g.C0.ESC+"[1;"+(a+1)+"H":y?g.C0.ESC+"OH":g.C0.ESC+"[H";break;case 35:f.key=a?g.C0.ESC+"[1;"+(a+1)+"F":y?g.C0.ESC+"OF":g.C0.ESC+"[F";break;case 33:h.shiftKey?f.type=2:h.ctrlKey?f.key=g.C0.ESC+"[5;"+(a+1)+"~":f.key=g.C0.ESC+"[5~";break;case 34:h.shiftKey?f.type=3:h.ctrlKey?f.key=g.C0.ESC+"[6;"+(a+1)+"~":f.key=g.C0.ESC+"[6~";break;case 112:f.key=a?g.C0.ESC+"[1;"+(a+1)+"P":g.C0.ESC+"OP";break;case 113:f.key=a?g.C0.ESC+"[1;"+(a+1)+"Q":g.C0.ESC+"OQ";break;case 114:f.key=a?g.C0.ESC+"[1;"+(a+1)+"R":g.C0.ESC+"OR";break;case 115:f.key=a?g.C0.ESC+"[1;"+(a+1)+"S":g.C0.ESC+"OS";break;case 116:f.key=a?g.C0.ESC+"[15;"+(a+1)+"~":g.C0.ESC+"[15~";break;case 117:f.key=a?g.C0.ESC+"[17;"+(a+1)+"~":g.C0.ESC+"[17~";break;case 118:f.key=a?g.C0.ESC+"[18;"+(a+1)+"~":g.C0.ESC+"[18~";break;case 119:f.key=a?g.C0.ESC+"[19;"+(a+1)+"~":g.C0.ESC+"[19~";break;case 120:f.key=a?g.C0.ESC+"[20;"+(a+1)+"~":g.C0.ESC+"[20~";break;case 121:f.key=a?g.C0.ESC+"[21;"+(a+1)+"~":g.C0.ESC+"[21~";break;case 122:f.key=a?g.C0.ESC+"[23;"+(a+1)+"~":g.C0.ESC+"[23~";break;case 123:f.key=a?g.C0.ESC+"[24;"+(a+1)+"~":g.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(S&&!E||!h.altKey||h.metaKey)!S||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?f.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(f.key=g.C0.US),h.key==="@"&&(f.key=g.C0.NUL)):h.keyCode===65&&(f.type=1);else{const m=v[h.keyCode],p=m==null?void 0:m[h.shiftKey?1:0];if(p)f.key=g.C0.ESC+p;else if(h.keyCode>=65&&h.keyCode<=90){const d=h.ctrlKey?h.keyCode-64:h.keyCode+32;let k=String.fromCharCode(d);h.shiftKey&&(k=k.toUpperCase()),f.key=g.C0.ESC+k}else if(h.keyCode===32)f.key=g.C0.ESC+(h.ctrlKey?g.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let d=h.code.slice(3,4);h.shiftKey||(d=d.toLowerCase()),f.key=g.C0.ESC+d,f.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?f.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?f.key=g.C0.NUL:h.keyCode>=51&&h.keyCode<=55?f.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?f.key=g.C0.DEL:h.keyCode===219?f.key=g.C0.ESC:h.keyCode===220?f.key=g.C0.FS:h.keyCode===221&&(f.key=g.C0.GS)}return f}},482:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},r.utf32ToString=function(c,g=0,v=c.length){let h="";for(let y=g;y<v;++y){let S=c[y];S>65535?(S-=65536,h+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):h+=String.fromCharCode(S)}return h},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,g){const v=c.length;if(!v)return 0;let h=0,y=0;if(this._interim){const S=c.charCodeAt(y++);56320<=S&&S<=57343?g[h++]=1024*(this._interim-55296)+S-56320+65536:(g[h++]=this._interim,g[h++]=S),this._interim=0}for(let S=y;S<v;++S){const E=c.charCodeAt(S);if(55296<=E&&E<=56319){if(++S>=v)return this._interim=E,h;const f=c.charCodeAt(S);56320<=f&&f<=57343?g[h++]=1024*(E-55296)+f-56320+65536:(g[h++]=E,g[h++]=f)}else E!==65279&&(g[h++]=E)}return h}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,g){const v=c.length;if(!v)return 0;let h,y,S,E,f=0,a=0,m=0;if(this.interim[0]){let k=!1,I=this.interim[0];I&=(224&I)==192?31:(240&I)==224?15:7;let L,M=0;for(;(L=63&this.interim[++M])&&M<4;)I<<=6,I|=L;const b=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=b-M;for(;m<T;){if(m>=v)return 0;if(L=c[m++],(192&L)!=128){m--,k=!0;break}this.interim[M++]=L,I<<=6,I|=63&L}k||(b===2?I<128?m--:g[f++]=I:b===3?I<2048||I>=55296&&I<=57343||I===65279||(g[f++]=I):I<65536||I>1114111||(g[f++]=I)),this.interim.fill(0)}const p=v-4;let d=m;for(;d<v;){for(;!(!(d<p)||128&(h=c[d])||128&(y=c[d+1])||128&(S=c[d+2])||128&(E=c[d+3]));)g[f++]=h,g[f++]=y,g[f++]=S,g[f++]=E,d+=4;if(h=c[d++],h<128)g[f++]=h;else if((224&h)==192){if(d>=v)return this.interim[0]=h,f;if(y=c[d++],(192&y)!=128){d--;continue}if(a=(31&h)<<6|63&y,a<128){d--;continue}g[f++]=a}else if((240&h)==224){if(d>=v)return this.interim[0]=h,f;if(y=c[d++],(192&y)!=128){d--;continue}if(d>=v)return this.interim[0]=h,this.interim[1]=y,f;if(S=c[d++],(192&S)!=128){d--;continue}if(a=(15&h)<<12|(63&y)<<6|63&S,a<2048||a>=55296&&a<=57343||a===65279)continue;g[f++]=a}else if((248&h)==240){if(d>=v)return this.interim[0]=h,f;if(y=c[d++],(192&y)!=128){d--;continue}if(d>=v)return this.interim[0]=h,this.interim[1]=y,f;if(S=c[d++],(192&S)!=128){d--;continue}if(d>=v)return this.interim[0]=h,this.interim[1]=y,this.interim[2]=S,f;if(E=c[d++],(192&E)!=128){d--;continue}if(a=(7&h)<<18|(63&y)<<12|(63&S)<<6|63&E,a<65536||a>1114111)continue;g[f++]=a}}return f}}},225:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const g=c(1480),v=[[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]],h=[[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 y;r.UnicodeV6=class{constructor(){if(this.version="6",!y){y=new Uint8Array(65536),y.fill(1),y[0]=0,y.fill(0,1,32),y.fill(0,127,160),y.fill(2,4352,4448),y[9001]=2,y[9002]=2,y.fill(2,11904,42192),y[12351]=1,y.fill(2,44032,55204),y.fill(2,63744,64256),y.fill(2,65040,65050),y.fill(2,65072,65136),y.fill(2,65280,65377),y.fill(2,65504,65511);for(let S=0;S<v.length;++S)y.fill(0,v[S][0],v[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?y[S]:(function(E,f){let a,m=0,p=f.length-1;if(E<f[0][0]||E>f[p][1])return!1;for(;p>=m;)if(a=m+p>>1,E>f[a][1])m=a+1;else{if(!(E<f[a][0]))return!0;p=a-1}return!1})(S,h)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,E){let f=this.wcwidth(S),a=f===0&&E!==0;if(a){const m=g.UnicodeService.extractWidth(E);m===0?a=!1:m>f&&(f=m)}return g.UnicodeService.createPropertyValue(0,f,a)}}},5981:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const g=c(8460),v=c(844);class h extends v.Disposable{constructor(S){super(),this._action=S,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new g.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,E){if(E!==void 0&&this._syncCalls>E)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let f;for(this._isSyncWriting=!0;f=this._writeBuffer.shift();){this._action(f);const a=this._callbacks.shift();a&&a()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,E){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(E),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(E)}_innerWrite(S=0,E=!0){const f=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const a=this._writeBuffer[this._bufferOffset],m=this._action(a,E);if(m){const d=k=>Date.now()-f>=12?setTimeout((()=>this._innerWrite(0,k))):this._innerWrite(f,k);return void m.catch((k=>(queueMicrotask((()=>{throw k})),Promise.resolve(!1)))).then(d)}const p=this._callbacks[this._bufferOffset];if(p&&p(),this._bufferOffset++,this._pendingData-=a.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()}}r.WriteBuffer=h},5941:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.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})$/,g=/^[\da-f]+$/;function v(h,y){const S=h.toString(16),E=S.length<2?"0"+S:S;switch(y){case 4:return S[0];case 8:return E;case 12:return(E+E).slice(0,3);default:return E+E}}r.parseColor=function(h){if(!h)return;let y=h.toLowerCase();if(y.indexOf("rgb:")===0){y=y.slice(4);const S=c.exec(y);if(S){const E=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/E*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/E*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/E*255)]}}else if(y.indexOf("#")===0&&(y=y.slice(1),g.exec(y)&&[3,6,9,12].includes(y.length))){const S=y.length/3,E=[0,0,0];for(let f=0;f<3;++f){const a=parseInt(y.slice(S*f,S*f+S),16);E[f]=S===1?a<<4:S===2?a:S===3?a>>4:a>>8}return E}},r.toRgbString=function(h,y=16){const[S,E,f]=h;return`rgb:${v(S,y)}/${v(E,y)}/${v(f,y)}`}},5770:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const g=c(482),v=c(8742),h=c(5770),y=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=y,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=y}registerHandler(E,f){this._handlers[E]===void 0&&(this._handlers[E]=[]);const a=this._handlers[E];return a.push(f),{dispose:()=>{const m=a.indexOf(f);m!==-1&&a.splice(m,1)}}}clearHandler(E){this._handlers[E]&&delete this._handlers[E]}setHandlerFallback(E){this._handlerFb=E}reset(){if(this._active.length)for(let E=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;E>=0;--E)this._active[E].unhook(!1);this._stack.paused=!1,this._active=y,this._ident=0}hook(E,f){if(this.reset(),this._ident=E,this._active=this._handlers[E]||y,this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].hook(f);else this._handlerFb(this._ident,"HOOK",f)}put(E,f,a){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(E,f,a);else this._handlerFb(this._ident,"PUT",(0,g.utf32ToString)(E,f,a))}unhook(E,f=!0){if(this._active.length){let a=!1,m=this._active.length-1,p=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,a=f,p=this._stack.fallThrough,this._stack.paused=!1),!p&&a===!1){for(;m>=0&&(a=this._active[m].unhook(E),a!==!0);m--)if(a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,a;m--}for(;m>=0;m--)if(a=this._active[m].unhook(!1),a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,a}else this._handlerFb(this._ident,"UNHOOK",E);this._active=y,this._ident=0}};const S=new v.Params;S.addParam(0),r.DcsHandler=class{constructor(E){this._handler=E,this._data="",this._params=S,this._hitLimit=!1}hook(E){this._params=E.length>1||E.params[0]?E.clone():S,this._data="",this._hitLimit=!1}put(E,f,a){this._hitLimit||(this._data+=(0,g.utf32ToString)(E,f,a),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(E){let f=!1;if(this._hitLimit)f=!1;else if(E&&(f=this._handler(this._data,this._params),f instanceof Promise))return f.then((a=>(this._params=S,this._data="",this._hitLimit=!1,a)));return this._params=S,this._data="",this._hitLimit=!1,f}}},2015:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const g=c(844),v=c(8742),h=c(6242),y=c(6351);class S{constructor(m){this.table=new Uint8Array(m)}setDefault(m,p){this.table.fill(m<<4|p)}add(m,p,d,k){this.table[p<<8|m]=d<<4|k}addMany(m,p,d,k){for(let I=0;I<m.length;I++)this.table[p<<8|m[I]]=d<<4|k}}r.TransitionTable=S;const E=160;r.VT500_TRANSITION_TABLE=(function(){const a=new S(4095),m=Array.apply(null,Array(256)).map(((M,b)=>b)),p=(M,b)=>m.slice(M,b),d=p(32,127),k=p(0,24);k.push(25),k.push.apply(k,p(28,32));const I=p(0,14);let L;for(L in a.setDefault(1,0),a.addMany(d,0,2,0),I)a.addMany([24,26,153,154],L,3,0),a.addMany(p(128,144),L,3,0),a.addMany(p(144,152),L,3,0),a.add(156,L,0,0),a.add(27,L,11,1),a.add(157,L,4,8),a.addMany([152,158,159],L,0,7),a.add(155,L,11,3),a.add(144,L,11,9);return a.addMany(k,0,3,0),a.addMany(k,1,3,1),a.add(127,1,0,1),a.addMany(k,8,0,8),a.addMany(k,3,3,3),a.add(127,3,0,3),a.addMany(k,4,3,4),a.add(127,4,0,4),a.addMany(k,6,3,6),a.addMany(k,5,3,5),a.add(127,5,0,5),a.addMany(k,2,3,2),a.add(127,2,0,2),a.add(93,1,4,8),a.addMany(d,8,5,8),a.add(127,8,5,8),a.addMany([156,27,24,26,7],8,6,0),a.addMany(p(28,32),8,0,8),a.addMany([88,94,95],1,0,7),a.addMany(d,7,0,7),a.addMany(k,7,0,7),a.add(156,7,0,0),a.add(127,7,0,7),a.add(91,1,11,3),a.addMany(p(64,127),3,7,0),a.addMany(p(48,60),3,8,4),a.addMany([60,61,62,63],3,9,4),a.addMany(p(48,60),4,8,4),a.addMany(p(64,127),4,7,0),a.addMany([60,61,62,63],4,0,6),a.addMany(p(32,64),6,0,6),a.add(127,6,0,6),a.addMany(p(64,127),6,0,0),a.addMany(p(32,48),3,9,5),a.addMany(p(32,48),5,9,5),a.addMany(p(48,64),5,0,6),a.addMany(p(64,127),5,7,0),a.addMany(p(32,48),4,9,5),a.addMany(p(32,48),1,9,2),a.addMany(p(32,48),2,9,2),a.addMany(p(48,127),2,10,0),a.addMany(p(48,80),1,10,0),a.addMany(p(81,88),1,10,0),a.addMany([89,90,92],1,10,0),a.addMany(p(96,127),1,10,0),a.add(80,1,11,9),a.addMany(k,9,0,9),a.add(127,9,0,9),a.addMany(p(28,32),9,0,9),a.addMany(p(32,48),9,9,12),a.addMany(p(48,60),9,8,10),a.addMany([60,61,62,63],9,9,10),a.addMany(k,11,0,11),a.addMany(p(32,128),11,0,11),a.addMany(p(28,32),11,0,11),a.addMany(k,10,0,10),a.add(127,10,0,10),a.addMany(p(28,32),10,0,10),a.addMany(p(48,60),10,8,10),a.addMany([60,61,62,63],10,0,11),a.addMany(p(32,48),10,9,12),a.addMany(k,12,0,12),a.add(127,12,0,12),a.addMany(p(28,32),12,0,12),a.addMany(p(32,48),12,9,12),a.addMany(p(48,64),12,0,11),a.addMany(p(64,127),12,12,13),a.addMany(p(64,127),10,12,13),a.addMany(p(64,127),9,12,13),a.addMany(k,13,13,13),a.addMany(d,13,13,13),a.add(127,13,0,13),a.addMany([27,156,24,26],13,14,0),a.add(E,0,2,0),a.add(E,8,5,8),a.add(E,6,0,6),a.add(E,11,0,11),a.add(E,13,13,13),a})();class f extends g.Disposable{constructor(m=r.VT500_TRANSITION_TABLE){super(),this._transitions=m,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new v.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(p,d,k)=>{},this._executeHandlerFb=p=>{},this._csiHandlerFb=(p,d)=>{},this._escHandlerFb=p=>{},this._errorHandlerFb=p=>p,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,g.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new y.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(m,p=[64,126]){let d=0;if(m.prefix){if(m.prefix.length>1)throw new Error("only one byte as prefix supported");if(d=m.prefix.charCodeAt(0),d&&60>d||d>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(m.intermediates){if(m.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let I=0;I<m.intermediates.length;++I){const L=m.intermediates.charCodeAt(I);if(32>L||L>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");d<<=8,d|=L}}if(m.final.length!==1)throw new Error("final must be a single byte");const k=m.final.charCodeAt(0);if(p[0]>k||k>p[1])throw new Error(`final must be in range ${p[0]} .. ${p[1]}`);return d<<=8,d|=k,d}identToString(m){const p=[];for(;m;)p.push(String.fromCharCode(255&m)),m>>=8;return p.reverse().join("")}setPrintHandler(m){this._printHandler=m}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(m,p){const d=this._identifier(m,[48,126]);this._escHandlers[d]===void 0&&(this._escHandlers[d]=[]);const k=this._escHandlers[d];return k.push(p),{dispose:()=>{const I=k.indexOf(p);I!==-1&&k.splice(I,1)}}}clearEscHandler(m){this._escHandlers[this._identifier(m,[48,126])]&&delete this._escHandlers[this._identifier(m,[48,126])]}setEscHandlerFallback(m){this._escHandlerFb=m}setExecuteHandler(m,p){this._executeHandlers[m.charCodeAt(0)]=p}clearExecuteHandler(m){this._executeHandlers[m.charCodeAt(0)]&&delete this._executeHandlers[m.charCodeAt(0)]}setExecuteHandlerFallback(m){this._executeHandlerFb=m}registerCsiHandler(m,p){const d=this._identifier(m);this._csiHandlers[d]===void 0&&(this._csiHandlers[d]=[]);const k=this._csiHandlers[d];return k.push(p),{dispose:()=>{const I=k.indexOf(p);I!==-1&&k.splice(I,1)}}}clearCsiHandler(m){this._csiHandlers[this._identifier(m)]&&delete this._csiHandlers[this._identifier(m)]}setCsiHandlerFallback(m){this._csiHandlerFb=m}registerDcsHandler(m,p){return this._dcsParser.registerHandler(this._identifier(m),p)}clearDcsHandler(m){this._dcsParser.clearHandler(this._identifier(m))}setDcsHandlerFallback(m){this._dcsParser.setHandlerFallback(m)}registerOscHandler(m,p){return this._oscParser.registerHandler(m,p)}clearOscHandler(m){this._oscParser.clearHandler(m)}setOscHandlerFallback(m){this._oscParser.setHandlerFallback(m)}setErrorHandler(m){this._errorHandler=m}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(m,p,d,k,I){this._parseStack.state=m,this._parseStack.handlers=p,this._parseStack.handlerPos=d,this._parseStack.transition=k,this._parseStack.chunkPos=I}parse(m,p,d){let k,I=0,L=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(d===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const b=this._parseStack.handlers;let T=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(d===!1&&T>-1){for(;T>=0&&(k=b[T](this._params),k!==!0);T--)if(k instanceof Promise)return this._parseStack.handlerPos=T,k}this._parseStack.handlers=[];break;case 4:if(d===!1&&T>-1){for(;T>=0&&(k=b[T](),k!==!0);T--)if(k instanceof Promise)return this._parseStack.handlerPos=T,k}this._parseStack.handlers=[];break;case 6:if(I=m[this._parseStack.chunkPos],k=this._dcsParser.unhook(I!==24&&I!==26,d),k)return k;I===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(I=m[this._parseStack.chunkPos],k=this._oscParser.end(I!==24&&I!==26,d),k)return k;I===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let b=M;b<p;++b){switch(I=m[b],L=this._transitions.table[this.currentState<<8|(I<160?I:E)],L>>4){case 2:for(let F=b+1;;++F){if(F>=p||(I=m[F])<32||I>126&&I<E){this._printHandler(m,b,F),b=F-1;break}if(++F>=p||(I=m[F])<32||I>126&&I<E){this._printHandler(m,b,F),b=F-1;break}if(++F>=p||(I=m[F])<32||I>126&&I<E){this._printHandler(m,b,F),b=F-1;break}if(++F>=p||(I=m[F])<32||I>126&&I<E){this._printHandler(m,b,F),b=F-1;break}}break;case 3:this._executeHandlers[I]?this._executeHandlers[I]():this._executeHandlerFb(I),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:b,code:I,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const T=this._csiHandlers[this._collect<<8|I];let N=T?T.length-1:-1;for(;N>=0&&(k=T[N](this._params),k!==!0);N--)if(k instanceof Promise)return this._preserveStack(3,T,N,L,b),k;N<0&&this._csiHandlerFb(this._collect<<8|I,this._params),this.precedingJoinState=0;break;case 8:do switch(I){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(I-48)}while(++b<p&&(I=m[b])>47&&I<60);b--;break;case 9:this._collect<<=8,this._collect|=I;break;case 10:const O=this._escHandlers[this._collect<<8|I];let B=O?O.length-1:-1;for(;B>=0&&(k=O[B](),k!==!0);B--)if(k instanceof Promise)return this._preserveStack(4,O,B,L,b),k;B<0&&this._escHandlerFb(this._collect<<8|I),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|I,this._params);break;case 13:for(let F=b+1;;++F)if(F>=p||(I=m[F])===24||I===26||I===27||I>127&&I<E){this._dcsParser.put(m,b,F),b=F-1;break}break;case 14:if(k=this._dcsParser.unhook(I!==24&&I!==26),k)return this._preserveStack(6,[],0,L,b),k;I===27&&(L|=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 F=b+1;;F++)if(F>=p||(I=m[F])<32||I>127&&I<E){this._oscParser.put(m,b,F),b=F-1;break}break;case 6:if(k=this._oscParser.end(I!==24&&I!==26),k)return this._preserveStack(5,[],0,L,b),k;I===27&&(L|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&L}}}r.EscapeSequenceParser=f},6242:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const g=c(5770),v=c(482),h=[];r.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(y,S){this._handlers[y]===void 0&&(this._handlers[y]=[]);const E=this._handlers[y];return E.push(S),{dispose:()=>{const f=E.indexOf(S);f!==-1&&E.splice(f,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].start();else this._handlerFb(this._id,"START")}_put(y,S,E){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(y,S,E);else this._handlerFb(this._id,"PUT",(0,v.utf32ToString)(y,S,E))}start(){this.reset(),this._state=1}put(y,S,E){if(this._state!==3){if(this._state===1)for(;S<E;){const f=y[S++];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&&E-S>0&&this._put(y,S,E)}}end(y,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let E=!1,f=this._active.length-1,a=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,E=S,a=this._stack.fallThrough,this._stack.paused=!1),!a&&E===!1){for(;f>=0&&(E=this._active[f].end(y),E!==!0);f--)if(E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,E;f--}for(;f>=0;f--)if(E=this._active[f].end(!1),E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,E}else this._handlerFb(this._id,"END",y);this._active=h,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(y){this._handler=y,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(y,S,E){this._hitLimit||(this._data+=(0,v.utf32ToString)(y,S,E),this._data.length>g.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(y){let S=!1;if(this._hitLimit)S=!1;else if(y&&(S=this._handler(this._data),S instanceof Promise))return S.then((E=>(this._data="",this._hitLimit=!1,E)));return this._data="",this._hitLimit=!1,S}}},8742:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const c=2147483647;class g{static fromArray(h){const y=new g;if(!h.length)return y;for(let S=Array.isArray(h[0])?1:0;S<h.length;++S){const E=h[S];if(Array.isArray(E))for(let f=0;f<E.length;++f)y.addSubParam(E[f]);else y.addParam(E)}return y}constructor(h=32,y=32){if(this.maxLength=h,this.maxSubParamsLength=y,y>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(y),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new g(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let y=0;y<this.length;++y){h.push(this.params[y]);const S=this._subParamsIdx[y]>>8,E=255&this._subParamsIdx[y];E-S>0&&h.push(Array.prototype.slice.call(this._subParams,S,E))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>c?c:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>c?c:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const y=this._subParamsIdx[h]>>8,S=255&this._subParamsIdx[h];return S-y>0?this._subParams.subarray(y,S):null}getSubParamsAll(){const h={};for(let y=0;y<this.length;++y){const S=this._subParamsIdx[y]>>8,E=255&this._subParamsIdx[y];E-S>0&&(h[y]=this._subParams.slice(S,E))}return h}addDigit(h){let y;if(this._rejectDigits||!(y=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,E=S[y-1];S[y-1]=~E?Math.min(10*E+h,c):h}}r.Params=g},5741:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,g){const v={instance:g,dispose:g.dispose,isDisposed:!1};this._addons.push(v),g.dispose=()=>this._wrappedAddonDispose(v),g.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let g=-1;for(let v=0;v<this._addons.length;v++)if(this._addons[v]===c){g=v;break}if(g===-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(g,1)}}},8771:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const g=c(3785),v=c(511);r.BufferApiView=class{constructor(h,y){this._buffer=h,this.type=y}init(h){return this._buffer=h,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(h){const y=this._buffer.lines.get(h);if(y)return new g.BufferLineApiView(y)}getNullCell(){return new v.CellData}}},3785:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const g=c(511);r.BufferLineApiView=class{constructor(v){this._line=v}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(v,h){if(!(v<0||v>=this._line.length))return h?(this._line.loadCell(v,h),h):this._line.loadCell(v,new g.CellData)}translateToString(v,h,y){return this._line.translateToString(v,h,y)}}},8285:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const g=c(8771),v=c(8460),h=c(844);class y extends h.Disposable{constructor(E){super(),this._core=E,this._onBufferChange=this.register(new v.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new g.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new g.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)}}r.BufferNamespaceApi=y},7975:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,g){return this._core.registerCsiHandler(c,(v=>g(v.toArray())))}addCsiHandler(c,g){return this.registerCsiHandler(c,g)}registerDcsHandler(c,g){return this._core.registerDcsHandler(c,((v,h)=>g(v,h.toArray())))}addDcsHandler(c,g){return this.registerDcsHandler(c,g)}registerEscHandler(c,g){return this._core.registerEscHandler(c,g)}addEscHandler(c,g){return this.registerEscHandler(c,g)}registerOscHandler(c,g){return this._core.registerOscHandler(c,g)}addOscHandler(c,g){return this.registerOscHandler(c,g)}}},7090:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.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(x,r,c){var g=this&&this.__decorate||function(a,m,p,d){var k,I=arguments.length,L=I<3?m:d===null?d=Object.getOwnPropertyDescriptor(m,p):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(a,m,p,d);else for(var M=a.length-1;M>=0;M--)(k=a[M])&&(L=(I<3?k(L):I>3?k(m,p,L):k(m,p))||L);return I>3&&L&&Object.defineProperty(m,p,L),L},v=this&&this.__param||function(a,m){return function(p,d){m(p,d,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const h=c(8460),y=c(844),S=c(5295),E=c(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let f=r.BufferService=class extends y.Disposable{get buffer(){return this.buffers.active}constructor(a){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(a.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(a.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(a,this))}resize(a,m){this.cols=a,this.rows=m,this.buffers.resize(a,m),this._onResize.fire({cols:a,rows:m})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(a,m=!1){const p=this.buffer;let d;d=this._cachedBlankLine,d&&d.length===this.cols&&d.getFg(0)===a.fg&&d.getBg(0)===a.bg||(d=p.getBlankLine(a,m),this._cachedBlankLine=d),d.isWrapped=m;const k=p.ybase+p.scrollTop,I=p.ybase+p.scrollBottom;if(p.scrollTop===0){const L=p.lines.isFull;I===p.lines.length-1?L?p.lines.recycle().copyFrom(d):p.lines.push(d.clone()):p.lines.splice(I+1,0,d.clone()),L?this.isUserScrolling&&(p.ydisp=Math.max(p.ydisp-1,0)):(p.ybase++,this.isUserScrolling||p.ydisp++)}else{const L=I-k+1;p.lines.shiftElements(k+1,L-1,-1),p.lines.set(I,d.clone())}this.isUserScrolling||(p.ydisp=p.ybase),this._onScroll.fire(p.ydisp)}scrollLines(a,m,p){const d=this.buffer;if(a<0){if(d.ydisp===0)return;this.isUserScrolling=!0}else a+d.ydisp>=d.ybase&&(this.isUserScrolling=!1);const k=d.ydisp;d.ydisp=Math.max(Math.min(d.ydisp+a,d.ybase),0),k!==d.ydisp&&(m||this._onScroll.fire(d.ydisp))}};r.BufferService=f=g([v(0,E.IOptionsService)],f)},7994:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.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,g){this._charsets[c]=g,this.glevel===c&&(this.charset=g)}}},1753:function(x,r,c){var g=this&&this.__decorate||function(d,k,I,L){var M,b=arguments.length,T=b<3?k:L===null?L=Object.getOwnPropertyDescriptor(k,I):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(d,k,I,L);else for(var N=d.length-1;N>=0;N--)(M=d[N])&&(T=(b<3?M(T):b>3?M(k,I,T):M(k,I))||T);return b>3&&T&&Object.defineProperty(k,I,T),T},v=this&&this.__param||function(d,k){return function(I,L){k(I,L,d)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const h=c(2585),y=c(8460),S=c(844),E={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:d=>d.button!==4&&d.action===1&&(d.ctrl=!1,d.alt=!1,d.shift=!1,!0)},VT200:{events:19,restrict:d=>d.action!==32},DRAG:{events:23,restrict:d=>d.action!==32||d.button!==3},ANY:{events:31,restrict:d=>!0}};function f(d,k){let I=(d.ctrl?16:0)|(d.shift?4:0)|(d.alt?8:0);return d.button===4?(I|=64,I|=d.action):(I|=3&d.button,4&d.button&&(I|=64),8&d.button&&(I|=128),d.action===32?I|=32:d.action!==0||k||(I|=3)),I}const a=String.fromCharCode,m={DEFAULT:d=>{const k=[f(d,!1)+32,d.col+32,d.row+32];return k[0]>255||k[1]>255||k[2]>255?"":`\x1B[M${a(k[0])}${a(k[1])}${a(k[2])}`},SGR:d=>{const k=d.action===0&&d.button!==4?"m":"M";return`\x1B[<${f(d,!0)};${d.col};${d.row}${k}`},SGR_PIXELS:d=>{const k=d.action===0&&d.button!==4?"m":"M";return`\x1B[<${f(d,!0)};${d.x};${d.y}${k}`}};let p=r.CoreMouseService=class extends S.Disposable{constructor(d,k){super(),this._bufferService=d,this._coreService=k,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new y.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const I of Object.keys(E))this.addProtocol(I,E[I]);for(const I of Object.keys(m))this.addEncoding(I,m[I]);this.reset()}addProtocol(d,k){this._protocols[d]=k}addEncoding(d,k){this._encodings[d]=k}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(d){if(!this._protocols[d])throw new Error(`unknown protocol "${d}"`);this._activeProtocol=d,this._onProtocolChange.fire(this._protocols[d].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(d){if(!this._encodings[d])throw new Error(`unknown encoding "${d}"`);this._activeEncoding=d}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(d){if(d.col<0||d.col>=this._bufferService.cols||d.row<0||d.row>=this._bufferService.rows||d.button===4&&d.action===32||d.button===3&&d.action!==32||d.button!==4&&(d.action===2||d.action===3)||(d.col++,d.row++,d.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,d,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(d))return!1;const k=this._encodings[this._activeEncoding](d);return k&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(k):this._coreService.triggerDataEvent(k,!0)),this._lastEvent=d,!0}explainEvents(d){return{down:!!(1&d),up:!!(2&d),drag:!!(4&d),move:!!(8&d),wheel:!!(16&d)}}_equalEvents(d,k,I){if(I){if(d.x!==k.x||d.y!==k.y)return!1}else if(d.col!==k.col||d.row!==k.row)return!1;return d.button===k.button&&d.action===k.action&&d.ctrl===k.ctrl&&d.alt===k.alt&&d.shift===k.shift}};r.CoreMouseService=p=g([v(0,h.IBufferService),v(1,h.ICoreService)],p)},6975:function(x,r,c){var g=this&&this.__decorate||function(p,d,k,I){var L,M=arguments.length,b=M<3?d:I===null?I=Object.getOwnPropertyDescriptor(d,k):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(p,d,k,I);else for(var T=p.length-1;T>=0;T--)(L=p[T])&&(b=(M<3?L(b):M>3?L(d,k,b):L(d,k))||b);return M>3&&b&&Object.defineProperty(d,k,b),b},v=this&&this.__param||function(p,d){return function(k,I){d(k,I,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const h=c(1439),y=c(8460),S=c(844),E=c(2585),f=Object.freeze({insertMode:!1}),a=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let m=r.CoreService=class extends S.Disposable{constructor(p,d,k){super(),this._bufferService=p,this._logService=d,this._optionsService=k,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new y.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new y.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(f),this.decPrivateModes=(0,h.clone)(a)}reset(){this.modes=(0,h.clone)(f),this.decPrivateModes=(0,h.clone)(a)}triggerDataEvent(p,d=!1){if(this._optionsService.rawOptions.disableStdin)return;const k=this._bufferService.buffer;d&&this._optionsService.rawOptions.scrollOnUserInput&&k.ybase!==k.ydisp&&this._onRequestScrollToBottom.fire(),d&&this._onUserInput.fire(),this._logService.debug(`sending data "${p}"`,(()=>p.split("").map((I=>I.charCodeAt(0))))),this._onData.fire(p)}triggerBinaryEvent(p){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${p}"`,(()=>p.split("").map((d=>d.charCodeAt(0))))),this._onBinary.fire(p))}};r.CoreService=m=g([v(0,E.IBufferService),v(1,E.ILogService),v(2,E.IOptionsService)],m)},9074:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const g=c(8055),v=c(8460),h=c(844),y=c(6106);let S=0,E=0;class f extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new y.SortedList((p=>p==null?void 0:p.marker.line)),this._onDecorationRegistered=this.register(new v.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new v.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(p){if(p.marker.isDisposed)return;const d=new a(p);if(d){const k=d.marker.onDispose((()=>d.dispose()));d.onDispose((()=>{d&&(this._decorations.delete(d)&&this._onDecorationRemoved.fire(d),k.dispose())})),this._decorations.insert(d),this._onDecorationRegistered.fire(d)}return d}reset(){for(const p of this._decorations.values())p.dispose();this._decorations.clear()}*getDecorationsAtCell(p,d,k){let I=0,L=0;for(const M of this._decorations.getKeyIterator(d))I=M.options.x??0,L=I+(M.options.width??1),p>=I&&p<L&&(!k||(M.options.layer??"bottom")===k)&&(yield M)}forEachDecorationAtCell(p,d,k,I){this._decorations.forEachByKey(d,(L=>{S=L.options.x??0,E=S+(L.options.width??1),p>=S&&p<E&&(!k||(L.options.layer??"bottom")===k)&&I(L)}))}}r.DecorationService=f;class a extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=g.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=g.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(p){super(),this.options=p,this.onRenderEmitter=this.register(new v.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new v.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=p.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const g=c(2585),v=c(8343);class h{constructor(...S){this._entries=new Map;for(const[E,f]of S)this.set(E,f)}set(S,E){const f=this._entries.get(S);return this._entries.set(S,E),f}forEach(S){for(const[E,f]of this._entries.entries())S(E,f)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}r.ServiceCollection=h,r.InstantiationService=class{constructor(){this._services=new h,this._services.set(g.IInstantiationService,this)}setService(y,S){this._services.set(y,S)}getService(y){return this._services.get(y)}createInstance(y,...S){const E=(0,v.getServiceDependencies)(y).sort(((m,p)=>m.index-p.index)),f=[];for(const m of E){const p=this._services.get(m.id);if(!p)throw new Error(`[createInstance] ${y.name} depends on UNKNOWN service ${m.id}.`);f.push(p)}const a=E.length>0?E[0].index:S.length;if(S.length!==a)throw new Error(`[createInstance] First service dependency of ${y.name} at position ${a+1} conflicts with ${S.length} static arguments`);return new y(...S,...f)}}},7866:function(x,r,c){var g=this&&this.__decorate||function(a,m,p,d){var k,I=arguments.length,L=I<3?m:d===null?d=Object.getOwnPropertyDescriptor(m,p):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(a,m,p,d);else for(var M=a.length-1;M>=0;M--)(k=a[M])&&(L=(I<3?k(L):I>3?k(m,p,L):k(m,p))||L);return I>3&&L&&Object.defineProperty(m,p,L),L},v=this&&this.__param||function(a,m){return function(p,d){m(p,d,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const h=c(844),y=c(2585),S={trace:y.LogLevelEnum.TRACE,debug:y.LogLevelEnum.DEBUG,info:y.LogLevelEnum.INFO,warn:y.LogLevelEnum.WARN,error:y.LogLevelEnum.ERROR,off:y.LogLevelEnum.OFF};let E,f=r.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(a){super(),this._optionsService=a,this._logLevel=y.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(a){for(let m=0;m<a.length;m++)typeof a[m]=="function"&&(a[m]=a[m]())}_log(a,m,p){this._evalLazyOptionalParams(p),a.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+m,...p)}trace(a,...m){var p;this._logLevel<=y.LogLevelEnum.TRACE&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.trace.bind(this._optionsService.options.logger))??console.log,a,m)}debug(a,...m){var p;this._logLevel<=y.LogLevelEnum.DEBUG&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.debug.bind(this._optionsService.options.logger))??console.log,a,m)}info(a,...m){var p;this._logLevel<=y.LogLevelEnum.INFO&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.info.bind(this._optionsService.options.logger))??console.info,a,m)}warn(a,...m){var p;this._logLevel<=y.LogLevelEnum.WARN&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.warn.bind(this._optionsService.options.logger))??console.warn,a,m)}error(a,...m){var p;this._logLevel<=y.LogLevelEnum.ERROR&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.error.bind(this._optionsService.options.logger))??console.error,a,m)}};r.LogService=f=g([v(0,y.IOptionsService)],f),r.setTraceLogger=function(a){E=a},r.traceCall=function(a,m,p){if(typeof p.value!="function")throw new Error("not supported");const d=p.value;p.value=function(...k){if(E.logLevel!==y.LogLevelEnum.TRACE)return d.apply(this,k);E.trace(`GlyphRenderer#${d.name}(${k.map((L=>JSON.stringify(L))).join(", ")})`);const I=d.apply(this,k);return E.trace(`GlyphRenderer#${d.name} return`,I),I}}},7302:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const g=c(8460),v=c(844),h=c(6114);r.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:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const y=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends v.Disposable{constructor(f){super(),this._onOptionChange=this.register(new g.EventEmitter),this.onOptionChange=this._onOptionChange.event;const a={...r.DEFAULT_OPTIONS};for(const m in f)if(m in a)try{const p=f[m];a[m]=this._sanitizeAndValidateOption(m,p)}catch(p){console.error(p)}this.rawOptions=a,this.options={...a},this._setupOptions(),this.register((0,v.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(f,a){return this.onOptionChange((m=>{m===f&&a(this.rawOptions[f])}))}onMultipleOptionChange(f,a){return this.onOptionChange((m=>{f.indexOf(m)!==-1&&a()}))}_setupOptions(){const f=m=>{if(!(m in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${m}"`);return this.rawOptions[m]},a=(m,p)=>{if(!(m in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${m}"`);p=this._sanitizeAndValidateOption(m,p),this.rawOptions[m]!==p&&(this.rawOptions[m]=p,this._onOptionChange.fire(m))};for(const m in this.rawOptions){const p={get:f.bind(this,m),set:a.bind(this,m)};Object.defineProperty(this.options,m,p)}}_sanitizeAndValidateOption(f,a){switch(f){case"cursorStyle":if(a||(a=r.DEFAULT_OPTIONS[f]),!(function(m){return m==="block"||m==="underline"||m==="bar"})(a))throw new Error(`"${a}" is not a valid value for ${f}`);break;case"wordSeparator":a||(a=r.DEFAULT_OPTIONS[f]);break;case"fontWeight":case"fontWeightBold":if(typeof a=="number"&&1<=a&&a<=1e3)break;a=y.includes(a)?a:r.DEFAULT_OPTIONS[f];break;case"cursorWidth":a=Math.floor(a);case"lineHeight":case"tabStopWidth":if(a<1)throw new Error(`${f} cannot be less than 1, value: ${a}`);break;case"minimumContrastRatio":a=Math.max(1,Math.min(21,Math.round(10*a)/10));break;case"scrollback":if((a=Math.min(a,4294967295))<0)throw new Error(`${f} cannot be less than 0, value: ${a}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(a<=0)throw new Error(`${f} cannot be less than or equal to 0, value: ${a}`);break;case"rows":case"cols":if(!a&&a!==0)throw new Error(`${f} must be numeric, value: ${a}`);break;case"windowsPty":a=a??{}}return a}}r.OptionsService=S},2660:function(x,r,c){var g=this&&this.__decorate||function(S,E,f,a){var m,p=arguments.length,d=p<3?E:a===null?a=Object.getOwnPropertyDescriptor(E,f):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(S,E,f,a);else for(var k=S.length-1;k>=0;k--)(m=S[k])&&(d=(p<3?m(d):p>3?m(E,f,d):m(E,f))||d);return p>3&&d&&Object.defineProperty(E,f,d),d},v=this&&this.__param||function(S,E){return function(f,a){E(f,a,S)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const h=c(2585);let y=r.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const E=this._bufferService.buffer;if(S.id===void 0){const k=E.addMarker(E.ybase+E.y),I={data:S,id:this._nextId++,lines:[k]};return k.onDispose((()=>this._removeMarkerFromLink(I,k))),this._dataByLinkId.set(I.id,I),I.id}const f=S,a=this._getEntryIdKey(f),m=this._entriesWithId.get(a);if(m)return this.addLineToLink(m.id,E.ybase+E.y),m.id;const p=E.addMarker(E.ybase+E.y),d={id:this._nextId++,key:this._getEntryIdKey(f),data:f,lines:[p]};return p.onDispose((()=>this._removeMarkerFromLink(d,p))),this._entriesWithId.set(d.key,d),this._dataByLinkId.set(d.id,d),d.id}addLineToLink(S,E){const f=this._dataByLinkId.get(S);if(f&&f.lines.every((a=>a.line!==E))){const a=this._bufferService.buffer.addMarker(E);f.lines.push(a),a.onDispose((()=>this._removeMarkerFromLink(f,a)))}}getLinkData(S){var E;return(E=this._dataByLinkId.get(S))==null?void 0:E.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,E){const f=S.lines.indexOf(E);f!==-1&&(S.lines.splice(f,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};r.OscLinkService=y=g([v(0,h.IBufferService)],y)},8343:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const c="di$target",g="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(v){return v[g]||[]},r.createDecorator=function(v){if(r.serviceRegistry.has(v))return r.serviceRegistry.get(v);const h=function(y,S,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,a,m){a[c]===a?a[g].push({id:f,index:m}):(a[g]=[{id:f,index:m}],a[c]=a)})(h,y,E)};return h.toString=()=>v,r.serviceRegistry.set(v,h),h}},2585:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const g=c(8343);var v;r.IBufferService=(0,g.createDecorator)("BufferService"),r.ICoreMouseService=(0,g.createDecorator)("CoreMouseService"),r.ICoreService=(0,g.createDecorator)("CoreService"),r.ICharsetService=(0,g.createDecorator)("CharsetService"),r.IInstantiationService=(0,g.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(v||(r.LogLevelEnum=v={})),r.ILogService=(0,g.createDecorator)("LogService"),r.IOptionsService=(0,g.createDecorator)("OptionsService"),r.IOscLinkService=(0,g.createDecorator)("OscLinkService"),r.IUnicodeService=(0,g.createDecorator)("UnicodeService"),r.IDecorationService=(0,g.createDecorator)("DecorationService")},1480:(x,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const g=c(8460),v=c(225);class h{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,E,f=!1){return(16777215&S)<<3|(3&E)<<1|(f?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new g.EventEmitter,this.onChange=this._onChange.event;const S=new v.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(S){if(!this._providers[S])throw new Error(`unknown Unicode version "${S}"`);this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)}register(S){this._providers[S.version]=S}wcwidth(S){return this._activeProvider.wcwidth(S)}getStringCellWidth(S){let E=0,f=0;const a=S.length;for(let m=0;m<a;++m){let p=S.charCodeAt(m);if(55296<=p&&p<=56319){if(++m>=a)return E+this.wcwidth(p);const I=S.charCodeAt(m);56320<=I&&I<=57343?p=1024*(p-55296)+I-56320+65536:E+=this.wcwidth(I)}const d=this.charProperties(p,f);let k=h.extractWidth(d);h.extractShouldJoin(d)&&(k-=h.extractWidth(f)),E+=k,f=d}return E}charProperties(S,E){return this._activeProvider.charProperties(S,E)}}r.UnicodeService=h}},u={};function _(x){var r=u[x];if(r!==void 0)return r.exports;var c=u[x]={exports:{}};return i[x].call(c.exports,c,c.exports,_),c.exports}var R={};return(()=>{var x=R;Object.defineProperty(x,"__esModule",{value:!0}),x.Terminal=void 0;const r=_(9042),c=_(3236),g=_(844),v=_(5741),h=_(8285),y=_(7975),S=_(7090),E=["cols","rows"];class f extends g.Disposable{constructor(m){super(),this._core=this.register(new c.Terminal(m)),this._addonManager=this.register(new v.AddonManager),this._publicOptions={...this._core.options};const p=k=>this._core.options[k],d=(k,I)=>{this._checkReadonlyOptions(k),this._core.options[k]=I};for(const k in this._core.options){const I={get:p.bind(this,k),set:d.bind(this,k)};Object.defineProperty(this._publicOptions,k,I)}}_checkReadonlyOptions(m){if(E.includes(m))throw new Error(`Option "${m}" 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 y.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new S.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const m=this._core.coreService.decPrivateModes;let p="none";switch(this._core.coreMouseService.activeProtocol){case"X10":p="x10";break;case"VT200":p="vt200";break;case"DRAG":p="drag";break;case"ANY":p="any"}return{applicationCursorKeysMode:m.applicationCursorKeys,applicationKeypadMode:m.applicationKeypad,bracketedPasteMode:m.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:p,originMode:m.origin,reverseWraparoundMode:m.reverseWraparound,sendFocusMode:m.sendFocus,wraparoundMode:m.wraparound}}get options(){return this._publicOptions}set options(m){for(const p in m)this._publicOptions[p]=m[p]}blur(){this._core.blur()}focus(){this._core.focus()}input(m,p=!0){this._core.input(m,p)}resize(m,p){this._verifyIntegers(m,p),this._core.resize(m,p)}open(m){this._core.open(m)}attachCustomKeyEventHandler(m){this._core.attachCustomKeyEventHandler(m)}attachCustomWheelEventHandler(m){this._core.attachCustomWheelEventHandler(m)}registerLinkProvider(m){return this._core.registerLinkProvider(m)}registerCharacterJoiner(m){return this._checkProposedApi(),this._core.registerCharacterJoiner(m)}deregisterCharacterJoiner(m){this._checkProposedApi(),this._core.deregisterCharacterJoiner(m)}registerMarker(m=0){return this._verifyIntegers(m),this._core.registerMarker(m)}registerDecoration(m){return this._checkProposedApi(),this._verifyPositiveIntegers(m.x??0,m.width??0,m.height??0),this._core.registerDecoration(m)}hasSelection(){return this._core.hasSelection()}select(m,p,d){this._verifyIntegers(m,p,d),this._core.select(m,p,d)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(m,p){this._verifyIntegers(m,p),this._core.selectLines(m,p)}dispose(){super.dispose()}scrollLines(m){this._verifyIntegers(m),this._core.scrollLines(m)}scrollPages(m){this._verifyIntegers(m),this._core.scrollPages(m)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(m){this._verifyIntegers(m),this._core.scrollToLine(m)}clear(){this._core.clear()}write(m,p){this._core.write(m,p)}writeln(m,p){this._core.write(m),this._core.write(`\r
116
- `,p)}paste(m){this._core.paste(m)}refresh(m,p){this._verifyIntegers(m,p),this._core.refresh(m,p)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(m){this._addonManager.loadAddon(this,m)}static get strings(){return r}_verifyIntegers(...m){for(const p of m)if(p===1/0||isNaN(p)||p%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...m){for(const p of m)if(p&&(p===1/0||isNaN(p)||p%1!=0||p<0))throw new Error("This API only accepts positive integers")}}x.Terminal=f})(),R})()))})(Ac)),Ac.exports}var P1=j1();function O1(n){return n.toLowerCase().startsWith("win")}function B1(n){return n.keyCode===86&&n.ctrlKey&&!n.shiftKey&&!n.altKey&&!n.metaKey}const F1=8,H1=100,$1=80,Rf=6,Mf=.02,U1=.95,W1=50;function z1(n,s){return Math.hypot(n,s)>F1}function V1(n,s){const i=n[n.length-1];if(i===void 0||s-i.t>$1)return 0;const u=n.filter(x=>i.t-x.t<=H1),_=u[0];if(_===void 0||u.length<2||i.t===_.t)return 0;const R=(_.y-i.y)/(i.t-_.t);return Math.max(-Rf,Math.min(Rf,R))}function q1(n,s){if(Math.abs(n)<Mf)return{delta:0,velocity:0};const i=Math.max(0,Math.min(W1,s)),u=n*U1**(i/16);return{delta:n*i,velocity:Math.abs(u)<Mf?0:u}}function K1(n){const s=Math.trunc(n);return{pixels:s,rest:n-s}}const G1=60;function Y1(){return new URLSearchParams(window.location.search).get("renderer")==="webgl"?"webgl":"canvas"}const Af={dark:{background:"#12141a",foreground:"#d8dee9",cursor:"#d8dee9",selectionBackground:"#2f3542"},light:{background:"#fbfbfd",foreground:"#22262e",cursor:"#22262e",selectionBackground:"#cfd8e3"}},Nf={dark:1,light:4.5};function jm({terminalId:n,connection:s,active:i,theme:u,autoFocus:_=!0,pasteOnCtrlV:R=!1}){const x=j.useRef(null),r=j.useRef(null),c=j.useRef(null),g=j.useRef(u);return g.current=u,j.useEffect(()=>{const v=x.current;if(v===null)return;const h=new P1.Terminal({convertEol:!1,cursorBlink:!0,fontFamily:'"Cascadia Mono", "Consolas", "Menlo", "DejaVu Sans Mono", monospace',fontSize:14,lineHeight:1.2,scrollback:1e4,allowProposedApi:!0,theme:Af[g.current],minimumContrastRatio:Nf[g.current]});r.current=h;const y=new M1.FitAddon;c.current=y,h.loadAddon(y),h.loadAddon(new N1.WebLinksAddon),h.open(v);let S=!1;const E=()=>{if(!(S||Y1()!=="webgl")){S=!0;try{const J=new I1.WebglAddon;J.onContextLoss(()=>J.dispose()),h.loadAddon(J)}catch{console.info("[terminal] WebGL no disponible; se usa el renderer por defecto.")}}};let f={cols:0,rows:0},a;const m=()=>v.clientWidth>0&&v.clientHeight>0,p=J=>{const{cols:Z,rows:de}=h;Z<=0||de<=0||!J&&Z===f.cols&&de===f.rows||(f={cols:Z,rows:de},s.send({type:"resize",terminalId:n,cols:Z,rows:de}))};let d={atBottom:!0,line:0},k=!1;const I=()=>{if(k||!m())return;const J=h.buffer.active;d={atBottom:J.viewportY>=J.baseY,line:J.viewportY}},L=()=>{const J=h.buffer.active;if(J.baseY===0)return;const Z=d.atBottom?J.baseY:Math.min(d.line,J.baseY);h.scrollToLine(Z>0?Z-1:Z+1),h.scrollToLine(Z)},M=h.onRender(I),b=h.onScroll(I);let T=m();const N=()=>{if(m()){try{y.fit()}catch{return}k&&(L(),k=!1),h.cols>0&&h.rows>0&&E(),p(!1)}},O=()=>{window.clearTimeout(a),a=window.setTimeout(N,G1)},B=new ResizeObserver(()=>{const J=m();k=!0,J&&!T&&L(),T=J,O()});B.observe(v),window.addEventListener("resize",O);let F=null,U=0,V=0;const X=(J,Z,de)=>{const fe=h.element;if(fe===void 0)return;const se=K1(V+J);V=se.rest,se.pixels!==0&&fe.dispatchEvent(new WheelEvent("wheel",{deltaY:se.pixels,deltaMode:WheelEvent.DOM_DELTA_PIXEL,clientX:Z,clientY:de,bubbles:!0,cancelable:!0}))},Y=()=>{window.cancelAnimationFrame(U),U=0},q=(J,Z,de)=>{let fe=J,se=performance.now();const Ee=Me=>{if(!m()){U=0;return}const Qe=q1(fe,Me-se);se=Me,X(Qe.delta,Z,de),fe=Qe.velocity,U=fe===0?0:window.requestAnimationFrame(Ee)};U=window.requestAnimationFrame(Ee)},D=(J,Z)=>{for(let de=0;de<J.length;de++){const fe=J.item(de);if(fe!==null&&fe.identifier===Z)return fe}return null},$=J=>{Y(),V=0;const Z=J.touches.length===1?J.touches.item(0):null;F=Z===null?null:{id:Z.identifier,startX:Z.clientX,startY:Z.clientY,lastX:Z.clientX,lastY:Z.clientY,moving:!1,samples:[{t:J.timeStamp,y:Z.clientY}]}},H=J=>{if(J.stopPropagation(),F===null)return;const Z=D(J.touches,F.id);if(Z===null)return;if(!F.moving){if(!z1(Z.clientX-F.startX,Z.clientY-F.startY))return;F.moving=!0}J.cancelable&&J.preventDefault();const de=F.lastY-Z.clientY;F.lastX=Z.clientX,F.lastY=Z.clientY,F.samples.push({t:J.timeStamp,y:Z.clientY}),F.samples.length>32&&F.samples.shift(),X(de,Z.clientX,Z.clientY)},K=J=>{if(F===null||D(J.changedTouches,F.id)===null)return;const Z=F;if(F=null,!Z.moving)return;const de=V1(Z.samples,J.timeStamp);de!==0&&q(de,Z.lastX,Z.lastY)},te=()=>{F=null};v.addEventListener("touchstart",$,{capture:!0,passive:!0}),v.addEventListener("touchmove",H,{capture:!0,passive:!1}),v.addEventListener("touchend",K,{capture:!0,passive:!0}),v.addEventListener("touchcancel",te,{capture:!0,passive:!0});const re=()=>{if(!(document.visibilityState!=="visible"||!m())){try{y.fit()}catch{return}p(!0)}};window.addEventListener("focus",re),document.addEventListener("visibilitychange",re),R&&h.attachCustomKeyEventHandler(J=>!B1(J));const ae=h.onData(J=>{s.send({type:"input",terminalId:n,data:J})}),ue=s.onMessage(J=>{switch(J.type){case"terminal.output":J.terminalId===n&&h.write(J.data);break;case"terminal.replay":if(J.terminalId!==n)break;h.reset(),J.truncated&&h.write(`\x1B[90m-- ${C("terminal.replayTruncated")} --\x1B[0m\r
117
- `),h.write(J.data);break;case"terminal.exit":if(J.terminalId!==n)break;h.write(`\r
118
- \x1B[90m-- ${C("terminal.exited",{code:J.exitCode})} --\x1B[0m\r
119
- `);break}}),G=()=>{if(m())try{y.fit()}catch{}const J=h.cols>0?h.cols:80,Z=h.rows>0?h.rows:24;f={cols:J,rows:Z},s.send({type:"terminal.attach",terminalId:n,cols:J,rows:Z})};G();const W=s.onReopen(G);return()=>{window.clearTimeout(a),window.removeEventListener("resize",O),window.removeEventListener("focus",re),document.removeEventListener("visibilitychange",re),B.disconnect(),Y(),v.removeEventListener("touchstart",$,{capture:!0}),v.removeEventListener("touchmove",H,{capture:!0}),v.removeEventListener("touchend",K,{capture:!0}),v.removeEventListener("touchcancel",te,{capture:!0}),M.dispose(),b.dispose(),ae.dispose(),ue(),W(),s.send({type:"terminal.detach",terminalId:n}),h.dispose(),r.current=null,c.current=null}},[n,s,R]),j.useEffect(()=>{const v=r.current;v!==null&&(v.options.theme=Af[u],v.options.minimumContrastRatio=Nf[u])},[u]),j.useEffect(()=>{if(!i)return;const v=r.current,h=c.current;if(v===null||h===null)return;const y=window.setTimeout(()=>{const S=x.current;if(!(S===null||S.clientWidth===0||S.clientHeight===0)){try{h.fit()}catch{return}_&&v.focus(),v.cols>0&&v.rows>0&&s.send({type:"resize",terminalId:n,cols:v.cols,rows:v.rows})}},0);return()=>window.clearTimeout(y)},[i,_,n,s]),l.jsx("div",{className:`terminal-surface${i?"":" terminal-surface-hidden"}`,ref:x})}function X1(){return l.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:[l.jsx("path",{d:"M1.5 8s2.4-4.5 6.5-4.5S14.5 8 14.5 8s-2.4 4.5-6.5 4.5S1.5 8 1.5 8z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),l.jsx("circle",{cx:"8",cy:"8",r:"1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),l.jsx("path",{d:"M2.5 13.5l11-11",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function Al({title:n,onHide:s,confirmText:i}){const[u,_]=j.useState(!1);return l.jsxs("span",{className:"section-hide",children:[l.jsx("button",{className:"icon-button",onClick:R=>{R.stopPropagation(),i===null?s():_(!0)},title:n,"aria-label":n,children:l.jsx(X1,{})}),u&&i!==null&&l.jsxs("span",{className:"section-hide-confirm",role:"alert",children:[l.jsx("span",{children:i}),l.jsx("button",{className:"link-button",onClick:()=>{_(!1),s()},children:C("settings.panels.consoleConfirmYes")}),l.jsx("button",{className:"link-button",onClick:()=>_(!1),children:C("common.cancel")})]})]})}const Q1=typeof navigator<"u"&&O1(navigator.platform);function J1({connection:n,shells:s,activeShellId:i,cwd:u,shellName:_,theme:R,onSelect:x,onOpen:r,onCloseShell:c,onCollapse:g,onHide:v,hideCount:h=0}){const y=_??C("console.name"),S=s.find(E=>E.terminalId===i)??s[0]??null;return l.jsxs("section",{className:"console-pane",children:[l.jsxs("header",{className:"console-header",children:[l.jsxs("div",{className:"strip-tabs",children:[s.map((E,f)=>l.jsxs("div",{className:`strip-tab${E.terminalId===(S==null?void 0:S.terminalId)?" is-active":""}${E.alive?"":" is-dead"}`,children:[l.jsx("button",{className:"strip-tab-label",onClick:()=>x(E.terminalId),title:E.alive?C("console.tab.title",{shell:E.label.length>0?E.label:y,number:f+1,cwd:u}):C("console.tab.exited",{code:E.exitCode??"?"}),children:C("console.tab.label",{number:f+1})}),l.jsx("button",{className:"strip-tab-close",onClick:()=>c(E.terminalId),title:C("console.tab.close"),children:"×"})]},E.terminalId)),_!==null&&l.jsx("button",{className:"strip-tab-new",onClick:r,title:C("console.openAnother",{shell:y,cwd:u}),children:"+"})]}),l.jsx("span",{className:"strip-spacer"}),l.jsx("button",{className:"icon-button",onClick:g,title:C("console.collapse"),children:"▾"}),v!==void 0&&l.jsx(Al,{title:C("settings.hide.console"),onHide:v,confirmText:h===0?null:C("settings.panels.consoleConfirm",{count:h})})]}),l.jsx("div",{className:"console-body",children:s.length===0?l.jsx("div",{className:"console-empty",children:_===null?l.jsx("p",{className:"panel-note",children:C("console.noShell")}):l.jsx("button",{className:"link-button",onClick:r,children:C("console.openIn",{shell:y,cwd:u})})}):l.jsx("div",{className:"terminal-stack",children:s.map(E=>l.jsx(jm,{terminalId:E.terminalId,connection:n,active:E.terminalId===(S==null?void 0:S.terminalId),theme:R,pasteOnCtrlV:Q1},E.terminalId))})})]})}const Z1=.75,eb=.9;function Pn(n){if(n<1e3)return String(n);if(n<1e6){const s=n/1e3;return`${s<100?Gr(s,1):Math.round(s)}k`}return`${Gr(n/1e6,2)}M`}function tb({usage:n,source:s,instructionsFile:i,fallbackWindow:u=null,compact:_=!1,statusLineState:R=null,onConfigure:x}){const{lastRequestTokens:r,contextWindow:c}=n;if(x!==void 0&&R!==null&&Iy(s,{state:R}))return l.jsxs("div",{className:`meter meter-idle${_?" meter-compact":""}`,title:jy(R),children:[l.jsx("span",{className:"meter-label",children:C("meter.label")}),l.jsx("span",{className:`meter-bar${_?" meter-bar-inline":""}`}),l.jsx("span",{className:"meter-value",children:C("meter.unmeasured")}),l.jsx("button",{className:"link-button",onClick:x,children:C("meter.configure")})]});if(s===null)return l.jsxs("div",{className:`meter meter-idle${_?" meter-compact":""}`,title:C("meter.noTokensTitle"),children:[l.jsx("span",{className:"meter-label",children:C("meter.label")}),l.jsx("span",{className:`meter-bar${_?" meter-bar-inline":""}`}),l.jsx("span",{className:"meter-value",children:C("meter.noTokens")})]});if(!Dy(s,n)){const S=Oy(i,s),E=Ny(s,n,u);return l.jsxs("div",{className:`meter meter-idle${_?" meter-compact":""}`,title:S,children:[l.jsx("span",{className:"meter-label",children:C("meter.label")}),l.jsx("span",{className:`meter-bar${_?" meter-bar-inline":""}`}),l.jsxs("span",{className:"meter-value",children:[C("meter.unmeasured"),E!==null&&l.jsxs("span",{className:"meter-dim",children:[" / ",Pn(E)]})]})]})}const g=c!==null&&c>0?Math.min(r/c,1):null,v=g===null?"unknown":g>=eb?"danger":g>=Z1?"warn":"ok",h=c===null?"":` / ${Pn(c)}${n.contextWindowEstimated?"+":""}`,y=Py(s,n);if(_){const S=[n.lastModel===null?null:n.lastModel,y,g===null?C("meter.unknownModelShort"):C("meter.windowPercent",{percent:Math.round(g*100)}),C("meter.output",{tokens:Pn(n.lastOutputTokens)}),s==="status-line"?C("meter.responses",{count:n.assistantMessages}):C("meter.sessionTotals",{output:Pn(n.totalOutputTokens),cache:Pn(n.totalCacheReadTokens),count:n.assistantMessages})].filter(E=>E!==null).join(" · ");return l.jsxs("div",{className:"meter meter-compact",title:S,children:[l.jsx("span",{className:"meter-label",children:C("meter.label")}),g!==null&&l.jsx("span",{className:"meter-bar meter-bar-inline",children:l.jsx("span",{className:`meter-fill meter-fill-${v}`,style:{width:`${g*100}%`}})}),l.jsxs("span",{className:"meter-value",children:[Pn(r),h.length>0&&l.jsx("span",{className:"meter-dim",children:h})]})]})}return l.jsxs("div",{className:"meter",children:[l.jsxs("div",{className:"meter-row",children:[l.jsx("span",{className:"meter-label",children:C("meter.label")}),l.jsxs("span",{className:"meter-value",children:[Pn(r),c!==null&&l.jsxs("span",{className:"meter-dim",title:n.lastModel===null?void 0:y!==null?C("meter.modelWithOrigin",{model:n.lastModel,origin:y}):n.lastModel,children:[" ","/ ",Pn(c),n.contextWindowEstimated&&"+"]})]})]}),g!==null?l.jsx("div",{className:"meter-bar",title:C("meter.windowPercent",{percent:Math.round(g*100)}),children:l.jsx("div",{className:`meter-fill meter-fill-${v}`,style:{width:`${g*100}%`}})}):l.jsx("div",{className:"meter-note",title:n.lastModel??void 0,children:C("meter.unknownModel")}),l.jsxs("div",{className:"meter-row meter-row-dim",children:[l.jsx("span",{title:C("meter.lastResponseTitle"),children:C("meter.output",{tokens:Pn(n.lastOutputTokens)})}),l.jsx("span",{title:C("meter.sessionTitle"),children:C("meter.sessionTotals",{output:Pn(n.totalOutputTokens),cache:Pn(n.totalCacheReadTokens),count:n.assistantMessages})})]})]})}const Nc=["s","m","l"],Pm="m",nb="agent-workbench.thread-font",sb="agent-workbench.notes-font",rb="s",ib={s:"threadFont.size.s",m:"threadFont.size.m",l:"threadFont.size.l"};function Df(n){return C(ib[n])}function Om(n){const s=Nc.indexOf(n);return Nc[(s+1)%Nc.length]??Pm}function ob(n){return n==="s"||n==="m"||n==="l"?n:null}function Nl(n){return C("threadFont.title",{current:Df(n),next:Df(Om(n))})}const lb=300,ab=200,cb=2,ub=lb+ab,Bm=cb*ub,hb=200;function Fm(n){return Math.max(hb,n)}function db(n){return n.hasMore&&!n.loading&&n.searching!==!0&&n.scrollTop<n.previousScrollTop&&n.scrollTop<=Fm(n.clientHeight)}function fb(n,s,i){return n<0&&s<=Fm(i)}function pb(n,s){return Math.max(0,s-n)}function mb(n,s){return n===null||s.length===0||s[0]===n?!1:s.includes(n)}const gb=52,_b=10;function vb(n){return n.filter(s=>s.role==="user"&&s.parts.some(i=>i.kind==="text"||i.kind==="image")).map(s=>s.eventId)}function yb(n,s){for(let i=n-1;i>=0;i-=1){const u=s(i);if(u!==null&&u<-8)return i}return null}function wb(n){return n.awayFromEnd&&(n.ownAbove||n.hasMore)}function If(n,s){return Math.max(0,n+s-gb)}function bb(n){return n.found?"jump":n.loading?"wait":!n.hasMore||n.pagesRequested>=_b?"give-up":"load"}const Sb=1;function Cb(n,s){for(const i of n){const u=s(i);if(!(u===null||u.bottom<=Sb))return{eventId:i,offset:u.top,lastId:n[n.length-1]??null}}return null}function xb(n,s,i,u){const _=s.indexOf(n.eventId);if(_===-1)return null;for(let R=_;R<s.length;R+=1){const x=s[R],r=x===void 0?null:i(x);if(r!==null)return Math.max(0,u+r.top-(R===_?n.offset:0))}return null}function kb(n,s){if(s===null)return 0;const i=n.lastIndexOf(s);return i===-1?0:n.length-1-i}function Hm({agents:n,preselected:s,anchor:i,label:u=C("agentMenu.openWith"),onPick:_,onClose:R}){const x=j.useMemo(()=>fm(n),[n]),[r,c]=j.useState(()=>Wy(x,s)),[g,v]=j.useState(null),h=j.useRef(null),y=j.useRef([]);return j.useLayoutEffect(()=>{const S=h.current;if(S===null)return;const E=i.getBoundingClientRect(),f=S.getBoundingClientRect();v(Vy({left:E.left,top:E.top,bottom:E.bottom},{width:f.width,height:f.height},{width:window.innerWidth,height:window.innerHeight}))},[i]),j.useEffect(()=>{var S;(S=y.current[r])==null||S.focus()},[r,g]),j.useEffect(()=>{const S=a=>{if(!(a.altKey||a.ctrlKey||a.metaKey)){if(a.key==="Escape"){a.preventDefault(),a.stopPropagation(),R(),i.focus();return}if(a.key==="ArrowDown"||a.key==="ArrowUp"){a.preventDefault(),a.stopPropagation(),c(m=>zy(m,a.key==="ArrowDown"?1:-1,x.length));return}if(a.key==="Enter"){a.preventDefault(),a.stopPropagation();const m=x[r];m!==void 0&&_(m.id);return}a.key==="Tab"&&R()}},E=a=>{var p;const m=a.target;m instanceof Node&&((p=h.current)!=null&&p.contains(m)||i.contains(m))||R()},f=a=>{qy(a.target,i,h.current)&&R()};return window.addEventListener("keydown",S,!0),document.addEventListener("pointerdown",E,!0),window.addEventListener("scroll",f,!0),window.addEventListener("resize",R),()=>{window.removeEventListener("keydown",S,!0),document.removeEventListener("pointerdown",E,!0),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",R)}},[r,i,x,R,_]),Sm.createPortal(l.jsx("div",{ref:h,className:"agent-menu",role:"menu","aria-label":u,style:g===null?{left:0,top:0,visibility:"hidden"}:{left:`${g.left}px`,top:`${g.top}px`},children:x.map((S,E)=>l.jsxs("button",{ref:f=>{y.current[E]=f},className:`agent-menu-item${E===r?" agent-menu-item-active":""}`,role:"menuitem",tabIndex:E===r?0:-1,onMouseEnter:()=>c(E),onClick:()=>_(S.id),children:[l.jsx("span",{className:"agent-menu-label",children:S.label}),S.version!==null&&l.jsx("span",{className:"agent-menu-version",children:S.version})]},S.id))}),document.body)}function $m({targets:n,className:s,text:i,blockedReason:u=null,onPick:_}){const[R,x]=j.useState(!1),r=j.useRef(null),c=j.useCallback(()=>x(!1),[]),g=j.useCallback(v=>{x(!1),_(v)},[_]);return n.length===0?null:l.jsxs(l.Fragment,{children:[l.jsx("button",{ref:r,className:s,onClick:()=>x(v=>!v),disabled:u!==null,"aria-haspopup":"menu","aria-expanded":R,title:u??Ky(),children:i}),R&&r.current!==null&&l.jsx(Hm,{agents:n,preselected:null,anchor:r.current,label:C("continue.menuLabel"),onPick:g,onClose:c})]})}function Um(n){switch(n.notice){case"compacted":return n.detail==="auto"?C("thread.notice.compactedAuto"):C("thread.notice.compacted");case"interrupted":return C("thread.notice.interrupted");case"error":return n.detail.length>0?C("thread.notice.error",{detail:n.detail}):C("thread.notice.errorNoDetail")}}const Wm="agent-workbench.locale",zm="auto";function Eb(n){return n==="auto"||rm(n)?n:null}function Vm(n){const s=n.trim().replace(/_/g,"-").toLowerCase();if(s.length===0)return null;const i=vu.find(R=>R.toLowerCase()===s);if(i!==void 0)return i;const[u="",..._]=s.split("-");return u==="zh"?_.includes("hant")||_.some(x=>x==="tw"||x==="hk"||x==="mo")?null:Dc("zh-CN"):Dc(u==="pt"?"pt-BR":u)}function Dc(n){return rm(n)?n:null}function qm(n,s){if(n!=="auto")return n;for(const i of s){const u=Vm(i);if(u!==null)return u}return"en"}function Km(n,s){for(const i of s)if(Vm(i)===n)try{if(Intl.DateTimeFormat.supportedLocalesOf([i]).length>0)return i}catch{}return sy(n)}let Dl=zm;const ru=new Set;function bu(){return Array.isArray(navigator.languages)&&navigator.languages.length>0?navigator.languages:typeof navigator.language=="string"?[navigator.language]:[]}function Lb(){return qm("auto",bu())}async function Gm(n){const s=bu(),i=qm(n,s);await om(i,Km(i,s))}async function Tb(){Dl=yt(Wm,zm,Eb);try{await Gm(Dl)}catch{await om("en",Km("en",bu()))}document.documentElement.lang=Zc(),im(()=>{document.documentElement.lang=Zc()})}async function Rb(n){await Gm(n),Dl=n,mt(Wm,n);for(const s of ru)s()}function Mb(n){return ru.add(n),()=>ru.delete(n)}function Ab(){return Dl}function eo(){return j.useSyncExternalStore(im,Zc)}function Nb(){return j.useSyncExternalStore(Mb,Ab)}const Ym=String.raw`https?:\/\/[^\s<>"'\`]+`,Db=new RegExp([String.raw`(\`[^\`\n]+\`)`,String.raw`(\*\*[^*\n]+\*\*)`,String.raw`(__[^_\n]+__)`,String.raw`(\*[^*\n]+\*)`,String.raw`(~~[^~\n]+~~)`,String.raw`(\[[^\]\n]+\]\([^)\s]+\))`,`(${Ym})`].join("|")),Ib=/^(https?:|mailto:)/i,jb=new RegExp(Ym);function Pb(n){const s=jb.exec(n);if(s===null||s.index===void 0)return null;const i=Xm(s[0]);return{index:s.index,length:i.length,href:i}}function yl(n,s){let i=0;for(const u of n)u===s&&(i+=1);return i}function Xm(n){let s=n;for(;;){const i=s.slice(-1);if(i.length===0)return s;if(".,;:!?".includes(i)){s=s.slice(0,-1);continue}if(i===")"&&yl(s,"(")<yl(s,")")){s=s.slice(0,-1);continue}if(i==="]"&&yl(s,"[")<yl(s,"]")){s=s.slice(0,-1);continue}return s}}function Ob(n){const s=Db.exec(n);if(s===null||s.index===void 0)return null;const i=s[0],u=s.index,_=(x,r=i.length)=>({index:u,length:r,token:x});if(i.startsWith("`"))return _({kind:"code",text:i.slice(1,-1)});if(i.startsWith("**")||i.startsWith("__"))return _({kind:"strong",text:i.slice(2,-2)});if(i.startsWith("~~"))return _({kind:"del",text:i.slice(2,-2)});if(i.startsWith("*"))return _({kind:"em",text:i.slice(1,-1)});if(i.startsWith("[")){const x=i.indexOf("]("),r=i.slice(1,x),c=i.slice(x+2,-1);return Ib.test(c)?_({kind:"link",label:r,href:c}):_({kind:"plain",text:i})}const R=Xm(i);return _({kind:"link",label:R,href:R},R.length)}function Ps(n,s,i){if(s.length===0)return[n];const u=n.toLowerCase(),_=s.toLowerCase(),R=[];let x=0,r=u.indexOf(_),c=0;for(;r!==-1;)r>x&&R.push(n.slice(x,r)),R.push(l.jsx("mark",{children:n.slice(r,r+s.length)},`${i}-m${c++}`)),x=r+s.length,r=u.indexOf(_,x);return x<n.length&&R.push(n.slice(x)),R}const Bb=/^\[([^\]\n]+)\]\(([^)\s]+)\)$/;function Fb(n,s){const i=Bb.exec(n);if(i===null)return null;const u=i[2]??"",_=s(u);return _===null?null:{label:i[1]??"",href:u,open:_}}function qr(n,s,i,u){const _=[];let R=n,x=0;for(;R.length>0;){const r=Ob(R);if(r===null){_.push(...Ps(R,s,`${i}-${x++}`));break}r.index>0&&_.push(...Ps(R.slice(0,r.index),s,`${i}-${x++}`));const c=`${i}-i${x++}`,{token:g}=r;switch(g.kind){case"code":_.push(l.jsx("code",{children:g.text},c));break;case"strong":_.push(l.jsx("strong",{children:Ps(g.text,s,c)},c));break;case"del":_.push(l.jsx("del",{children:Ps(g.text,s,c)},c));break;case"em":_.push(l.jsx("em",{children:Ps(g.text,s,c)},c));break;case"link":_.push(l.jsx("a",{href:g.href,target:"_blank",rel:"noreferrer noopener",children:Ps(g.label,s,c)},c));break;default:{const v=u===void 0?null:Fb(g.text,u);if(v!==null){_.push(l.jsx("button",{className:"md-local-link",onClick:v.open,title:v.href,children:Ps(v.label,s,c)},c));break}_.push(l.jsx("span",{children:Ps(g.text,s,c)},c));break}}R=R.slice(r.index+r.length)}return _}function Hb({code:n,language:s}){const[i,u]=j.useState(null),[_,R]=j.useState(!1),x=j.useRef(null);j.useEffect(()=>()=>{x.current!==null&&window.clearTimeout(x.current)},[]);const r=()=>{navigator.clipboard.writeText(n).then(()=>{R(!0),x.current!==null&&window.clearTimeout(x.current),x.current=window.setTimeout(()=>R(!1),1200)}).catch(()=>R(!1))};return j.useEffect(()=>{let c=!0;return Vn(async()=>{const{highlightCode:g}=await import("./highlight-BeEbartE.js");return{highlightCode:g}},[]).then(({highlightCode:g})=>{c&&u(g(n,s))}).catch(()=>{c&&u(null)}),()=>{c=!1}},[n,s]),l.jsxs("div",{className:"md-code-wrap",children:[l.jsx("pre",{className:"md-code hljs",children:i===null?l.jsx("code",{children:n}):l.jsx("code",{dangerouslySetInnerHTML:{__html:i}})}),l.jsxs("div",{className:"md-code-tools","data-search-skip":"",children:[s!==null&&l.jsx("span",{className:"md-code-lang",children:s}),l.jsx("button",{className:"md-code-copy",onClick:r,title:C(_?"common.copied":"common.copyCode"),"aria-label":C("common.copyCode"),children:_?"✓":"⧉"})]})]})}const jf=/^(#{1,6})\s+(.*)$/,Ic=/^\s{0,3}[-*+]\s+(.*)$/,Wi=/^\s{0,3}(\d{1,3})[.)]\s+(.*)$/,wl=/^>\s?(.*)$/,jc=/^\s*```(\S*)\s*$/,Pf=/^\s*(-{3,}|\*{3,}|_{3,})\s*$/,Pc=/^\s*\|.*\|\s*$/,$b=/^\s*\|[\s:|-]+\|\s*$/;function Of(n){return n.trim().replace(/^\||\|$/g,"").split("|").map(s=>s.trim())}function Su({text:n,needle:s="",localLink:i}){var x,r;const u=n.split(`
120
- `),_=[];let R=0;for(;R<u.length;){const c=u[R]??"",g=`b${R}`,v=jc.exec(c);if(v!==null){const S=(v[1]??"").length>0?v[1]:null,E=[];for(R+=1;R<u.length&&!jc.test(u[R]??"");)E.push(u[R]??""),R+=1;R+=1,_.push({key:g,node:l.jsx(Hb,{code:E.join(`
121
- `),language:S},g)});continue}if(c.trim().length===0){R+=1;continue}if(Pf.test(c)){_.push({key:g,node:l.jsx("hr",{className:"md-rule"},g)}),R+=1;continue}const h=jf.exec(c);if(h!==null){const S=Math.min((h[1]??"#").length,6);_.push({key:g,node:l.jsx("p",{className:`md-heading md-h${S}`,children:qr(h[2]??"",s,g,i)},g)}),R+=1;continue}if(Pc.test(c)&&$b.test(u[R+1]??"")){const S=Of(c);R+=2;const E=[];for(;R<u.length&&Pc.test(u[R]??"");)E.push(Of(u[R]??"")),R+=1;_.push({key:g,node:l.jsx("div",{className:"md-table-wrap",children:l.jsxs("table",{className:"md-table",children:[l.jsx("thead",{children:l.jsx("tr",{children:S.map((f,a)=>l.jsx("th",{children:qr(f,s,`${g}-h${a}`,i)},a))})}),l.jsx("tbody",{children:E.map((f,a)=>l.jsx("tr",{children:f.map((m,p)=>l.jsx("td",{children:qr(m,s,`${g}-${a}-${p}`,i)},p))},a))})]})},g)});continue}if(wl.test(c)){const S=[];for(;R<u.length&&wl.test(u[R]??"");)S.push(((x=wl.exec(u[R]??""))==null?void 0:x[1])??""),R+=1;_.push({key:g,node:l.jsx("blockquote",{className:"md-quote",children:qr(S.join(`
122
- `),s,g,i)},g)});continue}if(Ic.test(c)||Wi.test(c)){const S=Wi.test(c),E=S?Number(((r=Wi.exec(c))==null?void 0:r[1])??"1"):1,f=[];for(;R<u.length;){const m=u[R]??"",p=Ic.exec(m),d=Wi.exec(m);if(S&&d!==null)f.push(d[2]??"");else if(!S&&p!==null)f.push(p[1]??"");else if(f.length>0&&/^\s{2,}\S/.test(m)&&p===null&&d===null)f[f.length-1]=`${f[f.length-1]??""} ${m.trim()}`;else break;R+=1}const a=f.map((m,p)=>l.jsx("li",{children:qr(m,s,`${g}-l${p}`,i)},p));_.push({key:g,node:S?l.jsx("ol",{className:"md-list",start:E===1?void 0:E,children:a},g):l.jsx("ul",{className:"md-list",children:a},g)});continue}const y=[];for(;R<u.length;){const S=u[R]??"";if(S.trim().length===0||jc.test(S)||jf.test(S)||Ic.test(S)||Wi.test(S)||wl.test(S)||Pf.test(S)||Pc.test(S))break;y.push(S),R+=1}_.push({key:g,node:l.jsx("p",{className:"md-paragraph",children:qr(y.join(`
123
- `),s,g,i)},g)})}return l.jsx("div",{className:"md",children:_.map(c=>c.node)})}const Qm=[{key:"shell",names:["Bash","PowerShell","BashOutput","KillShell","shell_command","bash"],run:"tools.run.shell"},{key:"read",names:["Read","NotebookRead","read"],run:"tools.run.read"},{key:"find",names:["Glob","Grep","LS","grep","glob","list"],run:"tools.run.find"},{key:"edit",names:["Edit","Write","NotebookEdit","MultiEdit","apply_patch","edit","write"],run:"tools.run.edit"},{key:"web",names:["WebSearch","WebFetch","ToolSearch","webfetch","websearch","codesearch"],run:"tools.run.web"},{key:"agent",names:["Task","Agent","task"],run:"tools.run.agent"},{key:"todo",names:["TodoWrite","update_plan","todowrite","todoread"],run:"tools.run.todo"}];function Oc(n){const s=Qm.find(i=>i.names.includes(n));return s===void 0?{key:`name:${n}`,known:!1}:{key:s.key,known:!0}}function Ub(n,s,i){const u=Qm.find(_=>_.key===n);return u===void 0?C("tools.run.callsTo",{count:s,name:i}):C(u.run,{count:s})}function Dt(n){if(!J_(n.key))return n.key;let s;if(n.params!==void 0){const i={};for(const[u,_]of Object.entries(n.params))i[u]=typeof _=="object"?Dt(_):_;s=i}return C(`server.${n.key}`,s)}const Bc={model:null,effort:null,contextWindow:null},Wb=200,zb=2e4,Vb={},qb={},Bf=[];function iu(n,s,i){return`${n}:${i}:${s}`}function Kb(n,s){const[i,u]=j.useState([]),[_,R]=j.useState(bc),[x,r]=j.useState(Bc),[c,g]=j.useState("waiting"),[v,h]=j.useState(!1),[y,S]=j.useState(!1),[E,f]=j.useState({}),[a,m]=j.useState(null),[p,d]=j.useState(null),[k,I]=j.useState(!1),[L,M]=j.useState(Bf),[b,T]=j.useState({}),[N,O]=j.useState({}),B=(s===null?void 0:b[s])??Vb,F=(s===null?void 0:N[s])??qb,U=j.useRef(new Set),V=j.useRef(new Map),X=j.useRef(new Set),Y=j.useCallback((ae,ue,G)=>{O(W=>({...W,[ae]:{...W[ae]??{},[ue]:G}}))},[]),q=j.useCallback(ae=>{O(ue=>{let G=!1;const W={};for(const[J,Z]of Object.entries(ue))if(ae in Z){const de={...Z};delete de[ae],W[J]=de,G=!0}else W[J]=Z;return G?W:ue})},[]),D=j.useCallback((ae,ue)=>{O(G=>{const W=G[ae];if(W===void 0||!(ue in W))return G;const J={...W};return delete J[ue],{...G,[ae]:J}})},[]);j.useEffect(()=>{for(const ae of i)for(const ue of ae.parts){if(ue.kind!=="tool-result")continue;X.current.add(ue.toolUseId);const G=V.current.get(ue.toolUseId);G!==void 0&&(window.clearTimeout(G),V.current.delete(ue.toolUseId)),q(ue.toolUseId)}},[i,q]),j.useEffect(()=>{const ae=V.current;return()=>{for(const ue of ae.values())window.clearTimeout(ue);ae.clear()}},[]);const $=j.useRef(null);j.useEffect(()=>{if(s===null){u([]),R(bc),r(Bc),g("waiting"),h(!1),$.current=null;return}u([]),R(bc),r(Bc),g("waiting"),h(!1),S(!1),f({}),m(null),d(null),I(!1),M(Bf),U.current.clear(),$.current=null;const ae=n.onMessage(G=>{var W;switch(G.type){case"conversation.reset":if(G.terminalId!==s)break;u(G.events),R(G.usage),r(G.defaults),m(G.permissionMode),d(G.waitingFor),I(G.openToolCall),M(G.subagents),g(G.state),h(G.hasMore),S(!1),$.current=((W=G.events[0])==null?void 0:W.eventId)??null;break;case"conversation.append":{if(G.terminalId!==s)break;u(J=>{var fe;const Z=new Set(J.map(se=>se.eventId)),de=G.events.filter(se=>!Z.has(se.eventId));return de.length===0?J:($.current===null&&($.current=((fe=de[0])==null?void 0:fe.eventId)??null),[...J,...de])}),R(G.usage),G.permissionMode!==null&&m(G.permissionMode),g("live");break}case"conversation.page":{if(G.terminalId!==s)break;u(J=>{var fe;const Z=new Set(J.map(se=>se.eventId)),de=G.events.filter(se=>!Z.has(se.eventId));return de.length===0?J:($.current=((fe=de[0])==null?void 0:fe.eventId)??$.current,[...de,...J])}),h(G.hasMore),S(!1);break}case"conversation.turns":{if(G.terminalId!==s)break;const J=new Map(G.turns.map(Z=>[Z.eventId,Z.durationMs]));u(Z=>Z.map(de=>{const fe=J.get(de.eventId);return fe===void 0?de:{...de,durationMs:fe}}));break}case"conversation.parts":{if(G.terminalId!==s)break;const J=new Map(G.updates.map(Z=>[Z.eventId,Z.parts]));u(Z=>Z.map(de=>{const fe=J.get(de.eventId);return fe===void 0?de:{...de,parts:fe}}));break}case"conversation.imageData":{if(G.terminalId!==s)break;const J=iu(G.eventId,G.index,G.source);f(Z=>({...Z,[J]:G.data===null?null:`data:${G.mediaType};base64,${G.data}`}));break}case"conversation.state":if(G.terminalId!==s)break;g(G.state);break;case"conversation.mode":if(G.terminalId!==s)break;m(G.mode);break;case"conversation.waiting":if(G.terminalId!==s)break;d(G.waitingFor);break;case"conversation.toolCall":if(G.terminalId!==s)break;I(G.open);break;case"conversation.subagents":if(G.terminalId!==s)break;M(G.subagents);break;case"error":{if(G.code!=="answer-failed"||s===null)break;for(const[J,Z]of V.current)window.clearTimeout(Z),V.current.delete(J),T(de=>{const fe=de[s];if(fe===void 0||!(J in fe))return de;const se={...fe};return delete se[J],{...de,[s]:se}}),Y(s,J,Dt(G.text));break}}});n.send({type:"conversation.subscribe",terminalId:s});const ue=n.onReopen(()=>{n.send({type:"conversation.subscribe",terminalId:s})});return()=>{ae(),ue(),n.send({type:"conversation.unsubscribe",terminalId:s})}},[n,s,Y]);const H=j.useCallback(()=>{const ae=$.current;s===null||ae===null||y||(S(!0),n.send({type:"conversation.loadMore",terminalId:s,beforeEventId:ae,limit:Wb}))},[n,s,y]),K=j.useCallback((ae,ue,G)=>{if(s===null)return;const W=iu(ae,ue,G);U.current.has(W)||(U.current.add(W),n.send({type:"conversation.image",terminalId:s,eventId:ae,index:ue,source:G}))},[n,s]),te=j.useCallback((ae,ue)=>{if(s===null)return;T(W=>{const J=W[s]??{};return ae in J?W:{...W,[s]:{...J,[ae]:ue}}}),D(s,ae),n.send({type:"agent.answer",terminalId:s,toolUseId:ae,selections:ue});const G=window.setTimeout(()=>{X.current.has(ae)||(T(W=>{const J=W[s];if(J===void 0||!(ae in J))return W;const Z={...J};return delete Z[ae],{...W,[s]:Z}}),Y(s,ae,C("conversation.answerUnconfirmed")))},zb);V.current.set(ae,G)},[n,s,Y,D]),re=j.useCallback(ae=>{s!==null&&n.send({type:"agent.mode",terminalId:s,mode:ae})},[n,s]);return{events:i,usage:_,defaults:x,state:c,permissionMode:a,waitingFor:p,openToolCall:k,subagents:L,hasMore:v,loadingMore:y,loadMore:H,images:E,requestImage:K,answer:te,answered:B,answerFailed:F,setPermissionMode:re}}const Jm=80;function Fc(n){return n.scrollHeight-n.scrollTop-n.clientHeight>Jm}const Ff=5;function bl(n){return!Array.isArray(n)}function Hf(n){const s=[];for(const i of n.parts){if(i.kind!=="tool-call")return null;s.push(i.name)}return s.length>0?s:null}function Gb(n){const s=[];let i=0;for(;i<n.length;){const u=n[i];if(u===void 0)break;const _=Hf(u),R=_===null?null:Oc(_[0]??"");if(!(_!==null&&R!==null&&_.every(v=>Oc(v).key===R.key))||_===null||R===null){s.push({kind:"card",card:u}),i+=1;continue}const r=[u];let c=_.length,g=i+1;for(;g<n.length;){const v=n[g];if(v===void 0)break;const h=Hf(v);if(h===null||!h.every(y=>Oc(y).key===R.key))break;r.push(v),c+=h.length,g+=1}if(c<2){s.push({kind:"card",card:u}),i+=1;continue}s.push({kind:"tools",id:`tools-${u.event.eventId}`,summary:Ub(R.key,c,_[0]??""),at:u.event.at,cards:r}),i=g}return s}function Yb(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(i=>i.label).join(" ")}`).join(`
124
- `);case"notice":return Um(n);case"thinking":case"image":return""}}function $f(n,s){const i=[];for(const u of n.parts)if(i.push(Yb(u)),u.kind==="tool-call"){const _=s.get(u.toolUseId);_!==void 0&&i.push(_.text)}return i.join(`
125
- `)}function Hs(n,s){if(s.length===0)return l.jsx(l.Fragment,{children:n});const i=n.toLowerCase(),u=s.toLowerCase(),_=[];let R=0,x=i.indexOf(u),r=0;for(;x!==-1;)x>R&&_.push(l.jsx("span",{children:n.slice(R,x)},r++)),_.push(l.jsx("mark",{children:n.slice(x,x+s.length)},r++)),R=x+s.length,x=i.indexOf(u,R);return R<n.length&&_.push(l.jsx("span",{children:n.slice(R)},r++)),l.jsx(l.Fragment,{children:_})}function Zm(n,s){const i=[];let u=n,_=0;for(;u.length>0;){const R=Pb(u);if(R===null){i.push(l.jsx("span",{children:Hs(u,s)},_++));break}R.index>0&&i.push(l.jsx("span",{children:Hs(u.slice(0,R.index),s)},_++)),i.push(l.jsx("a",{href:R.href,target:"_blank",rel:"noreferrer noopener",children:Hs(R.href,s)},_++)),u=u.slice(R.index+R.length)}return l.jsx(l.Fragment,{children:i})}function Xb({view:n,terminalId:s,onRewind:i,questionsAnswerable:u,contextWindowSource:_,instructionsFile:R,onGoToCli:x,cliPresence:r,exitCode:c,onWakeCli:g,waking:v,discovering:h=!1,toolCallNotice:y=null,serverClosed:S=null,statusLineState:E=null,onConfigureStatusLine:f,threadFont:a,continueTargets:m=[],continueBlockedReason:p=null,onContinue:d,searchRequest:k=null,onSearchRequestApplied:I,activity:L=null,receipt:M=null,clock:b=null}){const{events:T,usage:N,defaults:O,state:B,waitingFor:F,subagents:U,hasMore:V,loadingMore:X,loadMore:Y,images:q,requestImage:D,answer:$,answered:H,answerFailed:K}=n,te=eo(),[re,ae]=j.useState(""),[ue,G]=j.useState(0),[W,J]=j.useState(null);j.useEffect(()=>{k!==null&&(ae(k.query),I==null||I(k.seq))},[k,I]);const Z=j.useRef(null),de=j.useRef(new Map),fe=j.useRef(!0),[se,Ee]=j.useState(!1),[Me,Qe]=j.useState(0),Le=j.useRef(s),pe=j.useRef(new Map),Re=j.useRef(null),[Ce,Te]=j.useState(!1),Pe=j.useRef(null),[xe,Ie]=j.useState(!1),[et,ot]=j.useState(!1),Ze=j.useRef(null),ht=j.useMemo(()=>vb(T),[T]),{cards:tt,results:He}=j.useMemo(()=>{const ge=new Map,Ue=new Set;for(const _t of T)for(const xt of _t.parts)xt.kind==="tool-result"?ge.set(xt.toolUseId,xt):(xt.kind==="tool-call"||xt.kind==="question")&&Ue.add(xt.toolUseId);const rt=[];for(const _t of T){const xt=_t.parts.filter(xn=>xn.kind!=="thinking"&&!(xn.kind==="tool-result"&&Ue.has(xn.toolUseId)));xt.length!==0&&rt.push({event:_t,parts:xt})}return{cards:rt,results:ge}},[T]),nt=j.useRef([]);nt.current=j.useMemo(()=>tt.map(ge=>ge.event.eventId),[tt]);const Ve=j.useCallback(ge=>{const Ue=ge.getBoundingClientRect().top;return rt=>{const _t=de.current.get(rt);if(_t===void 0)return null;const xt=_t.getBoundingClientRect();return xt.height<=0?null:{top:xt.top-Ue,bottom:xt.bottom-Ue}}},[]),at=j.useMemo(()=>Gb(tt),[tt,te]),st=re.trim(),ke=j.useMemo(()=>{if(st.length===0)return[];const ge=st.toLowerCase();return tt.filter(Ue=>$f(Ue,He).toLowerCase().includes(ge)).map(Ue=>Ue.event.eventId)},[tt,He,st,te]);j.useEffect(()=>{G(0)},[st]);const Ke=j.useMemo(()=>new Set(ke),[ke]),he=ke[ue]??null;j.useEffect(()=>{var ge;he!==null&&((ge=de.current.get(he))==null||ge.scrollIntoView({block:"center"}))},[he]),j.useLayoutEffect(()=>{const ge=Le.current;Le.current=s;const Ue=Z.current;if(ge!==null&&ge!==s&&Re.current===null){const rt=Ue===null||fe.current?null:Cb(nt.current,Ve(Ue));rt===null?pe.current.delete(ge):pe.current.set(ge,rt)}Re.current=s===null?null:pe.current.get(s)??null,fe.current=!0,Ee(!1),Qe(0),Ze.current=null,ot(!1),Ie(!1),Te(!1)},[s,Ve]),j.useEffect(()=>()=>{Pe.current!==null&&window.clearTimeout(Pe.current)},[]);const me=j.useCallback(()=>{const ge=Z.current;if(ge===null)return;const Ue=Fc(ge);Ee(Ue),Ue||Qe(0)},[]),Ae=j.useCallback(ge=>{const Ue=ge.getBoundingClientRect().top,rt=xt=>{const xn=ht[xt],ps=xn===void 0?void 0:de.current.get(xn);return ps===void 0?null:ps.getBoundingClientRect().top-Ue},_t=yb(ht.length,rt);return _t===null?null:rt(_t)},[ht]),pt=j.useCallback(()=>{const ge=Z.current;ge!==null&&Ie(wb({awayFromEnd:Fc(ge),ownAbove:Ae(ge)!==null,hasMore:V}))},[Ae,V]),Ne=j.useRef(null),qe=j.useRef(0),ct=j.useRef(0);j.useLayoutEffect(()=>{const ge=Ne.current,Ue=T.map(_t=>_t.eventId);Ne.current=Ue[0]??null;const rt=Z.current;rt===null||!mb(ge,Ue)||(rt.scrollTop=pb(qe.current,rt.scrollHeight))},[T]),j.useLayoutEffect(()=>{const ge=Z.current,Ue=Re.current;if(ge!==null&&Ue!==null&&tt.length>0){Re.current=null;const rt=nt.current,_t=st.length>0?null:xb(Ue,rt,Ve(ge),ge.scrollTop);_t!==null&&(ge.scrollTop=_t,fe.current=!Fc(ge),fe.current||(Qe(kb(rt,Ue.lastId)),Te(!0),Pe.current!==null&&window.clearTimeout(Pe.current),Pe.current=window.setTimeout(()=>{Pe.current=null,Te(!1)},Bm)))}ge!==null&&fe.current&&st.length===0&&(ge.scrollTop=ge.scrollHeight),me()},[tt.length,st,me,Ve]),j.useLayoutEffect(()=>{const ge=Ze.current,Ue=Z.current;if(ge===null||Ue===null)return;const rt=Ae(Ue),_t=bb({found:rt!==null,hasMore:V,loading:X,pagesRequested:ge.pages});if(_t!=="wait"){if(_t==="load"){ge.pages+=1,Y();return}Ze.current=null,ot(!1),rt!==null&&(fe.current=!1,Ue.scrollTop=If(Ue.scrollTop,rt))}},[tt,V,X,et,Ae,Y]),j.useLayoutEffect(()=>{pt()},[tt,pt]),j.useLayoutEffect(()=>{const ge=Z.current;ge!==null&&(qe.current=ge.scrollHeight-ge.scrollTop,ct.current=ge.scrollTop)});const At=j.useRef(null),Tt=j.useCallback(()=>{var Ue;const ge=((Ue=T[0])==null?void 0:Ue.eventId)??null;ge===null||At.current===ge||(At.current=ge,Y())},[T,Y]),Cn=j.useRef(null);j.useEffect(()=>{var _t;const ge=((_t=tt[tt.length-1])==null?void 0:_t.event.eventId)??null,Ue=Cn.current;if(Cn.current=ge,Ue===null||ge===Ue||fe.current&&st.length===0)return;const rt=tt.findIndex(xt=>xt.event.eventId===Ue);rt!==-1&&Qe(xt=>xt+(tt.length-1-rt))},[tt,st]);const Yn=j.useCallback(()=>{const ge=Z.current;if(ge===null)return;const Ue=ge.scrollHeight-ge.scrollTop-ge.clientHeight;fe.current=Ue<=Jm,me(),pt();const rt=db({scrollTop:ge.scrollTop,previousScrollTop:ct.current,clientHeight:ge.clientHeight,hasMore:V,loading:X,searching:st.length>0});ct.current=ge.scrollTop,qe.current=ge.scrollHeight-ge.scrollTop,rt&&Tt()},[me,pt,V,X,Tt,st]),dn=j.useCallback(ge=>{const Ue=Z.current;Ue===null||!V||X||st.length>0||fb(ge.deltaY,Ue.scrollTop,Ue.clientHeight)&&Tt()},[V,X,Tt,st]),ur=j.useCallback(()=>{const ge=Z.current;ge!==null&&(ge.scrollTop=ge.scrollHeight,fe.current=!0,Ee(!1),Qe(0),Ze.current=null,ot(!1),Ie(!1))},[]),Xn=j.useCallback(()=>{const ge=Z.current;if(ge===null)return;const Ue=Ae(ge);if(Ue!==null){fe.current=!1,ge.scrollTop=If(ge.scrollTop,Ue);return}Ze.current===null&&(Ze.current={pages:0},ot(!0))},[Ae]),fs=j.useCallback((ge,Ue)=>{Ue===null?de.current.delete(ge):de.current.set(ge,Ue)},[]),Jt=j.useCallback(ge=>{const Ue=$f(ge,He);navigator.clipboard.writeText(Ue).then(()=>{J(ge.event.eventId),window.setTimeout(()=>J(null),1200)}).catch(()=>J(null))},[He,te]),$s=ge=>{ke.length!==0&&G(Ue=>(Ue+ge+ke.length)%ke.length)};return l.jsxs("div",{className:"conversation-pane",children:[l.jsxs("div",{className:"conversation-search",children:[l.jsx("input",{className:"conversation-search-input",type:"search",placeholder:C("thread.search.placeholder"),value:re,onChange:ge=>ae(ge.target.value),onKeyDown:ge=>{ge.key==="Enter"&&$s(ge.shiftKey?-1:1),ge.stopPropagation()},spellCheck:!1}),st.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"conversation-matches",children:ke.length===0?C("thread.search.none"):`${ue+1}/${ke.length}`}),l.jsx("button",{className:"icon-button",onClick:()=>$s(-1),disabled:ke.length===0,title:C("thread.search.previous"),children:"↑"}),l.jsx("button",{className:"icon-button",onClick:()=>$s(1),disabled:ke.length===0,title:C("thread.search.next"),children:"↓"})]}),l.jsx("span",{className:"conversation-spacer"}),d!==void 0&&l.jsx($m,{targets:m,className:"icon-button conversation-continue",text:C("thread.continueWith"),blockedReason:p,onPick:d}),a!==void 0&&l.jsx("button",{className:"icon-button thread-font-button",onClick:a.cycle,title:Nl(a.size),"aria-label":Nl(a.size),children:l.jsxs("span",{"aria-hidden":"true",children:["a",l.jsx("span",{className:"thread-font-big",children:"A"})]})}),l.jsx(tb,{usage:N,source:_,instructionsFile:R,fallbackWindow:O.contextWindow,compact:!0,statusLineState:E,onConfigure:f})]}),l.jsxs("div",{className:"conversation-scroll-frame",children:[l.jsxs("div",{className:"conversation-scroll",ref:Z,onScroll:Yn,onWheel:dn,children:[V&&l.jsxs("button",{className:`conversation-more${X?" conversation-more-loading":""}`,onClick:Y,disabled:X,"aria-busy":X,children:[X&&l.jsx("span",{className:"conversation-more-spinner","aria-hidden":"true"}),C(X?"thread.loadingMore":"thread.loadEarlier")]}),tt.length===0&&l.jsxs("p",{className:"conversation-empty",children:[B==="unavailable"?C("thread.empty.unavailable"):B==="no-transcript"?tw():C(B==="waiting"?"thread.empty.waiting":"thread.empty.noMessages"),B==="waiting"&&h&&l.jsxs(l.Fragment,{children:[l.jsx("br",{}),nw()]})]}),at.map(ge=>{if(ge.kind==="card")return l.jsx(Uf,{card:ge.card,results:He,needle:st,isMatch:ge.card.event.eventId===he,copied:W===ge.card.event.eventId,images:q,onRequestImage:D,onCopy:()=>Jt(ge.card),onRewind:i,register:fs,answered:H,answerFailed:K,answerable:u,onAnswer:$},ge.card.event.eventId);const Ue=ge.cards.some(rt=>Ke.has(rt.event.eventId));return l.jsx(rS,{summary:ge.summary,at:ge.at,open:Ue,children:ge.cards.map(rt=>l.jsx(Uf,{card:rt,results:He,needle:st,isMatch:rt.event.eventId===he,copied:W===rt.event.eventId,images:q,onRequestImage:D,onCopy:()=>Jt(rt),onRewind:i,register:fs,answered:H,answerFailed:K,answerable:u,onAnswer:$},rt.event.eventId))},ge.id)})]}),se&&(xe||et)&&l.jsx("button",{className:`conversation-jump conversation-jump-own${et?" is-seeking":""}`,onClick:Xn,disabled:et,"aria-busy":et,title:C("thread.jumpToOwn"),"aria-label":C("thread.jumpToOwn"),children:l.jsx("span",{"aria-hidden":"true",children:"↑"})}),se&&l.jsxs("button",{className:`conversation-jump${Me>0?" has-unseen":""}${Ce?" is-hinting":""}`,onClick:ur,title:Me>0?C("thread.jumpToEndNew",{count:Me}):C("thread.jumpToEnd"),"aria-label":Me>0?C("thread.jumpToEndNew",{count:Me}):C("thread.jumpToEnd"),children:[l.jsx("span",{"aria-hidden":"true",children:"↓"}),Me>0&&l.jsx("span",{className:"conversation-jump-count",children:Me>99?"99+":Me}),Ce&&l.jsx("span",{className:"conversation-jump-tip","aria-hidden":"true",children:Me>0?C("thread.jumpToEndNew",{count:Me}):C("thread.jumpToEnd")})]})]}),l.jsx(Jb,{live:r==="live"&&S===null,activity:L,waitingFor:F,receipt:M,events:T,clock:b,subagents:U}),S!==null&&(S.state==="relaunching"||r==="live")?l.jsx(tS,{text:S.text,relaunching:S.state==="relaunching",onRelaunch:g}):r==="live"?F===null&&y!==null?l.jsx(sS,{notice:y,onGoToCli:x}):l.jsx(nS,{waitingFor:F,questionsAnswerable:u,onGoToCli:x}):l.jsx(eS,{presence:r,exitCode:c,waking:v,onWake:g})]})}const Qb=1e3;function Jb({live:n,activity:s,waitingFor:i,receipt:u,events:_,clock:R,subagents:x}){const[,r]=j.useState(0),c=Date.now(),g=d1({live:n,activity:s,waitingFor:i,receipt:u,events:_,clock:R,now:c}),v=n?x:[],h=g!==null||v.length>0;return j.useEffect(()=>{if(!h)return;const y=window.setInterval(()=>r(S=>S+1),Qb);return()=>window.clearInterval(y)},[h]),h?l.jsxs("div",{className:"thread-status",children:[g!==null&&l.jsxs("div",{className:`thread-status-row thread-status-${g.kind}`,children:[l.jsx(Zb,{kind:g.kind}),l.jsx("span",{className:"thread-status-text",children:f1(g,c)})]}),v.length>0&&l.jsxs("div",{className:"thread-status-row thread-status-subagents",children:[l.jsxs("span",{className:"tab-working thread-status-subagent-mark","aria-hidden":"true",children:[l.jsx("i",{}),l.jsx("i",{}),l.jsx("i",{})]}),l.jsx("span",{className:"thread-status-text",children:p1(v,c)})]})]}):null}function Zb({kind:n}){return n==="working"?l.jsxs("span",{className:"tab-working","aria-hidden":"true",children:[l.jsx("i",{}),l.jsx("i",{}),l.jsx("i",{})]}):n==="sending"?l.jsx("span",{className:"thread-status-sending-dot","aria-hidden":"true"}):l.jsx("span",{className:"thread-status-check","aria-hidden":"true",children:"✓"})}function eS({presence:n,exitCode:s,waking:i,onWake:u}){const _=n==="sleeping"?C("thread.wake.sleeping"):s===null?C("thread.wake.exited"):C("thread.wake.exitedWithCode",{code:s});return l.jsxs("div",{className:"conversation-waiting conversation-wake",role:"status",children:[l.jsx("span",{className:"conversation-wake-dot","aria-hidden":"true"}),l.jsx("span",{children:_}),l.jsx("button",{className:"primary-button primary-button-small",onClick:u,disabled:i,children:C(i?"thread.wake.opening":"thread.wake.open")})]})}function tS({text:n,relaunching:s,onRelaunch:i}){return l.jsxs("div",{className:"conversation-waiting conversation-wake",role:"status",children:[l.jsx("span",{className:"conversation-wake-dot","aria-hidden":"true"}),l.jsx("span",{children:n}),l.jsx("button",{className:"primary-button primary-button-small",onClick:i,disabled:s,children:s?lw():ow()})]})}function nS({waitingFor:n,questionsAnswerable:s,onGoToCli:i}){if(n===null)return null;const u=mm(n,s);return l.jsxs("div",{className:"conversation-waiting",role:"status",children:[l.jsx("span",{className:"conversation-waiting-dot","aria-hidden":"true"}),l.jsx("span",{children:u}),l.jsx("button",{className:"link-button",onClick:i,children:C("thread.goToCli")})]})}function sS({notice:n,onGoToCli:s}){return l.jsxs("div",{className:"conversation-waiting",role:"status",children:[l.jsx("span",{className:"conversation-waiting-dot","aria-hidden":"true"}),l.jsx("span",{children:n}),l.jsx("button",{className:"link-button",onClick:s,children:C("thread.goToCli")})]})}function Uf({card:n,results:s,needle:i,isMatch:u,copied:_,images:R,onRequestImage:x,onCopy:r,onRewind:c,register:g,answered:v,answerFailed:h,answerable:y,onAnswer:S}){const{event:E}=n,f=E.role==="user",a=m=>{const p=v[m.toolUseId];return p!==void 0?p:s.has(m.toolUseId)?[]:null};return l.jsxs("article",{ref:m=>g(E.eventId,m),className:`turn turn-${E.role}${u?" turn-match":""}`,children:[l.jsxs("div",{className:"turn-actions",children:[l.jsx("button",{className:"icon-button",onClick:r,title:C("thread.copyMessage"),children:_?"✓":"⧉"}),f&&c!==void 0&&l.jsx("button",{className:"icon-button",onClick:c,title:C("thread.rewind"),children:"↩"})]}),n.parts.map((m,p)=>l.jsx(oS,{part:m,eventId:E.eventId,mine:f,result:m.kind==="tool-call"?s.get(m.toolUseId)??null:null,needle:i,images:R,onRequestImage:x,answeredAt:m.kind==="question"?a(m):null,failure:m.kind==="question"?h[m.toolUseId]??null:null,answerable:y,onAnswer:S},p)),l.jsx(iS,{event:E,mine:f})]})}function rS({summary:n,at:s,open:i,children:u}){const _=s>0?bm(s):"";return l.jsxs("details",{className:"tool-group",open:i,children:[l.jsxs("summary",{className:"tool-group-summary",children:[l.jsx("span",{className:"tool-group-chevron","aria-hidden":"true",children:"▸"}),l.jsx("span",{className:"tool-group-count",children:n}),_.length>0&&l.jsx("span",{className:"tool-group-time",children:_})]}),l.jsx("div",{className:"tool-group-body",children:u})]})}function iS({event:n,mine:s}){const i=n.at>0?bm(n.at):"",u=[];return n.durationMs!==null&&u.push(jw(n.durationMs)),n.effort!==null&&u.push(C("thread.turn.effort",{effort:n.effort})),l.jsxs("div",{className:"turn-meta",children:[s&&l.jsx("span",{className:"turn-who",children:C("thread.turn.you")}),i.length>0&&l.jsx("span",{children:i}),n.queued&&l.jsx("span",{className:"turn-queued",title:C("thread.turn.queuedTitle"),children:C("thread.turn.queued")}),u.map(_=>l.jsx("span",{className:"turn-meta-bit",children:_},_))]})}function oS({part:n,eventId:s,mine:i,result:u,needle:_,images:R,onRequestImage:x,answeredAt:r,failure:c,answerable:g,onAnswer:v}){switch(n.kind){case"text":return i?l.jsx(aS,{text:n.text,truncated:n.truncated,needle:_}):l.jsxs("div",{className:"part-text",children:[l.jsx(Su,{text:n.text,needle:_}),n.truncated&&l.jsxs("span",{className:"part-truncated",children:[" ",C("thread.truncated")]})]});case"image":return l.jsx(uS,{eventId:s,index:n.index,source:n.source,src:R[iu(s,n.index,n.source)],onRequest:x});case"thinking":return null;case"notice":return l.jsx("div",{className:`turn-notice turn-notice-${n.notice}`,children:Hs(Um(n),_)});case"question":return l.jsx(lS,{part:n,answeredAt:r,failure:c,answerable:g,onAnswer:v,needle:_});case"tool-call":{const h=_.length>0&&`${n.name} ${n.input} ${(u==null?void 0:u.text)??""}`.toLowerCase().includes(_.toLowerCase());return l.jsxs("details",{className:"tool",open:h,children:[l.jsxs("summary",{className:"tool-summary",children:[l.jsx("span",{className:"tool-name",children:n.name}),u!==null&&u.isError&&l.jsx("span",{className:"tool-error",children:C("thread.tool.error")}),u!==null&&u.imageCount>0&&l.jsx("span",{className:"tool-images",children:C("thread.tool.images",{count:u.imageCount})})]}),l.jsxs("div",{className:"tool-block",children:[l.jsx("span",{className:"tool-label",children:C("thread.tool.input")}),l.jsxs("pre",{className:"tool-pre",children:[Hs(n.input,_),n.truncated&&l.jsxs("span",{className:"part-truncated",children:[" ",C("thread.truncated")]})]})]}),u!==null&&l.jsxs("div",{className:"tool-block",children:[l.jsx("span",{className:"tool-label",children:C("thread.tool.result")}),l.jsxs("pre",{className:`tool-pre${u.isError?" tool-pre-error":""}`,children:[u.text.length>0?Hs(u.text,_):u.imageCount>0?C("thread.tool.imagesNotSent",{count:u.imageCount}):C("thread.tool.noOutput"),u.truncated&&l.jsxs("span",{className:"part-truncated",children:[" ",C("thread.truncated")]})]})]})]})}case"tool-result":return l.jsxs("div",{className:"tool-block",children:[l.jsx("span",{className:"tool-label",children:C("thread.tool.orphanResult")}),l.jsx("pre",{className:`tool-pre${n.isError?" tool-pre-error":""}`,children:Hs(n.text,_)})]})}}function lS({part:n,answeredAt:s,failure:i,answerable:u,onAnswer:_,needle:R}){var I;const[x,r]=j.useState(()=>n.questions.map(()=>[])),[c,g]=j.useState(null),[v,h]=j.useState(""),y=s!==null,S=y||!u,E=s??x,f=n.questions.length===1&&((I=n.questions[0])==null?void 0:I.multiSelect)===!1,a=E.every(L=>bl(L)?L.text.trim().length>0:L.length>0),m=L=>L===void 0||bl(L)?[]:L,p=(L,M)=>{if(S)return;const b=n.questions[L];if(b!==void 0){if(f){_(n.toolUseId,[[M]]);return}g(T=>T===L?null:T),r(T=>T.map((N,O)=>{if(O!==L)return N;const B=m(N);return b.multiSelect?B.includes(M)?B.filter(F=>F!==M):[...B,M]:[M]}))}},d=L=>{const M=v.trim();if(M.length===0||S)return;const b={kind:"free",text:M};if(f){_(n.toolUseId,[b]);return}r(T=>T.map((N,O)=>O===L?b:N)),g(null),h("")},k=L=>{if(S)return;const M=E[L];h(M!==void 0&&bl(M)?M.text:""),g(L)};return l.jsxs("div",{className:`question${y?" question-done":""}`,children:[n.questions.map((L,M)=>{const b=E[M],T=b!==void 0&&bl(b)?b.text:null;return l.jsxs("div",{className:"question-item",children:[l.jsxs("div",{className:"question-head",children:[L.header.length>0&&l.jsx("span",{className:"question-header",children:L.header}),l.jsx("span",{className:"question-text",children:Hs(L.question,R)}),L.multiSelect&&l.jsx("span",{className:"question-hint",children:C("thread.question.multi")})]}),l.jsxs("div",{className:"question-options",children:[L.options.map((N,O)=>{const B=m(b).includes(O);return l.jsxs("button",{type:"button",className:`question-option${B?" question-option-picked":""}`,disabled:S,onClick:()=>p(M,O),children:[l.jsx("span",{className:"question-option-label",children:N.label}),N.description.length>0&&l.jsx("span",{className:"question-option-desc",children:N.description})]},O)}),c===M&&!S?l.jsxs("div",{className:"question-write",children:[l.jsx("textarea",{className:"question-write-input",autoFocus:!0,rows:2,value:v,placeholder:C("thread.question.placeholder"),onChange:N=>h(N.target.value),onKeyDown:N=>{N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),d(M)),N.key==="Escape"&&g(null),N.stopPropagation()}}),l.jsxs("div",{className:"question-write-actions",children:[l.jsx("button",{type:"button",className:"question-send",disabled:v.trim().length===0,onClick:()=>d(M),children:C(f?"thread.question.send":"thread.question.useText")}),l.jsx("button",{type:"button",className:"question-write-cancel",onClick:()=>g(null),children:C("common.cancel")})]})]}):l.jsxs("button",{type:"button",className:`question-option question-option-write${T!==null?" question-option-picked":""}`,disabled:S,onClick:()=>k(M),children:[l.jsx("span",{className:"question-option-label",children:T!==null?T:C("thread.question.writeOther")}),T===null&&l.jsx("span",{className:"question-option-desc",children:C("thread.question.writeOtherHint")})]})]})]},M)}),l.jsxs("div",{className:"question-foot",children:[i!==null&&l.jsx("span",{className:"question-failed",children:i}),y?l.jsx("span",{className:"question-sent",children:C("thread.question.answered")}):u?l.jsxs(l.Fragment,{children:[!f&&l.jsx("button",{type:"button",className:"question-send",disabled:!a,onClick:()=>_(n.toolUseId,x),children:C("thread.question.sendAnswers")}),l.jsx("span",{className:"question-note",children:C(f?"thread.question.pickOne":"thread.question.pickEach")})]}):l.jsx("span",{className:"question-note",children:C("thread.question.answerInCli")})]})]})}function aS({text:n,truncated:s,needle:i}){const u=Lw(n,s),_=u.length===1?u[0]:void 0;if(_!==void 0&&_.kind==="text")return l.jsx(Wf,{text:n,truncated:s,needle:i});const R=u.length-1;return l.jsx("div",{className:"part-own",children:u.map((x,r)=>x.kind==="text"?l.jsx(Wf,{text:x.text,truncated:s&&r===R,needle:i},r):l.jsx(cS,{number:x.number,text:x.text,complete:x.complete,needle:i},r))})}function cS({number:n,text:s,complete:i,needle:u}){const[_,R]=j.useState(!1),x=u.length>0&&s.toLowerCase().includes(u.toLowerCase()),r=_||x;return l.jsxs("div",{className:`thread-pasted${r?" thread-pasted-open":""}`,children:[l.jsxs("button",{className:"thread-pasted-toggle",onClick:()=>R(c=>!c),"aria-expanded":r,children:[l.jsx("span",{className:"chip-icon",children:"¶"}),C("thread.pasted",{number:n,count:Ml(s)}),!i&&l.jsxs("span",{className:"part-truncated",children:[" ",C("thread.truncated")]}),l.jsx("span",{className:"chip-chevron",children:r?"▾":"▸"})]}),r&&l.jsx("div",{className:"thread-pasted-text part-mine",children:Zm(s,u)})]})}function Wf({text:n,truncated:s,needle:i}){const[u,_]=j.useState(!1),R=n.split(`
126
- `),x=i.length>0&&n.toLowerCase().includes(i.toLowerCase()),r=R.length>=Ff&&!x,c=r&&!u?R.slice(0,Ff-1).join(`
127
- `):n;return l.jsxs("div",{className:"part-text part-mine",children:[Zm(c,i),s&&l.jsxs("span",{className:"part-truncated",children:[" ",C("thread.truncated")]}),r&&l.jsx("button",{className:"fold-toggle",onClick:()=>_(g=>!g),children:u?C("thread.fold.less"):C("thread.fold.more",{count:R.length})})]})}function uS({eventId:n,index:s,source:i,src:u,onRequest:_}){const[R,x]=j.useState(!1);return j.useEffect(()=>{u===void 0&&_(n,s,i)},[u,n,s,i,_]),u===void 0?l.jsx("div",{className:"conversation-image-placeholder",children:C("thread.image.loading")}):u===null?l.jsx("div",{className:"conversation-image-placeholder",children:C("thread.image.gone")}):l.jsxs(l.Fragment,{children:[l.jsx("img",{className:"conversation-image",src:u,alt:C("thread.image.alt"),onClick:()=>x(!0),title:C("thread.image.openTitle")}),R&&l.jsx(Cm,{src:u,caption:C("thread.image.alt"),onClose:()=>x(!1)})]})}function zf({connection:n,title:s,confirmLabel:i,confirmTitle:u,onChoose:_,onClose:R}){const[x,r]=j.useState(null),[c,g]=j.useState(null),[v,h]=j.useState(!1),[y,S]=j.useState(""),E=j.useRef(null),f=j.useRef(null);j.useEffect(()=>{const d=n.onMessage(k=>{if(k.type==="picker.listing"){E.current=k.listing.pickerId,r(k.listing),g(null),h(!1),S("");return}k.type==="error"&&k.code==="picker-failed"&&g(Dt(k.text))});return n.send({type:"picker.open"}),()=>{d();const k=E.current;k!==null&&n.send({type:"picker.close",pickerId:k})}},[n]),j.useEffect(()=>{const d=k=>{k.key==="Escape"&&(k.preventDefault(),k.stopPropagation(),R())};return window.addEventListener("keydown",d,!0),()=>window.removeEventListener("keydown",d,!0)},[R]),j.useEffect(()=>{var d;v&&((d=f.current)==null||d.focus())},[v]);const a=j.useCallback(d=>{const k=E.current;k!==null&&n.send({type:"picker.enter",pickerId:k,name:d})},[n]),m=j.useCallback(d=>{const k=E.current;k!==null&&n.send({type:"picker.root",pickerId:k,rootIndex:d})},[n]),p=j.useCallback(()=>{const d=E.current,k=y.trim();d===null||k.length===0||n.send({type:"picker.create",pickerId:d,name:k})},[n,y]);return l.jsx("div",{className:"modal-backdrop",onClick:R,children:l.jsxs("div",{className:"modal picker-modal",role:"dialog","aria-label":s,onClick:d=>d.stopPropagation(),children:[l.jsxs("header",{className:"modal-header",children:[l.jsx("span",{className:"modal-title",children:s}),l.jsx("button",{className:"icon-button",onClick:R,title:C("common.close"),children:"×"})]}),x===null?l.jsx("p",{className:"panel-note",children:C("picker.loading")}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"picker-roots",children:x.roots.map((d,k)=>l.jsx("button",{className:"picker-root",onClick:()=>m(k),title:C("picker.goTo",{root:d}),children:d},d))}),l.jsx("p",{className:"picker-path",title:x.path,children:x.path}),l.jsxs("div",{className:"picker-list",children:[x.canGoUp&&l.jsxs("button",{className:"picker-entry picker-up",onClick:()=>a(".."),children:["‹ ",C("picker.up")]}),x.entries.length===0&&!x.canGoUp&&l.jsx("p",{className:"panel-note",children:C("picker.empty")}),x.entries.map(d=>l.jsx("button",{className:"picker-entry",onClick:()=>a(d),children:d},d)),x.truncated&&l.jsx("p",{className:"panel-note",children:C("picker.truncated")})]}),c!==null&&l.jsx("p",{className:"picker-problem",children:c}),l.jsxs("footer",{className:"picker-footer",children:[v?l.jsxs("div",{className:"picker-create",children:[l.jsx("input",{ref:f,className:"picker-create-input",value:y,placeholder:C("picker.newFolderName"),onChange:d=>S(d.target.value),onKeyDown:d=>{d.key==="Enter"&&p(),d.key==="Escape"&&(d.stopPropagation(),h(!1)),d.stopPropagation()},spellCheck:!1}),l.jsx("button",{className:"primary-button primary-button-small",onClick:p,children:C("picker.create")}),l.jsx("button",{className:"link-button",onClick:()=>h(!1),children:C("common.cancel")})]}):l.jsx("button",{className:"primary-button primary-button-small",onClick:()=>h(!0),children:C("picker.createHere")}),l.jsx("span",{className:"composer-spacer"}),l.jsx("button",{className:"picker-open",onClick:()=>_(x.pickerId,x.path),title:u(x.path),children:i})]})]})]})})}function hS(n,s){return gu(n)&&s!==null&&s.sessions>0}function dS(){return C("search.mode.titles")}function fS(){return C("search.mode.conversations")}function pS(){return C("search.mode.conversationsTitle")}function mS(n){return C(n==="conversations"?"search.placeholder.conversations":"search.placeholder.titles")}function gS(){return C("search.tooShort",{min:Gp})}function _S(n){return[...n.trim()].length<Gp}function vS(){return C("search.off")}function yS(n){const s=new Map;for(const i of n){const u=`${i.agent}:${i.sessionId}`;let _=s.get(u);_===void 0&&(_={key:u,agent:i.agent,sessionId:i.sessionId,title:i.title,titleHit:null,hits:[],lastAt:null},s.set(u,_)),i.eventId===null?_.titleHit=i:_.hits.push(i),i.at!==null&&(_.lastAt=Math.max(_.lastAt??0,i.at))}return[...s.values()]}const wS=40;function eg(n,s=wS){const i=n.matchStart+n.matchLength;let u=n.snippet.slice(0,n.matchStart);if(u.length>s){let _=u.length-s;const R=u.charCodeAt(_);R>=56320&&R<=57343&&(_+=1),u=`…${u.slice(_)}`}return{before:u,match:n.snippet.slice(n.matchStart,i),after:n.snippet.slice(i)}}function bS(n){return n.role==="user"?C("search.role.user"):n.role==="assistant"?C("search.role.assistant"):C("search.role.title")}function tg(n){return eg(n).match.trim()}function SS(n){const s=n.hits[0]??n.titleHit;return s===null?"":tg(s)}const ou=n=>C("search.sessions",{count:n});function CS(n,s){return{query:s.query,hits:n===null?[...s.hits]:[...n.hits,...s.hits],sessionsScanned:s.sessionsScanned,sessionsTotal:s.sessionsTotal,truncated:null}}function xS(n){const{result:s}=n;if(n.searching&&n.error===null){if(s===null)return C("search.status.searching");const u={count:s.sessionsTotal,scanned:s.sessionsScanned};return s.hits.length===0?C("search.status.progress",u):C("search.status.progressFound",{...u,found:Vf(s)})}if(n.error!==null)return n.error;if(s===null)return null;const i=s.hits.length===0?C("search.status.none"):Vf(s);if(s.truncated===null&&s.hits.length===0&&s.sessionsScanned>0)return C("search.status.noneIn",{sessions:ou(s.sessionsScanned)});if(s.truncated==="results")return C("search.status.truncatedResults",{found:i});if(s.truncated==="time"){const u=Math.max(0,s.sessionsTotal-s.sessionsScanned);return C("search.status.truncatedTime",{found:i,seconds:Math.round(m0/1e3),left:ou(u)})}return C("search.status.done",{found:i})}function Vf(n){const s=new Set(n.hits.map(i=>`${i.agent}:${i.sessionId}`)).size;return C("search.found",{hits:C("search.hits",{count:n.hits.length}),sessions:ou(s)})}function kS(n,s){const i=s.terminals.find(u=>u.kind==="agent"&&u.agent===n.agent&&u.sessionId===n.sessionId);if(i!==void 0)return{kind:"activate",terminalId:i.terminalId};for(const u of s.projects){const _=u.sessions.find(R=>R.agent===n.agent&&R.sessionId===n.sessionId);if(_!==void 0)return eu(_)&&u.cwdExists&&s.canResume(_.agent)?{kind:"resume",cwd:Zp(_.cwd,u.cwd,s.platform),session:_}:{kind:"copy"}}return{kind:"copy"}}const ES=/<(code|kbd|b|strong|em)>([\s\S]*?)<\/\1>|<br\s*\/?>/g;function zt(n,s,i){const u=lm(n,s),_=[];let R=0;for(const x of u.matchAll(ES)){const r=x.index??0;r>R&&_.push(xl(u.slice(R,r),s));const c=x[1];if(c===void 0)_.push(j.createElement("br",{key:_.length}));else{const g=xl(x[2]??"",s);_.push(j.createElement(c,{key:_.length},g))}R=r+x[0].length}return R<u.length&&_.push(xl(u.slice(R),s)),_.length===1?_[0]:_}const qf="0.5.4",Kf="agent-workbench.support-notice",LS=3e4;function TS(n){return/^[0-9A-Za-z][0-9A-Za-z.+-]{0,39}$/.test(n)?n:null}function RS(n,s){return n!==s}function MS(){return[{keys:"Alt + T",description:C("shortcuts.app.newTab")},{keys:"Alt + W",description:C("shortcuts.app.closeTab")},{keys:"Alt + ← / →",description:C("shortcuts.app.switchTab")},{keys:"Alt + P",description:C("shortcuts.app.togglePanel")},{keys:"Shift + Tab",description:C("shortcuts.app.previousTab")}]}function AS({agent:n,onClose:s}){return j.useEffect(()=>{const i=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),s())};return window.addEventListener("keydown",i,!0),()=>window.removeEventListener("keydown",i,!0)},[s]),l.jsx("div",{className:"modal-backdrop",onClick:s,children:l.jsxs("div",{className:"modal",role:"dialog","aria-label":C("shortcuts.ariaLabel"),onClick:i=>i.stopPropagation(),children:[l.jsxs("header",{className:"modal-header",children:[l.jsx("span",{className:"modal-title",children:C("shortcuts.title")}),l.jsx("button",{className:"icon-button",onClick:s,title:C("common.close"),children:"×"})]}),l.jsxs("div",{className:"modal-body",children:[l.jsx("h3",{className:"modal-section",children:C("shortcuts.section.app")}),l.jsx(Hc,{shortcuts:MS()}),l.jsx("h3",{className:"modal-section",children:C("shortcuts.section.composer")}),l.jsx(Hc,{shortcuts:My(n!==null&&n.capabilities.imagesByPath!==null)}),n!==null&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"modal-section",children:C("shortcuts.section.cli")}),l.jsx("p",{className:"modal-hint",children:zt("shortcuts.cliHint")}),l.jsx(Hc,{shortcuts:Xr[n.id].shortcuts}),Xr[n.id].shortcutsNote!==null&&l.jsx("p",{className:"modal-hint",children:Xr[n.id].shortcutsNote})]}),l.jsx("p",{className:"modal-hint",children:zt("shortcuts.browserReserved")}),l.jsx("p",{className:"modal-hint",children:zt("shortcuts.altNumber")}),l.jsxs("p",{className:"modal-hint support-hint",children:[l.jsx("span",{"aria-hidden":"true",children:"☕"})," ",C("support.notice")," ",l.jsx("a",{href:tm,target:"_blank",rel:"noreferrer noopener",children:C("support.link")})]})]})]})})}function Hc({shortcuts:n}){return l.jsx("dl",{className:"shortcut-list",children:n.map(s=>l.jsxs("div",{className:"shortcut-row",children:[l.jsx("dt",{children:l.jsx("kbd",{children:s.keys})}),l.jsx("dd",{children:s.description})]},s.keys))})}const NS=1e3,DS=5e3;function IS({info:n,agentLabel:s,onRefresh:i,onClose:u}){const[_,R]=j.useState(!1),[x,r]=j.useState(!1),c=j.useRef(null),g=j.useRef(null);j.useEffect(()=>{const E=f=>{f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),u())};return window.addEventListener("keydown",E,!0),()=>window.removeEventListener("keydown",E,!0)},[u]),j.useEffect(()=>{r(!1)},[n]),j.useEffect(()=>()=>{c.current!==null&&window.clearTimeout(c.current),g.current!==null&&window.clearTimeout(g.current)},[]);const v=E=>{navigator.clipboard.writeText(E).then(()=>{R(!0),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>R(!1),NS)}).catch(()=>R(!1))},h=()=>{r(!0),i(),g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>r(!1),DS)},y=n.state==="active",S=C("statusLine.title",{agent:s});return l.jsx("div",{className:"modal-backdrop",onClick:u,children:l.jsxs("div",{className:"modal",role:"dialog","aria-label":S,onClick:E=>E.stopPropagation(),children:[l.jsxs("header",{className:"modal-header",children:[l.jsx("span",{className:"modal-title",children:S}),l.jsx("button",{className:"icon-button",onClick:u,title:C("common.close"),children:"×"})]}),l.jsxs("div",{className:"modal-body",children:[l.jsx("p",{className:`status-line-state${y?" status-line-state-active":""}`,children:ky(n.state)}),l.jsx("p",{className:"modal-hint",children:C("statusLine.benefit")}),l.jsx("h3",{className:"modal-section",children:C("statusLine.lineSection")}),n.fragment===null?l.jsx("p",{className:"modal-hint",children:Ey()}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"modal-hint",children:zt("statusLine.mergeHint")}),l.jsxs("div",{className:"status-line-fragment",children:[l.jsx("pre",{className:"tool-pre",children:n.fragment}),l.jsx("button",{className:"link-button",onClick:()=>v(n.fragment??""),title:C("statusLine.copyTitle"),children:_?l.jsxs(l.Fragment,{children:["✓ ",C("statusLine.copied")]}):C("statusLine.copy")})]})]}),l.jsx("h3",{className:"modal-section",children:C("statusLine.whereSection")}),l.jsx("p",{className:"status-line-path",children:n.settingsPath}),l.jsx("p",{className:"modal-hint",children:C("statusLine.whereHint")}),l.jsx("h3",{className:"modal-section",children:C("statusLine.scriptSection")}),l.jsx("p",{className:"modal-hint",children:C("statusLine.scriptHint")}),l.jsx("p",{className:"status-line-path",children:n.scriptPath}),l.jsx("p",{className:"modal-hint",children:zt("statusLine.runsEverywhere")}),l.jsxs("div",{className:"status-line-actions",children:[l.jsx("button",{className:"primary-button",onClick:h,disabled:x,children:C(x?"statusLine.checking":"statusLine.check")}),l.jsx("span",{className:"modal-hint",children:C("statusLine.checkHint")})]})]})]})})}function jS(){const[n,s]=j.useState(()=>RS(yt(Kf,null,TS),qf));return j.useEffect(()=>{if(!n)return;mt(Kf,qf);const i=window.setTimeout(()=>s(!1),LS);return()=>window.clearTimeout(i)},[n]),n?l.jsxs("div",{className:"banner banner-support",role:"status",children:[l.jsx("span",{children:C("support.notice")}),l.jsx("a",{className:"banner-support-link",href:tm,target:"_blank",rel:"noreferrer noopener",onClick:()=>s(!1),children:C("support.link")}),l.jsx("button",{className:"link-button banner-support-dismiss",onClick:()=>s(!1),children:C("support.dismiss")})]}):null}function lu({agent:n,agents:s}){return l.jsx("span",{className:"agent-badge",title:Zi(n,s),children:hy(n)})}const PS=500,Gf=10;function OS(n){const s=j.useRef(null),i=j.useRef(null),u=j.useRef(!1),_=j.useRef(n);_.current=n;const R=j.useCallback(()=>{s.current!==null&&window.clearTimeout(s.current),s.current=null,i.current=null},[]),x=j.useCallback(v=>{v.pointerType==="mouse"||v.button!==0||(R(),u.current=!1,i.current={x:v.clientX,y:v.clientY},s.current=window.setTimeout(()=>{s.current=null,u.current=!0,_.current()},PS))},[R]),r=j.useCallback(v=>{const h=i.current;h!==null&&(Math.abs(v.clientX-h.x)>Gf||Math.abs(v.clientY-h.y)>Gf)&&R()},[R]),c=j.useCallback(v=>{(u.current||s.current!==null)&&v.preventDefault()},[]),g=j.useCallback(v=>{u.current&&(u.current=!1,v.preventDefault(),v.stopPropagation())},[]);return{onPointerDown:x,onPointerMove:r,onPointerUp:R,onPointerCancel:R,onContextMenu:c,onClickCapture:g}}function BS({onLongPress:n,...s}){const i=OS(n);return l.jsx("button",{...s,...i})}function Cu({className:n,text:s,title:i,disabled:u,offerAgentChoice:_,agents:R,agent:x,onOpen:r}){var E;const[c,g]=j.useState(!1),v=j.useRef(null),h=j.useCallback(()=>g(!1),[]),y=j.useCallback(f=>{g(!1),r(f)},[r]);if(!_)return l.jsx("button",{className:n,onClick:()=>r(),disabled:u,title:i,children:s});const S=((E=R.find(f=>f.id===x))==null?void 0:E.label)??null;return l.jsxs("span",{className:"split-button",children:[l.jsx("button",{className:`${n} split-button-main`,onClick:()=>r(x??void 0),disabled:u,title:S===null?i:C("agentMenu.titleWithAgent",{title:i,label:S}),children:s}),l.jsx("button",{ref:v,className:`${n} split-button-arrow`,onClick:()=>g(f=>!f),disabled:u,"aria-haspopup":"menu","aria-expanded":c,title:C("agentMenu.chooseTitle"),children:"▾"}),c&&v.current!==null&&l.jsx(Hm,{agents:R,preselected:x,anchor:v.current,onPick:y,onClose:h})]})}function FS(n){const s=new Date(n);return s.setHours(0,0,0,0),s.getTime()}function ng(n,s,i,u){const _=new Set;for(const R of n)for(const x of R.sessions)x.agent===s&&(x.archived||x.updatedAt<i&&(u.has(x.sessionId)||_.add(x.sessionId)));return[..._]}function HS(n,s,i,u){const _=[];for(const r of n)for(const c of r.sessions)_.includes(c.agent)||_.push(c.agent);const R=u,x=r=>{const c=R.indexOf(r);return c===-1?u.length:c};return _.sort((r,c)=>x(r)-x(c)).map(r=>({agent:r,count:ng(n,r,s,i).length})).filter(r=>r.count>0)}function sg(n,s){const i=new Set;let u=0;for(const _ of n.sessions)if(!_.archived){if(s.has(_.sessionId)){u+=1;continue}i.add(_.sessionId)}return{sessionIds:[...i],blocked:u}}function $S(n){const{sessionIds:s,blocked:i}=n;if(s.length===0)return C("archive.allBlocked",{count:i});const u=C("archive.confirm",{count:s.length});return i===0?u:C("archive.withBlocked",{confirm:u,blocked:C("archive.blockedStays",{count:i})})}const Yf=12;function US(n){let s=2166136261;for(let i=0;i<n.length;i+=1)s^=n.charCodeAt(i),s=Math.imul(s,16777619);return s>>>0}function cr(n){const s=n.toLowerCase().replace(/[\\/]+/g,"/").replace(/\/+$/,"");return`hsl(${US(s)%Yf*(360/Yf)} var(--project-color-s) var(--project-color-l))`}function ei(){return C("vault.name")}function WS(){return C("vault.privacy")}function zS(){return C("vault.archived")}function VS(){return C("vault.mark.copy")}function Xf(){return C("vault.mark.copyTitle")}function qS(){return C("vault.mark.partial")}function KS(){return C("vault.mark.partialTitle")}function rg(n){return C("vault.sessions",{count:n})}function xu(n){return n==="measuring"||n==="writing"||n==="moving"}function GS(n){const s=n.progress;switch(n.state){case"measuring":return s===null?C("vault.state.measuring"):C("vault.state.measuringProgress",{done:s.done,total:s.total});case"writing":return s===null?C("vault.state.writing"):C("vault.state.writingProgress",{done:s.done,total:s.total});case"moving":return C("vault.state.moving");default:return n.enabled?C("vault.state.on"):C("vault.state.off")}}function YS(n){if(n===null||!n.enabled)return null;const s=[ei(),rg(n.sessions)];return n.state==="writing"?s.push(n.progress===null?C("vault.line.copying"):C("vault.line.copyingProgress",{done:n.progress.done,total:n.progress.total})):n.state==="moving"?s.push(C("vault.line.moving")):n.state==="measuring"?s.push(C("vault.line.measuring")):s.push(n.lastPassAt===null?C("vault.line.neverCopied"):Kn(n.lastPassAt)),n.pending>0&&s.push(C("vault.line.pending",{count:n.pending})),s.join(" · ")}function XS(n){return n===null?ei():n.enabled?C("vault.button.on"):C("vault.button.off")}function QS(n){return n.enabled?"enabled":xu(n.state)?"busy":n.measurement!==null?"measured":n.passSessions>0?"existing":"needs-measure"}function JS(n,s){return xu(n.state)?C("vault.busy"):s?null:C("vault.indexNotReady")}function ZS(n){return xu(n.state)?C("vault.busy"):null}function eC(n){return C("vault.previousDir",{dir:n})}function tC(n){const s=[];return n.skippedEmpty>0&&s.push(C("vault.note.empty",{count:n.skippedEmpty})),n.unsupported>0&&s.push(C("vault.note.unsupported",{count:n.unsupported})),n.failed>0&&s.push(n.failureReasons.length>0?C("vault.note.failedWithReasons",{count:n.failed,reasons:n.failureReasons.map(Dt).join("; ")}):C("vault.note.failed",{count:n.failed})),s.length===0?null:C("vault.note.notCopied",{parts:s.join(" · ")})}function nC(n,s){const i=n.byAgent.map(R=>({agent:R.agent,label:Zi(R.agent,s),sessions:R.sessions,bytes:R.eventBytes+R.imageBytes,images:R.images,imageBytes:R.imageBytes,skippedArchived:R.skippedArchived,note:tC(R)})),u=i.reduce((R,x)=>({sessions:R.sessions+x.sessions,bytes:R.bytes+x.bytes,images:R.images+x.images,skippedArchived:R.skippedArchived+x.skippedArchived}),{sessions:0,bytes:n.memoryBytes,images:0,skippedArchived:0}),_=Kn(n.measuredAt);return{rows:i,memoryProjects:n.memoryProjects,memoryBytes:n.memoryBytes,total:u,summary:_.length>0?C("vault.measure.summary",{when:_,duration:Yi(n.durationMs)}):C("vault.measure.summaryNoWhen",{duration:Yi(n.durationMs)})}}function sC(n){const s=n.storage==="vault";return{copy:s,partial:s&&n.partial}}function rC(n){switch(n){case"exporting":return C("vault.export.exporting");case"done":return C("vault.export.done");default:return C("vault.export.idle")}}const iC=1e3;function Qf({hit:n}){const{before:s,match:i,after:u}=eg(n);return l.jsxs(l.Fragment,{children:[s,l.jsx("mark",{children:i}),u]})}function oC({project:n,openSessionIds:s,onConfirm:i,onCancel:u}){const _=sg(n,s);return l.jsxs("div",{className:"project-archive-confirm",role:"group",children:[l.jsx("span",{className:"archive-history-text",children:$S(_)}),_.sessionIds.length>0&&l.jsx("button",{className:"link-button",onClick:i,children:C("sidebar.action.archive")}),l.jsx("button",{className:"link-button",onClick:u,children:_.sessionIds.length>0?C("common.cancel"):C("common.close")})]})}function $c(n){if(n.cwd.length===0)return n.fallbackName;const s=n.cwd.split(/[\\/]/).filter(i=>i.length>0);return s[s.length-1]??n.cwd}function Jf({out:n}){return l.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:[l.jsx("rect",{x:"2.5",y:"3.5",width:"19",height:"5",rx:"1.2"}),l.jsx("path",{d:"M4.5 8.5v10a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-10"}),n?l.jsx("path",{d:"M12 18.5v-6M9.2 15.3 12 12.5l2.8 2.8"}):l.jsx("path",{d:"M10 12.5h4"})]})}function lC(){return l.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:[l.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"}),l.jsx("rect",{x:"4",y:"7",width:"12",height:"14",rx:"1.5"}),l.jsx("path",{d:"M7.5 12h5M7.5 15.5h5"})]})}function aC({done:n}){return l.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?l.jsx("path",{d:"M5 12.5l4.5 4.5L19 7.5"}):l.jsxs(l.Fragment,{children:[l.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"}),l.jsx("path",{d:"M12 10.5v6.5M9.2 14.2 12 17l2.8-2.8"})]})})}function cC({candidates:n,agents:s,onArchiveAgent:i,onClose:u,anchorRef:_}){const[R,x]=j.useState(null),r=j.useRef(null);return j.useEffect(()=>{const c=h=>{var y,S;return h instanceof Node&&(((y=r.current)==null?void 0:y.contains(h))===!0||((S=_.current)==null?void 0:S.contains(h))===!0)},g=h=>{h.key!=="Escape"||!c(document.activeElement)||(h.preventDefault(),h.stopPropagation(),u())},v=h=>{c(h.target)||u()};return window.addEventListener("keydown",g,!0),document.addEventListener("pointerdown",v,!0),()=>{window.removeEventListener("keydown",g,!0),document.removeEventListener("pointerdown",v,!0)}},[_,u]),l.jsxs("div",{ref:r,className:"archive-history",role:"region","aria-label":C("sidebar.history.region"),children:[l.jsxs("div",{className:"archive-history-header",children:[l.jsx("span",{children:C("sidebar.history.heading")}),l.jsx("button",{className:"icon-button",onClick:u,title:C("common.closeEsc"),children:"×"})]}),n.map(({agent:c,count:g})=>{const v=Zi(c,s);return R===c?l.jsxs("div",{className:"archive-history-row archive-history-confirm",children:[l.jsx("span",{className:"archive-history-text",children:C("sidebar.history.confirm",{count:g,label:v})}),l.jsx("button",{className:"link-button",onClick:()=>i(c),children:C("sidebar.action.archive")}),l.jsx("button",{className:"link-button",onClick:()=>x(null),children:C("common.cancel")})]},c):l.jsxs("div",{className:"archive-history-row",children:[l.jsxs("span",{className:"archive-history-text",children:[l.jsx("span",{className:"archive-history-agent",children:v}),l.jsx("span",{className:"archive-history-count",children:C("sidebar.history.count",{count:g})})]}),l.jsx("button",{className:"link-button",onClick:()=>x(c),children:C("sidebar.action.archive")})]},c)})]})}function uC({projects:n,indexStatus:s,disabled:i,openSessionIds:u,openBlocked:_,onOpenProject:R,agents:x,offerAgentChoice:r,agentForProject:c,onOpenSession:g,canResume:v,platform:h,onRefresh:y,onArchive:S,onHide:E,width:f,onNewProject:a,vault:m,onOpenVault:p,onOpenVaultSession:d,onExportProject:k,exporting:I,lastExported:L,onContinueSession:M,globalSearch:b,onOpenSearchHit:T}){const[N,O]=j.useState(new Set),[B,F]=j.useState(null);j.useEffect(()=>{const he=L===null?0:L.at+iC-Date.now();if(L===null||he<=0)return;F(L.projectKey);const me=window.setTimeout(()=>F(null),he);return()=>window.clearTimeout(me)},[L]);const U=he=>I.has(he)?"exporting":B===he?"done":"idle",V=YS(m),[X,Y]=j.useState(""),[q,D]=j.useState(!1),[$,H]=j.useState(new Set),[K,te]=j.useState("titles"),re=b===null?"titles":K,[ae,ue]=j.useState(!1),G=b!==null&&re==="conversations"&&X.trim().length>0&&(ae||b.submitted!==null),W=(b==null?void 0:b.result)??null,J=j.useMemo(()=>G&&W!==null?yS(W.hits):[],[G,W]),Z=he=>{te(he),ue(!1),b==null||b.clear()},de=()=>{if(b!==null){if(_S(X)){ue(!0),b.clear();return}ue(!1),b.search(X.trim(),q)}},fe=(b==null?void 0:b.submitted)??null,se=b==null?void 0:b.search;j.useEffect(()=>{re!=="conversations"||fe===null||se===void 0||fe.includeArchived!==q&&se(fe.query,q)},[re,fe,se,q]);const Ee=j.useMemo(()=>n.reduce((he,me)=>he+me.sessions.filter(Ae=>Ae.archived).length,0),[n]),Me=j.useMemo(()=>{const he=re==="titles"?X.trim().toLowerCase():"";return n.map(me=>{const Ae=q?me.sessions:me.sessions.filter(qe=>!qe.archived);if(Ae.length===0)return null;if(he.length===0)return{...me,sessions:Ae};if($c(me).toLowerCase().includes(he)||me.cwd.toLowerCase().includes(he))return{...me,sessions:Ae};const Ne=Ae.filter(qe=>qn(qe.title,qe.titleSource).toLowerCase().includes(he));return Ne.length>0?{...me,sessions:Ne}:null}).filter(me=>me!==null)},[n,X,q,re]),Qe=re==="titles"&&X.trim().length>0,Le=he=>he.archived||!u.has(he.sessionId),[pe,Re]=j.useState(!1),Ce=j.useRef(null),Te=FS(Date.now()),Pe=j.useMemo(()=>x.map(he=>he.id),[x]),xe=j.useMemo(()=>HS(n,Te,u,Pe),[n,Te,u,Pe]),[Ie,et]=j.useState(null);j.useEffect(()=>{xe.length===0&&Re(!1)},[xe.length]);const ot=j.useCallback(()=>Re(!1),[]),Ze=he=>{const me=ng(n,he,Te,u);me.length>0&&(S(me,!0),et({what:Zi(he,x),sessionIds:me})),Re(!1)},[ht,tt]=j.useState(null),He=he=>{const me=sg(he,u);me.sessionIds.length>0&&(S(me.sessionIds,!0),et({what:$c(he),sessionIds:me.sessionIds})),tt(null)},nt=()=>{Ie!==null&&S(Ie.sessionIds,!1),et(null)},Ve=he=>{H(me=>{const Ae=new Set(me);return Ae.has(he)?Ae.delete(he):Ae.add(he),Ae})},at=j.useMemo(()=>{const he=[];for(const me of Me)for(const Ae of me.sessions)$.has(Ae.sessionId)&&he.push(Ae);return he},[Me,$]),st=he=>{const me=at.filter(Ae=>he?Le(Ae):!0).map(Ae=>Ae.sessionId);me.length>0&&S(me,he),H(new Set)},ke=he=>{O(me=>{const Ae=new Set(me);return Ae.has(he)?Ae.delete(he):Ae.add(he),Ae})},Ke=s.state==="scanning";return l.jsxs("aside",{className:"sidebar",style:{width:`${f}px`},children:[l.jsxs("div",{className:"sidebar-header",children:[l.jsx("input",{className:"sidebar-filter",type:"search",placeholder:mS(re),value:X,onChange:he=>{Y(he.target.value),re==="conversations"&&(ue(!1),he.target.value.trim().length===0&&(b==null||b.clear()))},onKeyDown:he=>{re!=="conversations"||he.key!=="Enter"||(he.preventDefault(),de())},spellCheck:!1}),l.jsx("button",{className:"icon-button",onClick:a,title:C("sidebar.newProject"),disabled:i,children:"+"}),l.jsx("button",{className:"icon-button",onClick:y,title:C("sidebar.reindex"),disabled:Ke,children:"⟳"}),l.jsx("button",{className:`icon-button${(m==null?void 0:m.enabled)===!0?" icon-button-on":""}`,onClick:p,title:XS(m),"aria-label":ei(),children:l.jsx(lC,{})}),l.jsx("button",{className:"icon-button",onClick:E,title:C("sidebar.hide"),children:"«"})]}),b!==null&&l.jsxs("div",{className:"sidebar-search-mode",role:"group","aria-label":C("sidebar.searchMode.label"),children:[l.jsx("button",{className:`sidebar-search-mode-option${re==="titles"?" is-on":""}`,"aria-pressed":re==="titles",onClick:()=>Z("titles"),title:C("sidebar.searchMode.titlesTitle"),children:dS()}),l.jsx("button",{className:`sidebar-search-mode-option${re==="conversations"?" is-on":""}`,"aria-pressed":re==="conversations",onClick:()=>Z("conversations"),title:pS(),children:fS()})]}),Ke&&l.jsx("div",{className:"sidebar-progress",children:C("sidebar.indexing",{scanned:s.scannedFiles,total:s.totalFiles})}),(Ee>0||xe.length>0)&&l.jsxs("div",{className:"sidebar-archive-bar",children:[Ee>0&&l.jsx("button",{className:`sidebar-archived-toggle${q?" is-on":""}`,onClick:()=>D(he=>!he),title:C("sidebar.archived.toggleTitle"),children:q?C("sidebar.archived.hide",{count:Ee}):C("sidebar.archived.show",{count:Ee})}),xe.length>0&&l.jsx("button",{ref:Ce,className:`link-button sidebar-archive-history${pe?" is-on":""}`,onClick:()=>Re(he=>!he),"aria-expanded":pe,title:C("sidebar.history.buttonTitle"),children:C("sidebar.history.button")})]}),pe&&xe.length>0&&l.jsx(cC,{candidates:xe,agents:x,onArchiveAgent:Ze,onClose:ot,anchorRef:Ce}),Ie!==null&&!pe&&l.jsxs("div",{className:"archive-history archive-history-undo",role:"status",children:[l.jsx("span",{className:"archive-history-text",children:C("sidebar.undo.text",{count:Ie.sessionIds.length,what:Ie.what})}),l.jsx("button",{className:"link-button",onClick:nt,children:C("sidebar.action.undo")}),l.jsx("button",{className:"icon-button",onClick:()=>et(null),title:C("sidebar.undo.dismissTitle"),children:"×"})]}),V!==null&&l.jsx("button",{className:`sidebar-vault-line${(m==null?void 0:m.lastError)!=null?" is-problem":""}`,onClick:p,title:(m==null?void 0:m.lastError)!=null?C("sidebar.vaultLine.lastError",{error:Dt(m.lastError)}):C("sidebar.vaultLine.title"),children:V}),l.jsxs("div",{className:"sidebar-scroll",children:[G&&b!==null&&l.jsxs("div",{className:"search-results",children:[!b.vaultEnabled&&l.jsx("p",{className:"search-note",children:vS()}),l.jsx("p",{className:`search-status${b.error!==null?" is-problem":""}`,role:"status",children:ae?gS():xS(b)}),!ae&&J.map(he=>{const me=he.hits[0]??he.titleHit;return me===null?null:l.jsxs("div",{className:"search-group",children:[l.jsxs("button",{className:"search-group-title",onClick:()=>T(me,SS(he)),title:qn(he.title),children:[l.jsx(lu,{agent:he.agent,agents:x}),he.titleHit!==null?l.jsx(Qf,{hit:he.titleHit}):qn(he.title)]}),he.hits.map(Ae=>l.jsxs("button",{className:"search-hit",onClick:()=>T(Ae,tg(Ae)),children:[l.jsx("span",{className:"search-hit-snippet",children:l.jsx(Qf,{hit:Ae})}),l.jsxs("span",{className:"search-hit-meta",children:[bS(Ae),Ae.at!==null?` · ${Kn(Ae.at)}`:""]})]},Ae.eventId??"titulo"))]},he.key)})]}),!G&&Me.length===0&&!Ke&&l.jsx("p",{className:"sidebar-empty",children:n.length===0?C("sidebar.empty.noProjects"):C("sidebar.empty.noMatch")}),!G&&Me.map(he=>{const me=N.has(he.key)||Qe,Ae=!i&&he.cwdExists,pt=_(he.cwd);return l.jsxs("div",{className:"project",children:[l.jsxs("div",{className:"project-row",children:[l.jsxs("button",{className:"project-toggle",onClick:()=>ke(he.key),title:he.cwd.length>0?he.cwd:he.fallbackName,children:[l.jsx("span",{className:`chevron${me?" chevron-open":""}`,children:"›"}),l.jsx("span",{className:"project-swatch",style:{background:cr(he.cwd)},"aria-hidden":"true"}),l.jsx("span",{className:"project-name",children:$c(he)}),l.jsx("span",{className:"project-count",children:he.sessions.length})]}),l.jsxs("span",{className:"project-actions",children:[k!==null&&l.jsx("button",{className:`icon-button project-action${U(he.key)!=="idle"?" project-action-busy":""}`,onClick:()=>k(he.key),disabled:U(he.key)==="exporting",title:rC(U(he.key)),"aria-label":C("sidebar.project.export"),children:l.jsx(aC,{done:U(he.key)==="done"})}),l.jsx("button",{className:`icon-button project-action${ht===he.key?" project-action-busy":""}`,onClick:()=>tt(Ne=>Ne===he.key?null:he.key),title:C("sidebar.project.archiveTitle"),"aria-label":C("sidebar.project.archive"),"aria-expanded":ht===he.key,children:l.jsx(Jf,{out:!1})})]}),l.jsx(Cu,{className:"icon-button",text:"+",title:pt?gm():he.cwdExists?C("sidebar.project.newSession"):C("sidebar.project.folderGone"),disabled:!Ae||pt,offerAgentChoice:r,agents:x,agent:r?c(he):null,onOpen:Ne=>R(he.cwd,Ne)})]}),!he.cwdExists&&l.jsx("div",{className:"project-missing",title:he.cwd,children:C("sidebar.project.missing")}),ht===he.key&&l.jsx(oC,{project:he,openSessionIds:u,onConfirm:()=>He(he),onCancel:()=>tt(null)}),me&&l.jsx("ul",{className:"session-list",children:he.sessions.map(Ne=>{const qe=$.has(Ne.sessionId),ct=!Le(Ne),At=Zy(Ne.agent,x,r),Tt=sC(Ne),Cn=eu(Ne)&&v(Ne.agent),Yn=Tt.copy?d!==null:Ae&&Cn;return l.jsxs("li",{className:`session-row${Ne.archived?" session-archived":""}${qe?" session-selected":""}`,children:[l.jsxs(BS,{className:"session-item",onLongPress:()=>Ve(Ne.sessionId),onClick:dn=>{if(dn.ctrlKey||dn.metaKey){Ve(Ne.sessionId);return}if(Tt.copy){d==null||d(Ne);return}eu(Ne)&&(Ne.archived&&S([Ne.sessionId],!1),g(Zp(Ne.cwd,he.cwd,h),Ne))},disabled:!Yn,title:Tt.copy?`${qn(Ne.title,Ne.titleSource)}
128
- ${d===null?C("remote.onlyOnHost"):Xf()}`:At.unavailableTitle??qn(Ne.title,Ne.titleSource),children:[l.jsxs("span",{className:"session-title",children:[At.badge&&l.jsx(lu,{agent:Ne.agent,agents:x}),Tt.copy&&l.jsx("span",{className:"session-vault-mark",title:Xf(),children:VS()}),Tt.partial&&l.jsx("span",{className:"session-partial-mark",title:KS(),children:qS()}),qn(Ne.title,Ne.titleSource)]}),l.jsx("span",{className:"session-meta",children:Kn(Ne.updatedAt)})]}),l.jsx($m,{targets:pm(x,Ne.agent,Ne.partial),className:"icon-button session-continue",text:"↪",onPick:dn=>M(Ne,dn)}),l.jsx("button",{className:"icon-button session-action",onClick:()=>S([Ne.sessionId],!Ne.archived),disabled:ct,title:Ne.archived?C("sidebar.session.restore"):C(ct?"sidebar.session.blocked":"sidebar.session.archive"),children:l.jsx(Jf,{out:Ne.archived})})]},`${Ne.agent}:${Ne.sessionId}`)})})]},he.key)})]}),at.length>0&&l.jsxs("div",{className:"sidebar-selection",children:[l.jsx("span",{children:C("sidebar.selection.count",{count:at.length})}),at.some(he=>!he.archived)&&l.jsx("button",{className:"link-button",onClick:()=>st(!0),children:C("sidebar.action.archive")}),at.some(he=>he.archived)&&l.jsx("button",{className:"link-button",onClick:()=>st(!1),children:C("sidebar.action.restore")}),l.jsx("button",{className:"link-button",onClick:()=>H(new Set),children:C("common.cancel")})]})]})}function au({x:n,y:s,items:i,onClose:u,anchor:_=null}){const R=j.useRef(null),[x,r]=j.useState({left:n,top:s});return j.useLayoutEffect(()=>{const c=R.current;if(c===null)return;const{width:g,height:v}=c.getBoundingClientRect();r({left:Math.max(4,Math.min(n,window.innerWidth-g-4)),top:Math.max(4,Math.min(s,window.innerHeight-v-4))})},[n,s]),j.useEffect(()=>{const c=v=>{v.key==="Escape"&&(v.stopPropagation(),u())},g=v=>{var y;const h=v.target;h instanceof Node&&((y=R.current)!=null&&y.contains(h)||_!=null&&_.contains(h))||u()};return window.addEventListener("keydown",c,!0),window.addEventListener("pointerdown",g,!0),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),()=>{window.removeEventListener("keydown",c,!0),window.removeEventListener("pointerdown",g,!0),window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u)}},[_,u]),l.jsx("div",{ref:R,className:"context-menu",style:{left:`${x.left}px`,top:`${x.top}px`},onPointerDown:c=>c.stopPropagation(),children:i.map(c=>l.jsxs("button",{className:"context-menu-item",lang:c.lang,role:c.checked===void 0?void 0:"menuitemradio","aria-checked":c.checked,onClick:()=>{c.onSelect(),u()},children:[c.checked!==void 0&&l.jsx("span",{className:"context-menu-check","aria-hidden":"true",children:c.checked?"✓":""}),c.label]},c.label))})}function ig({listLabel:n,docs:s,active:i,tooltipOf:u,labelOf:_=c=>c.title,onShowList:R,onSelect:x,onClose:r}){return l.jsxs("div",{className:"panel-subhead doc-strip",children:[l.jsx("button",{className:`doc-strip-list${i===null?" is-active":""}`,onClick:R,title:C("docs.backToList"),children:i===null?n:`← ${n}`}),l.jsx("div",{className:"strip-tabs doc-tabs",children:s.map(c=>l.jsxs("div",{className:`strip-tab${c.key===i?" is-active":""}`,children:[l.jsx("button",{className:"strip-tab-label",onClick:()=>x(c.key),title:u(c),children:_(c)}),l.jsx("button",{className:"strip-tab-close",onClick:()=>r(c.key),title:C("docs.tab.close"),children:"×"})]},c.key))})]})}function Zf(n){let s="";for(let i=0;i<n.length;i++){const u=n[i]??"",_=u.toLowerCase();s+=_.length===u.length?_:u}return s}function hC(n,s){if(s.length===0)return[];const i=Zf(n),u=Zf(s),_=[];let R=i.indexOf(u);for(;R!==-1;)_.push(R),R=i.indexOf(u,R+u.length);return _}function ep(n,s,i){for(let R=0;R<n.length;R++){const x=n[R]??0;if(i==="start"?s<x:s<=x){const r=R===0?0:n[R-1]??0;return{node:R,offset:s-r}}}const u=Math.max(0,n.length-1),_=u===0?0:n[u-1]??0;return{node:u,offset:(n[u]??0)-_}}function dC(n,s,i){return s===0?0:(n+i+s)%s}function fC(n){return/\.(md|markdown)$/i.test(n)}function pC(n,s){var R;const i=((R=s.split("#")[0])==null?void 0:R.split("?")[0])??"";if(i.length===0)return null;let u;try{u=decodeURIComponent(i)}catch{return null}if(/^[a-z][a-z0-9+.-]*:/i.test(u)||u.startsWith("/")||u.startsWith("\\"))return null;const _=n.split("/").slice(0,-1);for(const x of u.replace(/\\/g,"/").split("/")){if(x.includes(":"))return null;if(!(x===""||x===".")){if(x===".."){if(_.length===0)return null;_.pop();continue}_.push(x)}}return _.length===0?null:_.join("/")}function mC({text:n,language:s}){const[i,u]=j.useState(null);j.useEffect(()=>{if(s===null){u(null);return}let R=!1;return Vn(async()=>{const{highlightCode:x}=await import("./highlight-BeEbartE.js");return{highlightCode:x}},[]).then(({highlightCode:x})=>{R||u(x(n,s))}).catch(()=>{R||u(null)}),()=>{R=!0,u(null)}},[n,s]);const _=j.useMemo(()=>n.split(`
129
- `).length,[n]);return l.jsxs("div",{className:"preview",children:[l.jsx("div",{className:"preview-gutter","aria-hidden":"true","data-search-skip":"",children:Array.from({length:_},(R,x)=>l.jsx("span",{children:x+1},x))}),i!==null?l.jsx("pre",{className:"preview-code hljs",dangerouslySetInnerHTML:{__html:i}}):l.jsx("pre",{className:"preview-code",children:n})]})}function tp({onInsert:n,onOpenWithSystem:s}){const[i,u]=j.useState(!1),_=j.useRef(null);j.useEffect(()=>()=>{_.current!==null&&window.clearTimeout(_.current)},[]);const R=()=>{n==null||n(),u(!0),_.current!==null&&window.clearTimeout(_.current),_.current=window.setTimeout(()=>u(!1),1200)};return l.jsxs("div",{className:"preview-actions",children:[n!==void 0&&l.jsx("button",{className:"primary-button primary-button-small preview-open",onClick:R,children:C(i?"files.pathInserted":"files.preview.insertPath")}),s!==null&&l.jsx("button",{className:"primary-button primary-button-small preview-open",onClick:s,children:C("files.menu.openWithSystem")})]})}const cu="doc-search",uu="doc-search-current";function hu(){const n=CSS.highlights,s=window.Highlight;return n===void 0||typeof s!="function"?null:n}function np(n){const s=window.Highlight;return new s(...n)}function sp(){const n=hu();n==null||n.delete(cu),n==null||n.delete(uu)}function gC(n,s){if(s===null)return;const i=n.getBoundingClientRect(),u=s.getBoundingClientRect();(i.top<u.top+16||i.bottom>u.bottom-16)&&(s.scrollTop+=i.top-u.top-u.height/3),(i.left<u.left||i.right>u.right)&&(s.scrollLeft+=i.left-u.left-48)}function _C(n,s,i,u){const[_,R]=j.useState(0),[x,r]=j.useState(0),[c,g]=j.useState(0),v=j.useRef([]);j.useEffect(()=>{const y=n.current;if(y===null||i.length===0)return;let S=0;const E=new MutationObserver(()=>{S===0&&(S=window.requestAnimationFrame(()=>{S=0,g(f=>f+1)}))});return E.observe(y,{childList:!0,subtree:!0,characterData:!0}),()=>{E.disconnect(),S!==0&&window.cancelAnimationFrame(S)}},[n,i,u]),j.useEffect(()=>{const y=n.current;if(v.current=[],y===null||i.length===0){sp(),R(0),r(0);return}const S=[],E=[];let f="";const a=document.createTreeWalker(y,NodeFilter.SHOW_TEXT,{acceptNode:p=>{var d;return(d=p.parentElement)!=null&&d.closest("[data-search-skip]")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(let p=a.nextNode();p!==null;p=a.nextNode()){const d=p;S.push(d),f+=d.data,E.push(f.length)}v.current=hC(f,i).map(p=>{const d=ep(E,p,"start"),k=ep(E,p+i.length,"end"),I=document.createRange();return I.setStart(S[d.node],d.offset),I.setEnd(S[k.node],k.offset),I}),R(v.current.length),r(p=>p<v.current.length?p:0);const m=hu();return m!==null&&v.current.length>0?m.set(cu,np(v.current)):m==null||m.delete(cu),sp},[n,i,c,u]),j.useEffect(()=>{r(0)},[i]),j.useEffect(()=>{const y=v.current[x],S=hu();if(y===void 0){S==null||S.delete(uu);return}S==null||S.set(uu,np([y])),gC(y,s.current)},[x,_,c,u,i,s]);const h=j.useCallback(y=>r(S=>dC(S,_,y)),[_]);return{count:_,index:x,step:h}}function og({doc:n,content:s,readingText:i,truncatedText:u,onReload:_,onModeChange:R,onOpenWithSystem:x,onInsert:r,onOpenLink:c,initialScroll:g,onScrollChange:v}){const[h,y]=j.useState(""),S=j.useRef(null),E=j.useRef(null),f=(s==null?void 0:s.loaded)??null,a=f===null?"":f.kind==="file"?f.preview.text:f.plan.text,m=f!==null&&f.kind==="file"&&f.preview.binary,p=f!==null&&(f.kind==="file"?f.preview.truncated:f.plan.truncated),d=f!==null&&(f.kind==="plan"||f.preview.language==="markdown"||fC(f.preview.path)),k=d&&(n.mode??"formatted")==="formatted",I=f!==null&&f.kind==="file"?f.preview.language:"markdown",L=h.trim(),M=_C(E,S,L,`${k?"f":"s"}:${a.length}:${a.slice(0,64)}`),b=j.useRef(!1);j.useLayoutEffect(()=>{b.current||f===null||(b.current=!0,g!==void 0&&S.current!==null&&(S.current.scrollTop=g))},[f,g]);const T=c===void 0||f===null||f.kind!=="file"?void 0:O=>{const B=pC(n.key,O);return B===null?null:()=>c(B)},N=f!==null&&!m;return l.jsxs("div",{className:"panel-body doc-viewer",children:[l.jsxs("div",{className:"doc-toolbar",children:[l.jsx("input",{className:"conversation-search-input",type:"search",placeholder:C("docs.search.placeholder"),value:h,disabled:!N,onChange:O=>y(O.target.value),onKeyDown:O=>{O.key==="Enter"&&M.step(O.shiftKey?-1:1),O.key==="Escape"&&y(""),O.stopPropagation()},spellCheck:!1}),L.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"conversation-matches",children:M.count===0?C("thread.search.none"):`${M.index+1}/${M.count}`}),l.jsx("button",{className:"icon-button",onClick:()=>M.step(-1),disabled:M.count===0,title:C("thread.search.previous"),children:"↑"}),l.jsx("button",{className:"icon-button",onClick:()=>M.step(1),disabled:M.count===0,title:C("thread.search.next"),children:"↓"})]}),d&&l.jsxs("div",{className:"doc-mode",role:"group","aria-label":C("docs.mode.label"),children:[l.jsx("button",{className:k?"is-active":"","aria-pressed":k,onClick:()=>R("formatted"),children:C("docs.mode.formatted")}),l.jsx("button",{className:k?"":"is-active","aria-pressed":!k,onClick:()=>R("source"),children:C("docs.mode.source")})]}),l.jsx("button",{className:"icon-button",onClick:_,disabled:(s==null?void 0:s.loading)===!0,title:C("docs.reload"),children:"⟳"})]}),(s==null?void 0:s.failed)===!0&&f!==null&&l.jsx("p",{className:"panel-note doc-note",children:C("docs.reloadFailed")}),f===null?l.jsx("p",{className:"panel-note",children:(s==null?void 0:s.failed)===!0?C("docs.failed"):i}):m?l.jsxs("div",{className:"preview-fallback",children:[l.jsx("p",{className:"panel-note",children:C("files.preview.binary")}),l.jsx(tp,{onInsert:r,onOpenWithSystem:x})]}):l.jsxs("div",{className:"panel-scroll",ref:S,onScroll:O=>v(O.currentTarget.scrollTop),children:[l.jsx("div",{ref:E,className:k?"plan-body":"doc-source",children:k?l.jsx(Su,{text:a,localLink:T}):l.jsx(mC,{text:a,language:I})}),p&&l.jsxs("div",{className:"preview-fallback",children:[l.jsx("p",{className:"panel-note",children:u}),f.kind==="file"&&l.jsx(tp,{onInsert:r,onOpenWithSystem:x})]})]})]})}function ku(){return l.jsx("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:l.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 vC(){return l.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:[l.jsx("rect",{x:"5.5",y:"1.5",width:"9",height:"10",rx:"1.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),l.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 yC({open:n}){return l.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:[l.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"}),l.jsx("circle",{cx:"8",cy:"8",r:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),!n&&l.jsx("path",{d:"M2.6 13.4L13.4 2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function wC(){return l.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:[l.jsx("rect",{x:"1.5",y:"10",width:"13",height:"4.5",rx:"1.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),l.jsx("path",{d:"M8 1.5v6.2M5.4 5.3L8 7.9l2.6-2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function bC(){return l.jsx("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:l.jsx("path",{d:"M3 8.5l3.2 3.2L13 4.8",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function lg({className:n,title:s,doneTitle:i,icon:u,onAction:_}){const[R,x]=j.useState(!1),r=j.useRef(null);j.useEffect(()=>()=>{r.current!==null&&window.clearTimeout(r.current)},[]);const c=g=>{g.stopPropagation(),_(),x(!0),r.current!==null&&window.clearTimeout(r.current),r.current=window.setTimeout(()=>x(!1),1200)};return l.jsx("button",{className:R?`${n} tree-action-done`:n,onClick:c,title:R?i:s,children:R?l.jsx(bC,{}):u})}function SC({className:n,title:s,onCopy:i}){return l.jsx(lg,{className:n,title:s,doneTitle:C("common.copied"),icon:l.jsx(vC,{}),onAction:i})}function Eu({className:n,title:s,onInsert:i}){return l.jsx(lg,{className:n,title:s,doneTitle:C("files.pathInserted"),icon:l.jsx(wC,{}),onAction:i})}function CC({view:n,cwd:s,platform:i,onInsert:u,onInsertPath:_,onReveal:R,docs:x}){const{listings:r,loading:c,refresh:g,query:v,setQuery:h,showHidden:y,toggleHidden:S}=n,E=eo(),[f,a]=j.useState(null),m=i==="win32"?"\\":"/",p=j.useCallback(V=>{const X=V.split("/").join(m);return s.length===0?X:s.endsWith(m)?`${s}${X}`:`${s}${m}${X}`},[s,m]),d=j.useCallback(V=>{navigator.clipboard.writeText(V).catch(()=>{})},[]),k=j.useCallback(V=>_(`"${p(V)}"`),[p,_]),I=j.useCallback((V,X)=>{V.preventDefault(),V.stopPropagation(),a({x:V.clientX,y:V.clientY,items:[{label:C("files.menu.copyAbsolute"),onSelect:()=>d(p(X))},{label:C("files.menu.copyRelative"),onSelect:()=>d(X)},...u===void 0?[]:[{label:C("files.menu.insertMention"),onSelect:()=>u(`@${X}`)}],...R===null?[]:[{label:C("files.menu.openWithSystem"),onSelect:()=>R(X)}]]})},[p,d,u,R,E]),L=x.active===null?null:x.docs.find(V=>V.key===x.active)??null,M=L===null?void 0:x.content(L.key),b=L!==null&&M===void 0;j.useEffect(()=>{b&&L!==null&&x.reload(L.key)},[b,L==null?void 0:L.key]);const T=j.useCallback(V=>x.open({key:V,title:V.split("/").pop()??V}),[x]),N=j.useMemo(()=>({...n,openFile:T}),[n,T]),O=V=>{var Y;const X=(Y=x.content(V.key))==null?void 0:Y.loaded;return(X==null?void 0:X.kind)==="file"?`${V.key} · ${hn(X.preview.sizeBytes)}`:V.key},B=x.docs.length>0?l.jsx(ig,{listLabel:C("panel.tab.files"),docs:x.docs,active:x.active,tooltipOf:O,onShowList:x.showList,onSelect:x.select,onClose:x.close}):null;if(L!==null)return l.jsxs("div",{className:"panel-body",children:[B,l.jsx(og,{doc:L,content:M,readingText:C("files.readingFile"),truncatedText:C("files.preview.truncated"),onReload:()=>x.reload(L.key),onModeChange:V=>x.setMode(L.key,V),onOpenWithSystem:R===null?null:()=>R(L.key),onInsert:()=>k(L.key),onOpenLink:T,initialScroll:x.scrollOf(L.key),onScrollChange:V=>x.rememberScroll(L.key,V)},L.key),f!==null&&l.jsx(au,{x:f.x,y:f.y,items:f.items,onClose:()=>a(null)})]});const F=r.get(""),U=v.trim();return l.jsxs("div",{className:"panel-body",children:[B,l.jsxs("div",{className:"panel-subhead",children:[l.jsx("span",{className:"panel-subhead-title",title:s,children:s.split(/[\\/]/).filter(V=>V.length>0).pop()??s}),l.jsx(Eu,{className:"icon-button",title:C("files.insertFolderPath"),onInsert:()=>k("")}),l.jsx("button",{className:y?"icon-button icon-button-on":"icon-button",onClick:S,title:C(y?"files.hidden.hide":"files.hidden.show"),children:l.jsx(yC,{open:y})}),R!==null&&l.jsx("button",{className:"icon-button",onClick:()=>R(""),title:C("files.revealFolder"),children:l.jsx(ku,{})}),l.jsx("button",{className:"icon-button",onClick:g,title:C("files.refresh"),children:"⟳"})]}),l.jsxs("div",{className:"tree-search",children:[l.jsx("input",{className:"tree-search-input",value:v,placeholder:C("files.search.placeholder"),onChange:V=>h(V.target.value),onKeyDown:V=>{V.key==="Escape"&&v.length>0&&(V.stopPropagation(),h(""))}}),v.length>0&&l.jsx("button",{className:"tree-search-clear",onClick:()=>h(""),title:C("files.search.clear"),children:"×"})]}),l.jsx("div",{className:"panel-scroll",children:U.length>0?l.jsx(xC,{view:N,onContextMenu:I,onReveal:R,onInsertPath:k}):F===void 0?l.jsx("p",{className:"panel-note",children:c.has("")?C("files.readingDir"):C("files.readDirFailed")}):l.jsx(ag,{path:"",depth:0,view:N,onContextMenu:I,onReveal:R,onInsertPath:k})}),f!==null&&l.jsx(au,{x:f.x,y:f.y,items:f.items,onClose:()=>a(null)})]})}function xC({view:n,onContextMenu:s,onReveal:i,onInsertPath:u}){const{results:_,searching:R,openFile:x,toggleDirectory:r}=n;return _===null?l.jsx("p",{className:"panel-note",children:C(R?"files.search.searching":"files.search.prompt")}):_.entries.length===0?l.jsx("p",{className:"panel-note",children:C("files.search.none")}):l.jsxs("ul",{className:"tree tree-results",children:[_.entries.map(c=>l.jsx("li",{children:l.jsxs("div",{className:"tree-item",children:[l.jsxs("button",{className:`tree-row tree-row-${c.kind}${c.hidden===void 0?"":" tree-row-hidden"}`,onClick:()=>c.kind==="dir"?r(c.path):x(c.path),onContextMenu:g=>s(g,c.path,c.kind),title:c.path,children:[l.jsx("span",{className:"tree-chevron",children:c.kind==="dir"?"›":""}),l.jsxs("span",{className:"tree-result",children:[l.jsx("span",{className:"tree-name",children:c.name}),l.jsx("span",{className:"tree-result-path",children:c.path})]}),c.kind==="file"&&l.jsx("span",{className:"tree-size",children:hn(c.sizeBytes)})]}),l.jsx(Eu,{className:"tree-action",title:C("files.insertPath",{name:c.name}),onInsert:()=>u(c.path)}),c.kind==="dir"&&i!==null&&l.jsx("button",{className:"tree-action",onClick:()=>i(c.path),title:C("files.reveal",{name:c.name}),children:l.jsx(ku,{})})]})},c.path)),_.truncated&&l.jsx("li",{className:"tree-hidden",title:C("files.search.moreTitle"),children:C("files.search.more")})]})}function ag({path:n,depth:s,view:i,onContextMenu:u,onReveal:_,onInsertPath:R}){const{listings:x,loading:r}=i,c=x.get(n);return c===void 0?r.has(n)?l.jsx("div",{className:"tree-loading",children:C("files.loading")}):null:l.jsxs("ul",{className:"tree",children:[c.entries.map(g=>l.jsx(kC,{entry:g,depth:s,view:i,onContextMenu:u,onReveal:_,onInsertPath:R},g.path)),c.entries.length===0&&l.jsx("li",{className:"tree-empty",style:{paddingLeft:`${s*12+8}px`},children:c.hiddenCount>0?C("files.allHidden"):C("files.empty")}),(c.truncated||c.hiddenCount>0)&&c.entries.length>0&&l.jsx("li",{className:"tree-hidden",style:{paddingLeft:`${s*12+8}px`},title:C("files.hiddenTitle"),children:c.truncated?C("files.moreEntries"):C("files.hiddenCount",{count:c.hiddenCount})})]})}function kC({entry:n,depth:s,view:i,onContextMenu:u,onReveal:_,onInsertPath:R}){const{expanded:x,toggleDirectory:r,openFile:c}=i,g=n.kind==="dir"&&x.has(n.path);return l.jsxs("li",{children:[l.jsxs("div",{className:"tree-item",children:[l.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"?r(n.path):c(n.path),onContextMenu:v=>u(v,n.path,n.kind),title:n.hidden===void 0?n.path:`${n.path}
130
- ${n.hidden==="ignored"?C("files.row.ignored"):C("files.row.alwaysHidden")}`,children:[l.jsx("span",{className:`tree-chevron${g?" tree-chevron-open":""}`,children:n.kind==="dir"?"›":""}),l.jsx("span",{className:"tree-name",children:n.name}),n.kind==="file"&&l.jsx("span",{className:"tree-size",children:hn(n.sizeBytes)})]}),l.jsx(Eu,{className:"tree-action",title:C("files.insertPath",{name:n.name}),onInsert:()=>R(n.path)}),n.kind==="dir"&&_!==null&&l.jsx("button",{className:"tree-action",onClick:()=>_(n.path),title:C("files.reveal",{name:n.name}),children:l.jsx(ku,{})})]}),g&&l.jsx(ag,{path:n.path,depth:s+1,view:i,onContextMenu:u,onReveal:_,onInsertPath:R})]})}const EC={added:"+",removed:"-",context:" ",hunk:"",meta:""};function LC({diff:n}){return n.binary?l.jsx("p",{className:"panel-note",children:C("diff.binary")}):n.lines.length===0?l.jsx("p",{className:"panel-note",children:n.message===null?C("diff.noChanges"):Dt(n.message)}):l.jsxs("div",{className:"panel-scroll",children:[l.jsx("div",{className:"diff",children:n.lines.map((s,i)=>l.jsxs("div",{className:`diff-line diff-line-${s.kind}`,children:[l.jsx("span",{className:"diff-num","aria-hidden":"true",children:s.oldLine??""}),l.jsx("span",{className:"diff-num","aria-hidden":"true",children:s.newLine??""}),l.jsx("span",{className:"diff-marker","aria-hidden":"true",children:EC[s.kind]}),l.jsx("span",{className:"diff-text",children:s.text})]},i))}),n.truncated&&l.jsx("p",{className:"panel-note",children:C("diff.truncated")})]})}const TC={added:"A",modified:"M",deleted:"D",renamed:"R",copied:"C","type-changed":"T",untracked:"?",conflict:"!"},RC={added:"git.kind.added",modified:"git.kind.modified",deleted:"git.kind.deleted",renamed:"git.kind.renamed",copied:"git.kind.copied","type-changed":"git.kind.typeChanged",untracked:"git.kind.untracked",conflict:"git.kind.conflict"},MC=[{stage:"conflict",title:"git.group.conflict",hint:"git.group.conflictHint"},{stage:"staged",title:"git.group.staged",hint:"git.group.stagedHint"},{stage:"unstaged",title:"git.group.unstaged",hint:"git.group.unstagedHint"},{stage:"untracked",title:"git.group.untracked",hint:"git.group.untrackedHint"}];function rp(n){const s=n.endsWith("/"),i=s?n.slice(0,-1):n,u=i.lastIndexOf("/"),_=u===-1?i:i.slice(u+1);return{dir:u===-1?"":i.slice(0,u+1),name:s?`${_}/`:_,isDirectory:s}}function AC({status:n}){return l.jsxs("div",{className:"git-headline",children:[l.jsx("span",{className:"git-branch",title:n.repoRoot,children:n.branch??(n.head!==null?C("git.detachedAt",{head:n.head}):C("git.detached"))}),n.upstream!==null&&l.jsx("span",{className:"git-upstream",title:C("git.upstreamTitle",{upstream:n.upstream}),children:n.upstream}),(n.ahead>0||n.behind>0)&&l.jsxs("span",{className:"git-ab",title:C("git.aheadBehindTitle"),children:[n.ahead>0&&l.jsxs("span",{className:"git-ahead",children:["↑",n.ahead]}),n.behind>0&&l.jsxs("span",{className:"git-behind",children:["↓",n.behind]})]})]})}function NC({view:n}){const{status:s,diff:i,loadingDiff:u,openDiff:_,closeDiff:R,refresh:x}=n;if(i!==null||u)return l.jsxs("div",{className:"panel-body",children:[l.jsxs("div",{className:"panel-subhead",children:[l.jsxs("button",{className:"link-button",onClick:R,children:["← ",C("git.backToChanges")]}),i!==null&&l.jsxs("span",{className:"panel-subhead-title",title:i.path,children:[rp(i.path).name,i.staged&&l.jsxs("span",{className:"panel-tagline",children:[" ",C("git.stagedTag")]})]})]}),u?l.jsx("p",{className:"panel-note",children:C("git.readingDiff")}):i!==null&&l.jsx(LC,{diff:i})]});if(s.state!=="ready")return l.jsx("div",{className:"panel-body",children:l.jsx("p",{className:"panel-note",children:s.message===null?C("git.unknownState"):Dt(s.message)})});const r=s.worktrees.filter(c=>!c.isCurrent);return l.jsxs("div",{className:"panel-body",children:[l.jsxs("div",{className:"panel-subhead",children:[l.jsx(AC,{status:s}),l.jsx("button",{className:"icon-button",onClick:x,title:C("git.refresh"),children:"⟳"})]}),l.jsxs("div",{className:"panel-scroll",children:[s.changes.length===0&&l.jsx("p",{className:"panel-note",children:C("git.clean")}),MC.map(c=>{const g=s.changes.filter(v=>v.stage===c.stage);return g.length===0?null:l.jsxs("section",{className:"git-group",children:[l.jsxs("h3",{className:"git-group-title",title:C(c.hint),children:[C(c.title),l.jsx("span",{className:"git-group-count",children:g.length})]}),l.jsx("ul",{className:"git-list",children:g.map(v=>{const{dir:h,name:y,isDirectory:S}=rp(v.path),E=v.oldPath!==null?`${v.oldPath} → ${v.path}`:S?C("git.newFolderTitle",{path:v.path}):v.path,f=l.jsxs(l.Fragment,{children:[l.jsx("span",{className:`git-badge git-badge-${v.kind}`,title:C(RC[v.kind]),children:TC[v.kind]}),l.jsxs("span",{className:"git-path",children:[l.jsx("span",{className:"git-path-name",children:y}),h.length>0&&l.jsx("span",{className:"git-path-dir",children:h})]})]});return l.jsx("li",{children:S?l.jsx("div",{className:"git-item git-item-static",title:E,children:f}):l.jsx("button",{className:"git-item",onClick:()=>_(v.path,v.stage==="staged"),title:E,children:f})},`${c.stage}:${v.path}`)})})]},c.stage)}),s.truncated&&l.jsx("p",{className:"panel-note",children:zt("git.truncated")}),r.length>0&&l.jsxs("section",{className:"git-group",children:[l.jsxs("h3",{className:"git-group-title",title:C("git.worktrees.headingTitle"),children:[C("git.worktrees.heading"),l.jsx("span",{className:"git-group-count",children:r.length})]}),l.jsx("ul",{className:"git-list",children:r.map(c=>l.jsx("li",{children:l.jsxs("div",{className:"git-worktree",title:c.path,children:[l.jsx("span",{className:"git-worktree-branch",children:c.branch??C("git.worktrees.detached")}),l.jsx("span",{className:"git-worktree-path",children:c.path})]})},c.path))})]})]})]})}const DC={create:"memory.action.create","append-block":"memory.action.appendBlock","replace-block":"memory.action.replaceBlock","append-lines":"memory.action.appendLines",copy:"memory.action.copy"},IC={"AGENTS.md":["Codex","Antigravity","OpenCode"],"CLAUDE.md":["Claude Code"]};function Fl(n){return n.brokenBlock||n.problem!==null}function jC(n){return n.problem==="outside"?C("memory.problem.outside"):n.problem==="encoding"?C("memory.problem.encoding"):n.brokenBlock?C("memory.problem.brokenBlock"):null}function PC(n){const s=n.files.filter(i=>!Fl(i));return n.installed?{instructionFiles:s.filter(i=>i.hasBlock||i.exists).map(i=>i.name),gitMode:n.git.kind==="error"||n.git.kind==="repo"&&!n.git.ignored?"version":"ignore",importNative:!1,copyFromMainWorktree:!1}:{...s0(n),instructionFiles:s.map(i=>i.name)}}function OC(n){const s=n.files.filter(_=>_.hasBlock&&!_.blockCurrent),i=n.files.filter(_=>_.exists&&!_.hasBlock&&!Fl(_)),u=_=>wu(_.map(R=>R.name));return s.length===0?i.length===0?null:C("memory.update.missing",{files:u(i)}):i.length===0?C("memory.update.outdated",{count:s.length,files:u(s)}):C("memory.update.outdatedAndMissing",{count:s.length,outdated:u(s),missing:u(i)})}function BC(n){const s=n.replace(/^\uFEFF/,"").replace(/\r\n/g,`
131
- `),i=/^---\n[\s\S]*?\n---(?:\n|$)/.exec(s);return i===null?s:s.slice(i[0].length)}function FC(n){return n.split(/`([^`]+)`/).map((s,i)=>i%2===1?l.jsx("code",{children:s},i):s)}function HC({view:n}){var a;const{status:s,open:i,loading:u,error:_,closeNote:R,openNote:x}=n,[r,c]=j.useState(null),[g,v]=j.useState(!1),h=(s==null?void 0:s.cwd)??null;j.useEffect(()=>{c(null),v(!1)},[h]),j.useEffect(()=>{n.lastResult!==null&&(c(null),v(!1))},[n.lastResult]);const y=j.useCallback(m=>{if(s===null)return null;let p=m.replace(/^\.\//,"");try{p=decodeURIComponent(p)}catch{return null}return p===Tl||s.notes.some(k=>k.name===p)?()=>x(p):null},[s,x]);if(s===null)return l.jsx("div",{className:"panel-body",children:l.jsx("p",{className:"panel-note",children:_??C("memory.loading")})});if(i!==null||u!==null){const m=(i==null?void 0:i.name)??u??"",p=m===Tl?C("memory.index"):((a=s.notes.find(d=>d.name===m))==null?void 0:a.title)??m;return l.jsxs("div",{className:"panel-body",children:[l.jsxs("div",{className:"panel-subhead",children:[l.jsx("button",{className:"link-button",onClick:R,children:C("memory.back")}),l.jsx("span",{className:"panel-subhead-title",title:m,children:p})]}),i===null?l.jsx("p",{className:"panel-note",children:C("memory.note.loading")}):l.jsxs("div",{className:"panel-scroll",children:[l.jsx("div",{className:"plan-body",children:l.jsx(Su,{text:BC(i.text),localLink:y})}),i.truncated&&l.jsx("p",{className:"panel-note",children:C("memory.note.truncated")})]})]})}const S=r??PC(s),E=s.installed?OC(s):null,f=!s.installed||g||n.planned!==null;return l.jsxs("div",{className:"panel-body",children:[l.jsx($C,{reach:s.reach,onAdjust:s.installed&&!f&&E===null&&s.reach.some(m=>!m.reaches)?()=>v(!0):null}),l.jsxs("div",{className:"panel-scroll",children:[(_??n.lastResult)!==null&&l.jsxs("div",{className:`memory-message${_!==null?" memory-message-error":""}`,children:[l.jsx("span",{children:_??n.lastResult}),l.jsx("button",{className:"link-button",onClick:n.dismissMessage,title:C("common.dismissNotice"),children:"×"})]}),s.git.kind==="error"&&l.jsxs("div",{className:"memory-warning",children:[l.jsx("p",{className:"memory-warning-line",children:zt("memory.git.errorWarning")}),l.jsx("pre",{className:"memory-git-message",children:Dt(s.git.message)})]}),s.files.filter(Fl).map(m=>l.jsx("p",{className:"memory-warning",children:m.problem==="outside"?zt("memory.problem.outsideWarning",{file:m.name}):m.problem==="encoding"?zt("memory.problem.encodingWarning",{file:m.name}):zt("memory.problem.brokenBlockWarning",{file:m.name})},m.name)),!s.installed&&l.jsxs("div",{className:"memory-intro",children:[l.jsx("p",{children:C("memory.intro.what")}),l.jsx("p",{children:zt("memory.intro.where")})]}),s.installed&&E!==null&&!f&&l.jsxs("div",{className:"memory-callout",children:[l.jsx("span",{children:E}),l.jsx("button",{className:"primary-button primary-button-small",onClick:()=>v(!0),children:C("memory.update.button")})]}),f&&(n.planned===null?l.jsx(UC,{status:s,options:S,busy:n.busy,onChange:c,onPlan:()=>{c(S),n.requestPlan(S)},onCancel:s.installed?()=>{v(!1),c(null)}:null}):l.jsx(WC,{changes:n.planned,busy:n.busy,confirmLabel:s.installed?C("memory.plan.update"):C("memory.plan.install"),onConfirm:n.install,onCancel:n.cancelPlan})),s.installed&&s.native.pending>0&&!f&&l.jsxs("div",{className:"memory-callout",children:[l.jsx("span",{children:C("memory.native.pending",{count:s.native.pending})}),l.jsx("button",{className:"primary-button primary-button-small",disabled:n.busy!==null,onClick:n.importNative,children:n.busy==="import"?C("memory.native.importing"):C("memory.native.import",{count:s.native.pending})})]}),s.installed&&l.jsx(zC,{notes:s.notes,indexExists:s.indexExists,onOpen:x}),s.globalFragments.length>0&&l.jsx(VC,{fragments:s.globalFragments})]})]})}function $C({reach:n,onAdjust:s}){return l.jsxs("div",{className:"memory-reach",children:[n.map(i=>l.jsxs("span",{className:`memory-reach-item${i.reaches?" memory-reach-on":""}`,title:C("memory.reach.title",{label:i.label,via:Dt(i.via)}),children:[l.jsx("span",{className:"memory-reach-mark","aria-hidden":"true",children:i.reaches?"✓":"—"}),i.label,l.jsx("span",{className:"visually-hidden",children:i.reaches?C("memory.reach.reaches",{via:Dt(i.via)}):C("memory.reach.doesNotReach",{via:Dt(i.via)})})]},i.agent)),s!==null&&l.jsx("button",{className:"link-button memory-reach-adjust",onClick:s,title:C("memory.reach.adjustTitle"),children:C("memory.reach.adjust")})]})}function UC({status:n,options:s,busy:i,onChange:u,onPlan:_,onCancel:R}){const{git:x}=n,r=x.kind==="repo"?x.worktree:null,c=x.kind==="error"&&s.gitMode==="ignore",g=(v,h)=>{const y=new Set(s.instructionFiles);h?y.add(v):y.delete(v),u({...s,instructionFiles:_u.filter(S=>y.has(S))})};return l.jsxs("div",{className:"memory-form",children:[l.jsx("p",{className:"memory-section-label",children:C("memory.form.files")}),n.files.map(v=>l.jsxs("label",{className:"memory-option",title:jC(v)??void 0,children:[l.jsx("input",{type:"checkbox",checked:s.instructionFiles.includes(v.name),disabled:Fl(v),onChange:h=>g(v.name,h.target.checked)}),l.jsx("code",{children:v.name}),l.jsx("span",{className:"memory-option-hint",children:wu(IC[v.name])})]},v.name)),x.kind==="repo"&&l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"memory-section-label",children:"Git"}),l.jsxs("label",{className:"memory-option",children:[l.jsx("input",{type:"radio",name:"memory-git-mode",checked:s.gitMode==="ignore",onChange:()=>u({...s,gitMode:"ignore"})}),C("memory.git.ignore"),l.jsx("span",{className:"memory-option-hint",children:C("memory.git.ignoreHint")})]}),l.jsxs("label",{className:"memory-option",children:[l.jsx("input",{type:"radio",name:"memory-git-mode",checked:s.gitMode==="version",onChange:()=>u({...s,gitMode:"version"})}),C("memory.git.version"),l.jsx("span",{className:"memory-option-hint",children:C("memory.git.versionHint")})]}),x.ignored&&s.gitMode==="version"&&l.jsx("p",{className:"memory-warning",children:zt("memory.git.alreadyIgnored")})]}),x.kind==="error"&&l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"memory-section-label",children:"Git"}),l.jsxs("label",{className:"memory-option",children:[l.jsx("input",{type:"radio",name:"memory-git-mode",checked:s.gitMode==="version",onChange:()=>u({...s,gitMode:"version"})}),zt("memory.git.dontTouch"),l.jsx("span",{className:"memory-option-hint",children:C("memory.git.errorHint")})]})]}),(n.native.pending>0||(r==null?void 0:r.mainHasMemory)===!0)&&l.jsx("p",{className:"memory-section-label",children:C("memory.form.existingNotes")}),n.native.pending>0&&l.jsxs("label",{className:"memory-option",children:[l.jsx("input",{type:"checkbox",checked:s.importNative,onChange:v=>u({...s,importNative:v.target.checked})}),C("memory.form.importNative",{count:n.native.pending})]}),(r==null?void 0:r.mainHasMemory)===!0&&l.jsxs("label",{className:"memory-option",title:r.mainPath,children:[l.jsx("input",{type:"checkbox",checked:s.copyFromMainWorktree,onChange:v=>u({...s,copyFromMainWorktree:v.target.checked})}),C("memory.form.copyFromMain")]}),l.jsxs("div",{className:"memory-actions",children:[l.jsx("button",{className:"primary-button primary-button-small",disabled:i!==null||s.instructionFiles.length===0||c,onClick:_,title:s.instructionFiles.length===0?C("memory.form.noFiles"):c?C("memory.git.blocked"):void 0,children:C(i==="plan"?"memory.form.planning":"memory.form.preview")}),R!==null&&l.jsx("button",{className:"link-button",onClick:R,disabled:i!==null,children:C("common.cancel")})]})]})}function WC({changes:n,busy:s,confirmLabel:i,onConfirm:u,onCancel:_}){const R=s==="install";return l.jsxs("div",{className:"memory-form",children:[l.jsx("p",{className:"memory-section-label",children:C("memory.plan.changes")}),n.length===0?l.jsx("p",{className:"memory-empty",children:C("memory.plan.nothing")}):l.jsx("ul",{className:"memory-change-list",children:n.map((x,r)=>l.jsxs("li",{className:"memory-change",children:[l.jsxs("div",{className:"memory-change-head",children:[l.jsx("code",{className:"memory-change-file",children:x.file}),l.jsx("span",{className:"memory-option-hint",children:C(DC[x.action])})]}),x.copiedFrom!==null&&l.jsx("p",{className:"memory-option-hint",children:C("memory.plan.copiedFrom",{path:x.copiedFrom})}),x.preview.length>0&&l.jsx("pre",{className:"memory-preview",children:x.preview})]},`${x.file}-${r}`))}),l.jsxs("div",{className:"memory-actions",children:[n.length>0&&l.jsx("button",{className:"primary-button primary-button-small",disabled:s!==null,onClick:u,children:R?C("memory.plan.writing"):i}),l.jsx("button",{className:"link-button",onClick:_,disabled:R,children:n.length===0?C("memory.plan.back"):C("common.cancel")})]})]})}function zC({notes:n,indexExists:s,onOpen:i}){return l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"memory-section-label",children:C("memory.list.notes")}),l.jsxs("ul",{className:"plan-list",children:[s&&l.jsx("li",{children:l.jsxs("button",{className:"plan-row",onClick:()=>i(Tl),children:[l.jsx("span",{className:"plan-name",children:C("memory.index")}),l.jsx("span",{className:"plan-meta",children:Tl})]})}),n.map(u=>l.jsx("li",{children:l.jsxs("button",{className:"plan-row",onClick:()=>i(u.name),title:u.name,children:[l.jsx("span",{className:"plan-name",children:u.title}),u.description.length>0&&l.jsx("span",{className:"memory-note-description",children:u.description}),l.jsxs("span",{className:"plan-meta",children:[Kn(u.modifiedAt)," · ",hn(u.sizeBytes)]})]})},u.name))]}),n.length===0&&l.jsx("p",{className:"memory-empty",children:C("memory.list.empty")})]})}function VC({fragments:n}){const s=j.useCallback(i=>{navigator.clipboard.writeText(i).catch(()=>{})},[]);return l.jsxs("details",{className:"memory-global",children:[l.jsx("summary",{className:"memory-global-summary",children:C("memory.global.title")}),l.jsx("p",{className:"memory-empty",children:zt("memory.global.intro")}),n.map(i=>l.jsxs("div",{className:"memory-fragment",children:[l.jsxs("div",{className:"memory-change-head",children:[l.jsx("span",{className:"memory-fragment-label",children:i.label}),l.jsx("code",{className:"memory-fragment-target",title:i.target,children:i.target})]}),l.jsxs("div",{className:"memory-fragment-body",children:[l.jsx("pre",{className:"memory-preview",children:i.text}),l.jsx(SC,{className:"icon-button",title:C("memory.global.copy"),onCopy:()=>s(i.text)})]}),l.jsx("p",{className:"memory-fragment-note",children:FC(Dt(i.note))})]},i.agent))]})}function qC(n){for(const s of n.split(`
132
- `,40)){const i=/^#{1,3}\s+(.+)$/.exec(s.trim());if(i!==null)return(i[1]??"").trim()}return null}function KC({view:n,docs:s}){const{plans:i}=n,u=s.active===null?null:s.docs.find(c=>c.key===s.active)??null,_=u===null?void 0:s.content(u.key),R=u!==null&&_===void 0&&n.listFor!==null&&n.listFor===s.terminalId;j.useEffect(()=>{R&&u!==null&&s.reload(u.key)},[R,u==null?void 0:u.key]);const x=c=>{var v;const g=(v=s.content(c.key))==null?void 0:v.loaded;return(g==null?void 0:g.kind)==="plan"?qC(g.plan.text)??c.title:c.title},r=c=>{var v;const g=((v=i.find(h=>h.fileName===c.key))==null?void 0:v.path)??"";return g.length>0?g:x(c)};return l.jsxs("div",{className:"panel-body",children:[s.docs.length>0&&l.jsx(ig,{listLabel:C("panel.tab.plans"),docs:s.docs,active:s.active,tooltipOf:r,labelOf:x,onShowList:s.showList,onSelect:s.select,onClose:s.close}),u!==null?l.jsx(og,{doc:u,content:_,readingText:C("plans.loading"),truncatedText:C("plans.truncated"),onReload:()=>s.reload(u.key),onModeChange:c=>s.setMode(u.key,c),onOpenWithSystem:null,initialScroll:s.scrollOf(u.key),onScrollChange:c=>s.rememberScroll(u.key,c)},u.key):l.jsx("div",{className:"panel-scroll",children:i.length===0?l.jsx("p",{className:"panel-note",children:zt("plans.empty")}):l.jsx("ul",{className:"plan-list",children:[...i].reverse().map(c=>l.jsx(GC,{plan:c,onOpen:()=>s.open({key:c.fileName,title:c.title})},c.fileName))})})]})}function GC({plan:n,onOpen:s}){const i=n.path.length>0?n.path:null;return n.exists?l.jsx("li",{children:l.jsxs("button",{className:"plan-row",onClick:s,title:i??void 0,children:[l.jsx("span",{className:"plan-name",children:n.title}),i!==null&&l.jsx("span",{className:"plan-path",children:i}),l.jsxs("span",{className:"plan-meta",children:[Kn(n.modifiedAt)," · ",hn(n.sizeBytes)]})]})}):l.jsxs("li",{className:"plan-row plan-row-missing",title:i??C("plans.missingTitle"),children:[l.jsx("span",{className:"plan-name",children:n.title}),i!==null&&l.jsx("span",{className:"plan-path",children:i}),l.jsx("span",{className:"plan-meta",children:C("plans.missing")})]})}const YC=[{id:"cli",labelKey:"panel.tab.cli"},{id:"git",labelKey:"panel.tab.git"},{id:"files",labelKey:"panel.tab.files"},{id:"plans",labelKey:"panel.tab.plans"},{id:"memory",labelKey:"panel.tab.memory"}];function cg(n){return n.state!=="ready"?0:new Set(n.changes.map(s=>s.path)).size}function XC({tab:n,plansAvailable:s,hiddenTabs:i,hidden:u,onTabChange:_,title:R,cwd:x,platform:r,cli:c,cliUnseen:g,expanded:v,onToggleExpanded:h,git:y,files:S,plans:E,documents:f,memory:a,onInsert:m,onInsertPath:p,onReveal:d,onHide:k}){var M;const I=cg(y.status),L=((M=a.status)==null?void 0:M.installed)===!0?a.status.notes.length:0;return l.jsxs("section",{className:`side-panel${u?" side-panel-hidden":""}`,"aria-hidden":u,children:[l.jsxs("header",{className:"side-panel-header",children:[l.jsx("button",{className:"icon-button",onClick:k,title:C("panel.hide"),children:"»"}),x.length>0&&l.jsx("span",{className:"project-swatch",style:{background:cr(x)}}),l.jsx("span",{className:"side-panel-title",title:x,children:R}),l.jsx("button",{className:"icon-button",onClick:h,title:C(v?"panel.restoreWidth":"panel.widen"),children:v?"⇥":"⇤"})]}),l.jsx("nav",{className:"side-panel-tabs",children:Ly(YC,s,i).map(b=>l.jsxs("button",{className:`side-panel-tab${b.id===n?" side-panel-tab-active":""}`,onClick:()=>_(b.id),title:C(b.labelKey),children:[l.jsx("span",{className:"side-panel-tab-label",children:C(b.labelKey)}),b.id==="git"&&I>0&&l.jsx("span",{className:"side-panel-badge",children:I}),b.id==="plans"&&E.plans.length>0&&l.jsx("span",{className:"side-panel-badge",children:E.plans.length}),b.id==="memory"&&L>0&&l.jsx("span",{className:"side-panel-badge",children:L}),b.id==="cli"&&g&&n!=="cli"&&l.jsx("span",{className:"side-panel-dot",title:C("panel.cliUnseen")})]},b.id))}),l.jsxs("div",{className:"side-panel-body",children:[l.jsx("div",{className:`cli-slot${n==="cli"?"":" cli-slot-hidden"}`,children:c}),n==="git"&&l.jsx(NC,{view:y}),n==="plans"&&l.jsx(KC,{view:E,docs:f.plans}),n==="memory"&&l.jsx(HC,{view:a}),n==="files"&&l.jsx(CC,{view:S,cwd:x,platform:r,onInsert:m,onInsertPath:p,onReveal:d,docs:f.files})]})]})}function QC(n,s,i){return`${s===void 0||s.length===0?n:`${n} — ${s}`}
133
- ${i}`}function JC({placement:n}){return l.jsxs("div",{className:"tab tab-pending","aria-busy":"true",title:`${n.pending.cwd}
134
- ${C("tabs.state.opening")}`,style:{"--tab-project-color":cr(n.pending.cwd)},children:[l.jsx("span",{className:"tab-opening","aria-label":C("tabs.aria.opening"),children:l.jsx("i",{})}),l.jsx("span",{className:"tab-label",children:n.label})]})}function Lu({terminal:n,activity:s,statusLine:i}){if(!n.alive){const u=n.sleeping;return l.jsx("span",{className:`tab-dot${u?" tab-dot-sleeping":" tab-dot-dead"}`,title:C(u?"tabs.dot.sleeping":"tabs.dot.exited")})}return s==="waiting"?l.jsx("span",{className:"tab-bang",title:C("tabs.dot.waiting"),children:"!"}):s==="busy"?l.jsxs("span",{className:"tab-working",title:C("tabs.dot.busy"),"aria-label":C("tabs.aria.working"),children:[l.jsx("i",{}),l.jsx("i",{}),l.jsx("i",{})]}):l.jsx("span",{className:"tab-dot",title:By(s,i)})}function Xi(n){if(n.label.length>0)return n.label;const s=n.cwd.split(/[\\/]/).filter(u=>u.length>0),i=s[s.length-1]??n.cwd;return n.resumed?`${i} ↩`:i}function ZC(n){return n.alive?C("tabs.state.alive"):n.sleeping?C("tabs.state.sleeping"):C("tabs.state.exited",{code:n.exitCode??"?"})}function ex({terminals:n,activeTerminalId:s,activity:i,attention:u,canOpen:_,onSelect:R,onClose:x,onRename:r,onReorder:c,onNew:g,agents:v,offerAgentChoice:h,newTabAgent:y,pendingOpens:S,platform:E,newTabBlockedTitle:f,sessionTitles:a}){const[m,p]=j.useState(null),[d,k]=j.useState(""),[I,L]=j.useState(null),M=j.useRef(null);j.useEffect(()=>{var U;m!==null&&((U=M.current)==null||U.select())},[m]);const b=U=>{p(U.terminalId),k(U.label.length>0?U.label:Xi(U))},T=()=>{m!==null&&r(m,d.trim()),p(null)},N=U=>{if(I===null||I===U)return;const V=n.map(q=>q.terminalId),X=V.indexOf(I),Y=V.indexOf(U);X===-1||Y===-1||(V.splice(Y,0,...V.splice(X,1)),c(V),L(null))},O=dw(n,S,E),B=new Map;for(const U of O){const V=B.get(U.index);V===void 0?B.set(U.index,[U]):V.push(U)}const F=U=>(B.get(U)??[]).map(V=>l.jsx(JC,{placement:V},`pending:${V.pending.requestId}`));return l.jsxs("div",{className:"tab-bar",children:[n.map((U,V)=>{var q;const X=U.terminalId===s,Y=U.terminalId===m;return l.jsxs(G_.Fragment,{children:[F(V),l.jsx("div",{className:`tab${X?" tab-active":""}${U.alive||U.sleeping?"":" tab-dead"}${(u==null?void 0:u.has(U.terminalId))===!0?" tab-attention":""}`,draggable:!Y,onDragStart:()=>L(U.terminalId),onDragOver:D=>D.preventDefault(),onDrop:()=>N(U.terminalId),onDragEnd:()=>L(null),onClick:()=>R(U.terminalId),onDoubleClick:()=>b(U),title:QC(U.cwd,a.get(U.terminalId),ZC(U)),style:{"--tab-project-color":cr(U.cwd)},children:Y?l.jsx("input",{ref:M,className:"tab-input",value:d,onChange:D=>k(D.target.value),onBlur:T,onKeyDown:D=>{D.key==="Enter"&&T(),D.key==="Escape"&&p(null),D.stopPropagation()},onClick:D=>D.stopPropagation()}):l.jsxs(l.Fragment,{children:[l.jsx(Lu,{terminal:U,activity:i.get(U.terminalId),statusLine:((q=v.find(D=>D.id===U.agent))==null?void 0:q.statusLine)??null}),l.jsxs("span",{className:"tab-label",children:[U.agent!==null&&Jy(h,U.agent)&&l.jsx(lu,{agent:U.agent,agents:v}),Xi(U)]}),l.jsx("button",{className:"tab-close",onClick:D=>{D.stopPropagation(),x(U.terminalId)},title:C("tabs.close"),children:"×"})]})})]},U.terminalId)}),F(n.length),l.jsx(Cu,{className:"tab-new",text:"+",title:f??C("tabs.new"),disabled:!_||f!==null,offerAgentChoice:h,agents:v,agent:y,onOpen:g})]})}function tx(n,s,i){const[u,_]=j.useState(!1);return j.useEffect(()=>{if(_(!1),!(s===null||i))return n.onMessage(R=>{R.type==="terminal.output"&&R.terminalId===s&&_(!0)})},[n,s,i]),u&&!i}const nx=200,ip="agent-workbench.files.hidden";function sx(n,s){const[i,u]=j.useState(new Map),[_,R]=j.useState(new Set),[x,r]=j.useState(new Set),[c,g]=j.useState(""),[v,h]=j.useState(null),[y,S]=j.useState(!1),[E,f]=j.useState(()=>yt(ip,!1,L=>L==="true"?!0:L==="false"?!1:null)),a=j.useRef(new Set),m=j.useRef(E);m.current=E;const p=j.useCallback(L=>{s===null||a.current.has(L)||(a.current.add(L),r(M=>new Set(M).add(L)),n.send({type:"files.list",terminalId:s,path:L,includeHidden:m.current}))},[n,s]);j.useEffect(()=>{if(u(new Map),R(new Set),r(new Set),g(""),h(null),S(!1),a.current=new Set,s===null)return;const L=n.onMessage(b=>{switch(b.type){case"files.listing":{if(b.terminalId!==s)break;const{listing:T}=b;a.current.delete(T.path),u(N=>new Map(N).set(T.path,T)),r(N=>{const O=new Set(N);return O.delete(T.path),O});break}case"files.results":if(b.terminalId!==s)break;h(b.result),S(!1);break;case"error":a.current=new Set,r(new Set),S(!1);break}});n.send({type:"files.list",terminalId:s,path:"",includeHidden:m.current}),a.current.add(""),r(new Set([""]));const M=n.onReopen(()=>{a.current=new Set,n.send({type:"files.list",terminalId:s,path:"",includeHidden:m.current})});return()=>{L(),M()}},[n,s]),j.useEffect(()=>{const L=c.trim();if(s===null||L.length===0){h(null),S(!1);return}S(!0);const M=window.setTimeout(()=>{n.send({type:"files.search",terminalId:s,query:L,includeHidden:m.current})},nx);return()=>window.clearTimeout(M)},[n,s,c,E]);const d=j.useCallback(L=>{R(M=>{const b=new Set(M);return b.has(L)?b.delete(L):(b.add(L),p(L)),b})},[p]),k=j.useCallback(()=>{if(s===null)return;a.current=new Set;const L=["",..._];for(const M of L)a.current.add(M),n.send({type:"files.list",terminalId:s,path:M,includeHidden:m.current});r(new Set(L))},[n,s,_]),I=j.useCallback(()=>{f(L=>{const M=!L;if(m.current=M,mt(ip,String(M)),s!==null){a.current=new Set;const b=["",..._];for(const T of b)a.current.add(T),n.send({type:"files.list",terminalId:s,path:T,includeHidden:M});r(new Set(b))}return M})},[n,s,_]);return{listings:i,expanded:_,loading:x,query:c,setQuery:g,results:v,searching:y,showHidden:E,toggleHidden:I,toggleDirectory:d,refresh:k}}function rx(n){const[s,i]=j.useState(!1),[u,_]=j.useState(null),[R,x]=j.useState(null),[r,c]=j.useState(null),g=j.useRef(null);j.useEffect(()=>{const y=n.onMessage(E=>{switch(E.type){case"search.progress":if(g.current===null||E.searchId!==g.current)break;_(f=>CS(f,E.progress));break;case"search.results":if(g.current===null||E.searchId!==g.current)break;g.current=null,_(E.result),x(null),i(!1);break;case"error":if(E.code!=="search-failed"||g.current===null||E.requestId!==g.current)break;g.current=null,E.detail!==void 0&&console.error("[servidor]",E.detail),_(null),x(Dt(E.text)),i(!1);break}}),S=n.onReopen(()=>{g.current!==null&&(g.current=null,i(!1),x(C("searchHook.connectionLost")))});return()=>{y(),S()}},[n]);const v=j.useCallback((y,S)=>{const E=crypto.randomUUID();g.current=E,c({query:y,includeArchived:S}),i(!0),x(null),_(null),n.send({type:"search.global",searchId:E,query:y,includeArchived:S})},[n]),h=j.useCallback(()=>{const y=g.current;g.current=null,y!==null&&n.send({type:"search.cancel",searchId:y}),c(null),i(!1),_(null),x(null)},[n]);return{searching:s,result:u,error:R,submitted:r,search:v,clear:h}}function ix(n,s){const[i,u]=j.useState([]),[_,R]=j.useState(null);return j.useEffect(()=>{if(u([]),R(null),s!==null)return n.onMessage(x=>{switch(x.type){case"conversation.plans":if(x.terminalId!==s)break;u(x.plans),R(s);break}})},[n,s]),{plans:i,listFor:_}}const ug=8,hg=1024,ox=300,lx=["file","plan"],Il={docs:[],active:null,recent:[]},Qi={};function jl(n,s){return[...n.filter(i=>i!==s),s]}function ax(n,s){const i=n.docs.find(R=>R.key===s.key);if(i!==void 0)return{docs:i.title===s.title?n.docs:n.docs.map(x=>x.key===s.key?{...x,title:s.title}:x),active:s.key,recent:jl(n.recent,s.key)};let u=[...n.docs,{key:s.key,title:s.title}],_=jl(n.recent,s.key);for(;u.length>ug;){const R=_.find(x=>x!==s.key);if(R===void 0)break;u=u.filter(x=>x.key!==R),_=_.filter(x=>x!==R)}return{docs:u,active:s.key,recent:_}}function cx(n,s){return n.docs.some(i=>i.key===s)?{...n,active:s,recent:jl(n.recent,s)}:n}function ux(n){return n.active===null?n:{...n,active:null}}function hx(n,s){const i=n.docs.findIndex(x=>x.key===s);if(i===-1)return n;const u=n.docs.filter(x=>x.key!==s),_=n.recent.filter(x=>x!==s);if(n.active!==s)return{docs:u,active:n.active,recent:_};const R=u[i]??u[i-1]??null;return{docs:u,active:R===null?null:R.key,recent:R===null?_:jl(_,R.key)}}function dx(n,s,i){return{...n,docs:n.docs.map(u=>u.key===s?{...u,mode:i}:u)}}function Uc(n,s,i){var u;return((u=n[s])==null?void 0:u[i])??Il}function fx(n,s,i,u){const _=n[s]??{file:Il,plan:Il};return{...n,[s]:{..._,[i]:u}}}function px(n,s){if(s.length===0)return n;const i=new Set(s),u=Object.keys(n).filter(R=>!i.has(R));if(u.length===0)return n;const _={...n};for(const R of u)delete _[R];return _}function ar(n,s,i){return`${n}\0${s}\0${i}`}function mx(n){const s=new Set;for(const[i,u]of Object.entries(n))for(const _ of lx)for(const R of u[_].docs)s.add(ar(i,_,R.key));return s}function gx(n){return JSON.stringify(n)}function Pl(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)?n:null}function _x(n){const s=Pl(n);if(s===null)return null;const{key:i,title:u,mode:_}=s;if(typeof i!="string"||i.length===0||i.length>hg||typeof u!="string"||u.length>ox)return null;const R={key:i,title:u};return _==="formatted"||_==="source"?{...R,mode:_}:R}function op(n){const s=Pl(n);if(s===null||!Array.isArray(s.docs))return Il;const i=[];for(const r of s.docs){const c=_x(r);if(c!==null&&!i.some(g=>g.key===c.key)&&i.push(c),i.length===ug)break}const u=i.map(r=>r.key),_=typeof s.active=="string"&&u.includes(s.active)?s.active:null,R=Array.isArray(s.recent)?s.recent.filter(r=>typeof r=="string"&&u.includes(r)):[],x=[...u.filter(r=>!R.includes(r)),...new Set(R)];return{docs:i,active:_,recent:x}}function vx(n){let s;try{s=JSON.parse(n)}catch{return Qi}const i=Pl(s);if(i===null)return Qi;const u={};for(const[_,R]of Object.entries(i)){const x=Pl(R);if(x===null||_.length===0||_.length>hg)continue;const r=op(x.file),c=op(x.plan);r.docs.length===0&&c.docs.length===0||(u[_]={file:r,plan:c})}return u}const dg="agent-workbench.docTabs";function yx(){try{const n=window.sessionStorage.getItem(dg);return n===null?Qi:vx(n)}catch{return Qi}}function wx(n,s,i){const[u,_]=j.useState(yx),[R,x]=j.useState(new Map),r=j.useRef(R);r.current=R;const c=j.useRef(new Map);j.useEffect(()=>{_(h=>px(h,s.map(y=>y.terminalId)))},[s]),j.useEffect(()=>{const h=mx(u);for(const y of[...c.current.keys()])h.has(y)||c.current.delete(y);x(y=>{const S=[...y.keys()].filter(f=>!h.has(f));if(S.length===0)return y;const E=new Map(y);for(const f of S)E.delete(f);return E})},[u]),j.useEffect(()=>{try{window.sessionStorage.setItem(dg,gx(u))}catch{}},[u]);const g=j.useCallback((h,y,S)=>{const E=ar(h,y,S);x(f=>{var a;return new Map(f).set(E,{loaded:((a=f.get(E))==null?void 0:a.loaded)??null,loading:!0,failed:!1})}),y==="file"?n.send({type:"files.read",terminalId:h,path:S}):n.send({type:"plans.read",terminalId:h,fileName:S})},[n]);j.useEffect(()=>{const h=(E,f)=>x(a=>a.has(E)?new Map(a).set(E,{loaded:f,loading:!1,failed:!1}):a),y=n.onMessage(E=>{switch(E.type){case"files.preview":h(ar(E.terminalId,"file",E.preview.path),{kind:"file",preview:E.preview});break;case"plans.content":h(ar(E.terminalId,"plan",E.plan.fileName),{kind:"plan",plan:E.plan});break;case"error":x(f=>{if(![...f.values()].some(m=>m.loading))return f;const a=new Map;for(const[m,p]of f)a.set(m,p.loading?{...p,loading:!1,failed:!0}:p);return a});break}}),S=n.onReopen(()=>{for(const[E,f]of r.current){if(!f.loading)continue;const[a,m,p]=E.split("\0");a===void 0||p===void 0||(m==="file"&&n.send({type:"files.read",terminalId:a,path:p}),m==="plan"&&n.send({type:"plans.read",terminalId:a,fileName:p}))}});return()=>{y(),S()}},[n]);const v=j.useCallback(h=>{const y=i,S=y===null?Uc(Qi,"",h):Uc(u,y,h),E=f=>{y!==null&&_(a=>fx(a,y,h,f(Uc(a,y,h))))};return{terminalId:y,docs:S.docs,active:S.active,open:f=>{y!==null&&(E(a=>ax(a,f)),g(y,h,f.key))},select:f=>E(a=>cx(a,f)),showList:()=>E(ux),close:f=>E(a=>hx(a,f)),setMode:(f,a)=>E(m=>dx(m,f,a)),content:f=>y===null?void 0:R.get(ar(y,h,f)),reload:f=>{y!==null&&g(y,h,f)},rememberScroll:(f,a)=>{y!==null&&c.current.set(ar(y,h,f),a)},scrollOf:f=>y===null?void 0:c.current.get(ar(y,h,f))}},[i,u,R,g]);return j.useMemo(()=>({files:v("file"),plans:v("plan")}),[v])}function bx(n,s){const[i,u]=j.useState(Cc),[_,R]=j.useState(null),[x,r]=j.useState(!1);j.useEffect(()=>{if(s===null){u(Cc),R(null);return}u(Cc),R(null),r(!1);const h=n.onMessage(S=>{switch(S.type){case"git.status":S.terminalId===s&&u(S.status);break;case"git.diff":if(S.terminalId!==s)break;R(S.diff),r(!1);break;case"error":r(!1);break}});n.send({type:"git.subscribe",terminalId:s});const y=n.onReopen(()=>{n.send({type:"git.subscribe",terminalId:s})});return()=>{h(),y(),n.send({type:"git.unsubscribe",terminalId:s})}},[n,s]);const c=j.useCallback((h,y)=>{s!==null&&(r(!0),R(null),n.send({type:"git.diff",terminalId:s,path:h,staged:y}))},[n,s]),g=j.useCallback(()=>{R(null),r(!1)},[]),v=j.useCallback(()=>{s!==null&&n.send({type:"git.refresh",terminalId:s})},[n,s]);return{status:i,diff:_,loadingDiff:x,openDiff:c,closeDiff:g,refresh:v}}const du=new Set;function Sx(n){return n!==void 0&&du.has(n)}function Cx(n){return n.length===0?C("memory.result.nothingChanged"):C("memory.result.installed",{count:n.length})}function xx(n,s){const i=n.length===0?C("memory.result.nothingImported"):C("memory.result.imported",{count:n.length});return s.length===0?i:C("memory.result.withSkipped",{result:i,skipped:C("memory.result.skipped",{count:s.length,files:s.join(", ")})})}function kx(n,s){const[i,u]=j.useState(null),[_,R]=j.useState(null),[x,r]=j.useState(null),[c,g]=j.useState(null),[v,h]=j.useState(null),[y,S]=j.useState(null),[E,f]=j.useState(null),a=j.useRef(new Map),m=j.useRef(new Set),p=j.useRef(null),d=j.useRef(!1),k=j.useCallback(U=>{const V=`memory-${crypto.randomUUID()}`;return a.current.set(V,U),m.current.add(V),du.add(V),V},[]),I=j.useCallback(U=>{for(const[V,X]of a.current)X===U&&a.current.delete(V)},[]);j.useEffect(()=>{u(null),R(null),r(null),g(null),h(null),S(null),f(null),a.current.clear();for(const D of m.current)du.delete(D);if(m.current.clear(),p.current=null,d.current=!1,s===null)return;const U=(D,$)=>D===void 0||a.current.get(D)!==$?!1:(a.current.delete(D),!0),V=n.onMessage(D=>{switch(D.type){case"memory.status":if(D.terminalId!==s)break;u(D.status),d.current&&(d.current=!1,f(null));break;case"memory.planned":if(D.terminalId!==s||!U(D.requestId,"plan"))break;g(D.changes),h(null);break;case"memory.installed":if(D.terminalId!==s||!U(D.requestId,"install"))break;p.current=null,g(null),h(null),S(Cx(D.applied));break;case"memory.imported":if(D.terminalId!==s||!U(D.requestId,"import"))break;h(null),S(xx(D.copied,D.skipped));break;case"memory.content":if(D.terminalId!==s||!U(D.requestId,"read"))break;R(D.note),r(null);break;case"error":{const $=D.requestId,H=$===void 0?void 0:a.current.get($);if($===void 0||H===void 0)break;a.current.delete($),H==="read"?r(null):H!=="subscribe"&&h(null),f(Dt(D.text)),d.current=H==="subscribe";break}}}),X=n.onStatus(D=>{if(D!=="reconnecting"&&D!=="failed")return;const $=new Set(a.current.values());a.current.clear(),h(null),r(null),($.has("install")||$.has("import"))&&(p.current=null,g(null),f(C("memory.error.connectionLost")))}),Y=()=>{n.send({type:"memory.subscribe",terminalId:s,requestId:k("subscribe")})};Y();const q=n.onReopen(Y);return()=>{V(),X(),q(),n.send({type:"memory.unsubscribe",terminalId:s})}},[n,s,k]);const L=j.useCallback(()=>{d.current=!1,f(null),S(null)},[]),M=j.useCallback(U=>{s!==null&&(I("read"),L(),r(U),R(null),n.send({type:"memory.read",terminalId:s,name:U,requestId:k("read")}))},[n,s,L,I,k]),b=j.useCallback(()=>{I("read"),R(null),r(null)},[I]),T=j.useCallback(U=>{s!==null&&(L(),p.current=U,g(null),h("plan"),n.send({type:"memory.plan",terminalId:s,options:U,requestId:k("plan")}))},[n,s,L,k]),N=j.useCallback(()=>{const U=p.current;s===null||U===null||(L(),h("install"),n.send({type:"memory.install",terminalId:s,options:U,requestId:k("install")}))},[n,s,L,k]),O=j.useCallback(()=>{s!==null&&(L(),h("import"),n.send({type:"memory.import",terminalId:s,requestId:k("import")}))},[n,s,L,k]),B=j.useCallback(()=>{I("plan"),p.current=null,g(null)},[I]),F=j.useCallback(()=>{d.current=!1,f(null),S(null)},[]);return{status:i,open:_,loading:x,planned:c,busy:v,lastResult:y,error:E,openNote:M,closeNote:b,requestPlan:T,install:N,importNative:O,cancelPlan:B,dismissMessage:F}}function Ex(n){const[s,i]=j.useState([]),[u,_]=j.useState({}),[R,x]=j.useState(null),r=j.useRef(new Set);j.useEffect(()=>{const a=n.onMessage(p=>{switch(p.type){case"notes.list":i(p.notes);break;case"notes.imageData":r.current.add(p.imageId),_(d=>({...d,[p.imageId]:p.data===null?null:`data:${p.mediaType};base64,${p.data}`}));break;case"error":p.code==="notes-failed"&&x(Dt(p.text));break}}),m=n.onReopen(()=>{r.current.clear()});return()=>{a(),m()}},[n]);const c=j.useCallback(a=>{r.current.has(a)||(r.current.add(a),n.send({type:"notes.image",imageId:a}))},[n]),g=j.useCallback(()=>{const a=crypto.randomUUID(),m=Date.now();return i(p=>[...p,{noteId:a,text:"",images:[],createdAt:m,updatedAt:m}]),n.send({type:"notes.create",noteId:a}),a},[n]),v=j.useCallback((a,m)=>{i(p=>p.map(d=>d.noteId===a?{...d,text:m,updatedAt:Date.now()}:d)),n.send({type:"notes.update",noteId:a,text:m})},[n]),h=j.useCallback(a=>{i(m=>m.filter(p=>p.noteId!==a)),n.send({type:"notes.delete",noteId:a})},[n]),y=j.useCallback((a,m)=>{const p=s.find(k=>k.noteId===a);if(p!==void 0&&p.images.length>=Zd){x(C("notes.tooManyImages",{count:Zd}));return}if(m.size>Rl){x(C("notes.imageTooBig",{name:m.name||C("notes.imageFallbackName"),size:Math.round(m.size/1024/1024),max:Rl/1024/1024}));return}const d=new FileReader;d.onload=()=>{const k=d.result;if(typeof k!="string")return;const I=k.indexOf(",");I!==-1&&n.send({type:"notes.addImage",noteId:a,image:{mediaType:m.type,data:k.slice(I+1)}})},d.onerror=()=>x(C("notes.readFailed")),d.readAsDataURL(m)},[n,s]),S=j.useCallback((a,m)=>{i(p=>p.map(d=>d.noteId===a?{...d,images:d.images.filter(k=>k.imageId!==m)}:d)),n.send({type:"notes.removeImage",noteId:a,imageId:m})},[n]),E=j.useCallback((a,m)=>{n.send({type:"notes.send",noteId:a,terminalId:m})},[n]),f=j.useCallback(()=>x(null),[]);return{notes:s,images:u,problem:R,requestImage:c,create:g,updateText:v,remove:h,addImage:y,removeImage:S,sendToAgent:E,dismissProblem:f}}const fg="agent-workbench.theme",Wc=["system","light","dark"],Lx={system:"theme.system",light:"theme.light",dark:"theme.dark"};function lp(n){return C("theme.title",{theme:C(Lx[n])})}const ap={system:"◐",light:"☀",dark:"☾"};function Tx(){return yt(fg,"system",n=>n==="light"||n==="dark"||n==="system"?n:null)}function Rx(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function Mx(){const[n,s]=j.useState(Tx),[i,u]=j.useState(Rx);j.useEffect(()=>{const x=window.matchMedia("(prefers-color-scheme: dark)"),r=c=>u(c.matches);return x.addEventListener("change",r),()=>x.removeEventListener("change",r)},[]);const _=n==="system"?i?"dark":"light":n;j.useEffect(()=>{document.documentElement.dataset.theme=_,document.documentElement.style.colorScheme=_},[_]);const R=j.useCallback(()=>{s(x=>{const r=Wc[(Wc.indexOf(x)+1)%Wc.length]??"system";return mt(fg,r),r})},[]);return{preference:n,resolved:_,cycle:R}}const cp="agent-workbench.terminalTheme";function Ax(n){return n==="dark"||n==="follow"?n:null}function Nx(n,s){return n==="follow"?s:"dark"}function Dx(n){const[s,i]=j.useState(()=>yt(cp,"dark",Ax)),u=Nx(s,n);j.useEffect(()=>{document.documentElement.dataset.terminalTheme=u},[u]);const _=j.useCallback(R=>{mt(cp,R),i(R)},[]);return{preference:s,resolved:u,setPreference:_}}const Ix=1500;function jx(n,s){return n===void 0||n===s?null:s==="waiting"?"attention":s==="idle"&&n==="busy"?"done":null}function Px(n,s){const i={now:[],later:[],cancel:[]};for(const[u,_]of s){const R=n.get(u);if(R===_)continue;i.cancel.push(u);const x=jx(R,_);x==="attention"?i.now.push(u):x==="done"&&i.later.push(u)}for(const u of n.keys())s.has(u)||i.cancel.push(u);return i}const up="agent-workbench.phone-chime";function Ox(n){return n==="system"||n==="page"?n:null}function Bx(n){return`agentworkbench://chime?source=${n}`}function Fx(n,s,i,u){return n?s==="page"?Hl:null:i?to(u):null}const hp="agent-workbench.sound";function Hx(n){return n==="on"?!0:n==="off"?!1:null}function $x(n){return C(n?"sound.on":"sound.off")}function Ux(n,s){return n&&s>0}const Wx={done:[{frequency:880,at:0,duration:.18},{frequency:659.25,at:.14,duration:.28}],attention:[{frequency:659.25,at:0,duration:.18},{frequency:987.77,at:.14,duration:.28}]},pg=.02,Hl=.8,mg=.2,dp="agent-workbench.sound-volume";function to(n){return Math.min(Hl,Math.max(pg,n))}function zx(n){if(n.trim().length===0)return null;const s=Number(n);return Number.isFinite(s)?to(s):null}function Vx(n){return Math.round(to(n)/Hl*100)}class qx{constructor(){Mt(this,"context",null);Mt(this,"volume",mg)}unlock(){typeof window>"u"||typeof window.AudioContext!="function"||(this.context??(this.context=new window.AudioContext),this.context.state==="suspended"&&this.context.resume().catch(()=>{}))}get ready(){var s;return((s=this.context)==null?void 0:s.state)==="running"}play(s){const i=this.context;if(i===null||i.state!=="running")return;const u=i.currentTime+.01;for(const _ of Wx[s]){const R=i.createOscillator(),x=i.createGain();R.type="sine",R.frequency.value=_.frequency;const r=u+_.at;x.gain.setValueAtTime(1e-4,r),x.gain.exponentialRampToValueAtTime(to(this.volume),r+.012),x.gain.exponentialRampToValueAtTime(1e-4,r+_.duration),R.connect(x),x.connect(i.destination),R.start(r),R.stop(r+_.duration+.02)}}}const zc="agent-workbench.notify";function Kx(n){return n==="on"?!0:n==="off"?!1:null}function Gx(n,s,i){return n&&s==="granted"&&!i}function Yx(n,s){return C(s==="denied"?"sound.notify.blocked":n?"sound.notify.on":"sound.notify.off")}function Xx(n,s){return n==="attention"?C("notify.attention",{tab:s}):C("notify.done",{tab:s})}function Qx(n){return n===void 0?"":n.label.length>0?n.label:n.cwd.split(/[\\/]/).filter(s=>s.length>0).pop()??n.cwd}function Ki(){return typeof window>"u"||!("Notification"in window)||!window.isSecureContext?"unsupported":Notification.permission}async function Jx(){if(Ki()==="unsupported")return"unsupported";try{return await Notification.requestPermission()}catch{return Ki()}}function Zx(){return document.visibilityState==="visible"&&document.hasFocus()}function ek(n){try{const s=new Notification("Agent Workbench",{body:Xx(n.chime,n.tabName),tag:`agent-workbench:${n.terminalId}`});s.onclick=()=>{window.focus(),n.onClick(),s.close()}}catch{}}function tk(n,s){const[i,u]=j.useState(()=>yt(hp,!0,Hx)),_=j.useRef(i);_.current=i;const[R,x]=j.useState(()=>yt(dp,mg,zx)),r=j.useRef(R);r.current=R;const[c]=j.useState(()=>typeof navigator<"u"&&Em(navigator.userAgent)),[g,v]=j.useState(()=>yt(up,"system",Ox)),h=j.useRef(g);h.current=g;const[y,S]=j.useState(()=>Ki()),[E,f]=j.useState(()=>yt(zc,!1,Kx)),a=j.useRef(E);a.current=E;const m=j.useRef(s);m.current=s;const p=j.useCallback((q,D)=>{Gx(a.current,Ki(),Zx())&&ek({chime:q,terminalId:D,tabName:m.current.nameOf(D),onClick:()=>m.current.activate(D)})},[]),d=j.useRef(null),k=j.useRef(new Map),I=j.useRef(new Map),[L,M]=j.useState(()=>new Set),b=j.useRef(new Map),T=j.useCallback(q=>{const D=b.current,$=D.get(q);$!==void 0&&window.clearTimeout($),M(H=>H.has(q)?H:new Set(H).add(q)),D.set(q,window.setTimeout(()=>{D.delete(q),M(H=>{if(!H.has(q))return H;const K=new Set(H);return K.delete(q),K})},Bm))},[]),N=j.useCallback(q=>{const D=d.current,$=Fx(c,h.current,_.current,r.current);D===null||$===null||(D.volume=$,D.play(q))},[c]);j.useEffect(()=>{const q=new qx;q.volume=r.current,d.current=q;const D=()=>{q.unlock(),q.ready&&(window.removeEventListener("pointerdown",D),window.removeEventListener("keydown",D))};return window.addEventListener("pointerdown",D),window.addEventListener("keydown",D),()=>{window.removeEventListener("pointerdown",D),window.removeEventListener("keydown",D),d.current=null}},[]),j.useEffect(()=>{const q=Px(k.current,n);k.current=new Map(n);const D=I.current;for(const $ of q.cancel){const H=D.get($);H!==void 0&&(window.clearTimeout(H),D.delete($))}q.now.length>0&&N("attention");for(const $ of q.now)p("attention",$),T($);for(const $ of q.later)D.set($,window.setTimeout(()=>{D.delete($),N("done"),p("done",$),T($)},Ix))},[n,p,N,T]),j.useEffect(()=>{const q=I.current,D=b.current;return()=>{for(const $ of q.values())window.clearTimeout($);q.clear();for(const $ of D.values())window.clearTimeout($);D.clear()}},[]);const O=j.useCallback(()=>{var q,D;u($=>{const H=!$;return mt(hp,H?"on":"off"),H}),_.current||((q=d.current)==null||q.unlock(),(D=d.current)==null||D.play("done"))},[]),B=j.useCallback(q=>{const D=to(q);x(D),mt(dp,String(D)),d.current!==null&&(d.current.volume=D)},[]),F=j.useCallback(()=>{var q,D;_.current&&((q=d.current)==null||q.unlock(),(D=d.current)==null||D.play("done"))},[]),U=j.useCallback(()=>{if(a.current&&Ki()==="granted"){f(!1),mt(zc,"off");return}Jx().then(q=>{S(q),q==="granted"&&(f(!0),mt(zc,"on"))})},[]),V={supported:y!=="unsupported",enabled:E&&y==="granted",permission:y,toggle:U},X=j.useCallback(q=>{var D;v(q),h.current=q,mt(up,q),window.location.href=Bx(q),q==="page"&&((D=d.current)==null||D.unlock(),N("done"))},[N]);return{enabled:i,toggle:O,volume:R,setVolume:B,previewVolume:F,notify:V,phoneChime:c?{source:g,setSource:X}:null,attention:L}}function gg(n,s,i){const[u,_]=j.useState(()=>yt(n,s,ob));j.useLayoutEffect(()=>{document.documentElement.dataset[i]=u},[i,u]);const R=j.useCallback(()=>{_(x=>{const r=Om(x);return mt(n,r),r})},[n]);return{size:u,cycle:R}}function nk(){return gg(nb,Pm,"threadFont")}function sk(){return gg(sb,rb,"notesFont")}function rk(n,s){const[i,u]=j.useState(()=>new Map),[_,R]=j.useState(()=>new Map),x=j.useCallback((c,g,v,h)=>{u(y=>new Map(y).set(c,{requestId:g,terminalId:c,afterEventId:v,phase:"sending",queued:h,sentAt:Date.now(),deliveredAt:null}))},[]);j.useEffect(()=>{const c=n.onMessage(v=>{v.type==="agent.submitted"&&u(h=>h1(h,v,Date.now()))}),g=n.onReopen(()=>u(v=>u1(v,Date.now())));return()=>{c(),g()}},[n]);const r=j.useRef(new Map);return j.useLayoutEffect(()=>{const c=r.current;if(c===s)return;r.current=s;const g=Date.now();R(v=>c1(c,s,v,g))},[s]),{track:x,receipts:i,clocks:_}}const ik=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"]);function _g({sound:n}){return l.jsxs("span",{className:"sound-control",children:[l.jsx("button",{className:`icon-button${Ux(n.enabled,n.volume)?" icon-button-on":""}`,onClick:n.toggle,title:$x(n.enabled),"aria-pressed":n.enabled,children:"♪"}),n.enabled&&l.jsx("div",{className:"sound-volume",children:l.jsxs("div",{className:"sound-volume-box",children:[l.jsx("input",{className:"sound-volume-slider",type:"range",min:pg,max:Hl,step:.01,value:n.volume,onChange:s=>n.setVolume(Number(s.target.value)),onPointerUp:n.previewVolume,onKeyUp:s=>{ik.has(s.key)&&n.previewVolume()},title:C("sound.volume"),"aria-label":C("sound.volume")}),l.jsxs("span",{className:"sound-volume-value",children:[Vx(n.volume),"%"]})]})})]})}function vg({notify:n}){return n.supported?l.jsx("button",{className:`icon-button${n.enabled?" icon-button-on":""}`,onClick:n.toggle,title:Yx(n.enabled,n.permission),"aria-pressed":n.enabled,children:l.jsx(ok,{})}):null}function ok(){return l.jsx("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:l.jsx("path",{d:"M4 11V7a4 4 0 0 1 8 0v4l1.2 1.5H2.8L4 11zM6.6 14a1.5 1.5 0 0 0 2.8 0",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function lk(n){const[s,i]=j.useState(null),[u,_]=j.useState(null),[R,x]=j.useState(null),[r,c]=j.useState(!1),[g,v]=j.useState(null);j.useEffect(()=>{const k=n.onMessage(L=>{switch(L.type){case"remote.status":i(L.status),L.status.pairingActive||(_(null),x(null));break;case"remote.pairing.code":_(L.pairing),x(null);break;case"remote.phone.pairing":x(L.pairing),_(null);break;case"error":if(L.code!=="remote-failed")break;v(Dt(L.text)),L.detail!==void 0&&console.error("[servidor]",L.detail);break}}),I=n.onReopen(()=>{_(null),x(null),c(!1)});return()=>{k(),I()}},[n]);const h=j.useCallback(k=>{v(null),n.send({type:"remote.configure",enabled:k})},[n]),y=j.useCallback(k=>{v(null),n.send({type:"remote.configure",port:k})},[n]),S=j.useCallback(()=>{v(null),n.send({type:"remote.pairing.start"})},[n]),E=j.useCallback(()=>{_(null),n.send({type:"remote.pairing.cancel"})},[n]),f=j.useCallback(()=>{v(null),c(!0),n.send({type:"remote.phone.start"})},[n]),a=j.useCallback(()=>{x(null),c(!1),n.send({type:"remote.phone.cancel"})},[n]),m=j.useCallback((k,I)=>{v(null),n.send({type:"remote.device.rename",deviceId:k,label:I})},[n]),p=j.useCallback(k=>{v(null),n.send({type:"remote.device.revoke",deviceId:k})},[n]),d=j.useCallback(()=>v(null),[]);return{status:s,pairing:u,phonePairing:R,phoneStarted:r,problem:g,setEnabled:h,setPort:y,startPairing:S,cancelPairing:E,startPhonePairing:f,cancelPhonePairing:a,renameDevice:m,revokeDevice:p,dismissProblem:d}}const ak="USER";function ck(n,s){const i=n.sshUser.length>0?n.sshUser:ak,u=/\s/.test(i)?`"${i}@${s}"`:`${i}@${s}`;return`ssh -N -L ${n.port}:127.0.0.1:${n.port} ${u}`}function yg(n){return`http://localhost:${n}`}function uk(n,s){return`${yg(n)}/?${x0}=${s}`}function fp(n){return n[0]??"localhost"}function fu(n,s){switch(n){case"off":return C("remote.state.off");case"active":return C("remote.state.active",{port:s});case"restart-needed":return C("remote.state.restartNeeded");case"port-busy":return C("remote.state.portBusy",{port:s})}}function hk(n){const s=n.trim();if(!/^\d{1,5}$/.test(s))return null;const i=Number(s);return E0(i)?i:null}function dk(){return C("remote.portInvalid",{min:Xp,max:Qp})}function pp(n,s){return Math.max(0,Math.ceil((n-s)/1e3))}function mp(n){return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function fk(n,s=Date.now()){return n.connected?C("remote.device.connected"):n.lastSeenAt===null?C("remote.device.never"):C("remote.device.lastSeen",{when:Kn(n.lastSeenAt,s)})}function pk(n,s=Date.now()){return C("remote.device.paired",{when:Kn(n.createdAt,s)})}function mk(n){switch(n){case"powershell-admin":return C("remote.phone.authorize.admin");case"powershell":return C("remote.phone.authorize.powershell");case"terminal":return C("remote.phone.authorize.terminal")}}function gk(){return[{platform:"win32",label:"Windows",hint:C("remote.ssh.windows"),command:["Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0","Start-Service sshd","Set-Service -Name sshd -StartupType Automatic"].join(`
135
- `)},{platform:"darwin",label:"macOS",hint:C("remote.ssh.macos"),command:null},{platform:"linux",label:"Linux",hint:C("remote.ssh.linux"),command:["sudo apt install openssh-server","sudo systemctl enable --now ssh"].join(`
136
- `)}]}function _k(n){return n==="win32"||n==="darwin"?n:"linux"}function Sl(n){return n!==null&&n.state==="active"}function gp(n){return n!==null&&n.state==="active"&&n.devices.length>0}const ni=function(n,s){let _=n;const R=qi[s];let x=null,r=0,c=null;const g=[],v={},h=function(M,b){r=_*4+17,x=(function(T){const N=new Array(T);for(let O=0;O<T;O+=1){N[O]=new Array(T);for(let B=0;B<T;B+=1)N[O][B]=null}return N})(r),y(0,0),y(r-7,0),y(0,r-7),f(),E(),m(M,b),_>=7&&a(M),c==null&&(c=k(_,R,g)),p(c,b)},y=function(M,b){for(let T=-1;T<=7;T+=1)if(!(M+T<=-1||r<=M+T))for(let N=-1;N<=7;N+=1)b+N<=-1||r<=b+N||(0<=T&&T<=6&&(N==0||N==6)||0<=N&&N<=6&&(T==0||T==6)||2<=T&&T<=4&&2<=N&&N<=4?x[M+T][b+N]=!0:x[M+T][b+N]=!1)},S=function(){let M=0,b=0;for(let T=0;T<8;T+=1){h(!0,T);const N=Bs.getLostPoint(v);(T==0||M>N)&&(M=N,b=T)}return b},E=function(){for(let M=8;M<r-8;M+=1)x[M][6]==null&&(x[M][6]=M%2==0);for(let M=8;M<r-8;M+=1)x[6][M]==null&&(x[6][M]=M%2==0)},f=function(){const M=Bs.getPatternPosition(_);for(let b=0;b<M.length;b+=1)for(let T=0;T<M.length;T+=1){const N=M[b],O=M[T];if(x[N][O]==null)for(let B=-2;B<=2;B+=1)for(let F=-2;F<=2;F+=1)B==-2||B==2||F==-2||F==2||B==0&&F==0?x[N+B][O+F]=!0:x[N+B][O+F]=!1}},a=function(M){const b=Bs.getBCHTypeNumber(_);for(let T=0;T<18;T+=1){const N=!M&&(b>>T&1)==1;x[Math.floor(T/3)][T%3+r-8-3]=N}for(let T=0;T<18;T+=1){const N=!M&&(b>>T&1)==1;x[T%3+r-8-3][Math.floor(T/3)]=N}},m=function(M,b){const T=R<<3|b,N=Bs.getBCHTypeInfo(T);for(let O=0;O<15;O+=1){const B=!M&&(N>>O&1)==1;O<6?x[O][8]=B:O<8?x[O+1][8]=B:x[r-15+O][8]=B}for(let O=0;O<15;O+=1){const B=!M&&(N>>O&1)==1;O<8?x[8][r-O-1]=B:O<9?x[8][15-O-1+1]=B:x[8][15-O-1]=B}x[r-8][8]=!M},p=function(M,b){let T=-1,N=r-1,O=7,B=0;const F=Bs.getMaskFunction(b);for(let U=r-1;U>0;U-=2)for(U==6&&(U-=1);;){for(let V=0;V<2;V+=1)if(x[N][U-V]==null){let X=!1;B<M.length&&(X=(M[B]>>>O&1)==1),F(N,U-V)&&(X=!X),x[N][U-V]=X,O-=1,O==-1&&(B+=1,O=7)}if(N+=T,N<0||r<=N){N-=T,T=-T;break}}},d=function(M,b){let T=0,N=0,O=0;const B=new Array(b.length),F=new Array(b.length);for(let Y=0;Y<b.length;Y+=1){const q=b[Y].dataCount,D=b[Y].totalCount-q;N=Math.max(N,q),O=Math.max(O,D),B[Y]=new Array(q);for(let te=0;te<B[Y].length;te+=1)B[Y][te]=255&M.getBuffer()[te+T];T+=q;const $=Bs.getErrorCorrectPolynomial(D),K=Ji(B[Y],$.getLength()-1).mod($);F[Y]=new Array($.getLength()-1);for(let te=0;te<F[Y].length;te+=1){const re=te+K.getLength()-F[Y].length;F[Y][te]=re>=0?K.getAt(re):0}}let U=0;for(let Y=0;Y<b.length;Y+=1)U+=b[Y].totalCount;const V=new Array(U);let X=0;for(let Y=0;Y<N;Y+=1)for(let q=0;q<b.length;q+=1)Y<B[q].length&&(V[X]=B[q][Y],X+=1);for(let Y=0;Y<O;Y+=1)for(let q=0;q<b.length;q+=1)Y<F[q].length&&(V[X]=F[q][Y],X+=1);return V},k=function(M,b,T){const N=_p.getRSBlocks(M,b),O=vp();for(let F=0;F<T.length;F+=1){const U=T[F];O.put(U.getMode(),4),O.put(U.getLength(),Bs.getLengthInBits(U.getMode(),M)),U.write(O)}let B=0;for(let F=0;F<N.length;F+=1)B+=N[F].dataCount;if(O.getLengthInBits()>B*8)throw"code length overflow. ("+O.getLengthInBits()+">"+B*8+")";for(O.getLengthInBits()+4<=B*8&&O.put(0,4);O.getLengthInBits()%8!=0;)O.putBit(!1);for(;!(O.getLengthInBits()>=B*8||(O.put(236,8),O.getLengthInBits()>=B*8));)O.put(17,8);return d(O,N)};v.addData=function(M,b){b=b||"Byte";let T=null;switch(b){case"Numeric":T=vk(M);break;case"Alphanumeric":T=yk(M);break;case"Byte":T=wk(M);break;case"Kanji":T=bk(M);break;default:throw"mode:"+b}g.push(T),c=null},v.isDark=function(M,b){if(M<0||r<=M||b<0||r<=b)throw M+","+b;return x[M][b]},v.getModuleCount=function(){return r},v.make=function(){if(_<1){let M=1;for(;M<40;M++){const b=_p.getRSBlocks(M,R),T=vp();for(let O=0;O<g.length;O++){const B=g[O];T.put(B.getMode(),4),T.put(B.getLength(),Bs.getLengthInBits(B.getMode(),M)),B.write(T)}let N=0;for(let O=0;O<b.length;O++)N+=b[O].dataCount;if(T.getLengthInBits()<=N*8)break}_=M}h(!1,S())},v.createTableTag=function(M,b){M=M||2,b=typeof b>"u"?M*4:b;let T="";T+='<table style="',T+=" border-width: 0px; border-style: none;",T+=" border-collapse: collapse;",T+=" padding: 0px; margin: "+b+"px;",T+='">',T+="<tbody>";for(let N=0;N<v.getModuleCount();N+=1){T+="<tr>";for(let O=0;O<v.getModuleCount();O+=1)T+='<td style="',T+=" border-width: 0px; border-style: none;",T+=" border-collapse: collapse;",T+=" padding: 0px; margin: 0px;",T+=" width: "+M+"px;",T+=" height: "+M+"px;",T+=" background-color: ",T+=v.isDark(N,O)?"#000000":"#ffffff",T+=";",T+='"/>';T+="</tr>"}return T+="</tbody>",T+="</table>",T},v.createSvgTag=function(M,b,T,N){let O={};typeof arguments[0]=="object"&&(O=arguments[0],M=O.cellSize,b=O.margin,T=O.alt,N=O.title),M=M||2,b=typeof b>"u"?M*4:b,T=typeof T=="string"?{text:T}:T||{},T.text=T.text||null,T.id=T.text?T.id||"qrcode-description":null,N=typeof N=="string"?{text:N}:N||{},N.text=N.text||null,N.id=N.text?N.id||"qrcode-title":null;const B=v.getModuleCount()*M+b*2;let F,U,V,X,Y="",q;for(q="l"+M+",0 0,"+M+" -"+M+",0 0,-"+M+"z ",Y+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',Y+=O.scalable?"":' width="'+B+'px" height="'+B+'px"',Y+=' viewBox="0 0 '+B+" "+B+'" ',Y+=' preserveAspectRatio="xMinYMin meet"',Y+=N.text||T.text?' role="img" aria-labelledby="'+I([N.id,T.id].join(" ").trim())+'"':"",Y+=">",Y+=N.text?'<title id="'+I(N.id)+'">'+I(N.text)+"</title>":"",Y+=T.text?'<description id="'+I(T.id)+'">'+I(T.text)+"</description>":"",Y+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',Y+='<path d="',V=0;V<v.getModuleCount();V+=1)for(X=V*M+b,F=0;F<v.getModuleCount();F+=1)v.isDark(V,F)&&(U=F*M+b,Y+="M"+U+","+X+q);return Y+='" stroke="transparent" fill="black"/>',Y+="</svg>",Y},v.createDataURL=function(M,b){M=M||2,b=typeof b>"u"?M*4:b;const T=v.getModuleCount()*M+b*2,N=b,O=T-b;return kk(T,T,function(B,F){if(N<=B&&B<O&&N<=F&&F<O){const U=Math.floor((B-N)/M),V=Math.floor((F-N)/M);return v.isDark(V,U)?0:1}else return 1})},v.createImgTag=function(M,b,T){M=M||2,b=typeof b>"u"?M*4:b;const N=v.getModuleCount()*M+b*2;let O="";return O+="<img",O+=' src="',O+=v.createDataURL(M,b),O+='"',O+=' width="',O+=N,O+='"',O+=' height="',O+=N,O+='"',T&&(O+=' alt="',O+=I(T),O+='"'),O+="/>",O};const I=function(M){let b="";for(let T=0;T<M.length;T+=1){const N=M.charAt(T);switch(N){case"<":b+="&lt;";break;case">":b+="&gt;";break;case"&":b+="&amp;";break;case'"':b+="&quot;";break;default:b+=N;break}}return b},L=function(M){M=typeof M>"u"?2:M;const T=v.getModuleCount()*1+M*2,N=M,O=T-M;let B,F,U,V,X;const Y={"██":"█","█ ":"▀"," █":"▄"," ":" "},q={"██":"▀","█ ":"▀"," █":" "," ":" "};let D="";for(B=0;B<T;B+=2){for(U=Math.floor((B-N)/1),V=Math.floor((B+1-N)/1),F=0;F<T;F+=1)X="█",N<=F&&F<O&&N<=B&&B<O&&v.isDark(U,Math.floor((F-N)/1))&&(X=" "),N<=F&&F<O&&N<=B+1&&B+1<O&&v.isDark(V,Math.floor((F-N)/1))?X+=" ":X+="█",D+=M<1&&B+1>=O?q[X]:Y[X];D+=`
137
- `}return T%2&&M>0?D.substring(0,D.length-T-1)+Array(T+1).join("▀"):D.substring(0,D.length-1)};return v.createASCII=function(M,b){if(M=M||1,M<2)return L(b);M-=1,b=typeof b>"u"?M*2:b;const T=v.getModuleCount()*M+b*2,N=b,O=T-b;let B,F,U,V;const X=Array(M+1).join("██"),Y=Array(M+1).join(" ");let q="",D="";for(B=0;B<T;B+=1){for(U=Math.floor((B-N)/M),D="",F=0;F<T;F+=1)V=1,N<=F&&F<O&&N<=B&&B<O&&v.isDark(U,Math.floor((F-N)/M))&&(V=0),D+=V?X:Y;for(U=0;U<M;U+=1)q+=D+`
138
- `}return q.substring(0,q.length-1)},v.renderTo2dContext=function(M,b){b=b||2;const T=v.getModuleCount();for(let N=0;N<T;N++)for(let O=0;O<T;O++)M.fillStyle=v.isDark(N,O)?"black":"white",M.fillRect(O*b,N*b,b,b)},v};ni.stringToBytes=function(n){const s=[];for(let i=0;i<n.length;i+=1){const u=n.charCodeAt(i);s.push(u&255)}return s};ni.createStringToBytes=function(n,s){const i=(function(){const _=Ck(n),R=function(){const c=_.read();if(c==-1)throw"eof";return c};let x=0;const r={};for(;;){const c=_.read();if(c==-1)break;const g=R(),v=R(),h=R(),y=String.fromCharCode(c<<8|g),S=v<<8|h;r[y]=S,x+=1}if(x!=s)throw x+" != "+s;return r})(),u=63;return function(_){const R=[];for(let x=0;x<_.length;x+=1){const r=_.charCodeAt(x);if(r<128)R.push(r);else{const c=i[_.charAt(x)];typeof c=="number"?(c&255)==c?R.push(c):(R.push(c>>>8),R.push(c&255)):R.push(u)}}return R}};const Xt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},qi={L:1,M:0,Q:3,H:2},Os={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Bs=(function(){const n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],s=1335,i=7973,u=21522,_={},R=function(x){let r=0;for(;x!=0;)r+=1,x>>>=1;return r};return _.getBCHTypeInfo=function(x){let r=x<<10;for(;R(r)-R(s)>=0;)r^=s<<R(r)-R(s);return(x<<10|r)^u},_.getBCHTypeNumber=function(x){let r=x<<12;for(;R(r)-R(i)>=0;)r^=i<<R(r)-R(i);return x<<12|r},_.getPatternPosition=function(x){return n[x-1]},_.getMaskFunction=function(x){switch(x){case Os.PATTERN000:return function(r,c){return(r+c)%2==0};case Os.PATTERN001:return function(r,c){return r%2==0};case Os.PATTERN010:return function(r,c){return c%3==0};case Os.PATTERN011:return function(r,c){return(r+c)%3==0};case Os.PATTERN100:return function(r,c){return(Math.floor(r/2)+Math.floor(c/3))%2==0};case Os.PATTERN101:return function(r,c){return r*c%2+r*c%3==0};case Os.PATTERN110:return function(r,c){return(r*c%2+r*c%3)%2==0};case Os.PATTERN111:return function(r,c){return(r*c%3+(r+c)%2)%2==0};default:throw"bad maskPattern:"+x}},_.getErrorCorrectPolynomial=function(x){let r=Ji([1],0);for(let c=0;c<x;c+=1)r=r.multiply(Ji([1,Fs.gexp(c)],0));return r},_.getLengthInBits=function(x,r){if(1<=r&&r<10)switch(x){case Xt.MODE_NUMBER:return 10;case Xt.MODE_ALPHA_NUM:return 9;case Xt.MODE_8BIT_BYTE:return 8;case Xt.MODE_KANJI:return 8;default:throw"mode:"+x}else if(r<27)switch(x){case Xt.MODE_NUMBER:return 12;case Xt.MODE_ALPHA_NUM:return 11;case Xt.MODE_8BIT_BYTE:return 16;case Xt.MODE_KANJI:return 10;default:throw"mode:"+x}else if(r<41)switch(x){case Xt.MODE_NUMBER:return 14;case Xt.MODE_ALPHA_NUM:return 13;case Xt.MODE_8BIT_BYTE:return 16;case Xt.MODE_KANJI:return 12;default:throw"mode:"+x}else throw"type:"+r},_.getLostPoint=function(x){const r=x.getModuleCount();let c=0;for(let h=0;h<r;h+=1)for(let y=0;y<r;y+=1){let S=0;const E=x.isDark(h,y);for(let f=-1;f<=1;f+=1)if(!(h+f<0||r<=h+f))for(let a=-1;a<=1;a+=1)y+a<0||r<=y+a||f==0&&a==0||E==x.isDark(h+f,y+a)&&(S+=1);S>5&&(c+=3+S-5)}for(let h=0;h<r-1;h+=1)for(let y=0;y<r-1;y+=1){let S=0;x.isDark(h,y)&&(S+=1),x.isDark(h+1,y)&&(S+=1),x.isDark(h,y+1)&&(S+=1),x.isDark(h+1,y+1)&&(S+=1),(S==0||S==4)&&(c+=3)}for(let h=0;h<r;h+=1)for(let y=0;y<r-6;y+=1)x.isDark(h,y)&&!x.isDark(h,y+1)&&x.isDark(h,y+2)&&x.isDark(h,y+3)&&x.isDark(h,y+4)&&!x.isDark(h,y+5)&&x.isDark(h,y+6)&&(c+=40);for(let h=0;h<r;h+=1)for(let y=0;y<r-6;y+=1)x.isDark(y,h)&&!x.isDark(y+1,h)&&x.isDark(y+2,h)&&x.isDark(y+3,h)&&x.isDark(y+4,h)&&!x.isDark(y+5,h)&&x.isDark(y+6,h)&&(c+=40);let g=0;for(let h=0;h<r;h+=1)for(let y=0;y<r;y+=1)x.isDark(y,h)&&(g+=1);const v=Math.abs(100*g/r/r-50)/5;return c+=v*10,c},_})(),Fs=(function(){const n=new Array(256),s=new Array(256);for(let u=0;u<8;u+=1)n[u]=1<<u;for(let u=8;u<256;u+=1)n[u]=n[u-4]^n[u-5]^n[u-6]^n[u-8];for(let u=0;u<255;u+=1)s[n[u]]=u;const i={};return i.glog=function(u){if(u<1)throw"glog("+u+")";return s[u]},i.gexp=function(u){for(;u<0;)u+=255;for(;u>=256;)u-=255;return n[u]},i})(),Ji=function(n,s){if(typeof n.length>"u")throw n.length+"/"+s;const i=(function(){let _=0;for(;_<n.length&&n[_]==0;)_+=1;const R=new Array(n.length-_+s);for(let x=0;x<n.length-_;x+=1)R[x]=n[x+_];return R})(),u={};return u.getAt=function(_){return i[_]},u.getLength=function(){return i.length},u.multiply=function(_){const R=new Array(u.getLength()+_.getLength()-1);for(let x=0;x<u.getLength();x+=1)for(let r=0;r<_.getLength();r+=1)R[x+r]^=Fs.gexp(Fs.glog(u.getAt(x))+Fs.glog(_.getAt(r)));return Ji(R,0)},u.mod=function(_){if(u.getLength()-_.getLength()<0)return u;const R=Fs.glog(u.getAt(0))-Fs.glog(_.getAt(0)),x=new Array(u.getLength());for(let r=0;r<u.getLength();r+=1)x[r]=u.getAt(r);for(let r=0;r<_.getLength();r+=1)x[r]^=Fs.gexp(Fs.glog(_.getAt(r))+R);return Ji(x,0).mod(_)},u},_p=(function(){const n=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],s=function(_,R){const x={};return x.totalCount=_,x.dataCount=R,x},i={},u=function(_,R){switch(R){case qi.L:return n[(_-1)*4+0];case qi.M:return n[(_-1)*4+1];case qi.Q:return n[(_-1)*4+2];case qi.H:return n[(_-1)*4+3];default:return}};return i.getRSBlocks=function(_,R){const x=u(_,R);if(typeof x>"u")throw"bad rs block @ typeNumber:"+_+"/errorCorrectionLevel:"+R;const r=x.length/3,c=[];for(let g=0;g<r;g+=1){const v=x[g*3+0],h=x[g*3+1],y=x[g*3+2];for(let S=0;S<v;S+=1)c.push(s(h,y))}return c},i})(),vp=function(){const n=[];let s=0;const i={};return i.getBuffer=function(){return n},i.getAt=function(u){const _=Math.floor(u/8);return(n[_]>>>7-u%8&1)==1},i.put=function(u,_){for(let R=0;R<_;R+=1)i.putBit((u>>>_-R-1&1)==1)},i.getLengthInBits=function(){return s},i.putBit=function(u){const _=Math.floor(s/8);n.length<=_&&n.push(0),u&&(n[_]|=128>>>s%8),s+=1},i},vk=function(n){const s=Xt.MODE_NUMBER,i=n,u={};u.getMode=function(){return s},u.getLength=function(x){return i.length},u.write=function(x){const r=i;let c=0;for(;c+2<r.length;)x.put(_(r.substring(c,c+3)),10),c+=3;c<r.length&&(r.length-c==1?x.put(_(r.substring(c,c+1)),4):r.length-c==2&&x.put(_(r.substring(c,c+2)),7))};const _=function(x){let r=0;for(let c=0;c<x.length;c+=1)r=r*10+R(x.charAt(c));return r},R=function(x){if("0"<=x&&x<="9")return x.charCodeAt(0)-48;throw"illegal char :"+x};return u},yk=function(n){const s=Xt.MODE_ALPHA_NUM,i=n,u={};u.getMode=function(){return s},u.getLength=function(R){return i.length},u.write=function(R){const x=i;let r=0;for(;r+1<x.length;)R.put(_(x.charAt(r))*45+_(x.charAt(r+1)),11),r+=2;r<x.length&&R.put(_(x.charAt(r)),6)};const _=function(R){if("0"<=R&&R<="9")return R.charCodeAt(0)-48;if("A"<=R&&R<="Z")return R.charCodeAt(0)-65+10;switch(R){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+R}};return u},wk=function(n){const s=Xt.MODE_8BIT_BYTE,i=ni.stringToBytes(n),u={};return u.getMode=function(){return s},u.getLength=function(_){return i.length},u.write=function(_){for(let R=0;R<i.length;R+=1)_.put(i[R],8)},u},bk=function(n){const s=Xt.MODE_KANJI,i=ni.stringToBytes;(function(R,x){const r=i(R);if(r.length!=2||(r[0]<<8|r[1])!=x)throw"sjis not supported."})("友",38726);const u=i(n),_={};return _.getMode=function(){return s},_.getLength=function(R){return~~(u.length/2)},_.write=function(R){const x=u;let r=0;for(;r+1<x.length;){let c=(255&x[r])<<8|255&x[r+1];if(33088<=c&&c<=40956)c-=33088;else if(57408<=c&&c<=60351)c-=49472;else throw"illegal char at "+(r+1)+"/"+c;c=(c>>>8&255)*192+(c&255),R.put(c,13),r+=2}if(r<x.length)throw"illegal char at "+(r+1)},_},wg=function(){const n=[],s={};return s.writeByte=function(i){n.push(i&255)},s.writeShort=function(i){s.writeByte(i),s.writeByte(i>>>8)},s.writeBytes=function(i,u,_){u=u||0,_=_||i.length;for(let R=0;R<_;R+=1)s.writeByte(i[R+u])},s.writeString=function(i){for(let u=0;u<i.length;u+=1)s.writeByte(i.charCodeAt(u))},s.toByteArray=function(){return n},s.toString=function(){let i="";i+="[";for(let u=0;u<n.length;u+=1)u>0&&(i+=","),i+=n[u];return i+="]",i},s},Sk=function(){let n=0,s=0,i=0,u="";const _={},R=function(r){u+=String.fromCharCode(x(r&63))},x=function(r){if(r<0)throw"n:"+r;if(r<26)return 65+r;if(r<52)return 97+(r-26);if(r<62)return 48+(r-52);if(r==62)return 43;if(r==63)return 47;throw"n:"+r};return _.writeByte=function(r){for(n=n<<8|r&255,s+=8,i+=1;s>=6;)R(n>>>s-6),s-=6},_.flush=function(){if(s>0&&(R(n<<6-s),n=0,s=0),i%3!=0){const r=3-i%3;for(let c=0;c<r;c+=1)u+="="}},_.toString=function(){return u},_},Ck=function(n){const s=n;let i=0,u=0,_=0;const R={};R.read=function(){for(;_<8;){if(i>=s.length){if(_==0)return-1;throw"unexpected end of file./"+_}const c=s.charAt(i);if(i+=1,c=="=")return _=0,-1;if(c.match(/^\s$/))continue;u=u<<6|x(c.charCodeAt(0)),_+=6}const r=u>>>_-8&255;return _-=8,r};const x=function(r){if(65<=r&&r<=90)return r-65;if(97<=r&&r<=122)return r-97+26;if(48<=r&&r<=57)return r-48+52;if(r==43)return 62;if(r==47)return 63;throw"c:"+r};return R},xk=function(n,s){const i=n,u=s,_=new Array(n*s),R={};R.setPixel=function(g,v,h){_[v*i+g]=h},R.write=function(g){g.writeString("GIF87a"),g.writeShort(i),g.writeShort(u),g.writeByte(128),g.writeByte(0),g.writeByte(0),g.writeByte(0),g.writeByte(0),g.writeByte(0),g.writeByte(255),g.writeByte(255),g.writeByte(255),g.writeString(","),g.writeShort(0),g.writeShort(0),g.writeShort(i),g.writeShort(u),g.writeByte(0);const v=2,h=r(v);g.writeByte(v);let y=0;for(;h.length-y>255;)g.writeByte(255),g.writeBytes(h,y,255),y+=255;g.writeByte(h.length-y),g.writeBytes(h,y,h.length-y),g.writeByte(0),g.writeString(";")};const x=function(g){const v=g;let h=0,y=0;const S={};return S.write=function(E,f){if(E>>>f)throw"length over";for(;h+f>=8;)v.writeByte(255&(E<<h|y)),f-=8-h,E>>>=8-h,y=0,h=0;y=E<<h|y,h=h+f},S.flush=function(){h>0&&v.writeByte(y)},S},r=function(g){const v=1<<g,h=(1<<g)+1;let y=g+1;const S=c();for(let p=0;p<v;p+=1)S.add(String.fromCharCode(p));S.add(String.fromCharCode(v)),S.add(String.fromCharCode(h));const E=wg(),f=x(E);f.write(v,y);let a=0,m=String.fromCharCode(_[a]);for(a+=1;a<_.length;){const p=String.fromCharCode(_[a]);a+=1,S.contains(m+p)?m=m+p:(f.write(S.indexOf(m),y),S.size()<4095&&(S.size()==1<<y&&(y+=1),S.add(m+p)),m=p)}return f.write(S.indexOf(m),y),f.write(h,y),f.flush(),E.toByteArray()},c=function(){const g={};let v=0;const h={};return h.add=function(y){if(h.contains(y))throw"dup key:"+y;g[y]=v,v+=1},h.size=function(){return v},h.indexOf=function(y){return g[y]},h.contains=function(y){return typeof g[y]<"u"},h};return R},kk=function(n,s,i){const u=xk(n,s);for(let r=0;r<s;r+=1)for(let c=0;c<n;c+=1)u.setPixel(c,r,i(c,r));const _=wg();u.write(_);const R=Sk(),x=_.toByteArray();for(let r=0;r<x.length;r+=1)R.writeByte(x[r]);return R.flush(),"data:image/gif;base64,"+R};ni.stringToBytes;const zi=4;function Ek(n){const s=ni(0,"M");s.addData(n,"Byte"),s.make();const i=s.getModuleCount();let u="";for(let _=0;_<i;_++){let R=0;for(;R<i;){if(!s.isDark(_,R)){R++;continue}const x=R;for(;R<i&&s.isDark(_,R);)R++;u+=`M${x} ${_}h${R-x}v1h-${R-x}z`}}return{size:i,path:u}}const Lk=1e3,Tk=4e3;function Rk({status:n,pairing:s,phonePairing:i,phoneStarted:u,problem:_,platform:R,onSetEnabled:x,onSetPort:r,onStartPairing:c,onCancelPairing:g,onStartPhonePairing:v,onCancelPhonePairing:h,onRenameDevice:y,onRevokeDevice:S,onDismissProblem:E,onClose:f}){const[a,m]=j.useState(()=>fp(n.hostNames)),[p,d]=j.useState(String(n.port)),[k,I]=j.useState(null),L=j.useRef(null),[M,b]=j.useState(()=>Date.now()),T=()=>{s!==null&&g(),u&&h(),f()},N=j.useRef(T);N.current=T,j.useEffect(()=>{const D=$=>{$.key==="Escape"&&($.preventDefault(),$.stopPropagation(),N.current())};return window.addEventListener("keydown",D,!0),()=>window.removeEventListener("keydown",D,!0)},[]),j.useEffect(()=>{if(s===null&&i===null)return;b(Date.now());const D=window.setInterval(()=>b(Date.now()),1e3);return()=>window.clearInterval(D)},[s,i]),j.useEffect(()=>()=>{L.current!==null&&window.clearTimeout(L.current)},[]);const O=j.useRef(null),B=i!==null;j.useEffect(()=>{var $;if(!B)return;const D=window.matchMedia("(prefers-reduced-motion: reduce)").matches;($=O.current)==null||$.scrollIntoView({block:"center",behavior:D?"auto":"smooth"})},[B]),j.useEffect(()=>{d(String(n.port))},[n.port]),j.useEffect(()=>{n.hostNames.includes(a)||m(fp(n.hostNames))},[n.hostNames,a]);const F=(D,$)=>{navigator.clipboard.writeText($).then(()=>{I(D),L.current!==null&&window.clearTimeout(L.current),L.current=window.setTimeout(()=>I(null),Lk)}).catch(()=>I(null))},U=hk(p),V=U!==null&&U!==n.port,X=ck(n,a),Y=C("remote.title"),q=s===null?null:uk(n.port,s.code);return l.jsx("div",{className:"modal-backdrop",onClick:T,children:l.jsxs("div",{className:"modal",role:"dialog","aria-label":Y,onClick:D=>D.stopPropagation(),children:[l.jsxs("header",{className:"modal-header",children:[l.jsx("span",{className:"modal-title",children:Y}),l.jsx("button",{className:"icon-button",onClick:T,title:C("common.close"),children:"×"})]}),l.jsxs("div",{className:"modal-body",children:[l.jsx("p",{className:`status-line-state${n.state==="active"?" status-line-state-active":""}`,children:fu(n.state,n.port)}),l.jsx("p",{className:"modal-hint",children:C("remote.intro")}),l.jsx("div",{className:"vault-actions",children:n.enabled?l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"link-button",onClick:()=>x(!1),children:C("remote.turnOff")}),l.jsx("span",{className:"modal-hint",children:C("remote.turnOffHint")})]}):l.jsx("button",{className:"primary-button",onClick:()=>x(!0),children:C("remote.turnOn")})}),l.jsxs("div",{className:"remote-port",children:[l.jsx("label",{className:"modal-hint",htmlFor:"remote-port-input",children:C("remote.port")}),l.jsx("input",{id:"remote-port-input",className:"remote-port-input",inputMode:"numeric",value:p,onChange:D=>d(D.target.value),onKeyDown:D=>{D.key==="Enter"&&V&&U!==null&&r(U)}}),l.jsx("button",{className:"link-button",onClick:()=>U!==null&&r(U),disabled:!V,children:C("remote.portSave")}),U===null&&l.jsx("span",{className:"modal-hint remote-port-invalid",children:dk()})]}),l.jsx("p",{className:"modal-hint",children:C("remote.restartHint")}),_!==null&&l.jsxs("div",{className:"vault-problem",role:"alert",children:[l.jsx("span",{children:_}),l.jsx("button",{className:"icon-button",onClick:E,title:C("common.close"),children:"×"})]}),l.jsx("h3",{className:"modal-section",children:C("remote.step.host")}),l.jsx("p",{className:"modal-hint",children:C("remote.step.hostHint")}),gk().map(D=>l.jsxs("details",{className:"remote-os",open:D.platform===_k(R),children:[l.jsx("summary",{className:"remote-os-summary",children:D.label}),l.jsx("p",{className:"modal-hint",children:D.hint}),D.command!==null&&l.jsxs("div",{className:"status-line-fragment",children:[l.jsx("pre",{className:"tool-pre",children:D.command}),l.jsx("button",{className:"link-button",onClick:()=>F("ssh",D.command??""),children:k==="ssh"?l.jsxs(l.Fragment,{children:["✓ ",C("remote.copied")]}):C("remote.copy")})]})]},D.platform)),l.jsx("h3",{className:"modal-section",children:C("remote.step.tunnel")}),l.jsx("p",{className:"modal-hint",children:C("remote.step.tunnelHint")}),n.hostNames.length>1&&l.jsxs("div",{className:"remote-port",children:[l.jsx("label",{className:"modal-hint",htmlFor:"remote-host-select",children:C("remote.address")}),l.jsx("select",{id:"remote-host-select",className:"remote-host-select",value:a,onChange:D=>m(D.target.value),children:n.hostNames.map(D=>l.jsx("option",{value:D,children:D},D))})]}),l.jsxs("div",{className:"status-line-fragment",children:[l.jsx("pre",{className:"tool-pre",children:X}),l.jsx("button",{className:"link-button",onClick:()=>F("command",X),children:k==="command"?l.jsxs(l.Fragment,{children:["✓ ",C("remote.copied")]}):C("remote.copy")})]}),l.jsxs("details",{className:"remote-os",children:[l.jsx("summary",{className:"remote-os-summary",children:C("remote.trouble")}),l.jsxs("ul",{className:"remote-trouble",children:[l.jsx("li",{className:"modal-hint",children:C("remote.trouble.network")}),l.jsx("li",{className:"modal-hint",children:C("remote.vpnHint")}),n.sshUser.length>0&&l.jsx("li",{className:"modal-hint",children:C("remote.userHint",{user:n.sshUser})})]})]}),l.jsx("h3",{className:"modal-section",children:C("remote.step.pair")}),s===null||q===null?l.jsxs("div",{className:"vault-actions",children:[l.jsx("button",{className:"primary-button",onClick:c,disabled:!Sl(n),children:C("remote.pair.start")}),!Sl(n)&&l.jsx("span",{className:"modal-hint",children:C("remote.pair.needsActive")})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"modal-hint",children:C("remote.pair.open")}),l.jsxs("div",{className:"status-line-fragment",children:[l.jsx("pre",{className:"tool-pre",children:q}),l.jsx("button",{className:"link-button",onClick:()=>F("pairing",q),children:k==="pairing"?l.jsxs(l.Fragment,{children:["✓ ",C("remote.copied")]}):C("remote.copy")})]}),l.jsxs("p",{className:"modal-hint",children:[C("remote.pair.expires",{time:mp(pp(s.expiresAt,M))})," ",C("remote.pair.after",{url:yg(n.port)})]}),l.jsx("div",{className:"vault-actions",children:l.jsx("button",{className:"link-button",onClick:g,children:C("remote.pair.cancel")})})]}),l.jsx("h3",{className:"modal-section",children:C("remote.phone.title")}),i===null?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"modal-hint",children:C("remote.phone.hint")}),l.jsxs("div",{className:"vault-actions",children:[l.jsx("button",{className:"primary-button",onClick:v,disabled:!Sl(n),children:C("remote.phone.start")}),!Sl(n)&&l.jsx("span",{className:"modal-hint",children:C("remote.pair.needsActive")})]})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"modal-hint",children:mk(i.shell)}),l.jsxs("div",{className:"status-line-fragment",children:[l.jsx("pre",{className:"tool-pre remote-phone-command",children:i.authorizeCommand}),l.jsx("button",{className:"link-button",onClick:()=>F("phone",i.authorizeCommand),children:k==="phone"?l.jsxs(l.Fragment,{children:["✓ ",C("remote.copied")]}):C("remote.copy")})]}),l.jsx("p",{className:"modal-hint",children:C("remote.phone.authorizeOnce")}),l.jsx("p",{className:"modal-hint",children:C("remote.phone.scan")}),l.jsx("div",{ref:O,children:l.jsx(Mk,{payload:i.payload})}),l.jsx("p",{className:"modal-hint",children:C("remote.phone.secret")}),l.jsx("p",{className:"modal-hint",children:C("remote.pair.expires",{time:mp(pp(i.expiresAt,M))})}),l.jsx("div",{className:"vault-actions",children:l.jsx("button",{className:"link-button",onClick:h,children:C("remote.pair.cancel")})})]}),l.jsx("h3",{className:"modal-section",children:C("remote.devices")}),n.devices.length===0?l.jsx("p",{className:"modal-hint",children:C("remote.devices.empty")}):l.jsx("ul",{className:"remote-devices",children:n.devices.map(D=>l.jsx(Ak,{device:D,onRename:$=>y(D.id,$),onRevoke:()=>S(D.id)},D.id))})]})]})})}function Mk({payload:n}){const s=Ek(n),i=s.size+zi*2;return l.jsxs("svg",{className:"remote-phone-qr",viewBox:`${-zi} ${-zi} ${i} ${i}`,role:"img","aria-label":C("remote.phone.qrLabel"),shapeRendering:"crispEdges",children:[l.jsx("rect",{x:-zi,y:-zi,width:i,height:i,fill:"#fff"}),l.jsx("path",{d:s.path,fill:"#000"})]})}function Ak({device:n,onRename:s,onRevoke:i}){const[u,_]=j.useState(!1),[R,x]=j.useState(n.label),[r,c]=j.useState(!1),g=j.useRef(null);j.useEffect(()=>()=>{g.current!==null&&window.clearTimeout(g.current)},[]);const v=()=>{_(!1);const y=R.trim();y.length>0&&y!==n.label&&s(y)},h=()=>{if(r){i();return}c(!0),g.current=window.setTimeout(()=>c(!1),Tk)};return l.jsxs("li",{className:"remote-device",children:[l.jsxs("div",{className:"remote-device-main",children:[u?l.jsx("input",{className:"remote-device-input",value:R,autoFocus:!0,onChange:y=>x(y.target.value),onBlur:v,onKeyDown:y=>{y.key==="Enter"&&v()}}):l.jsx("button",{className:"remote-device-label",onClick:()=>{x(n.label),_(!0)},title:C("remote.device.rename"),children:n.label}),l.jsx("span",{className:`remote-device-seen${n.connected?" remote-device-connected":""}`,children:fk(n)}),l.jsx("span",{className:"remote-device-paired",children:pk(n)})]}),l.jsx("button",{className:`link-button${r?" remote-device-confirm":""}`,onClick:h,children:C(r?"remote.device.revokeConfirm":"remote.device.revoke")})]})}const Vc="agent-workbench.notes-open",yp="agent-workbench.notes-active",wp="agent-workbench.notes-height",qc=160,Nk=300;function Dk(n){return n.text.trim().length===0?n.images.length>0?C("notes.imageOnly"):C("notes.untitled"):d0(n)}function Ik({notes:n,onSendNote:s,sendTargetCwd:i,fill:u,onHide:_}){const[R,x]=j.useState(()=>yt(Vc,!1,V=>V==="true")),r=R||u,[c,g]=j.useState(()=>yt(wp,Nk,V=>{const X=Number.parseInt(V,10);return Number.isFinite(X)?Math.max(X,qc):null})),[v,h]=j.useState(()=>yt(yp,null,V=>V)),[y,S]=j.useState(null),[E,f]=j.useState(null),[a,m]=j.useState(0),p=sk(),d=j.useMemo(()=>n.notes.length===0?null:n.notes.find(V=>V.noteId===v)??n.notes[n.notes.length-1]??null,[n.notes,v]),k=j.useCallback(V=>{h(V),mt(yp,V),S(null)},[]),I=j.useCallback(()=>{x(V=>{const X=!V;return mt(Vc,String(X)),X})},[]),L=j.useCallback(()=>{const V=n.create();k(V),r||(x(!0),mt(Vc,"true")),m(X=>X+1)},[n,r,k]),M=j.useCallback(V=>{if(V.text.trim().length===0&&V.images.length===0){n.remove(V.noteId);return}k(V.noteId),S(V.noteId)},[n,k]),b=j.useCallback(()=>{y!==null&&n.remove(y),S(null)},[y,n]),T=j.useRef(null),N=j.useCallback(V=>{const X=V.currentTarget.parentElement,Y=X===null?c:Math.round(X.getBoundingClientRect().height);T.current={startY:V.clientY,startHeight:Y},V.currentTarget.setPointerCapture(V.pointerId),V.preventDefault()},[c]),O=j.useCallback(V=>{const X=T.current;if(X===null)return;const Y=Math.max(qc,Math.floor(window.innerHeight*.8));g(Math.min(Y,Math.max(qc,X.startHeight+X.startY-V.clientY)))},[]),B=j.useCallback(V=>{T.current!==null&&(T.current=null,V.currentTarget.releasePointerCapture(V.pointerId),mt(wp,String(c)))},[c]);j.useEffect(()=>{if(E===null)return;const V=X=>{X.key==="Escape"&&(X.stopPropagation(),f(null))};return window.addEventListener("keydown",V,!0),()=>window.removeEventListener("keydown",V,!0)},[E]);const F=E===null?void 0:n.images[E],U=n.notes.length;return l.jsxs("section",{className:`notes${r?" notes-open":""}${u?" notes-fill":""}`,style:r&&!u?{height:`${c}px`}:void 0,children:[r&&!u&&l.jsx("div",{className:"notes-resize",onPointerDown:N,onPointerMove:O,onPointerUp:B,onPointerCancel:B,title:C("notes.resize")}),r?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"notes-header",children:[l.jsxs("div",{className:"strip-tabs",role:"tablist",children:[n.notes.map(V=>{const X=V.noteId===(d==null?void 0:d.noteId),Y=Dk(V);return l.jsxs("div",{className:`strip-tab${X?" is-active":""}`,role:"tab","aria-selected":X,children:[l.jsx("button",{className:"strip-tab-label",onClick:()=>k(V.noteId),title:Y,children:Y}),l.jsx("button",{className:"strip-tab-close",onClick:()=>M(V),title:C("notes.closeNote"),children:"×"})]},V.noteId)}),l.jsx("button",{className:"strip-tab-new",onClick:L,title:C("notes.new"),children:"+"})]}),l.jsx("span",{className:"strip-spacer"}),l.jsx("button",{className:"icon-button thread-font-button",onClick:p.cycle,title:Nl(p.size),"aria-label":Nl(p.size),children:l.jsxs("span",{"aria-hidden":"true",children:["a",l.jsx("span",{className:"thread-font-big",children:"A"})]})}),!u&&l.jsx("button",{className:"icon-button",onClick:I,title:C("notes.collapse"),children:"▾"}),_!==void 0&&l.jsx(Al,{title:C("settings.hide.notes"),onHide:_,confirmText:null})]}),l.jsx("div",{className:"notes-body",children:U===0||d===null?l.jsx("p",{className:"notes-empty",children:zt("notes.empty")}):l.jsx(Ok,{note:d,notes:n,closing:y===d.noteId,focusRequest:a,onConfirmClose:b,onCancelClose:()=>S(null),onOpenImage:f,onSend:s===null?null:()=>s(d.noteId),sendTargetCwd:i},d.noteId)})]}):l.jsxs("div",{className:"strip-collapsed-row",children:[l.jsxs("button",{className:"strip-collapsed",onClick:I,title:C("notes.expand"),children:[l.jsx("span",{className:"strip-collapsed-arrow",children:"▸"}),l.jsx("span",{children:C("notes.name")}),U>0&&l.jsx("span",{className:"strip-collapsed-count",children:U})]}),_!==void 0&&l.jsx(Al,{title:C("settings.hide.notes"),onHide:_,confirmText:null})]}),E!==null&&l.jsx("div",{className:"notes-lightbox",onClick:()=>f(null),title:C("notes.lightboxClose"),children:typeof F=="string"?l.jsx("img",{src:F,alt:C("notes.imageAlt")}):l.jsx("span",{className:"notes-lightbox-missing",children:C("notes.imageUnavailable")})})]})}function jk(){return l.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:l.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 Pk(){return l.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:[l.jsx("path",{d:"M21.5 2.5 11 13"}),l.jsx("path",{d:"M21.5 2.5 15 21.5l-4-8.5-8.5-4z"})]})}function Ok({note:n,notes:s,closing:i,focusRequest:u,onConfirmClose:_,onCancelClose:R,onOpenImage:x,onSend:r,sendTargetCwd:c}){const g=j.useRef(null),[v,h]=j.useState(!1),y=n.text.trim().length===0&&n.images.length===0;j.useEffect(()=>{var f;u>0&&((f=g.current)==null||f.focus())},[u]);const S=j.useCallback(f=>{const a=Array.from(f).filter(m=>m.type.startsWith("image/"));for(const m of a)s.addImage(n.noteId,m);return a.length>0},[s,n.noteId]),E=j.useCallback(f=>{f.clipboardData!==null&&S(f.clipboardData.files)&&f.preventDefault()},[S]);return l.jsxs("div",{className:`note-editor${v?" note-editor-dragging":""}`,onDragOver:f=>{Array.from(f.dataTransfer.types).includes("Files")&&(f.preventDefault(),h(!0))},onDragLeave:()=>h(!1),onDrop:f=>{f.preventDefault(),h(!1),S(f.dataTransfer.files)},children:[i&&l.jsxs("div",{className:"note-closing",children:[l.jsx("span",{children:C("notes.closeConfirm")}),l.jsx("button",{className:"link-button link-danger",onClick:_,children:C("common.close")}),l.jsx("button",{className:"link-button",onClick:R,children:C("common.cancel")})]}),s.problem!==null&&l.jsxs("div",{className:"composer-problem",children:[l.jsx("span",{children:s.problem}),l.jsx("button",{className:"icon-button",onClick:s.dismissProblem,title:C("common.close"),children:"×"})]}),l.jsx("textarea",{ref:g,className:"note-input",value:n.text,placeholder:C("notes.placeholder"),onChange:f=>s.updateText(n.noteId,f.target.value),onPaste:E,spellCheck:!1}),n.images.length>0&&l.jsx("div",{className:"note-images",children:n.images.map(f=>l.jsx(Bk,{image:f,src:s.images[f.imageId],onRequest:s.requestImage,onOpen:()=>x(f.imageId),onRemove:()=>s.removeImage(n.noteId,f.imageId)},f.imageId))}),l.jsxs("div",{className:"note-footer",children:[l.jsx("span",{className:"note-meta",children:Kn(n.updatedAt)}),l.jsx("span",{className:"composer-spacer"}),l.jsx("button",{className:"icon-button",onClick:()=>r==null?void 0:r(),disabled:r===null||y,title:Fy(r!==null,c,y),children:l.jsx(Pk,{})}),l.jsxs("label",{className:"icon-button note-attach",title:C("notes.attach"),children:[l.jsx(jk,{}),l.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:f=>{f.target.files!==null&&S(f.target.files),f.target.value=""}})]})]})]})}function Bk({image:n,src:s,onRequest:i,onOpen:u,onRemove:_}){return j.useEffect(()=>{s===void 0&&i(n.imageId)},[s,n.imageId,i]),l.jsxs("figure",{className:"chip chip-image note-thumb",title:hn(n.bytes),children:[typeof s=="string"?l.jsx("img",{src:s,alt:C("notes.imageAlt"),onClick:u}):l.jsx("span",{className:"note-thumb-placeholder",children:s===null?C("notes.thumbMissing"):"…"}),l.jsx("button",{className:"chip-remove",onClick:_,title:C("notes.removeImage"),children:"×"})]})}function bg(){const n=eo(),s=Nb(),[i,u]=j.useState(null),_=j.useCallback(()=>u(null),[]),R=j.useRef(null),x=g=>{Rb(g).catch(()=>{})},r=[{label:C("header.locale.auto",{name:Ec[Lb()]}),checked:s==="auto",onSelect:()=>x("auto")},...vu.map(g=>({label:Ec[g],lang:g,checked:s===g,onSelect:()=>x(g)}))],c=Ec[n];return l.jsxs(l.Fragment,{children:[l.jsx("button",{ref:R,className:"icon-button locale-button",onClick:g=>{const v=g.currentTarget.getBoundingClientRect();u(h=>h===null?{x:v.left,y:v.bottom+4}:null)},title:s==="auto"?C("header.locale.titleAuto",{name:c}):C("header.locale.title",{name:c}),"aria-haspopup":"menu","aria-expanded":i!==null,children:ty[n]}),i!==null&&l.jsx(au,{x:i.x,y:i.y,items:r,onClose:_,anchor:R.current})]})}function Fk({onKey:n}){return l.jsx("div",{className:"narrow-keys",role:"toolbar","aria-label":C("narrow.keys.label"),children:Yw.map(s=>l.jsx("button",{className:"narrow-key",onPointerDown:i=>i.preventDefault(),onClick:()=>n(s.data),title:C(s.titleKey),children:s.label},s.id))})}function Hk({banners:n,status:s,statusLabel:i,terminals:u,activeTerminalId:_,activity:R,agents:x,offerAgentChoice:r,newTabAgent:c,canOpen:g,newTabBlockedTitle:v,onSelectTab:h,onCloseTab:y,onRenameTab:S,onNewTab:E,drawer:f,drawerOpen:a,onDrawerChange:m,menu:p,view:d,views:k,onViewChange:I,badges:L,chat:M,panel:b,notes:T,console:N,onTerminalKey:O}){const[B,F]=j.useState(null),U=u.find(D=>D.terminalId===_)??null,V=D=>{var $;return(($=x.find(H=>H.id===D.agent))==null?void 0:$.statusLine)??null};j.useEffect(()=>{if(!a&&B===null)return;const D=$=>{$.key==="Escape"&&($.preventDefault(),$.stopPropagation(),B!==null?F(null):m(!1))};return window.addEventListener("keydown",D,!0),()=>window.removeEventListener("keydown",D,!0)},[a,B,m]);const X=j.useRef({sheet:B,drawerOpen:a,view:d,onDrawerChange:m,onViewChange:I});X.current={sheet:B,drawerOpen:a,view:d,onDrawerChange:m,onViewChange:I},j.useEffect(()=>{const D=window;return D[wf]=()=>{const $=X.current;switch(e1({dialogOpen:document.querySelector(".modal-backdrop")!==null,sheetOpen:$.sheet!==null,drawerOpen:$.drawerOpen,view:$.view})){case"close-dialog":return window.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),!0;case"close-sheet":return F(null),!0;case"close-drawer":return $.onDrawerChange(!1),!0;case"show-chat":return $.onViewChange("chat"),!0;case null:return!1}},()=>{delete D[wf]}},[]);const Y=j.useRef(null);j.useEffect(()=>{var D;(D=Y.current)==null||D.scrollIntoView({block:"nearest",inline:"nearest"})},[d]);const q=D=>{const $=D==="git"?L.changes:D==="plans"?L.plans:D==="memory"?L.memory:0;return $>0?l.jsx("span",{className:"side-panel-badge",children:$}):D==="cli"&&L.cliUnseen&&d!=="cli"?l.jsx("span",{className:"narrow-view-dot",title:C("panel.cliUnseen")}):null};return l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:"app-header narrow-header",children:[l.jsx("button",{className:"icon-button narrow-icon",onClick:()=>m(!0),title:C("narrow.projects"),"aria-label":C("narrow.projects"),children:"☰"}),l.jsxs("button",{className:"narrow-current",onClick:()=>F("tabs"),title:C("narrow.tabs.open"),children:[U===null?l.jsx("span",{className:"app-name",children:"Agent Workbench"}):l.jsxs(l.Fragment,{children:[l.jsx(Lu,{terminal:U,activity:R.get(U.terminalId),statusLine:V(U)}),l.jsx("span",{className:"project-swatch",style:{background:cr(U.cwd)}}),l.jsx("span",{className:"narrow-current-label",children:Xi(U)})]}),l.jsx("span",{className:"narrow-caret","aria-hidden":"true",children:"▾"})]}),s!=="open"&&l.jsx("span",{className:`status status-${s}`,children:i}),l.jsx("button",{className:"icon-button narrow-icon",onClick:()=>F("menu"),title:C("narrow.more"),"aria-label":C("narrow.more"),children:"⋮"})]}),n,l.jsxs("div",{className:"narrow-body",children:[l.jsx("nav",{className:"narrow-views",role:"tablist",children:k.map(D=>l.jsxs("button",{ref:D===d?Y:null,role:"tab","aria-selected":D===d,className:`narrow-view-tab${D===d?" narrow-view-active":""}`,onClick:()=>I(D),children:[l.jsx("span",{children:C(Vw(D))}),q(D)]},D))}),l.jsxs("div",{className:"narrow-stack",children:[l.jsx("main",{className:`workspace narrow-pane${d==="chat"?"":" narrow-pane-veiled"}`,children:M}),b,l.jsx("div",{className:`narrow-pane${d==="notes"?"":" narrow-pane-hidden"}`,children:T}),l.jsx("div",{className:`narrow-pane${d==="console"?"":" narrow-pane-hidden"}`,children:N})]}),O!==null&&l.jsx(Fk,{onKey:O})]}),a&&l.jsx("div",{className:"narrow-backdrop",onClick:()=>m(!1),children:l.jsx("div",{className:"narrow-drawer",onClick:D=>D.stopPropagation(),children:f})}),B==="tabs"&&l.jsx("div",{className:"narrow-backdrop",onClick:()=>F(null),children:l.jsxs("div",{className:"narrow-sheet",role:"dialog","aria-label":C("narrow.tabs.open"),onClick:D=>D.stopPropagation(),children:[l.jsx($k,{terminals:u,activeTerminalId:_,activity:R,statusLineOf:V,onSelect:D=>{h(D),F(null)},onClose:y,onRename:S}),l.jsx(Cu,{className:"narrow-sheet-new",text:C("narrow.tabs.new"),title:v??C("narrow.tabs.new"),disabled:!g||v!==null,offerAgentChoice:r,agents:x,agent:c,onOpen:D=>{E(D),F(null)}})]})}),B==="menu"&&l.jsx("div",{className:"narrow-backdrop",onClick:()=>F(null),children:l.jsx("div",{className:"narrow-sheet",role:"dialog","aria-label":C("narrow.more"),onClick:D=>D.stopPropagation(),children:l.jsx(Wk,{menu:p,status:s,statusLabel:i,onClose:()=>F(null)})})})]})}function $k({terminals:n,activeTerminalId:s,activity:i,statusLineOf:u,onSelect:_,onClose:R,onRename:x}){const[r,c]=j.useState(null),[g,v]=j.useState(""),h=j.useRef(null);j.useEffect(()=>{var S;r!==null&&((S=h.current)==null||S.select())},[r]);const y=()=>{r!==null&&x(r,g.trim()),c(null)};return n.length===0?l.jsx("p",{className:"narrow-sheet-empty",children:C("narrow.tabs.none")}):l.jsx("ul",{className:"narrow-tabs",children:n.map(S=>{const E=r===S.terminalId;return l.jsxs("li",{className:`narrow-tab-row${S.terminalId===s?" narrow-tab-active":""}`,style:{"--tab-project-color":cr(S.cwd)},children:[E?l.jsx("input",{ref:h,className:"narrow-tab-input",value:g,onChange:f=>v(f.target.value),onBlur:y,onKeyDown:f=>{f.key==="Enter"&&y(),f.key==="Escape"&&(f.stopPropagation(),c(null))}}):l.jsxs("button",{className:"narrow-tab-select",onClick:()=>_(S.terminalId),children:[l.jsx(Lu,{terminal:S,activity:i.get(S.terminalId),statusLine:u(S)}),l.jsx("span",{className:"narrow-tab-label",children:Xi(S)})]}),l.jsx("button",{className:"icon-button",onClick:()=>{c(S.terminalId),v(S.label.length>0?S.label:Xi(S))},title:C("narrow.tabs.rename"),children:"✎"}),l.jsx("button",{className:"icon-button",onClick:()=>R(S.terminalId),title:C("narrow.tabs.close"),children:"×"})]},S.terminalId)})})}function Uk({choice:n}){const s=[{source:"system",label:C("narrow.menu.chimeSystem")},{source:"page",label:C("narrow.menu.chimePage")}];return l.jsx("div",{className:"narrow-chime-choice",role:"group","aria-label":C("narrow.menu.sound"),children:s.map(({source:i,label:u})=>l.jsx("button",{className:`narrow-chime-option${n.source===i?" is-on":""}`,"aria-pressed":n.source===i,onClick:()=>n.setSource(i),children:u},i))})}function Wk({menu:n,status:s,statusLabel:i,onClose:u}){return l.jsxs("div",{className:"narrow-menu",children:[l.jsxs("div",{className:"narrow-menu-row",children:[l.jsx("span",{className:"narrow-menu-label",children:C("narrow.menu.connection")}),l.jsx("span",{className:`status status-${s}`,children:i}),Em(navigator.userAgent)&&l.jsxs(l.Fragment,{children:[l.jsx("a",{className:"link-button",href:Zw,onClick:u,children:C("narrow.menu.phoneAppDisconnect")}),l.jsx("a",{className:"link-button",href:Jw,onClick:u,children:C("narrow.menu.phoneAppSettings")})]})]}),n.cwd!==null&&l.jsxs("div",{className:"narrow-menu-row",children:[l.jsx("span",{className:"narrow-menu-label",children:C("narrow.menu.folder")}),l.jsx("span",{className:"narrow-menu-value",title:n.cwd,children:n.cwd})]}),n.cliVersion!==null&&l.jsxs("div",{className:"narrow-menu-row",children:[l.jsx("span",{className:"narrow-menu-label",children:C("narrow.menu.cli")}),l.jsx("span",{className:"narrow-menu-value",title:n.cliVersion,children:n.cliVersion})]}),n.remoteClient&&l.jsxs("div",{className:"narrow-menu-row",children:[l.jsx("span",{className:"narrow-menu-label",children:C("app.header.remoteBadge")}),l.jsx("span",{className:"narrow-menu-value narrow-menu-value-wrap",children:C("app.header.remoteBadgeTitle")})]}),l.jsxs("div",{className:"narrow-menu-row",children:[l.jsx("span",{className:"narrow-menu-label",children:C("narrow.menu.theme")}),l.jsx("button",{className:"icon-button",onClick:n.onCycleTheme,title:n.themeTitle,children:n.themeIcon})]}),l.jsxs("div",{className:"narrow-menu-row",children:[l.jsx("span",{className:"narrow-menu-label",children:C("narrow.menu.language")}),l.jsx(bg,{})]}),l.jsxs("div",{className:"narrow-menu-row",children:[l.jsx("span",{className:"narrow-menu-label",children:C("narrow.menu.sound")}),n.sound.phoneChime===null?l.jsx(_g,{sound:n.sound}):l.jsx(Uk,{choice:n.sound.phoneChime})]}),n.sound.notify.supported&&l.jsxs("div",{className:"narrow-menu-row",children:[l.jsx("span",{className:"narrow-menu-label",children:C("narrow.menu.notifications")}),l.jsx(vg,{notify:n.sound.notify})]}),n.remote!==null&&l.jsxs("div",{className:"narrow-menu-row",children:[l.jsx("span",{className:"narrow-menu-label",children:C("app.header.remoteAccess")}),l.jsx("button",{className:`icon-button${n.remote.active?" icon-button-on":""}`,onClick:()=>{var _;u(),(_=n.remote)==null||_.onOpen()},title:n.remote.title,children:"⇄"})]}),l.jsxs("div",{className:"narrow-menu-row",children:[l.jsx("span",{className:"narrow-menu-label",children:C("narrow.menu.shortcuts")}),l.jsx("button",{className:"icon-button",onClick:()=>{u(),n.onShortcuts()},title:C("app.header.shortcuts"),children:"?"})]}),l.jsxs("div",{className:"narrow-menu-row",children:[l.jsx("span",{className:"narrow-menu-label",children:C("settings.title")}),l.jsx("button",{className:"icon-button",onClick:()=>{u(),n.onSettings()},title:C("settings.open"),"aria-label":C("settings.open"),children:"⚙"})]})]})}function zk(){const n=window.location.search,s=new URLSearchParams(n).get(Yc),i=s!==null&&s.length>0?s:null,u=Kw(n);return i===null&&u===null?{token:i,tab:u}:(window.history.replaceState(null,"",`${window.location.pathname}${Gw(n,[Yc,xm])}`),{token:i,tab:u})}const Sg=zk(),bp=Sg.token,Vk=Sg.tab,Kc=new Set;function qk(n){const[s,i]=j.useState(null),[u,_]=j.useState(null),[R,x]=j.useState(Kc),[r,c]=j.useState(null);j.useEffect(()=>{const a=n.onMessage(p=>{switch(p.type){case"vault.status":i(p.status);break;case"vault.exported":x(d=>{if(!d.has(p.projectKey))return d;const k=new Set(d);return k.delete(p.projectKey),k}),c({projectKey:p.projectKey,sessions:p.sessions,at:Date.now()});break;case"error":if(p.code!=="vault-failed")break;_(Dt(p.text)),p.detail!==void 0&&console.error("[servidor]",p.detail),x(Kc);break}}),m=n.onReopen(()=>x(Kc));return()=>{a(),m()}},[n]);const g=j.useCallback(()=>{_(null),n.send({type:"vault.measure"})},[n]),v=j.useCallback(a=>{_(null),n.send({type:"vault.enable",enabled:a})},[n]),h=j.useCallback(a=>{_(null),n.send({type:"vault.setDir",pickerId:a})},[n]),y=j.useCallback(a=>{_(null),x(m=>new Set(m).add(a)),n.send({type:"vault.exportProject",projectKey:a})},[n]),S=j.useCallback((a,m)=>{_(null),n.send({type:"vault.openSession",agent:a,sessionId:m})},[n]),E=j.useCallback(()=>{_(null),n.send({type:"vault.reveal"})},[n]),f=j.useCallback(()=>_(null),[]);return{status:s,problem:u,exporting:R,lastExported:r,measure:g,setEnabled:v,chooseDir:h,exportProject:y,openSession:S,reveal:E,dismissProblem:f}}function Kk(n){return C("summary.outdatedServer",{server:n,page:Kr})}function Gk(n){const[s,...i]=n;if(s===void 0||s.missingMessage===null)return null;const u=Dt(s.missingMessage);return i.length===0?u:`${u}
139
- ${C("summary.alsoWorksWith",{names:i.map(_=>_.label).join(", ")})}`}function Yk(n){const s=n.version??"?";return s.toLowerCase().includes(n.label.toLowerCase())?s:`${n.label} ${s}`}function Xk(n,s,i=Kr){var x,r;if(s&&i<Kr)return{cliAvailable:!1,cliVersion:null,cliMissingMessage:Kk(i),environmentNotice:null};if(s&&i>Kr)return{cliAvailable:!1,cliVersion:null,cliMissingMessage:C("summary.newerServer",{server:i,page:Kr}),environmentNotice:null};const u=n.filter(c=>c.available);let _=null;u.length===1?_=((x=u[0])==null?void 0:x.version)??null:u.length>1&&(_=u.map(Yk).join(" · "));const R=s&&u.length===0;return{cliAvailable:!s||u.length>0,cliVersion:_,cliMissingMessage:R?Gk(n):null,environmentNotice:((r=n.find(c=>c.environmentNotice!==null))==null?void 0:r.environmentNotice)??null}}const Qk=500,Jk=8e3;class Zk{constructor(){Mt(this,"socket",null);Mt(this,"status","connecting");Mt(this,"attempt",0);Mt(this,"closedByUs",!1);Mt(this,"hasConnectedOnce",!1);Mt(this,"reconnectTimer");Mt(this,"messageHandlers",new Set);Mt(this,"statusHandlers",new Set);Mt(this,"reopenHandlers",new Set);Mt(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(P0,window.location.href);s.protocol=window.location.protocol==="https:"?"wss:":"ws:",bp!==null&&s.searchParams.set(Yc,bp);const i=new WebSocket(s);this.socket=i,i.onopen=()=>{for(this.attempt=0,this.setStatus("open");this.outbox.length>0;){const u=this.outbox.shift();u!==void 0&&i.send(rf(u))}if(this.hasConnectedOnce)for(const u of this.reopenHandlers)u();this.hasConnectedOnce=!0},i.onmessage=u=>{const _=U0(u.data);if(_===null){console.warn("[conexion] mensaje del servidor no reconocido");return}for(const R of this.messageHandlers)R(_)},i.onclose=u=>{if(this.socket=null,!this.closedByUs){if(u.code===k0){this.setStatus("revoked");return}this.setStatus("reconnecting"),this.scheduleReconnect()}},i.onerror=()=>{}}send(s){return this.socket!==null&&this.socket.readyState===WebSocket.OPEN?(this.socket.send(rf(s)),!0):(s.type!=="input"&&s.type!=="resize"&&this.outbox.push(s),!1)}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 i of this.statusHandlers)i(s)}}scheduleReconnect(){if(this.attempt+=1,!this.hasConnectedOnce&&this.attempt>4){this.setStatus("failed");return}const s=Math.min(Qk*2**(this.attempt-1),Jk);window.clearTimeout(this.reconnectTimer),this.reconnectTimer=window.setTimeout(()=>this.connect(),s)}}const pu="agent-workbench.activeTab";function eE(){try{return window.sessionStorage.getItem(pu)}catch{return null}}const tE={state:"idle",scannedFiles:0,totalFiles:0};function nE(n,s,i){const u=new Map(i?[]:n.map(_=>[_.key,_]));for(const _ of s)u.set(_.key,_);return[...u.values()].sort((_,R)=>R.lastActivityAt-_.lastActivityAt)}function sE(){const n=j.useMemo(()=>new Zk,[]),s=j.useMemo(()=>new Iw({send:(ke,Ke)=>n.send({type:"composer.draft",terminalId:ke,draft:Ke}),connected:()=>n.getStatus()==="open",setTimer:(ke,Ke)=>window.setTimeout(ke,Ke),clearTimer:ke=>window.clearTimeout(ke),newId:()=>crypto.randomUUID()}),[n]),[i,u]=j.useState("connecting"),[_,R]=j.useState([]),[x,r]=j.useState(null),[c,g]=j.useState(!1),[v,h]=j.useState(Kr),[y,S]=j.useState(""),[E,f]=j.useState(""),[a,m]=j.useState(null),[p,d]=j.useState(!1),[k,I]=j.useState([]),[L,M]=j.useState([]),[b,T]=j.useState(tE),[N,O]=j.useState(eE);j.useEffect(()=>{try{N===null?window.sessionStorage.removeItem(pu):window.sessionStorage.setItem(pu,N)}catch{}},[N]);const[B,F]=j.useState(new Set),[U,V]=j.useState(new Map),[X,Y]=j.useState(new Map),q=j.useRef(new Map),D=j.useRef(new Map),[$,H]=j.useState(new Set),[K,te]=j.useState(null),[re,ae]=j.useState([]),[ue,G]=j.useState(new Map),[W,J]=j.useState([]),Z=j.useRef(1),de=j.useRef(new Set),fe=j.useRef(new Map),se=j.useRef(new Map),Ee=j.useCallback(ke=>{const Ke=se.current.get(ke);Ke!==void 0&&(clearTimeout(Ke),se.current.delete(ke)),ae(he=>he.some(me=>me.requestId===ke)?he.filter(me=>me.requestId!==ke):he)},[]),Me=j.useCallback(()=>{for(const ke of se.current.values())clearTimeout(ke);se.current.clear(),ae(ke=>ke.length===0?ke:[])},[]);j.useEffect(()=>{const ke=n.onStatus(me=>{u(me),me==="failed"&&te({message:C("workspace.connectFailed"),at:Date.now()})}),Ke=n.onMessage(me=>{switch(me.type){case"agents":R(me.agents),r(me.defaultAgent);break;case"hello":R(me.agents),r(me.defaultAgent),g(!0),h(me.protocolVersion),S(me.platform),f(me.defaultCwd),m(me.shellName),d(me.remoteClient);break;case"terminal.list":{I(me.terminals),s.retain(me.terminals.map(qe=>qe.terminalId));const Ae=aw(D.current,me.terminals),pt=Ae.finished.length>0||[...Ae.phases].some(([qe,ct])=>D.current.get(qe)!==ct);D.current=Ae.phases,pt&&H(new Set(Ae.phases.keys())),F(qe=>{if(qe.size===0)return qe;const ct=new Set(qe);for(const At of qe){if(Ae.phases.has(At))continue;const Tt=me.terminals.find(Cn=>Cn.terminalId===At);(Tt===void 0||Tt.alive)&&ct.delete(At)}return ct.size===qe.size?qe:ct}),Y(qe=>{if(qe.size===0)return qe;const ct=new Map([...qe].filter(([At])=>me.terminals.some(Tt=>Tt.terminalId===At)));return ct.size===qe.size?qe:(q.current=ct,ct)});const Ne=me.terminals.filter(qe=>qe.kind==="agent");O(qe=>{var ct;return qe!==null&&Ne.some(At=>At.terminalId===qe)?qe:((ct=Ne[0])==null?void 0:ct.terminalId)??null}),G(qe=>{if(qe.size===0)return qe;const ct=new Map(qe);for(const At of qe.keys())me.terminals.some(Tt=>Tt.terminalId===At)||ct.delete(At);return ct.size===qe.size?qe:ct});break}case"session.continued":G(Ae=>new Map(Ae).set(me.terminalId,{sourceAgent:me.source.agent,includedTurns:me.includedTurns,totalTurns:me.totalTurns,totalTurnsIsMinimum:me.totalTurnsIsMinimum,delivery:me.delivery,prefillReason:null}));break;case"composer.prefill":{const Ae=Z.current;Z.current+=1,J(pt=>[...pt,{id:Ae,terminalId:me.terminalId,text:me.text}]),G(pt=>{const Ne=pt.get(me.terminalId);return Ne===void 0?pt:new Map(pt).set(me.terminalId,{...Ne,delivery:"prefilled",prefillReason:me.reason})});break}case"composer.drafts":s.restore(me.drafts);break;case"terminal.opened":{Ee(me.requestId),de.current.delete(me.requestId)&&me.terminal.kind==="agent"&&O(me.terminal.terminalId);const Ae=fe.current.get(me.requestId);Ae!==void 0&&(fe.current.delete(me.requestId),Ae(me.terminal));break}case"terminal.activity":V(Ae=>Ae.get(me.terminalId)===me.activity?Ae:new Map(Ae).set(me.terminalId,me.activity)),Y(Ae=>{const pt=me.offlineReason??null;if((Ae.get(me.terminalId)??null)===pt)return Ae;const Ne=new Map(Ae);return pt===null?Ne.delete(me.terminalId):Ne.set(me.terminalId,pt),q.current=Ne,Ne});break;case"index.status":T(me.status);break;case"index.projects":M(Ae=>nE(Ae,me.projects,me.replace));break;case"error":if(Sx(me.requestId)){me.detail!==void 0&&console.error("[servidor]",me.detail);break}if(me.code==="vault-failed"||me.code==="search-failed"||me.code==="remote-failed"||me.code==="settings-failed")break;te({message:Dt(me.text),at:Date.now()}),F(Ae=>Ae.size===0?Ae:new Set),D.current.size>0&&(D.current=new Map,H(new Set)),me.detail!==void 0&&console.error("[servidor]",me.detail),me.requestId!==void 0&&(de.current.delete(me.requestId),fe.current.delete(me.requestId),Ee(me.requestId));break}}),he=n.onReopen(()=>{Me(),F(me=>me.size===0?me:new Set),D.current.size>0&&(D.current=new Map,H(new Set))});return n.connect(),()=>{ke(),Ke(),he(),n.close()}},[n,s,Ee,Me]),j.useEffect(()=>{const ke=n.onReopen(()=>s.reconnected()),Ke=()=>s.flushAll(),he=()=>{document.visibilityState==="hidden"&&s.flushAll()};return window.addEventListener("pagehide",Ke),document.addEventListener("visibilitychange",he),()=>{ke(),window.removeEventListener("pagehide",Ke),document.removeEventListener("visibilitychange",he)}},[n,s]),j.useEffect(()=>Me,[Me]);const Qe=j.useCallback(ke=>{const Ke=crypto.randomUUID();de.current.add(Ke),ke.onOpened!==void 0&&fe.current.set(Ke,ke.onOpened),ae(me=>[...me,{requestId:Ke,cwd:ke.cwd,agent:ke.agent??null,label:ke.label??"",at:Date.now()}]);const he=setTimeout(()=>Ee(Ke),uw);se.current.set(Ke,he),n.send({type:"terminal.open",requestId:Ke,cwd:ke.cwd,...ke.resumeSessionId!==void 0?{resumeSessionId:ke.resumeSessionId}:{},...ke.label!==void 0?{label:ke.label}:{},...ke.agent!==void 0?{agent:ke.agent}:{}})},[n,Ee]),Le=j.useCallback(ke=>{n.send({type:"terminal.open",requestId:crypto.randomUUID(),cwd:ke,kind:"shell"})},[n]),pe=j.useCallback(ke=>n.send({type:"terminal.close",terminalId:ke}),[n]),Re=j.useCallback(ke=>{F(Ke=>new Set(Ke).add(ke)),q.current.get(ke)==="server-closed"&&(D.current=new Map(D.current).set(ke,"waiting-exit"),H(new Set(D.current.keys()))),n.send({type:"terminal.wake",terminalId:ke})},[n]),Ce=j.useCallback((ke,Ke)=>n.send({type:"terminal.rename",terminalId:ke,label:Ke}),[n]),Te=j.useCallback(ke=>n.send({type:"tabs.reorder",terminalIds:ke}),[n]),Pe=j.useCallback((ke,Ke)=>n.send({type:"session.archive",sessionIds:ke,archived:Ke}),[n]),xe=j.useCallback((ke,Ke,he)=>{const me=crypto.randomUUID();de.current.add(me),n.send({type:"session.continue",requestId:me,agent:ke.agent,sessionId:ke.sessionId,target:Ke,label:he})},[n]),Ie=j.useCallback(ke=>{G(Ke=>{if(!Ke.has(ke))return Ke;const he=new Map(Ke);return he.delete(ke),he})},[]),et=j.useCallback(ke=>{J(Ke=>Ke.some(he=>he.id===ke)?Ke.filter(he=>he.id!==ke):Ke)},[]),ot=j.useCallback(()=>n.send({type:"index.refresh"}),[n]),Ze=j.useCallback(()=>n.send({type:"agents.refresh"}),[n]),ht=j.useCallback(()=>te(null),[]),tt=j.useMemo(()=>k.filter(ke=>ke.kind==="agent"),[k]),He=j.useMemo(()=>k.filter(ke=>ke.kind==="shell"),[k]),nt=eo(),Ve=j.useMemo(()=>Xk(_,c,v),[_,c,v,nt]),at=j.useCallback(ke=>{var Ke;return(ke===null||(Ke=_.find(he=>he.id===ke))==null?void 0:Ke.capabilities)??Bp},[_]),st=j.useMemo(()=>gu(_),[_]);return{connection:n,status:i,agents:_,defaultAgent:x,capabilitiesFor:at,offerAgentChoice:st,cliAvailable:Ve.cliAvailable,cliVersion:Ve.cliVersion,cliMissingMessage:Ve.cliMissingMessage,platform:y,defaultCwd:E,environmentNotice:Ve.environmentNotice,shellName:a,remoteClient:p,terminals:tt,shells:He,pendingOpens:re,activeTerminalId:N,projects:L,indexStatus:b,error:K,dismissError:ht,setActiveTerminal:O,openTerminal:Qe,openShell:Le,closeTerminal:pe,wakeTerminal:Re,waking:B,activity:U,offlineReasons:X,relaunching:$,renameTerminal:Ce,reorderTabs:Te,refreshIndex:ot,refreshAgents:Ze,archiveSessions:Pe,continueSession:xe,handoffs:ue,dismissHandoff:Ie,prefills:W,prefillApplied:et,drafts:s}}const Tu=["git","files","plans","memory","console","notes"],Sp="agent-workbench.hiddenPanels";function rE(n){return Tu.includes(n)}const iE=new Set(["memory"]),oE="none";function lE(n){return new Set(n.split(",").map(s=>s.trim()).filter(rE))}function aE(n){const s=Tu.filter(i=>n.has(i));return s.length===0?oE:s.join(",")}function cE(n,s,i){const u=new Set(n);return i?u.delete(s):u.add(s),u}function uE(){const[n,s]=j.useState(()=>yt(Sp,iE,lE)),i=j.useCallback((_,R)=>{s(x=>{const r=cE(x,_,R);return mt(Sp,aE(r)),r})},[]),u=j.useCallback(_=>!n.has(_),[n]);return{hidden:n,isVisible:u,setVisible:i}}const hE={git:"panel.tab.git",files:"panel.tab.files",plans:"panel.tab.plans",memory:"panel.tab.memory",console:"console.name",notes:"notes.name"},dE={dark:"settings.terminalTheme.dark",follow:"settings.terminalTheme.follow"};function fE(n,s,i){const u=n.filter(_=>_!==s);return i?[...u,s]:u}function pE(n,s){return n.length===s.length&&n.every(i=>s.includes(i))}function mE({onClose:n,terminalTheme:s,panels:i,consoleCount:u,onHideConsole:_,appSettings:R,agents:x,remoteClient:r,onOpenVault:c,onOpenRemote:g}){const[v,h]=j.useState(!1),y=R.status,S=y!==null&&!r,[E,f]=j.useState(null),[a,m]=j.useState(null);j.useEffect(()=>{f(null),m(null)},[y,R.problem]);const p=E??(y==null?void 0:y.consoleShell)??"auto",d=a??(y==null?void 0:y.disabledAgents)??[];j.useEffect(()=>{const b=T=>{T.key==="Escape"&&(T.preventDefault(),T.stopPropagation(),n())};return window.addEventListener("keydown",b,!0),()=>window.removeEventListener("keydown",b,!0)},[n]);const k=(b,T)=>{if(b==="console"&&!T&&u>0){h(!0);return}i.setVisible(b,T)},I=(y==null?void 0:y.consoleShells.find(b=>b.id!=="git-bash"&&b.id!=="zsh"))??null,L=y!==null&&!pE(y.disabledAgents,y.disabledAtStart),M=y===null?[]:[{id:"auto",label:I===null?C("settings.console.auto"):C("settings.console.autoWith",{shell:I.label})},...y.consoleShells];return l.jsx("div",{className:"modal-backdrop",onClick:n,children:l.jsxs("div",{className:"modal settings-dialog",role:"dialog","aria-label":C("settings.title"),onClick:b=>b.stopPropagation(),children:[l.jsxs("header",{className:"modal-header",children:[l.jsx("span",{className:"modal-title",children:C("settings.title")}),l.jsx("button",{className:"icon-button",onClick:n,title:C("common.closeEsc"),children:"×"})]}),l.jsxs("div",{className:"modal-body settings-body",children:[l.jsx("h3",{className:"modal-section",children:C("settings.section.appearance")}),l.jsxs("div",{className:"settings-row",children:[l.jsx("span",{className:"settings-label",children:C("settings.language")}),l.jsx(bg,{})]}),l.jsxs("div",{className:"settings-row settings-row-top",children:[l.jsx("span",{className:"settings-label",children:C("settings.terminalTheme")}),l.jsxs("div",{className:"settings-choices",role:"radiogroup","aria-label":C("settings.terminalTheme"),children:[["dark","follow"].map(b=>l.jsxs("label",{className:"settings-choice",children:[l.jsx("input",{type:"radio",name:"terminal-theme",checked:s.preference===b,onChange:()=>s.setPreference(b)}),C(dE[b])]},b)),l.jsx("p",{className:"modal-hint",children:C("settings.terminalTheme.hint")})]})]}),l.jsx("h3",{className:"modal-section",children:C("settings.section.panels")}),l.jsx("div",{className:"settings-panels",children:Tu.map(b=>l.jsxs("label",{className:"settings-choice",children:[l.jsx("input",{type:"checkbox",checked:i.isVisible(b),onChange:T=>k(b,T.target.checked)}),C(hE[b])]},b))}),v&&l.jsxs("div",{className:"settings-confirm",role:"alert",children:[l.jsx("span",{children:C("settings.panels.consoleConfirm",{count:u})}),l.jsx("button",{className:"link-button",onClick:()=>{h(!1),_()},children:C("settings.panels.consoleConfirmYes")}),l.jsx("button",{className:"link-button",onClick:()=>h(!1),children:C("common.cancel")})]}),l.jsx("p",{className:"modal-hint",children:C("settings.panels.cliAlways")}),y===null?l.jsx("p",{className:"modal-hint",children:C("settings.oldServer")}):l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"modal-section",children:C("settings.section.console")}),y.consoleShells.length===0?l.jsx("p",{className:"modal-hint",children:C("console.noShell")}):l.jsxs("div",{className:"settings-choices",role:"radiogroup","aria-label":C("settings.section.console"),children:[M.map(b=>l.jsxs("label",{className:"settings-choice",children:[l.jsx("input",{type:"radio",name:"console-shell",checked:p===b.id,disabled:!S,onChange:()=>{f(b.id),R.setConsoleShell(b.id)}}),b.label]},b.id)),l.jsx("p",{className:"modal-hint",children:C("settings.console.hint")})]}),l.jsx("h3",{className:"modal-section",children:C("settings.section.clis")}),l.jsx("ul",{className:"settings-clis",children:x.map(b=>{const T=d.includes(b.id),N=y.disabledAtStart.includes(b.id),O=b.available||N;return l.jsxs("li",{className:"settings-cli",children:[O?l.jsxs("label",{className:"settings-choice",children:[l.jsx("input",{type:"checkbox",checked:!T,disabled:!S,onChange:B=>{const F=fE(d,b.id,!B.target.checked);m(F),R.setDisabledAgents(F)}}),l.jsx("span",{className:"settings-cli-name",children:b.label})]}):l.jsx("span",{className:"settings-cli-name settings-cli-missing",children:b.label}),l.jsx("span",{className:"settings-cli-detail",children:b.available?b.version??"":C(N?"settings.cli.disabled":"settings.cli.notInstalled")}),!O&&l.jsx("a",{className:"link-button",href:b.installUrl,target:"_blank",rel:"noreferrer noopener",children:C("settings.cli.install")})]},b.id)})}),l.jsx("p",{className:"modal-hint",children:C("settings.cli.hint")}),L&&l.jsx("p",{className:"settings-restart",children:C("settings.cli.restart")}),r&&l.jsx("p",{className:"modal-hint",children:C("settings.hostOnly")}),R.problem!==null&&l.jsxs("p",{className:"settings-problem",role:"alert",children:[R.problem,l.jsx("button",{className:"link-button",onClick:R.dismissProblem,children:C("common.close")})]})]}),(c!==null||g!==null)&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"modal-section",children:C("settings.section.more")}),l.jsxs("div",{className:"settings-row settings-more",children:[c!==null&&l.jsx("button",{className:"primary-button primary-button-small",onClick:c,children:C("settings.more.open",{name:ei()})}),g!==null&&l.jsx("button",{className:"primary-button primary-button-small",onClick:g,children:C("settings.more.open",{name:C("app.header.remoteAccess")})})]})]})]})]})})}function gE(n){const[s,i]=j.useState(null),[u,_]=j.useState(null);j.useEffect(()=>n.onMessage(c=>{switch(c.type){case"settings.status":i(c.settings),_(null);break;case"error":if(c.code!=="settings-failed")break;_(Dt(c.text)),c.detail!==void 0&&console.error("[servidor]",c.detail);break}}),[n]);const R=j.useCallback(c=>n.send({type:"settings.update",consoleShell:c}),[n]),x=j.useCallback(c=>n.send({type:"settings.update",disabledAgents:c}),[n]),r=j.useCallback(()=>_(null),[]);return{status:s,problem:u,setConsoleShell:R,setDisabledAgents:x,dismissProblem:r}}function _E({status:n,agents:s,indexReady:i,problem:u,covered:_,onMeasure:R,onSetEnabled:x,onChangeDir:r,onReveal:c,onDismissProblem:g,onClose:v}){return j.useEffect(()=>{if(_)return;const h=y=>{y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),v())};return window.addEventListener("keydown",h,!0),()=>window.removeEventListener("keydown",h,!0)},[_,v]),l.jsx("div",{className:"modal-backdrop",onClick:v,children:l.jsxs("div",{className:"modal vault-modal",role:"dialog","aria-label":ei(),onClick:h=>h.stopPropagation(),children:[l.jsxs("header",{className:"modal-header",children:[l.jsx("span",{className:"modal-title",children:ei()}),n!==null&&l.jsx("span",{className:`vault-state${n.enabled?" vault-state-on":""}`,children:GS(n)}),l.jsx("button",{className:"icon-button",onClick:v,title:C("common.closeEsc"),children:"×"})]}),l.jsxs("div",{className:"modal-body",children:[l.jsx("p",{className:"vault-lead",children:WS()}),l.jsx("p",{className:"modal-hint",children:zS()}),n===null?l.jsx("p",{className:"modal-hint",children:C("vault.dialog.waiting")}):l.jsx(vE,{status:n,agents:s,indexReady:i,onMeasure:R,onSetEnabled:x,onChangeDir:r,onReveal:c}),u!==null&&l.jsxs("div",{className:"vault-problem",role:"alert",children:[l.jsx("span",{children:u}),l.jsx("button",{className:"icon-button",onClick:g,title:C("common.dismissNotice"),children:"×"})]})]})]})})}function vE({status:n,agents:s,indexReady:i,onMeasure:u,onSetEnabled:_,onChangeDir:R,onReveal:x}){const r=JS(n,i),c=ZS(n),g=QS(n),v=n.measurement===null?null:nC(n.measurement,s),h=n.progress;return l.jsxs(l.Fragment,{children:[n.enabled&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"modal-section",children:C("vault.dialog.inFolder")}),l.jsxs("p",{className:"vault-summary",children:[rg(n.sessions)," · ",hn(n.bytes),n.lastPassAt!==null&&l.jsxs(l.Fragment,{children:[" · ",C("vault.dialog.lastPass",{when:Kn(n.lastPassAt)})]}),n.pending>0&&l.jsxs(l.Fragment,{children:[" · ",C("vault.dialog.pendingCalm",{count:n.pending})]})]})]}),h!==null&&h.total>0&&l.jsx("progress",{className:"vault-progress",value:h.done,max:h.total}),l.jsx("h3",{className:"modal-section",children:C("vault.dialog.sizeSection")}),l.jsxs("div",{className:"vault-actions",children:[l.jsx("button",{className:"link-button vault-measure",onClick:u,disabled:r!==null,title:r??C("vault.dialog.measureTitle"),children:n.state==="measuring"?C("vault.state.measuring"):C(v===null?"vault.dialog.measure":"vault.dialog.measureAgain")}),v!==null&&l.jsx("span",{className:"modal-hint",children:v.summary})]}),v!==null&&l.jsx("div",{className:"vault-table-wrap",children:l.jsxs("table",{className:"vault-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"CLI"}),l.jsx("th",{children:C("vault.dialog.table.sessions")}),l.jsx("th",{children:C("vault.dialog.table.size")}),l.jsx("th",{children:C("vault.dialog.table.images")}),l.jsx("th",{title:C("vault.dialog.table.archivedTitle"),children:C("vault.dialog.table.archived")})]})}),l.jsxs("tbody",{children:[v.rows.map(y=>l.jsxs("tr",{children:[l.jsxs("td",{children:[y.label,y.note!==null&&l.jsx("span",{className:"vault-table-note",children:y.note})]}),l.jsx("td",{children:y.sessions}),l.jsx("td",{children:hn(y.bytes)}),l.jsx("td",{title:y.images>0?hn(y.imageBytes):void 0,children:y.images}),l.jsx("td",{children:y.skippedArchived})]},y.agent)),l.jsxs("tr",{children:[l.jsx("td",{children:C("vault.dialog.table.memory",{count:v.memoryProjects})}),l.jsx("td",{}),l.jsx("td",{children:hn(v.memoryBytes)}),l.jsx("td",{}),l.jsx("td",{})]})]}),l.jsx("tfoot",{children:l.jsxs("tr",{children:[l.jsx("td",{children:C("vault.dialog.table.total")}),l.jsx("td",{children:v.total.sessions}),l.jsx("td",{children:hn(v.total.bytes)}),l.jsx("td",{children:v.total.images}),l.jsx("td",{children:v.total.skippedArchived})]})})]})}),l.jsxs("div",{className:"vault-actions vault-switch",children:[g==="enabled"&&l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"link-button",onClick:()=>_(!1),children:C("vault.dialog.turnOff")}),l.jsx("span",{className:"modal-hint",children:C("vault.dialog.turnOffHint")})]}),(g==="measured"||g==="existing")&&l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"primary-button",onClick:()=>_(!0),title:C(g==="existing"?"vault.dialog.activateExistingTitle":"vault.dialog.activateMeasuredTitle"),children:C("vault.dialog.activate")}),l.jsx("span",{className:"modal-hint",children:C(g==="existing"?"vault.dialog.activateExistingHint":"vault.dialog.activateMeasuredHint")})]}),g==="needs-measure"&&l.jsx("span",{className:"modal-hint",children:C("vault.dialog.needsMeasure",{activate:C("vault.dialog.activate")})})]}),l.jsx("h3",{className:"modal-section",children:C("vault.dialog.folderSection")}),l.jsx("p",{className:"vault-dir",title:n.dir,children:n.dir}),n.isDefaultDir&&l.jsx("p",{className:"modal-hint",children:C("vault.dialog.defaultDir")}),l.jsxs("div",{className:"vault-actions",children:[l.jsx("button",{className:"link-button",onClick:R,disabled:c!==null,title:c??C("vault.dialog.changeDirTitle"),children:C("vault.dialog.changeDir")}),x!==null&&l.jsx("button",{className:"link-button",onClick:x,title:C("vault.dialog.openFolderTitle"),children:C("vault.dialog.openFolder")})]}),n.previousDir!==null&&l.jsx("p",{className:"modal-hint",children:eC(n.previousDir)}),n.lastError!==null&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"modal-section",children:C("vault.dialog.lastError")}),l.jsx("p",{className:"vault-error",children:Dt(n.lastError)})]})]})}const Cp={connecting:"app.status.connecting",open:"app.status.open",reconnecting:"app.status.reconnecting",failed:"app.status.failed",revoked:"app.status.revoked"},xp=320,yE=1400,wE=640,kp=200,Ep=560,bE=270,SE=120,CE=720,xE=260,Lp="agent-workbench.panel-width",Tp="agent-workbench.panel-visible",Rp="agent-workbench.panel-tab",Gc="agent-workbench.panel-expanded",Mp="agent-workbench.sidebar-visible",Ap="agent-workbench.sidebar-width",Np="agent-workbench.console-visible",Dp="agent-workbench.console-height",Ip="agent-workbench.marker-notice-dismissed",jp="agent-workbench.hidden-hint-shown";function kE(){var gi,xo;const n=eo(),s=sE(),{connection:i,status:u,agents:_,defaultAgent:R,capabilitiesFor:x,offerAgentChoice:r,cliAvailable:c,cliVersion:g,cliMissingMessage:v,platform:h,defaultCwd:y,environmentNotice:S,shellName:E,terminals:f,archiveSessions:a,shells:m,pendingOpens:p,activeTerminalId:d,projects:k,indexStatus:I,error:L,dismissError:M,setActiveTerminal:b,openTerminal:T,openShell:N,closeTerminal:O,wakeTerminal:B,waking:F,activity:U,offlineReasons:V,relaunching:X,renameTerminal:Y,reorderTabs:q,refreshIndex:D,refreshAgents:$,continueSession:H,handoffs:K,dismissHandoff:te,prefills:re,prefillApplied:ae,drafts:ue,remoteClient:G}=s,W=Mx(),J=Dx(W.resolved),Z=j.useMemo(()=>({nameOf:ie=>Qx(f.find(ye=>ye.terminalId===ie)),activate:b}),[f,b]),de=tk(U,Z),fe=nk(),se=f.find(ie=>ie.terminalId===d)??null,Ee=j.useCallback(ie=>{ie!==d&&M(),b(ie)},[d,M,b]),Me=(se==null?void 0:se.agent)??null,Qe=x(Me),Le=j.useMemo(()=>gy(Qe),[Qe]),pe=_.find(ie=>ie.id===Me)??null,Re=j.useMemo(()=>{if(se===null||Me===null)return null;for(const ie of k){const ye=ie.sessions.find(it=>it.agent===Me&&it.sessionId===se.sessionId);if(ye!==void 0)return qn(ye.title,ye.titleSource)}return null},[se,Me,k,n]),Ce=j.useMemo(()=>dy(f,k.flatMap(ie=>ie.sessions)),[f,k]),Te=(pe==null?void 0:pe.statusLine)??null,Pe=(se==null?void 0:se.cwd)??y,xe=j.useMemo(()=>r?$y(f,Pe,h,_,R):null,[r,f,Pe,h,_,R]),Ie=j.useMemo(()=>pf(p,Pe,h),[p,Pe,h]),et=Ie?gm():null,ot=Ex(i),Ze=qk(i),[ht,tt]=j.useState(!1),He=lk(i),[nt,Ve]=j.useState(!1),at=v1(),st=uE(),[ke,Ke]=j.useState(!1),he=j.useCallback(()=>Ke(!1),[]),[me,Ae]=j.useState(()=>yt(vf,"chat",$w)),pt=j.useMemo(()=>Uw({hasTab:se!==null,plansAvailable:Le.plansAvailable,hidden:st.hidden}),[se,Le.plansAvailable,st.hidden]),Ne=Ww(me,pt),qe=j.useCallback(ie=>{Ae(ie),mt(vf,ie)},[]),ct=j.useRef(Vk);j.useEffect(()=>{if(ct.current!==null)return i.onMessage(ie=>{if(ie.type!=="terminal.list"||ct.current===null)return;const ye=ct.current;ct.current=null,ie.terminals.some(it=>it.terminalId===ye&&it.kind==="agent")&&b(ye)})},[i,b]);const At=rx(i),Tt=hS(_,Ze.status),[Cn,Yn]=j.useState(null),dn=j.useRef(0),ur=j.useCallback(ie=>{Yn(ye=>ye!==null&&ye.seq===ie?null:ye)},[]),Xn=(ie,ye)=>{const it=kS(ie,{projects:k,terminals:f,platform:h,canResume:rs=>uf(_,rs)}),gn=()=>{ye.length!==0&&(dn.current+=1,Yn({query:ye,seq:dn.current}))};switch(it.kind){case"activate":Ee(it.terminalId),gn();break;case"resume":it.session.archived&&a([it.session.sessionId],!1),T({cwd:it.cwd,resumeSessionId:it.session.sessionId,agent:it.session.agent,label:qn(it.session.title,it.session.titleSource)}),gn();break;case"copy":Ze.openSession(ie.agent,ie.sessionId);break}},fs=j.useMemo(()=>new Set(f.map(ie=>ie.sessionId).filter(ie=>ie.length>0)),[f]),[Jt,$s]=j.useState(()=>yt(Tp,!0,ie=>ie==="true")),[ge,Ue]=j.useState(()=>yt(Rp,"cli",ie=>ie==="git"||ie==="files"||ie==="cli"||ie==="plans"||ie==="memory"?ie:ie==="conversation"?"cli":null)),[rt,_t]=j.useState(()=>yt(Lp,wE,ie=>{const ye=Number.parseInt(ie,10);return Number.isFinite(ye)?Math.max(ye,xp):null})),[xt,xn]=j.useState(()=>yt(Gc,!1,ie=>ie==="true")),[ps,Qn]=j.useState(()=>yt(Mp,!0,ie=>ie==="true")),[si,no]=j.useState(()=>yt(Ap,bE,ie=>{const ye=Number.parseInt(ie,10);return Number.isFinite(ye)?Math.min(Ep,Math.max(kp,ye)):null})),[$l,so]=j.useState(()=>yt(Np,!1,ie=>ie==="true")),[ri,ro]=j.useState(()=>yt(Dp,xE,ie=>{const ye=Number.parseInt(ie,10);return Number.isFinite(ye)?ye:null})),[io,Ul]=j.useState(()=>yt(Ip,!0,ie=>ie!=="true")),[Wl,wt]=j.useState(!1),ii=gE(i),[oi,ms]=j.useState(!1),Jn=ii.status!==null?ii.status.shellName:E,[oo,li]=j.useState(null),[hr,nn]=j.useState(!1);j.useEffect(()=>{Te===null&&nn(!1)},[Te]);const[ai,Ot]=j.useState(null),dr=Jt&&se!==null,fr=Ty(ge,Le.plansAvailable,st.hidden),pr=$l&&st.isVisible("console"),kn=se!==null?Jt||pr:Jt,gs=xt&&se!==null,Vt=j.useMemo(()=>se===null?[]:m.filter(ie=>ie.cwd===se.cwd),[m,se]),[mr,lo]=j.useState(null),_s=Vt.find(ie=>ie.terminalId===mr)??Vt[0]??null,vs=Ne==="cli"?d:Ne==="console"?(_s==null?void 0:_s.terminalId)??null:null,ao=j.useCallback(ie=>{vs!==null&&i.send({type:"input",terminalId:vs,data:ie})},[i,vs]),Bt=Kb(i,d),Zn=rk(i,U),co=at?se!==null:dr,ci=at?Ne==="files":dr&&fr==="files",dt=bx(i,co?d:null),uo=sx(i,ci?d:null),ui=ix(i,d),hi=wx(i,f,d),gr=kx(i,co?d:null),ho=at?Ne==="cli":dr&&fr==="cli",di=Bt.usage.lastModel,_r=py(Bt.events,Bt.usage.lastEffort,(se==null?void 0:se.launchedAt)??null),Us=di??Bt.defaults.model,En=_r??Bt.defaults.effort,On=di===null&&Us!==null,Bn=_r===null&&En!==null,ys=tx(i,d,ho),es=d===null?null:U.get(d)??null,Ln=sw(Qe,Bt.openToolCall,(pe==null?void 0:pe.label)??null,(se==null?void 0:se.alive)??!1,es),fi=rw({offlineReason:d===null?null:V.get(d)??null,alive:(se==null?void 0:se.alive)??!1,relaunching:d!==null&&X.has(d)}),vr=fi===null?null:iw((pe==null?void 0:pe.label)??null),Ws=vr??Ln??cw(Qe,Bt.waitingFor,(se==null?void 0:se.alive)??!1),zl=!Op(Qe,es),fo=j.useMemo(()=>pm(_,Me),[_,Me]),zs=se!==null&&ew(Me,se.sessionId,Qe),Tn=d===null?null:K.get(d)??null,Vl=Tn===null?null:{text:Yy(Zi(Tn.sourceAgent,_),Tn.includedTurns,Tn.totalTurns,Tn.totalTurnsIsMinimum),status:Tn.prefillReason!==null?Qy(Tn.prefillReason):Tn.delivery==="sending"&&Bt.events.length===0?Xy():null},Rn=j.useCallback(()=>{$s(ie=>{const ye=!ie;return mt(Tp,String(ye)),ye})},[]),ws=j.useCallback(()=>{Qn(ie=>{const ye=!ie;return mt(Mp,String(ye)),ye})},[]),ts=j.useCallback(()=>{so(ie=>{const ye=!ie;return mt(Np,String(ye)),ye})},[]),Vs=j.useCallback(ie=>{Ue(ie),mt(Rp,ie)},[]),ql=j.useCallback(()=>{xn(ie=>{const ye=!ie;return mt(Gc,String(ye)),ye})},[]),Kl=j.useCallback(()=>{d!==null&&i.send({type:"input",terminalId:d,data:"\x1B\x1B"})},[i,d]),pi=j.useCallback(ie=>{d!==null&&i.send({type:"input",terminalId:d,data:`${ie} `})},[i,d]),ns=j.useRef(null),mi=j.useCallback(ie=>{var ye;return(ye=ns.current)==null?void 0:ye.call(ns,ie,!at)},[at]),po=j.useCallback(ie=>{d!==null&&i.send({type:"agent.submit",terminalId:d,text:ie,images:[]})},[i,d]),Fn=j.useCallback(ie=>{d!==null&&i.send({type:"files.reveal",terminalId:d,path:ie})},[i,d]),Hn=j.useRef(new Set);j.useEffect(()=>{if(!pr){Hn.current.clear();return}if(se===null)return;const{cwd:ie}=se;if(m.some(ye=>ye.cwd===ie)){Hn.current.delete(ie);return}Hn.current.has(ie)||(Hn.current.add(ie),N(ie))},[pr,se,m,N]);const yr=j.useCallback(ie=>{const ye=Vt.find(it=>it.terminalId===ie);ye!==void 0&&Hn.current.delete(ye.cwd),O(ie)},[Vt,O]),wr=j.useCallback(ie=>{if(ie==="console")for(const ye of m)O(ye.terminalId);st.setVisible(ie,!1),!yt(jp,!1,ye=>ye==="true")&&(mt(jp,"true"),li(ie))},[m,O,st]),br=j.useCallback(()=>{for(const ie of m)O(ie.terminalId);st.setVisible("console",!1)},[m,O,st]),qs=j.useRef(new Set);j.useEffect(()=>{const ie=Vt.filter(it=>!qs.current.has(it.terminalId));for(const it of Vt)qs.current.add(it.terminalId);const ye=ie[ie.length-1];ye!==void 0&&lo(ye.terminalId)},[Vt]);const mo=j.useCallback(()=>{se!==null&&(Hn.current.add(se.cwd),N(se.cwd))},[se,N]),Zt=El({min:xp,max:yE,value:rt,measure:j.useCallback(ie=>window.innerWidth-ie.clientX,[]),onChange:_t,onCommit:j.useCallback(ie=>mt(Lp,String(ie)),[]),onStart:j.useCallback(()=>{xn(!1),mt(Gc,"false")},[])}),bs=El({min:kp,max:Ep,value:si,measure:j.useCallback(ie=>ie.clientX,[]),onChange:no,onCommit:j.useCallback(ie=>mt(Ap,String(ie)),[])}),Sr=j.useRef(0),Ks=El({min:SE,max:CE,value:ri,measure:j.useCallback(ie=>Math.round(Sr.current-ie.clientY),[]),onChange:ro,onCommit:j.useCallback(ie=>mt(Dp,String(ie)),[]),onStart:j.useCallback(ie=>{const ye=ie.currentTarget.nextElementSibling;Sr.current=ye===null?window.innerHeight:ie.clientY+ye.getBoundingClientRect().height},[])}),Gl=j.useCallback(()=>{Ul(!1),mt(Ip,"true")},[]),Gs=j.useCallback(ie=>{if(f.length===0)return;const it=(f.findIndex(rs=>rs.terminalId===d)+ie+f.length)%f.length,gn=f[it];gn!==void 0&&Ee(gn.terminalId)},[f,d,Ee]),Cr=j.useRef(null),ss=j.useRef(null);j.useEffect(()=>{d!==ss.current&&(Cr.current=ss.current,ss.current=d)},[d]);const Ys=j.useCallback(()=>{const ie=Cr.current;ie===null||ie===d||f.some(ye=>ye.terminalId===ie)&&Ee(ie)},[d,f,Ee]);j.useEffect(()=>{const ie=ye=>{if(ye.key!=="Tab"||!ye.shiftKey||ye.altKey||ye.ctrlKey||ye.metaKey)return;const it=document.activeElement;it instanceof Element&&it.closest(".xterm")!==null||(ye.preventDefault(),ye.stopPropagation(),Ys())};return window.addEventListener("keydown",ie,!0),()=>window.removeEventListener("keydown",ie,!0)},[Ys]),j.useEffect(()=>{const ie=ye=>{if(!ye.altKey||ye.ctrlKey||ye.metaKey)return;const it=ye.key.toLowerCase();if(it==="t"){c&&y.length>0&&!Ie&&(ye.preventDefault(),ye.stopPropagation(),T({cwd:(se==null?void 0:se.cwd)??y}));return}if(it==="w"){d!==null&&(ye.preventDefault(),ye.stopPropagation(),O(d));return}if(it==="p"){ye.preventDefault(),ye.stopPropagation(),Rn();return}if(it==="arrowright"||it==="pagedown"){ye.preventDefault(),ye.stopPropagation(),Gs(1);return}(it==="arrowleft"||it==="pageup")&&(ye.preventDefault(),ye.stopPropagation(),Gs(-1))};return window.addEventListener("keydown",ie,!0),()=>window.removeEventListener("keydown",ie,!0)},[se,d,c,O,Gs,y,Ie,T,Rn]);const go=se===null?C("app.panel.name"):se.label.length>0?se.label:se.cwd.split(/[\\/]/).filter(ie=>ie.length>0).pop()??se.cwd,_o=l.jsx(uC,{projects:k,indexStatus:I,disabled:!c,onOpenProject:(ie,ye)=>{he(),T({cwd:ie,...ye!==void 0?{agent:ye}:{}})},agents:_,offerAgentChoice:r,agentForProject:ie=>Uy(f,ie,h,_,R),onOpenSession:(ie,ye)=>{he(),T({cwd:ie,resumeSessionId:ye.sessionId,agent:ye.agent,label:qn(ye.title,ye.titleSource)})},canResume:ie=>uf(_,ie),platform:h,onRefresh:D,openSessionIds:fs,openBlocked:ie=>pf(p,ie,h),onArchive:a,onHide:at?he:ws,width:si,onNewProject:()=>{he(),Ot("project")},vault:Ze.status,onOpenVault:()=>{he(),tt(!0)},onOpenVaultSession:G?null:ie=>Ze.openSession(ie.agent,ie.sessionId),onExportProject:G?null:Ze.exportProject,exporting:Ze.exporting,lastExported:Ze.lastExported,onContinueSession:(ie,ye)=>{he(),H({agent:ie.agent,sessionId:ie.sessionId},ye,df(qn(ie.title,ie.titleSource)))},globalSearch:Tt?{...At,vaultEnabled:((gi=Ze.status)==null?void 0:gi.enabled)===!0}:null,onOpenSearchHit:(ie,ye)=>{he(),Xn(ie,ye)}}),vo=l.jsx("div",{className:"chat-stack",children:f.length===0?l.jsxs("div",{className:"empty-state",children:[l.jsx("p",{children:C("app.empty.noTabs")}),l.jsx("p",{className:"empty-hint",children:C("app.empty.hint")}),c&&y.length>0&&l.jsx("button",{className:"primary-button",onClick:()=>T({cwd:y}),disabled:Ie,title:et??void 0,children:Ie?C("app.empty.opening"):C("app.empty.newSession",{cwd:y})})]}):l.jsx(Xb,{view:Bt,terminalId:d,threadFont:fe,onRewind:Le.rewind&&(se==null?void 0:se.alive)===!0?Kl:void 0,questionsAnswerable:Le.questionsAnswerable,contextWindowSource:Le.contextWindowSource,instructionsFile:my(Me),onGoToCli:()=>{if(at){qe("cli");return}dr||Rn(),Vs("cli")},cliPresence:se===null||se.alive?"live":se.sleeping?"sleeping":"exited",exitCode:(se==null?void 0:se.exitCode)??null,waking:d!==null&&F.has(d),onWakeCli:()=>{d!==null&&B(d)},discovering:zs,continueTargets:fo,continueBlockedReason:Gy((se==null?void 0:se.sessionId)??"",zs,Bt.events.length>0),onContinue:se===null||Me===null?void 0:ie=>H({agent:Me,sessionId:se.sessionId},ie,df(Re??se.label)),searchRequest:Cn,onSearchRequestApplied:ur,toolCallNotice:Ln,serverClosed:fi===null||vr===null?null:{state:fi,text:vr},statusLineState:(Te==null?void 0:Te.state)??null,onConfigureStatusLine:Te===null?void 0:()=>nn(!0),activity:es,receipt:d===null?null:Zn.receipts.get(d)??null,clock:d===null?null:Zn.clocks.get(d)??null})}),yo=l.jsx(l.Fragment,{children:se!==null&&l.jsx(L1,{connection:i,drafts:ue,terminalId:d,alive:se.alive,sleeping:se.sleeping,projectColor:cr(se.cwd),activity:U.get(se.terminalId),imagesAllowed:Le.imagesAllowed,blockedReason:Ws,prefills:re,onPrefillApplied:ae,notice:Vl,onDismissNotice:d===null?void 0:()=>te(d),onSubmitted:(ie,ye,it)=>{te(ie);const{events:gn}=Bt,rs=ie===d?gn[gn.length-1]:void 0;Zn.track(ie,ye,(rs==null?void 0:rs.eventId)??null,it)},fontSize:fe.size,insertRef:ns,leading:Le.modeCycle===null?void 0:l.jsx(_w,{mode:Bt.permissionMode,cycle:Le.modeCycle,disabled:!se.alive,waitingFor:Bt.waitingFor,statusKnown:zl,onChange:Bt.setPermissionMode}),controls:Le.models===null&&Le.efforts===null?void 0:l.jsx(gw,{models:Le.models,efforts:Le.efforts,model:Us,effort:En,modelProvisional:On,effortProvisional:Bn,savesChoice:fy(Me),disabled:!se.alive,onCommand:po})})}),xr=se===null?null:l.jsx(XC,{tab:at?yf(Ne)??fr:fr,plansAvailable:Le.plansAvailable,hiddenTabs:st.hidden,hidden:at?yf(Ne)===null:!Jt,onTabChange:at?qe:Vs,title:go,cwd:se.cwd,platform:h,cli:l.jsx("div",{className:"terminal-stack",children:f.map(ie=>l.jsx(jm,{terminalId:ie.terminalId,connection:i,active:ie.terminalId===d,theme:J.resolved,autoFocus:!1},ie.terminalId))}),cliUnseen:ys,expanded:xt,onToggleExpanded:ql,git:dt,files:uo,plans:ui,documents:hi,memory:gr,onInsert:Le.fileMentions&&se.alive?pi:void 0,onInsertPath:mi,onReveal:G?null:Fn,onHide:Rn}),wo=se===null?null:l.jsx(J1,{connection:i,shells:Vt,activeShellId:(_s==null?void 0:_s.terminalId)??null,cwd:se.cwd,shellName:Jn,theme:J.resolved,onSelect:lo,onOpen:mo,onCloseShell:yr,onCollapse:at?()=>qe("chat"):ts,onHide:at?void 0:()=>wr("console"),hideCount:m.length}),bo=st.isVisible("notes")?l.jsx(Ik,{notes:ot,fill:at||se===null,onHide:at?void 0:()=>wr("notes"),onSendNote:se===null||!Le.noteSendable?null:ie=>{const ye=se.cwd;T({cwd:ye,...se.agent!==null?{agent:se.agent}:{},onOpened:it=>{i.send({type:"notes.send",noteId:ie,terminalId:it.terminalId}),at&&qe("chat")}})},sendTargetCwd:(se==null?void 0:se.cwd)??null}):null,Yl=se===null||!st.isVisible("console")?null:l.jsx(l.Fragment,{children:pr?l.jsxs(l.Fragment,{children:[Jt&&l.jsx("div",{className:"hdivider",...Ks,title:C("app.divider.consoleHeight")}),l.jsx("div",{className:"console-slot",style:Jt?{height:`${ri}px`}:{flex:"1 1 auto"},children:wo})]}):l.jsxs("div",{className:"strip-collapsed-row",children:[l.jsxs("button",{className:"strip-collapsed",onClick:ts,title:Jn===null?C("console.openAnyIn",{cwd:se.cwd}):C("console.openIn",{shell:Jn,cwd:se.cwd}),children:[l.jsx("span",{className:"strip-collapsed-arrow",children:"▸"}),l.jsx("span",{children:Jn??C("console.name")}),Vt.length>0&&l.jsx("span",{className:"strip-collapsed-count",children:Vt.length})]}),l.jsx(Al,{title:C("settings.hide.console"),onHide:()=>wr("console"),confirmText:m.length===0?null:C("settings.panels.consoleConfirm",{count:m.length})})]})}),So=l.jsxs(l.Fragment,{children:[u==="revoked"&&l.jsx("div",{className:"banner banner-error",children:C("app.banner.revoked")}),oo!==null&&l.jsxs("div",{className:"banner banner-notice",children:[l.jsx("span",{children:C("settings.hiddenHint",{name:C(oo==="console"?"console.name":"notes.name")})}),l.jsx("button",{className:"banner-close",onClick:()=>li(null),title:C("common.gotIt"),children:"×"})]}),!c&&v!==null&&l.jsx("div",{className:"banner banner-error banner-lines",children:v}),S==="child-session-marker"&&io&&l.jsxs("div",{className:"banner banner-notice",children:[l.jsx("span",{children:zt("app.markerNotice",{variable:"CLAUDE_CODE_CHILD_SESSION"})}),l.jsx("button",{className:"banner-close",onClick:Gl,title:C("common.gotIt"),children:"×"})]}),L!==null&&l.jsxs("div",{className:"banner banner-error",children:[l.jsx("span",{children:L.message}),l.jsx("button",{className:"banner-close",onClick:M,title:C("common.close"),children:"×"})]}),Ze.problem!==null&&!ht&&l.jsxs("div",{className:"banner banner-error",children:[l.jsx("span",{children:Ze.problem}),l.jsx("button",{className:"banner-close",onClick:Ze.dismissProblem,title:C("common.close"),children:"×"})]}),l.jsx(jS,{})]}),Co=l.jsxs(l.Fragment,{children:[hr&&Te!==null&&pe!==null&&l.jsx(IS,{info:Te,agentLabel:pe.label,onRefresh:$,onClose:()=>nn(!1)}),oi&&l.jsx(mE,{onClose:()=>ms(!1),terminalTheme:J,panels:st,consoleCount:at?0:m.length,onHideConsole:br,appSettings:ii,agents:_,remoteClient:G,onOpenVault:()=>{ms(!1),tt(!0)},onOpenRemote:He.status!==null&&!G?()=>{ms(!1),Ve(!0)}:null}),Wl&&l.jsx(AS,{agent:Ry(Me,_,R),onClose:()=>wt(!1)}),ai==="project"&&l.jsx(zf,{connection:i,title:C("app.picker.project.title"),confirmLabel:C("app.picker.project.confirm"),confirmTitle:ie=>C("app.picker.project.confirmTitle",{path:ie}),onChoose:(ie,ye)=>{Ot(null),T({cwd:ye})},onClose:()=>Ot(null)}),ht&&l.jsx(_E,{status:Ze.status,agents:_,indexReady:I.state==="ready",problem:Ze.problem,covered:ai==="vault",onMeasure:Ze.measure,onSetEnabled:Ze.setEnabled,onChangeDir:()=>Ot("vault"),onReveal:G?null:Ze.reveal,onDismissProblem:Ze.dismissProblem,onClose:()=>tt(!1)}),nt&&He.status!==null&&!G&&l.jsx(Rk,{status:He.status,pairing:He.pairing,phonePairing:He.phonePairing,phoneStarted:He.phoneStarted,problem:He.problem,platform:h,onSetEnabled:He.setEnabled,onSetPort:He.setPort,onStartPairing:He.startPairing,onCancelPairing:He.cancelPairing,onStartPhonePairing:He.startPhonePairing,onCancelPhonePairing:He.cancelPhonePairing,onRenameDevice:He.renameDevice,onRevokeDevice:He.revokeDevice,onDismissProblem:He.dismissProblem,onClose:()=>Ve(!1)}),ai==="vault"&&l.jsx(zf,{connection:i,title:C("app.picker.vault.title"),confirmLabel:C("app.picker.vault.confirm"),confirmTitle:ie=>C("app.picker.vault.confirmTitle",{path:ie}),onChoose:ie=>{Ze.chooseDir(ie),Ot(null)},onClose:()=>Ot(null)})]});return at?l.jsxs("div",{className:"app app-narrow",children:[l.jsx(Hk,{banners:So,status:u,statusLabel:C(Cp[u]),terminals:f,activeTerminalId:d,activity:U,agents:_,offerAgentChoice:r,newTabAgent:xe,canOpen:c&&y.length>0,newTabBlockedTitle:et,onSelectTab:Ee,onCloseTab:O,onRenameTab:Y,onNewTab:ie=>T({cwd:Pe,...ie!==void 0?{agent:ie}:{}}),drawer:_o,drawerOpen:ke,onDrawerChange:Ke,menu:{cwd:(se==null?void 0:se.cwd)??null,cliVersion:g,themeIcon:ap[W.preference],themeTitle:lp(W.preference),onCycleTheme:W.cycle,sound:de,remote:He.status!==null&&!G?{title:`${C("app.header.remoteAccess")} — ${fu(He.status.state,He.status.port)}`,active:gp(He.status),onOpen:()=>Ve(!0)}:null,remoteClient:G,onShortcuts:()=>wt(!0),onSettings:()=>ms(!0)},view:Ne,views:pt,onViewChange:qe,badges:{changes:cg(dt.status),plans:ui.plans.length,memory:((xo=gr.status)==null?void 0:xo.installed)===!0?gr.status.notes.length:0,cliUnseen:ys},chat:l.jsxs(l.Fragment,{children:[vo,yo]}),panel:xr,notes:bo,console:wo,onTerminalKey:vs===null?null:ao}),Co]}):l.jsxs("div",{className:"app",children:[l.jsxs("header",{className:"app-header",children:[l.jsx("span",{className:"app-name",children:"Agent Workbench"}),l.jsx("span",{className:`status status-${u}`,children:C(Cp[u])}),se!==null&&l.jsx("span",{className:"meta",title:se.cwd,children:se.cwd}),l.jsx("span",{className:"header-spacer"}),g!==null&&l.jsx("span",{className:"meta meta-dim",children:C("app.header.cliVersion",{version:g})}),l.jsx("button",{className:"icon-button",onClick:W.cycle,title:lp(W.preference),children:ap[W.preference]}),l.jsx(_g,{sound:de}),l.jsx(vg,{notify:de.notify}),He.status!==null&&!G&&l.jsx("button",{className:`icon-button${gp(He.status)?" icon-button-on":""}`,onClick:()=>Ve(!0),title:`${C("app.header.remoteAccess")} — ${fu(He.status.state,He.status.port)}`,children:"⇄"}),G&&l.jsx("span",{className:"remote-badge",title:C("app.header.remoteBadgeTitle"),children:C("app.header.remoteBadge")}),l.jsx("button",{className:"icon-button",onClick:()=>ms(!0),title:C("settings.open"),"aria-label":C("settings.open"),children:"⚙"}),l.jsx("button",{className:"icon-button",onClick:()=>wt(!0),title:C("app.header.shortcuts"),children:"?"})]}),So,l.jsxs("div",{className:"app-body",children:[!ps&&l.jsxs("button",{className:"panel-peek panel-peek-left",onClick:ws,title:C("app.sidebar.show"),children:[l.jsx("span",{className:"panel-peek-arrow",children:"»"}),l.jsx("span",{className:"panel-peek-label",children:C("app.sidebar.name")})]}),ps&&_o,ps&&l.jsx("div",{className:"divider",...bs,title:C("app.divider.width")}),l.jsxs("main",{className:`workspace${gs&&kn?" workspace-narrow":""}`,children:[l.jsx(ex,{terminals:f,activeTerminalId:d,activity:U,attention:de.attention,canOpen:c&&y.length>0,onSelect:Ee,onClose:O,onRename:Y,onReorder:q,onNew:ie=>T({cwd:Pe,...ie!==void 0?{agent:ie}:{}}),agents:_,offerAgentChoice:r,newTabAgent:xe,pendingOpens:p,platform:h,newTabBlockedTitle:et,sessionTitles:Ce}),vo,yo]}),l.jsxs(l.Fragment,{children:[!kn&&l.jsxs("button",{className:"panel-peek",onClick:Rn,title:C("app.panel.show"),children:[l.jsx("span",{className:"panel-peek-arrow",children:"«"}),l.jsx("span",{className:"panel-peek-label",children:C("app.panel.name")})]}),kn&&l.jsx("div",{className:"divider",...Zt,title:C("app.divider.width")}),l.jsxs("div",{className:`panel-slot${kn?"":" panel-slot-collapsed"}${kn&&gs?" panel-slot-expanded":""}`,style:kn&&!gs?{width:`${rt}px`}:void 0,children:[se!==null&&l.jsxs(l.Fragment,{children:[xr,Yl]}),bo]})]})]}),Co]})}const Cg=document.getElementById("root");if(Cg===null)throw new Error("Falta el contenedor #root.");const EE=K_.createRoot(Cg);Tb().then(()=>EE.render(l.jsx(kE,{})));export{F_ as g};