wicked-crew 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,50 @@
1
+ (function(){const I=document.createElement("link").relList;if(I&&I.supports&&I.supports("modulepreload"))return;for(const K of document.querySelectorAll('link[rel="modulepreload"]'))V(K);new MutationObserver(K=>{for(const Z of K)if(Z.type==="childList")for(const $ of Z.addedNodes)$.tagName==="LINK"&&$.rel==="modulepreload"&&V($)}).observe(document,{childList:!0,subtree:!0});function A(K){const Z={};return K.integrity&&(Z.integrity=K.integrity),K.referrerPolicy&&(Z.referrerPolicy=K.referrerPolicy),K.crossOrigin==="use-credentials"?Z.credentials="include":K.crossOrigin==="anonymous"?Z.credentials="omit":Z.credentials="same-origin",Z}function V(K){if(K.ep)return;K.ep=!0;const Z=A(K);fetch(K.href,Z)}})();function nd(B){return B&&B.__esModule&&Object.prototype.hasOwnProperty.call(B,"default")?B.default:B}var $o={exports:{}},ji={},Vo={exports:{}},be={};/**
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 jc;function od(){if(jc)return be;jc=1;var B=Symbol.for("react.element"),I=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),Z=Symbol.for("react.provider"),$=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.iterator;function g(k){return k===null||typeof k!="object"?null:(k=h&&k[h]||k["@@iterator"],typeof k=="function"?k:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,_={};function n(k,P,J){this.props=k,this.context=P,this.refs=_,this.updater=J||S}n.prototype.isReactComponent={},n.prototype.setState=function(k,P){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,P,"setState")},n.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function l(){}l.prototype=n.prototype;function s(k,P,J){this.props=k,this.context=P,this.refs=_,this.updater=J||S}var o=s.prototype=new l;o.constructor=s,x(o,n.prototype),o.isPureReactComponent=!0;var f=Array.isArray,w=Object.prototype.hasOwnProperty,y={current:null},b={key:!0,ref:!0,__self:!0,__source:!0};function v(k,P,J){var re,ce={},ue=null,U=null;if(P!=null)for(re in P.ref!==void 0&&(U=P.ref),P.key!==void 0&&(ue=""+P.key),P)w.call(P,re)&&!b.hasOwnProperty(re)&&(ce[re]=P[re]);var L=arguments.length-2;if(L===1)ce.children=J;else if(1<L){for(var ee=Array(L),Y=0;Y<L;Y++)ee[Y]=arguments[Y+2];ce.children=ee}if(k&&k.defaultProps)for(re in L=k.defaultProps,L)ce[re]===void 0&&(ce[re]=L[re]);return{$$typeof:B,type:k,key:ue,ref:U,props:ce,_owner:y.current}}function R(k,P){return{$$typeof:B,type:k.type,key:P,ref:k.ref,props:k.props,_owner:k._owner}}function N(k){return typeof k=="object"&&k!==null&&k.$$typeof===B}function j(k){var P={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(J){return P[J]})}var z=/\/+/g;function M(k,P){return typeof k=="object"&&k!==null&&k.key!=null?j(""+k.key):P.toString(36)}function Q(k,P,J,re,ce){var ue=typeof k;(ue==="undefined"||ue==="boolean")&&(k=null);var U=!1;if(k===null)U=!0;else switch(ue){case"string":case"number":U=!0;break;case"object":switch(k.$$typeof){case B:case I:U=!0}}if(U)return U=k,ce=ce(U),k=re===""?"."+M(U,0):re,f(ce)?(J="",k!=null&&(J=k.replace(z,"$&/")+"/"),Q(ce,P,J,"",function(Y){return Y})):ce!=null&&(N(ce)&&(ce=R(ce,J+(!ce.key||U&&U.key===ce.key?"":(""+ce.key).replace(z,"$&/")+"/")+k)),P.push(ce)),1;if(U=0,re=re===""?".":re+":",f(k))for(var L=0;L<k.length;L++){ue=k[L];var ee=re+M(ue,L);U+=Q(ue,P,J,ee,ce)}else if(ee=g(k),typeof ee=="function")for(k=ee.call(k),L=0;!(ue=k.next()).done;)ue=ue.value,ee=re+M(ue,L++),U+=Q(ue,P,J,ee,ce);else if(ue==="object")throw P=String(k),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.");return U}function te(k,P,J){if(k==null)return k;var re=[],ce=0;return Q(k,re,"","",function(ue){return P.call(J,ue,ce++)}),re}function ne(k){if(k._status===-1){var P=k._result;P=P(),P.then(function(J){(k._status===0||k._status===-1)&&(k._status=1,k._result=J)},function(J){(k._status===0||k._status===-1)&&(k._status=2,k._result=J)}),k._status===-1&&(k._status=0,k._result=P)}if(k._status===1)return k._result.default;throw k._result}var le={current:null},F={transition:null},C={ReactCurrentDispatcher:le,ReactCurrentBatchConfig:F,ReactCurrentOwner:y};function D(){throw Error("act(...) is not supported in production builds of React.")}return be.Children={map:te,forEach:function(k,P,J){te(k,function(){P.apply(this,arguments)},J)},count:function(k){var P=0;return te(k,function(){P++}),P},toArray:function(k){return te(k,function(P){return P})||[]},only:function(k){if(!N(k))throw Error("React.Children.only expected to receive a single React element child.");return k}},be.Component=n,be.Fragment=A,be.Profiler=K,be.PureComponent=s,be.StrictMode=V,be.Suspense=u,be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=C,be.act=D,be.cloneElement=function(k,P,J){if(k==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+k+".");var re=x({},k.props),ce=k.key,ue=k.ref,U=k._owner;if(P!=null){if(P.ref!==void 0&&(ue=P.ref,U=y.current),P.key!==void 0&&(ce=""+P.key),k.type&&k.type.defaultProps)var L=k.type.defaultProps;for(ee in P)w.call(P,ee)&&!b.hasOwnProperty(ee)&&(re[ee]=P[ee]===void 0&&L!==void 0?L[ee]:P[ee])}var ee=arguments.length-2;if(ee===1)re.children=J;else if(1<ee){L=Array(ee);for(var Y=0;Y<ee;Y++)L[Y]=arguments[Y+2];re.children=L}return{$$typeof:B,type:k.type,key:ce,ref:ue,props:re,_owner:U}},be.createContext=function(k){return k={$$typeof:$,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},k.Provider={$$typeof:Z,_context:k},k.Consumer=k},be.createElement=v,be.createFactory=function(k){var P=v.bind(null,k);return P.type=k,P},be.createRef=function(){return{current:null}},be.forwardRef=function(k){return{$$typeof:a,render:k}},be.isValidElement=N,be.lazy=function(k){return{$$typeof:m,_payload:{_status:-1,_result:k},_init:ne}},be.memo=function(k,P){return{$$typeof:p,type:k,compare:P===void 0?null:P}},be.startTransition=function(k){var P=F.transition;F.transition={};try{k()}finally{F.transition=P}},be.unstable_act=D,be.useCallback=function(k,P){return le.current.useCallback(k,P)},be.useContext=function(k){return le.current.useContext(k)},be.useDebugValue=function(){},be.useDeferredValue=function(k){return le.current.useDeferredValue(k)},be.useEffect=function(k,P){return le.current.useEffect(k,P)},be.useId=function(){return le.current.useId()},be.useImperativeHandle=function(k,P,J){return le.current.useImperativeHandle(k,P,J)},be.useInsertionEffect=function(k,P){return le.current.useInsertionEffect(k,P)},be.useLayoutEffect=function(k,P){return le.current.useLayoutEffect(k,P)},be.useMemo=function(k,P){return le.current.useMemo(k,P)},be.useReducer=function(k,P,J){return le.current.useReducer(k,P,J)},be.useRef=function(k){return le.current.useRef(k)},be.useState=function(k){return le.current.useState(k)},be.useSyncExternalStore=function(k,P,J){return le.current.useSyncExternalStore(k,P,J)},be.useTransition=function(){return le.current.useTransition()},be.version="18.3.1",be}var Hc;function Zo(){return Hc||(Hc=1,Vo.exports=od()),Vo.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 Fc;function ld(){if(Fc)return ji;Fc=1;var B=Zo(),I=Symbol.for("react.element"),A=Symbol.for("react.fragment"),V=Object.prototype.hasOwnProperty,K=B.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Z={key:!0,ref:!0,__self:!0,__source:!0};function $(a,u,p){var m,h={},g=null,S=null;p!==void 0&&(g=""+p),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(S=u.ref);for(m in u)V.call(u,m)&&!Z.hasOwnProperty(m)&&(h[m]=u[m]);if(a&&a.defaultProps)for(m in u=a.defaultProps,u)h[m]===void 0&&(h[m]=u[m]);return{$$typeof:I,type:a,key:g,ref:S,props:h,_owner:K.current}}return ji.Fragment=A,ji.jsx=$,ji.jsxs=$,ji}var Uc;function ad(){return Uc||(Uc=1,$o.exports=ld()),$o.exports}var T=ad(),ye=Zo();const Qs=nd(ye);var Ys={},Ko={exports:{}},ut={},qo={exports:{}},Go={};/**
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 zc;function cd(){return zc||(zc=1,(function(B){function I(F,C){var D=F.length;F.push(C);e:for(;0<D;){var k=D-1>>>1,P=F[k];if(0<K(P,C))F[k]=C,F[D]=P,D=k;else break e}}function A(F){return F.length===0?null:F[0]}function V(F){if(F.length===0)return null;var C=F[0],D=F.pop();if(D!==C){F[0]=D;e:for(var k=0,P=F.length,J=P>>>1;k<J;){var re=2*(k+1)-1,ce=F[re],ue=re+1,U=F[ue];if(0>K(ce,D))ue<P&&0>K(U,ce)?(F[k]=U,F[ue]=D,k=ue):(F[k]=ce,F[re]=D,k=re);else if(ue<P&&0>K(U,D))F[k]=U,F[ue]=D,k=ue;else break e}}return C}function K(F,C){var D=F.sortIndex-C.sortIndex;return D!==0?D:F.id-C.id}if(typeof performance=="object"&&typeof performance.now=="function"){var Z=performance;B.unstable_now=function(){return Z.now()}}else{var $=Date,a=$.now();B.unstable_now=function(){return $.now()-a}}var u=[],p=[],m=1,h=null,g=3,S=!1,x=!1,_=!1,n=typeof setTimeout=="function"?setTimeout:null,l=typeof clearTimeout=="function"?clearTimeout:null,s=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function o(F){for(var C=A(p);C!==null;){if(C.callback===null)V(p);else if(C.startTime<=F)V(p),C.sortIndex=C.expirationTime,I(u,C);else break;C=A(p)}}function f(F){if(_=!1,o(F),!x)if(A(u)!==null)x=!0,ne(w);else{var C=A(p);C!==null&&le(f,C.startTime-F)}}function w(F,C){x=!1,_&&(_=!1,l(v),v=-1),S=!0;var D=g;try{for(o(C),h=A(u);h!==null&&(!(h.expirationTime>C)||F&&!j());){var k=h.callback;if(typeof k=="function"){h.callback=null,g=h.priorityLevel;var P=k(h.expirationTime<=C);C=B.unstable_now(),typeof P=="function"?h.callback=P:h===A(u)&&V(u),o(C)}else V(u);h=A(u)}if(h!==null)var J=!0;else{var re=A(p);re!==null&&le(f,re.startTime-C),J=!1}return J}finally{h=null,g=D,S=!1}}var y=!1,b=null,v=-1,R=5,N=-1;function j(){return!(B.unstable_now()-N<R)}function z(){if(b!==null){var F=B.unstable_now();N=F;var C=!0;try{C=b(!0,F)}finally{C?M():(y=!1,b=null)}}else y=!1}var M;if(typeof s=="function")M=function(){s(z)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,te=Q.port2;Q.port1.onmessage=z,M=function(){te.postMessage(null)}}else M=function(){n(z,0)};function ne(F){b=F,y||(y=!0,M())}function le(F,C){v=n(function(){F(B.unstable_now())},C)}B.unstable_IdlePriority=5,B.unstable_ImmediatePriority=1,B.unstable_LowPriority=4,B.unstable_NormalPriority=3,B.unstable_Profiling=null,B.unstable_UserBlockingPriority=2,B.unstable_cancelCallback=function(F){F.callback=null},B.unstable_continueExecution=function(){x||S||(x=!0,ne(w))},B.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<F?Math.floor(1e3/F):5},B.unstable_getCurrentPriorityLevel=function(){return g},B.unstable_getFirstCallbackNode=function(){return A(u)},B.unstable_next=function(F){switch(g){case 1:case 2:case 3:var C=3;break;default:C=g}var D=g;g=C;try{return F()}finally{g=D}},B.unstable_pauseExecution=function(){},B.unstable_requestPaint=function(){},B.unstable_runWithPriority=function(F,C){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var D=g;g=F;try{return C()}finally{g=D}},B.unstable_scheduleCallback=function(F,C,D){var k=B.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?k+D:k):D=k,F){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=D+P,F={id:m++,callback:C,priorityLevel:F,startTime:D,expirationTime:P,sortIndex:-1},D>k?(F.sortIndex=D,I(p,F),A(u)===null&&F===A(p)&&(_?(l(v),v=-1):_=!0,le(f,D-k))):(F.sortIndex=P,I(u,F),x||S||(x=!0,ne(w))),F},B.unstable_shouldYield=j,B.unstable_wrapCallback=function(F){var C=g;return function(){var D=g;g=C;try{return F.apply(this,arguments)}finally{g=D}}}})(Go)),Go}var Wc;function ud(){return Wc||(Wc=1,qo.exports=cd()),qo.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 $c;function hd(){if($c)return ut;$c=1;var B=Zo(),I=ud();function A(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var V=new Set,K={};function Z(e,t){$(e,t),$(e+"Capture",t)}function $(e,t){for(K[e]=t,e=0;e<t.length;e++)V.add(t[e])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,p=/^[: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]*$/,m={},h={};function g(e){return u.call(h,e)?!0:u.call(m,e)?!1:p.test(e)?h[e]=!0:(m[e]=!0,!1)}function S(e,t,r,i){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function x(e,t,r,i){if(t===null||typeof t>"u"||S(e,t,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function _(e,t,r,i,c,d,E){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=c,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=d,this.removeEmptyString=E}var n={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){n[e]=new _(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];n[t]=new _(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){n[e]=new _(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){n[e]=new _(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){n[e]=new _(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){n[e]=new _(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){n[e]=new _(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){n[e]=new _(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){n[e]=new _(e,5,!1,e.toLowerCase(),null,!1,!1)});var l=/[\-:]([a-z])/g;function s(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(l,s);n[t]=new _(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(l,s);n[t]=new _(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(l,s);n[t]=new _(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){n[e]=new _(e,1,!1,e.toLowerCase(),null,!1,!1)}),n.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){n[e]=new _(e,1,!1,e.toLowerCase(),null,!0,!0)});function o(e,t,r,i){var c=n.hasOwnProperty(t)?n[t]:null;(c!==null?c.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(x(t,r,c,i)&&(r=null),i||c===null?g(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):c.mustUseProperty?e[c.propertyName]=r===null?c.type===3?!1:"":r:(t=c.attributeName,i=c.attributeNamespace,r===null?e.removeAttribute(t):(c=c.type,r=c===3||c===4&&r===!0?"":""+r,i?e.setAttributeNS(i,t,r):e.setAttribute(t,r))))}var f=B.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),y=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),j=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),le=Symbol.for("react.offscreen"),F=Symbol.iterator;function C(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var D=Object.assign,k;function P(e){if(k===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);k=t&&t[1]||""}return`
34
+ `+k+e}var J=!1;function re(e,t){if(!e||J)return"";J=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(X){var i=X}Reflect.construct(e,[],t)}else{try{t.call()}catch(X){i=X}e.call(t.prototype)}else{try{throw Error()}catch(X){i=X}e()}}catch(X){if(X&&i&&typeof X.stack=="string"){for(var c=X.stack.split(`
35
+ `),d=i.stack.split(`
36
+ `),E=c.length-1,O=d.length-1;1<=E&&0<=O&&c[E]!==d[O];)O--;for(;1<=E&&0<=O;E--,O--)if(c[E]!==d[O]){if(E!==1||O!==1)do if(E--,O--,0>O||c[E]!==d[O]){var H=`
37
+ `+c[E].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=E&&0<=O);break}}}finally{J=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?P(e):""}function ce(e){switch(e.tag){case 5:return P(e.type);case 16:return P("Lazy");case 13:return P("Suspense");case 19:return P("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 b:return"Fragment";case y:return"Portal";case R:return"Profiler";case v:return"StrictMode";case M:return"Suspense";case Q:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case j:return(e.displayName||"Context")+".Consumer";case N:return(e._context.displayName||"Context")+".Provider";case z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case te:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case ne:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}function U(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===v?"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 L(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ee(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Y(e){var t=ee(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,d=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(E){i=""+E,d.call(this,E)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(E){i=""+E},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function de(e){e._valueTracker||(e._valueTracker=Y(e))}function he(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=ee(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function xe(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 Le(e,t){var r=t.checked;return D({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Te(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=L(t.value!=null?t.value:r),e._wrapperState={initialChecked:i,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function qe(e,t){t=t.checked,t!=null&&o(e,"checked",t,!1)}function we(e,t){qe(e,t);var r=L(t.value),i=t.type;if(r!=null)i==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?gr(e,t.type,r):t.hasOwnProperty("defaultValue")&&gr(e,t.type,L(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Kt(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function gr(e,t,r){(t!=="number"||xe(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Nt=Array.isArray;function At(e,t,r,i){if(e=e.options,t){t={};for(var c=0;c<r.length;c++)t["$"+r[c]]=!0;for(r=0;r<e.length;r++)c=t.hasOwnProperty("$"+e[r].value),e[r].selected!==c&&(e[r].selected=c),c&&i&&(e[r].defaultSelected=!0)}else{for(r=""+L(r),t=null,c=0;c<e.length;c++){if(e[c].value===r){e[c].selected=!0,i&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function qt(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(A(91));return D({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function et(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(A(92));if(Nt(r)){if(1<r.length)throw Error(A(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:L(r)}}function Gt(e,t){var r=L(t.value),i=L(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),i!=null&&(e.defaultValue=""+i)}function ht(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Xt(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 vr(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Xt(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var dt,mr=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,c){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,c)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(dt=dt||document.createElement("div"),dt.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=dt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function st(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var xt={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},Ae=["Webkit","ms","Moz","O"];Object.keys(xt).forEach(function(e){Ae.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xt[t]=xt[e]})});function zi(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||xt.hasOwnProperty(e)&&xt[e]?(""+t).trim():t+"px"}function el(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,c=zi(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,c):e[r]=c}}var uu=D({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 en(e,t){if(t){if(uu[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(A(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(A(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(A(61))}if(t.style!=null&&typeof t.style!="object")throw Error(A(62))}}function tn(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 rn=null;function sn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nn=null,Pr=null,Br=null;function tl(e){if(e=xi(e)){if(typeof nn!="function")throw Error(A(280));var t=e.stateNode;t&&(t=hs(t),nn(e.stateNode,e.type,t))}}function rl(e){Pr?Br?Br.push(e):Br=[e]:Pr=e}function il(){if(Pr){var e=Pr,t=Br;if(Br=Pr=null,tl(e),t)for(e=0;e<t.length;e++)tl(t[e])}}function sl(e,t){return e(t)}function nl(){}var on=!1;function ol(e,t,r){if(on)return e(t,r);on=!0;try{return sl(e,t,r)}finally{on=!1,(Pr!==null||Br!==null)&&(nl(),il())}}function ri(e,t){var r=e.stateNode;if(r===null)return null;var i=hs(r);if(i===null)return null;r=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(A(231,t,typeof r));return r}var ln=!1;if(a)try{var ii={};Object.defineProperty(ii,"passive",{get:function(){ln=!0}}),window.addEventListener("test",ii,ii),window.removeEventListener("test",ii,ii)}catch{ln=!1}function hu(e,t,r,i,c,d,E,O,H){var X=Array.prototype.slice.call(arguments,3);try{t.apply(r,X)}catch(se){this.onError(se)}}var si=!1,Wi=null,$i=!1,an=null,du={onError:function(e){si=!0,Wi=e}};function fu(e,t,r,i,c,d,E,O,H){si=!1,Wi=null,hu.apply(du,arguments)}function pu(e,t,r,i,c,d,E,O,H){if(fu.apply(this,arguments),si){if(si){var X=Wi;si=!1,Wi=null}else throw Error(A(198));$i||($i=!0,an=X)}}function Sr(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function ll(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 al(e){if(Sr(e)!==e)throw Error(A(188))}function _u(e){var t=e.alternate;if(!t){if(t=Sr(e),t===null)throw Error(A(188));return t!==e?null:e}for(var r=e,i=t;;){var c=r.return;if(c===null)break;var d=c.alternate;if(d===null){if(i=c.return,i!==null){r=i;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===r)return al(c),e;if(d===i)return al(c),t;d=d.sibling}throw Error(A(188))}if(r.return!==i.return)r=c,i=d;else{for(var E=!1,O=c.child;O;){if(O===r){E=!0,r=c,i=d;break}if(O===i){E=!0,i=c,r=d;break}O=O.sibling}if(!E){for(O=d.child;O;){if(O===r){E=!0,r=d,i=c;break}if(O===i){E=!0,i=d,r=c;break}O=O.sibling}if(!E)throw Error(A(189))}}if(r.alternate!==i)throw Error(A(190))}if(r.tag!==3)throw Error(A(188));return r.stateNode.current===r?e:t}function cl(e){return e=_u(e),e!==null?ul(e):null}function ul(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ul(e);if(t!==null)return t;e=e.sibling}return null}var hl=I.unstable_scheduleCallback,dl=I.unstable_cancelCallback,gu=I.unstable_shouldYield,vu=I.unstable_requestPaint,je=I.unstable_now,mu=I.unstable_getCurrentPriorityLevel,cn=I.unstable_ImmediatePriority,fl=I.unstable_UserBlockingPriority,Vi=I.unstable_NormalPriority,Su=I.unstable_LowPriority,pl=I.unstable_IdlePriority,Ki=null,Pt=null;function yu(e){if(Pt&&typeof Pt.onCommitFiberRoot=="function")try{Pt.onCommitFiberRoot(Ki,e,void 0,(e.current.flags&128)===128)}catch{}}var bt=Math.clz32?Math.clz32:xu,wu=Math.log,Cu=Math.LN2;function xu(e){return e>>>=0,e===0?32:31-(wu(e)/Cu|0)|0}var qi=64,Gi=4194304;function ni(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 Xi(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,c=e.suspendedLanes,d=e.pingedLanes,E=r&268435455;if(E!==0){var O=E&~c;O!==0?i=ni(O):(d&=E,d!==0&&(i=ni(d)))}else E=r&~c,E!==0?i=ni(E):d!==0&&(i=ni(d));if(i===0)return 0;if(t!==0&&t!==i&&(t&c)===0&&(c=i&-i,d=t&-t,c>=d||c===16&&(d&4194240)!==0))return t;if((i&4)!==0&&(i|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)r=31-bt(t),c=1<<r,i|=e[r],t&=~c;return i}function bu(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 Eu(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes;0<d;){var E=31-bt(d),O=1<<E,H=c[E];H===-1?((O&r)===0||(O&i)!==0)&&(c[E]=bu(O,t)):H<=t&&(e.expiredLanes|=O),d&=~O}}function un(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function _l(){var e=qi;return qi<<=1,(qi&4194240)===0&&(qi=64),e}function hn(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function oi(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-bt(t),e[t]=r}function ku(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<r;){var c=31-bt(r),d=1<<c;t[c]=0,i[c]=-1,e[c]=-1,r&=~d}}function dn(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-bt(r),c=1<<i;c&t|e[i]&t&&(e[i]|=t),r&=~c}}var Re=0;function gl(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var vl,fn,ml,Sl,yl,pn=!1,Qi=[],Qt=null,Yt=null,Jt=null,li=new Map,ai=new Map,Zt=[],Ru="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 wl(e,t){switch(e){case"focusin":case"focusout":Qt=null;break;case"dragenter":case"dragleave":Yt=null;break;case"mouseover":case"mouseout":Jt=null;break;case"pointerover":case"pointerout":li.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ai.delete(t.pointerId)}}function ci(e,t,r,i,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:d,targetContainers:[c]},t!==null&&(t=xi(t),t!==null&&fn(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Lu(e,t,r,i,c){switch(t){case"focusin":return Qt=ci(Qt,e,t,r,i,c),!0;case"dragenter":return Yt=ci(Yt,e,t,r,i,c),!0;case"mouseover":return Jt=ci(Jt,e,t,r,i,c),!0;case"pointerover":var d=c.pointerId;return li.set(d,ci(li.get(d)||null,e,t,r,i,c)),!0;case"gotpointercapture":return d=c.pointerId,ai.set(d,ci(ai.get(d)||null,e,t,r,i,c)),!0}return!1}function Cl(e){var t=yr(e.target);if(t!==null){var r=Sr(t);if(r!==null){if(t=r.tag,t===13){if(t=ll(r),t!==null){e.blockedOn=t,yl(e.priority,function(){ml(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Yi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=gn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);rn=i,r.target.dispatchEvent(i),rn=null}else return t=xi(r),t!==null&&fn(t),e.blockedOn=r,!1;t.shift()}return!0}function xl(e,t,r){Yi(e)&&r.delete(t)}function Du(){pn=!1,Qt!==null&&Yi(Qt)&&(Qt=null),Yt!==null&&Yi(Yt)&&(Yt=null),Jt!==null&&Yi(Jt)&&(Jt=null),li.forEach(xl),ai.forEach(xl)}function ui(e,t){e.blockedOn===t&&(e.blockedOn=null,pn||(pn=!0,I.unstable_scheduleCallback(I.unstable_NormalPriority,Du)))}function hi(e){function t(c){return ui(c,e)}if(0<Qi.length){ui(Qi[0],e);for(var r=1;r<Qi.length;r++){var i=Qi[r];i.blockedOn===e&&(i.blockedOn=null)}}for(Qt!==null&&ui(Qt,e),Yt!==null&&ui(Yt,e),Jt!==null&&ui(Jt,e),li.forEach(t),ai.forEach(t),r=0;r<Zt.length;r++)i=Zt[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<Zt.length&&(r=Zt[0],r.blockedOn===null);)Cl(r),r.blockedOn===null&&Zt.shift()}var Mr=f.ReactCurrentBatchConfig,Ji=!0;function Tu(e,t,r,i){var c=Re,d=Mr.transition;Mr.transition=null;try{Re=1,_n(e,t,r,i)}finally{Re=c,Mr.transition=d}}function Au(e,t,r,i){var c=Re,d=Mr.transition;Mr.transition=null;try{Re=4,_n(e,t,r,i)}finally{Re=c,Mr.transition=d}}function _n(e,t,r,i){if(Ji){var c=gn(e,t,r,i);if(c===null)Bn(e,t,i,Zi,r),wl(e,i);else if(Lu(c,e,t,r,i))i.stopPropagation();else if(wl(e,i),t&4&&-1<Ru.indexOf(e)){for(;c!==null;){var d=xi(c);if(d!==null&&vl(d),d=gn(e,t,r,i),d===null&&Bn(e,t,i,Zi,r),d===c)break;c=d}c!==null&&i.stopPropagation()}else Bn(e,t,i,null,r)}}var Zi=null;function gn(e,t,r,i){if(Zi=null,e=sn(i),e=yr(e),e!==null)if(t=Sr(e),t===null)e=null;else if(r=t.tag,r===13){if(e=ll(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Zi=e,null}function bl(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(mu()){case cn:return 1;case fl:return 4;case Vi:case Su:return 16;case pl:return 536870912;default:return 16}default:return 16}}var er=null,vn=null,es=null;function El(){if(es)return es;var e,t=vn,r=t.length,i,c="value"in er?er.value:er.textContent,d=c.length;for(e=0;e<r&&t[e]===c[e];e++);var E=r-e;for(i=1;i<=E&&t[r-i]===c[d-i];i++);return es=c.slice(e,1<i?1-i:void 0)}function ts(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 rs(){return!0}function kl(){return!1}function ft(e){function t(r,i,c,d,E){this._reactName=r,this._targetInst=c,this.type=i,this.nativeEvent=d,this.target=E,this.currentTarget=null;for(var O in e)e.hasOwnProperty(O)&&(r=e[O],this[O]=r?r(d):d[O]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?rs:kl,this.isPropagationStopped=kl,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=rs)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=rs)},persist:function(){},isPersistent:rs}),t}var Or={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mn=ft(Or),di=D({},Or,{view:0,detail:0}),Pu=ft(di),Sn,yn,fi,is=D({},di,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cn,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!==fi&&(fi&&e.type==="mousemove"?(Sn=e.screenX-fi.screenX,yn=e.screenY-fi.screenY):yn=Sn=0,fi=e),Sn)},movementY:function(e){return"movementY"in e?e.movementY:yn}}),Rl=ft(is),Bu=D({},is,{dataTransfer:0}),Mu=ft(Bu),Ou=D({},di,{relatedTarget:0}),wn=ft(Ou),Iu=D({},Or,{animationName:0,elapsedTime:0,pseudoElement:0}),Nu=ft(Iu),ju=D({},Or,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Hu=ft(ju),Fu=D({},Or,{data:0}),Ll=ft(Fu),Uu={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zu={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"},Wu={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $u(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Wu[e])?!!t[e]:!1}function Cn(){return $u}var Vu=D({},di,{key:function(e){if(e.key){var t=Uu[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ts(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?zu[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cn,charCode:function(e){return e.type==="keypress"?ts(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ts(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ku=ft(Vu),qu=D({},is,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dl=ft(qu),Gu=D({},di,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cn}),Xu=ft(Gu),Qu=D({},Or,{propertyName:0,elapsedTime:0,pseudoElement:0}),Yu=ft(Qu),Ju=D({},is,{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}),Zu=ft(Ju),eh=[9,13,27,32],xn=a&&"CompositionEvent"in window,pi=null;a&&"documentMode"in document&&(pi=document.documentMode);var th=a&&"TextEvent"in window&&!pi,Tl=a&&(!xn||pi&&8<pi&&11>=pi),Al=" ",Pl=!1;function Bl(e,t){switch(e){case"keyup":return eh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ml(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ir=!1;function rh(e,t){switch(e){case"compositionend":return Ml(t);case"keypress":return t.which!==32?null:(Pl=!0,Al);case"textInput":return e=t.data,e===Al&&Pl?null:e;default:return null}}function ih(e,t){if(Ir)return e==="compositionend"||!xn&&Bl(e,t)?(e=El(),es=vn=er=null,Ir=!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 Tl&&t.locale!=="ko"?null:t.data;default:return null}}var sh={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 Ol(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!sh[e.type]:t==="textarea"}function Il(e,t,r,i){rl(i),t=as(t,"onChange"),0<t.length&&(r=new mn("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var _i=null,gi=null;function nh(e){ea(e,0)}function ss(e){var t=Ur(e);if(he(t))return e}function oh(e,t){if(e==="change")return t}var Nl=!1;if(a){var bn;if(a){var En="oninput"in document;if(!En){var jl=document.createElement("div");jl.setAttribute("oninput","return;"),En=typeof jl.oninput=="function"}bn=En}else bn=!1;Nl=bn&&(!document.documentMode||9<document.documentMode)}function Hl(){_i&&(_i.detachEvent("onpropertychange",Fl),gi=_i=null)}function Fl(e){if(e.propertyName==="value"&&ss(gi)){var t=[];Il(t,gi,e,sn(e)),ol(nh,t)}}function lh(e,t,r){e==="focusin"?(Hl(),_i=t,gi=r,_i.attachEvent("onpropertychange",Fl)):e==="focusout"&&Hl()}function ah(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ss(gi)}function ch(e,t){if(e==="click")return ss(t)}function uh(e,t){if(e==="input"||e==="change")return ss(t)}function hh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Et=typeof Object.is=="function"?Object.is:hh;function vi(e,t){if(Et(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var c=r[i];if(!u.call(t,c)||!Et(e[c],t[c]))return!1}return!0}function Ul(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zl(e,t){var r=Ul(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ul(r)}}function Wl(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wl(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $l(){for(var e=window,t=xe();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=xe(e.document)}return t}function kn(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 dh(e){var t=$l(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Wl(r.ownerDocument.documentElement,r)){if(i!==null&&kn(r)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var c=r.textContent.length,d=Math.min(i.start,c);i=i.end===void 0?d:Math.min(i.end,c),!e.extend&&d>i&&(c=i,i=d,d=c),c=zl(r,d);var E=zl(r,i);c&&E&&(e.rangeCount!==1||e.anchorNode!==c.node||e.anchorOffset!==c.offset||e.focusNode!==E.node||e.focusOffset!==E.offset)&&(t=t.createRange(),t.setStart(c.node,c.offset),e.removeAllRanges(),d>i?(e.addRange(t),e.extend(E.node,E.offset)):(t.setEnd(E.node,E.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var fh=a&&"documentMode"in document&&11>=document.documentMode,Nr=null,Rn=null,mi=null,Ln=!1;function Vl(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ln||Nr==null||Nr!==xe(i)||(i=Nr,"selectionStart"in i&&kn(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),mi&&vi(mi,i)||(mi=i,i=as(Rn,"onSelect"),0<i.length&&(t=new mn("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=Nr)))}function ns(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var jr={animationend:ns("Animation","AnimationEnd"),animationiteration:ns("Animation","AnimationIteration"),animationstart:ns("Animation","AnimationStart"),transitionend:ns("Transition","TransitionEnd")},Dn={},Kl={};a&&(Kl=document.createElement("div").style,"AnimationEvent"in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),"TransitionEvent"in window||delete jr.transitionend.transition);function os(e){if(Dn[e])return Dn[e];if(!jr[e])return e;var t=jr[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Kl)return Dn[e]=t[r];return e}var ql=os("animationend"),Gl=os("animationiteration"),Xl=os("animationstart"),Ql=os("transitionend"),Yl=new Map,Jl="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 tr(e,t){Yl.set(e,t),Z(t,[e])}for(var Tn=0;Tn<Jl.length;Tn++){var An=Jl[Tn],ph=An.toLowerCase(),_h=An[0].toUpperCase()+An.slice(1);tr(ph,"on"+_h)}tr(ql,"onAnimationEnd"),tr(Gl,"onAnimationIteration"),tr(Xl,"onAnimationStart"),tr("dblclick","onDoubleClick"),tr("focusin","onFocus"),tr("focusout","onBlur"),tr(Ql,"onTransitionEnd"),$("onMouseEnter",["mouseout","mouseover"]),$("onMouseLeave",["mouseout","mouseover"]),$("onPointerEnter",["pointerout","pointerover"]),$("onPointerLeave",["pointerout","pointerover"]),Z("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Z("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Z("onBeforeInput",["compositionend","keypress","textInput","paste"]),Z("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Z("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Z("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(" "),gh=new Set("cancel close invalid load scroll toggle".split(" ").concat(Si));function Zl(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,pu(i,t,void 0,e),e.currentTarget=null}function ea(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],c=i.event;i=i.listeners;e:{var d=void 0;if(t)for(var E=i.length-1;0<=E;E--){var O=i[E],H=O.instance,X=O.currentTarget;if(O=O.listener,H!==d&&c.isPropagationStopped())break e;Zl(c,O,X),d=H}else for(E=0;E<i.length;E++){if(O=i[E],H=O.instance,X=O.currentTarget,O=O.listener,H!==d&&c.isPropagationStopped())break e;Zl(c,O,X),d=H}}}if($i)throw e=an,$i=!1,an=null,e}function Pe(e,t){var r=t[Hn];r===void 0&&(r=t[Hn]=new Set);var i=e+"__bubble";r.has(i)||(ta(t,e,2,!1),r.add(i))}function Pn(e,t,r){var i=0;t&&(i|=4),ta(r,e,i,t)}var ls="_reactListening"+Math.random().toString(36).slice(2);function yi(e){if(!e[ls]){e[ls]=!0,V.forEach(function(r){r!=="selectionchange"&&(gh.has(r)||Pn(r,!1,e),Pn(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ls]||(t[ls]=!0,Pn("selectionchange",!1,t))}}function ta(e,t,r,i){switch(bl(t)){case 1:var c=Tu;break;case 4:c=Au;break;default:c=_n}r=c.bind(null,t,r,e),c=void 0,!ln||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),i?c!==void 0?e.addEventListener(t,r,{capture:!0,passive:c}):e.addEventListener(t,r,!0):c!==void 0?e.addEventListener(t,r,{passive:c}):e.addEventListener(t,r,!1)}function Bn(e,t,r,i,c){var d=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var E=i.tag;if(E===3||E===4){var O=i.stateNode.containerInfo;if(O===c||O.nodeType===8&&O.parentNode===c)break;if(E===4)for(E=i.return;E!==null;){var H=E.tag;if((H===3||H===4)&&(H=E.stateNode.containerInfo,H===c||H.nodeType===8&&H.parentNode===c))return;E=E.return}for(;O!==null;){if(E=yr(O),E===null)return;if(H=E.tag,H===5||H===6){i=d=E;continue e}O=O.parentNode}}i=i.return}ol(function(){var X=d,se=sn(r),oe=[];e:{var ie=Yl.get(e);if(ie!==void 0){var fe=mn,_e=e;switch(e){case"keypress":if(ts(r)===0)break e;case"keydown":case"keyup":fe=Ku;break;case"focusin":_e="focus",fe=wn;break;case"focusout":_e="blur",fe=wn;break;case"beforeblur":case"afterblur":fe=wn;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=Rl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=Mu;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=Xu;break;case ql:case Gl:case Xl:fe=Nu;break;case Ql:fe=Yu;break;case"scroll":fe=Pu;break;case"wheel":fe=Zu;break;case"copy":case"cut":case"paste":fe=Hu;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=Dl}var ge=(t&4)!==0,He=!ge&&e==="scroll",q=ge?ie!==null?ie+"Capture":null:ie;ge=[];for(var W=X,G;W!==null;){G=W;var ae=G.stateNode;if(G.tag===5&&ae!==null&&(G=ae,q!==null&&(ae=ri(W,q),ae!=null&&ge.push(wi(W,ae,G)))),He)break;W=W.return}0<ge.length&&(ie=new fe(ie,_e,null,r,se),oe.push({event:ie,listeners:ge}))}}if((t&7)===0){e:{if(ie=e==="mouseover"||e==="pointerover",fe=e==="mouseout"||e==="pointerout",ie&&r!==rn&&(_e=r.relatedTarget||r.fromElement)&&(yr(_e)||_e[jt]))break e;if((fe||ie)&&(ie=se.window===se?se:(ie=se.ownerDocument)?ie.defaultView||ie.parentWindow:window,fe?(_e=r.relatedTarget||r.toElement,fe=X,_e=_e?yr(_e):null,_e!==null&&(He=Sr(_e),_e!==He||_e.tag!==5&&_e.tag!==6)&&(_e=null)):(fe=null,_e=X),fe!==_e)){if(ge=Rl,ae="onMouseLeave",q="onMouseEnter",W="mouse",(e==="pointerout"||e==="pointerover")&&(ge=Dl,ae="onPointerLeave",q="onPointerEnter",W="pointer"),He=fe==null?ie:Ur(fe),G=_e==null?ie:Ur(_e),ie=new ge(ae,W+"leave",fe,r,se),ie.target=He,ie.relatedTarget=G,ae=null,yr(se)===X&&(ge=new ge(q,W+"enter",_e,r,se),ge.target=G,ge.relatedTarget=He,ae=ge),He=ae,fe&&_e)t:{for(ge=fe,q=_e,W=0,G=ge;G;G=Hr(G))W++;for(G=0,ae=q;ae;ae=Hr(ae))G++;for(;0<W-G;)ge=Hr(ge),W--;for(;0<G-W;)q=Hr(q),G--;for(;W--;){if(ge===q||q!==null&&ge===q.alternate)break t;ge=Hr(ge),q=Hr(q)}ge=null}else ge=null;fe!==null&&ra(oe,ie,fe,ge,!1),_e!==null&&He!==null&&ra(oe,He,_e,ge,!0)}}e:{if(ie=X?Ur(X):window,fe=ie.nodeName&&ie.nodeName.toLowerCase(),fe==="select"||fe==="input"&&ie.type==="file")var ve=oh;else if(Ol(ie))if(Nl)ve=uh;else{ve=ah;var me=lh}else(fe=ie.nodeName)&&fe.toLowerCase()==="input"&&(ie.type==="checkbox"||ie.type==="radio")&&(ve=ch);if(ve&&(ve=ve(e,X))){Il(oe,ve,r,se);break e}me&&me(e,ie,X),e==="focusout"&&(me=ie._wrapperState)&&me.controlled&&ie.type==="number"&&gr(ie,"number",ie.value)}switch(me=X?Ur(X):window,e){case"focusin":(Ol(me)||me.contentEditable==="true")&&(Nr=me,Rn=X,mi=null);break;case"focusout":mi=Rn=Nr=null;break;case"mousedown":Ln=!0;break;case"contextmenu":case"mouseup":case"dragend":Ln=!1,Vl(oe,r,se);break;case"selectionchange":if(fh)break;case"keydown":case"keyup":Vl(oe,r,se)}var Se;if(xn)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else Ir?Bl(e,r)&&(Ce="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ce="onCompositionStart");Ce&&(Tl&&r.locale!=="ko"&&(Ir||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&Ir&&(Se=El()):(er=se,vn="value"in er?er.value:er.textContent,Ir=!0)),me=as(X,Ce),0<me.length&&(Ce=new Ll(Ce,e,null,r,se),oe.push({event:Ce,listeners:me}),Se?Ce.data=Se:(Se=Ml(r),Se!==null&&(Ce.data=Se)))),(Se=th?rh(e,r):ih(e,r))&&(X=as(X,"onBeforeInput"),0<X.length&&(se=new Ll("onBeforeInput","beforeinput",null,r,se),oe.push({event:se,listeners:X}),se.data=Se))}ea(oe,t)})}function wi(e,t,r){return{instance:e,listener:t,currentTarget:r}}function as(e,t){for(var r=t+"Capture",i=[];e!==null;){var c=e,d=c.stateNode;c.tag===5&&d!==null&&(c=d,d=ri(e,r),d!=null&&i.unshift(wi(e,d,c)),d=ri(e,t),d!=null&&i.push(wi(e,d,c))),e=e.return}return i}function Hr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ra(e,t,r,i,c){for(var d=t._reactName,E=[];r!==null&&r!==i;){var O=r,H=O.alternate,X=O.stateNode;if(H!==null&&H===i)break;O.tag===5&&X!==null&&(O=X,c?(H=ri(r,d),H!=null&&E.unshift(wi(r,H,O))):c||(H=ri(r,d),H!=null&&E.push(wi(r,H,O)))),r=r.return}E.length!==0&&e.push({event:t,listeners:E})}var vh=/\r\n?/g,mh=/\u0000|\uFFFD/g;function ia(e){return(typeof e=="string"?e:""+e).replace(vh,`
38
+ `).replace(mh,"")}function cs(e,t,r){if(t=ia(t),ia(e)!==t&&r)throw Error(A(425))}function us(){}var Mn=null,On=null;function In(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 Nn=typeof setTimeout=="function"?setTimeout:void 0,Sh=typeof clearTimeout=="function"?clearTimeout:void 0,sa=typeof Promise=="function"?Promise:void 0,yh=typeof queueMicrotask=="function"?queueMicrotask:typeof sa<"u"?function(e){return sa.resolve(null).then(e).catch(wh)}:Nn;function wh(e){setTimeout(function(){throw e})}function jn(e,t){var r=t,i=0;do{var c=r.nextSibling;if(e.removeChild(r),c&&c.nodeType===8)if(r=c.data,r==="/$"){if(i===0){e.removeChild(c),hi(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=c}while(r);hi(t)}function rr(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 na(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Fr=Math.random().toString(36).slice(2),Bt="__reactFiber$"+Fr,Ci="__reactProps$"+Fr,jt="__reactContainer$"+Fr,Hn="__reactEvents$"+Fr,Ch="__reactListeners$"+Fr,xh="__reactHandles$"+Fr;function yr(e){var t=e[Bt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[jt]||r[Bt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=na(e);e!==null;){if(r=e[Bt])return r;e=na(e)}return t}e=r,r=e.parentNode}return null}function xi(e){return e=e[Bt]||e[jt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ur(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(A(33))}function hs(e){return e[Ci]||null}var Fn=[],zr=-1;function ir(e){return{current:e}}function Be(e){0>zr||(e.current=Fn[zr],Fn[zr]=null,zr--)}function De(e,t){zr++,Fn[zr]=e.current,e.current=t}var sr={},Qe=ir(sr),nt=ir(!1),wr=sr;function Wr(e,t){var r=e.type.contextTypes;if(!r)return sr;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var c={},d;for(d in r)c[d]=t[d];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=c),c}function ot(e){return e=e.childContextTypes,e!=null}function ds(){Be(nt),Be(Qe)}function oa(e,t,r){if(Qe.current!==sr)throw Error(A(168));De(Qe,t),De(nt,r)}function la(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var c in i)if(!(c in t))throw Error(A(108,U(e)||"Unknown",c));return D({},r,i)}function fs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||sr,wr=Qe.current,De(Qe,e),De(nt,nt.current),!0}function aa(e,t,r){var i=e.stateNode;if(!i)throw Error(A(169));r?(e=la(e,t,wr),i.__reactInternalMemoizedMergedChildContext=e,Be(nt),Be(Qe),De(Qe,e)):Be(nt),De(nt,r)}var Ht=null,ps=!1,Un=!1;function ca(e){Ht===null?Ht=[e]:Ht.push(e)}function bh(e){ps=!0,ca(e)}function nr(){if(!Un&&Ht!==null){Un=!0;var e=0,t=Re;try{var r=Ht;for(Re=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}Ht=null,ps=!1}catch(c){throw Ht!==null&&(Ht=Ht.slice(e+1)),hl(cn,nr),c}finally{Re=t,Un=!1}}return null}var $r=[],Vr=0,_s=null,gs=0,vt=[],mt=0,Cr=null,Ft=1,Ut="";function xr(e,t){$r[Vr++]=gs,$r[Vr++]=_s,_s=e,gs=t}function ua(e,t,r){vt[mt++]=Ft,vt[mt++]=Ut,vt[mt++]=Cr,Cr=e;var i=Ft;e=Ut;var c=32-bt(i)-1;i&=~(1<<c),r+=1;var d=32-bt(t)+c;if(30<d){var E=c-c%5;d=(i&(1<<E)-1).toString(32),i>>=E,c-=E,Ft=1<<32-bt(t)+c|r<<c|i,Ut=d+e}else Ft=1<<d|r<<c|i,Ut=e}function zn(e){e.return!==null&&(xr(e,1),ua(e,1,0))}function Wn(e){for(;e===_s;)_s=$r[--Vr],$r[Vr]=null,gs=$r[--Vr],$r[Vr]=null;for(;e===Cr;)Cr=vt[--mt],vt[mt]=null,Ut=vt[--mt],vt[mt]=null,Ft=vt[--mt],vt[mt]=null}var pt=null,_t=null,Me=!1,kt=null;function ha(e,t){var r=Ct(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function da(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,pt=e,_t=rr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,pt=e,_t=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Cr!==null?{id:Ft,overflow:Ut}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Ct(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,pt=e,_t=null,!0):!1;default:return!1}}function $n(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Vn(e){if(Me){var t=_t;if(t){var r=t;if(!da(e,t)){if($n(e))throw Error(A(418));t=rr(r.nextSibling);var i=pt;t&&da(e,t)?ha(i,r):(e.flags=e.flags&-4097|2,Me=!1,pt=e)}}else{if($n(e))throw Error(A(418));e.flags=e.flags&-4097|2,Me=!1,pt=e}}}function fa(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;pt=e}function vs(e){if(e!==pt)return!1;if(!Me)return fa(e),Me=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!In(e.type,e.memoizedProps)),t&&(t=_t)){if($n(e))throw pa(),Error(A(418));for(;t;)ha(e,t),t=rr(t.nextSibling)}if(fa(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(A(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){_t=rr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}_t=null}}else _t=pt?rr(e.stateNode.nextSibling):null;return!0}function pa(){for(var e=_t;e;)e=rr(e.nextSibling)}function Kr(){_t=pt=null,Me=!1}function Kn(e){kt===null?kt=[e]:kt.push(e)}var Eh=f.ReactCurrentBatchConfig;function bi(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(A(309));var i=r.stateNode}if(!i)throw Error(A(147,e));var c=i,d=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===d?t.ref:(t=function(E){var O=c.refs;E===null?delete O[d]:O[d]=E},t._stringRef=d,t)}if(typeof e!="string")throw Error(A(284));if(!r._owner)throw Error(A(290,e))}return e}function ms(e,t){throw e=Object.prototype.toString.call(t),Error(A(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function _a(e){var t=e._init;return t(e._payload)}function ga(e){function t(q,W){if(e){var G=q.deletions;G===null?(q.deletions=[W],q.flags|=16):G.push(W)}}function r(q,W){if(!e)return null;for(;W!==null;)t(q,W),W=W.sibling;return null}function i(q,W){for(q=new Map;W!==null;)W.key!==null?q.set(W.key,W):q.set(W.index,W),W=W.sibling;return q}function c(q,W){return q=fr(q,W),q.index=0,q.sibling=null,q}function d(q,W,G){return q.index=G,e?(G=q.alternate,G!==null?(G=G.index,G<W?(q.flags|=2,W):G):(q.flags|=2,W)):(q.flags|=1048576,W)}function E(q){return e&&q.alternate===null&&(q.flags|=2),q}function O(q,W,G,ae){return W===null||W.tag!==6?(W=jo(G,q.mode,ae),W.return=q,W):(W=c(W,G),W.return=q,W)}function H(q,W,G,ae){var ve=G.type;return ve===b?se(q,W,G.props.children,ae,G.key):W!==null&&(W.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===ne&&_a(ve)===W.type)?(ae=c(W,G.props),ae.ref=bi(q,W,G),ae.return=q,ae):(ae=zs(G.type,G.key,G.props,null,q.mode,ae),ae.ref=bi(q,W,G),ae.return=q,ae)}function X(q,W,G,ae){return W===null||W.tag!==4||W.stateNode.containerInfo!==G.containerInfo||W.stateNode.implementation!==G.implementation?(W=Ho(G,q.mode,ae),W.return=q,W):(W=c(W,G.children||[]),W.return=q,W)}function se(q,W,G,ae,ve){return W===null||W.tag!==7?(W=Ar(G,q.mode,ae,ve),W.return=q,W):(W=c(W,G),W.return=q,W)}function oe(q,W,G){if(typeof W=="string"&&W!==""||typeof W=="number")return W=jo(""+W,q.mode,G),W.return=q,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case w:return G=zs(W.type,W.key,W.props,null,q.mode,G),G.ref=bi(q,null,W),G.return=q,G;case y:return W=Ho(W,q.mode,G),W.return=q,W;case ne:var ae=W._init;return oe(q,ae(W._payload),G)}if(Nt(W)||C(W))return W=Ar(W,q.mode,G,null),W.return=q,W;ms(q,W)}return null}function ie(q,W,G,ae){var ve=W!==null?W.key:null;if(typeof G=="string"&&G!==""||typeof G=="number")return ve!==null?null:O(q,W,""+G,ae);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case w:return G.key===ve?H(q,W,G,ae):null;case y:return G.key===ve?X(q,W,G,ae):null;case ne:return ve=G._init,ie(q,W,ve(G._payload),ae)}if(Nt(G)||C(G))return ve!==null?null:se(q,W,G,ae,null);ms(q,G)}return null}function fe(q,W,G,ae,ve){if(typeof ae=="string"&&ae!==""||typeof ae=="number")return q=q.get(G)||null,O(W,q,""+ae,ve);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case w:return q=q.get(ae.key===null?G:ae.key)||null,H(W,q,ae,ve);case y:return q=q.get(ae.key===null?G:ae.key)||null,X(W,q,ae,ve);case ne:var me=ae._init;return fe(q,W,G,me(ae._payload),ve)}if(Nt(ae)||C(ae))return q=q.get(G)||null,se(W,q,ae,ve,null);ms(W,ae)}return null}function _e(q,W,G,ae){for(var ve=null,me=null,Se=W,Ce=W=0,Ve=null;Se!==null&&Ce<G.length;Ce++){Se.index>Ce?(Ve=Se,Se=null):Ve=Se.sibling;var ke=ie(q,Se,G[Ce],ae);if(ke===null){Se===null&&(Se=Ve);break}e&&Se&&ke.alternate===null&&t(q,Se),W=d(ke,W,Ce),me===null?ve=ke:me.sibling=ke,me=ke,Se=Ve}if(Ce===G.length)return r(q,Se),Me&&xr(q,Ce),ve;if(Se===null){for(;Ce<G.length;Ce++)Se=oe(q,G[Ce],ae),Se!==null&&(W=d(Se,W,Ce),me===null?ve=Se:me.sibling=Se,me=Se);return Me&&xr(q,Ce),ve}for(Se=i(q,Se);Ce<G.length;Ce++)Ve=fe(Se,q,Ce,G[Ce],ae),Ve!==null&&(e&&Ve.alternate!==null&&Se.delete(Ve.key===null?Ce:Ve.key),W=d(Ve,W,Ce),me===null?ve=Ve:me.sibling=Ve,me=Ve);return e&&Se.forEach(function(pr){return t(q,pr)}),Me&&xr(q,Ce),ve}function ge(q,W,G,ae){var ve=C(G);if(typeof ve!="function")throw Error(A(150));if(G=ve.call(G),G==null)throw Error(A(151));for(var me=ve=null,Se=W,Ce=W=0,Ve=null,ke=G.next();Se!==null&&!ke.done;Ce++,ke=G.next()){Se.index>Ce?(Ve=Se,Se=null):Ve=Se.sibling;var pr=ie(q,Se,ke.value,ae);if(pr===null){Se===null&&(Se=Ve);break}e&&Se&&pr.alternate===null&&t(q,Se),W=d(pr,W,Ce),me===null?ve=pr:me.sibling=pr,me=pr,Se=Ve}if(ke.done)return r(q,Se),Me&&xr(q,Ce),ve;if(Se===null){for(;!ke.done;Ce++,ke=G.next())ke=oe(q,ke.value,ae),ke!==null&&(W=d(ke,W,Ce),me===null?ve=ke:me.sibling=ke,me=ke);return Me&&xr(q,Ce),ve}for(Se=i(q,Se);!ke.done;Ce++,ke=G.next())ke=fe(Se,q,Ce,ke.value,ae),ke!==null&&(e&&ke.alternate!==null&&Se.delete(ke.key===null?Ce:ke.key),W=d(ke,W,Ce),me===null?ve=ke:me.sibling=ke,me=ke);return e&&Se.forEach(function(sd){return t(q,sd)}),Me&&xr(q,Ce),ve}function He(q,W,G,ae){if(typeof G=="object"&&G!==null&&G.type===b&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case w:e:{for(var ve=G.key,me=W;me!==null;){if(me.key===ve){if(ve=G.type,ve===b){if(me.tag===7){r(q,me.sibling),W=c(me,G.props.children),W.return=q,q=W;break e}}else if(me.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===ne&&_a(ve)===me.type){r(q,me.sibling),W=c(me,G.props),W.ref=bi(q,me,G),W.return=q,q=W;break e}r(q,me);break}else t(q,me);me=me.sibling}G.type===b?(W=Ar(G.props.children,q.mode,ae,G.key),W.return=q,q=W):(ae=zs(G.type,G.key,G.props,null,q.mode,ae),ae.ref=bi(q,W,G),ae.return=q,q=ae)}return E(q);case y:e:{for(me=G.key;W!==null;){if(W.key===me)if(W.tag===4&&W.stateNode.containerInfo===G.containerInfo&&W.stateNode.implementation===G.implementation){r(q,W.sibling),W=c(W,G.children||[]),W.return=q,q=W;break e}else{r(q,W);break}else t(q,W);W=W.sibling}W=Ho(G,q.mode,ae),W.return=q,q=W}return E(q);case ne:return me=G._init,He(q,W,me(G._payload),ae)}if(Nt(G))return _e(q,W,G,ae);if(C(G))return ge(q,W,G,ae);ms(q,G)}return typeof G=="string"&&G!==""||typeof G=="number"?(G=""+G,W!==null&&W.tag===6?(r(q,W.sibling),W=c(W,G),W.return=q,q=W):(r(q,W),W=jo(G,q.mode,ae),W.return=q,q=W),E(q)):r(q,W)}return He}var qr=ga(!0),va=ga(!1),Ss=ir(null),ys=null,Gr=null,qn=null;function Gn(){qn=Gr=ys=null}function Xn(e){var t=Ss.current;Be(Ss),e._currentValue=t}function Qn(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function Xr(e,t){ys=e,qn=Gr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(lt=!0),e.firstContext=null)}function St(e){var t=e._currentValue;if(qn!==e)if(e={context:e,memoizedValue:t,next:null},Gr===null){if(ys===null)throw Error(A(308));Gr=e,ys.dependencies={lanes:0,firstContext:e}}else Gr=Gr.next=e;return t}var br=null;function Yn(e){br===null?br=[e]:br.push(e)}function ma(e,t,r,i){var c=t.interleaved;return c===null?(r.next=r,Yn(t)):(r.next=c.next,c.next=r),t.interleaved=r,zt(e,i)}function zt(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var or=!1;function Jn(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Sa(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 Wt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function lr(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ee&2)!==0){var c=i.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),i.pending=t,zt(e,r)}return c=i.interleaved,c===null?(t.next=t,Yn(i)):(t.next=c.next,c.next=t),i.interleaved=t,zt(e,r)}function ws(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,dn(e,r)}}function ya(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var c=null,d=null;if(r=r.firstBaseUpdate,r!==null){do{var E={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};d===null?c=d=E:d=d.next=E,r=r.next}while(r!==null);d===null?c=d=t:d=d.next=t}else c=d=t;r={baseState:i.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Cs(e,t,r,i){var c=e.updateQueue;or=!1;var d=c.firstBaseUpdate,E=c.lastBaseUpdate,O=c.shared.pending;if(O!==null){c.shared.pending=null;var H=O,X=H.next;H.next=null,E===null?d=X:E.next=X,E=H;var se=e.alternate;se!==null&&(se=se.updateQueue,O=se.lastBaseUpdate,O!==E&&(O===null?se.firstBaseUpdate=X:O.next=X,se.lastBaseUpdate=H))}if(d!==null){var oe=c.baseState;E=0,se=X=H=null,O=d;do{var ie=O.lane,fe=O.eventTime;if((i&ie)===ie){se!==null&&(se=se.next={eventTime:fe,lane:0,tag:O.tag,payload:O.payload,callback:O.callback,next:null});e:{var _e=e,ge=O;switch(ie=t,fe=r,ge.tag){case 1:if(_e=ge.payload,typeof _e=="function"){oe=_e.call(fe,oe,ie);break e}oe=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=ge.payload,ie=typeof _e=="function"?_e.call(fe,oe,ie):_e,ie==null)break e;oe=D({},oe,ie);break e;case 2:or=!0}}O.callback!==null&&O.lane!==0&&(e.flags|=64,ie=c.effects,ie===null?c.effects=[O]:ie.push(O))}else fe={eventTime:fe,lane:ie,tag:O.tag,payload:O.payload,callback:O.callback,next:null},se===null?(X=se=fe,H=oe):se=se.next=fe,E|=ie;if(O=O.next,O===null){if(O=c.shared.pending,O===null)break;ie=O,O=ie.next,ie.next=null,c.lastBaseUpdate=ie,c.shared.pending=null}}while(!0);if(se===null&&(H=oe),c.baseState=H,c.firstBaseUpdate=X,c.lastBaseUpdate=se,t=c.shared.interleaved,t!==null){c=t;do E|=c.lane,c=c.next;while(c!==t)}else d===null&&(c.shared.lanes=0);Rr|=E,e.lanes=E,e.memoizedState=oe}}function wa(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],c=i.callback;if(c!==null){if(i.callback=null,i=r,typeof c!="function")throw Error(A(191,c));c.call(i)}}}var Ei={},Mt=ir(Ei),ki=ir(Ei),Ri=ir(Ei);function Er(e){if(e===Ei)throw Error(A(174));return e}function Zn(e,t){switch(De(Ri,t),De(ki,e),De(Mt,Ei),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:vr(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=vr(t,e)}Be(Mt),De(Mt,t)}function Qr(){Be(Mt),Be(ki),Be(Ri)}function Ca(e){Er(Ri.current);var t=Er(Mt.current),r=vr(t,e.type);t!==r&&(De(ki,e),De(Mt,r))}function eo(e){ki.current===e&&(Be(Mt),Be(ki))}var Oe=ir(0);function xs(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var to=[];function ro(){for(var e=0;e<to.length;e++)to[e]._workInProgressVersionPrimary=null;to.length=0}var bs=f.ReactCurrentDispatcher,io=f.ReactCurrentBatchConfig,kr=0,Ie=null,Ue=null,We=null,Es=!1,Li=!1,Di=0,kh=0;function Ye(){throw Error(A(321))}function so(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Et(e[r],t[r]))return!1;return!0}function no(e,t,r,i,c,d){if(kr=d,Ie=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,bs.current=e===null||e.memoizedState===null?Th:Ah,e=r(i,c),Li){d=0;do{if(Li=!1,Di=0,25<=d)throw Error(A(301));d+=1,We=Ue=null,t.updateQueue=null,bs.current=Ph,e=r(i,c)}while(Li)}if(bs.current=Ls,t=Ue!==null&&Ue.next!==null,kr=0,We=Ue=Ie=null,Es=!1,t)throw Error(A(300));return e}function oo(){var e=Di!==0;return Di=0,e}function Ot(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?Ie.memoizedState=We=e:We=We.next=e,We}function yt(){if(Ue===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=Ue.next;var t=We===null?Ie.memoizedState:We.next;if(t!==null)We=t,Ue=e;else{if(e===null)throw Error(A(310));Ue=e,e={memoizedState:Ue.memoizedState,baseState:Ue.baseState,baseQueue:Ue.baseQueue,queue:Ue.queue,next:null},We===null?Ie.memoizedState=We=e:We=We.next=e}return We}function Ti(e,t){return typeof t=="function"?t(e):t}function lo(e){var t=yt(),r=t.queue;if(r===null)throw Error(A(311));r.lastRenderedReducer=e;var i=Ue,c=i.baseQueue,d=r.pending;if(d!==null){if(c!==null){var E=c.next;c.next=d.next,d.next=E}i.baseQueue=c=d,r.pending=null}if(c!==null){d=c.next,i=i.baseState;var O=E=null,H=null,X=d;do{var se=X.lane;if((kr&se)===se)H!==null&&(H=H.next={lane:0,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),i=X.hasEagerState?X.eagerState:e(i,X.action);else{var oe={lane:se,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null};H===null?(O=H=oe,E=i):H=H.next=oe,Ie.lanes|=se,Rr|=se}X=X.next}while(X!==null&&X!==d);H===null?E=i:H.next=O,Et(i,t.memoizedState)||(lt=!0),t.memoizedState=i,t.baseState=E,t.baseQueue=H,r.lastRenderedState=i}if(e=r.interleaved,e!==null){c=e;do d=c.lane,Ie.lanes|=d,Rr|=d,c=c.next;while(c!==e)}else c===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function ao(e){var t=yt(),r=t.queue;if(r===null)throw Error(A(311));r.lastRenderedReducer=e;var i=r.dispatch,c=r.pending,d=t.memoizedState;if(c!==null){r.pending=null;var E=c=c.next;do d=e(d,E.action),E=E.next;while(E!==c);Et(d,t.memoizedState)||(lt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),r.lastRenderedState=d}return[d,i]}function xa(){}function ba(e,t){var r=Ie,i=yt(),c=t(),d=!Et(i.memoizedState,c);if(d&&(i.memoizedState=c,lt=!0),i=i.queue,co(Ra.bind(null,r,i,e),[e]),i.getSnapshot!==t||d||We!==null&&We.memoizedState.tag&1){if(r.flags|=2048,Ai(9,ka.bind(null,r,i,c,t),void 0,null),$e===null)throw Error(A(349));(kr&30)!==0||Ea(r,t,c)}return c}function Ea(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ie.updateQueue,t===null?(t={lastEffect:null,stores:null},Ie.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function ka(e,t,r,i){t.value=r,t.getSnapshot=i,La(t)&&Da(e)}function Ra(e,t,r){return r(function(){La(t)&&Da(e)})}function La(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Et(e,r)}catch{return!0}}function Da(e){var t=zt(e,1);t!==null&&Tt(t,e,1,-1)}function Ta(e){var t=Ot();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ti,lastRenderedState:e},t.queue=e,e=e.dispatch=Dh.bind(null,Ie,e),[t.memoizedState,e]}function Ai(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=Ie.updateQueue,t===null?(t={lastEffect:null,stores:null},Ie.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function Aa(){return yt().memoizedState}function ks(e,t,r,i){var c=Ot();Ie.flags|=e,c.memoizedState=Ai(1|t,r,void 0,i===void 0?null:i)}function Rs(e,t,r,i){var c=yt();i=i===void 0?null:i;var d=void 0;if(Ue!==null){var E=Ue.memoizedState;if(d=E.destroy,i!==null&&so(i,E.deps)){c.memoizedState=Ai(t,r,d,i);return}}Ie.flags|=e,c.memoizedState=Ai(1|t,r,d,i)}function Pa(e,t){return ks(8390656,8,e,t)}function co(e,t){return Rs(2048,8,e,t)}function Ba(e,t){return Rs(4,2,e,t)}function Ma(e,t){return Rs(4,4,e,t)}function Oa(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 Ia(e,t,r){return r=r!=null?r.concat([e]):null,Rs(4,4,Oa.bind(null,t,e),r)}function uo(){}function Na(e,t){var r=yt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&so(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function ja(e,t){var r=yt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&so(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function Ha(e,t,r){return(kr&21)===0?(e.baseState&&(e.baseState=!1,lt=!0),e.memoizedState=r):(Et(r,t)||(r=_l(),Ie.lanes|=r,Rr|=r,e.baseState=!0),t)}function Rh(e,t){var r=Re;Re=r!==0&&4>r?r:4,e(!0);var i=io.transition;io.transition={};try{e(!1),t()}finally{Re=r,io.transition=i}}function Fa(){return yt().memoizedState}function Lh(e,t,r){var i=hr(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},Ua(e))za(t,r);else if(r=ma(e,t,r,i),r!==null){var c=rt();Tt(r,e,i,c),Wa(r,t,i)}}function Dh(e,t,r){var i=hr(e),c={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(Ua(e))za(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var E=t.lastRenderedState,O=d(E,r);if(c.hasEagerState=!0,c.eagerState=O,Et(O,E)){var H=t.interleaved;H===null?(c.next=c,Yn(t)):(c.next=H.next,H.next=c),t.interleaved=c;return}}catch{}finally{}r=ma(e,t,c,i),r!==null&&(c=rt(),Tt(r,e,i,c),Wa(r,t,i))}}function Ua(e){var t=e.alternate;return e===Ie||t!==null&&t===Ie}function za(e,t){Li=Es=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Wa(e,t,r){if((r&4194240)!==0){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,dn(e,r)}}var Ls={readContext:St,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useInsertionEffect:Ye,useLayoutEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useMutableSource:Ye,useSyncExternalStore:Ye,useId:Ye,unstable_isNewReconciler:!1},Th={readContext:St,useCallback:function(e,t){return Ot().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:Pa,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ks(4194308,4,Oa.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ks(4194308,4,e,t)},useInsertionEffect:function(e,t){return ks(4,2,e,t)},useMemo:function(e,t){var r=Ot();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=Ot();return t=r!==void 0?r(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Lh.bind(null,Ie,e),[i.memoizedState,e]},useRef:function(e){var t=Ot();return e={current:e},t.memoizedState=e},useState:Ta,useDebugValue:uo,useDeferredValue:function(e){return Ot().memoizedState=e},useTransition:function(){var e=Ta(!1),t=e[0];return e=Rh.bind(null,e[1]),Ot().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=Ie,c=Ot();if(Me){if(r===void 0)throw Error(A(407));r=r()}else{if(r=t(),$e===null)throw Error(A(349));(kr&30)!==0||Ea(i,t,r)}c.memoizedState=r;var d={value:r,getSnapshot:t};return c.queue=d,Pa(Ra.bind(null,i,d,e),[e]),i.flags|=2048,Ai(9,ka.bind(null,i,d,r,t),void 0,null),r},useId:function(){var e=Ot(),t=$e.identifierPrefix;if(Me){var r=Ut,i=Ft;r=(i&~(1<<32-bt(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=Di++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=kh++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ah={readContext:St,useCallback:Na,useContext:St,useEffect:co,useImperativeHandle:Ia,useInsertionEffect:Ba,useLayoutEffect:Ma,useMemo:ja,useReducer:lo,useRef:Aa,useState:function(){return lo(Ti)},useDebugValue:uo,useDeferredValue:function(e){var t=yt();return Ha(t,Ue.memoizedState,e)},useTransition:function(){var e=lo(Ti)[0],t=yt().memoizedState;return[e,t]},useMutableSource:xa,useSyncExternalStore:ba,useId:Fa,unstable_isNewReconciler:!1},Ph={readContext:St,useCallback:Na,useContext:St,useEffect:co,useImperativeHandle:Ia,useInsertionEffect:Ba,useLayoutEffect:Ma,useMemo:ja,useReducer:ao,useRef:Aa,useState:function(){return ao(Ti)},useDebugValue:uo,useDeferredValue:function(e){var t=yt();return Ue===null?t.memoizedState=e:Ha(t,Ue.memoizedState,e)},useTransition:function(){var e=ao(Ti)[0],t=yt().memoizedState;return[e,t]},useMutableSource:xa,useSyncExternalStore:ba,useId:Fa,unstable_isNewReconciler:!1};function Rt(e,t){if(e&&e.defaultProps){t=D({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function ho(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:D({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Ds={isMounted:function(e){return(e=e._reactInternals)?Sr(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=rt(),c=hr(e),d=Wt(i,c);d.payload=t,r!=null&&(d.callback=r),t=lr(e,d,c),t!==null&&(Tt(t,e,c,i),ws(t,e,c))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=rt(),c=hr(e),d=Wt(i,c);d.tag=1,d.payload=t,r!=null&&(d.callback=r),t=lr(e,d,c),t!==null&&(Tt(t,e,c,i),ws(t,e,c))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=rt(),i=hr(e),c=Wt(r,i);c.tag=2,t!=null&&(c.callback=t),t=lr(e,c,i),t!==null&&(Tt(t,e,i,r),ws(t,e,i))}};function $a(e,t,r,i,c,d,E){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,d,E):t.prototype&&t.prototype.isPureReactComponent?!vi(r,i)||!vi(c,d):!0}function Va(e,t,r){var i=!1,c=sr,d=t.contextType;return typeof d=="object"&&d!==null?d=St(d):(c=ot(t)?wr:Qe.current,i=t.contextTypes,d=(i=i!=null)?Wr(e,c):sr),t=new t(r,d),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ds,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=c,e.__reactInternalMemoizedMaskedChildContext=d),t}function Ka(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&Ds.enqueueReplaceState(t,t.state,null)}function fo(e,t,r,i){var c=e.stateNode;c.props=r,c.state=e.memoizedState,c.refs={},Jn(e);var d=t.contextType;typeof d=="object"&&d!==null?c.context=St(d):(d=ot(t)?wr:Qe.current,c.context=Wr(e,d)),c.state=e.memoizedState,d=t.getDerivedStateFromProps,typeof d=="function"&&(ho(e,t,d,r),c.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(t=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),t!==c.state&&Ds.enqueueReplaceState(c,c.state,null),Cs(e,r,c,i),c.state=e.memoizedState),typeof c.componentDidMount=="function"&&(e.flags|=4194308)}function Yr(e,t){try{var r="",i=t;do r+=ce(i),i=i.return;while(i);var c=r}catch(d){c=`
39
+ Error generating stack: `+d.message+`
40
+ `+d.stack}return{value:e,source:t,stack:c,digest:null}}function po(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function _o(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Bh=typeof WeakMap=="function"?WeakMap:Map;function qa(e,t,r){r=Wt(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){Is||(Is=!0,To=i),_o(e,t)},r}function Ga(e,t,r){r=Wt(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var c=t.value;r.payload=function(){return i(c)},r.callback=function(){_o(e,t)}}var d=e.stateNode;return d!==null&&typeof d.componentDidCatch=="function"&&(r.callback=function(){_o(e,t),typeof i!="function"&&(cr===null?cr=new Set([this]):cr.add(this));var E=t.stack;this.componentDidCatch(t.value,{componentStack:E!==null?E:""})}),r}function Xa(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new Bh;var c=new Set;i.set(t,c)}else c=i.get(t),c===void 0&&(c=new Set,i.set(t,c));c.has(r)||(c.add(r),e=qh.bind(null,e,t,r),t.then(e,e))}function Qa(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ya(e,t,r,i,c){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Wt(-1,1),t.tag=2,lr(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=c,e)}var Mh=f.ReactCurrentOwner,lt=!1;function tt(e,t,r,i){t.child=e===null?va(t,null,r,i):qr(t,e.child,r,i)}function Ja(e,t,r,i,c){r=r.render;var d=t.ref;return Xr(t,c),i=no(e,t,r,i,d,c),r=oo(),e!==null&&!lt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~c,$t(e,t,c)):(Me&&r&&zn(t),t.flags|=1,tt(e,t,i,c),t.child)}function Za(e,t,r,i,c){if(e===null){var d=r.type;return typeof d=="function"&&!No(d)&&d.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=d,ec(e,t,d,i,c)):(e=zs(r.type,null,i,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,(e.lanes&c)===0){var E=d.memoizedProps;if(r=r.compare,r=r!==null?r:vi,r(E,i)&&e.ref===t.ref)return $t(e,t,c)}return t.flags|=1,e=fr(d,i),e.ref=t.ref,e.return=t,t.child=e}function ec(e,t,r,i,c){if(e!==null){var d=e.memoizedProps;if(vi(d,i)&&e.ref===t.ref)if(lt=!1,t.pendingProps=i=d,(e.lanes&c)!==0)(e.flags&131072)!==0&&(lt=!0);else return t.lanes=e.lanes,$t(e,t,c)}return go(e,t,r,i,c)}function tc(e,t,r){var i=t.pendingProps,c=i.children,d=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},De(Zr,gt),gt|=r;else{if((r&1073741824)===0)return e=d!==null?d.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,De(Zr,gt),gt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=d!==null?d.baseLanes:r,De(Zr,gt),gt|=i}else d!==null?(i=d.baseLanes|r,t.memoizedState=null):i=r,De(Zr,gt),gt|=i;return tt(e,t,c,r),t.child}function rc(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function go(e,t,r,i,c){var d=ot(r)?wr:Qe.current;return d=Wr(t,d),Xr(t,c),r=no(e,t,r,i,d,c),i=oo(),e!==null&&!lt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~c,$t(e,t,c)):(Me&&i&&zn(t),t.flags|=1,tt(e,t,r,c),t.child)}function ic(e,t,r,i,c){if(ot(r)){var d=!0;fs(t)}else d=!1;if(Xr(t,c),t.stateNode===null)As(e,t),Va(t,r,i),fo(t,r,i,c),i=!0;else if(e===null){var E=t.stateNode,O=t.memoizedProps;E.props=O;var H=E.context,X=r.contextType;typeof X=="object"&&X!==null?X=St(X):(X=ot(r)?wr:Qe.current,X=Wr(t,X));var se=r.getDerivedStateFromProps,oe=typeof se=="function"||typeof E.getSnapshotBeforeUpdate=="function";oe||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(O!==i||H!==X)&&Ka(t,E,i,X),or=!1;var ie=t.memoizedState;E.state=ie,Cs(t,i,E,c),H=t.memoizedState,O!==i||ie!==H||nt.current||or?(typeof se=="function"&&(ho(t,r,se,i),H=t.memoizedState),(O=or||$a(t,r,O,i,ie,H,X))?(oe||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(t.flags|=4194308)):(typeof E.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=H),E.props=i,E.state=H,E.context=X,i=O):(typeof E.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{E=t.stateNode,Sa(e,t),O=t.memoizedProps,X=t.type===t.elementType?O:Rt(t.type,O),E.props=X,oe=t.pendingProps,ie=E.context,H=r.contextType,typeof H=="object"&&H!==null?H=St(H):(H=ot(r)?wr:Qe.current,H=Wr(t,H));var fe=r.getDerivedStateFromProps;(se=typeof fe=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(O!==oe||ie!==H)&&Ka(t,E,i,H),or=!1,ie=t.memoizedState,E.state=ie,Cs(t,i,E,c);var _e=t.memoizedState;O!==oe||ie!==_e||nt.current||or?(typeof fe=="function"&&(ho(t,r,fe,i),_e=t.memoizedState),(X=or||$a(t,r,X,i,ie,_e,H)||!1)?(se||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(i,_e,H),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(i,_e,H)),typeof E.componentDidUpdate=="function"&&(t.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof E.componentDidUpdate!="function"||O===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=_e),E.props=i,E.state=_e,E.context=H,i=X):(typeof E.componentDidUpdate!="function"||O===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),i=!1)}return vo(e,t,r,i,d,c)}function vo(e,t,r,i,c,d){rc(e,t);var E=(t.flags&128)!==0;if(!i&&!E)return c&&aa(t,r,!1),$t(e,t,d);i=t.stateNode,Mh.current=t;var O=E&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&E?(t.child=qr(t,e.child,null,d),t.child=qr(t,null,O,d)):tt(e,t,O,d),t.memoizedState=i.state,c&&aa(t,r,!0),t.child}function sc(e){var t=e.stateNode;t.pendingContext?oa(e,t.pendingContext,t.pendingContext!==t.context):t.context&&oa(e,t.context,!1),Zn(e,t.containerInfo)}function nc(e,t,r,i,c){return Kr(),Kn(c),t.flags|=256,tt(e,t,r,i),t.child}var mo={dehydrated:null,treeContext:null,retryLane:0};function So(e){return{baseLanes:e,cachePool:null,transitions:null}}function oc(e,t,r){var i=t.pendingProps,c=Oe.current,d=!1,E=(t.flags&128)!==0,O;if((O=E)||(O=e!==null&&e.memoizedState===null?!1:(c&2)!==0),O?(d=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(c|=1),De(Oe,c&1),e===null)return Vn(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):(E=i.children,e=i.fallback,d?(i=t.mode,d=t.child,E={mode:"hidden",children:E},(i&1)===0&&d!==null?(d.childLanes=0,d.pendingProps=E):d=Ws(E,i,0,null),e=Ar(e,i,r,null),d.return=t,e.return=t,d.sibling=e,t.child=d,t.child.memoizedState=So(r),t.memoizedState=mo,e):yo(t,E));if(c=e.memoizedState,c!==null&&(O=c.dehydrated,O!==null))return Oh(e,t,E,i,O,c,r);if(d){d=i.fallback,E=t.mode,c=e.child,O=c.sibling;var H={mode:"hidden",children:i.children};return(E&1)===0&&t.child!==c?(i=t.child,i.childLanes=0,i.pendingProps=H,t.deletions=null):(i=fr(c,H),i.subtreeFlags=c.subtreeFlags&14680064),O!==null?d=fr(O,d):(d=Ar(d,E,r,null),d.flags|=2),d.return=t,i.return=t,i.sibling=d,t.child=i,i=d,d=t.child,E=e.child.memoizedState,E=E===null?So(r):{baseLanes:E.baseLanes|r,cachePool:null,transitions:E.transitions},d.memoizedState=E,d.childLanes=e.childLanes&~r,t.memoizedState=mo,i}return d=e.child,e=d.sibling,i=fr(d,{mode:"visible",children:i.children}),(t.mode&1)===0&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function yo(e,t){return t=Ws({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ts(e,t,r,i){return i!==null&&Kn(i),qr(t,e.child,null,r),e=yo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Oh(e,t,r,i,c,d,E){if(r)return t.flags&256?(t.flags&=-257,i=po(Error(A(422))),Ts(e,t,E,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(d=i.fallback,c=t.mode,i=Ws({mode:"visible",children:i.children},c,0,null),d=Ar(d,c,E,null),d.flags|=2,i.return=t,d.return=t,i.sibling=d,t.child=i,(t.mode&1)!==0&&qr(t,e.child,null,E),t.child.memoizedState=So(E),t.memoizedState=mo,d);if((t.mode&1)===0)return Ts(e,t,E,null);if(c.data==="$!"){if(i=c.nextSibling&&c.nextSibling.dataset,i)var O=i.dgst;return i=O,d=Error(A(419)),i=po(d,i,void 0),Ts(e,t,E,i)}if(O=(E&e.childLanes)!==0,lt||O){if(i=$e,i!==null){switch(E&-E){case 4:c=2;break;case 16:c=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:c=32;break;case 536870912:c=268435456;break;default:c=0}c=(c&(i.suspendedLanes|E))!==0?0:c,c!==0&&c!==d.retryLane&&(d.retryLane=c,zt(e,c),Tt(i,e,c,-1))}return Io(),i=po(Error(A(421))),Ts(e,t,E,i)}return c.data==="$?"?(t.flags|=128,t.child=e.child,t=Gh.bind(null,e),c._reactRetry=t,null):(e=d.treeContext,_t=rr(c.nextSibling),pt=t,Me=!0,kt=null,e!==null&&(vt[mt++]=Ft,vt[mt++]=Ut,vt[mt++]=Cr,Ft=e.id,Ut=e.overflow,Cr=t),t=yo(t,i.children),t.flags|=4096,t)}function lc(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Qn(e.return,t,r)}function wo(e,t,r,i,c){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:c}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=i,d.tail=r,d.tailMode=c)}function ac(e,t,r){var i=t.pendingProps,c=i.revealOrder,d=i.tail;if(tt(e,t,i.children,r),i=Oe.current,(i&2)!==0)i=i&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&&lc(e,r,t);else if(e.tag===19)lc(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(De(Oe,i),(t.mode&1)===0)t.memoizedState=null;else switch(c){case"forwards":for(r=t.child,c=null;r!==null;)e=r.alternate,e!==null&&xs(e)===null&&(c=r),r=r.sibling;r=c,r===null?(c=t.child,t.child=null):(c=r.sibling,r.sibling=null),wo(t,!1,c,r,d);break;case"backwards":for(r=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&xs(e)===null){t.child=c;break}e=c.sibling,c.sibling=r,r=c,c=e}wo(t,!0,r,null,d);break;case"together":wo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function As(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function $t(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Rr|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(A(153));if(t.child!==null){for(e=t.child,r=fr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=fr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Ih(e,t,r){switch(t.tag){case 3:sc(t),Kr();break;case 5:Ca(t);break;case 1:ot(t.type)&&fs(t);break;case 4:Zn(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,c=t.memoizedProps.value;De(Ss,i._currentValue),i._currentValue=c;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(De(Oe,Oe.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?oc(e,t,r):(De(Oe,Oe.current&1),e=$t(e,t,r),e!==null?e.sibling:null);De(Oe,Oe.current&1);break;case 19:if(i=(r&t.childLanes)!==0,(e.flags&128)!==0){if(i)return ac(e,t,r);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),De(Oe,Oe.current),i)break;return null;case 22:case 23:return t.lanes=0,tc(e,t,r)}return $t(e,t,r)}var cc,Co,uc,hc;cc=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Co=function(){},uc=function(e,t,r,i){var c=e.memoizedProps;if(c!==i){e=t.stateNode,Er(Mt.current);var d=null;switch(r){case"input":c=Le(e,c),i=Le(e,i),d=[];break;case"select":c=D({},c,{value:void 0}),i=D({},i,{value:void 0}),d=[];break;case"textarea":c=qt(e,c),i=qt(e,i),d=[];break;default:typeof c.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=us)}en(r,i);var E;r=null;for(X in c)if(!i.hasOwnProperty(X)&&c.hasOwnProperty(X)&&c[X]!=null)if(X==="style"){var O=c[X];for(E in O)O.hasOwnProperty(E)&&(r||(r={}),r[E]="")}else X!=="dangerouslySetInnerHTML"&&X!=="children"&&X!=="suppressContentEditableWarning"&&X!=="suppressHydrationWarning"&&X!=="autoFocus"&&(K.hasOwnProperty(X)?d||(d=[]):(d=d||[]).push(X,null));for(X in i){var H=i[X];if(O=c!=null?c[X]:void 0,i.hasOwnProperty(X)&&H!==O&&(H!=null||O!=null))if(X==="style")if(O){for(E in O)!O.hasOwnProperty(E)||H&&H.hasOwnProperty(E)||(r||(r={}),r[E]="");for(E in H)H.hasOwnProperty(E)&&O[E]!==H[E]&&(r||(r={}),r[E]=H[E])}else r||(d||(d=[]),d.push(X,r)),r=H;else X==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,O=O?O.__html:void 0,H!=null&&O!==H&&(d=d||[]).push(X,H)):X==="children"?typeof H!="string"&&typeof H!="number"||(d=d||[]).push(X,""+H):X!=="suppressContentEditableWarning"&&X!=="suppressHydrationWarning"&&(K.hasOwnProperty(X)?(H!=null&&X==="onScroll"&&Pe("scroll",e),d||O===H||(d=[])):(d=d||[]).push(X,H))}r&&(d=d||[]).push("style",r);var X=d;(t.updateQueue=X)&&(t.flags|=4)}},hc=function(e,t,r,i){r!==i&&(t.flags|=4)};function Pi(e,t){if(!Me)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Je(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var c=e.child;c!==null;)r|=c.lanes|c.childLanes,i|=c.subtreeFlags&14680064,i|=c.flags&14680064,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)r|=c.lanes|c.childLanes,i|=c.subtreeFlags,i|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function Nh(e,t,r){var i=t.pendingProps;switch(Wn(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(t),null;case 1:return ot(t.type)&&ds(),Je(t),null;case 3:return i=t.stateNode,Qr(),Be(nt),Be(Qe),ro(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(vs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,kt!==null&&(Bo(kt),kt=null))),Co(e,t),Je(t),null;case 5:eo(t);var c=Er(Ri.current);if(r=t.type,e!==null&&t.stateNode!=null)uc(e,t,r,i,c),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(A(166));return Je(t),null}if(e=Er(Mt.current),vs(t)){i=t.stateNode,r=t.type;var d=t.memoizedProps;switch(i[Bt]=t,i[Ci]=d,e=(t.mode&1)!==0,r){case"dialog":Pe("cancel",i),Pe("close",i);break;case"iframe":case"object":case"embed":Pe("load",i);break;case"video":case"audio":for(c=0;c<Si.length;c++)Pe(Si[c],i);break;case"source":Pe("error",i);break;case"img":case"image":case"link":Pe("error",i),Pe("load",i);break;case"details":Pe("toggle",i);break;case"input":Te(i,d),Pe("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!d.multiple},Pe("invalid",i);break;case"textarea":et(i,d),Pe("invalid",i)}en(r,d),c=null;for(var E in d)if(d.hasOwnProperty(E)){var O=d[E];E==="children"?typeof O=="string"?i.textContent!==O&&(d.suppressHydrationWarning!==!0&&cs(i.textContent,O,e),c=["children",O]):typeof O=="number"&&i.textContent!==""+O&&(d.suppressHydrationWarning!==!0&&cs(i.textContent,O,e),c=["children",""+O]):K.hasOwnProperty(E)&&O!=null&&E==="onScroll"&&Pe("scroll",i)}switch(r){case"input":de(i),Kt(i,d,!0);break;case"textarea":de(i),ht(i);break;case"select":case"option":break;default:typeof d.onClick=="function"&&(i.onclick=us)}i=c,t.updateQueue=i,i!==null&&(t.flags|=4)}else{E=c.nodeType===9?c:c.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Xt(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=E.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=E.createElement(r,{is:i.is}):(e=E.createElement(r),r==="select"&&(E=e,i.multiple?E.multiple=!0:i.size&&(E.size=i.size))):e=E.createElementNS(e,r),e[Bt]=t,e[Ci]=i,cc(e,t,!1,!1),t.stateNode=e;e:{switch(E=tn(r,i),r){case"dialog":Pe("cancel",e),Pe("close",e),c=i;break;case"iframe":case"object":case"embed":Pe("load",e),c=i;break;case"video":case"audio":for(c=0;c<Si.length;c++)Pe(Si[c],e);c=i;break;case"source":Pe("error",e),c=i;break;case"img":case"image":case"link":Pe("error",e),Pe("load",e),c=i;break;case"details":Pe("toggle",e),c=i;break;case"input":Te(e,i),c=Le(e,i),Pe("invalid",e);break;case"option":c=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},c=D({},i,{value:void 0}),Pe("invalid",e);break;case"textarea":et(e,i),c=qt(e,i),Pe("invalid",e);break;default:c=i}en(r,c),O=c;for(d in O)if(O.hasOwnProperty(d)){var H=O[d];d==="style"?el(e,H):d==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,H!=null&&mr(e,H)):d==="children"?typeof H=="string"?(r!=="textarea"||H!=="")&&st(e,H):typeof H=="number"&&st(e,""+H):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(K.hasOwnProperty(d)?H!=null&&d==="onScroll"&&Pe("scroll",e):H!=null&&o(e,d,H,E))}switch(r){case"input":de(e),Kt(e,i,!1);break;case"textarea":de(e),ht(e);break;case"option":i.value!=null&&e.setAttribute("value",""+L(i.value));break;case"select":e.multiple=!!i.multiple,d=i.value,d!=null?At(e,!!i.multiple,d,!1):i.defaultValue!=null&&At(e,!!i.multiple,i.defaultValue,!0);break;default:typeof c.onClick=="function"&&(e.onclick=us)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Je(t),null;case 6:if(e&&t.stateNode!=null)hc(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(A(166));if(r=Er(Ri.current),Er(Mt.current),vs(t)){if(i=t.stateNode,r=t.memoizedProps,i[Bt]=t,(d=i.nodeValue!==r)&&(e=pt,e!==null))switch(e.tag){case 3:cs(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&cs(i.nodeValue,r,(e.mode&1)!==0)}d&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[Bt]=t,t.stateNode=i}return Je(t),null;case 13:if(Be(Oe),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Me&&_t!==null&&(t.mode&1)!==0&&(t.flags&128)===0)pa(),Kr(),t.flags|=98560,d=!1;else if(d=vs(t),i!==null&&i.dehydrated!==null){if(e===null){if(!d)throw Error(A(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(A(317));d[Bt]=t}else Kr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),d=!1}else kt!==null&&(Bo(kt),kt=null),d=!0;if(!d)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Oe.current&1)!==0?ze===0&&(ze=3):Io())),t.updateQueue!==null&&(t.flags|=4),Je(t),null);case 4:return Qr(),Co(e,t),e===null&&yi(t.stateNode.containerInfo),Je(t),null;case 10:return Xn(t.type._context),Je(t),null;case 17:return ot(t.type)&&ds(),Je(t),null;case 19:if(Be(Oe),d=t.memoizedState,d===null)return Je(t),null;if(i=(t.flags&128)!==0,E=d.rendering,E===null)if(i)Pi(d,!1);else{if(ze!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(E=xs(e),E!==null){for(t.flags|=128,Pi(d,!1),i=E.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)d=r,e=i,d.flags&=14680066,E=d.alternate,E===null?(d.childLanes=0,d.lanes=e,d.child=null,d.subtreeFlags=0,d.memoizedProps=null,d.memoizedState=null,d.updateQueue=null,d.dependencies=null,d.stateNode=null):(d.childLanes=E.childLanes,d.lanes=E.lanes,d.child=E.child,d.subtreeFlags=0,d.deletions=null,d.memoizedProps=E.memoizedProps,d.memoizedState=E.memoizedState,d.updateQueue=E.updateQueue,d.type=E.type,e=E.dependencies,d.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return De(Oe,Oe.current&1|2),t.child}e=e.sibling}d.tail!==null&&je()>ei&&(t.flags|=128,i=!0,Pi(d,!1),t.lanes=4194304)}else{if(!i)if(e=xs(E),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Pi(d,!0),d.tail===null&&d.tailMode==="hidden"&&!E.alternate&&!Me)return Je(t),null}else 2*je()-d.renderingStartTime>ei&&r!==1073741824&&(t.flags|=128,i=!0,Pi(d,!1),t.lanes=4194304);d.isBackwards?(E.sibling=t.child,t.child=E):(r=d.last,r!==null?r.sibling=E:t.child=E,d.last=E)}return d.tail!==null?(t=d.tail,d.rendering=t,d.tail=t.sibling,d.renderingStartTime=je(),t.sibling=null,r=Oe.current,De(Oe,i?r&1|2:r&1),t):(Je(t),null);case 22:case 23:return Oo(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&(t.mode&1)!==0?(gt&1073741824)!==0&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),null;case 24:return null;case 25:return null}throw Error(A(156,t.tag))}function jh(e,t){switch(Wn(t),t.tag){case 1:return ot(t.type)&&ds(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qr(),Be(nt),Be(Qe),ro(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return eo(t),null;case 13:if(Be(Oe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(A(340));Kr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Be(Oe),null;case 4:return Qr(),null;case 10:return Xn(t.type._context),null;case 22:case 23:return Oo(),null;case 24:return null;default:return null}}var Ps=!1,Ze=!1,Hh=typeof WeakSet=="function"?WeakSet:Set,pe=null;function Jr(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){Ne(e,t,i)}else r.current=null}function xo(e,t,r){try{r()}catch(i){Ne(e,t,i)}}var dc=!1;function Fh(e,t){if(Mn=Ji,e=$l(),kn(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var c=i.anchorOffset,d=i.focusNode;i=i.focusOffset;try{r.nodeType,d.nodeType}catch{r=null;break e}var E=0,O=-1,H=-1,X=0,se=0,oe=e,ie=null;t:for(;;){for(var fe;oe!==r||c!==0&&oe.nodeType!==3||(O=E+c),oe!==d||i!==0&&oe.nodeType!==3||(H=E+i),oe.nodeType===3&&(E+=oe.nodeValue.length),(fe=oe.firstChild)!==null;)ie=oe,oe=fe;for(;;){if(oe===e)break t;if(ie===r&&++X===c&&(O=E),ie===d&&++se===i&&(H=E),(fe=oe.nextSibling)!==null)break;oe=ie,ie=oe.parentNode}oe=fe}r=O===-1||H===-1?null:{start:O,end:H}}else r=null}r=r||{start:0,end:0}}else r=null;for(On={focusedElem:e,selectionRange:r},Ji=!1,pe=t;pe!==null;)if(t=pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pe=e;else for(;pe!==null;){t=pe;try{var _e=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(_e!==null){var ge=_e.memoizedProps,He=_e.memoizedState,q=t.stateNode,W=q.getSnapshotBeforeUpdate(t.elementType===t.type?ge:Rt(t.type,ge),He);q.__reactInternalSnapshotBeforeUpdate=W}break;case 3:var G=t.stateNode.containerInfo;G.nodeType===1?G.textContent="":G.nodeType===9&&G.documentElement&&G.removeChild(G.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(A(163))}}catch(ae){Ne(t,t.return,ae)}if(e=t.sibling,e!==null){e.return=t.return,pe=e;break}pe=t.return}return _e=dc,dc=!1,_e}function Bi(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var c=i=i.next;do{if((c.tag&e)===e){var d=c.destroy;c.destroy=void 0,d!==void 0&&xo(t,r,d)}c=c.next}while(c!==i)}}function Bs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function bo(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function fc(e){var t=e.alternate;t!==null&&(e.alternate=null,fc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Bt],delete t[Ci],delete t[Hn],delete t[Ch],delete t[xh])),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 pc(e){return e.tag===5||e.tag===3||e.tag===4}function _c(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||pc(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 Eo(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=us));else if(i!==4&&(e=e.child,e!==null))for(Eo(e,t,r),e=e.sibling;e!==null;)Eo(e,t,r),e=e.sibling}function ko(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(ko(e,t,r),e=e.sibling;e!==null;)ko(e,t,r),e=e.sibling}var Ge=null,Lt=!1;function ar(e,t,r){for(r=r.child;r!==null;)gc(e,t,r),r=r.sibling}function gc(e,t,r){if(Pt&&typeof Pt.onCommitFiberUnmount=="function")try{Pt.onCommitFiberUnmount(Ki,r)}catch{}switch(r.tag){case 5:Ze||Jr(r,t);case 6:var i=Ge,c=Lt;Ge=null,ar(e,t,r),Ge=i,Lt=c,Ge!==null&&(Lt?(e=Ge,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ge.removeChild(r.stateNode));break;case 18:Ge!==null&&(Lt?(e=Ge,r=r.stateNode,e.nodeType===8?jn(e.parentNode,r):e.nodeType===1&&jn(e,r),hi(e)):jn(Ge,r.stateNode));break;case 4:i=Ge,c=Lt,Ge=r.stateNode.containerInfo,Lt=!0,ar(e,t,r),Ge=i,Lt=c;break;case 0:case 11:case 14:case 15:if(!Ze&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){c=i=i.next;do{var d=c,E=d.destroy;d=d.tag,E!==void 0&&((d&2)!==0||(d&4)!==0)&&xo(r,t,E),c=c.next}while(c!==i)}ar(e,t,r);break;case 1:if(!Ze&&(Jr(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(O){Ne(r,t,O)}ar(e,t,r);break;case 21:ar(e,t,r);break;case 22:r.mode&1?(Ze=(i=Ze)||r.memoizedState!==null,ar(e,t,r),Ze=i):ar(e,t,r);break;default:ar(e,t,r)}}function vc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Hh),t.forEach(function(i){var c=Xh.bind(null,e,i);r.has(i)||(r.add(i),i.then(c,c))})}}function Dt(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var c=r[i];try{var d=e,E=t,O=E;e:for(;O!==null;){switch(O.tag){case 5:Ge=O.stateNode,Lt=!1;break e;case 3:Ge=O.stateNode.containerInfo,Lt=!0;break e;case 4:Ge=O.stateNode.containerInfo,Lt=!0;break e}O=O.return}if(Ge===null)throw Error(A(160));gc(d,E,c),Ge=null,Lt=!1;var H=c.alternate;H!==null&&(H.return=null),c.return=null}catch(X){Ne(c,t,X)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)mc(t,e),t=t.sibling}function mc(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Dt(t,e),It(e),i&4){try{Bi(3,e,e.return),Bs(3,e)}catch(ge){Ne(e,e.return,ge)}try{Bi(5,e,e.return)}catch(ge){Ne(e,e.return,ge)}}break;case 1:Dt(t,e),It(e),i&512&&r!==null&&Jr(r,r.return);break;case 5:if(Dt(t,e),It(e),i&512&&r!==null&&Jr(r,r.return),e.flags&32){var c=e.stateNode;try{st(c,"")}catch(ge){Ne(e,e.return,ge)}}if(i&4&&(c=e.stateNode,c!=null)){var d=e.memoizedProps,E=r!==null?r.memoizedProps:d,O=e.type,H=e.updateQueue;if(e.updateQueue=null,H!==null)try{O==="input"&&d.type==="radio"&&d.name!=null&&qe(c,d),tn(O,E);var X=tn(O,d);for(E=0;E<H.length;E+=2){var se=H[E],oe=H[E+1];se==="style"?el(c,oe):se==="dangerouslySetInnerHTML"?mr(c,oe):se==="children"?st(c,oe):o(c,se,oe,X)}switch(O){case"input":we(c,d);break;case"textarea":Gt(c,d);break;case"select":var ie=c._wrapperState.wasMultiple;c._wrapperState.wasMultiple=!!d.multiple;var fe=d.value;fe!=null?At(c,!!d.multiple,fe,!1):ie!==!!d.multiple&&(d.defaultValue!=null?At(c,!!d.multiple,d.defaultValue,!0):At(c,!!d.multiple,d.multiple?[]:"",!1))}c[Ci]=d}catch(ge){Ne(e,e.return,ge)}}break;case 6:if(Dt(t,e),It(e),i&4){if(e.stateNode===null)throw Error(A(162));c=e.stateNode,d=e.memoizedProps;try{c.nodeValue=d}catch(ge){Ne(e,e.return,ge)}}break;case 3:if(Dt(t,e),It(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{hi(t.containerInfo)}catch(ge){Ne(e,e.return,ge)}break;case 4:Dt(t,e),It(e);break;case 13:Dt(t,e),It(e),c=e.child,c.flags&8192&&(d=c.memoizedState!==null,c.stateNode.isHidden=d,!d||c.alternate!==null&&c.alternate.memoizedState!==null||(Do=je())),i&4&&vc(e);break;case 22:if(se=r!==null&&r.memoizedState!==null,e.mode&1?(Ze=(X=Ze)||se,Dt(t,e),Ze=X):Dt(t,e),It(e),i&8192){if(X=e.memoizedState!==null,(e.stateNode.isHidden=X)&&!se&&(e.mode&1)!==0)for(pe=e,se=e.child;se!==null;){for(oe=pe=se;pe!==null;){switch(ie=pe,fe=ie.child,ie.tag){case 0:case 11:case 14:case 15:Bi(4,ie,ie.return);break;case 1:Jr(ie,ie.return);var _e=ie.stateNode;if(typeof _e.componentWillUnmount=="function"){i=ie,r=ie.return;try{t=i,_e.props=t.memoizedProps,_e.state=t.memoizedState,_e.componentWillUnmount()}catch(ge){Ne(i,r,ge)}}break;case 5:Jr(ie,ie.return);break;case 22:if(ie.memoizedState!==null){wc(oe);continue}}fe!==null?(fe.return=ie,pe=fe):wc(oe)}se=se.sibling}e:for(se=null,oe=e;;){if(oe.tag===5){if(se===null){se=oe;try{c=oe.stateNode,X?(d=c.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none"):(O=oe.stateNode,H=oe.memoizedProps.style,E=H!=null&&H.hasOwnProperty("display")?H.display:null,O.style.display=zi("display",E))}catch(ge){Ne(e,e.return,ge)}}}else if(oe.tag===6){if(se===null)try{oe.stateNode.nodeValue=X?"":oe.memoizedProps}catch(ge){Ne(e,e.return,ge)}}else if((oe.tag!==22&&oe.tag!==23||oe.memoizedState===null||oe===e)&&oe.child!==null){oe.child.return=oe,oe=oe.child;continue}if(oe===e)break e;for(;oe.sibling===null;){if(oe.return===null||oe.return===e)break e;se===oe&&(se=null),oe=oe.return}se===oe&&(se=null),oe.sibling.return=oe.return,oe=oe.sibling}}break;case 19:Dt(t,e),It(e),i&4&&vc(e);break;case 21:break;default:Dt(t,e),It(e)}}function It(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(pc(r)){var i=r;break e}r=r.return}throw Error(A(160))}switch(i.tag){case 5:var c=i.stateNode;i.flags&32&&(st(c,""),i.flags&=-33);var d=_c(e);ko(e,d,c);break;case 3:case 4:var E=i.stateNode.containerInfo,O=_c(e);Eo(e,O,E);break;default:throw Error(A(161))}}catch(H){Ne(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Uh(e,t,r){pe=e,Sc(e)}function Sc(e,t,r){for(var i=(e.mode&1)!==0;pe!==null;){var c=pe,d=c.child;if(c.tag===22&&i){var E=c.memoizedState!==null||Ps;if(!E){var O=c.alternate,H=O!==null&&O.memoizedState!==null||Ze;O=Ps;var X=Ze;if(Ps=E,(Ze=H)&&!X)for(pe=c;pe!==null;)E=pe,H=E.child,E.tag===22&&E.memoizedState!==null?Cc(c):H!==null?(H.return=E,pe=H):Cc(c);for(;d!==null;)pe=d,Sc(d),d=d.sibling;pe=c,Ps=O,Ze=X}yc(e)}else(c.subtreeFlags&8772)!==0&&d!==null?(d.return=c,pe=d):yc(e)}}function yc(e){for(;pe!==null;){var t=pe;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Ze||Bs(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Ze)if(r===null)i.componentDidMount();else{var c=t.elementType===t.type?r.memoizedProps:Rt(t.type,r.memoizedProps);i.componentDidUpdate(c,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var d=t.updateQueue;d!==null&&wa(t,d,i);break;case 3:var E=t.updateQueue;if(E!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}wa(t,E,r)}break;case 5:var O=t.stateNode;if(r===null&&t.flags&4){r=O;var H=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":H.autoFocus&&r.focus();break;case"img":H.src&&(r.src=H.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var X=t.alternate;if(X!==null){var se=X.memoizedState;if(se!==null){var oe=se.dehydrated;oe!==null&&hi(oe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(A(163))}Ze||t.flags&512&&bo(t)}catch(ie){Ne(t,t.return,ie)}}if(t===e){pe=null;break}if(r=t.sibling,r!==null){r.return=t.return,pe=r;break}pe=t.return}}function wc(e){for(;pe!==null;){var t=pe;if(t===e){pe=null;break}var r=t.sibling;if(r!==null){r.return=t.return,pe=r;break}pe=t.return}}function Cc(e){for(;pe!==null;){var t=pe;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Bs(4,t)}catch(H){Ne(t,r,H)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var c=t.return;try{i.componentDidMount()}catch(H){Ne(t,c,H)}}var d=t.return;try{bo(t)}catch(H){Ne(t,d,H)}break;case 5:var E=t.return;try{bo(t)}catch(H){Ne(t,E,H)}}}catch(H){Ne(t,t.return,H)}if(t===e){pe=null;break}var O=t.sibling;if(O!==null){O.return=t.return,pe=O;break}pe=t.return}}var zh=Math.ceil,Ms=f.ReactCurrentDispatcher,Ro=f.ReactCurrentOwner,wt=f.ReactCurrentBatchConfig,Ee=0,$e=null,Fe=null,Xe=0,gt=0,Zr=ir(0),ze=0,Mi=null,Rr=0,Os=0,Lo=0,Oi=null,at=null,Do=0,ei=1/0,Vt=null,Is=!1,To=null,cr=null,Ns=!1,ur=null,js=0,Ii=0,Ao=null,Hs=-1,Fs=0;function rt(){return(Ee&6)!==0?je():Hs!==-1?Hs:Hs=je()}function hr(e){return(e.mode&1)===0?1:(Ee&2)!==0&&Xe!==0?Xe&-Xe:Eh.transition!==null?(Fs===0&&(Fs=_l()),Fs):(e=Re,e!==0||(e=window.event,e=e===void 0?16:bl(e.type)),e)}function Tt(e,t,r,i){if(50<Ii)throw Ii=0,Ao=null,Error(A(185));oi(e,r,i),((Ee&2)===0||e!==$e)&&(e===$e&&((Ee&2)===0&&(Os|=r),ze===4&&dr(e,Xe)),ct(e,i),r===1&&Ee===0&&(t.mode&1)===0&&(ei=je()+500,ps&&nr()))}function ct(e,t){var r=e.callbackNode;Eu(e,t);var i=Xi(e,e===$e?Xe:0);if(i===0)r!==null&&dl(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&dl(r),t===1)e.tag===0?bh(bc.bind(null,e)):ca(bc.bind(null,e)),yh(function(){(Ee&6)===0&&nr()}),r=null;else{switch(gl(i)){case 1:r=cn;break;case 4:r=fl;break;case 16:r=Vi;break;case 536870912:r=pl;break;default:r=Vi}r=Pc(r,xc.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function xc(e,t){if(Hs=-1,Fs=0,(Ee&6)!==0)throw Error(A(327));var r=e.callbackNode;if(ti()&&e.callbackNode!==r)return null;var i=Xi(e,e===$e?Xe:0);if(i===0)return null;if((i&30)!==0||(i&e.expiredLanes)!==0||t)t=Us(e,i);else{t=i;var c=Ee;Ee|=2;var d=kc();($e!==e||Xe!==t)&&(Vt=null,ei=je()+500,Dr(e,t));do try{Vh();break}catch(O){Ec(e,O)}while(!0);Gn(),Ms.current=d,Ee=c,Fe!==null?t=0:($e=null,Xe=0,t=ze)}if(t!==0){if(t===2&&(c=un(e),c!==0&&(i=c,t=Po(e,c))),t===1)throw r=Mi,Dr(e,0),dr(e,i),ct(e,je()),r;if(t===6)dr(e,i);else{if(c=e.current.alternate,(i&30)===0&&!Wh(c)&&(t=Us(e,i),t===2&&(d=un(e),d!==0&&(i=d,t=Po(e,d))),t===1))throw r=Mi,Dr(e,0),dr(e,i),ct(e,je()),r;switch(e.finishedWork=c,e.finishedLanes=i,t){case 0:case 1:throw Error(A(345));case 2:Tr(e,at,Vt);break;case 3:if(dr(e,i),(i&130023424)===i&&(t=Do+500-je(),10<t)){if(Xi(e,0)!==0)break;if(c=e.suspendedLanes,(c&i)!==i){rt(),e.pingedLanes|=e.suspendedLanes&c;break}e.timeoutHandle=Nn(Tr.bind(null,e,at,Vt),t);break}Tr(e,at,Vt);break;case 4:if(dr(e,i),(i&4194240)===i)break;for(t=e.eventTimes,c=-1;0<i;){var E=31-bt(i);d=1<<E,E=t[E],E>c&&(c=E),i&=~d}if(i=c,i=je()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*zh(i/1960))-i,10<i){e.timeoutHandle=Nn(Tr.bind(null,e,at,Vt),i);break}Tr(e,at,Vt);break;case 5:Tr(e,at,Vt);break;default:throw Error(A(329))}}}return ct(e,je()),e.callbackNode===r?xc.bind(null,e):null}function Po(e,t){var r=Oi;return e.current.memoizedState.isDehydrated&&(Dr(e,t).flags|=256),e=Us(e,t),e!==2&&(t=at,at=r,t!==null&&Bo(t)),e}function Bo(e){at===null?at=e:at.push.apply(at,e)}function Wh(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var c=r[i],d=c.getSnapshot;c=c.value;try{if(!Et(d(),c))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function dr(e,t){for(t&=~Lo,t&=~Os,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-bt(t),i=1<<r;e[r]=-1,t&=~i}}function bc(e){if((Ee&6)!==0)throw Error(A(327));ti();var t=Xi(e,0);if((t&1)===0)return ct(e,je()),null;var r=Us(e,t);if(e.tag!==0&&r===2){var i=un(e);i!==0&&(t=i,r=Po(e,i))}if(r===1)throw r=Mi,Dr(e,0),dr(e,t),ct(e,je()),r;if(r===6)throw Error(A(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Tr(e,at,Vt),ct(e,je()),null}function Mo(e,t){var r=Ee;Ee|=1;try{return e(t)}finally{Ee=r,Ee===0&&(ei=je()+500,ps&&nr())}}function Lr(e){ur!==null&&ur.tag===0&&(Ee&6)===0&&ti();var t=Ee;Ee|=1;var r=wt.transition,i=Re;try{if(wt.transition=null,Re=1,e)return e()}finally{Re=i,wt.transition=r,Ee=t,(Ee&6)===0&&nr()}}function Oo(){gt=Zr.current,Be(Zr)}function Dr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Sh(r)),Fe!==null)for(r=Fe.return;r!==null;){var i=r;switch(Wn(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&ds();break;case 3:Qr(),Be(nt),Be(Qe),ro();break;case 5:eo(i);break;case 4:Qr();break;case 13:Be(Oe);break;case 19:Be(Oe);break;case 10:Xn(i.type._context);break;case 22:case 23:Oo()}r=r.return}if($e=e,Fe=e=fr(e.current,null),Xe=gt=t,ze=0,Mi=null,Lo=Os=Rr=0,at=Oi=null,br!==null){for(t=0;t<br.length;t++)if(r=br[t],i=r.interleaved,i!==null){r.interleaved=null;var c=i.next,d=r.pending;if(d!==null){var E=d.next;d.next=c,i.next=E}r.pending=i}br=null}return e}function Ec(e,t){do{var r=Fe;try{if(Gn(),bs.current=Ls,Es){for(var i=Ie.memoizedState;i!==null;){var c=i.queue;c!==null&&(c.pending=null),i=i.next}Es=!1}if(kr=0,We=Ue=Ie=null,Li=!1,Di=0,Ro.current=null,r===null||r.return===null){ze=1,Mi=t,Fe=null;break}e:{var d=e,E=r.return,O=r,H=t;if(t=Xe,O.flags|=32768,H!==null&&typeof H=="object"&&typeof H.then=="function"){var X=H,se=O,oe=se.tag;if((se.mode&1)===0&&(oe===0||oe===11||oe===15)){var ie=se.alternate;ie?(se.updateQueue=ie.updateQueue,se.memoizedState=ie.memoizedState,se.lanes=ie.lanes):(se.updateQueue=null,se.memoizedState=null)}var fe=Qa(E);if(fe!==null){fe.flags&=-257,Ya(fe,E,O,d,t),fe.mode&1&&Xa(d,X,t),t=fe,H=X;var _e=t.updateQueue;if(_e===null){var ge=new Set;ge.add(H),t.updateQueue=ge}else _e.add(H);break e}else{if((t&1)===0){Xa(d,X,t),Io();break e}H=Error(A(426))}}else if(Me&&O.mode&1){var He=Qa(E);if(He!==null){(He.flags&65536)===0&&(He.flags|=256),Ya(He,E,O,d,t),Kn(Yr(H,O));break e}}d=H=Yr(H,O),ze!==4&&(ze=2),Oi===null?Oi=[d]:Oi.push(d),d=E;do{switch(d.tag){case 3:d.flags|=65536,t&=-t,d.lanes|=t;var q=qa(d,H,t);ya(d,q);break e;case 1:O=H;var W=d.type,G=d.stateNode;if((d.flags&128)===0&&(typeof W.getDerivedStateFromError=="function"||G!==null&&typeof G.componentDidCatch=="function"&&(cr===null||!cr.has(G)))){d.flags|=65536,t&=-t,d.lanes|=t;var ae=Ga(d,O,t);ya(d,ae);break e}}d=d.return}while(d!==null)}Lc(r)}catch(ve){t=ve,Fe===r&&r!==null&&(Fe=r=r.return);continue}break}while(!0)}function kc(){var e=Ms.current;return Ms.current=Ls,e===null?Ls:e}function Io(){(ze===0||ze===3||ze===2)&&(ze=4),$e===null||(Rr&268435455)===0&&(Os&268435455)===0||dr($e,Xe)}function Us(e,t){var r=Ee;Ee|=2;var i=kc();($e!==e||Xe!==t)&&(Vt=null,Dr(e,t));do try{$h();break}catch(c){Ec(e,c)}while(!0);if(Gn(),Ee=r,Ms.current=i,Fe!==null)throw Error(A(261));return $e=null,Xe=0,ze}function $h(){for(;Fe!==null;)Rc(Fe)}function Vh(){for(;Fe!==null&&!gu();)Rc(Fe)}function Rc(e){var t=Ac(e.alternate,e,gt);e.memoizedProps=e.pendingProps,t===null?Lc(e):Fe=t,Ro.current=null}function Lc(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=Nh(r,t,gt),r!==null){Fe=r;return}}else{if(r=jh(r,t),r!==null){r.flags&=32767,Fe=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ze=6,Fe=null;return}}if(t=t.sibling,t!==null){Fe=t;return}Fe=t=e}while(t!==null);ze===0&&(ze=5)}function Tr(e,t,r){var i=Re,c=wt.transition;try{wt.transition=null,Re=1,Kh(e,t,r,i)}finally{wt.transition=c,Re=i}return null}function Kh(e,t,r,i){do ti();while(ur!==null);if((Ee&6)!==0)throw Error(A(327));r=e.finishedWork;var c=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(A(177));e.callbackNode=null,e.callbackPriority=0;var d=r.lanes|r.childLanes;if(ku(e,d),e===$e&&(Fe=$e=null,Xe=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||Ns||(Ns=!0,Pc(Vi,function(){return ti(),null})),d=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||d){d=wt.transition,wt.transition=null;var E=Re;Re=1;var O=Ee;Ee|=4,Ro.current=null,Fh(e,r),mc(r,e),dh(On),Ji=!!Mn,On=Mn=null,e.current=r,Uh(r),vu(),Ee=O,Re=E,wt.transition=d}else e.current=r;if(Ns&&(Ns=!1,ur=e,js=c),d=e.pendingLanes,d===0&&(cr=null),yu(r.stateNode),ct(e,je()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)c=t[r],i(c.value,{componentStack:c.stack,digest:c.digest});if(Is)throw Is=!1,e=To,To=null,e;return(js&1)!==0&&e.tag!==0&&ti(),d=e.pendingLanes,(d&1)!==0?e===Ao?Ii++:(Ii=0,Ao=e):Ii=0,nr(),null}function ti(){if(ur!==null){var e=gl(js),t=wt.transition,r=Re;try{if(wt.transition=null,Re=16>e?16:e,ur===null)var i=!1;else{if(e=ur,ur=null,js=0,(Ee&6)!==0)throw Error(A(331));var c=Ee;for(Ee|=4,pe=e.current;pe!==null;){var d=pe,E=d.child;if((pe.flags&16)!==0){var O=d.deletions;if(O!==null){for(var H=0;H<O.length;H++){var X=O[H];for(pe=X;pe!==null;){var se=pe;switch(se.tag){case 0:case 11:case 15:Bi(8,se,d)}var oe=se.child;if(oe!==null)oe.return=se,pe=oe;else for(;pe!==null;){se=pe;var ie=se.sibling,fe=se.return;if(fc(se),se===X){pe=null;break}if(ie!==null){ie.return=fe,pe=ie;break}pe=fe}}}var _e=d.alternate;if(_e!==null){var ge=_e.child;if(ge!==null){_e.child=null;do{var He=ge.sibling;ge.sibling=null,ge=He}while(ge!==null)}}pe=d}}if((d.subtreeFlags&2064)!==0&&E!==null)E.return=d,pe=E;else e:for(;pe!==null;){if(d=pe,(d.flags&2048)!==0)switch(d.tag){case 0:case 11:case 15:Bi(9,d,d.return)}var q=d.sibling;if(q!==null){q.return=d.return,pe=q;break e}pe=d.return}}var W=e.current;for(pe=W;pe!==null;){E=pe;var G=E.child;if((E.subtreeFlags&2064)!==0&&G!==null)G.return=E,pe=G;else e:for(E=W;pe!==null;){if(O=pe,(O.flags&2048)!==0)try{switch(O.tag){case 0:case 11:case 15:Bs(9,O)}}catch(ve){Ne(O,O.return,ve)}if(O===E){pe=null;break e}var ae=O.sibling;if(ae!==null){ae.return=O.return,pe=ae;break e}pe=O.return}}if(Ee=c,nr(),Pt&&typeof Pt.onPostCommitFiberRoot=="function")try{Pt.onPostCommitFiberRoot(Ki,e)}catch{}i=!0}return i}finally{Re=r,wt.transition=t}}return!1}function Dc(e,t,r){t=Yr(r,t),t=qa(e,t,1),e=lr(e,t,1),t=rt(),e!==null&&(oi(e,1,t),ct(e,t))}function Ne(e,t,r){if(e.tag===3)Dc(e,e,r);else for(;t!==null;){if(t.tag===3){Dc(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(cr===null||!cr.has(i))){e=Yr(r,e),e=Ga(t,e,1),t=lr(t,e,1),e=rt(),t!==null&&(oi(t,1,e),ct(t,e));break}}t=t.return}}function qh(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=rt(),e.pingedLanes|=e.suspendedLanes&r,$e===e&&(Xe&r)===r&&(ze===4||ze===3&&(Xe&130023424)===Xe&&500>je()-Do?Dr(e,0):Lo|=r),ct(e,t)}function Tc(e,t){t===0&&((e.mode&1)===0?t=1:(t=Gi,Gi<<=1,(Gi&130023424)===0&&(Gi=4194304)));var r=rt();e=zt(e,t),e!==null&&(oi(e,t,r),ct(e,r))}function Gh(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Tc(e,r)}function Xh(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,c=e.memoizedState;c!==null&&(r=c.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(A(314))}i!==null&&i.delete(t),Tc(e,r)}var Ac;Ac=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||nt.current)lt=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return lt=!1,Ih(e,t,r);lt=(e.flags&131072)!==0}else lt=!1,Me&&(t.flags&1048576)!==0&&ua(t,gs,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;As(e,t),e=t.pendingProps;var c=Wr(t,Qe.current);Xr(t,r),c=no(null,t,i,e,c,r);var d=oo();return t.flags|=1,typeof c=="object"&&c!==null&&typeof c.render=="function"&&c.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ot(i)?(d=!0,fs(t)):d=!1,t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,Jn(t),c.updater=Ds,t.stateNode=c,c._reactInternals=t,fo(t,i,e,r),t=vo(null,t,i,!0,d,r)):(t.tag=0,Me&&d&&zn(t),tt(null,t,c,r),t=t.child),t;case 16:i=t.elementType;e:{switch(As(e,t),e=t.pendingProps,c=i._init,i=c(i._payload),t.type=i,c=t.tag=Yh(i),e=Rt(i,e),c){case 0:t=go(null,t,i,e,r);break e;case 1:t=ic(null,t,i,e,r);break e;case 11:t=Ja(null,t,i,e,r);break e;case 14:t=Za(null,t,i,Rt(i.type,e),r);break e}throw Error(A(306,i,""))}return t;case 0:return i=t.type,c=t.pendingProps,c=t.elementType===i?c:Rt(i,c),go(e,t,i,c,r);case 1:return i=t.type,c=t.pendingProps,c=t.elementType===i?c:Rt(i,c),ic(e,t,i,c,r);case 3:e:{if(sc(t),e===null)throw Error(A(387));i=t.pendingProps,d=t.memoizedState,c=d.element,Sa(e,t),Cs(t,i,null,r);var E=t.memoizedState;if(i=E.element,d.isDehydrated)if(d={element:i,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){c=Yr(Error(A(423)),t),t=nc(e,t,i,r,c);break e}else if(i!==c){c=Yr(Error(A(424)),t),t=nc(e,t,i,r,c);break e}else for(_t=rr(t.stateNode.containerInfo.firstChild),pt=t,Me=!0,kt=null,r=va(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Kr(),i===c){t=$t(e,t,r);break e}tt(e,t,i,r)}t=t.child}return t;case 5:return Ca(t),e===null&&Vn(t),i=t.type,c=t.pendingProps,d=e!==null?e.memoizedProps:null,E=c.children,In(i,c)?E=null:d!==null&&In(i,d)&&(t.flags|=32),rc(e,t),tt(e,t,E,r),t.child;case 6:return e===null&&Vn(t),null;case 13:return oc(e,t,r);case 4:return Zn(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=qr(t,null,i,r):tt(e,t,i,r),t.child;case 11:return i=t.type,c=t.pendingProps,c=t.elementType===i?c:Rt(i,c),Ja(e,t,i,c,r);case 7:return tt(e,t,t.pendingProps,r),t.child;case 8:return tt(e,t,t.pendingProps.children,r),t.child;case 12:return tt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,c=t.pendingProps,d=t.memoizedProps,E=c.value,De(Ss,i._currentValue),i._currentValue=E,d!==null)if(Et(d.value,E)){if(d.children===c.children&&!nt.current){t=$t(e,t,r);break e}}else for(d=t.child,d!==null&&(d.return=t);d!==null;){var O=d.dependencies;if(O!==null){E=d.child;for(var H=O.firstContext;H!==null;){if(H.context===i){if(d.tag===1){H=Wt(-1,r&-r),H.tag=2;var X=d.updateQueue;if(X!==null){X=X.shared;var se=X.pending;se===null?H.next=H:(H.next=se.next,se.next=H),X.pending=H}}d.lanes|=r,H=d.alternate,H!==null&&(H.lanes|=r),Qn(d.return,r,t),O.lanes|=r;break}H=H.next}}else if(d.tag===10)E=d.type===t.type?null:d.child;else if(d.tag===18){if(E=d.return,E===null)throw Error(A(341));E.lanes|=r,O=E.alternate,O!==null&&(O.lanes|=r),Qn(E,r,t),E=d.sibling}else E=d.child;if(E!==null)E.return=d;else for(E=d;E!==null;){if(E===t){E=null;break}if(d=E.sibling,d!==null){d.return=E.return,E=d;break}E=E.return}d=E}tt(e,t,c.children,r),t=t.child}return t;case 9:return c=t.type,i=t.pendingProps.children,Xr(t,r),c=St(c),i=i(c),t.flags|=1,tt(e,t,i,r),t.child;case 14:return i=t.type,c=Rt(i,t.pendingProps),c=Rt(i.type,c),Za(e,t,i,c,r);case 15:return ec(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,c=t.pendingProps,c=t.elementType===i?c:Rt(i,c),As(e,t),t.tag=1,ot(i)?(e=!0,fs(t)):e=!1,Xr(t,r),Va(t,i,c),fo(t,i,c,r),vo(null,t,i,!0,e,r);case 19:return ac(e,t,r);case 22:return tc(e,t,r)}throw Error(A(156,t.tag))};function Pc(e,t){return hl(e,t)}function Qh(e,t,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ct(e,t,r,i){return new Qh(e,t,r,i)}function No(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Yh(e){if(typeof e=="function")return No(e)?1:0;if(e!=null){if(e=e.$$typeof,e===z)return 11;if(e===te)return 14}return 2}function fr(e,t){var r=e.alternate;return r===null?(r=Ct(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function zs(e,t,r,i,c,d){var E=2;if(i=e,typeof e=="function")No(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case b:return Ar(r.children,c,d,t);case v:E=8,c|=8;break;case R:return e=Ct(12,r,t,c|2),e.elementType=R,e.lanes=d,e;case M:return e=Ct(13,r,t,c),e.elementType=M,e.lanes=d,e;case Q:return e=Ct(19,r,t,c),e.elementType=Q,e.lanes=d,e;case le:return Ws(r,c,d,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case N:E=10;break e;case j:E=9;break e;case z:E=11;break e;case te:E=14;break e;case ne:E=16,i=null;break e}throw Error(A(130,e==null?e:typeof e,""))}return t=Ct(E,r,t,c),t.elementType=e,t.type=i,t.lanes=d,t}function Ar(e,t,r,i){return e=Ct(7,e,i,t),e.lanes=r,e}function Ws(e,t,r,i){return e=Ct(22,e,i,t),e.elementType=le,e.lanes=r,e.stateNode={isHidden:!1},e}function jo(e,t,r){return e=Ct(6,e,null,t),e.lanes=r,e}function Ho(e,t,r){return t=Ct(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Jh(e,t,r,i,c){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=hn(0),this.expirationTimes=hn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hn(0),this.identifierPrefix=i,this.onRecoverableError=c,this.mutableSourceEagerHydrationData=null}function Fo(e,t,r,i,c,d,E,O,H){return e=new Jh(e,t,r,O,H),t===1?(t=1,d===!0&&(t|=8)):t=0,d=Ct(3,null,null,t),e.current=d,d.stateNode=e,d.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Jn(d),e}function Zh(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:y,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function Bc(e){if(!e)return sr;e=e._reactInternals;e:{if(Sr(e)!==e||e.tag!==1)throw Error(A(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ot(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(A(171))}if(e.tag===1){var r=e.type;if(ot(r))return la(e,r,t)}return t}function Mc(e,t,r,i,c,d,E,O,H){return e=Fo(r,i,!0,e,c,d,E,O,H),e.context=Bc(null),r=e.current,i=rt(),c=hr(r),d=Wt(i,c),d.callback=t??null,lr(r,d,c),e.current.lanes=c,oi(e,c,i),ct(e,i),e}function $s(e,t,r,i){var c=t.current,d=rt(),E=hr(c);return r=Bc(r),t.context===null?t.context=r:t.pendingContext=r,t=Wt(d,E),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=lr(c,t,E),e!==null&&(Tt(e,c,E,d),ws(e,c,E)),E}function Vs(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 Oc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Uo(e,t){Oc(e,t),(e=e.alternate)&&Oc(e,t)}function ed(){return null}var Ic=typeof reportError=="function"?reportError:function(e){console.error(e)};function zo(e){this._internalRoot=e}Ks.prototype.render=zo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(A(409));$s(e,t,null,null)},Ks.prototype.unmount=zo.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Lr(function(){$s(null,e,null,null)}),t[jt]=null}};function Ks(e){this._internalRoot=e}Ks.prototype.unstable_scheduleHydration=function(e){if(e){var t=Sl();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Zt.length&&t!==0&&t<Zt[r].priority;r++);Zt.splice(r,0,e),r===0&&Cl(e)}};function Wo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function qs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Nc(){}function td(e,t,r,i,c){if(c){if(typeof i=="function"){var d=i;i=function(){var X=Vs(E);d.call(X)}}var E=Mc(t,i,e,0,null,!1,!1,"",Nc);return e._reactRootContainer=E,e[jt]=E.current,yi(e.nodeType===8?e.parentNode:e),Lr(),E}for(;c=e.lastChild;)e.removeChild(c);if(typeof i=="function"){var O=i;i=function(){var X=Vs(H);O.call(X)}}var H=Fo(e,0,!1,null,null,!1,!1,"",Nc);return e._reactRootContainer=H,e[jt]=H.current,yi(e.nodeType===8?e.parentNode:e),Lr(function(){$s(t,H,r,i)}),H}function Gs(e,t,r,i,c){var d=r._reactRootContainer;if(d){var E=d;if(typeof c=="function"){var O=c;c=function(){var H=Vs(E);O.call(H)}}$s(t,E,e,c)}else E=td(r,t,e,c,i);return Vs(E)}vl=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=ni(t.pendingLanes);r!==0&&(dn(t,r|1),ct(t,je()),(Ee&6)===0&&(ei=je()+500,nr()))}break;case 13:Lr(function(){var i=zt(e,1);if(i!==null){var c=rt();Tt(i,e,1,c)}}),Uo(e,1)}},fn=function(e){if(e.tag===13){var t=zt(e,134217728);if(t!==null){var r=rt();Tt(t,e,134217728,r)}Uo(e,134217728)}},ml=function(e){if(e.tag===13){var t=hr(e),r=zt(e,t);if(r!==null){var i=rt();Tt(r,e,t,i)}Uo(e,t)}},Sl=function(){return Re},yl=function(e,t){var r=Re;try{return Re=e,t()}finally{Re=r}},nn=function(e,t,r){switch(t){case"input":if(we(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var c=hs(i);if(!c)throw Error(A(90));he(i),we(i,c)}}}break;case"textarea":Gt(e,r);break;case"select":t=r.value,t!=null&&At(e,!!r.multiple,t,!1)}},sl=Mo,nl=Lr;var rd={usingClientEntryPoint:!1,Events:[xi,Ur,hs,rl,il,Mo]},Ni={findFiberByHostInstance:yr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},id={bundleType:Ni.bundleType,version:Ni.version,rendererPackageName:Ni.rendererPackageName,rendererConfig:Ni.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:f.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=cl(e),e===null?null:e.stateNode},findFiberByHostInstance:Ni.findFiberByHostInstance||ed,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 Xs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xs.isDisabled&&Xs.supportsFiber)try{Ki=Xs.inject(id),Pt=Xs}catch{}}return ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rd,ut.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Wo(t))throw Error(A(200));return Zh(e,t,null,r)},ut.createRoot=function(e,t){if(!Wo(e))throw Error(A(299));var r=!1,i="",c=Ic;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=Fo(e,1,!1,null,null,r,!1,i,c),e[jt]=t.current,yi(e.nodeType===8?e.parentNode:e),new zo(t)},ut.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(A(188)):(e=Object.keys(e).join(","),Error(A(268,e)));return e=cl(t),e=e===null?null:e.stateNode,e},ut.flushSync=function(e){return Lr(e)},ut.hydrate=function(e,t,r){if(!qs(t))throw Error(A(200));return Gs(null,e,t,!0,r)},ut.hydrateRoot=function(e,t,r){if(!Wo(e))throw Error(A(405));var i=r!=null&&r.hydratedSources||null,c=!1,d="",E=Ic;if(r!=null&&(r.unstable_strictMode===!0&&(c=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onRecoverableError!==void 0&&(E=r.onRecoverableError)),t=Mc(t,null,e,1,r??null,c,!1,d,E),e[jt]=t.current,yi(e),i)for(e=0;e<i.length;e++)r=i[e],c=r._getVersion,c=c(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,c]:t.mutableSourceEagerHydrationData.push(r,c);return new Ks(t)},ut.render=function(e,t,r){if(!qs(t))throw Error(A(200));return Gs(null,e,t,!1,r)},ut.unmountComponentAtNode=function(e){if(!qs(e))throw Error(A(40));return e._reactRootContainer?(Lr(function(){Gs(null,null,e,!1,function(){e._reactRootContainer=null,e[jt]=null})}),!0):!1},ut.unstable_batchedUpdates=Mo,ut.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!qs(r))throw Error(A(200));if(e==null||e._reactInternals===void 0)throw Error(A(38));return Gs(e,t,r,!1,i)},ut.version="18.3.1-next-f1338f8080-20240426",ut}var Vc;function dd(){if(Vc)return Ko.exports;Vc=1;function B(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(B)}catch(I){console.error(I)}}return B(),Ko.exports=hd(),Ko.exports}var Kc;function fd(){if(Kc)return Ys;Kc=1;var B=dd();return Ys.createRoot=B.createRoot,Ys.hydrateRoot=B.hydrateRoot,Ys}var pd=fd();const qc=B=>{let I;const A=new Set,V=(p,m)=>{const h=typeof p=="function"?p(I):p;if(!Object.is(h,I)){const g=I;I=m??(typeof h!="object"||h===null)?h:Object.assign({},I,h),A.forEach(S=>S(I,g))}},K=()=>I,a={setState:V,getState:K,getInitialState:()=>u,subscribe:p=>(A.add(p),()=>A.delete(p))},u=I=B(V,K,a);return a},_d=(B=>B?qc(B):qc),gd=B=>B;function vd(B,I=gd){const A=Qs.useSyncExternalStore(B.subscribe,Qs.useCallback(()=>I(B.getState()),[B,I]),Qs.useCallback(()=>I(B.getInitialState()),[B,I]));return Qs.useDebugValue(A),A}const Gc=B=>{const I=_d(B),A=V=>vd(I,V);return Object.assign(A,I),A},Ui=(B=>B?Gc(B):Gc),Zs=Ui(B=>({status:"connecting",setStatus:I=>B({status:I})})),md={connecting:{label:"Connecting…",className:"text-yellow-500"},connected:{label:"Connected",className:"text-green-500"},disconnected:{label:"Disconnected",className:"text-red-500"}};function Sd(){const B=Zs(V=>V.status),{label:I,className:A}=md[B];return T.jsxs("div",{"data-testid":"connection-status","aria-label":B,className:`flex items-center gap-1.5 text-sm font-medium ${A}`,children:[T.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-current"}),I]})}const _r=Ui(B=>({gates:{},setGate:I=>B(A=>({gates:{...A.gates,[I.runId]:I}})),clearGate:I=>B(A=>{if(!(I in A.gates))return A;const V={...A.gates};return delete V[I],{gates:V}}),ingest:I=>{const A=typeof I.session=="string"?I.session:void 0;A!==void 0&&B(V=>{switch(I.type){case"awaitingHuman":return typeof I.ord=="number"&&typeof I.prompt=="string"?{gates:{...V.gates,[A]:{runId:A,ord:I.ord,prompt:I.prompt,lifecycle:"open",receivedAt:Date.now()}}}:V;case"resumed":case"sessionCompleted":case"runCancelled":case"sessionFailed":{if(!(A in V.gates))return V;const K={...V.gates};return delete K[A],{gates:K}}default:return V}})},reconcile:I=>B(A=>{const V=new Set(I),K={};let Z=!1;for(const[$,a]of Object.entries(A.gates))V.has($)?K[$]=a:Z=!0;return Z?{gates:K}:A})}));function yd({onSelect:B}){const I=_r(V=>V.gates),A=Object.values(I);return A.length===0?T.jsx(T.Fragment,{}):T.jsx("div",{className:"fixed bottom-4 right-4 flex flex-col gap-2 z-50","data-testid":"gate-notification",children:A.map(V=>T.jsxs("button",{type:"button",onClick:()=>B(V.runId),"data-testid":"gate-toast","data-run-id":V.runId,className:"w-72 rounded-lg border border-yellow-300 bg-white p-3 text-left shadow-lg hover:border-yellow-400",children:[T.jsx("p",{className:"text-xs font-semibold text-yellow-700",children:"Run awaiting human"}),T.jsxs("p",{className:"text-[11px] text-gray-400 font-mono",children:[V.runId.slice(0,8)," · before unit #",V.ord]}),T.jsx("p",{className:"mt-1 text-xs text-gray-600 line-clamp-2",children:V.prompt}),T.jsx("p",{className:"mt-1 text-[11px] text-blue-600",children:"Review →"})]},V.runId))})}const iu={planning:{label:"Planning",className:"text-gray-500"},distributing:{label:"Distributing",className:"text-purple-600"},executing:{label:"Executing",className:"text-blue-600"},awaiting_human:{label:"Awaiting human",className:"text-yellow-600"},completed:{label:"Completed",className:"text-green-600"},cancelled:{label:"Cancelled",className:"text-gray-400"},failed:{label:"Failed",className:"text-red-600"}};function wd({view:B,selected:I,onSelect:A}){const{session:V,units:K}=B,Z=iu[V.status]??{label:V.status,className:"text-gray-500"},$=V.status==="awaiting_human";return T.jsxs("button",{type:"button",onClick:()=>A(V.id),"data-testid":"run-card","data-run-id":V.id,"data-status":V.status,"aria-pressed":I,className:`w-full text-left rounded-lg border p-4 bg-white shadow-sm transition ${I?"border-blue-500 ring-1 ring-blue-300":"border-gray-200 hover:border-gray-300"}`,children:[T.jsxs("div",{className:"flex justify-between items-start gap-2 mb-1",children:[T.jsx("p",{className:"font-semibold text-sm line-clamp-2 flex-1",children:V.problem}),$&&T.jsx("span",{"data-testid":"run-card-gate-flag",className:"shrink-0 rounded-full bg-yellow-100 px-2 py-0.5 text-[10px] font-semibold text-yellow-700",children:"gate"})]}),T.jsxs("div",{className:"flex justify-between items-center",children:[T.jsx("p",{className:"text-xs text-gray-400 font-mono",children:V.id.slice(0,8)}),T.jsx("span",{className:`text-xs font-medium ${Z.className}`,children:Z.label})]}),T.jsxs("p",{className:"text-[11px] text-gray-400 mt-1",children:[K.length," unit",K.length===1?"":"s"]})]})}function Cd({runs:B,selectedRunId:I,onSelect:A}){return Zs(K=>K.status)==="disconnected"?T.jsx("div",{"data-testid":"run-list",className:"p-4 text-sm text-gray-400 text-center",children:"Daemon not reachable — reconnecting…"}):B.length===0?T.jsx("div",{"data-testid":"run-list",className:"p-4 text-sm text-gray-400 text-center",children:"No runs yet"}):T.jsx("div",{"data-testid":"run-list",className:"flex flex-col gap-3 p-4",children:B.map(K=>T.jsx(wd,{view:K,selected:K.session.id===I,onSelect:A},K.session.id))})}const Xo={};function su(){const B=Xo==null?void 0:Xo.VITE_API_HOST;return typeof B=="string"&&B.length>0?B:void 0}function xd(){const B=su();return B?`http://${B}/api/v1`:`${window.location.origin}/api/v1`}function nu(){const B=su();return B?`ws://${B}`:`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}`}const bd=B=>`${nu()}/ws/terminals/${encodeURIComponent(B)}`;async function it(B,I){const A=(I==null?void 0:I.body)!==void 0&&(I==null?void 0:I.body)!==null?{"Content-Type":"application/json",...I==null?void 0:I.headers}:{...I==null?void 0:I.headers},V=await fetch(`${xd()}${B}`,{...I,headers:A});if(!V.ok)throw new Error(`API ${V.status}: ${await V.text()}`);return V.json()}const Ke={listRuns:()=>it("/runs"),getRun:B=>it(`/runs/${encodeURIComponent(B)}`),launchRun:B=>it("/runs",{method:"POST",body:JSON.stringify(B)}),confirmGate:(B,I)=>it(`/runs/${encodeURIComponent(B)}/gate`,{method:"POST",body:JSON.stringify(I)}),cancelRun:B=>it(`/runs/${encodeURIComponent(B)}/cancel`,{method:"POST"}),resumeRun:B=>it(`/runs/${encodeURIComponent(B)}/resume`,{method:"POST"}),getUnitOutput:(B,I)=>it(`/runs/${encodeURIComponent(B)}/units/${I}/output`),getGate:B=>it(`/runs/${encodeURIComponent(B)}/gate`),getRoster:()=>it("/roster"),listRepos:()=>it("/repos"),registerRepo:(B,I)=>it("/repos",{method:"POST",body:JSON.stringify({name:B,rootPath:I})}),getHealth:()=>it("/health"),openTerminal:B=>it("/terminals",{method:"POST",body:JSON.stringify(B)}),resizeTerminal:(B,I,A)=>it(`/terminals/${encodeURIComponent(B)}/resize`,{method:"POST",body:JSON.stringify({cols:I,rows:A})}),closeTerminal:B=>it(`/terminals/${encodeURIComponent(B)}/close`,{method:"POST"})},Xc=2e5,Qc=500;function Ed(B,I){return`${B}:u${I}`}function kd(B){switch(B.type){case"sessionStarted":return typeof B.problem=="string"?B.problem:"run started";case"unitPlanned":return typeof B.description=="string"?B.description:"unit planned";case"unitDistributed":return typeof B.cli=="string"?`assigned -> ${B.cli}`:"distributed";case"unitExecuting":return"executing";case"gateDecided":return B.allow===!0?"gate: allow":"gate: deny";case"unitDone":return"unit done";case"unitDenied":return"unit denied";case"awaitingHuman":return typeof B.prompt=="string"?`awaiting human: ${B.prompt}`:"awaiting human";case"resumed":return"resumed";case"runCancelled":return"run cancelled";case"sessionFailed":return"run failed";case"sessionCompleted":return"run completed";case"error":return typeof B.message=="string"?`error: ${B.message}`:"error";default:return B.type}}const Js=Ui(B=>({outputs:{},logs:{},seq:0,ingest:I=>{const A=typeof I.session=="string"?I.session:void 0;A!==void 0&&B(V=>{const K=V.seq+1;if(I.type==="cliOutputDelta"&&typeof I.ord=="number"&&typeof I.chunk=="string"){const u=Ed(A,I.ord);let m=(V.outputs[u]??"")+I.chunk;return m.length>Xc&&(m=m.slice(m.length-Xc)),{seq:K,outputs:{...V.outputs,[u]:m}}}if(I.type==="heartbeat")return{seq:K};const Z={seq:K,type:I.type,ts:Date.now(),detail:kd(I)};typeof I.ord=="number"&&(Z.ord=I.ord);const a=[...V.logs[A]??[],Z];return a.length>Qc&&a.splice(0,a.length-Qc),{seq:K,logs:{...V.logs,[A]:a}}})},clear:I=>B(A=>{const V={...A.outputs};for(const Z of Object.keys(V))Z.startsWith(`${I}:u`)&&delete V[Z];const K={...A.logs};return delete K[I],{outputs:V,logs:K}})})),Yc=5e4,Rd=new Set(["cliOutputDelta","heartbeat"]),Jo=Ui(B=>({byRun:{},ingest:I=>{const A=typeof I.session=="string"?I.session:void 0;A!==void 0&&(Rd.has(I.type)||B(V=>{const Z=[...V.byRun[A]??[],I];return Z.length>Yc&&Z.splice(0,Z.length-Yc),{byRun:{...V.byRun,[A]:Z}}}))},clear:I=>B(A=>{if(!(I in A.byRun))return A;const V={...A.byRun};return delete V[I],{byRun:V}})})),Ld=new Set(["sessionStarted","unitPlanned","unitDistributed","unitExecuting","gateDecided","unitDone","unitDenied","awaitingHuman","resumed","runCancelled","sessionFailed","sessionCompleted"]);function Dd(B){return{ord:B,description:"",stage:"build",status:"pending",resolved:!1,assignedCli:null,assignedInvocation:null,routing:null,denialReason:null,skillRef:null,phaseStatus:null,attempts:[],usage:[],filesRead:[],gateEvals:[]}}function Jc(B){return JSON.stringify([B.criterion,B.hasDeterministicFloor,B.deterministicPass,B.agentVerdict,B.agentReasoning,B.evaluatorPass,B.denialReason,B.combined])}function Td(B,I){var a;const A={...B.session},V=new Map;for(const u of B.units)V.set(u.ord,{ord:u.ord,description:u.description,stage:u.stage,status:u.status,resolved:!0,assignedCli:u.assigned_cli,assignedInvocation:u.assigned_invocation,routing:u.routing,denialReason:u.denial_reason,skillRef:u.skill_ref??null,phaseStatus:u.phase_status,attempts:[],usage:[],filesRead:[],gateEvals:[]});let K=A.status==="awaiting_human"?{ord:((a=B.units[A.unit_ix])==null?void 0:a.ord)??A.unit_ix+1,prompt:null}:null;const Z=u=>{let p=V.get(u);return p===void 0&&(p=Dd(u),V.set(u,p)),p};for(const u of I){const p=typeof u.ord=="number"?u.ord:void 0;switch(u.type){case"sessionStarted":A.status="planning";break;case"unitDistributed":if(p!==void 0){const m=Z(p);m.status==="pending"&&(m.status="distributed"),typeof u.cli=="string"&&m.assignedCli===null&&(m.assignedCli=u.cli)}break;case"unitExecuting":if(p!==void 0){const m=Z(p);m.status==="pending"&&(m.status="distributed")}break;case"unitDone":p!==void 0&&(Z(p).status="done");break;case"unitDenied":p!==void 0&&(Z(p).status="rejected");break;case"awaitingHuman":p!==void 0&&(A.status="awaiting_human",K={ord:p,prompt:typeof u.prompt=="string"?u.prompt:null});break;case"resumed":A.status="executing",K=null;break;case"runCancelled":A.status="cancelled",K=null;break;case"sessionFailed":A.status="failed",K=null;break;case"sessionCompleted":A.status="completed",K=null;break;case"unitDispatched":if(p!==void 0&&typeof u.attempt=="number"){const m=Z(p);m.attempts.includes(u.attempt)||(m.attempts.push(u.attempt),m.attempts.sort((h,g)=>h-g))}break;case"cliUsage":if(p!==void 0&&typeof u.attempt=="number"&&typeof u.inputTokens=="number"&&typeof u.outputTokens=="number"){const m=Z(p),h=typeof u.costUsd=="number"?u.costUsd:null,g=m.usage.find(S=>S.attempt===u.attempt);g?(g.inputTokens=u.inputTokens,g.outputTokens=u.outputTokens,g.costUsd=h):m.usage.push({attempt:u.attempt,inputTokens:u.inputTokens,outputTokens:u.outputTokens,costUsd:h})}break;case"dataUsed":if(p!==void 0&&Array.isArray(u.files)){const m=Z(p);for(const h of u.files)typeof h=="string"&&!m.filesRead.includes(h)&&m.filesRead.push(h)}break;case"gateEvaluated":if(p!==void 0){const m=Z(p),h={criterion:u.criterion??null,hasDeterministicFloor:u.hasDeterministicFloor===!0,deterministicPass:u.deterministicPass===!0,agentVerdict:u.agentVerdict??null,agentReasoning:u.agentReasoning??null,evaluatorPass:typeof u.evaluatorPass=="boolean"?u.evaluatorPass:null,denialReason:u.denialReason??null,combined:u.combined===!0},g=Jc(h);m.gateEvals.some(S=>Jc(S)===g)||m.gateEvals.push(h)}break}}const $=[...V.values()].sort((u,p)=>u.ord-p.ord);return{session:A,units:$,pendingGate:K}}function Zc(B){return(B.split(/[\\/]/).pop()??B).replace(/\.(exe|cmd|bat)$/i,"").toLowerCase()}function Ad(B,I){const A=B==null?void 0:B.trim();return A?Zc(A.split(/\s+/)[0]??"")==="claude":I!==null&&Zc(I)==="claude"}function Pd(B){let I=0,A=0,V=0,K=0,Z=0,$=0;const a=new Map,u=new Set,p=new Set;for(const h of B.units){const g=h.status==="distributed"||h.status==="done"||h.status==="rejected";h.usage.length===0&&h.assignedCli!==null&&g&&(Ad(h.assignedInvocation,h.assignedCli)?p.add(h.assignedCli):u.add(h.assignedCli));const S=h.assignedCli??"unknown",x=h.usage.length>0?Math.min(...h.usage.map(_=>_.attempt)):0;for(const _ of h.usage){Z+=1,I+=_.inputTokens,A+=_.outputTokens,_.costUsd!==null&&(V+=_.costUsd,K+=1),_.attempt>x&&($+=_.inputTokens+_.outputTokens);const n=a.get(S)??{cli:S,input:0,output:0,cost:null};n.input+=_.inputTokens,n.output+=_.outputTokens,_.costUsd!==null&&(n.cost=(n.cost??0)+_.costUsd),a.set(S,n)}}const m=I+A;return{totalInput:I,totalOutput:A,totalTokens:m,totalCost:K>0?V:null,costComplete:Z>0&&K===Z,reworkTokens:$,reworkPct:m>0?$/m*100:0,perCli:[...a.values()],noAdapterClis:[...u],pendingUsageClis:[...p],hasUsage:Z>0}}const Bd=[];function Md(B,I){const A=Jo($=>$.byRun[B])??Bd,[V,K]=ye.useState(I??null),Z=Jo($=>{const a=$.byRun[B];if(a===void 0)return 0;let u=0;for(const p of a)Ld.has(p.type)&&(u+=1);return u});return ye.useEffect(()=>{let $=!1;return(async()=>{try{const{run:a}=await Ke.getRun(B);$||K(a)}catch{}})(),()=>{$=!0}},[B,Z]),ye.useMemo(()=>V===null||V.session.id!==B?null:Td(V,A),[V,A,B])}const ou=Ui(B=>({entries:[],seq:0,record:I=>B(A=>{const V=A.seq+1;return{seq:V,entries:[...A.entries,{...I,seq:V,ts:Date.now()}]}})}));function Od({runId:B,ord:I,prompt:A,onResolved:V}){const K=_r(l=>l.clearGate),Z=ou(l=>l.record),[$,a]=ye.useState(""),[u,p]=ye.useState(!1),[m,h]=ye.useState(null);async function g(l,s){p(!0),h(null);try{await l(),Z({runId:B,action:s.kind,...typeof I=="number"?{ord:I}:{},...s.amend!==void 0?{amend:s.amend}:{}}),K(B),V==null||V()}catch(o){h(o instanceof Error?o.message:String(o))}finally{p(!1)}}const S=()=>g(()=>Ke.confirmGate(B,{approve:!0}),{kind:"approve"}),x=()=>{const l=$.trim();if(!l)return Promise.resolve();const s={approve:!0,amend:l};return g(()=>Ke.confirmGate(B,s),{kind:"approve-with-steer",amend:l})},_=()=>g(()=>Ke.confirmGate(B,{approve:!1}),{kind:"reject"}),n=()=>g(()=>Ke.cancelRun(B),{kind:"cancel"});return T.jsxs("div",{className:"rounded-lg border border-yellow-300 bg-white p-4 shadow-lg","data-testid":"steering-gate","data-run-id":B,children:[T.jsx("p",{className:"font-semibold text-sm mb-1",children:"Awaiting human decision"}),T.jsxs("p",{className:"text-xs text-gray-400 font-mono mb-2",children:["run ",B.slice(0,8),typeof I=="number"?` · before unit #${I}`:""]}),T.jsx("p",{className:"text-xs text-gray-600 mb-3 whitespace-pre-wrap","data-testid":"steering-prompt",children:A??"Prompt unavailable (daemon restarted) — you can still approve, reject, or cancel."}),T.jsx("textarea",{"data-testid":"steering-amend",className:"w-full rounded border p-2 text-xs mb-2 resize-none",rows:2,placeholder:"Optional steer / amend — sent with Approve with steer to guide the next unit",value:$,onChange:l=>a(l.target.value),disabled:u}),m&&T.jsx("p",{className:"text-xs text-red-600 mb-2","data-testid":"steering-error",children:m}),T.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[T.jsx("button",{"data-testid":"steering-approve",onClick:()=>void S(),disabled:u,className:"rounded bg-green-600 px-3 py-1.5 text-xs text-white hover:bg-green-700 disabled:opacity-50",children:"Approve"}),T.jsx("button",{"data-testid":"steering-approve-steer",onClick:()=>void x(),disabled:u||!$.trim(),className:"rounded bg-amber-500 px-3 py-1.5 text-xs text-white hover:bg-amber-600 disabled:opacity-50",children:"Approve with steer"}),T.jsx("button",{"data-testid":"steering-reject",onClick:()=>void _(),disabled:u,className:"rounded bg-red-600 px-3 py-1.5 text-xs text-white hover:bg-red-700 disabled:opacity-50",children:"Reject"}),T.jsx("button",{"data-testid":"steering-cancel",onClick:()=>void n(),disabled:u,className:"rounded bg-gray-700 px-3 py-1.5 text-xs text-white hover:bg-gray-800 disabled:opacity-50",children:"Cancel run"})]})]})}function lu({routing:B}){return B?B.method==="council"?T.jsxs("p",{className:"text-[11px] text-gray-500","data-testid":"routing-provenance",children:[T.jsx("span",{className:"font-medium",children:"Council:"})," ",B.winner," won ·"," ",B.agreement_pct,"% agreement · ",B.returned," returned · ",B.dissent," dissent"]}):B.method==="degraded"?T.jsxs("p",{className:"text-[11px] text-amber-600","data-testid":"routing-provenance",children:[T.jsx("span",{className:"font-medium",children:"Degraded:"})," ",B.reason]}):T.jsxs("p",{className:"text-[11px] text-indigo-600","data-testid":"routing-provenance",children:[T.jsx("span",{className:"font-medium",children:"Evaluator-distinct:"})," ",B.winner," (was ",B.was,")"]}):null}const Id={recon:"bg-blue-100 text-blue-700",build:"bg-green-100 text-green-700",review:"bg-indigo-100 text-indigo-700",test:"bg-amber-100 text-amber-700"},Nd={pending:"text-gray-400",distributed:"text-blue-600",done:"text-green-600",rejected:"text-red-600"};function jd({runId:B,unit:I,isGated:A,onResolved:V}){const K=_r(_=>_.clearGate),[Z,$]=ye.useState(null),[a,u]=ye.useState(!1),[p,m]=ye.useState(!1),[h,g]=ye.useState(!1);async function S(){if(a){u(!1);return}if(u(!0),Z===null){m(!0);try{const{output:_}=await Ke.getUnitOutput(B,I.ord);$(_??"(no transcript captured)")}catch(_){$(`(failed to load transcript: ${_ instanceof Error?_.message:String(_)})`)}finally{m(!1)}}}async function x(){g(!0);try{await Ke.confirmGate(B,{approve:!0}),K(B),V==null||V()}finally{g(!1)}}return T.jsxs("li",{className:"rounded border border-gray-200 p-2","data-testid":"work-unit","data-ord":I.ord,children:[T.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[T.jsxs("span",{className:"w-6 text-center text-xs text-gray-400 shrink-0",children:["#",I.ord]}),T.jsx("span",{className:`rounded px-2 py-0.5 text-[10px] font-semibold uppercase ${Id[I.stage]??"bg-gray-100 text-gray-600"}`,children:I.stage}),T.jsx("span",{className:"flex-1 truncate text-xs text-gray-700",children:I.description}),T.jsx("span",{className:`text-[11px] font-medium ${Nd[I.status]??"text-gray-500"}`,children:I.status})]}),T.jsxs("div",{className:"mt-1 pl-8 flex flex-col gap-0.5",children:[I.assigned_cli&&T.jsxs("p",{className:"text-[11px] text-gray-500",children:["CLI: ",T.jsx("span",{className:"font-mono",children:I.assigned_cli})]}),T.jsx(lu,{routing:I.routing}),I.denial_reason&&T.jsxs("p",{className:"text-[11px] text-red-600","data-testid":"unit-denial-reason",children:["Denied: ",I.denial_reason]}),T.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[T.jsx("button",{type:"button","data-testid":"unit-transcript-toggle",onClick:()=>void S(),className:"text-[11px] text-blue-600 hover:underline",children:a?"Hide transcript":"View transcript"}),A&&T.jsx("button",{type:"button","data-testid":"unit-approve",onClick:()=>void x(),disabled:h,className:"rounded bg-green-600 px-2 py-0.5 text-[11px] text-white hover:bg-green-700 disabled:opacity-50",children:"Approve this unit"})]}),a&&T.jsx("pre",{"data-testid":"unit-transcript",className:"mt-1 max-h-48 overflow-auto rounded bg-gray-900 p-2 text-[10px] leading-tight text-gray-100 whitespace-pre-wrap",children:p?"Loading…":Z})]})]})}function Hd({runId:B,units:I,gateOrd:A,onResolved:V}){if(I.length===0)return T.jsx("p",{"data-testid":"unit-list",className:"text-xs text-gray-400",children:"No units planned yet."});const K=[...I].sort((Z,$)=>Z.ord-$.ord);return T.jsx("ol",{className:"flex flex-col gap-1.5","data-testid":"unit-list",children:K.map(Z=>{const $=V!==void 0?{runId:B,unit:Z,isGated:A===Z.ord,onResolved:V}:{runId:B,unit:Z,isGated:A===Z.ord};return T.jsx(jd,{...$},Z.id)})})}function Fd({runId:B}){const I=Js(a=>a.outputs),A=Js(a=>a.logs),V=ye.useRef(null),K=`${B}:u`,Z=ye.useMemo(()=>Object.entries(I).filter(([a])=>a.startsWith(K)).map(([a,u])=>({ord:Number(a.slice(K.length)),text:u})).sort((a,u)=>a.ord-u.ord),[I,K]),$=A[B]??[];return ye.useEffect(()=>{const a=V.current;a&&(a.scrollTop=a.scrollHeight)},[Z]),T.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3","data-testid":"live-output",children:[T.jsxs("section",{children:[T.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-gray-400 mb-1",children:"Live output"}),T.jsx("div",{ref:V,"data-testid":"live-output-pane",className:"max-h-64 overflow-auto rounded bg-gray-900 p-2 text-[10px] leading-tight text-gray-100",children:Z.length===0?T.jsx("span",{className:"text-gray-500",children:"No output yet."}):Z.map(({ord:a,text:u})=>T.jsxs("div",{className:"mb-2",children:[T.jsxs("p",{className:"text-gray-500",children:["— unit #",a," —"]}),T.jsx("pre",{className:"whitespace-pre-wrap",children:u})]},a))})]}),T.jsxs("section",{children:[T.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-gray-400 mb-1",children:"Event log"}),T.jsx("ol",{"data-testid":"event-log",className:"max-h-64 overflow-auto rounded border border-gray-200 bg-white p-2 text-[11px]",children:$.length===0?T.jsx("li",{className:"text-gray-400",children:"No events yet."}):$.map(a=>T.jsxs("li",{className:"flex gap-2 border-b border-gray-50 py-0.5 last:border-0",children:[T.jsx("span",{className:"font-mono text-gray-400 shrink-0",children:typeof a.ord=="number"?`#${a.ord}`:"·"}),T.jsx("span",{className:"font-medium text-gray-600 shrink-0",children:a.type}),T.jsx("span",{className:"truncate text-gray-500",children:a.detail})]},a.seq))})]})]})}function Ud({view:B,log:I}){const{status:A}=B.session;if(A!=="failed"&&A!=="cancelled")return null;const V=[...I].reverse().find(Z=>Z.type==="error"),K=B.units.filter(Z=>Z.denial_reason||Z.status==="rejected");return A==="cancelled"?T.jsx("div",{"data-testid":"failure-banner","data-kind":"cancelled",className:"rounded border border-gray-300 bg-gray-50 p-3 text-xs text-gray-600",children:"Run cancelled."}):T.jsxs("div",{"data-testid":"failure-banner","data-kind":"failed",className:"rounded border border-red-300 bg-red-50 p-3 text-xs text-red-700",children:[T.jsx("p",{className:"font-semibold",children:"Run halted."}),V&&T.jsx("p",{className:"mt-1",children:V.detail}),K.length>0&&T.jsx("ul",{className:"mt-1 list-disc pl-4",children:K.map(Z=>T.jsxs("li",{children:["Unit #",Z.ord,": ",Z.denial_reason??"rejected"]},Z.id))})]})}const zd={pending:{ring:"border-gray-300 bg-white text-gray-400",label:"pending"},distributed:{ring:"border-blue-400 bg-blue-50 text-blue-600",label:"dispatched"},done:{ring:"border-green-500 bg-green-50 text-green-700",label:"done"},rejected:{ring:"border-red-500 bg-red-50 text-red-700",label:"rejected"}},Wd={recon:"text-blue-600",build:"text-green-600",review:"text-indigo-600",test:"text-amber-600"};function $d({model:B}){const{units:I,session:A}=B,V=K=>{const Z=A.human_confirm;return Z==="all"?!0:Z==="none"?!1:Z.before===K};return I.length===0?T.jsx("div",{"data-testid":"phase-ladder",className:"text-xs text-gray-400",children:"No units planned yet."}):T.jsxs("div",{"data-testid":"phase-ladder",className:"flex flex-col gap-2",children:[T.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-gray-400",children:"Phase ladder"}),T.jsx("ol",{className:"flex flex-wrap items-stretch gap-1",children:I.map((K,Z)=>{if(!K.resolved)return T.jsxs("li",{className:"flex items-center gap-1","data-testid":"ladder-unit","data-ord":K.ord,"data-resolving":"true",children:[Z>0&&T.jsx("span",{className:"h-px w-3 bg-gray-300","aria-hidden":!0}),T.jsxs("div",{className:"flex min-w-[3.5rem] flex-col items-center rounded border border-dashed border-gray-300 bg-white px-2 py-1 text-gray-400",title:`unit #${K.ord} — resolving (awaiting snapshot)`,children:[T.jsxs("span",{className:"text-[10px] font-semibold",children:["#",K.ord]}),T.jsx("span",{className:"text-[9px] italic text-gray-400",children:"resolving…"})]})]},K.ord);const $=zd[K.status],a=K.ord===A.unit_ix,u=K.gateEvals.length>0,p=K.gateEvals.some(h=>!h.combined)||K.status==="rejected",m=V(K.ord);return T.jsxs("li",{className:"flex items-center gap-1","data-testid":"ladder-unit","data-ord":K.ord,children:[Z>0&&T.jsx("span",{className:"h-px w-3 bg-gray-300","aria-hidden":!0}),T.jsxs("div",{className:`flex min-w-[3.5rem] flex-col items-center rounded border px-2 py-1 ${$.ring} ${a?"ring-2 ring-offset-1 ring-blue-400":""}`,title:`unit #${K.ord} — ${K.stage} — ${$.label}`,children:[T.jsxs("span",{className:"text-[10px] font-semibold",children:["#",K.ord]}),T.jsx("span",{className:`text-[9px] font-medium uppercase ${Wd[K.stage]}`,children:K.stage}),T.jsx("span",{className:"text-[9px] text-gray-500",children:$.label})]}),(u||m)&&T.jsx("span",{"data-testid":"ladder-gate",className:`text-xs ${p?"text-red-500":u?"text-green-600":"text-gray-400"}`,title:u?`gate evaluated (${p?"denied":"allowed"})`:"human-confirm gate (policy)",children:"◆"})]},K.ord)})})]})}function Vd(B){if(!B.combined){const I=[];return B.hasDeterministicFloor&&!B.deterministicPass&&I.push("deterministic floor"),B.evaluatorPass===!1&&I.push("evaluator (2nd pass)"),I.length===0&&B.agentVerdict!==null&&I.push("agent judge"),I.length>0?I.join(" + "):"governance"}return B.evaluatorPass!==null?"evaluator (2nd pass)":B.agentVerdict!==null?"agent judge":B.hasDeterministicFloor?"deterministic floor":"ungated"}function Kd({model:B}){const{units:I,session:A,pendingGate:V}=B,K=I.filter(a=>a.routing!==null||a.denialReason!==null||a.gateEvals.length>0),Z=V!==null?V.ord+1:A.status==="executing"?A.unit_ix:null,$=(()=>{if(Z===null)return!1;const a=A.human_confirm;return a==="all"?!0:a==="none"?!1:a.before===Z})();return T.jsx("div",{"data-testid":"decisions-ledger",className:"flex flex-col gap-2",children:K.length===0&&V===null?T.jsx("p",{className:"text-xs text-gray-400",children:"No governed decisions recorded yet."}):T.jsxs("ol",{className:"flex flex-col gap-2",children:[K.map(a=>T.jsxs("li",{"data-testid":"ledger-row","data-ord":a.ord,className:"rounded border border-gray-200 p-2 text-[11px]",children:[T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("span",{className:"font-semibold text-gray-600",children:["unit #",a.ord]}),T.jsx("span",{className:"text-gray-400",children:a.resolved?a.stage:"resolving…"})]}),T.jsx(lu,{routing:a.routing}),a.skillRef&&T.jsxs("p",{className:"text-[11px] text-gray-500",children:["skill: ",T.jsx("span",{className:"font-mono",children:a.skillRef})]}),a.gateEvals.map((u,p)=>T.jsxs("div",{className:"mt-1 rounded bg-gray-50 p-1.5",children:[T.jsxs("p",{className:u.combined?"text-green-700":"text-red-700",children:[T.jsx("span",{className:"font-semibold",children:u.combined?"ALLOW":"DENY"})," ·"," ",Vd(u),u.criterion?` · ${u.criterion}`:" · (ungated)"]}),u.hasDeterministicFloor&&T.jsxs("p",{className:"text-gray-500",children:["deterministic: ",u.deterministicPass?"pass":"fail"]}),u.agentVerdict!==null&&T.jsxs("p",{className:"text-gray-500",children:["agent: ",u.agentVerdict,u.agentReasoning?` — ${u.agentReasoning}`:""]}),u.evaluatorPass!==null&&T.jsxs("p",{className:"text-gray-500",children:["evaluator: ",u.evaluatorPass?"pass":"fail"]}),u.denialReason&&T.jsxs("p",{className:"text-red-600",children:["reason: ",u.denialReason]})]},p)),a.denialReason&&a.gateEvals.length===0&&T.jsxs("p",{className:"mt-1 text-red-600","data-testid":"ledger-denial",children:["denied: ",a.denialReason]})]},a.ord)),V!==null&&T.jsxs("li",{"data-testid":"ledger-pending",className:"rounded border border-dashed border-amber-300 bg-amber-50 p-2 text-[11px] text-amber-700",children:[T.jsx("span",{className:"font-semibold",children:"PENDING"})," · awaiting human · before unit #",V.ord,V.prompt?` — ${V.prompt}`:""]}),Z!==null&&T.jsxs("li",{"data-testid":"ledger-next",className:"rounded border border-dashed border-gray-200 p-2 text-[11px] text-gray-400",children:[$?"next decision point · unit #":"next unit · unit #",Z,$?" (human-confirm gate)":""]})]})})}const qd={approve:{label:"Approved",className:"text-green-700"},"approve-with-steer":{label:"Approved + steered",className:"text-amber-700"},reject:{label:"Rejected",className:"text-red-700"},cancel:{label:"Cancelled run",className:"text-gray-700"}};function Gd({runId:B}){const I=ou(A=>A.entries).filter(A=>A.runId===B);return I.length===0?T.jsx("p",{"data-testid":"steering-timeline",className:"text-xs text-gray-400",children:"No interventions recorded this session. Operator gate actions (approve / reject / amend) appear here as they happen."}):T.jsxs("div",{className:"flex flex-col gap-2",children:[T.jsx("p",{"data-testid":"steering-scope-note",className:"text-[10px] text-gray-400",children:"Client-recorded, this session only — cleared on reload. The daemon keeps no per-action gate history, so this list is forward-only from when this client connected."}),T.jsx("ol",{"data-testid":"steering-timeline",className:"flex flex-col gap-2",children:I.map(A=>{const V=qd[A.action];return T.jsxs("li",{"data-testid":"steering-entry",className:"rounded border border-gray-200 p-2 text-[11px]",children:[T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("span",{className:`font-semibold ${V.className}`,children:V.label}),T.jsx("span",{className:"text-gray-400",children:typeof A.ord=="number"?`before unit #${A.ord}`:"—"})]}),A.amend&&T.jsxs("p",{className:"mt-1 whitespace-pre-wrap rounded bg-gray-50 p-1.5 text-gray-600",children:[T.jsx("span",{className:"font-medium",children:"amended instruction:"})," ",A.amend]}),T.jsxs("p",{className:"mt-1 text-[10px] text-gray-400",children:["effect: ",A.action==="approve-with-steer"?"steers the next unit":A.action==="approve"?"run advances":A.action==="reject"?"run rejected":"run cancelled"," ","— as recorded"]})]},A.seq)})})]})}const Xd=new Set(["completed","cancelled","failed"]),Qd=new Intl.NumberFormat("en-US");function Hi(B){return Qd.format(B)}function eu(B){return B===null?"—":`$${B.toFixed(4)}`}function Yd({model:B}){const I=Pd(B),V=!Xd.has(B.session.status)||I.noAdapterClis.length>0||I.pendingUsageClis.length>0;return T.jsxs("div",{"data-testid":"burn",className:"flex flex-col gap-2 text-[11px]",children:[I.hasUsage?T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[T.jsxs("div",{className:"rounded border border-gray-200 p-2",children:[T.jsxs("p",{className:"text-gray-400",children:["tokens",V?" (partial)":""]}),T.jsx("p",{className:"font-mono text-sm text-gray-700",children:Hi(I.totalTokens)}),T.jsxs("p",{className:"text-[10px] text-gray-400",children:[Hi(I.totalInput)," in / ",Hi(I.totalOutput)," out"]})]}),T.jsxs("div",{className:"rounded border border-gray-200 p-2",children:[T.jsxs("p",{className:"text-gray-400",children:["cost",I.costComplete&&!V?"":" (partial)"]}),T.jsx("p",{className:"font-mono text-sm text-gray-700",children:eu(I.totalCost)}),I.totalCost===null&&T.jsx("p",{className:"text-[10px] text-gray-400",children:"no cost reported"})]}),T.jsxs("div",{className:"rounded border border-gray-200 p-2","data-testid":"burn-rework",children:[T.jsxs("p",{className:"text-gray-400",children:["rework",V?" (provisional)":""]}),T.jsxs("p",{className:"font-mono text-sm text-gray-700",children:[V?"~":"",I.reworkPct.toFixed(0),"%"]}),T.jsxs("p",{className:"text-[10px] text-gray-400",children:[Hi(I.reworkTokens)," tok (attempt>0)"]})]})]}),V&&T.jsx("p",{className:"text-[10px] text-gray-400","data-testid":"burn-partial",children:"Token totals and rework% are from connect onward; earlier usage may be missing — treat rework% as provisional."}),T.jsxs("div",{children:[T.jsx("p",{className:"mb-1 text-gray-400",children:"per CLI"}),T.jsx("ul",{className:"flex flex-col gap-0.5",children:I.perCli.map(K=>T.jsxs("li",{className:"flex justify-between font-mono text-gray-600",children:[T.jsx("span",{children:K.cli}),T.jsxs("span",{children:[Hi(K.input+K.output)," tok · ",eu(K.cost)]})]},K.cli))})]})]}):T.jsxs("p",{className:"text-gray-400","data-testid":"burn-empty",children:["Awaiting usage — token/cost burn lights up when a CLI emits ",T.jsx("code",{children:"cliUsage"})," ","(claude reports tokens + cost directly)."]}),I.noAdapterClis.length>0&&T.jsxs("p",{className:"text-amber-600","data-testid":"burn-unavailable",children:["usage unavailable for ",I.noAdapterClis.join(", ")," — no usage adapter (this seat doesn't emit ",T.jsx("code",{children:"cliUsage"}),")"]}),I.pendingUsageClis.length>0&&T.jsxs("p",{className:"text-gray-400","data-testid":"burn-pending",children:["usage not yet reported for ",I.pendingUsageClis.join(", ")," — claude reports tokens + cost directly; the record can lag the dispatch or the client joined mid-run."]})]})}function Jd({model:B}){const I=B.units.filter(A=>A.filesRead.length>0);return T.jsxs("div",{"data-testid":"data-used",className:"flex flex-col gap-2 text-[11px]",children:[I.length===0?T.jsxs("p",{className:"text-gray-400","data-testid":"data-used-empty",children:["No files-read captured yet — populated from claude ",T.jsx("code",{children:"tool_use"})," blocks via"," ",T.jsx("code",{children:"dataUsed"}),"."]}):T.jsx("ul",{className:"flex flex-col gap-2",children:I.map(A=>T.jsxs("li",{"data-testid":"data-used-unit","data-ord":A.ord,children:[T.jsxs("p",{className:"font-semibold text-gray-600",children:["unit #",A.ord,A.assignedCli?` · ${A.assignedCli}`:""]}),T.jsx("ul",{className:"mt-0.5 flex flex-col gap-0.5",children:A.filesRead.map(V=>T.jsx("li",{className:"truncate font-mono text-gray-500",title:V,children:V},V))})]},A.ord))}),T.jsx("p",{"data-testid":"data-used-recall-disabled",className:"rounded border border-dashed border-gray-300 bg-gray-50 p-1.5 text-gray-400",children:"memory / knowledge recall: disabled (pending core-ts binding)"})]})}function Fi({label:B,value:I,mono:A}){return T.jsxs("div",{className:"flex gap-2",children:[T.jsx("span",{className:"w-20 shrink-0 text-gray-400",children:B}),T.jsx("span",{className:`text-gray-700 ${A?"font-mono break-all":""}`,children:I})]})}function Zd({model:B}){const{session:I}=B;return T.jsxs("div",{"data-testid":"what-where",className:"flex flex-col gap-1.5 text-[11px]",children:[T.jsx(Fi,{label:"intent",value:I.problem}),T.jsx(Fi,{label:"repo",value:I.repo_ref??"—",mono:!0}),T.jsx(Fi,{label:"worktree",value:I.workdir??"—",mono:!0}),T.jsx(Fi,{label:"roster",value:I.clis.length>0?I.clis.join(", "):"—",mono:!0}),T.jsx(Fi,{label:"entity",value:I.entity_mode}),T.jsxs("div",{className:"mt-1 rounded border border-dashed border-gray-300 bg-gray-50 p-1.5 text-gray-400",children:["diff: not exposed on the run DTO (",T.jsx("code",{children:"work_output"})," pending daemon surface)"]})]})}function ef({model:B}){const I=B.units.filter(A=>A.routing!==null&&A.routing.method==="council"&&A.routing.dissent>0);return T.jsxs("div",{"data-testid":"assumptions",className:"flex flex-col gap-2 text-[11px]",children:[T.jsx("p",{className:"rounded border border-dashed border-purple-300 bg-purple-50 p-1.5 text-purple-600",children:"proto — derived from council dissent; structured-assumptions skill convention pending"}),I.length===0?T.jsx("p",{className:"text-gray-400",children:"No dissent signal yet. The full assumptions surface (assumed toolchain, no-rollback, …) is coming with the skill convention."}):T.jsx("ul",{className:"flex flex-col gap-1",children:I.map(A=>{const V=A.routing,K=V!==null&&V.method==="council"?V.dissent:0,Z=V!==null&&V.method==="council"?V.winner:"";return T.jsxs("li",{className:"rounded border border-gray-200 p-1.5 text-gray-600",children:["unit #",A.ord,": ",K," dissenting seat",K===1?"":"s"," vs winner"," ",T.jsx("span",{className:"font-mono",children:Z})," — proceeding past an unsettled call"]},A.ord)})})]})}function tf(){return T.jsxs("div",{"data-testid":"campaign-dag-stub",className:"rounded-lg border border-dashed border-gray-300 bg-gray-50 p-4 text-xs text-gray-400",children:[T.jsx("p",{className:"font-semibold text-gray-500",children:"Campaign DAG — engine-real, not wired"}),T.jsxs("p",{className:"mt-1",children:["Pending core's ",T.jsx("code",{children:"Campaign"})," primitive + ",T.jsx("code",{children:"RunFinished"})," /"," ",T.jsx("code",{children:"Campaign*"})," events (§4.3). Attaches to this same event stream when they land."]})]})}const rf=[{id:"decisions",label:"Decisions"},{id:"burn",label:"Burn"},{id:"data",label:"Data"},{id:"steering",label:"Steering"},{id:"what",label:"What/Where"},{id:"assumptions",label:"Assumptions"},{id:"unwired",label:"Unwired"}];function sf({model:B}){const[I,A]=ye.useState("decisions");return T.jsxs("div",{"data-testid":"insight-rail",className:"flex flex-col gap-3",children:[T.jsx("div",{className:"flex flex-wrap gap-1 border-b border-gray-200 pb-2",children:rf.map(V=>T.jsx("button",{type:"button","data-testid":`insight-tab-${V.id}`,"aria-pressed":I===V.id,onClick:()=>A(V.id),className:`rounded px-2 py-1 text-[11px] font-medium ${I===V.id?"bg-blue-600 text-white":"text-gray-500 hover:bg-gray-100"}`,children:V.label},V.id))}),T.jsxs("div",{children:[I==="decisions"&&T.jsx(Kd,{model:B}),I==="burn"&&T.jsx(Yd,{model:B}),I==="data"&&T.jsx(Jd,{model:B}),I==="steering"&&T.jsx(Gd,{runId:B.session.id}),I==="what"&&T.jsx(Zd,{model:B}),I==="assumptions"&&T.jsx(ef,{model:B}),I==="unwired"&&T.jsxs("div",{className:"flex flex-col gap-2 text-[11px]",children:[T.jsxs("div",{className:"rounded-lg border border-dashed border-gray-300 bg-gray-50 p-2 text-gray-500",children:[T.jsx("p",{className:"font-semibold",children:"Workflow selector — not wired"}),T.jsx("p",{className:"mt-1 text-gray-400",children:"Runs launch from free-text today; a workflow-def selector is a separate task."})]}),T.jsx(tf,{})]})]})]})}var Qo={exports:{}},tu;function nf(){return tu||(tu=1,(function(B,I){(function(A,V){B.exports=V()})(globalThis,(()=>(()=>{var A={4567:function($,a,u){var p=this&&this.__decorate||function(s,o,f,w){var y,b=arguments.length,v=b<3?o:w===null?w=Object.getOwnPropertyDescriptor(o,f):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(s,o,f,w);else for(var R=s.length-1;R>=0;R--)(y=s[R])&&(v=(b<3?y(v):b>3?y(o,f,v):y(o,f))||v);return b>3&&v&&Object.defineProperty(o,f,v),v},m=this&&this.__param||function(s,o){return function(f,w){o(f,w,s)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const h=u(9042),g=u(9924),S=u(844),x=u(4725),_=u(2585),n=u(3656);let l=a.AccessibilityManager=class extends S.Disposable{constructor(s,o,f,w){super(),this._terminal=s,this._coreBrowserService=f,this._renderService=w,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 y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=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 g.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((y=>this._handleResize(y.rows)))),this.register(this._terminal.onRender((y=>this._refreshRows(y.start,y.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((y=>this._handleChar(y)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
41
+ `)))),this.register(this._terminal.onA11yTab((y=>this._handleTab(y)))),this.register(this._terminal.onKey((y=>this._handleKey(y.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,n.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,S.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(s){for(let o=0;o<s;o++)this._handleChar(" ")}_handleChar(s){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==s&&(this._charsToAnnounce+=s):this._charsToAnnounce+=s,s===`
42
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(s){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(s)||this._charsToConsume.push(s)}_refreshRows(s,o){this._liveRegionDebouncer.refresh(s,o,this._terminal.rows)}_renderRows(s,o){const f=this._terminal.buffer,w=f.lines.length.toString();for(let y=s;y<=o;y++){const b=f.lines.get(f.ydisp+y),v=[],R=(b==null?void 0:b.translateToString(!0,void 0,void 0,v))||"",N=(f.ydisp+y+1).toString(),j=this._rowElements[y];j&&(R.length===0?(j.innerText=" ",this._rowColumns.set(j,[0,1])):(j.textContent=R,this._rowColumns.set(j,v)),j.setAttribute("aria-posinset",N),j.setAttribute("aria-setsize",w))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(s,o){const f=s.target,w=this._rowElements[o===0?1:this._rowElements.length-2];if(f.getAttribute("aria-posinset")===(o===0?"1":`${this._terminal.buffer.lines.length}`)||s.relatedTarget!==w)return;let y,b;if(o===0?(y=f,b=this._rowElements.pop(),this._rowContainer.removeChild(b)):(y=this._rowElements.shift(),b=f,this._rowContainer.removeChild(y)),y.removeEventListener("focus",this._topBoundaryFocusListener),b.removeEventListener("focus",this._bottomBoundaryFocusListener),o===0){const v=this._createAccessibilityTreeNode();this._rowElements.unshift(v),this._rowContainer.insertAdjacentElement("afterbegin",v)}else{const v=this._createAccessibilityTreeNode();this._rowElements.push(v),this._rowContainer.appendChild(v)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(o===0?-1:1),this._rowElements[o===0?1:this._rowElements.length-2].focus(),s.preventDefault(),s.stopImmediatePropagation()}_handleSelectionChange(){var R;if(this._rowElements.length===0)return;const s=document.getSelection();if(!s)return;if(s.isCollapsed)return void(this._rowContainer.contains(s.anchorNode)&&this._terminal.clearSelection());if(!s.anchorNode||!s.focusNode)return void console.error("anchorNode and/or focusNode are null");let o={node:s.anchorNode,offset:s.anchorOffset},f={node:s.focusNode,offset:s.focusOffset};if((o.node.compareDocumentPosition(f.node)&Node.DOCUMENT_POSITION_PRECEDING||o.node===f.node&&o.offset>f.offset)&&([o,f]=[f,o]),o.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(o={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(o.node))return;const w=this._rowElements.slice(-1)[0];if(f.node.compareDocumentPosition(w)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(f={node:w,offset:((R=w.textContent)==null?void 0:R.length)??0}),!this._rowContainer.contains(f.node))return;const y=({node:N,offset:j})=>{const z=N instanceof Text?N.parentNode:N;let M=parseInt(z==null?void 0:z.getAttribute("aria-posinset"),10)-1;if(isNaN(M))return console.warn("row is invalid. Race condition?"),null;const Q=this._rowColumns.get(z);if(!Q)return console.warn("columns is null. Race condition?"),null;let te=j<Q.length?Q[j]:Q.slice(-1)[0]+1;return te>=this._terminal.cols&&(++M,te=0),{row:M,column:te}},b=y(o),v=y(f);if(b&&v){if(b.row>v.row||b.row===v.row&&b.column>=v.column)throw new Error("invalid range");this._terminal.select(b.column,b.row,(v.row-b.row)*this._terminal.cols-b.column+v.column)}}_handleResize(s){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let o=this._rowContainer.children.length;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);for(;this._rowElements.length>s;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const s=this._coreBrowserService.mainDocument.createElement("div");return s.setAttribute("role","listitem"),s.tabIndex=-1,this._refreshRowDimensions(s),s}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let s=0;s<this._terminal.rows;s++)this._refreshRowDimensions(this._rowElements[s])}}_refreshRowDimensions(s){s.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=l=p([m(1,_.IInstantiationService),m(2,x.ICoreBrowserService),m(3,x.IRenderService)],l)},3614:($,a)=>{function u(g){return g.replace(/\r?\n/g,"\r")}function p(g,S){return S?"\x1B[200~"+g+"\x1B[201~":g}function m(g,S,x,_){g=p(g=u(g),x.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(g,!0),S.value=""}function h(g,S,x){const _=x.getBoundingClientRect(),n=g.clientX-_.left-10,l=g.clientY-_.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${n}px`,S.style.top=`${l}px`,S.style.zIndex="1000",S.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=u,a.bracketTextForPaste=p,a.copyHandler=function(g,S){g.clipboardData&&g.clipboardData.setData("text/plain",S.selectionText),g.preventDefault()},a.handlePasteEvent=function(g,S,x,_){g.stopPropagation(),g.clipboardData&&m(g.clipboardData.getData("text/plain"),S,x,_)},a.paste=m,a.moveTextAreaUnderMouseCursor=h,a.rightClickHandler=function(g,S,x,_,n){h(g,S,x),n&&_.rightClickSelect(g),S.value=_.selectionText,S.select()}},7239:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const p=u(1505);a.ColorContrastCache=class{constructor(){this._color=new p.TwoKeyMap,this._css=new p.TwoKeyMap}setCss(m,h,g){this._css.set(m,h,g)}getCss(m,h){return this._css.get(m,h)}setColor(m,h,g){this._color.set(m,h,g)}getColor(m,h){return this._color.get(m,h)}clear(){this._color.clear(),this._css.clear()}}},3656:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(u,p,m,h){u.addEventListener(p,m,h);let g=!1;return{dispose:()=>{g||(g=!0,u.removeEventListener(p,m,h))}}}},3551:function($,a,u){var p=this&&this.__decorate||function(l,s,o,f){var w,y=arguments.length,b=y<3?s:f===null?f=Object.getOwnPropertyDescriptor(s,o):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(l,s,o,f);else for(var v=l.length-1;v>=0;v--)(w=l[v])&&(b=(y<3?w(b):y>3?w(s,o,b):w(s,o))||b);return y>3&&b&&Object.defineProperty(s,o,b),b},m=this&&this.__param||function(l,s){return function(o,f){s(o,f,l)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const h=u(3656),g=u(8460),S=u(844),x=u(2585),_=u(4725);let n=a.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(l,s,o,f,w){super(),this._element=l,this._mouseService=s,this._renderService=o,this._bufferService=f,this._linkProviderService=w,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)((()=>{var y;this._lastMouseEvent=void 0,(y=this._activeProviderReplies)==null||y.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(l){this._lastMouseEvent=l;const s=this._positionFromMouseEvent(l,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const o=l.composedPath();for(let f=0;f<o.length;f++){const w=o[f];if(w.classList.contains("xterm"))break;if(w.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(l){if(this._activeLine!==l.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(l,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,l)||(this._clearCurrentLink(),this._askForLink(l,!0))}_askForLink(l,s){var f,w;this._activeProviderReplies&&s||((f=this._activeProviderReplies)==null||f.forEach((y=>{y==null||y.forEach((b=>{b.link.dispose&&b.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=l.y);let o=!1;for(const[y,b]of this._linkProviderService.linkProviders.entries())s?(w=this._activeProviderReplies)!=null&&w.get(y)&&(o=this._checkLinkProviderResult(y,l,o)):b.provideLinks(l.y,(v=>{var N,j;if(this._isMouseOut)return;const R=v==null?void 0:v.map((z=>({link:z})));(N=this._activeProviderReplies)==null||N.set(y,R),o=this._checkLinkProviderResult(y,l,o),((j=this._activeProviderReplies)==null?void 0:j.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(l.y,this._activeProviderReplies)}))}_removeIntersectingLinks(l,s){const o=new Set;for(let f=0;f<s.size;f++){const w=s.get(f);if(w)for(let y=0;y<w.length;y++){const b=w[y],v=b.link.range.start.y<l?0:b.link.range.start.x,R=b.link.range.end.y>l?this._bufferService.cols:b.link.range.end.x;for(let N=v;N<=R;N++){if(o.has(N)){w.splice(y--,1);break}o.add(N)}}}}_checkLinkProviderResult(l,s,o){var y;if(!this._activeProviderReplies)return o;const f=this._activeProviderReplies.get(l);let w=!1;for(let b=0;b<l;b++)this._activeProviderReplies.has(b)&&!this._activeProviderReplies.get(b)||(w=!0);if(!w&&f){const b=f.find((v=>this._linkAtPosition(v.link,s)));b&&(o=!0,this._handleNewLink(b))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!o)for(let b=0;b<this._activeProviderReplies.size;b++){const v=(y=this._activeProviderReplies.get(b))==null?void 0:y.find((R=>this._linkAtPosition(R.link,s)));if(v){o=!0,this._handleNewLink(v);break}}return o}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(l){if(!this._currentLink)return;const s=this._positionFromMouseEvent(l,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(l,this._currentLink.link.text)}_clearCurrentLink(l,s){this._currentLink&&this._lastMouseEvent&&(!l||!s||this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(l){if(!this._lastMouseEvent)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(l.link,s)&&(this._currentLink=l,this._currentLink.state={decorations:{underline:l.link.decorations===void 0||l.link.decorations.underline,pointerCursor:l.link.decorations===void 0||l.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,l.link,this._lastMouseEvent),l.link.decorations={},Object.defineProperties(l.link.decorations,{pointerCursor:{get:()=>{var o,f;return(f=(o=this._currentLink)==null?void 0:o.state)==null?void 0:f.decorations.pointerCursor},set:o=>{var f;(f=this._currentLink)!=null&&f.state&&this._currentLink.state.decorations.pointerCursor!==o&&(this._currentLink.state.decorations.pointerCursor=o,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",o))}},underline:{get:()=>{var o,f;return(f=(o=this._currentLink)==null?void 0:o.state)==null?void 0:f.decorations.underline},set:o=>{var f,w,y;(f=this._currentLink)!=null&&f.state&&((y=(w=this._currentLink)==null?void 0:w.state)==null?void 0:y.decorations.underline)!==o&&(this._currentLink.state.decorations.underline=o,this._currentLink.state.isHovered&&this._fireUnderlineEvent(l.link,o))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((o=>{if(!this._currentLink)return;const f=o.start===0?0:o.start+1+this._bufferService.buffer.ydisp,w=this._bufferService.buffer.ydisp+1+o.end;if(this._currentLink.link.range.start.y>=f&&this._currentLink.link.range.end.y<=w&&(this._clearCurrentLink(f,w),this._lastMouseEvent)){const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}}))))}_linkHover(l,s,o){var f;(f=this._currentLink)!=null&&f.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&l.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(o,s.text)}_fireUnderlineEvent(l,s){const o=l.range,f=this._bufferService.buffer.ydisp,w=this._createLinkUnderlineEvent(o.start.x-1,o.start.y-f-1,o.end.x,o.end.y-f-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(w)}_linkLeave(l,s,o){var f;(f=this._currentLink)!=null&&f.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&l.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(o,s.text)}_linkAtPosition(l,s){const o=l.range.start.y*this._bufferService.cols+l.range.start.x,f=l.range.end.y*this._bufferService.cols+l.range.end.x,w=s.y*this._bufferService.cols+s.x;return o<=w&&w<=f}_positionFromMouseEvent(l,s,o){const f=o.getCoords(l,s,this._bufferService.cols,this._bufferService.rows);if(f)return{x:f[0],y:f[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(l,s,o,f,w){return{x1:l,y1:s,x2:o,y2:f,cols:this._bufferService.cols,fg:w}}};a.Linkifier=n=p([m(1,_.IMouseService),m(2,_.IRenderService),m(3,x.IBufferService),m(4,_.ILinkProviderService)],n)},9042:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function($,a,u){var p=this&&this.__decorate||function(_,n,l,s){var o,f=arguments.length,w=f<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,l):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(_,n,l,s);else for(var y=_.length-1;y>=0;y--)(o=_[y])&&(w=(f<3?o(w):f>3?o(n,l,w):o(n,l))||w);return f>3&&w&&Object.defineProperty(n,l,w),w},m=this&&this.__param||function(_,n){return function(l,s){n(l,s,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const h=u(511),g=u(2585);let S=a.OscLinkProvider=class{constructor(_,n,l){this._bufferService=_,this._optionsService=n,this._oscLinkService=l}provideLinks(_,n){var R;const l=this._bufferService.buffer.lines.get(_-1);if(!l)return void n(void 0);const s=[],o=this._optionsService.rawOptions.linkHandler,f=new h.CellData,w=l.getTrimmedLength();let y=-1,b=-1,v=!1;for(let N=0;N<w;N++)if(b!==-1||l.hasContent(N)){if(l.loadCell(N,f),f.hasExtendedAttrs()&&f.extended.urlId){if(b===-1){b=N,y=f.extended.urlId;continue}v=f.extended.urlId!==y}else b!==-1&&(v=!0);if(v||b!==-1&&N===w-1){const j=(R=this._oscLinkService.getLinkData(y))==null?void 0:R.uri;if(j){const z={start:{x:b+1,y:_},end:{x:N+(v||N!==w-1?0:1),y:_}};let M=!1;if(!(o!=null&&o.allowNonHttpProtocols))try{const Q=new URL(j);["http:","https:"].includes(Q.protocol)||(M=!0)}catch{M=!0}M||s.push({text:j,range:z,activate:(Q,te)=>o?o.activate(Q,te,z):x(0,te),hover:(Q,te)=>{var ne;return(ne=o==null?void 0:o.hover)==null?void 0:ne.call(o,Q,te,z)},leave:(Q,te)=>{var ne;return(ne=o==null?void 0:o.leave)==null?void 0:ne.call(o,Q,te,z)}})}v=!1,f.hasExtendedAttrs()&&f.extended.urlId?(b=N,y=f.extended.urlId):(b=-1,y=-1)}}n(s)}};function x(_,n){if(confirm(`Do you want to navigate to ${n}?
43
+
44
+ WARNING: This link could potentially be dangerous`)){const l=window.open();if(l){try{l.opener=null}catch{}l.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=S=p([m(0,g.IBufferService),m(1,g.IOptionsService),m(2,g.IOscLinkService)],S)},6193:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(u,p){this._renderCallback=u,this._coreBrowserService=p,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,p,m){this._rowCount=m,u=u!==void 0?u:0,p=p!==void 0?p:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,p):p,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),p=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,p),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const p=u(3614),m=u(3656),h=u(3551),g=u(9042),S=u(3730),x=u(1680),_=u(3107),n=u(5744),l=u(2950),s=u(1296),o=u(428),f=u(4269),w=u(5114),y=u(8934),b=u(3230),v=u(9312),R=u(4725),N=u(6731),j=u(8055),z=u(8969),M=u(8460),Q=u(844),te=u(6114),ne=u(8437),le=u(2584),F=u(7399),C=u(5941),D=u(9074),k=u(2585),P=u(5435),J=u(4567),re=u(779);class ce extends z.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(U={}){super(U),this.browser=te,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Q.MutableDisposable),this._onCursorMove=this.register(new M.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new M.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new M.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new M.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new M.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new M.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new M.EventEmitter),this._onBlur=this.register(new M.EventEmitter),this._onA11yCharEmitter=this.register(new M.EventEmitter),this._onA11yTabEmitter=this.register(new M.EventEmitter),this._onWillOpen=this.register(new M.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(k.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(re.LinkProviderService),this._instantiationService.setService(R.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((L,ee)=>this.refresh(L,ee)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((L=>this._reportWindowsOptions(L)))),this.register(this._inputHandler.onColor((L=>this._handleColorEvent(L)))),this.register((0,M.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,M.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((L=>this._afterResize(L.cols,L.rows)))),this.register((0,Q.toDisposable)((()=>{var L,ee;this._customKeyEventHandler=void 0,(ee=(L=this.element)==null?void 0:L.parentNode)==null||ee.removeChild(this.element)})))}_handleColorEvent(U){if(this._themeService)for(const L of U){let ee,Y="";switch(L.index){case 256:ee="foreground",Y="10";break;case 257:ee="background",Y="11";break;case 258:ee="cursor",Y="12";break;default:ee="ansi",Y="4;"+L.index}switch(L.type){case 0:const de=j.color.toColorRGB(ee==="ansi"?this._themeService.colors.ansi[L.index]:this._themeService.colors[ee]);this.coreService.triggerDataEvent(`${le.C0.ESC}]${Y};${(0,C.toRgbString)(de)}${le.C1_ESCAPED.ST}`);break;case 1:if(ee==="ansi")this._themeService.modifyColors((he=>he.ansi[L.index]=j.channels.toColor(...L.color)));else{const he=ee;this._themeService.modifyColors((xe=>xe[he]=j.channels.toColor(...L.color)))}break;case 2:this._themeService.restoreColor(L.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(U){U?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(J.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(U){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(le.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var U;return(U=this.textarea)==null?void 0:U.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(le.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 U=this.buffer.ybase+this.buffer.y,L=this.buffer.lines.get(U);if(!L)return;const ee=Math.min(this.buffer.x,this.cols-1),Y=this._renderService.dimensions.css.cell.height,de=L.getWidth(ee),he=this._renderService.dimensions.css.cell.width*de,xe=this.buffer.y*this._renderService.dimensions.css.cell.height,Le=ee*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Le+"px",this.textarea.style.top=xe+"px",this.textarea.style.width=he+"px",this.textarea.style.height=Y+"px",this.textarea.style.lineHeight=Y+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(L=>{this.hasSelection()&&(0,p.copyHandler)(L,this._selectionService)})));const U=L=>(0,p.handlePasteEvent)(L,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",U)),this.register((0,m.addDisposableDomListener)(this.element,"paste",U)),te.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(L=>{L.button===2&&(0,p.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(L=>{(0,p.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),te.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(L=>{L.button===1&&(0,p.moveTextAreaUnderMouseCursor)(L,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(U=>this._keyUp(U)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(U=>this._keyDown(U)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(U=>this._keyPress(U)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(U=>this._compositionHelper.compositionupdate(U)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(U=>this._inputEvent(U)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(U){var ee;if(!U)throw new Error("Terminal requires a parent element.");if(U.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ee=this.element)==null?void 0:ee.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=U.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"),U.appendChild(this.element);const L=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),L.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,m.addDisposableDomListener)(this.screenElement,"mousemove",(Y=>this.updateCursorStyle(Y)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),L.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),te.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(w.CoreBrowserService,this.textarea,U.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(R.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(Y=>this._handleTextAreaFocus(Y)))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(o.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(R.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(N.ThemeService),this._instantiationService.setService(R.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(f.CharacterJoinerService),this._instantiationService.setService(R.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(b.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(R.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((Y=>this._onRender.fire(Y)))),this.onResize((Y=>this._renderService.resize(Y.cols,Y.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(l.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(y.MouseService),this._instantiationService.setService(R.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(L);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((Y=>this.scrollLines(Y.amount,Y.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(v.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(R.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((Y=>this.scrollLines(Y.amount,Y.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((Y=>this._renderService.handleSelectionChanged(Y.start,Y.end,Y.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((Y=>{this.textarea.value=Y,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((Y=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(_.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(Y=>this._selectionService.handleMouseDown(Y)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(J.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(Y=>this._handleScreenReaderModeOptionChange(Y)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(Y=>{!this._overviewRulerRenderer&&Y&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(s.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const U=this,L=this.element;function ee(he){const xe=U._mouseService.getMouseReportCoords(he,U.screenElement);if(!xe)return!1;let Le,Te;switch(he.overrideType||he.type){case"mousemove":Te=32,he.buttons===void 0?(Le=3,he.button!==void 0&&(Le=he.button<3?he.button:3)):Le=1&he.buttons?0:4&he.buttons?1:2&he.buttons?2:3;break;case"mouseup":Te=0,Le=he.button<3?he.button:3;break;case"mousedown":Te=1,Le=he.button<3?he.button:3;break;case"wheel":if(U._customWheelEventHandler&&U._customWheelEventHandler(he)===!1||U.viewport.getLinesScrolled(he)===0)return!1;Te=he.deltaY<0?0:1,Le=4;break;default:return!1}return!(Te===void 0||Le===void 0||Le>4)&&U.coreMouseService.triggerMouseEvent({col:xe.col,row:xe.row,x:xe.x,y:xe.y,button:Le,action:Te,ctrl:he.ctrlKey,alt:he.altKey,shift:he.shiftKey})}const Y={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de={mouseup:he=>(ee(he),he.buttons||(this._document.removeEventListener("mouseup",Y.mouseup),Y.mousedrag&&this._document.removeEventListener("mousemove",Y.mousedrag)),this.cancel(he)),wheel:he=>(ee(he),this.cancel(he,!0)),mousedrag:he=>{he.buttons&&ee(he)},mousemove:he=>{he.buttons||ee(he)}};this.register(this.coreMouseService.onProtocolChange((he=>{he?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(he)),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&he?Y.mousemove||(L.addEventListener("mousemove",de.mousemove),Y.mousemove=de.mousemove):(L.removeEventListener("mousemove",Y.mousemove),Y.mousemove=null),16&he?Y.wheel||(L.addEventListener("wheel",de.wheel,{passive:!1}),Y.wheel=de.wheel):(L.removeEventListener("wheel",Y.wheel),Y.wheel=null),2&he?Y.mouseup||(Y.mouseup=de.mouseup):(this._document.removeEventListener("mouseup",Y.mouseup),Y.mouseup=null),4&he?Y.mousedrag||(Y.mousedrag=de.mousedrag):(this._document.removeEventListener("mousemove",Y.mousedrag),Y.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(L,"mousedown",(he=>{if(he.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(he))return ee(he),Y.mouseup&&this._document.addEventListener("mouseup",Y.mouseup),Y.mousedrag&&this._document.addEventListener("mousemove",Y.mousedrag),this.cancel(he)}))),this.register((0,m.addDisposableDomListener)(L,"wheel",(he=>{if(!Y.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(he)===!1)return!1;if(!this.buffer.hasScrollback){const xe=this.viewport.getLinesScrolled(he);if(xe===0)return;const Le=le.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(he.deltaY<0?"A":"B");let Te="";for(let qe=0;qe<Math.abs(xe);qe++)Te+=Le;return this.coreService.triggerDataEvent(Te,!0),this.cancel(he,!0)}return this.viewport.handleWheel(he)?this.cancel(he):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)(L,"touchstart",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(he),this.cancel(he)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(L,"touchmove",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(he)?void 0:this.cancel(he)}),{passive:!1}))}refresh(U,L){var ee;(ee=this._renderService)==null||ee.refreshRows(U,L)}updateCursorStyle(U){var L;(L=this._selectionService)!=null&&L.shouldColumnSelect(U)?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(U,L,ee=0){var Y;ee===1?(super.scrollLines(U,L,ee),this.refresh(0,this.rows-1)):(Y=this.viewport)==null||Y.scrollLines(U)}paste(U){(0,p.paste)(U,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(U){this._customKeyEventHandler=U}attachCustomWheelEventHandler(U){this._customWheelEventHandler=U}registerLinkProvider(U){return this._linkProviderService.registerLinkProvider(U)}registerCharacterJoiner(U){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const L=this._characterJoinerService.register(U);return this.refresh(0,this.rows-1),L}deregisterCharacterJoiner(U){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(U)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(U){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+U)}registerDecoration(U){return this._decorationService.registerDecoration(U)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(U,L,ee){this._selectionService.setSelection(U,L,ee)}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 U;(U=this._selectionService)==null||U.clearSelection()}selectAll(){var U;(U=this._selectionService)==null||U.selectAll()}selectLines(U,L){var ee;(ee=this._selectionService)==null||ee.selectLines(U,L)}_keyDown(U){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(U)===!1)return!1;const L=this.browser.isMac&&this.options.macOptionIsMeta&&U.altKey;if(!L&&!this._compositionHelper.keydown(U))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;L||U.key!=="Dead"&&U.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ee=(0,F.evaluateKeyboardEvent)(U,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(U),ee.type===3||ee.type===2){const Y=this.rows-1;return this.scrollLines(ee.type===2?-Y:Y),this.cancel(U,!0)}return ee.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,U)||(ee.cancel&&this.cancel(U,!0),!ee.key||!!(U.key&&!U.ctrlKey&&!U.altKey&&!U.metaKey&&U.key.length===1&&U.key.charCodeAt(0)>=65&&U.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ee.key!==le.C0.ETX&&ee.key!==le.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ee.key,domEvent:U}),this._showCursor(),this.coreService.triggerDataEvent(ee.key,!0),!this.optionsService.rawOptions.screenReaderMode||U.altKey||U.ctrlKey?this.cancel(U,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(U,L){const ee=U.isMac&&!this.options.macOptionIsMeta&&L.altKey&&!L.ctrlKey&&!L.metaKey||U.isWindows&&L.altKey&&L.ctrlKey&&!L.metaKey||U.isWindows&&L.getModifierState("AltGraph");return L.type==="keypress"?ee:ee&&(!L.keyCode||L.keyCode>47)}_keyUp(U){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(U)===!1||((function(L){return L.keyCode===16||L.keyCode===17||L.keyCode===18})(U)||this.focus(),this.updateCursorStyle(U),this._keyPressHandled=!1)}_keyPress(U){let L;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(U)===!1)return!1;if(this.cancel(U),U.charCode)L=U.charCode;else if(U.which===null||U.which===void 0)L=U.keyCode;else{if(U.which===0||U.charCode===0)return!1;L=U.which}return!(!L||(U.altKey||U.ctrlKey||U.metaKey)&&!this._isThirdLevelShift(this.browser,U)||(L=String.fromCharCode(L),this._onKey.fire({key:L,domEvent:U}),this._showCursor(),this.coreService.triggerDataEvent(L,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(U){if(U.data&&U.inputType==="insertText"&&(!U.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const L=U.data;return this.coreService.triggerDataEvent(L,!0),this.cancel(U),!0}return!1}resize(U,L){U!==this.cols||L!==this.rows?super.resize(U,L):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(U,L){var ee,Y;(ee=this._charSizeService)==null||ee.measure(),(Y=this.viewport)==null||Y.syncScrollArea(!0)}clear(){var U;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let L=1;L<this.rows;L++)this.buffer.lines.push(this.buffer.getBlankLine(ne.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(U=this.viewport)==null||U.reset(),this.refresh(0,this.rows-1)}}reset(){var L,ee;this.options.rows=this.rows,this.options.cols=this.cols;const U=this._customKeyEventHandler;this._setup(),super.reset(),(L=this._selectionService)==null||L.reset(),this._decorationService.reset(),(ee=this.viewport)==null||ee.reset(),this._customKeyEventHandler=U,this.refresh(0,this.rows-1)}clearTextureAtlas(){var U;(U=this._renderService)==null||U.clearTextureAtlas()}_reportFocus(){var U;(U=this.element)!=null&&U.classList.contains("focus")?this.coreService.triggerDataEvent(le.C0.ESC+"[I"):this.coreService.triggerDataEvent(le.C0.ESC+"[O")}_reportWindowsOptions(U){if(this._renderService)switch(U){case P.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const L=this._renderService.dimensions.css.canvas.width.toFixed(0),ee=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${le.C0.ESC}[4;${ee};${L}t`);break;case P.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const Y=this._renderService.dimensions.css.cell.width.toFixed(0),de=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${le.C0.ESC}[6;${de};${Y}t`)}}cancel(U,L){if(this.options.cancelEvents||L)return U.preventDefault(),U.stopPropagation(),!1}}a.Terminal=ce},9924:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(u,p=1e3){this._renderCallback=u,this._debounceThresholdMS=p,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,p,m){this._rowCount=m,u=u!==void 0?u:0,p=p!==void 0?p:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,p):p;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=h-this._lastRefreshMs,S=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),S)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),p=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,p)}}},1680:function($,a,u){var p=this&&this.__decorate||function(l,s,o,f){var w,y=arguments.length,b=y<3?s:f===null?f=Object.getOwnPropertyDescriptor(s,o):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(l,s,o,f);else for(var v=l.length-1;v>=0;v--)(w=l[v])&&(b=(y<3?w(b):y>3?w(s,o,b):w(s,o))||b);return y>3&&b&&Object.defineProperty(s,o,b),b},m=this&&this.__param||function(l,s){return function(o,f){s(o,f,l)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const h=u(3656),g=u(4725),S=u(8460),x=u(844),_=u(2585);let n=a.Viewport=class extends x.Disposable{constructor(l,s,o,f,w,y,b,v){super(),this._viewportElement=l,this._scrollArea=s,this._bufferService=o,this._optionsService=f,this._charSizeService=w,this._renderService=y,this._coreBrowserService=b,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((R=>this._activeBuffer=R.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((R=>this._renderDimensions=R))),this._handleThemeChange(v.colors),this.register(v.onChangeColors((R=>this._handleThemeChange(R)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(l){this._viewportElement.style.backgroundColor=l.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(l){if(l)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==s&&(this._lastRecordedBufferHeight=s,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const l=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==l&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=l),this._refreshAnimationFrame=null}syncScrollArea(l=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(l);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(l)}_handleScroll(l){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const s=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const l=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(l*(this._smoothScrollState.target-this._smoothScrollState.origin)),l<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(l,s){const o=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&o<this._lastRecordedBufferHeight)||(l.cancelable&&l.preventDefault(),!1)}handleWheel(l){const s=this._getPixelsScrolled(l);return s!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+s:this._smoothScrollState.target+=s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=s,this._bubbleScroll(l,s))}scrollLines(l){if(l!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const s=l*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!1})}_getPixelsScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let s=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getBufferElements(l,s){var v;let o,f="";const w=[],y=s??this._bufferService.buffer.lines.length,b=this._bufferService.buffer.lines;for(let R=l;R<y;R++){const N=b.get(R);if(!N)continue;const j=(v=b.get(R+1))==null?void 0:v.isWrapped;if(f+=N.translateToString(!j),!j||R===b.length-1){const z=document.createElement("div");z.textContent=f,w.push(z),f.length>0&&(o=z),f=""}}return{bufferElements:w,cursorElement:o}}getLinesScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let s=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=this._currentRowHeight+0,this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(l,s){const o=this._optionsService.rawOptions.fastScrollModifier;return o==="alt"&&s.altKey||o==="ctrl"&&s.ctrlKey||o==="shift"&&s.shiftKey?l*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:l*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(l){this._lastTouchY=l.touches[0].pageY}handleTouchMove(l){const s=this._lastTouchY-l.touches[0].pageY;return this._lastTouchY=l.touches[0].pageY,s!==0&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(l,s))}};a.Viewport=n=p([m(2,_.IBufferService),m(3,_.IOptionsService),m(4,g.ICharSizeService),m(5,g.IRenderService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],n)},3107:function($,a,u){var p=this&&this.__decorate||function(_,n,l,s){var o,f=arguments.length,w=f<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,l):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(_,n,l,s);else for(var y=_.length-1;y>=0;y--)(o=_[y])&&(w=(f<3?o(w):f>3?o(n,l,w):o(n,l))||w);return f>3&&w&&Object.defineProperty(n,l,w),w},m=this&&this.__param||function(_,n){return function(l,s){n(l,s,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const h=u(4725),g=u(844),S=u(2585);let x=a.BufferDecorationRenderer=class extends g.Disposable{constructor(_,n,l,s,o){super(),this._screenElement=_,this._bufferService=n,this._coreBrowserService=l,this._decorationService=s,this._renderService=o,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((f=>this._removeDecoration(f)))),this.register((0,g.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const _ of this._decorationService.decorations)this._renderDecoration(_);this._dimensionsChanged=!1}_renderDecoration(_){this._refreshStyle(_),this._dimensionsChanged&&this._refreshXPosition(_)}_createElement(_){var s;const n=this._coreBrowserService.mainDocument.createElement("div");n.classList.add("xterm-decoration"),n.classList.toggle("xterm-decoration-top-layer",((s=_==null?void 0:_.options)==null?void 0:s.layer)==="top"),n.style.width=`${Math.round((_.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=(_.options.height||1)*this._renderService.dimensions.css.cell.height+"px",n.style.top=(_.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const l=_.options.x??0;return l&&l>this._bufferService.cols&&(n.style.display="none"),this._refreshXPosition(_,n),n}_refreshStyle(_){const n=_.marker.line-this._bufferService.buffers.active.ydisp;if(n<0||n>=this._bufferService.rows)_.element&&(_.element.style.display="none",_.onRenderEmitter.fire(_.element));else{let l=this._decorationElements.get(_);l||(l=this._createElement(_),_.element=l,this._decorationElements.set(_,l),this._container.appendChild(l),_.onDispose((()=>{this._decorationElements.delete(_),l.remove()}))),l.style.top=n*this._renderService.dimensions.css.cell.height+"px",l.style.display=this._altBufferIsActive?"none":"block",_.onRenderEmitter.fire(l)}}_refreshXPosition(_,n=_.element){if(!n)return;const l=_.options.x??0;(_.options.anchor||"left")==="right"?n.style.right=l?l*this._renderService.dimensions.css.cell.width+"px":"":n.style.left=l?l*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(_){var n;(n=this._decorationElements.get(_))==null||n.remove(),this._decorationElements.delete(_),_.dispose()}};a.BufferDecorationRenderer=x=p([m(1,S.IBufferService),m(2,h.ICoreBrowserService),m(3,S.IDecorationService),m(4,h.IRenderService)],x)},5871:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const p of this._zones)if(p.color===u.options.overviewRulerOptions.color&&p.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(p,u.marker.line))return;if(this._lineAdjacentToZone(p,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(p,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,p){return p>=u.startBufferLine&&p<=u.endBufferLine}_lineAdjacentToZone(u,p,m){return p>=u.startBufferLine-this._linePadding[m||"full"]&&p<=u.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(u,p){u.startBufferLine=Math.min(u.startBufferLine,p),u.endBufferLine=Math.max(u.endBufferLine,p)}}},5744:function($,a,u){var p=this&&this.__decorate||function(o,f,w,y){var b,v=arguments.length,R=v<3?f:y===null?y=Object.getOwnPropertyDescriptor(f,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(o,f,w,y);else for(var N=o.length-1;N>=0;N--)(b=o[N])&&(R=(v<3?b(R):v>3?b(f,w,R):b(f,w))||R);return v>3&&R&&Object.defineProperty(f,w,R),R},m=this&&this.__param||function(o,f){return function(w,y){f(w,y,o)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const h=u(5871),g=u(4725),S=u(844),x=u(2585),_={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0};let s=a.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(o,f,w,y,b,v,R){var j;super(),this._viewportElement=o,this._screenElement=f,this._bufferService=w,this._decorationService=y,this._renderService=b,this._optionsService=v,this._coreBrowserService=R,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(),(j=this._viewportElement.parentElement)==null||j.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 z;(z=this._canvas)==null||z.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 o=Math.floor(this._canvas.width/3),f=Math.ceil(this._canvas.width/3);n.full=this._canvas.width,n.left=o,n.center=f,n.right=o,this._refreshDrawHeightConstants(),l.full=0,l.left=0,l.center=n.left,l.right=n.left+n.center}_refreshDrawHeightConstants(){_.full=Math.round(2*this._coreBrowserService.dpr);const o=this._canvas.height/this._bufferService.buffer.lines.length,f=Math.round(Math.max(Math.min(o,12),6)*this._coreBrowserService.dpr);_.left=f,_.center=f,_.right=f}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const f of this._decorationService.decorations)this._colorZoneStore.addDecoration(f);this._ctx.lineWidth=1;const o=this._colorZoneStore.zones;for(const f of o)f.position!=="full"&&this._renderColorZone(f);for(const f of o)f.position==="full"&&this._renderColorZone(f);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(o){this._ctx.fillStyle=o.color,this._ctx.fillRect(l[o.position||"full"],Math.round((this._canvas.height-1)*(o.startBufferLine/this._bufferService.buffers.active.lines.length)-_[o.position||"full"]/2),n[o.position||"full"],Math.round((this._canvas.height-1)*((o.endBufferLine-o.startBufferLine)/this._bufferService.buffers.active.lines.length)+_[o.position||"full"]))}_queueRefresh(o,f){this._shouldUpdateDimensions=o||this._shouldUpdateDimensions,this._shouldUpdateAnchor=f||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=s=p([m(2,x.IBufferService),m(3,x.IDecorationService),m(4,g.IRenderService),m(5,x.IOptionsService),m(6,g.ICoreBrowserService)],s)},2950:function($,a,u){var p=this&&this.__decorate||function(_,n,l,s){var o,f=arguments.length,w=f<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,l):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(_,n,l,s);else for(var y=_.length-1;y>=0;y--)(o=_[y])&&(w=(f<3?o(w):f>3?o(n,l,w):o(n,l))||w);return f>3&&w&&Object.defineProperty(n,l,w),w},m=this&&this.__param||function(_,n){return function(l,s){n(l,s,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const h=u(4725),g=u(2585),S=u(2584);let x=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(_,n,l,s,o,f){this._textarea=_,this._compositionView=n,this._bufferService=l,this._optionsService=s,this._coreService=o,this._renderService=f,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(_){this._compositionView.textContent=_.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(_){if(this._isComposing||this._isSendingComposition){if(_.keyCode===229||_.keyCode===16||_.keyCode===17||_.keyCode===18)return!1;this._finalizeComposition(!1)}return _.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(_){if(this._compositionView.classList.remove("active"),this._isComposing=!1,_){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let l;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,l=this._isComposing?this._textarea.value.substring(n.start,n.end):this._textarea.value.substring(n.start),l.length>0&&this._coreService.triggerDataEvent(l,!0)}}),0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const _=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const n=this._textarea.value,l=n.replace(_,"");this._dataAlreadySent=l,n.length>_.length?this._coreService.triggerDataEvent(l,!0):n.length<_.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):n.length===_.length&&n!==_&&this._coreService.triggerDataEvent(n,!0)}}),0)}updateCompositionElements(_){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),l=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,o=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=o+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=l+"px",this._compositionView.style.lineHeight=l+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const f=this._compositionView.getBoundingClientRect();this._textarea.style.left=o+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(f.width,1)+"px",this._textarea.style.height=Math.max(f.height,1)+"px",this._textarea.style.lineHeight=f.height+"px"}_||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=x=p([m(2,g.IBufferService),m(3,g.IOptionsService),m(4,g.ICoreService),m(5,h.IRenderService)],x)},9806:($,a)=>{function u(p,m,h){const g=h.getBoundingClientRect(),S=p.getComputedStyle(h),x=parseInt(S.getPropertyValue("padding-left")),_=parseInt(S.getPropertyValue("padding-top"));return[m.clientX-g.left-x,m.clientY-g.top-_]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=u,a.getCoords=function(p,m,h,g,S,x,_,n,l){if(!x)return;const s=u(p,m,h);return s?(s[0]=Math.ceil((s[0]+(l?_/2:0))/_),s[1]=Math.ceil(s[1]/n),s[0]=Math.min(Math.max(s[0],1),g+(l?1:0)),s[1]=Math.min(Math.max(s[1],1),S),s):void 0}},9504:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const p=u(2584);function m(n,l,s,o){const f=n-h(n,s),w=l-h(l,s),y=Math.abs(f-w)-(function(b,v,R){let N=0;const j=b-h(b,R),z=v-h(v,R);for(let M=0;M<Math.abs(j-z);M++){const Q=g(b,v)==="A"?-1:1,te=R.buffer.lines.get(j+Q*M);te!=null&&te.isWrapped&&N++}return N})(n,l,s);return _(y,x(g(n,l),o))}function h(n,l){let s=0,o=l.buffer.lines.get(n),f=o==null?void 0:o.isWrapped;for(;f&&n>=0&&n<l.rows;)s++,o=l.buffer.lines.get(--n),f=o==null?void 0:o.isWrapped;return s}function g(n,l){return n>l?"A":"B"}function S(n,l,s,o,f,w){let y=n,b=l,v="";for(;y!==s||b!==o;)y+=f?1:-1,f&&y>w.cols-1?(v+=w.buffer.translateBufferLineToString(b,!1,n,y),y=0,n=0,b++):!f&&y<0&&(v+=w.buffer.translateBufferLineToString(b,!1,0,n+1),y=w.cols-1,n=y,b--);return v+w.buffer.translateBufferLineToString(b,!1,n,y)}function x(n,l){const s=l?"O":"[";return p.C0.ESC+s+n}function _(n,l){n=Math.floor(n);let s="";for(let o=0;o<n;o++)s+=l;return s}a.moveToCellSequence=function(n,l,s,o){const f=s.buffer.x,w=s.buffer.y;if(!s.buffer.hasScrollback)return(function(v,R,N,j,z,M){return m(R,j,z,M).length===0?"":_(S(v,R,v,R-h(R,z),!1,z).length,x("D",M))})(f,w,0,l,s,o)+m(w,l,s,o)+(function(v,R,N,j,z,M){let Q;Q=m(R,j,z,M).length>0?j-h(j,z):R;const te=j,ne=(function(le,F,C,D,k,P){let J;return J=m(C,D,k,P).length>0?D-h(D,k):F,le<C&&J<=D||le>=C&&J<D?"C":"D"})(v,R,N,j,z,M);return _(S(v,Q,N,te,ne==="C",z).length,x(ne,M))})(f,w,n,l,s,o);let y;if(w===l)return y=f>n?"D":"C",_(Math.abs(f-n),x(y,o));y=w>l?"D":"C";const b=Math.abs(w-l);return _((function(v,R){return R.cols-v})(w>l?n:f,s)+(b-1)*s.cols+1+((w>l?f:n)-1),x(y,o))}},1296:function($,a,u){var p=this&&this.__decorate||function(M,Q,te,ne){var le,F=arguments.length,C=F<3?Q:ne===null?ne=Object.getOwnPropertyDescriptor(Q,te):ne;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(M,Q,te,ne);else for(var D=M.length-1;D>=0;D--)(le=M[D])&&(C=(F<3?le(C):F>3?le(Q,te,C):le(Q,te))||C);return F>3&&C&&Object.defineProperty(Q,te,C),C},m=this&&this.__param||function(M,Q){return function(te,ne){Q(te,ne,M)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const h=u(3787),g=u(2550),S=u(2223),x=u(6171),_=u(6052),n=u(4725),l=u(8055),s=u(8460),o=u(844),f=u(2585),w="xterm-dom-renderer-owner-",y="xterm-rows",b="xterm-fg-",v="xterm-bg-",R="xterm-focus",N="xterm-selection";let j=1,z=a.DomRenderer=class extends o.Disposable{constructor(M,Q,te,ne,le,F,C,D,k,P,J,re,ce){super(),this._terminal=M,this._document=Q,this._element=te,this._screenElement=ne,this._viewportElement=le,this._helperContainer=F,this._linkifier2=C,this._charSizeService=k,this._optionsService=P,this._bufferService=J,this._coreBrowserService=re,this._themeService=ce,this._terminalClass=j++,this._rowElements=[],this._selectionRenderModel=(0,_.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new s.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(y),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(N),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.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=D.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(w+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,o.toDisposable)((()=>{this._element.classList.remove(w+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new g.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 M=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*M,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*M),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/M),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/M),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 te of this._rowElements)te.style.width=`${this.dimensions.css.canvas.width}px`,te.style.height=`${this.dimensions.css.cell.height}px`,te.style.lineHeight=`${this.dimensions.css.cell.height}px`,te.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Q=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Q,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(M){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Q=`${this._terminalSelector} .${y} { color: ${M.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Q+=`${this._terminalSelector} .${y} .xterm-dim { color: ${l.color.multiplyOpacity(M.foreground,.5).css};}`,Q+=`${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 te=`blink_underline_${this._terminalClass}`,ne=`blink_bar_${this._terminalClass}`,le=`blink_block_${this._terminalClass}`;Q+=`@keyframes ${te} { 50% { border-bottom-style: hidden; }}`,Q+=`@keyframes ${ne} { 50% { box-shadow: none; }}`,Q+=`@keyframes ${le} { 0% { background-color: ${M.cursor.css}; color: ${M.cursorAccent.css}; } 50% { background-color: inherit; color: ${M.cursor.css}; }}`,Q+=`${this._terminalSelector} .${y}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${te} 1s step-end infinite;}${this._terminalSelector} .${y}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${ne} 1s step-end infinite;}${this._terminalSelector} .${y}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${le} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${M.cursor.css}; color: ${M.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${M.cursor.css} !important; color: ${M.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${M.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${M.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${M.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Q+=`${this._terminalSelector} .${N} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${N} div { position: absolute; background-color: ${M.selectionBackgroundOpaque.css};}${this._terminalSelector} .${N} div { position: absolute; background-color: ${M.selectionInactiveBackgroundOpaque.css};}`;for(const[F,C]of M.ansi.entries())Q+=`${this._terminalSelector} .${b}${F} { color: ${C.css}; }${this._terminalSelector} .${b}${F}.xterm-dim { color: ${l.color.multiplyOpacity(C,.5).css}; }${this._terminalSelector} .${v}${F} { background-color: ${C.css}; }`;Q+=`${this._terminalSelector} .${b}${S.INVERTED_DEFAULT_COLOR} { color: ${l.color.opaque(M.background).css}; }${this._terminalSelector} .${b}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${l.color.multiplyOpacity(l.color.opaque(M.background),.5).css}; }${this._terminalSelector} .${v}${S.INVERTED_DEFAULT_COLOR} { background-color: ${M.foreground.css}; }`,this._themeStyleElement.textContent=Q}_setDefaultSpacing(){const M=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${M}px`,this._rowFactory.defaultSpacing=M}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(M,Q){for(let te=this._rowElements.length;te<=Q;te++){const ne=this._document.createElement("div");this._rowContainer.appendChild(ne),this._rowElements.push(ne)}for(;this._rowElements.length>Q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(M,Q){this._refreshRowElements(M,Q),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(R),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(R),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(M,Q,te){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(M,Q,te),this.renderRows(0,this._bufferService.rows-1),!M||!Q)return;this._selectionRenderModel.update(this._terminal,M,Q,te);const ne=this._selectionRenderModel.viewportStartRow,le=this._selectionRenderModel.viewportEndRow,F=this._selectionRenderModel.viewportCappedStartRow,C=this._selectionRenderModel.viewportCappedEndRow;if(F>=this._bufferService.rows||C<0)return;const D=this._document.createDocumentFragment();if(te){const k=M[0]>Q[0];D.appendChild(this._createSelectionElement(F,k?Q[0]:M[0],k?M[0]:Q[0],C-F+1))}else{const k=ne===F?M[0]:0,P=F===le?Q[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(F,k,P));const J=C-F-1;if(D.appendChild(this._createSelectionElement(F+1,0,this._bufferService.cols,J)),F!==C){const re=le===C?Q[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(C,0,re))}}this._selectionContainer.appendChild(D)}_createSelectionElement(M,Q,te,ne=1){const le=this._document.createElement("div"),F=Q*this.dimensions.css.cell.width;let C=this.dimensions.css.cell.width*(te-Q);return F+C>this.dimensions.css.canvas.width&&(C=this.dimensions.css.canvas.width-F),le.style.height=ne*this.dimensions.css.cell.height+"px",le.style.top=M*this.dimensions.css.cell.height+"px",le.style.left=`${F}px`,le.style.width=`${C}px`,le}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 M of this._rowElements)M.replaceChildren()}renderRows(M,Q){const te=this._bufferService.buffer,ne=te.ybase+te.y,le=Math.min(te.x,this._bufferService.cols-1),F=this._optionsService.rawOptions.cursorBlink,C=this._optionsService.rawOptions.cursorStyle,D=this._optionsService.rawOptions.cursorInactiveStyle;for(let k=M;k<=Q;k++){const P=k+te.ydisp,J=this._rowElements[k],re=te.lines.get(P);if(!J||!re)break;J.replaceChildren(...this._rowFactory.createRow(re,P,P===ne,C,D,le,F,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${w}${this._terminalClass}`}_handleLinkHover(M){this._setCellUnderline(M.x1,M.x2,M.y1,M.y2,M.cols,!0)}_handleLinkLeave(M){this._setCellUnderline(M.x1,M.x2,M.y1,M.y2,M.cols,!1)}_setCellUnderline(M,Q,te,ne,le,F){te<0&&(M=0),ne<0&&(Q=0);const C=this._bufferService.rows-1;te=Math.max(Math.min(te,C),0),ne=Math.max(Math.min(ne,C),0),le=Math.min(le,this._bufferService.cols);const D=this._bufferService.buffer,k=D.ybase+D.y,P=Math.min(D.x,le-1),J=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let ue=te;ue<=ne;++ue){const U=ue+D.ydisp,L=this._rowElements[ue],ee=D.lines.get(U);if(!L||!ee)break;L.replaceChildren(...this._rowFactory.createRow(ee,U,U===k,re,ce,P,J,this.dimensions.css.cell.width,this._widthCache,F?ue===te?M:0:-1,F?(ue===ne?Q:le)-1:-1))}}};a.DomRenderer=z=p([m(7,f.IInstantiationService),m(8,n.ICharSizeService),m(9,f.IOptionsService),m(10,f.IBufferService),m(11,n.ICoreBrowserService),m(12,n.IThemeService)],z)},3787:function($,a,u){var p=this&&this.__decorate||function(y,b,v,R){var N,j=arguments.length,z=j<3?b:R===null?R=Object.getOwnPropertyDescriptor(b,v):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(y,b,v,R);else for(var M=y.length-1;M>=0;M--)(N=y[M])&&(z=(j<3?N(z):j>3?N(b,v,z):N(b,v))||z);return j>3&&z&&Object.defineProperty(b,v,z),z},m=this&&this.__param||function(y,b){return function(v,R){b(v,R,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const h=u(2223),g=u(643),S=u(511),x=u(2585),_=u(8055),n=u(4725),l=u(4269),s=u(6171),o=u(3734);let f=a.DomRendererRowFactory=class{constructor(y,b,v,R,N,j,z){this._document=y,this._characterJoinerService=b,this._optionsService=v,this._coreBrowserService=R,this._coreService=N,this._decorationService=j,this._themeService=z,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,b,v){this._selectionStart=y,this._selectionEnd=b,this._columnSelectMode=v}createRow(y,b,v,R,N,j,z,M,Q,te,ne){const le=[],F=this._characterJoinerService.getJoinedCharacters(b),C=this._themeService.colors;let D,k=y.getNoBgTrimmedLength();v&&k<j+1&&(k=j+1);let P=0,J="",re=0,ce=0,ue=0,U=!1,L=0,ee=!1,Y=0;const de=[],he=te!==-1&&ne!==-1;for(let xe=0;xe<k;xe++){y.loadCell(xe,this._workCell);let Le=this._workCell.getWidth();if(Le===0)continue;let Te=!1,qe=xe,we=this._workCell;if(F.length>0&&xe===F[0][0]){Te=!0;const Ae=F.shift();we=new l.JoinedCellData(this._workCell,y.translateToString(!0,Ae[0],Ae[1]),Ae[1]-Ae[0]),qe=Ae[1]-1,Le=we.getWidth()}const Kt=this._isCellInSelection(xe,b),gr=v&&xe===j,Nt=he&&xe>=te&&xe<=ne;let At=!1;this._decorationService.forEachDecorationAtCell(xe,b,void 0,(Ae=>{At=!0}));let qt=we.getChars()||g.WHITESPACE_CELL_CHAR;if(qt===" "&&(we.isUnderline()||we.isOverline())&&(qt=" "),Y=Le*M-Q.get(qt,we.isBold(),we.isItalic()),D){if(P&&(Kt&&ee||!Kt&&!ee&&we.bg===re)&&(Kt&&ee&&C.selectionForeground||we.fg===ce)&&we.extended.ext===ue&&Nt===U&&Y===L&&!gr&&!Te&&!At){we.isInvisible()?J+=g.WHITESPACE_CELL_CHAR:J+=qt,P++;continue}P&&(D.textContent=J),D=this._document.createElement("span"),P=0,J=""}else D=this._document.createElement("span");if(re=we.bg,ce=we.fg,ue=we.extended.ext,U=Nt,L=Y,ee=Kt,Te&&j>=xe&&j<=qe&&(j=xe),!this._coreService.isCursorHidden&&gr&&this._coreService.isCursorInitialized){if(de.push("xterm-cursor"),this._coreBrowserService.isFocused)z&&de.push("xterm-cursor-blink"),de.push(R==="bar"?"xterm-cursor-bar":R==="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(we.isBold()&&de.push("xterm-bold"),we.isItalic()&&de.push("xterm-italic"),we.isDim()&&de.push("xterm-dim"),J=we.isInvisible()?g.WHITESPACE_CELL_CHAR:we.getChars()||g.WHITESPACE_CELL_CHAR,we.isUnderline()&&(de.push(`xterm-underline-${we.extended.underlineStyle}`),J===" "&&(J=" "),!we.isUnderlineColorDefault()))if(we.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${o.AttributeData.toColorRGB(we.getUnderlineColor()).join(",")})`;else{let Ae=we.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&we.isBold()&&Ae<8&&(Ae+=8),D.style.textDecorationColor=C.ansi[Ae].css}we.isOverline()&&(de.push("xterm-overline"),J===" "&&(J=" ")),we.isStrikethrough()&&de.push("xterm-strikethrough"),Nt&&(D.style.textDecoration="underline");let et=we.getFgColor(),Gt=we.getFgColorMode(),ht=we.getBgColor(),Xt=we.getBgColorMode();const vr=!!we.isInverse();if(vr){const Ae=et;et=ht,ht=Ae;const zi=Gt;Gt=Xt,Xt=zi}let dt,mr,st,xt=!1;switch(this._decorationService.forEachDecorationAtCell(xe,b,void 0,(Ae=>{Ae.options.layer!=="top"&&xt||(Ae.backgroundColorRGB&&(Xt=50331648,ht=Ae.backgroundColorRGB.rgba>>8&16777215,dt=Ae.backgroundColorRGB),Ae.foregroundColorRGB&&(Gt=50331648,et=Ae.foregroundColorRGB.rgba>>8&16777215,mr=Ae.foregroundColorRGB),xt=Ae.options.layer==="top")})),!xt&&Kt&&(dt=this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque,ht=dt.rgba>>8&16777215,Xt=50331648,xt=!0,C.selectionForeground&&(Gt=50331648,et=C.selectionForeground.rgba>>8&16777215,mr=C.selectionForeground)),xt&&de.push("xterm-decoration-top"),Xt){case 16777216:case 33554432:st=C.ansi[ht],de.push(`xterm-bg-${ht}`);break;case 50331648:st=_.channels.toColor(ht>>16,ht>>8&255,255&ht),this._addStyle(D,`background-color:#${w((ht>>>0).toString(16),"0",6)}`);break;default:vr?(st=C.foreground,de.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):st=C.background}switch(dt||we.isDim()&&(dt=_.color.multiplyOpacity(st,.5)),Gt){case 16777216:case 33554432:we.isBold()&&et<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(et+=8),this._applyMinimumContrast(D,st,C.ansi[et],we,dt,void 0)||de.push(`xterm-fg-${et}`);break;case 50331648:const Ae=_.channels.toColor(et>>16&255,et>>8&255,255&et);this._applyMinimumContrast(D,st,Ae,we,dt,mr)||this._addStyle(D,`color:#${w(et.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,st,C.foreground,we,dt,mr)||vr&&de.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}de.length&&(D.className=de.join(" "),de.length=0),gr||Te||At?D.textContent=J:P++,Y!==this.defaultSpacing&&(D.style.letterSpacing=`${Y}px`),le.push(D),xe=qe}return D&&P&&(D.textContent=J),le}_applyMinimumContrast(y,b,v,R,N,j){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.treatGlyphAsBackgroundColor)(R.getCode()))return!1;const z=this._getContrastCache(R);let M;if(N||j||(M=z.getColor(b.rgba,v.rgba)),M===void 0){const Q=this._optionsService.rawOptions.minimumContrastRatio/(R.isDim()?2:1);M=_.color.ensureContrastRatio(N||b,j||v,Q),z.setColor((N||b).rgba,(j||v).rgba,M??null)}return!!M&&(this._addStyle(y,`color:${M.css}`),!0)}_getContrastCache(y){return y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(y,b){y.setAttribute("style",`${y.getAttribute("style")||""}${b};`)}_isCellInSelection(y,b){const v=this._selectionStart,R=this._selectionEnd;return!(!v||!R)&&(this._columnSelectMode?v[0]<=R[0]?y>=v[0]&&b>=v[1]&&y<R[0]&&b<=R[1]:y<v[0]&&b>=v[1]&&y>=R[0]&&b<=R[1]:b>v[1]&&b<R[1]||v[1]===R[1]&&b===v[1]&&y>=v[0]&&y<R[0]||v[1]<R[1]&&b===R[1]&&y<R[0]||v[1]<R[1]&&b===v[1]&&y>=v[0])}};function w(y,b,v){for(;y.length<v;)y=b+y;return y}a.DomRendererRowFactory=f=p([m(1,n.ICharacterJoinerService),m(2,x.IOptionsService),m(3,n.ICoreBrowserService),m(4,x.ICoreService),m(5,x.IDecorationService),m(6,n.IThemeService)],f)},2550:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(u,p){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const m=u.createElement("span");m.classList.add("xterm-char-measure-element");const h=u.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const g=u.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const S=u.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[m,h,g,S],this._container.appendChild(m),this._container.appendChild(h),this._container.appendChild(g),this._container.appendChild(S),p.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(u,p,m,h){u===this._font&&p===this._fontSize&&m===this._weight&&h===this._weightBold||(this._font=u,this._fontSize=p,this._weight=m,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(u,p,m){let h=0;if(!p&&!m&&u.length===1&&(h=u.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const x=this._measure(u,0);return x>0&&(this._flat[h]=x),x}let g=u;p&&(g+="B"),m&&(g+="I");let S=this._holey.get(g);if(S===void 0){let x=0;p&&(x|=1),m&&(x|=2),S=this._measure(u,x),S>0&&this._holey.set(g,S)}return S}_measure(u,p){const m=this._measureElements[p];return m.textContent=u.repeat(32),m.offsetWidth/32}}},2223:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const p=u(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=p.isFirefox||p.isLegacyEdge?"bottom":"ideographic"},6171:($,a)=>{function u(m){return 57508<=m&&m<=57558}function p(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},a.isPowerlineGlyph=u,a.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},a.isEmoji=p,a.allowRescaling=function(m,h,g,S){return h===1&&g>Math.ceil(1.5*S)&&m!==void 0&&m>255&&!p(m)&&!u(m)&&!(function(x){return 57344<=x&&x<=63743})(m)},a.treatGlyphAsBackgroundColor=function(m){return u(m)||(function(h){return 9472<=h&&h<=9631})(m)},a.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},a.computeNextVariantOffset=function(m,h,g=0){return(m-(2*Math.round(h)-g))%(2*Math.round(h))}},6052:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class u{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(m,h,g,S=!1){if(this.selectionStart=h,this.selectionEnd=g,!h||!g||h[0]===g[0]&&h[1]===g[1])return void this.clear();const x=m.buffers.active.ydisp,_=h[1]-x,n=g[1]-x,l=Math.max(_,0),s=Math.min(n,m.rows-1);l>=m.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=_,this.viewportEndRow=n,this.viewportCappedStartRow=l,this.viewportCappedEndRow=s,this.startCol=h[0],this.endCol=g[0])}isCellSelected(m,h,g){return!!this.hasSelection&&(g-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&g>=this.viewportCappedStartRow&&h<this.endCol&&g<=this.viewportCappedEndRow:h<this.startCol&&g>=this.viewportCappedStartRow&&h>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&h>=this.startCol)}}a.createSelectionRenderModel=function(){return new u}},456:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,p=this.selectionEnd;return!(!u||!p)&&(u[1]>p[1]||u[1]===p[1]&&u[0]>p[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function($,a,u){var p=this&&this.__decorate||function(s,o,f,w){var y,b=arguments.length,v=b<3?o:w===null?w=Object.getOwnPropertyDescriptor(o,f):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(s,o,f,w);else for(var R=s.length-1;R>=0;R--)(y=s[R])&&(v=(b<3?y(v):b>3?y(o,f,v):y(o,f))||v);return b>3&&v&&Object.defineProperty(o,f,v),v},m=this&&this.__param||function(s,o){return function(f,w){o(f,w,s)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const h=u(2585),g=u(8460),S=u(844);let x=a.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(s,o,f){super(),this._optionsService=f,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new l(this._optionsService))}catch{this._measureStrategy=this.register(new n(s,o,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const s=this._measureStrategy.measure();s.width===this.width&&s.height===this.height||(this.width=s.width,this.height=s.height,this._onCharSizeChange.fire())}};a.CharSizeService=x=p([m(2,h.IOptionsService)],x);class _ extends S.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(o,f){o!==void 0&&o>0&&f!==void 0&&f>0&&(this._result.width=o,this._result.height=f)}}class n extends _{constructor(o,f,w){super(),this._document=o,this._parentElement=f,this._optionsService=w,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 l extends _{constructor(o){super(),this._optionsService=o,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const f=this._ctx.measureText("W");if(!("width"in f&&"fontBoundingBoxAscent"in f&&"fontBoundingBoxDescent"in f))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const o=this._ctx.measureText("W");return this._validateAndSet(o.width,o.fontBoundingBoxAscent+o.fontBoundingBoxDescent),this._result}}},4269:function($,a,u){var p=this&&this.__decorate||function(l,s,o,f){var w,y=arguments.length,b=y<3?s:f===null?f=Object.getOwnPropertyDescriptor(s,o):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(l,s,o,f);else for(var v=l.length-1;v>=0;v--)(w=l[v])&&(b=(y<3?w(b):y>3?w(s,o,b):w(s,o))||b);return y>3&&b&&Object.defineProperty(s,o,b),b},m=this&&this.__param||function(l,s){return function(o,f){s(o,f,l)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const h=u(3734),g=u(643),S=u(511),x=u(2585);class _ extends h.AttributeData{constructor(s,o,f){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=o,this._width=f}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(s){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=_;let n=a.CharacterJoinerService=class au{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(s){const o={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(o),o.id}deregister(s){for(let o=0;o<this._characterJoiners.length;o++)if(this._characterJoiners[o].id===s)return this._characterJoiners.splice(o,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const o=this._bufferService.buffer.lines.get(s);if(!o||o.length===0)return[];const f=[],w=o.translateToString(!0);let y=0,b=0,v=0,R=o.getFg(0),N=o.getBg(0);for(let j=0;j<o.getTrimmedLength();j++)if(o.loadCell(j,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==R||this._workCell.bg!==N){if(j-y>1){const z=this._getJoinedRanges(w,v,b,o,y);for(let M=0;M<z.length;M++)f.push(z[M])}y=j,v=b,R=this._workCell.fg,N=this._workCell.bg}b+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-y>1){const j=this._getJoinedRanges(w,v,b,o,y);for(let z=0;z<j.length;z++)f.push(j[z])}return f}_getJoinedRanges(s,o,f,w,y){const b=s.substring(o,f);let v=[];try{v=this._characterJoiners[0].handler(b)}catch(R){console.error(R)}for(let R=1;R<this._characterJoiners.length;R++)try{const N=this._characterJoiners[R].handler(b);for(let j=0;j<N.length;j++)au._mergeRanges(v,N[j])}catch(N){console.error(N)}return this._stringRangesToCellRanges(v,w,y),v}_stringRangesToCellRanges(s,o,f){let w=0,y=!1,b=0,v=s[w];if(v){for(let R=f;R<this._bufferService.cols;R++){const N=o.getWidth(R),j=o.getString(R).length||g.WHITESPACE_CELL_CHAR.length;if(N!==0){if(!y&&v[0]<=b&&(v[0]=R,y=!0),v[1]<=b){if(v[1]=R,v=s[++w],!v)break;v[0]<=b?(v[0]=R,y=!0):y=!1}b+=j}}v&&(v[1]=this._bufferService.cols)}}static _mergeRanges(s,o){let f=!1;for(let w=0;w<s.length;w++){const y=s[w];if(f){if(o[1]<=y[0])return s[w-1][1]=o[1],s;if(o[1]<=y[1])return s[w-1][1]=Math.max(o[1],y[1]),s.splice(w,1),s;s.splice(w,1),w--}else{if(o[1]<=y[0])return s.splice(w,0,o),s;if(o[1]<=y[1])return y[0]=Math.min(o[0],y[0]),s;o[0]<y[1]&&(y[0]=Math.min(o[0],y[0]),f=!0)}}return f?s[s.length-1][1]=o[1]:s.push(o),s}};a.CharacterJoinerService=n=p([m(0,x.IBufferService)],n)},5114:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const p=u(844),m=u(8460),h=u(3656);class g extends p.Disposable{constructor(_,n,l){super(),this._textarea=_,this._window=n,this.mainDocument=l,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new S(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((s=>this._screenDprMonitor.setWindow(s)))),this.register((0,m.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(_){this._window!==_&&(this._window=_,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}a.CoreBrowserService=g;class S extends p.Disposable{constructor(_){super(),this._parentWindow=_,this._windowResizeListener=this.register(new p.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,p.toDisposable)((()=>this.clearListener())))}setWindow(_){this._parentWindow=_,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 _;this._outerListener&&((_=this._resolutionMediaMatchList)==null||_.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const p=u(844);class m extends p.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,p.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const S=this.linkProviders.indexOf(g);S!==-1&&this.linkProviders.splice(S,1)}}}}a.LinkProviderService=m},8934:function($,a,u){var p=this&&this.__decorate||function(x,_,n,l){var s,o=arguments.length,f=o<3?_:l===null?l=Object.getOwnPropertyDescriptor(_,n):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(x,_,n,l);else for(var w=x.length-1;w>=0;w--)(s=x[w])&&(f=(o<3?s(f):o>3?s(_,n,f):s(_,n))||f);return o>3&&f&&Object.defineProperty(_,n,f),f},m=this&&this.__param||function(x,_){return function(n,l){_(n,l,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const h=u(4725),g=u(9806);let S=a.MouseService=class{constructor(x,_){this._renderService=x,this._charSizeService=_}getCoords(x,_,n,l,s){return(0,g.getCoords)(window,x,_,n,l,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(x,_){const n=(0,g.getCoordsRelativeToElement)(window,x,_);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};a.MouseService=S=p([m(0,h.IRenderService),m(1,h.ICharSizeService)],S)},3230:function($,a,u){var p=this&&this.__decorate||function(s,o,f,w){var y,b=arguments.length,v=b<3?o:w===null?w=Object.getOwnPropertyDescriptor(o,f):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(s,o,f,w);else for(var R=s.length-1;R>=0;R--)(y=s[R])&&(v=(b<3?y(v):b>3?y(o,f,v):y(o,f))||v);return b>3&&v&&Object.defineProperty(o,f,v),v},m=this&&this.__param||function(s,o){return function(f,w){o(f,w,s)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const h=u(6193),g=u(4725),S=u(8460),x=u(844),_=u(7226),n=u(2585);let l=a.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(s,o,f,w,y,b,v,R){super(),this._rowCount=s,this._charSizeService=w,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new _.DebouncedIdleTask,this._observerDisposable=this.register(new x.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,j)=>this._renderRows(N,j)),v),this.register(this._renderDebouncer),this.register(v.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(b.onResize((()=>this._fullRefresh()))),this.register(b.buffers.onBufferActivate((()=>{var N;return(N=this._renderer.value)==null?void 0:N.clear()}))),this.register(f.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(y.onDecorationRegistered((()=>this._fullRefresh()))),this.register(y.onDecorationRemoved((()=>this._fullRefresh()))),this.register(f.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(b.cols,b.rows),this._fullRefresh()}))),this.register(f.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(b.buffer.y,b.buffer.y,!0)))),this.register(R.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(v.window,o),this.register(v.onWindowChange((N=>this._registerIntersectionObserver(N,o))))}_registerIntersectionObserver(s,o){if("IntersectionObserver"in s){const f=new s.IntersectionObserver((w=>this._handleIntersectionChange(w[w.length-1])),{threshold:0});f.observe(o),this._observerDisposable.value=(0,x.toDisposable)((()=>f.disconnect()))}}_handleIntersectionChange(s){this._isPaused=s.isIntersecting===void 0?s.intersectionRatio===0:!s.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(s,o,f=!1){this._isPaused?this._needsFullRefresh=!0:(f||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(s,o,this._rowCount))}_renderRows(s,o){this._renderer.value&&(s=Math.min(s,this._rowCount-1),o=Math.min(o,this._rowCount-1),this._renderer.value.renderRows(s,o),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:s,end:o}),this._onRender.fire({start:s,end:o}),this._isNextRenderRedrawOnly=!0)}resize(s,o){this._rowCount=o,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(s){this._renderer.value=s,this._renderer.value&&(this._renderer.value.onRequestRedraw((o=>this.refreshRows(o.start,o.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(s){return this._renderDebouncer.addRefreshCallback(s)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var s,o;this._renderer.value&&((o=(s=this._renderer.value).clearTextureAtlas)==null||o.call(s),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(s,o){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var f;return(f=this._renderer.value)==null?void 0:f.handleResize(s,o)})):this._renderer.value.handleResize(s,o),this._fullRefresh())}handleCharSizeChanged(){var s;(s=this._renderer.value)==null||s.handleCharSizeChanged()}handleBlur(){var s;(s=this._renderer.value)==null||s.handleBlur()}handleFocus(){var s;(s=this._renderer.value)==null||s.handleFocus()}handleSelectionChanged(s,o,f){var w;this._selectionState.start=s,this._selectionState.end=o,this._selectionState.columnSelectMode=f,(w=this._renderer.value)==null||w.handleSelectionChanged(s,o,f)}handleCursorMove(){var s;(s=this._renderer.value)==null||s.handleCursorMove()}clear(){var s;(s=this._renderer.value)==null||s.clear()}};a.RenderService=l=p([m(2,n.IOptionsService),m(3,g.ICharSizeService),m(4,n.IDecorationService),m(5,n.IBufferService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],l)},9312:function($,a,u){var p=this&&this.__decorate||function(v,R,N,j){var z,M=arguments.length,Q=M<3?R:j===null?j=Object.getOwnPropertyDescriptor(R,N):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(v,R,N,j);else for(var te=v.length-1;te>=0;te--)(z=v[te])&&(Q=(M<3?z(Q):M>3?z(R,N,Q):z(R,N))||Q);return M>3&&Q&&Object.defineProperty(R,N,Q),Q},m=this&&this.__param||function(v,R){return function(N,j){R(N,j,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const h=u(9806),g=u(9504),S=u(456),x=u(4725),_=u(8460),n=u(844),l=u(6114),s=u(4841),o=u(511),f=u(2585),w=" ",y=new RegExp(w,"g");let b=a.SelectionService=class extends n.Disposable{constructor(v,R,N,j,z,M,Q,te,ne){super(),this._element=v,this._screenElement=R,this._linkifier=N,this._bufferService=j,this._coreService=z,this._mouseService=M,this._optionsService=Q,this._renderService=te,this._coreBrowserService=ne,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new o.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new _.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new _.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=le=>this._handleMouseMove(le),this._mouseUpListener=le=>this._handleMouseUp(le),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((le=>this._handleTrim(le))),this.register(this._bufferService.buffers.onBufferActivate((le=>this._handleBufferActivate(le)))),this.enable(),this._model=new S.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,n.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const v=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!v||!R||v[0]===R[0]&&v[1]===R[1])}get selectionText(){const v=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;if(!v||!R)return"";const N=this._bufferService.buffer,j=[];if(this._activeSelectionMode===3){if(v[0]===R[0])return"";const z=v[0]<R[0]?v[0]:R[0],M=v[0]<R[0]?R[0]:v[0];for(let Q=v[1];Q<=R[1];Q++){const te=N.translateBufferLineToString(Q,!0,z,M);j.push(te)}}else{const z=v[1]===R[1]?R[0]:void 0;j.push(N.translateBufferLineToString(v[1],!0,v[0],z));for(let M=v[1]+1;M<=R[1]-1;M++){const Q=N.lines.get(M),te=N.translateBufferLineToString(M,!0);Q!=null&&Q.isWrapped?j[j.length-1]+=te:j.push(te)}if(v[1]!==R[1]){const M=N.lines.get(R[1]),Q=N.translateBufferLineToString(R[1],!0,0,R[0]);M&&M.isWrapped?j[j.length-1]+=Q:j.push(Q)}}return j.map((z=>z.replace(y," "))).join(l.isWindows?`\r
45
+ `:`
46
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(v){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),l.isLinux&&v&&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(v){const R=this._getMouseBufferCoords(v),N=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!!(N&&j&&R)&&this._areCoordsInSelection(R,N,j)}isCellInSelection(v,R){const N=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!N||!j)&&this._areCoordsInSelection([v,R],N,j)}_areCoordsInSelection(v,R,N){return v[1]>R[1]&&v[1]<N[1]||R[1]===N[1]&&v[1]===R[1]&&v[0]>=R[0]&&v[0]<N[0]||R[1]<N[1]&&v[1]===N[1]&&v[0]<N[0]||R[1]<N[1]&&v[1]===R[1]&&v[0]>=R[0]}_selectWordAtCursor(v,R){var z,M;const N=(M=(z=this._linkifier.currentLink)==null?void 0:z.link)==null?void 0:M.range;if(N)return this._model.selectionStart=[N.start.x-1,N.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(N,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const j=this._getMouseBufferCoords(v);return!!j&&(this._selectWordAt(j,R),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(v,R){this._model.clearSelection(),v=Math.max(v,0),R=Math.min(R,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,v],this._model.selectionEnd=[this._bufferService.cols,R],this.refresh(),this._onSelectionChange.fire()}_handleTrim(v){this._model.handleTrim(v)&&this.refresh()}_getMouseBufferCoords(v){const R=this._mouseService.getCoords(v,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(R)return R[0]--,R[1]--,R[1]+=this._bufferService.buffer.ydisp,R}_getMouseEventScrollAmount(v){let R=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,v,this._screenElement)[1];const N=this._renderService.dimensions.css.canvas.height;return R>=0&&R<=N?0:(R>N&&(R-=N),R=Math.min(Math.max(R,-50),50),R/=50,R/Math.abs(R)+Math.round(14*R))}shouldForceSelection(v){return l.isMac?v.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:v.shiftKey}handleMouseDown(v){if(this._mouseDownTimeStamp=v.timeStamp,(v.button!==2||!this.hasSelection)&&v.button===0){if(!this._enabled){if(!this.shouldForceSelection(v))return;v.stopPropagation()}v.preventDefault(),this._dragScrollAmount=0,this._enabled&&v.shiftKey?this._handleIncrementalClick(v):v.detail===1?this._handleSingleClick(v):v.detail===2?this._handleDoubleClick(v):v.detail===3&&this._handleTripleClick(v),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(v){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(v))}_handleSingleClick(v){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(v)?3:0,this._model.selectionStart=this._getMouseBufferCoords(v),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const R=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);R&&R.length!==this._model.selectionStart[0]&&R.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(v){this._selectWordAtCursor(v,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(v){const R=this._getMouseBufferCoords(v);R&&(this._activeSelectionMode=2,this._selectLineAt(R[1]))}shouldColumnSelect(v){return v.altKey&&!(l.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(v){if(v.stopImmediatePropagation(),!this._model.selectionStart)return;const R=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(v),!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(v),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 j=N.lines.get(this._model.selectionEnd[1]);j&&j.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}R&&R[0]===this._model.selectionEnd[0]&&R[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 v=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(v.ydisp+this._bufferService.rows,v.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=v.ydisp),this.refresh()}}_handleMouseUp(v){const R=v.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&R<500&&v.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const N=this._mouseService.getCoords(v,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(N&&N[0]!==void 0&&N[1]!==void 0){const j=(0,g.moveToCellSequence)(N[0]-1,N[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(j,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const v=this._model.finalSelectionStart,R=this._model.finalSelectionEnd,N=!(!v||!R||v[0]===R[0]&&v[1]===R[1]);N?v&&R&&(this._oldSelectionStart&&this._oldSelectionEnd&&v[0]===this._oldSelectionStart[0]&&v[1]===this._oldSelectionStart[1]&&R[0]===this._oldSelectionEnd[0]&&R[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(v,R,N)):this._oldHasSelection&&this._fireOnSelectionChange(v,R,N)}_fireOnSelectionChange(v,R,N){this._oldSelectionStart=v,this._oldSelectionEnd=R,this._oldHasSelection=N,this._onSelectionChange.fire()}_handleBufferActivate(v){this.clearSelection(),this._trimListener.dispose(),this._trimListener=v.activeBuffer.lines.onTrim((R=>this._handleTrim(R)))}_convertViewportColToCharacterIndex(v,R){let N=R;for(let j=0;R>=j;j++){const z=v.loadCell(j,this._workCell).getChars().length;this._workCell.getWidth()===0?N--:z>1&&R!==j&&(N+=z-1)}return N}setSelection(v,R,N){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[v,R],this._model.selectionStartLength=N,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(v){this._isClickInSelection(v)||(this._selectWordAtCursor(v,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(v,R,N=!0,j=!0){if(v[0]>=this._bufferService.cols)return;const z=this._bufferService.buffer,M=z.lines.get(v[1]);if(!M)return;const Q=z.translateBufferLineToString(v[1],!1);let te=this._convertViewportColToCharacterIndex(M,v[0]),ne=te;const le=v[0]-te;let F=0,C=0,D=0,k=0;if(Q.charAt(te)===" "){for(;te>0&&Q.charAt(te-1)===" ";)te--;for(;ne<Q.length&&Q.charAt(ne+1)===" ";)ne++}else{let re=v[0],ce=v[0];M.getWidth(re)===0&&(F++,re--),M.getWidth(ce)===2&&(C++,ce++);const ue=M.getString(ce).length;for(ue>1&&(k+=ue-1,ne+=ue-1);re>0&&te>0&&!this._isCharWordSeparator(M.loadCell(re-1,this._workCell));){M.loadCell(re-1,this._workCell);const U=this._workCell.getChars().length;this._workCell.getWidth()===0?(F++,re--):U>1&&(D+=U-1,te-=U-1),te--,re--}for(;ce<M.length&&ne+1<Q.length&&!this._isCharWordSeparator(M.loadCell(ce+1,this._workCell));){M.loadCell(ce+1,this._workCell);const U=this._workCell.getChars().length;this._workCell.getWidth()===2?(C++,ce++):U>1&&(k+=U-1,ne+=U-1),ne++,ce++}}ne++;let P=te+le-F+D,J=Math.min(this._bufferService.cols,ne-te+F+C-D-k);if(R||Q.slice(te,ne).trim()!==""){if(N&&P===0&&M.getCodePoint(0)!==32){const re=z.lines.get(v[1]-1);if(re&&M.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,v[1]-1],!1,!0,!1);if(ce){const ue=this._bufferService.cols-ce.start;P-=ue,J+=ue}}}if(j&&P+J===this._bufferService.cols&&M.getCodePoint(this._bufferService.cols-1)!==32){const re=z.lines.get(v[1]+1);if(re!=null&&re.isWrapped&&re.getCodePoint(0)!==32){const ce=this._getWordAt([0,v[1]+1],!1,!1,!0);ce&&(J+=ce.length)}}return{start:P,length:J}}}_selectWordAt(v,R){const N=this._getWordAt(v,R);if(N){for(;N.start<0;)N.start+=this._bufferService.cols,v[1]--;this._model.selectionStart=[N.start,v[1]],this._model.selectionStartLength=N.length}}_selectToWordAt(v){const R=this._getWordAt(v,!0);if(R){let N=v[1];for(;R.start<0;)R.start+=this._bufferService.cols,N--;if(!this._model.areSelectionValuesReversed())for(;R.start+R.length>this._bufferService.cols;)R.length-=this._bufferService.cols,N++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?R.start:R.start+R.length,N]}}_isCharWordSeparator(v){return v.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(v.getChars())>=0}_selectLineAt(v){const R=this._bufferService.buffer.getWrappedRangeForLine(v),N={start:{x:0,y:R.first},end:{x:this._bufferService.cols-1,y:R.last}};this._model.selectionStart=[0,R.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(N,this._bufferService.cols)}};a.SelectionService=b=p([m(3,f.IBufferService),m(4,f.ICoreService),m(5,x.IMouseService),m(6,f.IOptionsService),m(7,x.IRenderService),m(8,x.ICoreBrowserService)],b)},4725:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const p=u(8343);a.ICharSizeService=(0,p.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,p.createDecorator)("CoreBrowserService"),a.IMouseService=(0,p.createDecorator)("MouseService"),a.IRenderService=(0,p.createDecorator)("RenderService"),a.ISelectionService=(0,p.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,p.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,p.createDecorator)("ThemeService"),a.ILinkProviderService=(0,p.createDecorator)("LinkProviderService")},6731:function($,a,u){var p=this&&this.__decorate||function(b,v,R,N){var j,z=arguments.length,M=z<3?v:N===null?N=Object.getOwnPropertyDescriptor(v,R):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,v,R,N);else for(var Q=b.length-1;Q>=0;Q--)(j=b[Q])&&(M=(z<3?j(M):z>3?j(v,R,M):j(v,R))||M);return z>3&&M&&Object.defineProperty(v,R,M),M},m=this&&this.__param||function(b,v){return function(R,N){v(R,N,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const h=u(7239),g=u(8055),S=u(8460),x=u(844),_=u(2585),n=g.css.toColor("#ffffff"),l=g.css.toColor("#000000"),s=g.css.toColor("#ffffff"),o=g.css.toColor("#000000"),f={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const b=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],v=[0,95,135,175,215,255];for(let R=0;R<216;R++){const N=v[R/36%6|0],j=v[R/6%6|0],z=v[R%6];b.push({css:g.channels.toCss(N,j,z),rgba:g.channels.toRgba(N,j,z)})}for(let R=0;R<24;R++){const N=8+10*R;b.push({css:g.channels.toCss(N,N,N),rgba:g.channels.toRgba(N,N,N)})}return b})());let w=a.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(b){super(),this._optionsService=b,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:n,background:l,cursor:s,cursorAccent:o,selectionForeground:void 0,selectionBackgroundTransparent:f,selectionBackgroundOpaque:g.color.blend(l,f),selectionInactiveBackgroundTransparent:f,selectionInactiveBackgroundOpaque:g.color.blend(l,f),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(b={}){const v=this._colors;if(v.foreground=y(b.foreground,n),v.background=y(b.background,l),v.cursor=y(b.cursor,s),v.cursorAccent=y(b.cursorAccent,o),v.selectionBackgroundTransparent=y(b.selectionBackground,f),v.selectionBackgroundOpaque=g.color.blend(v.background,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundTransparent=y(b.selectionInactiveBackground,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundOpaque=g.color.blend(v.background,v.selectionInactiveBackgroundTransparent),v.selectionForeground=b.selectionForeground?y(b.selectionForeground,g.NULL_COLOR):void 0,v.selectionForeground===g.NULL_COLOR&&(v.selectionForeground=void 0),g.color.isOpaque(v.selectionBackgroundTransparent)&&(v.selectionBackgroundTransparent=g.color.opacity(v.selectionBackgroundTransparent,.3)),g.color.isOpaque(v.selectionInactiveBackgroundTransparent)&&(v.selectionInactiveBackgroundTransparent=g.color.opacity(v.selectionInactiveBackgroundTransparent,.3)),v.ansi=a.DEFAULT_ANSI_COLORS.slice(),v.ansi[0]=y(b.black,a.DEFAULT_ANSI_COLORS[0]),v.ansi[1]=y(b.red,a.DEFAULT_ANSI_COLORS[1]),v.ansi[2]=y(b.green,a.DEFAULT_ANSI_COLORS[2]),v.ansi[3]=y(b.yellow,a.DEFAULT_ANSI_COLORS[3]),v.ansi[4]=y(b.blue,a.DEFAULT_ANSI_COLORS[4]),v.ansi[5]=y(b.magenta,a.DEFAULT_ANSI_COLORS[5]),v.ansi[6]=y(b.cyan,a.DEFAULT_ANSI_COLORS[6]),v.ansi[7]=y(b.white,a.DEFAULT_ANSI_COLORS[7]),v.ansi[8]=y(b.brightBlack,a.DEFAULT_ANSI_COLORS[8]),v.ansi[9]=y(b.brightRed,a.DEFAULT_ANSI_COLORS[9]),v.ansi[10]=y(b.brightGreen,a.DEFAULT_ANSI_COLORS[10]),v.ansi[11]=y(b.brightYellow,a.DEFAULT_ANSI_COLORS[11]),v.ansi[12]=y(b.brightBlue,a.DEFAULT_ANSI_COLORS[12]),v.ansi[13]=y(b.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),v.ansi[14]=y(b.brightCyan,a.DEFAULT_ANSI_COLORS[14]),v.ansi[15]=y(b.brightWhite,a.DEFAULT_ANSI_COLORS[15]),b.extendedAnsi){const R=Math.min(v.ansi.length-16,b.extendedAnsi.length);for(let N=0;N<R;N++)v.ansi[N+16]=y(b.extendedAnsi[N],a.DEFAULT_ANSI_COLORS[N+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(b){this._restoreColor(b),this._onChangeColors.fire(this.colors)}_restoreColor(b){if(b!==void 0)switch(b){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[b]=this._restoreColors.ansi[b]}else for(let v=0;v<this._restoreColors.ansi.length;++v)this._colors.ansi[v]=this._restoreColors.ansi[v]}modifyColors(b){b(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 y(b,v){if(b!==void 0)try{return g.css.toColor(b)}catch{}return v}a.ThemeService=w=p([m(0,_.IOptionsService)],w)},6349:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const p=u(8460),m=u(844);class h extends m.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new p.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new p.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new p.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 x=new Array(S);for(let _=0;_<Math.min(S,this.length);_++)x[_]=this._array[this._getCyclicIndex(_)];this._array=x,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let x=this._length;x<S;x++)this._array[x]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,x){this._array[this._getCyclicIndex(S)]=x}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,x,..._){if(x){for(let n=S;n<this._length-x;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+x)];this._length-=x,this.onDeleteEmitter.fire({index:S,amount:x})}for(let n=this._length-1;n>=S;n--)this._array[this._getCyclicIndex(n+_.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<_.length;n++)this._array[this._getCyclicIndex(S+n)]=_[n];if(_.length&&this.onInsertEmitter.fire({index:S,amount:_.length}),this._length+_.length>this._maxLength){const n=this._length+_.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=_.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,x,_){if(!(x<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let l=x-1;l>=0;l--)this.set(S+l+_,this.get(S+l));const n=S+x+_-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<x;n++)this.set(S+n+_,this.get(S+n))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}a.CircularList=h},1439:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function u(p,m=5){if(typeof p!="object")return p;const h=Array.isArray(p)?[]:{};for(const g in p)h[g]=m<=1?p[g]:p[g]&&u(p[g],m-1);return h}},8055:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let u=0,p=0,m=0,h=0;var g,S,x,_,n;function l(o){const f=o.toString(16);return f.length<2?"0"+f:f}function s(o,f){return o<f?(f+.05)/(o+.05):(o+.05)/(f+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(o){o.toCss=function(f,w,y,b){return b!==void 0?`#${l(f)}${l(w)}${l(y)}${l(b)}`:`#${l(f)}${l(w)}${l(y)}`},o.toRgba=function(f,w,y,b=255){return(f<<24|w<<16|y<<8|b)>>>0},o.toColor=function(f,w,y,b){return{css:o.toCss(f,w,y,b),rgba:o.toRgba(f,w,y,b)}}})(g||(a.channels=g={})),(function(o){function f(w,y){return h=Math.round(255*y),[u,p,m]=n.toChannels(w.rgba),{css:g.toCss(u,p,m,h),rgba:g.toRgba(u,p,m,h)}}o.blend=function(w,y){if(h=(255&y.rgba)/255,h===1)return{css:y.css,rgba:y.rgba};const b=y.rgba>>24&255,v=y.rgba>>16&255,R=y.rgba>>8&255,N=w.rgba>>24&255,j=w.rgba>>16&255,z=w.rgba>>8&255;return u=N+Math.round((b-N)*h),p=j+Math.round((v-j)*h),m=z+Math.round((R-z)*h),{css:g.toCss(u,p,m),rgba:g.toRgba(u,p,m)}},o.isOpaque=function(w){return(255&w.rgba)==255},o.ensureContrastRatio=function(w,y,b){const v=n.ensureContrastRatio(w.rgba,y.rgba,b);if(v)return g.toColor(v>>24&255,v>>16&255,v>>8&255)},o.opaque=function(w){const y=(255|w.rgba)>>>0;return[u,p,m]=n.toChannels(y),{css:g.toCss(u,p,m),rgba:y}},o.opacity=f,o.multiplyOpacity=function(w,y){return h=255&w.rgba,f(w,h*y/255)},o.toColorRGB=function(w){return[w.rgba>>24&255,w.rgba>>16&255,w.rgba>>8&255]}})(S||(a.color=S={})),(function(o){let f,w;try{const y=document.createElement("canvas");y.width=1,y.height=1;const b=y.getContext("2d",{willReadFrequently:!0});b&&(f=b,f.globalCompositeOperation="copy",w=f.createLinearGradient(0,0,1,1))}catch{}o.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return u=parseInt(y.slice(1,2).repeat(2),16),p=parseInt(y.slice(2,3).repeat(2),16),m=parseInt(y.slice(3,4).repeat(2),16),g.toColor(u,p,m);case 5:return u=parseInt(y.slice(1,2).repeat(2),16),p=parseInt(y.slice(2,3).repeat(2),16),m=parseInt(y.slice(3,4).repeat(2),16),h=parseInt(y.slice(4,5).repeat(2),16),g.toColor(u,p,m,h);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const b=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(b)return u=parseInt(b[1]),p=parseInt(b[2]),m=parseInt(b[3]),h=Math.round(255*(b[5]===void 0?1:parseFloat(b[5]))),g.toColor(u,p,m,h);if(!f||!w)throw new Error("css.toColor: Unsupported css format");if(f.fillStyle=w,f.fillStyle=y,typeof f.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(f.fillRect(0,0,1,1),[u,p,m,h]=f.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(u,p,m,h),css:y}}})(x||(a.css=x={})),(function(o){function f(w,y,b){const v=w/255,R=y/255,N=b/255;return .2126*(v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))}o.relativeLuminance=function(w){return f(w>>16&255,w>>8&255,255&w)},o.relativeLuminance2=f})(_||(a.rgb=_={})),(function(o){function f(y,b,v){const R=y>>24&255,N=y>>16&255,j=y>>8&255;let z=b>>24&255,M=b>>16&255,Q=b>>8&255,te=s(_.relativeLuminance2(z,M,Q),_.relativeLuminance2(R,N,j));for(;te<v&&(z>0||M>0||Q>0);)z-=Math.max(0,Math.ceil(.1*z)),M-=Math.max(0,Math.ceil(.1*M)),Q-=Math.max(0,Math.ceil(.1*Q)),te=s(_.relativeLuminance2(z,M,Q),_.relativeLuminance2(R,N,j));return(z<<24|M<<16|Q<<8|255)>>>0}function w(y,b,v){const R=y>>24&255,N=y>>16&255,j=y>>8&255;let z=b>>24&255,M=b>>16&255,Q=b>>8&255,te=s(_.relativeLuminance2(z,M,Q),_.relativeLuminance2(R,N,j));for(;te<v&&(z<255||M<255||Q<255);)z=Math.min(255,z+Math.ceil(.1*(255-z))),M=Math.min(255,M+Math.ceil(.1*(255-M))),Q=Math.min(255,Q+Math.ceil(.1*(255-Q))),te=s(_.relativeLuminance2(z,M,Q),_.relativeLuminance2(R,N,j));return(z<<24|M<<16|Q<<8|255)>>>0}o.blend=function(y,b){if(h=(255&b)/255,h===1)return b;const v=b>>24&255,R=b>>16&255,N=b>>8&255,j=y>>24&255,z=y>>16&255,M=y>>8&255;return u=j+Math.round((v-j)*h),p=z+Math.round((R-z)*h),m=M+Math.round((N-M)*h),g.toRgba(u,p,m)},o.ensureContrastRatio=function(y,b,v){const R=_.relativeLuminance(y>>8),N=_.relativeLuminance(b>>8);if(s(R,N)<v){if(N<R){const M=f(y,b,v),Q=s(R,_.relativeLuminance(M>>8));if(Q<v){const te=w(y,b,v);return Q>s(R,_.relativeLuminance(te>>8))?M:te}return M}const j=w(y,b,v),z=s(R,_.relativeLuminance(j>>8));if(z<v){const M=f(y,b,v);return z>s(R,_.relativeLuminance(M>>8))?j:M}return j}},o.reduceLuminance=f,o.increaseLuminance=w,o.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}})(n||(a.rgba=n={})),a.toPaddedHex=l,a.contrastRatio=s},8969:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const p=u(844),m=u(2585),h=u(4348),g=u(7866),S=u(744),x=u(7302),_=u(6975),n=u(8460),l=u(1753),s=u(1480),o=u(7994),f=u(9282),w=u(5435),y=u(5981),b=u(2660);let v=!1;class R extends p.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event((j=>{var z;(z=this._onScrollApi)==null||z.fire(j.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(j){for(const z in j)this.optionsService.options[z]=j[z]}constructor(j){super(),this._windowsWrappingHeuristics=this.register(new p.MutableDisposable),this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new n.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new n.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new x.OptionsService(j)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(_.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(l.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(o.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(b.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new w.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,n.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,n.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,n.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,n.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((z=>{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((z=>{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 y.WriteBuffer(((z,M)=>this._inputHandler.parse(z,M)))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(j,z){this._writeBuffer.write(j,z)}writeSync(j,z){this._logService.logLevel<=m.LogLevelEnum.WARN&&!v&&(this._logService.warn("writeSync is unreliable and will be removed soon."),v=!0),this._writeBuffer.writeSync(j,z)}input(j,z=!0){this.coreService.triggerDataEvent(j,z)}resize(j,z){isNaN(j)||isNaN(z)||(j=Math.max(j,S.MINIMUM_COLS),z=Math.max(z,S.MINIMUM_ROWS),this._bufferService.resize(j,z))}scroll(j,z=!1){this._bufferService.scroll(j,z)}scrollLines(j,z,M){this._bufferService.scrollLines(j,z,M)}scrollPages(j){this.scrollLines(j*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(j){const z=j-this._bufferService.buffer.ydisp;z!==0&&this.scrollLines(z)}registerEscHandler(j,z){return this._inputHandler.registerEscHandler(j,z)}registerDcsHandler(j,z){return this._inputHandler.registerDcsHandler(j,z)}registerCsiHandler(j,z){return this._inputHandler.registerCsiHandler(j,z)}registerOscHandler(j,z){return this._inputHandler.registerOscHandler(j,z)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let j=!1;const z=this.optionsService.rawOptions.windowsPty;z&&z.buildNumber!==void 0&&z.buildNumber!==void 0?j=z.backend==="conpty"&&z.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(j=!0),j?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const j=[];j.push(this.onLineFeed(f.updateWindowsModeWrappedState.bind(null,this._bufferService))),j.push(this.registerCsiHandler({final:"H"},(()=>((0,f.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,p.toDisposable)((()=>{for(const z of j)z.dispose()}))}}}a.CoreTerminal=R},8460:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let p=0;p<this._listeners.length;p++)if(this._listeners[p]===u)return void this._listeners.splice(p,1)}}})),this._event}fire(u,p){const m=[];for(let h=0;h<this._listeners.length;h++)m.push(this._listeners[h]);for(let h=0;h<m.length;h++)m[h].call(void 0,u,p)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(u,p){return u((m=>p.fire(m)))},a.runAndSubscribe=function(u,p){return p(void 0),u((m=>p(m)))}},5435:function($,a,u){var p=this&&this.__decorate||function(F,C,D,k){var P,J=arguments.length,re=J<3?C:k===null?k=Object.getOwnPropertyDescriptor(C,D):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(F,C,D,k);else for(var ce=F.length-1;ce>=0;ce--)(P=F[ce])&&(re=(J<3?P(re):J>3?P(C,D,re):P(C,D))||re);return J>3&&re&&Object.defineProperty(C,D,re),re},m=this&&this.__param||function(F,C){return function(D,k){C(D,k,F)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const h=u(2584),g=u(7116),S=u(2015),x=u(844),_=u(482),n=u(8437),l=u(8460),s=u(643),o=u(511),f=u(3734),w=u(2585),y=u(1480),b=u(6242),v=u(6351),R=u(5941),N={"(":0,")":1,"*":2,"+":3,"-":1,".":2},j=131072;function z(F,C){if(F>24)return C.setWinLines||!1;switch(F){case 1:return!!C.restoreWin;case 2:return!!C.minimizeWin;case 3:return!!C.setWinPosition;case 4:return!!C.setWinSizePixels;case 5:return!!C.raiseWin;case 6:return!!C.lowerWin;case 7:return!!C.refreshWin;case 8:return!!C.setWinSizeChars;case 9:return!!C.maximizeWin;case 10:return!!C.fullscreenWin;case 11:return!!C.getWinState;case 13:return!!C.getWinPosition;case 14:return!!C.getWinSizePixels;case 15:return!!C.getScreenSizePixels;case 16:return!!C.getCellSizePixels;case 18:return!!C.getWinSizeChars;case 19:return!!C.getScreenSizeChars;case 20:return!!C.getIconTitle;case 21:return!!C.getWinTitle;case 22:return!!C.pushTitle;case 23:return!!C.popTitle;case 24:return!!C.setWinLines}return!1}var M;(function(F){F[F.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",F[F.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(M||(a.WindowsOptionsReportType=M={}));let Q=0;class te extends x.Disposable{getAttrData(){return this._curAttrData}constructor(C,D,k,P,J,re,ce,ue,U=new S.EscapeSequenceParser){super(),this._bufferService=C,this._charsetService=D,this._coreService=k,this._logService=P,this._optionsService=J,this._oscLinkService=re,this._coreMouseService=ce,this._unicodeService=ue,this._parser=U,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.Utf8ToUtf32,this._workCell=new o.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new l.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new l.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new l.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new l.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new l.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new l.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new l.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new l.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new l.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new l.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new l.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 ne(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._parser.setCsiHandlerFallback(((L,ee)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(L),params:ee.toArray()})})),this._parser.setEscHandlerFallback((L=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(L)})})),this._parser.setExecuteHandlerFallback((L=>{this._logService.debug("Unknown EXECUTE code: ",{code:L})})),this._parser.setOscHandlerFallback(((L,ee,Y)=>{this._logService.debug("Unknown OSC code: ",{identifier:L,action:ee,data:Y})})),this._parser.setDcsHandlerFallback(((L,ee,Y)=>{ee==="HOOK"&&(Y=Y.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(L),action:ee,payload:Y})})),this._parser.setPrintHandler(((L,ee,Y)=>this.print(L,ee,Y))),this._parser.registerCsiHandler({final:"@"},(L=>this.insertChars(L))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(L=>this.scrollLeft(L))),this._parser.registerCsiHandler({final:"A"},(L=>this.cursorUp(L))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(L=>this.scrollRight(L))),this._parser.registerCsiHandler({final:"B"},(L=>this.cursorDown(L))),this._parser.registerCsiHandler({final:"C"},(L=>this.cursorForward(L))),this._parser.registerCsiHandler({final:"D"},(L=>this.cursorBackward(L))),this._parser.registerCsiHandler({final:"E"},(L=>this.cursorNextLine(L))),this._parser.registerCsiHandler({final:"F"},(L=>this.cursorPrecedingLine(L))),this._parser.registerCsiHandler({final:"G"},(L=>this.cursorCharAbsolute(L))),this._parser.registerCsiHandler({final:"H"},(L=>this.cursorPosition(L))),this._parser.registerCsiHandler({final:"I"},(L=>this.cursorForwardTab(L))),this._parser.registerCsiHandler({final:"J"},(L=>this.eraseInDisplay(L,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(L=>this.eraseInDisplay(L,!0))),this._parser.registerCsiHandler({final:"K"},(L=>this.eraseInLine(L,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(L=>this.eraseInLine(L,!0))),this._parser.registerCsiHandler({final:"L"},(L=>this.insertLines(L))),this._parser.registerCsiHandler({final:"M"},(L=>this.deleteLines(L))),this._parser.registerCsiHandler({final:"P"},(L=>this.deleteChars(L))),this._parser.registerCsiHandler({final:"S"},(L=>this.scrollUp(L))),this._parser.registerCsiHandler({final:"T"},(L=>this.scrollDown(L))),this._parser.registerCsiHandler({final:"X"},(L=>this.eraseChars(L))),this._parser.registerCsiHandler({final:"Z"},(L=>this.cursorBackwardTab(L))),this._parser.registerCsiHandler({final:"`"},(L=>this.charPosAbsolute(L))),this._parser.registerCsiHandler({final:"a"},(L=>this.hPositionRelative(L))),this._parser.registerCsiHandler({final:"b"},(L=>this.repeatPrecedingCharacter(L))),this._parser.registerCsiHandler({final:"c"},(L=>this.sendDeviceAttributesPrimary(L))),this._parser.registerCsiHandler({prefix:">",final:"c"},(L=>this.sendDeviceAttributesSecondary(L))),this._parser.registerCsiHandler({final:"d"},(L=>this.linePosAbsolute(L))),this._parser.registerCsiHandler({final:"e"},(L=>this.vPositionRelative(L))),this._parser.registerCsiHandler({final:"f"},(L=>this.hVPosition(L))),this._parser.registerCsiHandler({final:"g"},(L=>this.tabClear(L))),this._parser.registerCsiHandler({final:"h"},(L=>this.setMode(L))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(L=>this.setModePrivate(L))),this._parser.registerCsiHandler({final:"l"},(L=>this.resetMode(L))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(L=>this.resetModePrivate(L))),this._parser.registerCsiHandler({final:"m"},(L=>this.charAttributes(L))),this._parser.registerCsiHandler({final:"n"},(L=>this.deviceStatus(L))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(L=>this.deviceStatusPrivate(L))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(L=>this.softReset(L))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(L=>this.setCursorStyle(L))),this._parser.registerCsiHandler({final:"r"},(L=>this.setScrollRegion(L))),this._parser.registerCsiHandler({final:"s"},(L=>this.saveCursor(L))),this._parser.registerCsiHandler({final:"t"},(L=>this.windowOptions(L))),this._parser.registerCsiHandler({final:"u"},(L=>this.restoreCursor(L))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(L=>this.insertColumns(L))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(L=>this.deleteColumns(L))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(L=>this.selectProtected(L))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(L=>this.requestMode(L,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(L=>this.requestMode(L,!1))),this._parser.setExecuteHandler(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 b.OscHandler((L=>(this.setTitle(L),this.setIconName(L),!0)))),this._parser.registerOscHandler(1,new b.OscHandler((L=>this.setIconName(L)))),this._parser.registerOscHandler(2,new b.OscHandler((L=>this.setTitle(L)))),this._parser.registerOscHandler(4,new b.OscHandler((L=>this.setOrReportIndexedColor(L)))),this._parser.registerOscHandler(8,new b.OscHandler((L=>this.setHyperlink(L)))),this._parser.registerOscHandler(10,new b.OscHandler((L=>this.setOrReportFgColor(L)))),this._parser.registerOscHandler(11,new b.OscHandler((L=>this.setOrReportBgColor(L)))),this._parser.registerOscHandler(12,new b.OscHandler((L=>this.setOrReportCursorColor(L)))),this._parser.registerOscHandler(104,new b.OscHandler((L=>this.restoreIndexedColor(L)))),this._parser.registerOscHandler(110,new b.OscHandler((L=>this.restoreFgColor(L)))),this._parser.registerOscHandler(111,new b.OscHandler((L=>this.restoreBgColor(L)))),this._parser.registerOscHandler(112,new b.OscHandler((L=>this.restoreCursorColor(L)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const L in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:L},(()=>this.selectCharset("("+L))),this._parser.registerEscHandler({intermediates:")",final:L},(()=>this.selectCharset(")"+L))),this._parser.registerEscHandler({intermediates:"*",final:L},(()=>this.selectCharset("*"+L))),this._parser.registerEscHandler({intermediates:"+",final:L},(()=>this.selectCharset("+"+L))),this._parser.registerEscHandler({intermediates:"-",final:L},(()=>this.selectCharset("-"+L))),this._parser.registerEscHandler({intermediates:".",final:L},(()=>this.selectCharset("."+L))),this._parser.registerEscHandler({intermediates:"/",final:L},(()=>this.selectCharset("/"+L)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((L=>(this._logService.error("Parsing error: ",L),L))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new v.DcsHandler(((L,ee)=>this.requestStatusString(L,ee))))}_preserveStack(C,D,k,P){this._parseStack.paused=!0,this._parseStack.cursorStartX=C,this._parseStack.cursorStartY=D,this._parseStack.decodedLength=k,this._parseStack.position=P}_logSlowResolvingAsync(C){this._logService.logLevel<=w.LogLevelEnum.WARN&&Promise.race([C,new Promise(((D,k)=>setTimeout((()=>k("#SLOW_TIMEOUT")),5e3)))]).catch((D=>{if(D!=="#SLOW_TIMEOUT")throw D;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(C,D){let k,P=this._activeBuffer.x,J=this._activeBuffer.y,re=0;const ce=this._parseStack.paused;if(ce){if(k=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,D))return this._logSlowResolvingAsync(k),k;P=this._parseStack.cursorStartX,J=this._parseStack.cursorStartY,this._parseStack.paused=!1,C.length>j&&(re=this._parseStack.position+j)}if(this._logService.logLevel<=w.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof C=="string"?` "${C}"`:` "${Array.prototype.map.call(C,(L=>String.fromCharCode(L))).join("")}"`),typeof C=="string"?C.split("").map((L=>L.charCodeAt(0))):C),this._parseBuffer.length<C.length&&this._parseBuffer.length<j&&(this._parseBuffer=new Uint32Array(Math.min(C.length,j))),ce||this._dirtyRowTracker.clearRange(),C.length>j)for(let L=re;L<C.length;L+=j){const ee=L+j<C.length?L+j:C.length,Y=typeof C=="string"?this._stringDecoder.decode(C.substring(L,ee),this._parseBuffer):this._utf8Decoder.decode(C.subarray(L,ee),this._parseBuffer);if(k=this._parser.parse(this._parseBuffer,Y))return this._preserveStack(P,J,Y,L),this._logSlowResolvingAsync(k),k}else if(!ce){const L=typeof C=="string"?this._stringDecoder.decode(C,this._parseBuffer):this._utf8Decoder.decode(C,this._parseBuffer);if(k=this._parser.parse(this._parseBuffer,L))return this._preserveStack(P,J,L,0),this._logSlowResolvingAsync(k),k}this._activeBuffer.x===P&&this._activeBuffer.y===J||this._onCursorMove.fire();const ue=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),U=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);U<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(U,this._bufferService.rows-1),Math.min(ue,this._bufferService.rows-1))}print(C,D,k){let P,J;const re=this._charsetService.charset,ce=this._optionsService.rawOptions.screenReaderMode,ue=this._bufferService.cols,U=this._coreService.decPrivateModes.wraparound,L=this._coreService.modes.insertMode,ee=this._curAttrData;let Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&k-D>0&&Y.getWidth(this._activeBuffer.x-1)===2&&Y.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ee);let de=this._parser.precedingJoinState;for(let he=D;he<k;++he){if(P=C[he],P<127&&re){const qe=re[String.fromCharCode(P)];qe&&(P=qe.charCodeAt(0))}const xe=this._unicodeService.charProperties(P,de);J=y.UnicodeService.extractWidth(xe);const Le=y.UnicodeService.extractShouldJoin(xe),Te=Le?y.UnicodeService.extractWidth(de):0;if(de=xe,ce&&this._onA11yChar.fire((0,_.stringFromCodePoint)(P)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+J-Te>ue){if(U){const qe=Y;let we=this._activeBuffer.x-Te;for(this._activeBuffer.x=Te,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Te>0&&Y instanceof n.BufferLine&&Y.copyCellsFrom(qe,we,0,Te,!1);we<ue;)qe.setCellFromCodepoint(we++,0,1,ee)}else if(this._activeBuffer.x=ue-1,J===2)continue}if(Le&&this._activeBuffer.x){const qe=Y.getWidth(this._activeBuffer.x-1)?1:2;Y.addCodepointToCell(this._activeBuffer.x-qe,P,J);for(let we=J-Te;--we>=0;)Y.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}else if(L&&(Y.insertCells(this._activeBuffer.x,J-Te,this._activeBuffer.getNullCell(ee)),Y.getWidth(ue-1)===2&&Y.setCellFromCodepoint(ue-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,ee)),Y.setCellFromCodepoint(this._activeBuffer.x++,P,J,ee),J>0)for(;--J;)Y.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}this._parser.precedingJoinState=de,this._activeBuffer.x<ue&&k-D>0&&Y.getWidth(this._activeBuffer.x)===0&&!Y.hasContent(this._activeBuffer.x)&&Y.setCellFromCodepoint(this._activeBuffer.x,0,1,ee),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(C,D){return C.final!=="t"||C.prefix||C.intermediates?this._parser.registerCsiHandler(C,D):this._parser.registerCsiHandler(C,(k=>!z(k.params[0],this._optionsService.rawOptions.windowOptions)||D(k)))}registerDcsHandler(C,D){return this._parser.registerDcsHandler(C,new v.DcsHandler(D))}registerEscHandler(C,D){return this._parser.registerEscHandler(C,D)}registerOscHandler(C,D){return this._parser.registerOscHandler(C,new b.OscHandler(D))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var C;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&&((C=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&C.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);D.hasWidth(this._activeBuffer.x)&&!D.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const C=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-C),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(C=this._bufferService.cols-1){this._activeBuffer.x=Math.min(C,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(C,D){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=C,this._activeBuffer.y=this._activeBuffer.scrollTop+D):(this._activeBuffer.x=C,this._activeBuffer.y=D),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(C,D){this._restrictCursor(),this._setCursor(this._activeBuffer.x+C,this._activeBuffer.y+D)}cursorUp(C){const D=this._activeBuffer.y-this._activeBuffer.scrollTop;return D>=0?this._moveCursor(0,-Math.min(D,C.params[0]||1)):this._moveCursor(0,-(C.params[0]||1)),!0}cursorDown(C){const D=this._activeBuffer.scrollBottom-this._activeBuffer.y;return D>=0?this._moveCursor(0,Math.min(D,C.params[0]||1)):this._moveCursor(0,C.params[0]||1),!0}cursorForward(C){return this._moveCursor(C.params[0]||1,0),!0}cursorBackward(C){return this._moveCursor(-(C.params[0]||1),0),!0}cursorNextLine(C){return this.cursorDown(C),this._activeBuffer.x=0,!0}cursorPrecedingLine(C){return this.cursorUp(C),this._activeBuffer.x=0,!0}cursorCharAbsolute(C){return this._setCursor((C.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(C){return this._setCursor(C.length>=2?(C.params[1]||1)-1:0,(C.params[0]||1)-1),!0}charPosAbsolute(C){return this._setCursor((C.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(C){return this._moveCursor(C.params[0]||1,0),!0}linePosAbsolute(C){return this._setCursor(this._activeBuffer.x,(C.params[0]||1)-1),!0}vPositionRelative(C){return this._moveCursor(0,C.params[0]||1),!0}hVPosition(C){return this.cursorPosition(C),!0}tabClear(C){const D=C.params[0];return D===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:D===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(C){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=C.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(C){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=C.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(C){const D=C.params[0];return D===1&&(this._curAttrData.bg|=536870912),D!==2&&D!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(C,D,k,P=!1,J=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+C);re.replaceCells(D,k,this._activeBuffer.getNullCell(this._eraseAttrData()),J),P&&(re.isWrapped=!1)}_resetBufferLine(C,D=!1){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+C);k&&(k.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),D),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+C),k.isWrapped=!1)}eraseInDisplay(C,D=!1){let k;switch(this._restrictCursor(this._bufferService.cols),C.params[0]){case 0:for(k=this._activeBuffer.y,this._dirtyRowTracker.markDirty(k),this._eraseInBufferLine(k++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);k<this._bufferService.rows;k++)this._resetBufferLine(k,D);this._dirtyRowTracker.markDirty(k);break;case 1:for(k=this._activeBuffer.y,this._dirtyRowTracker.markDirty(k),this._eraseInBufferLine(k,0,this._activeBuffer.x+1,!0,D),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(k+1).isWrapped=!1);k--;)this._resetBufferLine(k,D);this._dirtyRowTracker.markDirty(0);break;case 2:for(k=this._bufferService.rows,this._dirtyRowTracker.markDirty(k-1);k--;)this._resetBufferLine(k,D);this._dirtyRowTracker.markDirty(0);break;case 3:const P=this._activeBuffer.lines.length-this._bufferService.rows;P>0&&(this._activeBuffer.lines.trimStart(P),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-P,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-P,0),this._onScroll.fire(0))}return!0}eraseInLine(C,D=!1){switch(this._restrictCursor(this._bufferService.cols),C.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,D);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,D)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(C){this._restrictCursor();let D=C.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const k=this._activeBuffer.ybase+this._activeBuffer.y,P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,J=this._bufferService.rows-1+this._activeBuffer.ybase-P+1;for(;D--;)this._activeBuffer.lines.splice(J-1,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}deleteLines(C){this._restrictCursor();let D=C.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const k=this._activeBuffer.ybase+this._activeBuffer.y;let P;for(P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-P;D--;)this._activeBuffer.lines.splice(k,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(C){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.insertCells(this._activeBuffer.x,C.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(C){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.deleteCells(this._activeBuffer.x,C.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(C){let D=C.params[0]||1;for(;D--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(C){let D=C.params[0]||1;for(;D--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=C.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);P.deleteCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=C.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);P.insertCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=C.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);P.insertCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=C.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);P.deleteCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(C){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(C.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(C){const D=this._parser.precedingJoinState;if(!D)return!0;const k=C.params[0]||1,P=y.UnicodeService.extractWidth(D),J=this._activeBuffer.x-P,re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(J),ce=new Uint32Array(re.length*k);let ue=0;for(let L=0;L<re.length;){const ee=re.codePointAt(L)||0;ce[ue++]=ee,L+=ee>65535?2:1}let U=ue;for(let L=1;L<k;++L)ce.copyWithin(U,0,ue),U+=ue;return this.print(ce,0,U),!0}sendDeviceAttributesPrimary(C){return C.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(C){return C.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(C.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(C){return(this._optionsService.rawOptions.termName+"").indexOf(C)===0}setMode(C){for(let D=0;D<C.length;D++)switch(C.params[D]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(C){for(let D=0;D<C.length;D++)switch(C.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),this._charsetService.setgCharset(1,g.DEFAULT_CHARSET),this._charsetService.setgCharset(2,g.DEFAULT_CHARSET),this._charsetService.setgCharset(3,g.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(C){for(let D=0;D<C.length;D++)switch(C.params[D]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(C){for(let D=0;D<C.length;D++)switch(C.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),C.params[D]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(C,D){const k=this._coreService.decPrivateModes,{activeProtocol:P,activeEncoding:J}=this._coreMouseService,re=this._coreService,{buffers:ce,cols:ue}=this._bufferService,{active:U,alt:L}=ce,ee=this._optionsService.rawOptions,Y=Le=>Le?1:2,de=C.params[0];return he=de,xe=D?de===2?4:de===4?Y(re.modes.insertMode):de===12?3:de===20?Y(ee.convertEol):0:de===1?Y(k.applicationCursorKeys):de===3?ee.windowOptions.setWinLines?ue===80?2:ue===132?1:0:0:de===6?Y(k.origin):de===7?Y(k.wraparound):de===8?3:de===9?Y(P==="X10"):de===12?Y(ee.cursorBlink):de===25?Y(!re.isCursorHidden):de===45?Y(k.reverseWraparound):de===66?Y(k.applicationKeypad):de===67?4:de===1e3?Y(P==="VT200"):de===1002?Y(P==="DRAG"):de===1003?Y(P==="ANY"):de===1004?Y(k.sendFocus):de===1005?4:de===1006?Y(J==="SGR"):de===1015?4:de===1016?Y(J==="SGR_PIXELS"):de===1048?1:de===47||de===1047||de===1049?Y(U===L):de===2004?Y(k.bracketedPasteMode):0,re.triggerDataEvent(`${h.C0.ESC}[${D?"":"?"}${he};${xe}$y`),!0;var he,xe}_updateAttrColor(C,D,k,P,J){return D===2?(C|=50331648,C&=-16777216,C|=f.AttributeData.fromColorRGB([k,P,J])):D===5&&(C&=-50331904,C|=33554432|255&k),C}_extractColor(C,D,k){const P=[0,0,-1,0,0,0];let J=0,re=0;do{if(P[re+J]=C.params[D+re],C.hasSubParams(D+re)){const ce=C.getSubParams(D+re);let ue=0;do P[1]===5&&(J=1),P[re+ue+1+J]=ce[ue];while(++ue<ce.length&&ue+re+1+J<P.length);break}if(P[1]===5&&re+J>=2||P[1]===2&&re+J>=5)break;P[1]&&(J=1)}while(++re+D<C.length&&re+J<P.length);for(let ce=2;ce<P.length;++ce)P[ce]===-1&&(P[ce]=0);switch(P[0]){case 38:k.fg=this._updateAttrColor(k.fg,P[1],P[3],P[4],P[5]);break;case 48:k.bg=this._updateAttrColor(k.bg,P[1],P[3],P[4],P[5]);break;case 58:k.extended=k.extended.clone(),k.extended.underlineColor=this._updateAttrColor(k.extended.underlineColor,P[1],P[3],P[4],P[5])}return re}_processUnderline(C,D){D.extended=D.extended.clone(),(!~C||C>5)&&(C=1),D.extended.underlineStyle=C,D.fg|=268435456,C===0&&(D.fg&=-268435457),D.updateExtended()}_processSGR0(C){C.fg=n.DEFAULT_ATTR_DATA.fg,C.bg=n.DEFAULT_ATTR_DATA.bg,C.extended=C.extended.clone(),C.extended.underlineStyle=0,C.extended.underlineColor&=-67108864,C.updateExtended()}charAttributes(C){if(C.length===1&&C.params[0]===0)return this._processSGR0(this._curAttrData),!0;const D=C.length;let k;const P=this._curAttrData;for(let J=0;J<D;J++)k=C.params[J],k>=30&&k<=37?(P.fg&=-50331904,P.fg|=16777216|k-30):k>=40&&k<=47?(P.bg&=-50331904,P.bg|=16777216|k-40):k>=90&&k<=97?(P.fg&=-50331904,P.fg|=16777224|k-90):k>=100&&k<=107?(P.bg&=-50331904,P.bg|=16777224|k-100):k===0?this._processSGR0(P):k===1?P.fg|=134217728:k===3?P.bg|=67108864:k===4?(P.fg|=268435456,this._processUnderline(C.hasSubParams(J)?C.getSubParams(J)[0]:1,P)):k===5?P.fg|=536870912:k===7?P.fg|=67108864:k===8?P.fg|=1073741824:k===9?P.fg|=2147483648:k===2?P.bg|=134217728:k===21?this._processUnderline(2,P):k===22?(P.fg&=-134217729,P.bg&=-134217729):k===23?P.bg&=-67108865:k===24?(P.fg&=-268435457,this._processUnderline(0,P)):k===25?P.fg&=-536870913:k===27?P.fg&=-67108865:k===28?P.fg&=-1073741825:k===29?P.fg&=2147483647:k===39?(P.fg&=-67108864,P.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):k===49?(P.bg&=-67108864,P.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):k===38||k===48||k===58?J+=this._extractColor(C,J,P):k===53?P.bg|=1073741824:k===55?P.bg&=-1073741825:k===59?(P.extended=P.extended.clone(),P.extended.underlineColor=-1,P.updateExtended()):k===100?(P.fg&=-67108864,P.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,P.bg&=-67108864,P.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",k);return!0}deviceStatus(C){switch(C.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const D=this._activeBuffer.y+1,k=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${D};${k}R`)}return!0}deviceStatusPrivate(C){if(C.params[0]===6){const D=this._activeBuffer.y+1,k=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${D};${k}R`)}return!0}softReset(C){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(C){const D=C.params[0]||1;switch(D){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const k=D%2==1;return this._optionsService.options.cursorBlink=k,!0}setScrollRegion(C){const D=C.params[0]||1;let k;return(C.length<2||(k=C.params[1])>this._bufferService.rows||k===0)&&(k=this._bufferService.rows),k>D&&(this._activeBuffer.scrollTop=D-1,this._activeBuffer.scrollBottom=k-1,this._setCursor(0,0)),!0}windowOptions(C){if(!z(C.params[0],this._optionsService.rawOptions.windowOptions))return!0;const D=C.length>1?C.params[1]:0;switch(C.params[0]){case 14:D!==2&&this._onRequestWindowsOptionsReport.fire(M.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(M.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:D!==0&&D!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),D!==0&&D!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:D!==0&&D!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),D!==0&&D!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(C){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(C){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(C){return this._windowTitle=C,this._onTitleChange.fire(C),!0}setIconName(C){return this._iconName=C,!0}setOrReportIndexedColor(C){const D=[],k=C.split(";");for(;k.length>1;){const P=k.shift(),J=k.shift();if(/^\d+$/.exec(P)){const re=parseInt(P);if(le(re))if(J==="?")D.push({type:0,index:re});else{const ce=(0,R.parseColor)(J);ce&&D.push({type:1,index:re,color:ce})}}}return D.length&&this._onColor.fire(D),!0}setHyperlink(C){const D=C.split(";");return!(D.length<2)&&(D[1]?this._createHyperlink(D[0],D[1]):!D[0]&&this._finishHyperlink())}_createHyperlink(C,D){this._getCurrentLinkId()&&this._finishHyperlink();const k=C.split(":");let P;const J=k.findIndex((re=>re.startsWith("id=")));return J!==-1&&(P=k[J].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:P,uri:D}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(C,D){const k=C.split(";");for(let P=0;P<k.length&&!(D>=this._specialColors.length);++P,++D)if(k[P]==="?")this._onColor.fire([{type:0,index:this._specialColors[D]}]);else{const J=(0,R.parseColor)(k[P]);J&&this._onColor.fire([{type:1,index:this._specialColors[D],color:J}])}return!0}setOrReportFgColor(C){return this._setOrReportSpecialColor(C,0)}setOrReportBgColor(C){return this._setOrReportSpecialColor(C,1)}setOrReportCursorColor(C){return this._setOrReportSpecialColor(C,2)}restoreIndexedColor(C){if(!C)return this._onColor.fire([{type:2}]),!0;const D=[],k=C.split(";");for(let P=0;P<k.length;++P)if(/^\d+$/.exec(k[P])){const J=parseInt(k[P]);le(J)&&D.push({type:2,index:J})}return D.length&&this._onColor.fire(D),!0}restoreFgColor(C){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(C){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(C){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,g.DEFAULT_CHARSET),!0}selectCharset(C){return C.length!==2?(this.selectDefaultCharset(),!0):(C[0]==="/"||this._charsetService.setgCharset(N[C[0]],g.CHARSETS[C[1]]||g.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 C=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,C,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(C){return this._charsetService.setgLevel(C),!0}screenAlignmentPattern(){const C=new o.CellData;C.content=4194373,C.fg=this._curAttrData.fg,C.bg=this._curAttrData.bg,this._setCursor(0,0);for(let D=0;D<this._bufferService.rows;++D){const k=this._activeBuffer.ybase+this._activeBuffer.y+D,P=this._activeBuffer.lines.get(k);P&&(P.fill(C),P.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(C,D){const k=this._bufferService.buffer,P=this._optionsService.rawOptions;return(J=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${J}${h.C0.ESC}\\`),!0))(C==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:C==='"p'?'P1$r61;1"p':C==="r"?`P1$r${k.scrollTop+1};${k.scrollBottom+1}r`:C==="m"?"P1$r0m":C===" q"?`P1$r${{block:2,underline:4,bar:6}[P.cursorStyle]-(P.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(C,D){this._dirtyRowTracker.markRangeDirty(C,D)}}a.InputHandler=te;let ne=class{constructor(F){this._bufferService=F,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(F){F<this.start?this.start=F:F>this.end&&(this.end=F)}markRangeDirty(F,C){F>C&&(Q=F,F=C,C=Q),F<this.start&&(this.start=F),C>this.end&&(this.end=C)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function le(F){return 0<=F&&F<256}ne=p([m(0,w.IBufferService)],ne)},844:($,a)=>{function u(p){for(const m of p)m.dispose();p.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const p of this._disposables)p.dispose();this._disposables.length=0}register(p){return this._disposables.push(p),p}unregister(p){const m=this._disposables.indexOf(p);m!==-1&&this._disposables.splice(m,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(p){var m;this._isDisposed||p===this._value||((m=this._value)==null||m.dispose(),this._value=p)}clear(){this.value=void 0}dispose(){var p;this._isDisposed=!0,(p=this._value)==null||p.dispose(),this._value=void 0}},a.toDisposable=function(p){return{dispose:p}},a.disposeArray=u,a.getDisposeArrayDisposable=function(p){return{dispose:()=>u(p)}}},1505:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(m,h,g){this._data[m]||(this._data[m]={}),this._data[m][h]=g}get(m,h){return this._data[m]?this._data[m][h]:void 0}clear(){this._data={}}}a.TwoKeyMap=u,a.FourKeyMap=class{constructor(){this._data=new u}set(p,m,h,g,S){this._data.get(p,m)||this._data.set(p,m,new u),this._data.get(p,m).set(h,g,S)}get(p,m,h,g){var S;return(S=this._data.get(p,m))==null?void 0:S.get(h,g)}clear(){this._data.clear()}}},6114:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const u=a.isNode?"node":navigator.userAgent,p=a.isNode?"node":navigator.platform;a.isFirefox=u.includes("Firefox"),a.isLegacyEdge=u.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(u),a.getSafariVersion=function(){if(!a.isSafari)return 0;const m=u.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(p),a.isIpad=p==="iPad",a.isIphone=p==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(p),a.isLinux=p.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(u)},6106:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let u=0;a.SortedList=class{constructor(p){this._getKey=p,this._array=[]}clear(){this._array.length=0}insert(p){this._array.length!==0?(u=this._search(this._getKey(p)),this._array.splice(u,0,p)):this._array.push(p)}delete(p){if(this._array.length===0)return!1;const m=this._getKey(p);if(m===void 0||(u=this._search(m),u===-1)||this._getKey(this._array[u])!==m)return!1;do if(this._array[u]===p)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===m);return!1}*getKeyIterator(p){if(this._array.length!==0&&(u=this._search(p),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===p))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===p)}forEachByKey(p,m){if(this._array.length!==0&&(u=this._search(p),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===p))do m(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===p)}values(){return[...this._array].values()}_search(p){let m=0,h=this._array.length-1;for(;h>=m;){let g=m+h>>1;const S=this._getKey(this._array[g]);if(S>p)h=g-1;else{if(!(S<p)){for(;g>0&&this._getKey(this._array[g-1])===p;)g--;return g}m=g+1}}return m}}},7226:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const p=u(6114);class m{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 x=0,_=0,n=S.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),_=Math.max(x,_),l=S.timeRemaining(),1.5*_>l)return n-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-x))}ms`),void this._start();n=l}this.clear()}}class h extends m{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const x=Date.now()+S;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}a.PriorityTaskQueue=h,a.IdleTaskQueue=!p.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:h,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const p=u(643);a.updateWindowsModeWrappedState=function(m){const h=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),g=h==null?void 0:h.get(m.cols-1),S=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);S&&g&&(S.isWrapped=g[p.CHAR_DATA_CODE_INDEX]!==p.NULL_CELL_CODE&&g[p.CHAR_DATA_CODE_INDEX]!==p.WHITESPACE_CELL_CODE)}},3734:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new p}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 u;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}}a.AttributeData=u;class p{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,g=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=g}clone(){return new p(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=p},9092:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const p=u(6349),m=u(7226),h=u(3734),g=u(8437),S=u(4634),x=u(511),_=u(643),n=u(4863),l=u(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(s,o,f){this._hasScrollback=s,this._optionsService=o,this._bufferService=f,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=l.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new p.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,o){return new g.BufferLine(this._bufferService.cols,this.getNullCell(s),o)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows}_getCorrectBufferLength(s){if(!this._hasScrollback)return s;const o=s+this._optionsService.rawOptions.scrollback;return o>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:o}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=g.DEFAULT_ATTR_DATA);let o=this._rows;for(;o--;)this.lines.push(this.getBlankLine(s))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new p.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(s,o){const f=this.getNullCell(g.DEFAULT_ATTR_DATA);let w=0;const y=this._getCorrectBufferLength(o);if(y>this.lines.maxLength&&(this.lines.maxLength=y),this.lines.length>0){if(this._cols<s)for(let v=0;v<this.lines.length;v++)w+=+this.lines.get(v).resize(s,f);let b=0;if(this._rows<o)for(let v=this._rows;v<o;v++)this.lines.length<o+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new g.BufferLine(s,f)):this.ybase>0&&this.lines.length<=this.ybase+this.y+b+1?(this.ybase--,b++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(s,f)));else for(let v=this._rows;v>o;v--)this.lines.length>o+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(y<this.lines.maxLength){const v=this.lines.length-y;v>0&&(this.lines.trimStart(v),this.ybase=Math.max(this.ybase-v,0),this.ydisp=Math.max(this.ydisp-v,0),this.savedY=Math.max(this.savedY-v,0)),this.lines.maxLength=y}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,o-1),b&&(this.y+=b),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=o-1,this._isReflowEnabled&&(this._reflow(s,o),this._cols>s))for(let b=0;b<this.lines.length;b++)w+=+this.lines.get(b).resize(s,f);this._cols=s,this._rows=o,this._memoryCleanupQueue.clear(),w>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let s=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,s=!1);let o=0;for(;this._memoryCleanupPosition<this.lines.length;)if(o+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),o>100)return!0;return s}get _isReflowEnabled(){const s=this._optionsService.rawOptions.windowsPty;return s&&s.buildNumber?this._hasScrollback&&s.backend==="conpty"&&s.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(s,o){this._cols!==s&&(s>this._cols?this._reflowLarger(s,o):this._reflowSmaller(s,o))}_reflowLarger(s,o){const f=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(f.length>0){const w=(0,S.reflowLargerCreateNewLayout)(this.lines,f);(0,S.reflowLargerApplyNewLayout)(this.lines,w.layout),this._reflowLargerAdjustViewport(s,o,w.countRemoved)}}_reflowLargerAdjustViewport(s,o,f){const w=this.getNullCell(g.DEFAULT_ATTR_DATA);let y=f;for(;y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<o&&this.lines.push(new g.BufferLine(s,w))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-f,0)}_reflowSmaller(s,o){const f=this.getNullCell(g.DEFAULT_ATTR_DATA),w=[];let y=0;for(let b=this.lines.length-1;b>=0;b--){let v=this.lines.get(b);if(!v||!v.isWrapped&&v.getTrimmedLength()<=s)continue;const R=[v];for(;v.isWrapped&&b>0;)v=this.lines.get(--b),R.unshift(v);const N=this.ybase+this.y;if(N>=b&&N<b+R.length)continue;const j=R[R.length-1].getTrimmedLength(),z=(0,S.reflowSmallerGetNewLineLengths)(R,this._cols,s),M=z.length-R.length;let Q;Q=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+M):Math.max(0,this.lines.length-this.lines.maxLength+M);const te=[];for(let k=0;k<M;k++){const P=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);te.push(P)}te.length>0&&(w.push({start:b+R.length+y,newLines:te}),y+=te.length),R.push(...te);let ne=z.length-1,le=z[ne];le===0&&(ne--,le=z[ne]);let F=R.length-M-1,C=j;for(;F>=0;){const k=Math.min(C,le);if(R[ne]===void 0)break;if(R[ne].copyCellsFrom(R[F],C-k,le-k,k,!0),le-=k,le===0&&(ne--,le=z[ne]),C-=k,C===0){F--;const P=Math.max(F,0);C=(0,S.getWrappedLineTrimmedLength)(R,P,this._cols)}}for(let k=0;k<R.length;k++)z[k]<s&&R[k].setCell(z[k],f);let D=M-Q;for(;D-- >0;)this.ybase===0?this.y<o-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+y)-o&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+M,this.ybase+o-1)}if(w.length>0){const b=[],v=[];for(let ne=0;ne<this.lines.length;ne++)v.push(this.lines.get(ne));const R=this.lines.length;let N=R-1,j=0,z=w[j];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);let M=0;for(let ne=Math.min(this.lines.maxLength-1,R+y-1);ne>=0;ne--)if(z&&z.start>N+M){for(let le=z.newLines.length-1;le>=0;le--)this.lines.set(ne--,z.newLines[le]);ne++,b.push({index:N+1,amount:z.newLines.length}),M+=z.newLines.length,z=w[++j]}else this.lines.set(ne,v[N--]);let Q=0;for(let ne=b.length-1;ne>=0;ne--)b[ne].index+=Q,this.lines.onInsertEmitter.fire(b[ne]),Q+=b[ne].amount;const te=Math.max(0,R+y-this.lines.maxLength);te>0&&this.lines.onTrimEmitter.fire(te)}}translateBufferLineToString(s,o,f=0,w){const y=this.lines.get(s);return y?y.translateToString(o,f,w):""}getWrappedRangeForLine(s){let o=s,f=s;for(;o>0&&this.lines.get(o).isWrapped;)o--;for(;f+1<this.lines.length&&this.lines.get(f+1).isWrapped;)f++;return{first:o,last:f}}setupTabStops(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.rawOptions.tabStopWidth)this.tabs[s]=!0}prevStop(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s}nextStop(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s}clearMarkers(s){this._isClearing=!0;for(let o=0;o<this.markers.length;o++)this.markers[o].line===s&&(this.markers[o].dispose(),this.markers.splice(o--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].dispose(),this.markers.splice(s--,1);this._isClearing=!1}addMarker(s){const o=new n.Marker(s);return this.markers.push(o),o.register(this.lines.onTrim((f=>{o.line-=f,o.line<0&&o.dispose()}))),o.register(this.lines.onInsert((f=>{o.line>=f.index&&(o.line+=f.amount)}))),o.register(this.lines.onDelete((f=>{o.line>=f.index&&o.line<f.index+f.amount&&o.dispose(),o.line>f.index&&(o.line-=f.amount)}))),o.register(o.onDispose((()=>this._removeMarker(o)))),o}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const p=u(3734),m=u(511),h=u(643),g=u(482);a.DEFAULT_ATTR_DATA=Object.freeze(new p.AttributeData);let S=0;class x{constructor(n,l,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const o=l||m.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let f=0;f<n;++f)this.setCell(f,o);this.length=n}get(n){const l=this._data[3*n+0],s=2097151&l;return[this._data[3*n+1],2097152&l?this._combined[n]:s?(0,g.stringFromCodePoint)(s):"",l>>22,2097152&l?this._combined[n].charCodeAt(this._combined[n].length-1):s]}set(n,l){this._data[3*n+1]=l[h.CHAR_DATA_ATTR_INDEX],l[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=l[1],this._data[3*n+0]=2097152|n|l[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=l[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|l[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const l=this._data[3*n+0];return 2097152&l?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&l}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const l=this._data[3*n+0];return 2097152&l?this._combined[n]:2097151&l?(0,g.stringFromCodePoint)(2097151&l):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,l){return S=3*n,l.content=this._data[S+0],l.fg=this._data[S+1],l.bg=this._data[S+2],2097152&l.content&&(l.combinedData=this._combined[n]),268435456&l.bg&&(l.extended=this._extendedAttrs[n]),l}setCell(n,l){2097152&l.content&&(this._combined[n]=l.combinedData),268435456&l.bg&&(this._extendedAttrs[n]=l.extended),this._data[3*n+0]=l.content,this._data[3*n+1]=l.fg,this._data[3*n+2]=l.bg}setCellFromCodepoint(n,l,s,o){268435456&o.bg&&(this._extendedAttrs[n]=o.extended),this._data[3*n+0]=l|s<<22,this._data[3*n+1]=o.fg,this._data[3*n+2]=o.bg}addCodepointToCell(n,l,s){let o=this._data[3*n+0];2097152&o?this._combined[n]+=(0,g.stringFromCodePoint)(l):2097151&o?(this._combined[n]=(0,g.stringFromCodePoint)(2097151&o)+(0,g.stringFromCodePoint)(l),o&=-2097152,o|=2097152):o=l|4194304,s&&(o&=-12582913,o|=s<<22),this._data[3*n+0]=o}insertCells(n,l,s){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,s),l<this.length-n){const o=new m.CellData;for(let f=this.length-n-l-1;f>=0;--f)this.setCell(n+l+f,this.loadCell(n+f,o));for(let f=0;f<l;++f)this.setCell(n+f,s)}else for(let o=n;o<this.length;++o)this.setCell(o,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(n,l,s){if(n%=this.length,l<this.length-n){const o=new m.CellData;for(let f=0;f<this.length-n-l;++f)this.setCell(n+f,this.loadCell(n+l+f,o));for(let f=this.length-l;f<this.length;++f)this.setCell(f,s)}else for(let o=n;o<this.length;++o)this.setCell(o,s);n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,s),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodepoint(n,0,1,s)}replaceCells(n,l,s,o=!1){if(o)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodepoint(n-1,0,1,s),l<this.length&&this.getWidth(l-1)===2&&!this.isProtected(l)&&this.setCellFromCodepoint(l,0,1,s);n<l&&n<this.length;)this.isProtected(n)||this.setCell(n,s),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,s),l<this.length&&this.getWidth(l-1)===2&&this.setCellFromCodepoint(l,0,1,s);n<l&&n<this.length;)this.setCell(n++,s)}resize(n,l){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const o=new Uint32Array(s);o.set(this._data),this._data=o}for(let o=this.length;o<n;++o)this.setCell(o,l)}else{this._data=this._data.subarray(0,s);const o=Object.keys(this._combined);for(let w=0;w<o.length;w++){const y=parseInt(o[w],10);y>=n&&delete this._combined[y]}const f=Object.keys(this._extendedAttrs);for(let w=0;w<f.length;w++){const y=parseInt(f[w],10);y>=n&&delete this._extendedAttrs[y]}}return this.length=n,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,l=!1){if(l)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,n);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const l in n._combined)this._combined[l]=n._combined[l];this._extendedAttrs={};for(const l in n._extendedAttrs)this._extendedAttrs[l]=n._extendedAttrs[l];this.isWrapped=n.isWrapped}clone(){const n=new x(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const l in this._combined)n._combined[l]=this._combined[l];for(const l in this._extendedAttrs)n._extendedAttrs[l]=this._extendedAttrs[l];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,l,s,o,f){const w=n._data;if(f)for(let b=o-1;b>=0;b--){for(let v=0;v<3;v++)this._data[3*(s+b)+v]=w[3*(l+b)+v];268435456&w[3*(l+b)+2]&&(this._extendedAttrs[s+b]=n._extendedAttrs[l+b])}else for(let b=0;b<o;b++){for(let v=0;v<3;v++)this._data[3*(s+b)+v]=w[3*(l+b)+v];268435456&w[3*(l+b)+2]&&(this._extendedAttrs[s+b]=n._extendedAttrs[l+b])}const y=Object.keys(n._combined);for(let b=0;b<y.length;b++){const v=parseInt(y[b],10);v>=l&&(this._combined[v-l+s]=n._combined[v])}}translateToString(n,l,s,o){l=l??0,s=s??this.length,n&&(s=Math.min(s,this.getTrimmedLength())),o&&(o.length=0);let f="";for(;l<s;){const w=this._data[3*l+0],y=2097151&w,b=2097152&w?this._combined[l]:y?(0,g.stringFromCodePoint)(y):h.WHITESPACE_CELL_CHAR;if(f+=b,o)for(let v=0;v<b.length;++v)o.push(l);l+=w>>22||1}return o&&o.push(l),f}}a.BufferLine=x},4841:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(u,p){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return p*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:($,a)=>{function u(p,m,h){if(m===p.length-1)return p[m].getTrimmedLength();const g=!p[m].hasContent(h-1)&&p[m].getWidth(h-1)===1,S=p[m+1].getWidth(0)===2;return g&&S?h-1:h}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(p,m,h,g,S){const x=[];for(let _=0;_<p.length-1;_++){let n=_,l=p.get(++n);if(!l.isWrapped)continue;const s=[p.get(_)];for(;n<p.length&&l.isWrapped;)s.push(l),l=p.get(++n);if(g>=_&&g<n){_+=s.length-1;continue}let o=0,f=u(s,o,m),w=1,y=0;for(;w<s.length;){const v=u(s,w,m),R=v-y,N=h-f,j=Math.min(R,N);s[o].copyCellsFrom(s[w],y,f,j,!1),f+=j,f===h&&(o++,f=0),y+=j,y===v&&(w++,y=0),f===0&&o!==0&&s[o-1].getWidth(h-1)===2&&(s[o].copyCellsFrom(s[o-1],h-1,f++,1,!1),s[o-1].setCell(h-1,S))}s[o].replaceCells(f,h,S);let b=0;for(let v=s.length-1;v>0&&(v>o||s[v].getTrimmedLength()===0);v--)b++;b>0&&(x.push(_+s.length-b),x.push(b)),_+=s.length-1}return x},a.reflowLargerCreateNewLayout=function(p,m){const h=[];let g=0,S=m[g],x=0;for(let _=0;_<p.length;_++)if(S===_){const n=m[++g];p.onDeleteEmitter.fire({index:_-x,amount:n}),_+=n-1,x+=n,S=m[++g]}else h.push(_);return{layout:h,countRemoved:x}},a.reflowLargerApplyNewLayout=function(p,m){const h=[];for(let g=0;g<m.length;g++)h.push(p.get(m[g]));for(let g=0;g<h.length;g++)p.set(g,h[g]);p.length=m.length},a.reflowSmallerGetNewLineLengths=function(p,m,h){const g=[],S=p.map(((l,s)=>u(p,s,m))).reduce(((l,s)=>l+s));let x=0,_=0,n=0;for(;n<S;){if(S-n<h){g.push(S-n);break}x+=h;const l=u(p,_,m);x>l&&(x-=l,_++);const s=p[_].getWidth(x-1)===2;s&&x--;const o=s?h-1:h;g.push(o),n+=o}return g},a.getWrappedLineTrimmedLength=u},5295:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const p=u(8460),m=u(844),h=u(9092);class g extends m.Disposable{constructor(x,_){super(),this._optionsService=x,this._bufferService=_,this._onBufferActivate=this.register(new p.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(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),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(x,_){this._normal.resize(x,_),this._alt.resize(x,_),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}a.BufferSet=g},511:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const p=u(482),m=u(643),h=u(3734);class g extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const _=new g;return _.setFromCharData(x),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,p.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(x[m.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(x[m.CHAR_DATA_CHAR_INDEX].length===2){const n=x[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const l=x[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(n-55296)+l-56320+65536|x[m.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=x[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[m.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=x[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=g},643:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const p=u(8460),m=u(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 p.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}a.Marker=h,h._nextId=1},7116:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:($,a)=>{var u,p,m;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.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=`
47
+ `,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=""})(u||(a.C0=u={})),(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="Ÿ"})(p||(a.C1=p={})),(function(h){h.ST=`${u.ESC}\\`})(m||(a.C1_ESCAPED=m={}))},7399:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const p=u(2584),m={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};a.evaluateKeyboardEvent=function(h,g,S,x){const _={type:0,cancel:!1,key:void 0},n=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?_.key=g?p.C0.ESC+"OA":p.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?_.key=g?p.C0.ESC+"OD":p.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?_.key=g?p.C0.ESC+"OC":p.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(_.key=g?p.C0.ESC+"OB":p.C0.ESC+"[B");break;case 8:_.key=h.ctrlKey?"\b":p.C0.DEL,h.altKey&&(_.key=p.C0.ESC+_.key);break;case 9:if(h.shiftKey){_.key=p.C0.ESC+"[Z";break}_.key=p.C0.HT,_.cancel=!0;break;case 13:_.key=h.altKey?p.C0.ESC+p.C0.CR:p.C0.CR,_.cancel=!0;break;case 27:_.key=p.C0.ESC,h.altKey&&(_.key=p.C0.ESC+p.C0.ESC),_.cancel=!0;break;case 37:if(h.metaKey)break;n?(_.key=p.C0.ESC+"[1;"+(n+1)+"D",_.key===p.C0.ESC+"[1;3D"&&(_.key=p.C0.ESC+(S?"b":"[1;5D"))):_.key=g?p.C0.ESC+"OD":p.C0.ESC+"[D";break;case 39:if(h.metaKey)break;n?(_.key=p.C0.ESC+"[1;"+(n+1)+"C",_.key===p.C0.ESC+"[1;3C"&&(_.key=p.C0.ESC+(S?"f":"[1;5C"))):_.key=g?p.C0.ESC+"OC":p.C0.ESC+"[C";break;case 38:if(h.metaKey)break;n?(_.key=p.C0.ESC+"[1;"+(n+1)+"A",S||_.key!==p.C0.ESC+"[1;3A"||(_.key=p.C0.ESC+"[1;5A")):_.key=g?p.C0.ESC+"OA":p.C0.ESC+"[A";break;case 40:if(h.metaKey)break;n?(_.key=p.C0.ESC+"[1;"+(n+1)+"B",S||_.key!==p.C0.ESC+"[1;3B"||(_.key=p.C0.ESC+"[1;5B")):_.key=g?p.C0.ESC+"OB":p.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(_.key=p.C0.ESC+"[2~");break;case 46:_.key=n?p.C0.ESC+"[3;"+(n+1)+"~":p.C0.ESC+"[3~";break;case 36:_.key=n?p.C0.ESC+"[1;"+(n+1)+"H":g?p.C0.ESC+"OH":p.C0.ESC+"[H";break;case 35:_.key=n?p.C0.ESC+"[1;"+(n+1)+"F":g?p.C0.ESC+"OF":p.C0.ESC+"[F";break;case 33:h.shiftKey?_.type=2:h.ctrlKey?_.key=p.C0.ESC+"[5;"+(n+1)+"~":_.key=p.C0.ESC+"[5~";break;case 34:h.shiftKey?_.type=3:h.ctrlKey?_.key=p.C0.ESC+"[6;"+(n+1)+"~":_.key=p.C0.ESC+"[6~";break;case 112:_.key=n?p.C0.ESC+"[1;"+(n+1)+"P":p.C0.ESC+"OP";break;case 113:_.key=n?p.C0.ESC+"[1;"+(n+1)+"Q":p.C0.ESC+"OQ";break;case 114:_.key=n?p.C0.ESC+"[1;"+(n+1)+"R":p.C0.ESC+"OR";break;case 115:_.key=n?p.C0.ESC+"[1;"+(n+1)+"S":p.C0.ESC+"OS";break;case 116:_.key=n?p.C0.ESC+"[15;"+(n+1)+"~":p.C0.ESC+"[15~";break;case 117:_.key=n?p.C0.ESC+"[17;"+(n+1)+"~":p.C0.ESC+"[17~";break;case 118:_.key=n?p.C0.ESC+"[18;"+(n+1)+"~":p.C0.ESC+"[18~";break;case 119:_.key=n?p.C0.ESC+"[19;"+(n+1)+"~":p.C0.ESC+"[19~";break;case 120:_.key=n?p.C0.ESC+"[20;"+(n+1)+"~":p.C0.ESC+"[20~";break;case 121:_.key=n?p.C0.ESC+"[21;"+(n+1)+"~":p.C0.ESC+"[21~";break;case 122:_.key=n?p.C0.ESC+"[23;"+(n+1)+"~":p.C0.ESC+"[23~";break;case 123:_.key=n?p.C0.ESC+"[24;"+(n+1)+"~":p.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(S&&!x||!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?_.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(_.key=p.C0.US),h.key==="@"&&(_.key=p.C0.NUL)):h.keyCode===65&&(_.type=1);else{const l=m[h.keyCode],s=l==null?void 0:l[h.shiftKey?1:0];if(s)_.key=p.C0.ESC+s;else if(h.keyCode>=65&&h.keyCode<=90){const o=h.ctrlKey?h.keyCode-64:h.keyCode+32;let f=String.fromCharCode(o);h.shiftKey&&(f=f.toUpperCase()),_.key=p.C0.ESC+f}else if(h.keyCode===32)_.key=p.C0.ESC+(h.ctrlKey?p.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let o=h.code.slice(3,4);h.shiftKey||(o=o.toLowerCase()),_.key=p.C0.ESC+o,_.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?_.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?_.key=p.C0.NUL:h.keyCode>=51&&h.keyCode<=55?_.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?_.key=p.C0.DEL:h.keyCode===219?_.key=p.C0.ESC:h.keyCode===220?_.key=p.C0.FS:h.keyCode===221&&(_.key=p.C0.GS)}return _}},482:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},a.utf32ToString=function(u,p=0,m=u.length){let h="";for(let g=p;g<m;++g){let S=u[g];S>65535?(S-=65536,h+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):h+=String.fromCharCode(S)}return h},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,p){const m=u.length;if(!m)return 0;let h=0,g=0;if(this._interim){const S=u.charCodeAt(g++);56320<=S&&S<=57343?p[h++]=1024*(this._interim-55296)+S-56320+65536:(p[h++]=this._interim,p[h++]=S),this._interim=0}for(let S=g;S<m;++S){const x=u.charCodeAt(S);if(55296<=x&&x<=56319){if(++S>=m)return this._interim=x,h;const _=u.charCodeAt(S);56320<=_&&_<=57343?p[h++]=1024*(x-55296)+_-56320+65536:(p[h++]=x,p[h++]=_)}else x!==65279&&(p[h++]=x)}return h}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,p){const m=u.length;if(!m)return 0;let h,g,S,x,_=0,n=0,l=0;if(this.interim[0]){let f=!1,w=this.interim[0];w&=(224&w)==192?31:(240&w)==224?15:7;let y,b=0;for(;(y=63&this.interim[++b])&&b<4;)w<<=6,w|=y;const v=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=v-b;for(;l<R;){if(l>=m)return 0;if(y=u[l++],(192&y)!=128){l--,f=!0;break}this.interim[b++]=y,w<<=6,w|=63&y}f||(v===2?w<128?l--:p[_++]=w:v===3?w<2048||w>=55296&&w<=57343||w===65279||(p[_++]=w):w<65536||w>1114111||(p[_++]=w)),this.interim.fill(0)}const s=m-4;let o=l;for(;o<m;){for(;!(!(o<s)||128&(h=u[o])||128&(g=u[o+1])||128&(S=u[o+2])||128&(x=u[o+3]));)p[_++]=h,p[_++]=g,p[_++]=S,p[_++]=x,o+=4;if(h=u[o++],h<128)p[_++]=h;else if((224&h)==192){if(o>=m)return this.interim[0]=h,_;if(g=u[o++],(192&g)!=128){o--;continue}if(n=(31&h)<<6|63&g,n<128){o--;continue}p[_++]=n}else if((240&h)==224){if(o>=m)return this.interim[0]=h,_;if(g=u[o++],(192&g)!=128){o--;continue}if(o>=m)return this.interim[0]=h,this.interim[1]=g,_;if(S=u[o++],(192&S)!=128){o--;continue}if(n=(15&h)<<12|(63&g)<<6|63&S,n<2048||n>=55296&&n<=57343||n===65279)continue;p[_++]=n}else if((248&h)==240){if(o>=m)return this.interim[0]=h,_;if(g=u[o++],(192&g)!=128){o--;continue}if(o>=m)return this.interim[0]=h,this.interim[1]=g,_;if(S=u[o++],(192&S)!=128){o--;continue}if(o>=m)return this.interim[0]=h,this.interim[1]=g,this.interim[2]=S,_;if(x=u[o++],(192&x)!=128){o--;continue}if(n=(7&h)<<18|(63&g)<<12|(63&S)<<6|63&x,n<65536||n>1114111)continue;p[_++]=n}}return _}}},225:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const p=u(1480),m=[[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 g;a.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let S=0;S<m.length;++S)g.fill(0,m[S][0],m[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?g[S]:(function(x,_){let n,l=0,s=_.length-1;if(x<_[0][0]||x>_[s][1])return!1;for(;s>=l;)if(n=l+s>>1,x>_[n][1])l=n+1;else{if(!(x<_[n][0]))return!0;s=n-1}return!1})(S,h)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,x){let _=this.wcwidth(S),n=_===0&&x!==0;if(n){const l=p.UnicodeService.extractWidth(x);l===0?n=!1:l>_&&(_=l)}return p.UnicodeService.createPropertyValue(0,_,n)}}},5981:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const p=u(8460),m=u(844);class h extends m.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 p.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let _;for(this._isSyncWriting=!0;_=this._writeBuffer.shift();){this._action(_);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,x){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(x),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(x)}_innerWrite(S=0,x=!0){const _=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],l=this._action(n,x);if(l){const o=f=>Date.now()-_>=12?setTimeout((()=>this._innerWrite(0,f))):this._innerWrite(_,f);return void l.catch((f=>(queueMicrotask((()=>{throw f})),Promise.resolve(!1)))).then(o)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-_>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}a.WriteBuffer=h},5941:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,p=/^[\da-f]+$/;function m(h,g){const S=h.toString(16),x=S.length<2?"0"+S:S;switch(g){case 4:return S[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}a.parseColor=function(h){if(!h)return;let g=h.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const S=u.exec(g);if(S){const x=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/x*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/x*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/x*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),p.exec(g)&&[3,6,9,12].includes(g.length))){const S=g.length/3,x=[0,0,0];for(let _=0;_<3;++_){const n=parseInt(g.slice(S*_,S*_+S),16);x[_]=S===1?n<<4:S===2?n:S===3?n>>4:n>>8}return x}},a.toRgbString=function(h,g=16){const[S,x,_]=h;return`rgb:${m(S,g)}/${m(x,g)}/${m(_,g)}`}},5770:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const p=u(482),m=u(8742),h=u(5770),g=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(x,_){this._handlers[x]===void 0&&(this._handlers[x]=[]);const n=this._handlers[x];return n.push(_),{dispose:()=>{const l=n.indexOf(_);l!==-1&&n.splice(l,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(x,_){if(this.reset(),this._ident=x,this._active=this._handlers[x]||g,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(_);else this._handlerFb(this._ident,"HOOK",_)}put(x,_,n){if(this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].put(x,_,n);else this._handlerFb(this._ident,"PUT",(0,p.utf32ToString)(x,_,n))}unhook(x,_=!0){if(this._active.length){let n=!1,l=this._active.length-1,s=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,n=_,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;l>=0&&(n=this._active[l].unhook(x),n!==!0);l--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,n;l--}for(;l>=0;l--)if(n=this._active[l].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",x);this._active=g,this._ident=0}};const S=new m.Params;S.addParam(0),a.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=S,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():S,this._data="",this._hitLimit=!1}put(x,_,n){this._hitLimit||(this._data+=(0,p.utf32ToString)(x,_,n),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let _=!1;if(this._hitLimit)_=!1;else if(x&&(_=this._handler(this._data,this._params),_ instanceof Promise))return _.then((n=>(this._params=S,this._data="",this._hitLimit=!1,n)));return this._params=S,this._data="",this._hitLimit=!1,_}}},2015:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const p=u(844),m=u(8742),h=u(6242),g=u(6351);class S{constructor(l){this.table=new Uint8Array(l)}setDefault(l,s){this.table.fill(l<<4|s)}add(l,s,o,f){this.table[s<<8|l]=o<<4|f}addMany(l,s,o,f){for(let w=0;w<l.length;w++)this.table[s<<8|l[w]]=o<<4|f}}a.TransitionTable=S;const x=160;a.VT500_TRANSITION_TABLE=(function(){const n=new S(4095),l=Array.apply(null,Array(256)).map(((b,v)=>v)),s=(b,v)=>l.slice(b,v),o=s(32,127),f=s(0,24);f.push(25),f.push.apply(f,s(28,32));const w=s(0,14);let y;for(y in n.setDefault(1,0),n.addMany(o,0,2,0),w)n.addMany([24,26,153,154],y,3,0),n.addMany(s(128,144),y,3,0),n.addMany(s(144,152),y,3,0),n.add(156,y,0,0),n.add(27,y,11,1),n.add(157,y,4,8),n.addMany([152,158,159],y,0,7),n.add(155,y,11,3),n.add(144,y,11,9);return n.addMany(f,0,3,0),n.addMany(f,1,3,1),n.add(127,1,0,1),n.addMany(f,8,0,8),n.addMany(f,3,3,3),n.add(127,3,0,3),n.addMany(f,4,3,4),n.add(127,4,0,4),n.addMany(f,6,3,6),n.addMany(f,5,3,5),n.add(127,5,0,5),n.addMany(f,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(o,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(s(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(o,7,0,7),n.addMany(f,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(s(64,127),3,7,0),n.addMany(s(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(s(48,60),4,8,4),n.addMany(s(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(s(32,64),6,0,6),n.add(127,6,0,6),n.addMany(s(64,127),6,0,0),n.addMany(s(32,48),3,9,5),n.addMany(s(32,48),5,9,5),n.addMany(s(48,64),5,0,6),n.addMany(s(64,127),5,7,0),n.addMany(s(32,48),4,9,5),n.addMany(s(32,48),1,9,2),n.addMany(s(32,48),2,9,2),n.addMany(s(48,127),2,10,0),n.addMany(s(48,80),1,10,0),n.addMany(s(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(s(96,127),1,10,0),n.add(80,1,11,9),n.addMany(f,9,0,9),n.add(127,9,0,9),n.addMany(s(28,32),9,0,9),n.addMany(s(32,48),9,9,12),n.addMany(s(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(f,11,0,11),n.addMany(s(32,128),11,0,11),n.addMany(s(28,32),11,0,11),n.addMany(f,10,0,10),n.add(127,10,0,10),n.addMany(s(28,32),10,0,10),n.addMany(s(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(s(32,48),10,9,12),n.addMany(f,12,0,12),n.add(127,12,0,12),n.addMany(s(28,32),12,0,12),n.addMany(s(32,48),12,9,12),n.addMany(s(48,64),12,0,11),n.addMany(s(64,127),12,12,13),n.addMany(s(64,127),10,12,13),n.addMany(s(64,127),9,12,13),n.addMany(f,13,13,13),n.addMany(o,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(x,0,2,0),n.add(x,8,5,8),n.add(x,6,0,6),n.add(x,11,0,11),n.add(x,13,13,13),n})();class _ extends p.Disposable{constructor(l=a.VT500_TRANSITION_TABLE){super(),this._transitions=l,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(s,o,f)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,o)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,p.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 g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(l,s=[64,126]){let o=0;if(l.prefix){if(l.prefix.length>1)throw new Error("only one byte as prefix supported");if(o=l.prefix.charCodeAt(0),o&&60>o||o>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(l.intermediates){if(l.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let w=0;w<l.intermediates.length;++w){const y=l.intermediates.charCodeAt(w);if(32>y||y>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");o<<=8,o|=y}}if(l.final.length!==1)throw new Error("final must be a single byte");const f=l.final.charCodeAt(0);if(s[0]>f||f>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return o<<=8,o|=f,o}identToString(l){const s=[];for(;l;)s.push(String.fromCharCode(255&l)),l>>=8;return s.reverse().join("")}setPrintHandler(l){this._printHandler=l}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(l,s){const o=this._identifier(l,[48,126]);this._escHandlers[o]===void 0&&(this._escHandlers[o]=[]);const f=this._escHandlers[o];return f.push(s),{dispose:()=>{const w=f.indexOf(s);w!==-1&&f.splice(w,1)}}}clearEscHandler(l){this._escHandlers[this._identifier(l,[48,126])]&&delete this._escHandlers[this._identifier(l,[48,126])]}setEscHandlerFallback(l){this._escHandlerFb=l}setExecuteHandler(l,s){this._executeHandlers[l.charCodeAt(0)]=s}clearExecuteHandler(l){this._executeHandlers[l.charCodeAt(0)]&&delete this._executeHandlers[l.charCodeAt(0)]}setExecuteHandlerFallback(l){this._executeHandlerFb=l}registerCsiHandler(l,s){const o=this._identifier(l);this._csiHandlers[o]===void 0&&(this._csiHandlers[o]=[]);const f=this._csiHandlers[o];return f.push(s),{dispose:()=>{const w=f.indexOf(s);w!==-1&&f.splice(w,1)}}}clearCsiHandler(l){this._csiHandlers[this._identifier(l)]&&delete this._csiHandlers[this._identifier(l)]}setCsiHandlerFallback(l){this._csiHandlerFb=l}registerDcsHandler(l,s){return this._dcsParser.registerHandler(this._identifier(l),s)}clearDcsHandler(l){this._dcsParser.clearHandler(this._identifier(l))}setDcsHandlerFallback(l){this._dcsParser.setHandlerFallback(l)}registerOscHandler(l,s){return this._oscParser.registerHandler(l,s)}clearOscHandler(l){this._oscParser.clearHandler(l)}setOscHandlerFallback(l){this._oscParser.setHandlerFallback(l)}setErrorHandler(l){this._errorHandler=l}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(l,s,o,f,w){this._parseStack.state=l,this._parseStack.handlers=s,this._parseStack.handlerPos=o,this._parseStack.transition=f,this._parseStack.chunkPos=w}parse(l,s,o){let f,w=0,y=0,b=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,b=this._parseStack.chunkPos+1;else{if(o===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const v=this._parseStack.handlers;let R=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(o===!1&&R>-1){for(;R>=0&&(f=v[R](this._params),f!==!0);R--)if(f instanceof Promise)return this._parseStack.handlerPos=R,f}this._parseStack.handlers=[];break;case 4:if(o===!1&&R>-1){for(;R>=0&&(f=v[R](),f!==!0);R--)if(f instanceof Promise)return this._parseStack.handlerPos=R,f}this._parseStack.handlers=[];break;case 6:if(w=l[this._parseStack.chunkPos],f=this._dcsParser.unhook(w!==24&&w!==26,o),f)return f;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(w=l[this._parseStack.chunkPos],f=this._oscParser.end(w!==24&&w!==26,o),f)return f;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,b=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let v=b;v<s;++v){switch(w=l[v],y=this._transitions.table[this.currentState<<8|(w<160?w:x)],y>>4){case 2:for(let M=v+1;;++M){if(M>=s||(w=l[M])<32||w>126&&w<x){this._printHandler(l,v,M),v=M-1;break}if(++M>=s||(w=l[M])<32||w>126&&w<x){this._printHandler(l,v,M),v=M-1;break}if(++M>=s||(w=l[M])<32||w>126&&w<x){this._printHandler(l,v,M),v=M-1;break}if(++M>=s||(w=l[M])<32||w>126&&w<x){this._printHandler(l,v,M),v=M-1;break}}break;case 3:this._executeHandlers[w]?this._executeHandlers[w]():this._executeHandlerFb(w),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:v,code:w,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const R=this._csiHandlers[this._collect<<8|w];let N=R?R.length-1:-1;for(;N>=0&&(f=R[N](this._params),f!==!0);N--)if(f instanceof Promise)return this._preserveStack(3,R,N,y,v),f;N<0&&this._csiHandlerFb(this._collect<<8|w,this._params),this.precedingJoinState=0;break;case 8:do switch(w){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(w-48)}while(++v<s&&(w=l[v])>47&&w<60);v--;break;case 9:this._collect<<=8,this._collect|=w;break;case 10:const j=this._escHandlers[this._collect<<8|w];let z=j?j.length-1:-1;for(;z>=0&&(f=j[z](),f!==!0);z--)if(f instanceof Promise)return this._preserveStack(4,j,z,y,v),f;z<0&&this._escHandlerFb(this._collect<<8|w),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|w,this._params);break;case 13:for(let M=v+1;;++M)if(M>=s||(w=l[M])===24||w===26||w===27||w>127&&w<x){this._dcsParser.put(l,v,M),v=M-1;break}break;case 14:if(f=this._dcsParser.unhook(w!==24&&w!==26),f)return this._preserveStack(6,[],0,y,v),f;w===27&&(y|=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 M=v+1;;M++)if(M>=s||(w=l[M])<32||w>127&&w<x){this._oscParser.put(l,v,M),v=M-1;break}break;case 6:if(f=this._oscParser.end(w!==24&&w!==26),f)return this._preserveStack(5,[],0,y,v),f;w===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&y}}}a.EscapeSequenceParser=_},6242:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const p=u(5770),m=u(482),h=[];a.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(g,S){this._handlers[g]===void 0&&(this._handlers[g]=[]);const x=this._handlers[g];return x.push(S),{dispose:()=>{const _=x.indexOf(S);_!==-1&&x.splice(_,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].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 g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,S,x){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(g,S,x);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(g,S,x))}start(){this.reset(),this._state=1}put(g,S,x){if(this._state!==3){if(this._state===1)for(;S<x;){const _=g[S++];if(_===59){this._state=2,this._start();break}if(_<48||57<_)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+_-48}this._state===2&&x-S>0&&this._put(g,S,x)}}end(g,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,_=this._active.length-1,n=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,x=S,n=this._stack.fallThrough,this._stack.paused=!1),!n&&x===!1){for(;_>=0&&(x=this._active[_].end(g),x!==!0);_--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,x;_--}for(;_>=0;_--)if(x=this._active[_].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",g);this._active=h,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,S,x){this._hitLimit||(this._data+=(0,m.utf32ToString)(g,S,x),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let S=!1;if(this._hitLimit)S=!1;else if(g&&(S=this._handler(this._data),S instanceof Promise))return S.then((x=>(this._data="",this._hitLimit=!1,x)));return this._data="",this._hitLimit=!1,S}}},8742:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const u=2147483647;class p{static fromArray(h){const g=new p;if(!h.length)return g;for(let S=Array.isArray(h[0])?1:0;S<h.length;++S){const x=h[S];if(Array.isArray(x))for(let _=0;_<x.length;++_)g.addSubParam(x[_]);else g.addParam(x)}return g}constructor(h=32,g=32){if(this.maxLength=h,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new p(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 g=0;g<this.length;++g){h.push(this.params[g]);const S=this._subParamsIdx[g]>>8,x=255&this._subParamsIdx[g];x-S>0&&h.push(Array.prototype.slice.call(this._subParams,S,x))}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>u?u: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>u?u:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const g=this._subParamsIdx[h]>>8,S=255&this._subParamsIdx[h];return S-g>0?this._subParams.subarray(g,S):null}getSubParamsAll(){const h={};for(let g=0;g<this.length;++g){const S=this._subParamsIdx[g]>>8,x=255&this._subParamsIdx[g];x-S>0&&(h[g]=this._subParams.slice(S,x))}return h}addDigit(h){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,x=S[g-1];S[g-1]=~x?Math.min(10*x+h,u):h}}a.Params=p},5741:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,p){const m={instance:p,dispose:p.dispose,isDisposed:!1};this._addons.push(m),p.dispose=()=>this._wrappedAddonDispose(m),p.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let p=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===u){p=m;break}if(p===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(p,1)}}},8771:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const p=u(3785),m=u(511);a.BufferApiView=class{constructor(h,g){this._buffer=h,this.type=g}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 g=this._buffer.lines.get(h);if(g)return new p.BufferLineApiView(g)}getNullCell(){return new m.CellData}}},3785:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const p=u(511);a.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,h){if(!(m<0||m>=this._line.length))return h?(this._line.loadCell(m,h),h):this._line.loadCell(m,new p.CellData)}translateToString(m,h,g){return this._line.translateToString(m,h,g)}}},8285:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const p=u(8771),m=u(8460),h=u(844);class g extends h.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new p.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new p.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}a.BufferNamespaceApi=g},7975:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,p){return this._core.registerCsiHandler(u,(m=>p(m.toArray())))}addCsiHandler(u,p){return this.registerCsiHandler(u,p)}registerDcsHandler(u,p){return this._core.registerDcsHandler(u,((m,h)=>p(m,h.toArray())))}addDcsHandler(u,p){return this.registerDcsHandler(u,p)}registerEscHandler(u,p){return this._core.registerEscHandler(u,p)}addEscHandler(u,p){return this.registerEscHandler(u,p)}registerOscHandler(u,p){return this._core.registerOscHandler(u,p)}addOscHandler(u,p){return this.registerOscHandler(u,p)}}},7090:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function($,a,u){var p=this&&this.__decorate||function(n,l,s,o){var f,w=arguments.length,y=w<3?l:o===null?o=Object.getOwnPropertyDescriptor(l,s):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(n,l,s,o);else for(var b=n.length-1;b>=0;b--)(f=n[b])&&(y=(w<3?f(y):w>3?f(l,s,y):f(l,s))||y);return w>3&&y&&Object.defineProperty(l,s,y),y},m=this&&this.__param||function(n,l){return function(s,o){l(s,o,n)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const h=u(8460),g=u(844),S=u(5295),x=u(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let _=a.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(n){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(n.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(n,this))}resize(n,l){this.cols=n,this.rows=l,this.buffers.resize(n,l),this._onResize.fire({cols:n,rows:l})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,l=!1){const s=this.buffer;let o;o=this._cachedBlankLine,o&&o.length===this.cols&&o.getFg(0)===n.fg&&o.getBg(0)===n.bg||(o=s.getBlankLine(n,l),this._cachedBlankLine=o),o.isWrapped=l;const f=s.ybase+s.scrollTop,w=s.ybase+s.scrollBottom;if(s.scrollTop===0){const y=s.lines.isFull;w===s.lines.length-1?y?s.lines.recycle().copyFrom(o):s.lines.push(o.clone()):s.lines.splice(w+1,0,o.clone()),y?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const y=w-f+1;s.lines.shiftElements(f+1,y-1,-1),s.lines.set(w,o.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(n,l,s){const o=this.buffer;if(n<0){if(o.ydisp===0)return;this.isUserScrolling=!0}else n+o.ydisp>=o.ybase&&(this.isUserScrolling=!1);const f=o.ydisp;o.ydisp=Math.max(Math.min(o.ydisp+n,o.ybase),0),f!==o.ydisp&&(l||this._onScroll.fire(o.ydisp))}};a.BufferService=_=p([m(0,x.IOptionsService)],_)},7994:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,p){this._charsets[u]=p,this.glevel===u&&(this.charset=p)}}},1753:function($,a,u){var p=this&&this.__decorate||function(o,f,w,y){var b,v=arguments.length,R=v<3?f:y===null?y=Object.getOwnPropertyDescriptor(f,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(o,f,w,y);else for(var N=o.length-1;N>=0;N--)(b=o[N])&&(R=(v<3?b(R):v>3?b(f,w,R):b(f,w))||R);return v>3&&R&&Object.defineProperty(f,w,R),R},m=this&&this.__param||function(o,f){return function(w,y){f(w,y,o)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const h=u(2585),g=u(8460),S=u(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:o=>o.button!==4&&o.action===1&&(o.ctrl=!1,o.alt=!1,o.shift=!1,!0)},VT200:{events:19,restrict:o=>o.action!==32},DRAG:{events:23,restrict:o=>o.action!==32||o.button!==3},ANY:{events:31,restrict:o=>!0}};function _(o,f){let w=(o.ctrl?16:0)|(o.shift?4:0)|(o.alt?8:0);return o.button===4?(w|=64,w|=o.action):(w|=3&o.button,4&o.button&&(w|=64),8&o.button&&(w|=128),o.action===32?w|=32:o.action!==0||f||(w|=3)),w}const n=String.fromCharCode,l={DEFAULT:o=>{const f=[_(o,!1)+32,o.col+32,o.row+32];return f[0]>255||f[1]>255||f[2]>255?"":`\x1B[M${n(f[0])}${n(f[1])}${n(f[2])}`},SGR:o=>{const f=o.action===0&&o.button!==4?"m":"M";return`\x1B[<${_(o,!0)};${o.col};${o.row}${f}`},SGR_PIXELS:o=>{const f=o.action===0&&o.button!==4?"m":"M";return`\x1B[<${_(o,!0)};${o.x};${o.y}${f}`}};let s=a.CoreMouseService=class extends S.Disposable{constructor(o,f){super(),this._bufferService=o,this._coreService=f,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const w of Object.keys(x))this.addProtocol(w,x[w]);for(const w of Object.keys(l))this.addEncoding(w,l[w]);this.reset()}addProtocol(o,f){this._protocols[o]=f}addEncoding(o,f){this._encodings[o]=f}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(o){if(!this._protocols[o])throw new Error(`unknown protocol "${o}"`);this._activeProtocol=o,this._onProtocolChange.fire(this._protocols[o].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(o){if(!this._encodings[o])throw new Error(`unknown encoding "${o}"`);this._activeEncoding=o}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(o){if(o.col<0||o.col>=this._bufferService.cols||o.row<0||o.row>=this._bufferService.rows||o.button===4&&o.action===32||o.button===3&&o.action!==32||o.button!==4&&(o.action===2||o.action===3)||(o.col++,o.row++,o.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,o,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(o))return!1;const f=this._encodings[this._activeEncoding](o);return f&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(f):this._coreService.triggerDataEvent(f,!0)),this._lastEvent=o,!0}explainEvents(o){return{down:!!(1&o),up:!!(2&o),drag:!!(4&o),move:!!(8&o),wheel:!!(16&o)}}_equalEvents(o,f,w){if(w){if(o.x!==f.x||o.y!==f.y)return!1}else if(o.col!==f.col||o.row!==f.row)return!1;return o.button===f.button&&o.action===f.action&&o.ctrl===f.ctrl&&o.alt===f.alt&&o.shift===f.shift}};a.CoreMouseService=s=p([m(0,h.IBufferService),m(1,h.ICoreService)],s)},6975:function($,a,u){var p=this&&this.__decorate||function(s,o,f,w){var y,b=arguments.length,v=b<3?o:w===null?w=Object.getOwnPropertyDescriptor(o,f):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(s,o,f,w);else for(var R=s.length-1;R>=0;R--)(y=s[R])&&(v=(b<3?y(v):b>3?y(o,f,v):y(o,f))||v);return b>3&&v&&Object.defineProperty(o,f,v),v},m=this&&this.__param||function(s,o){return function(f,w){o(f,w,s)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const h=u(1439),g=u(8460),S=u(844),x=u(2585),_=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let l=a.CoreService=class extends S.Disposable{constructor(s,o,f){super(),this._bufferService=s,this._logService=o,this._optionsService=f,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(_),this.decPrivateModes=(0,h.clone)(n)}reset(){this.modes=(0,h.clone)(_),this.decPrivateModes=(0,h.clone)(n)}triggerDataEvent(s,o=!1){if(this._optionsService.rawOptions.disableStdin)return;const f=this._bufferService.buffer;o&&this._optionsService.rawOptions.scrollOnUserInput&&f.ybase!==f.ydisp&&this._onRequestScrollToBottom.fire(),o&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,(()=>s.split("").map((w=>w.charCodeAt(0))))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,(()=>s.split("").map((o=>o.charCodeAt(0))))),this._onBinary.fire(s))}};a.CoreService=l=p([m(0,x.IBufferService),m(1,x.ILogService),m(2,x.IOptionsService)],l)},9074:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const p=u(8055),m=u(8460),h=u(844),g=u(6106);let S=0,x=0;class _ extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((s=>s==null?void 0:s.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(s){if(s.marker.isDisposed)return;const o=new n(s);if(o){const f=o.marker.onDispose((()=>o.dispose()));o.onDispose((()=>{o&&(this._decorations.delete(o)&&this._onDecorationRemoved.fire(o),f.dispose())})),this._decorations.insert(o),this._onDecorationRegistered.fire(o)}return o}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,o,f){let w=0,y=0;for(const b of this._decorations.getKeyIterator(o))w=b.options.x??0,y=w+(b.options.width??1),s>=w&&s<y&&(!f||(b.options.layer??"bottom")===f)&&(yield b)}forEachDecorationAtCell(s,o,f,w){this._decorations.forEachByKey(o,(y=>{S=y.options.x??0,x=S+(y.options.width??1),s>=S&&s<x&&(!f||(y.options.layer??"bottom")===f)&&w(y)}))}}a.DecorationService=_;class n extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=p.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=p.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const p=u(2585),m=u(8343);class h{constructor(...S){this._entries=new Map;for(const[x,_]of S)this.set(x,_)}set(S,x){const _=this._entries.get(S);return this._entries.set(S,x),_}forEach(S){for(const[x,_]of this._entries.entries())S(x,_)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}a.ServiceCollection=h,a.InstantiationService=class{constructor(){this._services=new h,this._services.set(p.IInstantiationService,this)}setService(g,S){this._services.set(g,S)}getService(g){return this._services.get(g)}createInstance(g,...S){const x=(0,m.getServiceDependencies)(g).sort(((l,s)=>l.index-s.index)),_=[];for(const l of x){const s=this._services.get(l.id);if(!s)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${l.id}.`);_.push(s)}const n=x.length>0?x[0].index:S.length;if(S.length!==n)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${n+1} conflicts with ${S.length} static arguments`);return new g(...S,..._)}}},7866:function($,a,u){var p=this&&this.__decorate||function(n,l,s,o){var f,w=arguments.length,y=w<3?l:o===null?o=Object.getOwnPropertyDescriptor(l,s):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(n,l,s,o);else for(var b=n.length-1;b>=0;b--)(f=n[b])&&(y=(w<3?f(y):w>3?f(l,s,y):f(l,s))||y);return w>3&&y&&Object.defineProperty(l,s,y),y},m=this&&this.__param||function(n,l){return function(s,o){l(s,o,n)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const h=u(844),g=u(2585),S={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let x,_=a.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),x=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let l=0;l<n.length;l++)typeof n[l]=="function"&&(n[l]=n[l]())}_log(n,l,s){this._evalLazyOptionalParams(s),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+l,...s)}trace(n,...l){var s;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,n,l)}debug(n,...l){var s;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,n,l)}info(n,...l){var s;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,n,l)}warn(n,...l){var s;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,n,l)}error(n,...l){var s;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,n,l)}};a.LogService=_=p([m(0,g.IOptionsService)],_),a.setTraceLogger=function(n){x=n},a.traceCall=function(n,l,s){if(typeof s.value!="function")throw new Error("not supported");const o=s.value;s.value=function(...f){if(x.logLevel!==g.LogLevelEnum.TRACE)return o.apply(this,f);x.trace(`GlyphRenderer#${o.name}(${f.map((y=>JSON.stringify(y))).join(", ")})`);const w=o.apply(this,f);return x.trace(`GlyphRenderer#${o.name} return`,w),w}}},7302:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const p=u(8460),m=u(844),h=u(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends m.Disposable{constructor(_){super(),this._onOptionChange=this.register(new p.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n={...a.DEFAULT_OPTIONS};for(const l in _)if(l in n)try{const s=_[l];n[l]=this._sanitizeAndValidateOption(l,s)}catch(s){console.error(s)}this.rawOptions=n,this.options={...n},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(_,n){return this.onOptionChange((l=>{l===_&&n(this.rawOptions[_])}))}onMultipleOptionChange(_,n){return this.onOptionChange((l=>{_.indexOf(l)!==-1&&n()}))}_setupOptions(){const _=l=>{if(!(l in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);return this.rawOptions[l]},n=(l,s)=>{if(!(l in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);s=this._sanitizeAndValidateOption(l,s),this.rawOptions[l]!==s&&(this.rawOptions[l]=s,this._onOptionChange.fire(l))};for(const l in this.rawOptions){const s={get:_.bind(this,l),set:n.bind(this,l)};Object.defineProperty(this.options,l,s)}}_sanitizeAndValidateOption(_,n){switch(_){case"cursorStyle":if(n||(n=a.DEFAULT_OPTIONS[_]),!(function(l){return l==="block"||l==="underline"||l==="bar"})(n))throw new Error(`"${n}" is not a valid value for ${_}`);break;case"wordSeparator":n||(n=a.DEFAULT_OPTIONS[_]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=g.includes(n)?n:a.DEFAULT_OPTIONS[_];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${_} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${_} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${_} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${_} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}a.OptionsService=S},2660:function($,a,u){var p=this&&this.__decorate||function(S,x,_,n){var l,s=arguments.length,o=s<3?x:n===null?n=Object.getOwnPropertyDescriptor(x,_):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(S,x,_,n);else for(var f=S.length-1;f>=0;f--)(l=S[f])&&(o=(s<3?l(o):s>3?l(x,_,o):l(x,_))||o);return s>3&&o&&Object.defineProperty(x,_,o),o},m=this&&this.__param||function(S,x){return function(_,n){x(_,n,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const h=u(2585);let g=a.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const x=this._bufferService.buffer;if(S.id===void 0){const f=x.addMarker(x.ybase+x.y),w={data:S,id:this._nextId++,lines:[f]};return f.onDispose((()=>this._removeMarkerFromLink(w,f))),this._dataByLinkId.set(w.id,w),w.id}const _=S,n=this._getEntryIdKey(_),l=this._entriesWithId.get(n);if(l)return this.addLineToLink(l.id,x.ybase+x.y),l.id;const s=x.addMarker(x.ybase+x.y),o={id:this._nextId++,key:this._getEntryIdKey(_),data:_,lines:[s]};return s.onDispose((()=>this._removeMarkerFromLink(o,s))),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(S,x){const _=this._dataByLinkId.get(S);if(_&&_.lines.every((n=>n.line!==x))){const n=this._bufferService.buffer.addMarker(x);_.lines.push(n),n.onDispose((()=>this._removeMarkerFromLink(_,n)))}}getLinkData(S){var x;return(x=this._dataByLinkId.get(S))==null?void 0:x.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,x){const _=S.lines.indexOf(x);_!==-1&&(S.lines.splice(_,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};a.OscLinkService=g=p([m(0,h.IBufferService)],g)},8343:($,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const u="di$target",p="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(m){return m[p]||[]},a.createDecorator=function(m){if(a.serviceRegistry.has(m))return a.serviceRegistry.get(m);const h=function(g,S,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,n,l){n[u]===n?n[p].push({id:_,index:l}):(n[p]=[{id:_,index:l}],n[u]=n)})(h,g,x)};return h.toString=()=>m,a.serviceRegistry.set(m,h),h}},2585:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const p=u(8343);var m;a.IBufferService=(0,p.createDecorator)("BufferService"),a.ICoreMouseService=(0,p.createDecorator)("CoreMouseService"),a.ICoreService=(0,p.createDecorator)("CoreService"),a.ICharsetService=(0,p.createDecorator)("CharsetService"),a.IInstantiationService=(0,p.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"})(m||(a.LogLevelEnum=m={})),a.ILogService=(0,p.createDecorator)("LogService"),a.IOptionsService=(0,p.createDecorator)("OptionsService"),a.IOscLinkService=(0,p.createDecorator)("OscLinkService"),a.IUnicodeService=(0,p.createDecorator)("UnicodeService"),a.IDecorationService=(0,p.createDecorator)("DecorationService")},1480:($,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const p=u(8460),m=u(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,x,_=!1){return(16777215&S)<<3|(3&x)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new p.EventEmitter,this.onChange=this._onChange.event;const S=new m.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 x=0,_=0;const n=S.length;for(let l=0;l<n;++l){let s=S.charCodeAt(l);if(55296<=s&&s<=56319){if(++l>=n)return x+this.wcwidth(s);const w=S.charCodeAt(l);56320<=w&&w<=57343?s=1024*(s-55296)+w-56320+65536:x+=this.wcwidth(w)}const o=this.charProperties(s,_);let f=h.extractWidth(o);h.extractShouldJoin(o)&&(f-=h.extractWidth(_)),x+=f,_=o}return x}charProperties(S,x){return this._activeProvider.charProperties(S,x)}}a.UnicodeService=h}},V={};function K($){var a=V[$];if(a!==void 0)return a.exports;var u=V[$]={exports:{}};return A[$].call(u.exports,u,u.exports,K),u.exports}var Z={};return(()=>{var $=Z;Object.defineProperty($,"__esModule",{value:!0}),$.Terminal=void 0;const a=K(9042),u=K(3236),p=K(844),m=K(5741),h=K(8285),g=K(7975),S=K(7090),x=["cols","rows"];class _ extends p.Disposable{constructor(l){super(),this._core=this.register(new u.Terminal(l)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const s=f=>this._core.options[f],o=(f,w)=>{this._checkReadonlyOptions(f),this._core.options[f]=w};for(const f in this._core.options){const w={get:s.bind(this,f),set:o.bind(this,f)};Object.defineProperty(this._publicOptions,f,w)}}_checkReadonlyOptions(l){if(x.includes(l))throw new Error(`Option "${l}" 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 g.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 l=this._core.coreService.decPrivateModes;let s="none";switch(this._core.coreMouseService.activeProtocol){case"X10":s="x10";break;case"VT200":s="vt200";break;case"DRAG":s="drag";break;case"ANY":s="any"}return{applicationCursorKeysMode:l.applicationCursorKeys,applicationKeypadMode:l.applicationKeypad,bracketedPasteMode:l.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:l.origin,reverseWraparoundMode:l.reverseWraparound,sendFocusMode:l.sendFocus,wraparoundMode:l.wraparound}}get options(){return this._publicOptions}set options(l){for(const s in l)this._publicOptions[s]=l[s]}blur(){this._core.blur()}focus(){this._core.focus()}input(l,s=!0){this._core.input(l,s)}resize(l,s){this._verifyIntegers(l,s),this._core.resize(l,s)}open(l){this._core.open(l)}attachCustomKeyEventHandler(l){this._core.attachCustomKeyEventHandler(l)}attachCustomWheelEventHandler(l){this._core.attachCustomWheelEventHandler(l)}registerLinkProvider(l){return this._core.registerLinkProvider(l)}registerCharacterJoiner(l){return this._checkProposedApi(),this._core.registerCharacterJoiner(l)}deregisterCharacterJoiner(l){this._checkProposedApi(),this._core.deregisterCharacterJoiner(l)}registerMarker(l=0){return this._verifyIntegers(l),this._core.registerMarker(l)}registerDecoration(l){return this._checkProposedApi(),this._verifyPositiveIntegers(l.x??0,l.width??0,l.height??0),this._core.registerDecoration(l)}hasSelection(){return this._core.hasSelection()}select(l,s,o){this._verifyIntegers(l,s,o),this._core.select(l,s,o)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(l,s){this._verifyIntegers(l,s),this._core.selectLines(l,s)}dispose(){super.dispose()}scrollLines(l){this._verifyIntegers(l),this._core.scrollLines(l)}scrollPages(l){this._verifyIntegers(l),this._core.scrollPages(l)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(l){this._verifyIntegers(l),this._core.scrollToLine(l)}clear(){this._core.clear()}write(l,s){this._core.write(l,s)}writeln(l,s){this._core.write(l),this._core.write(`\r
48
+ `,s)}paste(l){this._core.paste(l)}refresh(l,s){this._verifyIntegers(l,s),this._core.refresh(l,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(l){this._addonManager.loadAddon(this,l)}static get strings(){return a}_verifyIntegers(...l){for(const s of l)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...l){for(const s of l)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}$.Terminal=_})(),Z})()))})(Qo)),Qo.exports}var of=nf(),Yo={exports:{}},ru;function lf(){return ru||(ru=1,(function(B,I){(function(A,V){B.exports=V()})(self,(()=>(()=>{var A={};return(()=>{var V=A;Object.defineProperty(V,"__esModule",{value:!0}),V.FitAddon=void 0,V.FitAddon=class{activate(K){this._terminal=K}dispose(){}fit(){const K=this.proposeDimensions();if(!K||!this._terminal||isNaN(K.cols)||isNaN(K.rows))return;const Z=this._terminal._core;this._terminal.rows===K.rows&&this._terminal.cols===K.cols||(Z._renderService.clear(),this._terminal.resize(K.cols,K.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const K=this._terminal._core,Z=K._renderService.dimensions;if(Z.css.cell.width===0||Z.css.cell.height===0)return;const $=this._terminal.options.scrollback===0?0:K.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(a.getPropertyValue("height")),p=Math.max(0,parseInt(a.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),h=u-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),g=p-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-$;return{cols:Math.max(2,Math.floor(g/Z.css.cell.width)),rows:Math.max(1,Math.floor(h/Z.css.cell.height))}}}})(),A})()))})(Yo)),Yo.exports}var af=lf();function cf({cwd:B,cmd:I,governed:A=!0}){const V=ye.useRef(null),K=ye.useRef({cwd:B,cmd:I,governed:A});return K.current={cwd:B,cmd:I,governed:A},ye.useEffect(()=>{const Z=V.current;if(!Z)return;let $=!1,a,u;const p=new of.Terminal({convertEol:!1,cursorBlink:!0,fontSize:12,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",theme:{background:"#111827",foreground:"#e5e7eb"}}),m=new af.FitAddon;p.loadAddon(m),p.open(Z);try{m.fit()}catch{}const h=p.onData(S=>{a&&a.readyState===WebSocket.OPEN&&a.send(S)});(async()=>{const S=K.current;let x;try{const n={cwd:S.cwd,cols:p.cols,rows:p.rows,governed:S.governed};S.cmd!==void 0&&(n.cmd=S.cmd),x=(await Ke.openTerminal(n)).id}catch(n){const l=n instanceof Error?n.message:String(n);p.write(`\r
49
+ \x1B[31m[failed to open terminal: ${l}]\x1B[0m\r
50
+ `);return}if($){Ke.closeTerminal(x).catch(()=>{});return}u=x;const _=new WebSocket(bd(x));_.binaryType="arraybuffer",_.onmessage=n=>{typeof n.data=="string"?p.write(n.data):p.write(new Uint8Array(n.data))},a=_})();const g=typeof ResizeObserver<"u"?new ResizeObserver(()=>{try{m.fit()}catch{}u&&Ke.resizeTerminal(u,p.cols,p.rows).catch(()=>{})}):void 0;return g==null||g.observe(Z),()=>{$=!0,g==null||g.disconnect(),h.dispose();try{a==null||a.close()}catch{}u&&Ke.closeTerminal(u).catch(()=>{}),p.dispose()}},[]),T.jsxs("div",{"data-testid":"terminal",className:"flex flex-col gap-1",children:[T.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[T.jsx("span",{className:"font-semibold text-gray-500",children:"Terminal"}),T.jsx("span",{"data-testid":"terminal-governed",className:A?"text-gray-400":"font-semibold text-amber-600",children:A?"governed":"ungoverned operator shell"})]}),T.jsx("div",{ref:V,"data-testid":"terminal-host",className:"h-64 w-full overflow-hidden rounded bg-gray-900 p-1"})]})}const uf=new Set(["completed","cancelled","failed"]);function hf(B){return B==="none"?"none":B==="all"?"every unit":`before #${B.before}`}function df({view:B,onRefresh:I}){const{session:A}=B,V=Md(A.id,B),K=_r(n=>n.gates[A.id]),Z=Js(n=>n.logs[A.id])??[],[$,a]=ye.useState(!1),[u,p]=ye.useState(!1),[m,h]=ye.useState(!1),g=iu[A.status]??{label:A.status,className:"text-gray-500"},x=!uf.has(A.status)&&A.status!=="awaiting_human";async function _(){a(!0);try{await Ke.resumeRun(A.id),I()}finally{a(!1)}}return T.jsxs("div",{className:"flex flex-col gap-4","data-testid":"run-detail","data-run-id":A.id,children:[T.jsxs("header",{children:[T.jsxs("div",{className:"flex items-start justify-between gap-3",children:[T.jsx("h2",{className:"text-base font-semibold",children:A.problem}),T.jsx("span",{className:`text-sm font-medium shrink-0 ${g.className}`,children:g.label})]}),T.jsxs("div",{className:"mt-1 flex flex-wrap gap-x-4 gap-y-0.5 text-[11px] text-gray-400",children:[T.jsx("span",{className:"font-mono",children:A.id}),T.jsxs("span",{children:["gate: ",hf(A.human_confirm)]}),T.jsxs("span",{children:["entity: ",A.entity_mode]}),A.repo_ref&&T.jsxs("span",{children:["repo: ",A.repo_ref]}),T.jsxs("span",{children:["cursor: unit #",A.unit_ix]})]})]}),T.jsx(Ud,{view:B,log:Z}),T.jsxs("div",{className:"grid grid-cols-1 gap-6 xl:grid-cols-[minmax(0,1fr)_22rem]",children:[T.jsxs("div",{className:"flex min-w-0 flex-col gap-4","data-testid":"cockpit-center",children:[V?T.jsx($d,{model:V}):T.jsx("p",{className:"text-xs text-gray-400",children:"Loading run…"}),A.status==="awaiting_human"&&T.jsx(Od,{runId:A.id,...K?{ord:K.ord,prompt:K.prompt}:{},onResolved:I}),x&&T.jsx("button",{type:"button","data-testid":"run-resume",onClick:()=>void _(),disabled:$,className:"self-start rounded border border-gray-300 px-3 py-1 text-xs text-gray-600 hover:bg-gray-50 disabled:opacity-50",children:$?"Resuming…":"Resume from cursor"}),T.jsxs("section",{children:[T.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-gray-400 mb-1",children:"Work units"}),T.jsx(Hd,{runId:A.id,units:B.units,onResolved:I,...K?{gateOrd:K.ord}:{}})]}),T.jsx(Fd,{runId:A.id}),T.jsxs("section",{"data-testid":"terminal-section",children:[T.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-gray-400 mb-1",children:"Terminal"}),u?T.jsxs("div",{className:"flex flex-col gap-2",children:[T.jsx(cf,{cwd:A.workdir??".",governed:!m},`${A.id}:${m?"ungoverned":"governed"}`),T.jsx("button",{type:"button","data-testid":"terminal-close",onClick:()=>p(!1),className:"self-start rounded border border-gray-300 px-3 py-1 text-xs text-gray-600 hover:bg-gray-50",children:"Close terminal"})]}):T.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[T.jsx("button",{type:"button","data-testid":"terminal-open",onClick:()=>p(!0),className:"rounded border border-gray-300 px-3 py-1 text-xs text-gray-600 hover:bg-gray-50",children:"Open terminal"}),T.jsxs("label",{className:"flex items-center gap-1.5 text-[11px] text-gray-500",children:[T.jsx("input",{type:"checkbox","data-testid":"terminal-ungoverned",checked:m,onChange:n=>h(n.target.checked)}),T.jsx("span",{className:m?"font-semibold text-amber-600":"",children:"ungoverned operator shell (bypasses the gate-hook)"})]})]})]})]}),T.jsxs("aside",{className:"min-w-0","data-testid":"cockpit-rail",children:[T.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-gray-400 mb-2",children:"Insight"}),V?T.jsx(sf,{model:V}):T.jsx("p",{className:"text-xs text-gray-400",children:"Loading insight…"})]})]})]})}function ff({onLaunched:B,onCancel:I}){const[A,V]=ye.useState(""),[K,Z]=ye.useState([]),[$,a]=ye.useState(new Set),[u,p]=ye.useState([]),[m,h]=ye.useState(""),[g,S]=ye.useState("shared"),[x,_]=ye.useState("none"),[n,l]=ye.useState(1),[s,o]=ye.useState(!1),[f,w]=ye.useState(""),[y,b]=ye.useState(""),[v,R]=ye.useState(null),[N,j]=ye.useState(!1),[z,M]=ye.useState(null);ye.useEffect(()=>{Ke.getRoster().then(({roster:F})=>{Z(F),a(new Set(F.filter(C=>C.enabled_for_council).map(C=>C.key)))}).catch(()=>M("Could not load the council roster.")),Ke.listRepos().then(({repos:F})=>p(F)).catch(()=>{})},[]);function Q(F){a(C=>{const D=new Set(C);return D.has(F)?D.delete(F):D.add(F),D})}async function te(){if(!(!f.trim()||!y.trim())){R(null);try{const{repo:F}=await Ke.registerRepo(f.trim(),y.trim());p(C=>[...C,F]),h(F.id),o(!1),w(""),b("")}catch(F){R(F instanceof Error?F.message:String(F))}}}async function ne(){if(!A.trim()||$.size===0)return;j(!0),M(null);const F={problem:A.trim()},C=K.filter(D=>$.has(D.key));C.length>0&&(F.clisJson=JSON.stringify(C)),F.entityMode=g,x==="all"?F.humanConfirm="all":x==="before"&&(F.humanConfirm=`before:${n}`),m&&(F.repoRef=m);try{const{runId:D}=await Ke.launchRun(F);B(D)}catch(D){M(D instanceof Error?D.message:String(D))}finally{j(!1)}}const le=A.trim().length>0&&$.size>0&&!N;return T.jsxs("div",{className:"rounded-lg border bg-white p-4 shadow-sm","data-testid":"launch-form",children:[T.jsxs("div",{className:"flex items-center justify-between mb-3",children:[T.jsx("p",{className:"font-semibold text-sm",children:"Launch a run"}),T.jsx("button",{type:"button",onClick:I,className:"text-xs text-gray-400 hover:text-gray-600",children:"Cancel"})]}),T.jsx("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Brief"}),T.jsx("textarea",{"data-testid":"launch-problem",className:"w-full rounded border p-2 text-xs mb-1 resize-none",rows:3,placeholder:"Describe the problem — decomposed into ordered work units.",value:A,onChange:F=>V(F.target.value)}),T.jsxs("div",{className:"mb-3",children:[T.jsx("input",{"data-testid":"launch-recall",disabled:!0,placeholder:"Memory / knowledge recall on the brief",className:"w-full rounded border border-dashed bg-gray-50 p-2 text-xs text-gray-400"}),T.jsx("p",{className:"text-[10px] text-gray-400 mt-0.5",children:"Recall is disabled — pending the core-ts memory/knowledge binding (DES-STUDIO-001 §4.4)."})]}),T.jsx("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Council roster"}),T.jsx("div",{className:"mb-3 flex flex-col gap-1 max-h-40 overflow-auto rounded border p-2","data-testid":"launch-roster",children:K.length===0?T.jsx("span",{className:"text-xs text-gray-400",children:"No roster loaded."}):K.map(F=>T.jsxs("label",{className:"flex items-center gap-2 text-xs",children:[T.jsx("input",{type:"checkbox",checked:$.has(F.key),onChange:()=>Q(F.key),"data-testid":`launch-seat-${F.key}`}),T.jsx("span",{children:F.display_name}),T.jsx("span",{className:"font-mono text-gray-400",children:F.key})]},F.key))}),T.jsx("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Target repo"}),T.jsxs("div",{className:"mb-3",children:[T.jsxs("select",{"data-testid":"launch-repo",className:"w-full rounded border p-2 text-xs",value:m,onChange:F=>h(F.target.value),children:[T.jsx("option",{value:"",children:"(repo-less run)"}),u.map(F=>T.jsxs("option",{value:F.id,children:[F.name," — ",F.root_path]},F.id))]}),T.jsx("button",{type:"button",onClick:()=>o(F=>!F),className:"text-[11px] text-blue-600 hover:underline mt-1",children:s?"Close":"Register a repo"}),s&&T.jsxs("div",{className:"mt-1 flex flex-col gap-1",children:[T.jsx("input",{"data-testid":"launch-repo-name",className:"rounded border p-1.5 text-xs",placeholder:"Repo name",value:f,onChange:F=>w(F.target.value)}),T.jsx("input",{"data-testid":"launch-repo-path",className:"rounded border p-1.5 text-xs",placeholder:"Absolute path to a git repo (>=1 commit)",value:y,onChange:F=>b(F.target.value)}),v&&T.jsx("p",{className:"text-[11px] text-red-600",children:v}),T.jsx("button",{type:"button",onClick:()=>void te(),className:"self-start rounded bg-blue-600 px-2 py-1 text-[11px] text-white hover:bg-blue-700",children:"Register"})]})]}),T.jsxs("div",{className:"mb-3 grid grid-cols-2 gap-3",children:[T.jsxs("div",{children:[T.jsx("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Human-confirm gate"}),T.jsxs("select",{"data-testid":"launch-confirm",className:"w-full rounded border p-2 text-xs",value:x,onChange:F=>_(F.target.value),children:[T.jsx("option",{value:"none",children:"None"}),T.jsx("option",{value:"all",children:"Before every unit"}),T.jsx("option",{value:"before",children:"Before unit…"})]}),x==="before"&&T.jsx("input",{"data-testid":"launch-confirm-ord",type:"number",min:1,className:"mt-1 w-full rounded border p-1.5 text-xs",value:n,onChange:F=>l(Math.max(1,Number(F.target.value)||1))})]}),T.jsxs("div",{children:[T.jsx("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Entity mode"}),T.jsxs("select",{"data-testid":"launch-entity",className:"w-full rounded border p-2 text-xs",value:g,onChange:F=>S(F.target.value),children:[T.jsx("option",{value:"shared",children:"Shared"}),T.jsx("option",{value:"isolated",children:"Isolated (worktree)"})]})]})]}),z&&T.jsx("p",{className:"text-xs text-red-600 mb-2","data-testid":"launch-error",children:z}),T.jsx("button",{type:"button","data-testid":"launch-submit",onClick:()=>void ne(),disabled:!le,className:"w-full rounded bg-blue-600 px-3 py-2 text-xs font-semibold text-white hover:bg-blue-700 disabled:opacity-50",children:N?"Launching…":"Launch run"})]})}function pf(B){const I=Zs(K=>K.setStatus),A=ye.useRef(B);A.current=B;const V=ye.useCallback(()=>{const K=new WebSocket(`${nu()}/ws`);K.onopen=()=>I("connected"),K.onmessage=Z=>{try{const $=JSON.parse(String(Z.data));$!==null&&typeof $=="object"&&typeof $.type=="string"&&A.current($)}catch{}},K.onclose=()=>{I("disconnected"),setTimeout(V,3e3)},K.onerror=()=>{I("disconnected"),K.close()}},[I]);ye.useEffect(()=>{V()},[V])}function _f(){const B=Zs(u=>u.status),I=_r(u=>u.setGate),A=_r(u=>u.reconcile),[V,K]=ye.useState([]),[Z,$]=ye.useState(0),a=ye.useCallback(()=>$(u=>u+1),[]);return ye.useEffect(()=>{if(B!=="connected")return;let u=!1;return(async()=>{let p;try{({runs:p}=await Ke.listRuns())}catch{return}if(u)return;K(p);const m=p.filter(h=>h.session.status==="awaiting_human").map(h=>h.session.id);A(m);for(const h of m)if(!_r.getState().gates[h])try{const g=await Ke.getGate(h);if(u)return;I({runId:g.runId,ord:g.ord,prompt:g.prompt,lifecycle:g.lifecycle,receivedAt:Date.parse(g.receivedAt)||Date.now()})}catch{}})(),()=>{u=!0}},[B,Z,I,A]),{runs:V,refresh:a}}const gf=new Set(["sessionStarted","unitPlanned","unitDistributed","unitExecuting","gateDecided","unitDone","unitDenied","awaitingHuman","resumed","runCancelled","sessionFailed","sessionCompleted"]);function vf(){const{runs:B,refresh:I}=_f(),A=_r(S=>S.ingest),V=Js(S=>S.ingest),K=Jo(S=>S.ingest),[Z,$]=ye.useState(null),[a,u]=ye.useState(!1),p=ye.useCallback(S=>{A(S),V(S),K(S),gf.has(S.type)&&I()},[A,V,K,I]);pf(p);const m=ye.useCallback(S=>{$(S),u(!1)},[]),h=ye.useCallback(S=>{$(S),u(!1),I()},[I]),g=B.find(S=>S.session.id===Z)??null;return T.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col",children:[T.jsxs("header",{className:"h-12 flex items-center justify-between px-4 bg-white border-b shadow-sm",children:[T.jsx("span",{className:"font-bold text-sm tracking-tight",children:"wicked-studio"}),T.jsx(Sd,{})]}),T.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[T.jsxs("aside",{className:"w-80 border-r bg-white overflow-y-auto flex flex-col",children:[T.jsxs("div",{className:"flex items-center justify-between px-4 pt-4 pb-2",children:[T.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-gray-400",children:"Runs"}),T.jsx("button",{type:"button","data-testid":"new-run",onClick:()=>{u(!0),$(null)},className:"rounded bg-blue-600 px-2 py-1 text-[11px] font-semibold text-white hover:bg-blue-700",children:"New run"})]}),T.jsx(Cd,{runs:B,selectedRunId:Z,onSelect:m})]}),T.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:a?T.jsx(ff,{onLaunched:h,onCancel:()=>u(!1)}):g?T.jsx(df,{view:g,onRefresh:I},g.session.id):T.jsx("p",{className:"text-sm text-gray-400",children:"Select a run, or launch a new one."})})]}),T.jsx(yd,{onSelect:m})]})}const cu=document.getElementById("root");if(!cu)throw new Error("Root element not found");pd.createRoot(cu).render(T.jsx(ye.StrictMode,{children:T.jsx(vf,{})}));