@unlikeotherai/unloved 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
var ig=e=>{throw TypeError(e)};var sg=(e,i,n)=>i.has(e)||ig("Cannot "+n);var al=(e,i,n)=>(sg(e,i,"read from private field"),n?n.call(e):i.get(e)),rg=(e,i,n)=>i.has(e)?ig("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,n),ng=(e,i,n,l)=>(sg(e,i,"write to private field"),l?l.call(e,n):i.set(e,n),n);(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function n(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function l(o){if(o.ep)return;o.ep=!0;const c=n(o);fetch(o.href,c)}})();function py(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Oc={exports:{}},ol={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and 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 lg;function my(){if(lg)return ol;lg=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function n(l,o,c){var d=null;if(c!==void 0&&(d=""+c),o.key!==void 0&&(d=""+o.key),"key"in o){c={};for(var _ in o)_!=="key"&&(c[_]=o[_])}else c=o;return o=c.ref,{$$typeof:e,type:l,key:d,ref:o!==void 0?o:null,props:c}}return ol.Fragment=i,ol.jsx=n,ol.jsxs=n,ol}var ag;function Sy(){return ag||(ag=1,Oc.exports=my()),Oc.exports}var O=Sy(),Lc={exports:{}},hl={},Nc={exports:{}},Hc={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* scheduler.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and 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 og;function yy(){return og||(og=1,(function(e){function i(k,P){var U=k.length;k.push(P);e:for(;0<U;){var oe=U-1>>>1,w=k[oe];if(0<o(w,P))k[oe]=P,k[U]=w,U=oe;else break e}}function n(k){return k.length===0?null:k[0]}function l(k){if(k.length===0)return null;var P=k[0],U=k.pop();if(U!==P){k[0]=U;e:for(var oe=0,w=k.length,W=w>>>1;oe<W;){var J=2*(oe+1)-1,I=k[J],se=J+1,ve=k[se];if(0>o(I,U))se<w&&0>o(ve,I)?(k[oe]=ve,k[se]=U,oe=se):(k[oe]=I,k[J]=U,oe=J);else if(se<w&&0>o(ve,U))k[oe]=ve,k[se]=U,oe=se;else break e}}return P}function o(k,P){var U=k.sortIndex-P.sortIndex;return U!==0?U:k.id-P.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,_=d.now();e.unstable_now=function(){return d.now()-_}}var v=[],f=[],m=1,S=null,y=3,M=!1,C=!1,E=!1,B=!1,L=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function q(k){for(var P=n(f);P!==null;){if(P.callback===null)l(f);else if(P.startTime<=k)l(f),P.sortIndex=P.expirationTime,i(v,P);else break;P=n(f)}}function N(k){if(E=!1,q(k),!C)if(n(v)!==null)C=!0,ee||(ee=!0,X());else{var P=n(f);P!==null&&$(N,P.startTime-k)}}var ee=!1,le=-1,_e=5,Te=-1;function Qe(){return B?!0:!(e.unstable_now()-Te<_e)}function ie(){if(B=!1,ee){var k=e.unstable_now();Te=k;var P=!0;try{e:{C=!1,E&&(E=!1,Q(le),le=-1),M=!0;var U=y;try{t:{for(q(k),S=n(v);S!==null&&!(S.expirationTime>k&&Qe());){var oe=S.callback;if(typeof oe=="function"){S.callback=null,y=S.priorityLevel;var w=oe(S.expirationTime<=k);if(k=e.unstable_now(),typeof w=="function"){S.callback=w,q(k),P=!0;break t}S===n(v)&&l(v),q(k)}else l(v);S=n(v)}if(S!==null)P=!0;else{var W=n(f);W!==null&&$(N,W.startTime-k),P=!1}}break e}finally{S=null,y=U,M=!1}P=void 0}}finally{P?X():ee=!1}}}var X;if(typeof G=="function")X=function(){G(ie)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,F=H.port2;H.port1.onmessage=ie,X=function(){F.postMessage(null)}}else X=function(){L(ie,0)};function $(k,P){le=L(function(){k(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(k){k.callback=null},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_e=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(k){switch(y){case 1:case 2:case 3:var P=3;break;default:P=y}var U=y;y=P;try{return k()}finally{y=U}},e.unstable_requestPaint=function(){B=!0},e.unstable_runWithPriority=function(k,P){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var U=y;y=k;try{return P()}finally{y=U}},e.unstable_scheduleCallback=function(k,P,U){var oe=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?oe+U:oe):U=oe,k){case 1:var w=-1;break;case 2:w=250;break;case 5:w=1073741823;break;case 4:w=1e4;break;default:w=5e3}return w=U+w,k={id:m++,callback:P,priorityLevel:k,startTime:U,expirationTime:w,sortIndex:-1},U>oe?(k.sortIndex=U,i(f,k),n(v)===null&&k===n(f)&&(E?(Q(le),le=-1):E=!0,$(N,U-oe))):(k.sortIndex=w,i(v,k),C||M||(C=!0,ee||(ee=!0,X()))),k},e.unstable_shouldYield=Qe,e.unstable_wrapCallback=function(k){var P=y;return function(){var U=y;y=P;try{return k.apply(this,arguments)}finally{y=U}}}})(Hc)),Hc}var hg;function by(){return hg||(hg=1,Nc.exports=yy()),Nc.exports}var Uc={exports:{}},ge={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* react.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and 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 cg;function wy(){if(cg)return ge;cg=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),S=Symbol.iterator;function y(w){return w===null||typeof w!="object"?null:(w=S&&w[S]||w["@@iterator"],typeof w=="function"?w:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,E={};function B(w,W,J){this.props=w,this.context=W,this.refs=E,this.updater=J||M}B.prototype.isReactComponent={},B.prototype.setState=function(w,W){if(typeof w!="object"&&typeof w!="function"&&w!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,w,W,"setState")},B.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function L(){}L.prototype=B.prototype;function Q(w,W,J){this.props=w,this.context=W,this.refs=E,this.updater=J||M}var G=Q.prototype=new L;G.constructor=Q,C(G,B.prototype),G.isPureReactComponent=!0;var q=Array.isArray,N={H:null,A:null,T:null,S:null,V:null},ee=Object.prototype.hasOwnProperty;function le(w,W,J,I,se,ve){return J=ve.ref,{$$typeof:e,type:w,key:W,ref:J!==void 0?J:null,props:ve}}function _e(w,W){return le(w.type,W,void 0,void 0,void 0,w.props)}function Te(w){return typeof w=="object"&&w!==null&&w.$$typeof===e}function Qe(w){var W={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(J){return W[J]})}var ie=/\/+/g;function X(w,W){return typeof w=="object"&&w!==null&&w.key!=null?Qe(""+w.key):W.toString(36)}function H(){}function F(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(H,H):(w.status="pending",w.then(function(W){w.status==="pending"&&(w.status="fulfilled",w.value=W)},function(W){w.status==="pending"&&(w.status="rejected",w.reason=W)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function $(w,W,J,I,se){var ve=typeof w;(ve==="undefined"||ve==="boolean")&&(w=null);var re=!1;if(w===null)re=!0;else switch(ve){case"bigint":case"string":case"number":re=!0;break;case"object":switch(w.$$typeof){case e:case i:re=!0;break;case m:return re=w._init,$(re(w._payload),W,J,I,se)}}if(re)return se=se(w),re=I===""?"."+X(w,0):I,q(se)?(J="",re!=null&&(J=re.replace(ie,"$&/")+"/"),$(se,W,J,"",function(st){return st})):se!=null&&(Te(se)&&(se=_e(se,J+(se.key==null||w&&w.key===se.key?"":(""+se.key).replace(ie,"$&/")+"/")+re)),W.push(se)),1;re=0;var Ue=I===""?".":I+":";if(q(w))for(var Me=0;Me<w.length;Me++)I=w[Me],ve=Ue+X(I,Me),re+=$(I,W,J,ve,se);else if(Me=y(w),typeof Me=="function")for(w=Me.call(w),Me=0;!(I=w.next()).done;)I=I.value,ve=Ue+X(I,Me++),re+=$(I,W,J,ve,se);else if(ve==="object"){if(typeof w.then=="function")return $(F(w),W,J,I,se);throw W=String(w),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return re}function k(w,W,J){if(w==null)return w;var I=[],se=0;return $(w,I,"","",function(ve){return W.call(J,ve,se++)}),I}function P(w){if(w._status===-1){var W=w._result;W=W(),W.then(function(J){(w._status===0||w._status===-1)&&(w._status=1,w._result=J)},function(J){(w._status===0||w._status===-1)&&(w._status=2,w._result=J)}),w._status===-1&&(w._status=0,w._result=W)}if(w._status===1)return w._result.default;throw w._result}var U=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)};function oe(){}return ge.Children={map:k,forEach:function(w,W,J){k(w,function(){W.apply(this,arguments)},J)},count:function(w){var W=0;return k(w,function(){W++}),W},toArray:function(w){return k(w,function(W){return W})||[]},only:function(w){if(!Te(w))throw Error("React.Children.only expected to receive a single React element child.");return w}},ge.Component=B,ge.Fragment=n,ge.Profiler=o,ge.PureComponent=Q,ge.StrictMode=l,ge.Suspense=v,ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,ge.__COMPILER_RUNTIME={__proto__:null,c:function(w){return N.H.useMemoCache(w)}},ge.cache=function(w){return function(){return w.apply(null,arguments)}},ge.cloneElement=function(w,W,J){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var I=C({},w.props),se=w.key,ve=void 0;if(W!=null)for(re in W.ref!==void 0&&(ve=void 0),W.key!==void 0&&(se=""+W.key),W)!ee.call(W,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&W.ref===void 0||(I[re]=W[re]);var re=arguments.length-2;if(re===1)I.children=J;else if(1<re){for(var Ue=Array(re),Me=0;Me<re;Me++)Ue[Me]=arguments[Me+2];I.children=Ue}return le(w.type,se,void 0,void 0,ve,I)},ge.createContext=function(w){return w={$$typeof:d,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:c,_context:w},w},ge.createElement=function(w,W,J){var I,se={},ve=null;if(W!=null)for(I in W.key!==void 0&&(ve=""+W.key),W)ee.call(W,I)&&I!=="key"&&I!=="__self"&&I!=="__source"&&(se[I]=W[I]);var re=arguments.length-2;if(re===1)se.children=J;else if(1<re){for(var Ue=Array(re),Me=0;Me<re;Me++)Ue[Me]=arguments[Me+2];se.children=Ue}if(w&&w.defaultProps)for(I in re=w.defaultProps,re)se[I]===void 0&&(se[I]=re[I]);return le(w,ve,void 0,void 0,null,se)},ge.createRef=function(){return{current:null}},ge.forwardRef=function(w){return{$$typeof:_,render:w}},ge.isValidElement=Te,ge.lazy=function(w){return{$$typeof:m,_payload:{_status:-1,_result:w},_init:P}},ge.memo=function(w,W){return{$$typeof:f,type:w,compare:W===void 0?null:W}},ge.startTransition=function(w){var W=N.T,J={};N.T=J;try{var I=w(),se=N.S;se!==null&&se(J,I),typeof I=="object"&&I!==null&&typeof I.then=="function"&&I.then(oe,U)}catch(ve){U(ve)}finally{N.T=W}},ge.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},ge.use=function(w){return N.H.use(w)},ge.useActionState=function(w,W,J){return N.H.useActionState(w,W,J)},ge.useCallback=function(w,W){return N.H.useCallback(w,W)},ge.useContext=function(w){return N.H.useContext(w)},ge.useDebugValue=function(){},ge.useDeferredValue=function(w,W){return N.H.useDeferredValue(w,W)},ge.useEffect=function(w,W,J){var I=N.H;if(typeof J=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return I.useEffect(w,W)},ge.useId=function(){return N.H.useId()},ge.useImperativeHandle=function(w,W,J){return N.H.useImperativeHandle(w,W,J)},ge.useInsertionEffect=function(w,W){return N.H.useInsertionEffect(w,W)},ge.useLayoutEffect=function(w,W){return N.H.useLayoutEffect(w,W)},ge.useMemo=function(w,W){return N.H.useMemo(w,W)},ge.useOptimistic=function(w,W){return N.H.useOptimistic(w,W)},ge.useReducer=function(w,W,J){return N.H.useReducer(w,W,J)},ge.useRef=function(w){return N.H.useRef(w)},ge.useState=function(w){return N.H.useState(w)},ge.useSyncExternalStore=function(w,W,J){return N.H.useSyncExternalStore(w,W,J)},ge.useTransition=function(){return N.H.useTransition()},ge.version="19.1.0",ge}var ug;function Ku(){return ug||(ug=1,Uc.exports=wy()),Uc.exports}var Pc={exports:{}},kt={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and 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 dg;function Cy(){if(dg)return kt;dg=1;var e=Ku();function i(v){var f="https://react.dev/errors/"+v;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+v+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var l={d:{f:n,r:function(){throw Error(i(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(v,f,m){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:S==null?null:""+S,children:v,containerInfo:f,implementation:m}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function _(v,f){if(v==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,kt.createPortal=function(v,f){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(i(299));return c(v,f,null,m)},kt.flushSync=function(v){var f=d.T,m=l.p;try{if(d.T=null,l.p=2,v)return v()}finally{d.T=f,l.p=m,l.d.f()}},kt.preconnect=function(v,f){typeof v=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,l.d.C(v,f))},kt.prefetchDNS=function(v){typeof v=="string"&&l.d.D(v)},kt.preinit=function(v,f){if(typeof v=="string"&&f&&typeof f.as=="string"){var m=f.as,S=_(m,f.crossOrigin),y=typeof f.integrity=="string"?f.integrity:void 0,M=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;m==="style"?l.d.S(v,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:S,integrity:y,fetchPriority:M}):m==="script"&&l.d.X(v,{crossOrigin:S,integrity:y,fetchPriority:M,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},kt.preinitModule=function(v,f){if(typeof v=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var m=_(f.as,f.crossOrigin);l.d.M(v,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&l.d.M(v)},kt.preload=function(v,f){if(typeof v=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var m=f.as,S=_(m,f.crossOrigin);l.d.L(v,m,{crossOrigin:S,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},kt.preloadModule=function(v,f){if(typeof v=="string")if(f){var m=_(f.as,f.crossOrigin);l.d.m(v,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else l.d.m(v)},kt.requestFormReset=function(v){l.d.r(v)},kt.unstable_batchedUpdates=function(v,f){return v(f)},kt.useFormState=function(v,f,m){return d.H.useFormState(v,f,m)},kt.useFormStatus=function(){return d.H.useHostTransitionStatus()},kt.version="19.1.0",kt}var fg;function xy(){if(fg)return Pc.exports;fg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Pc.exports=Cy(),Pc.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var _g;function Ey(){if(_g)return hl;_g=1;var e=by(),i=Ku(),n=xy();function l(t){var s="https://react.dev/errors/"+t;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)s+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+t+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var s=t,r=t;if(t.alternate)for(;s.return;)s=s.return;else{t=s;do s=t,(s.flags&4098)!==0&&(r=s.return),t=s.return;while(t)}return s.tag===3?r:null}function d(t){if(t.tag===13){var s=t.memoizedState;if(s===null&&(t=t.alternate,t!==null&&(s=t.memoizedState)),s!==null)return s.dehydrated}return null}function _(t){if(c(t)!==t)throw Error(l(188))}function v(t){var s=t.alternate;if(!s){if(s=c(t),s===null)throw Error(l(188));return s!==t?null:t}for(var r=t,a=s;;){var h=r.return;if(h===null)break;var u=h.alternate;if(u===null){if(a=h.return,a!==null){r=a;continue}break}if(h.child===u.child){for(u=h.child;u;){if(u===r)return _(h),t;if(u===a)return _(h),s;u=u.sibling}throw Error(l(188))}if(r.return!==a.return)r=h,a=u;else{for(var g=!1,p=h.child;p;){if(p===r){g=!0,r=h,a=u;break}if(p===a){g=!0,a=h,r=u;break}p=p.sibling}if(!g){for(p=u.child;p;){if(p===r){g=!0,r=u,a=h;break}if(p===a){g=!0,a=u,r=h;break}p=p.sibling}if(!g)throw Error(l(189))}}if(r.alternate!==a)throw Error(l(190))}if(r.tag!==3)throw Error(l(188));return r.stateNode.current===r?t:s}function f(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t;for(t=t.child;t!==null;){if(s=f(t),s!==null)return s;t=t.sibling}return null}var m=Object.assign,S=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),Q=Symbol.for("react.consumer"),G=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),_e=Symbol.for("react.lazy"),Te=Symbol.for("react.activity"),Qe=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function X(t){return t===null||typeof t!="object"?null:(t=ie&&t[ie]||t["@@iterator"],typeof t=="function"?t:null)}var H=Symbol.for("react.client.reference");function F(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===H?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case C:return"Fragment";case B:return"Profiler";case E:return"StrictMode";case N:return"Suspense";case ee:return"SuspenseList";case Te:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case M:return"Portal";case G:return(t.displayName||"Context")+".Provider";case Q:return(t._context.displayName||"Context")+".Consumer";case q:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case le:return s=t.displayName||null,s!==null?s:F(t.type)||"Memo";case _e:s=t._payload,t=t._init;try{return F(t(s))}catch{}}return null}var $=Array.isArray,k=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},oe=[],w=-1;function W(t){return{current:t}}function J(t){0>w||(t.current=oe[w],oe[w]=null,w--)}function I(t,s){w++,oe[w]=t.current,t.current=s}var se=W(null),ve=W(null),re=W(null),Ue=W(null);function Me(t,s){switch(I(re,s),I(ve,t),I(se,null),s.nodeType){case 9:case 11:t=(t=s.documentElement)&&(t=t.namespaceURI)?Tv(t):0;break;default:if(t=s.tagName,s=s.namespaceURI)s=Tv(s),t=Av(s,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}J(se),I(se,t)}function st(){J(se),J(ve),J(re)}function Ji(t){t.memoizedState!==null&&I(Ue,t);var s=se.current,r=Av(s,t.type);s!==r&&(I(ve,t),I(se,r))}function mi(t){ve.current===t&&(J(se),J(ve)),Ue.current===t&&(J(Ue),il._currentValue=U)}var Jt=Object.prototype.hasOwnProperty,xe=e.unstable_scheduleCallback,Bs=e.unstable_cancelCallback,Fm=e.unstable_shouldYield,Im=e.unstable_requestPaint,Si=e.unstable_now,Zm=e.unstable_getCurrentPriorityLevel,hd=e.unstable_ImmediatePriority,cd=e.unstable_UserBlockingPriority,Bl=e.unstable_NormalPriority,Qm=e.unstable_LowPriority,ud=e.unstable_IdlePriority,Jm=e.log,e0=e.unstable_setDisableYieldValue,cn=null,Wt=null;function es(t){if(typeof Jm=="function"&&e0(t),Wt&&typeof Wt.setStrictMode=="function")try{Wt.setStrictMode(cn,t)}catch{}}var Yt=Math.clz32?Math.clz32:s0,t0=Math.log,i0=Math.LN2;function s0(t){return t>>>=0,t===0?32:31-(t0(t)/i0|0)|0}var zl=256,Ol=4194304;function zs(t){var s=t&42;if(s!==0)return s;switch(t&-t){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:return 64;case 128:return 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&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ll(t,s,r){var a=t.pendingLanes;if(a===0)return 0;var h=0,u=t.suspendedLanes,g=t.pingedLanes;t=t.warmLanes;var p=a&134217727;return p!==0?(a=p&~u,a!==0?h=zs(a):(g&=p,g!==0?h=zs(g):r||(r=p&~t,r!==0&&(h=zs(r))))):(p=a&~u,p!==0?h=zs(p):g!==0?h=zs(g):r||(r=a&~t,r!==0&&(h=zs(r)))),h===0?0:s!==0&&s!==h&&(s&u)===0&&(u=h&-h,r=s&-s,u>=r||u===32&&(r&4194048)!==0)?s:h}function un(t,s){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&s)===0}function r0(t,s){switch(t){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32: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 s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function dd(){var t=zl;return zl<<=1,(zl&4194048)===0&&(zl=256),t}function fd(){var t=Ol;return Ol<<=1,(Ol&62914560)===0&&(Ol=4194304),t}function Co(t){for(var s=[],r=0;31>r;r++)s.push(t);return s}function dn(t,s){t.pendingLanes|=s,s!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function n0(t,s,r,a,h,u){var g=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var p=t.entanglements,b=t.expirationTimes,T=t.hiddenUpdates;for(r=g&~r;0<r;){var j=31-Yt(r),V=1<<j;p[j]=0,b[j]=-1;var A=T[j];if(A!==null)for(T[j]=null,j=0;j<A.length;j++){var z=A[j];z!==null&&(z.lane&=-536870913)}r&=~V}a!==0&&_d(t,a,0),u!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=u&~(g&~s))}function _d(t,s,r){t.pendingLanes|=s,t.suspendedLanes&=~s;var a=31-Yt(s);t.entangledLanes|=s,t.entanglements[a]=t.entanglements[a]|1073741824|r&4194090}function vd(t,s){var r=t.entangledLanes|=s;for(t=t.entanglements;r;){var a=31-Yt(r),h=1<<a;h&s|t[a]&s&&(t[a]|=s),r&=~h}}function xo(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Eo(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function gd(){var t=P.p;return t!==0?t:(t=window.event,t===void 0?32:Iv(t.type))}function l0(t,s){var r=P.p;try{return P.p=t,s()}finally{P.p=r}}var ts=Math.random().toString(36).slice(2),xt="__reactFiber$"+ts,Lt="__reactProps$"+ts,ur="__reactContainer$"+ts,ko="__reactEvents$"+ts,a0="__reactListeners$"+ts,o0="__reactHandles$"+ts,pd="__reactResources$"+ts,fn="__reactMarker$"+ts;function Mo(t){delete t[xt],delete t[Lt],delete t[ko],delete t[a0],delete t[o0]}function dr(t){var s=t[xt];if(s)return s;for(var r=t.parentNode;r;){if(s=r[ur]||r[xt]){if(r=s.alternate,s.child!==null||r!==null&&r.child!==null)for(t=Lv(t);t!==null;){if(r=t[xt])return r;t=Lv(t)}return s}t=r,r=t.parentNode}return null}function fr(t){if(t=t[xt]||t[ur]){var s=t.tag;if(s===5||s===6||s===13||s===26||s===27||s===3)return t}return null}function _n(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t.stateNode;throw Error(l(33))}function _r(t){var s=t[pd];return s||(s=t[pd]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function ct(t){t[fn]=!0}var md=new Set,Sd={};function Os(t,s){vr(t,s),vr(t+"Capture",s)}function vr(t,s){for(Sd[t]=s,t=0;t<s.length;t++)md.add(s[t])}var h0=RegExp("^[: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]*$"),yd={},bd={};function c0(t){return Jt.call(bd,t)?!0:Jt.call(yd,t)?!1:h0.test(t)?bd[t]=!0:(yd[t]=!0,!1)}function Nl(t,s,r){if(c0(s))if(r===null)t.removeAttribute(s);else{switch(typeof r){case"undefined":case"function":case"symbol":t.removeAttribute(s);return;case"boolean":var a=s.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){t.removeAttribute(s);return}}t.setAttribute(s,""+r)}}function Hl(t,s,r){if(r===null)t.removeAttribute(s);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttribute(s,""+r)}}function zi(t,s,r,a){if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttributeNS(s,r,""+a)}}var Do,wd;function gr(t){if(Do===void 0)try{throw Error()}catch(r){var s=r.stack.trim().match(/\n( *(at )?)/);Do=s&&s[1]||"",wd=-1<r.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Do+t+wd}var Ro=!1;function To(t,s){if(!t||Ro)return"";Ro=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(s){var V=function(){throw Error()};if(Object.defineProperty(V.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(V,[])}catch(z){var A=z}Reflect.construct(t,[],V)}else{try{V.call()}catch(z){A=z}t.call(V.prototype)}}else{try{throw Error()}catch(z){A=z}(V=t())&&typeof V.catch=="function"&&V.catch(function(){})}}catch(z){if(z&&A&&typeof z.stack=="string")return[z.stack,A.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),g=u[0],p=u[1];if(g&&p){var b=g.split(`
|
|
44
|
-
`),T=p.split(`
|
|
45
|
-
`);for(h=a=0;a<b.length&&!b[a].includes("DetermineComponentFrameRoot");)a++;for(;h<T.length&&!T[h].includes("DetermineComponentFrameRoot");)h++;if(a===b.length||h===T.length)for(a=b.length-1,h=T.length-1;1<=a&&0<=h&&b[a]!==T[h];)h--;for(;1<=a&&0<=h;a--,h--)if(b[a]!==T[h]){if(a!==1||h!==1)do if(a--,h--,0>h||b[a]!==T[h]){var j=`
|
|
46
|
-
`+b[a].replace(" at new "," at ");return t.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",t.displayName)),j}while(1<=a&&0<=h);break}}}finally{Ro=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?gr(r):""}function u0(t){switch(t.tag){case 26:case 27:case 5:return gr(t.type);case 16:return gr("Lazy");case 13:return gr("Suspense");case 19:return gr("SuspenseList");case 0:case 15:return To(t.type,!1);case 11:return To(t.type.render,!1);case 1:return To(t.type,!0);case 31:return gr("Activity");default:return""}}function Cd(t){try{var s="";do s+=u0(t),t=t.return;while(t);return s}catch(r){return`
|
|
47
|
-
Error generating stack: `+r.message+`
|
|
48
|
-
`+r.stack}}function ei(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function xd(t){var s=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function d0(t){var s=xd(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,s),a=""+t[s];if(!t.hasOwnProperty(s)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var h=r.get,u=r.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return h.call(this)},set:function(g){a=""+g,u.call(this,g)}}),Object.defineProperty(t,s,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(g){a=""+g},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function Ul(t){t._valueTracker||(t._valueTracker=d0(t))}function Ed(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var r=s.getValue(),a="";return t&&(a=xd(t)?t.checked?"true":"false":t.value),t=a,t!==r?(s.setValue(t),!0):!1}function Pl(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var f0=/[\n"\\]/g;function ti(t){return t.replace(f0,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Ao(t,s,r,a,h,u,g,p){t.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?t.type=g:t.removeAttribute("type"),s!=null?g==="number"?(s===0&&t.value===""||t.value!=s)&&(t.value=""+ei(s)):t.value!==""+ei(s)&&(t.value=""+ei(s)):g!=="submit"&&g!=="reset"||t.removeAttribute("value"),s!=null?Bo(t,g,ei(s)):r!=null?Bo(t,g,ei(r)):a!=null&&t.removeAttribute("value"),h==null&&u!=null&&(t.defaultChecked=!!u),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?t.name=""+ei(p):t.removeAttribute("name")}function kd(t,s,r,a,h,u,g,p){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(t.type=u),s!=null||r!=null){if(!(u!=="submit"&&u!=="reset"||s!=null))return;r=r!=null?""+ei(r):"",s=s!=null?""+ei(s):r,p||s===t.value||(t.value=s),t.defaultValue=s}a=a??h,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=p?t.checked:!!a,t.defaultChecked=!!a,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.name=g)}function Bo(t,s,r){s==="number"&&Pl(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function pr(t,s,r,a){if(t=t.options,s){s={};for(var h=0;h<r.length;h++)s["$"+r[h]]=!0;for(r=0;r<t.length;r++)h=s.hasOwnProperty("$"+t[r].value),t[r].selected!==h&&(t[r].selected=h),h&&a&&(t[r].defaultSelected=!0)}else{for(r=""+ei(r),s=null,h=0;h<t.length;h++){if(t[h].value===r){t[h].selected=!0,a&&(t[h].defaultSelected=!0);return}s!==null||t[h].disabled||(s=t[h])}s!==null&&(s.selected=!0)}}function Md(t,s,r){if(s!=null&&(s=""+ei(s),s!==t.value&&(t.value=s),r==null)){t.defaultValue!==s&&(t.defaultValue=s);return}t.defaultValue=r!=null?""+ei(r):""}function Dd(t,s,r,a){if(s==null){if(a!=null){if(r!=null)throw Error(l(92));if($(a)){if(1<a.length)throw Error(l(93));a=a[0]}r=a}r==null&&(r=""),s=r}r=ei(s),t.defaultValue=r,a=t.textContent,a===r&&a!==""&&a!==null&&(t.value=a)}function mr(t,s){if(s){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=s;return}}t.textContent=s}var _0=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Rd(t,s,r){var a=s.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?a?t.setProperty(s,""):s==="float"?t.cssFloat="":t[s]="":a?t.setProperty(s,r):typeof r!="number"||r===0||_0.has(s)?s==="float"?t.cssFloat=r:t[s]=(""+r).trim():t[s]=r+"px"}function Td(t,s,r){if(s!=null&&typeof s!="object")throw Error(l(62));if(t=t.style,r!=null){for(var a in r)!r.hasOwnProperty(a)||s!=null&&s.hasOwnProperty(a)||(a.indexOf("--")===0?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="");for(var h in s)a=s[h],s.hasOwnProperty(h)&&r[h]!==a&&Rd(t,h,a)}else for(var u in s)s.hasOwnProperty(u)&&Rd(t,u,s[u])}function zo(t){if(t.indexOf("-")===-1)return!1;switch(t){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 v0=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),g0=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function jl(t){return g0.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var Oo=null;function Lo(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Sr=null,yr=null;function Ad(t){var s=fr(t);if(s&&(t=s.stateNode)){var r=t[Lt]||null;e:switch(t=s.stateNode,s.type){case"input":if(Ao(t,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),s=r.name,r.type==="radio"&&s!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+ti(""+s)+'"][type="radio"]'),s=0;s<r.length;s++){var a=r[s];if(a!==t&&a.form===t.form){var h=a[Lt]||null;if(!h)throw Error(l(90));Ao(a,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(s=0;s<r.length;s++)a=r[s],a.form===t.form&&Ed(a)}break e;case"textarea":Md(t,r.value,r.defaultValue);break e;case"select":s=r.value,s!=null&&pr(t,!!r.multiple,s,!1)}}}var No=!1;function Bd(t,s,r){if(No)return t(s,r);No=!0;try{var a=t(s);return a}finally{if(No=!1,(Sr!==null||yr!==null)&&(Ea(),Sr&&(s=Sr,t=yr,yr=Sr=null,Ad(s),t)))for(s=0;s<t.length;s++)Ad(t[s])}}function vn(t,s){var r=t.stateNode;if(r===null)return null;var a=r[Lt]||null;if(a===null)return null;r=a[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(t=t.type,a=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!a;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(l(231,s,typeof r));return r}var Oi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ho=!1;if(Oi)try{var gn={};Object.defineProperty(gn,"passive",{get:function(){Ho=!0}}),window.addEventListener("test",gn,gn),window.removeEventListener("test",gn,gn)}catch{Ho=!1}var is=null,Uo=null,ql=null;function zd(){if(ql)return ql;var t,s=Uo,r=s.length,a,h="value"in is?is.value:is.textContent,u=h.length;for(t=0;t<r&&s[t]===h[t];t++);var g=r-t;for(a=1;a<=g&&s[r-a]===h[u-a];a++);return ql=h.slice(t,1<a?1-a:void 0)}function Wl(t){var s=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&s===13&&(t=13)):t=s,t===10&&(t=13),32<=t||t===13?t:0}function Yl(){return!0}function Od(){return!1}function Nt(t){function s(r,a,h,u,g){this._reactName=r,this._targetInst=h,this.type=a,this.nativeEvent=u,this.target=g,this.currentTarget=null;for(var p in t)t.hasOwnProperty(p)&&(r=t[p],this[p]=r?r(u):u[p]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?Yl:Od,this.isPropagationStopped=Od,this}return m(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Yl)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Yl)},persist:function(){},isPersistent:Yl}),s}var Ls={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Kl=Nt(Ls),pn=m({},Ls,{view:0,detail:0}),p0=Nt(pn),Po,jo,mn,Vl=m({},pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wo,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==mn&&(mn&&t.type==="mousemove"?(Po=t.screenX-mn.screenX,jo=t.screenY-mn.screenY):jo=Po=0,mn=t),Po)},movementY:function(t){return"movementY"in t?t.movementY:jo}}),Ld=Nt(Vl),m0=m({},Vl,{dataTransfer:0}),S0=Nt(m0),y0=m({},pn,{relatedTarget:0}),qo=Nt(y0),b0=m({},Ls,{animationName:0,elapsedTime:0,pseudoElement:0}),w0=Nt(b0),C0=m({},Ls,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),x0=Nt(C0),E0=m({},Ls,{data:0}),Nd=Nt(E0),k0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},M0={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"},D0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function R0(t){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(t):(t=D0[t])?!!s[t]:!1}function Wo(){return R0}var T0=m({},pn,{key:function(t){if(t.key){var s=k0[t.key]||t.key;if(s!=="Unidentified")return s}return t.type==="keypress"?(t=Wl(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?M0[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wo,charCode:function(t){return t.type==="keypress"?Wl(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Wl(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),A0=Nt(T0),B0=m({},Vl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hd=Nt(B0),z0=m({},pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wo}),O0=Nt(z0),L0=m({},Ls,{propertyName:0,elapsedTime:0,pseudoElement:0}),N0=Nt(L0),H0=m({},Vl,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),U0=Nt(H0),P0=m({},Ls,{newState:0,oldState:0}),j0=Nt(P0),q0=[9,13,27,32],Yo=Oi&&"CompositionEvent"in window,Sn=null;Oi&&"documentMode"in document&&(Sn=document.documentMode);var W0=Oi&&"TextEvent"in window&&!Sn,Ud=Oi&&(!Yo||Sn&&8<Sn&&11>=Sn),Pd=" ",jd=!1;function qd(t,s){switch(t){case"keyup":return q0.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wd(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var br=!1;function Y0(t,s){switch(t){case"compositionend":return Wd(s);case"keypress":return s.which!==32?null:(jd=!0,Pd);case"textInput":return t=s.data,t===Pd&&jd?null:t;default:return null}}function K0(t,s){if(br)return t==="compositionend"||!Yo&&qd(t,s)?(t=zd(),ql=Uo=is=null,br=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Ud&&s.locale!=="ko"?null:s.data;default:return null}}var V0={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 Yd(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s==="input"?!!V0[t.type]:s==="textarea"}function Kd(t,s,r,a){Sr?yr?yr.push(a):yr=[a]:Sr=a,s=Aa(s,"onChange"),0<s.length&&(r=new Kl("onChange","change",null,r,a),t.push({event:r,listeners:s}))}var yn=null,bn=null;function X0(t){Ev(t,0)}function Xl(t){var s=_n(t);if(Ed(s))return t}function Vd(t,s){if(t==="change")return s}var Xd=!1;if(Oi){var Ko;if(Oi){var Vo="oninput"in document;if(!Vo){var Gd=document.createElement("div");Gd.setAttribute("oninput","return;"),Vo=typeof Gd.oninput=="function"}Ko=Vo}else Ko=!1;Xd=Ko&&(!document.documentMode||9<document.documentMode)}function $d(){yn&&(yn.detachEvent("onpropertychange",Fd),bn=yn=null)}function Fd(t){if(t.propertyName==="value"&&Xl(bn)){var s=[];Kd(s,bn,t,Lo(t)),Bd(X0,s)}}function G0(t,s,r){t==="focusin"?($d(),yn=s,bn=r,yn.attachEvent("onpropertychange",Fd)):t==="focusout"&&$d()}function $0(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Xl(bn)}function F0(t,s){if(t==="click")return Xl(s)}function I0(t,s){if(t==="input"||t==="change")return Xl(s)}function Z0(t,s){return t===s&&(t!==0||1/t===1/s)||t!==t&&s!==s}var Kt=typeof Object.is=="function"?Object.is:Z0;function wn(t,s){if(Kt(t,s))return!0;if(typeof t!="object"||t===null||typeof s!="object"||s===null)return!1;var r=Object.keys(t),a=Object.keys(s);if(r.length!==a.length)return!1;for(a=0;a<r.length;a++){var h=r[a];if(!Jt.call(s,h)||!Kt(t[h],s[h]))return!1}return!0}function Id(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Zd(t,s){var r=Id(t);t=0;for(var a;r;){if(r.nodeType===3){if(a=t+r.textContent.length,t<=s&&a>=s)return{node:r,offset:s-t};t=a}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Id(r)}}function Qd(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?Qd(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function Jd(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var s=Pl(t.document);s instanceof t.HTMLIFrameElement;){try{var r=typeof s.contentWindow.location.href=="string"}catch{r=!1}if(r)t=s.contentWindow;else break;s=Pl(t.document)}return s}function Xo(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s&&(s==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||s==="textarea"||t.contentEditable==="true")}var Q0=Oi&&"documentMode"in document&&11>=document.documentMode,wr=null,Go=null,Cn=null,$o=!1;function ef(t,s,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;$o||wr==null||wr!==Pl(a)||(a=wr,"selectionStart"in a&&Xo(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Cn&&wn(Cn,a)||(Cn=a,a=Aa(Go,"onSelect"),0<a.length&&(s=new Kl("onSelect","select",null,s,r),t.push({event:s,listeners:a}),s.target=wr)))}function Ns(t,s){var r={};return r[t.toLowerCase()]=s.toLowerCase(),r["Webkit"+t]="webkit"+s,r["Moz"+t]="moz"+s,r}var Cr={animationend:Ns("Animation","AnimationEnd"),animationiteration:Ns("Animation","AnimationIteration"),animationstart:Ns("Animation","AnimationStart"),transitionrun:Ns("Transition","TransitionRun"),transitionstart:Ns("Transition","TransitionStart"),transitioncancel:Ns("Transition","TransitionCancel"),transitionend:Ns("Transition","TransitionEnd")},Fo={},tf={};Oi&&(tf=document.createElement("div").style,"AnimationEvent"in window||(delete Cr.animationend.animation,delete Cr.animationiteration.animation,delete Cr.animationstart.animation),"TransitionEvent"in window||delete Cr.transitionend.transition);function Hs(t){if(Fo[t])return Fo[t];if(!Cr[t])return t;var s=Cr[t],r;for(r in s)if(s.hasOwnProperty(r)&&r in tf)return Fo[t]=s[r];return t}var sf=Hs("animationend"),rf=Hs("animationiteration"),nf=Hs("animationstart"),J0=Hs("transitionrun"),eS=Hs("transitionstart"),tS=Hs("transitioncancel"),lf=Hs("transitionend"),af=new Map,Io="abort auxClick beforeToggle 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(" ");Io.push("scrollEnd");function _i(t,s){af.set(t,s),Os(s,[t])}var of=new WeakMap;function ii(t,s){if(typeof t=="object"&&t!==null){var r=of.get(t);return r!==void 0?r:(s={value:t,source:s,stack:Cd(s)},of.set(t,s),s)}return{value:t,source:s,stack:Cd(s)}}var si=[],xr=0,Zo=0;function Gl(){for(var t=xr,s=Zo=xr=0;s<t;){var r=si[s];si[s++]=null;var a=si[s];si[s++]=null;var h=si[s];si[s++]=null;var u=si[s];if(si[s++]=null,a!==null&&h!==null){var g=a.pending;g===null?h.next=h:(h.next=g.next,g.next=h),a.pending=h}u!==0&&hf(r,h,u)}}function $l(t,s,r,a){si[xr++]=t,si[xr++]=s,si[xr++]=r,si[xr++]=a,Zo|=a,t.lanes|=a,t=t.alternate,t!==null&&(t.lanes|=a)}function Qo(t,s,r,a){return $l(t,s,r,a),Fl(t)}function Er(t,s){return $l(t,null,null,s),Fl(t)}function hf(t,s,r){t.lanes|=r;var a=t.alternate;a!==null&&(a.lanes|=r);for(var h=!1,u=t.return;u!==null;)u.childLanes|=r,a=u.alternate,a!==null&&(a.childLanes|=r),u.tag===22&&(t=u.stateNode,t===null||t._visibility&1||(h=!0)),t=u,u=u.return;return t.tag===3?(u=t.stateNode,h&&s!==null&&(h=31-Yt(r),t=u.hiddenUpdates,a=t[h],a===null?t[h]=[s]:a.push(s),s.lane=r|536870912),u):null}function Fl(t){if(50<$n)throw $n=0,rc=null,Error(l(185));for(var s=t.return;s!==null;)t=s,s=t.return;return t.tag===3?t.stateNode:null}var kr={};function iS(t,s,r,a){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vt(t,s,r,a){return new iS(t,s,r,a)}function Jo(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Li(t,s){var r=t.alternate;return r===null?(r=Vt(t.tag,s,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=s,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&65011712,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,s=t.dependencies,r.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r.refCleanup=t.refCleanup,r}function cf(t,s){t.flags&=65011714;var r=t.alternate;return r===null?(t.childLanes=0,t.lanes=s,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=r.childLanes,t.lanes=r.lanes,t.child=r.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=r.memoizedProps,t.memoizedState=r.memoizedState,t.updateQueue=r.updateQueue,t.type=r.type,s=r.dependencies,t.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),t}function Il(t,s,r,a,h,u){var g=0;if(a=t,typeof t=="function")Jo(t)&&(g=1);else if(typeof t=="string")g=ry(t,r,se.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Te:return t=Vt(31,r,s,h),t.elementType=Te,t.lanes=u,t;case C:return Us(r.children,h,u,s);case E:g=8,h|=24;break;case B:return t=Vt(12,r,s,h|2),t.elementType=B,t.lanes=u,t;case N:return t=Vt(13,r,s,h),t.elementType=N,t.lanes=u,t;case ee:return t=Vt(19,r,s,h),t.elementType=ee,t.lanes=u,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case L:case G:g=10;break e;case Q:g=9;break e;case q:g=11;break e;case le:g=14;break e;case _e:g=16,a=null;break e}g=29,r=Error(l(130,t===null?"null":typeof t,"")),a=null}return s=Vt(g,r,s,h),s.elementType=t,s.type=a,s.lanes=u,s}function Us(t,s,r,a){return t=Vt(7,t,a,s),t.lanes=r,t}function eh(t,s,r){return t=Vt(6,t,null,s),t.lanes=r,t}function th(t,s,r){return s=Vt(4,t.children!==null?t.children:[],t.key,s),s.lanes=r,s.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},s}var Mr=[],Dr=0,Zl=null,Ql=0,ri=[],ni=0,Ps=null,Ni=1,Hi="";function js(t,s){Mr[Dr++]=Ql,Mr[Dr++]=Zl,Zl=t,Ql=s}function uf(t,s,r){ri[ni++]=Ni,ri[ni++]=Hi,ri[ni++]=Ps,Ps=t;var a=Ni;t=Hi;var h=32-Yt(a)-1;a&=~(1<<h),r+=1;var u=32-Yt(s)+h;if(30<u){var g=h-h%5;u=(a&(1<<g)-1).toString(32),a>>=g,h-=g,Ni=1<<32-Yt(s)+h|r<<h|a,Hi=u+t}else Ni=1<<u|r<<h|a,Hi=t}function ih(t){t.return!==null&&(js(t,1),uf(t,1,0))}function sh(t){for(;t===Zl;)Zl=Mr[--Dr],Mr[Dr]=null,Ql=Mr[--Dr],Mr[Dr]=null;for(;t===Ps;)Ps=ri[--ni],ri[ni]=null,Hi=ri[--ni],ri[ni]=null,Ni=ri[--ni],ri[ni]=null}var Tt=null,Ve=null,ke=!1,qs=null,yi=!1,rh=Error(l(519));function Ws(t){var s=Error(l(418,""));throw kn(ii(s,t)),rh}function df(t){var s=t.stateNode,r=t.type,a=t.memoizedProps;switch(s[xt]=t,s[Lt]=a,r){case"dialog":we("cancel",s),we("close",s);break;case"iframe":case"object":case"embed":we("load",s);break;case"video":case"audio":for(r=0;r<In.length;r++)we(In[r],s);break;case"source":we("error",s);break;case"img":case"image":case"link":we("error",s),we("load",s);break;case"details":we("toggle",s);break;case"input":we("invalid",s),kd(s,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0),Ul(s);break;case"select":we("invalid",s);break;case"textarea":we("invalid",s),Dd(s,a.value,a.defaultValue,a.children),Ul(s)}r=a.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||s.textContent===""+r||a.suppressHydrationWarning===!0||Rv(s.textContent,r)?(a.popover!=null&&(we("beforetoggle",s),we("toggle",s)),a.onScroll!=null&&we("scroll",s),a.onScrollEnd!=null&&we("scrollend",s),a.onClick!=null&&(s.onclick=Ba),s=!0):s=!1,s||Ws(t)}function ff(t){for(Tt=t.return;Tt;)switch(Tt.tag){case 5:case 13:yi=!1;return;case 27:case 3:yi=!0;return;default:Tt=Tt.return}}function xn(t){if(t!==Tt)return!1;if(!ke)return ff(t),ke=!0,!1;var s=t.tag,r;if((r=s!==3&&s!==27)&&((r=s===5)&&(r=t.type,r=!(r!=="form"&&r!=="button")||yc(t.type,t.memoizedProps)),r=!r),r&&Ve&&Ws(t),ff(t),s===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));e:{for(t=t.nextSibling,s=0;t;){if(t.nodeType===8)if(r=t.data,r==="/$"){if(s===0){Ve=gi(t.nextSibling);break e}s--}else r!=="$"&&r!=="$!"&&r!=="$?"||s++;t=t.nextSibling}Ve=null}}else s===27?(s=Ve,ms(t.type)?(t=xc,xc=null,Ve=t):Ve=s):Ve=Tt?gi(t.stateNode.nextSibling):null;return!0}function En(){Ve=Tt=null,ke=!1}function _f(){var t=qs;return t!==null&&(Pt===null?Pt=t:Pt.push.apply(Pt,t),qs=null),t}function kn(t){qs===null?qs=[t]:qs.push(t)}var nh=W(null),Ys=null,Ui=null;function ss(t,s,r){I(nh,s._currentValue),s._currentValue=r}function Pi(t){t._currentValue=nh.current,J(nh)}function lh(t,s,r){for(;t!==null;){var a=t.alternate;if((t.childLanes&s)!==s?(t.childLanes|=s,a!==null&&(a.childLanes|=s)):a!==null&&(a.childLanes&s)!==s&&(a.childLanes|=s),t===r)break;t=t.return}}function ah(t,s,r,a){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var u=h.dependencies;if(u!==null){var g=h.child;u=u.firstContext;e:for(;u!==null;){var p=u;u=h;for(var b=0;b<s.length;b++)if(p.context===s[b]){u.lanes|=r,p=u.alternate,p!==null&&(p.lanes|=r),lh(u.return,r,t),a||(g=null);break e}u=p.next}}else if(h.tag===18){if(g=h.return,g===null)throw Error(l(341));g.lanes|=r,u=g.alternate,u!==null&&(u.lanes|=r),lh(g,r,t),g=null}else g=h.child;if(g!==null)g.return=h;else for(g=h;g!==null;){if(g===t){g=null;break}if(h=g.sibling,h!==null){h.return=g.return,g=h;break}g=g.return}h=g}}function Mn(t,s,r,a){t=null;for(var h=s,u=!1;h!==null;){if(!u){if((h.flags&524288)!==0)u=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var g=h.alternate;if(g===null)throw Error(l(387));if(g=g.memoizedProps,g!==null){var p=h.type;Kt(h.pendingProps.value,g.value)||(t!==null?t.push(p):t=[p])}}else if(h===Ue.current){if(g=h.alternate,g===null)throw Error(l(387));g.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(il):t=[il])}h=h.return}t!==null&&ah(s,t,r,a),s.flags|=262144}function Jl(t){for(t=t.firstContext;t!==null;){if(!Kt(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ks(t){Ys=t,Ui=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Et(t){return vf(Ys,t)}function ea(t,s){return Ys===null&&Ks(t),vf(t,s)}function vf(t,s){var r=s._currentValue;if(s={context:s,memoizedValue:r,next:null},Ui===null){if(t===null)throw Error(l(308));Ui=s,t.dependencies={lanes:0,firstContext:s},t.flags|=524288}else Ui=Ui.next=s;return r}var sS=typeof AbortController<"u"?AbortController:function(){var t=[],s=this.signal={aborted:!1,addEventListener:function(r,a){t.push(a)}};this.abort=function(){s.aborted=!0,t.forEach(function(r){return r()})}},rS=e.unstable_scheduleCallback,nS=e.unstable_NormalPriority,rt={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oh(){return{controller:new sS,data:new Map,refCount:0}}function Dn(t){t.refCount--,t.refCount===0&&rS(nS,function(){t.controller.abort()})}var Rn=null,hh=0,Rr=0,Tr=null;function lS(t,s){if(Rn===null){var r=Rn=[];hh=0,Rr=uc(),Tr={status:"pending",value:void 0,then:function(a){r.push(a)}}}return hh++,s.then(gf,gf),s}function gf(){if(--hh===0&&Rn!==null){Tr!==null&&(Tr.status="fulfilled");var t=Rn;Rn=null,Rr=0,Tr=null;for(var s=0;s<t.length;s++)(0,t[s])()}}function aS(t,s){var r=[],a={status:"pending",value:null,reason:null,then:function(h){r.push(h)}};return t.then(function(){a.status="fulfilled",a.value=s;for(var h=0;h<r.length;h++)(0,r[h])(s)},function(h){for(a.status="rejected",a.reason=h,h=0;h<r.length;h++)(0,r[h])(void 0)}),a}var pf=k.S;k.S=function(t,s){typeof s=="object"&&s!==null&&typeof s.then=="function"&&lS(t,s),pf!==null&&pf(t,s)};var Vs=W(null);function ch(){var t=Vs.current;return t!==null?t:He.pooledCache}function ta(t,s){s===null?I(Vs,Vs.current):I(Vs,s.pool)}function mf(){var t=ch();return t===null?null:{parent:rt._currentValue,pool:t}}var Tn=Error(l(460)),Sf=Error(l(474)),ia=Error(l(542)),uh={then:function(){}};function yf(t){return t=t.status,t==="fulfilled"||t==="rejected"}function sa(){}function bf(t,s,r){switch(r=t[r],r===void 0?t.push(s):r!==s&&(s.then(sa,sa),s=r),s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,Cf(t),t;default:if(typeof s.status=="string")s.then(sa,sa);else{if(t=He,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=s,t.status="pending",t.then(function(a){if(s.status==="pending"){var h=s;h.status="fulfilled",h.value=a}},function(a){if(s.status==="pending"){var h=s;h.status="rejected",h.reason=a}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,Cf(t),t}throw An=s,Tn}}var An=null;function wf(){if(An===null)throw Error(l(459));var t=An;return An=null,t}function Cf(t){if(t===Tn||t===ia)throw Error(l(483))}var rs=!1;function dh(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fh(t,s){t=t.updateQueue,s.updateQueue===t&&(s.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ns(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ls(t,s,r){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(De&2)!==0){var h=a.pending;return h===null?s.next=s:(s.next=h.next,h.next=s),a.pending=s,s=Fl(t),hf(t,null,r),s}return $l(t,a,s,r),Fl(t)}function Bn(t,s,r){if(s=s.updateQueue,s!==null&&(s=s.shared,(r&4194048)!==0)){var a=s.lanes;a&=t.pendingLanes,r|=a,s.lanes=r,vd(t,r)}}function _h(t,s){var r=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,r===a)){var h=null,u=null;if(r=r.firstBaseUpdate,r!==null){do{var g={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};u===null?h=u=g:u=u.next=g,r=r.next}while(r!==null);u===null?h=u=s:u=u.next=s}else h=u=s;r={baseState:a.baseState,firstBaseUpdate:h,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=s:t.next=s,r.lastBaseUpdate=s}var vh=!1;function zn(){if(vh){var t=Tr;if(t!==null)throw t}}function On(t,s,r,a){vh=!1;var h=t.updateQueue;rs=!1;var u=h.firstBaseUpdate,g=h.lastBaseUpdate,p=h.shared.pending;if(p!==null){h.shared.pending=null;var b=p,T=b.next;b.next=null,g===null?u=T:g.next=T,g=b;var j=t.alternate;j!==null&&(j=j.updateQueue,p=j.lastBaseUpdate,p!==g&&(p===null?j.firstBaseUpdate=T:p.next=T,j.lastBaseUpdate=b))}if(u!==null){var V=h.baseState;g=0,j=T=b=null,p=u;do{var A=p.lane&-536870913,z=A!==p.lane;if(z?(Ce&A)===A:(a&A)===A){A!==0&&A===Rr&&(vh=!0),j!==null&&(j=j.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var ue=t,he=p;A=s;var ze=r;switch(he.tag){case 1:if(ue=he.payload,typeof ue=="function"){V=ue.call(ze,V,A);break e}V=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=he.payload,A=typeof ue=="function"?ue.call(ze,V,A):ue,A==null)break e;V=m({},V,A);break e;case 2:rs=!0}}A=p.callback,A!==null&&(t.flags|=64,z&&(t.flags|=8192),z=h.callbacks,z===null?h.callbacks=[A]:z.push(A))}else z={lane:A,tag:p.tag,payload:p.payload,callback:p.callback,next:null},j===null?(T=j=z,b=V):j=j.next=z,g|=A;if(p=p.next,p===null){if(p=h.shared.pending,p===null)break;z=p,p=z.next,z.next=null,h.lastBaseUpdate=z,h.shared.pending=null}}while(!0);j===null&&(b=V),h.baseState=b,h.firstBaseUpdate=T,h.lastBaseUpdate=j,u===null&&(h.shared.lanes=0),_s|=g,t.lanes=g,t.memoizedState=V}}function xf(t,s){if(typeof t!="function")throw Error(l(191,t));t.call(s)}function Ef(t,s){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;t<r.length;t++)xf(r[t],s)}var Ar=W(null),ra=W(0);function kf(t,s){t=Xi,I(ra,t),I(Ar,s),Xi=t|s.baseLanes}function gh(){I(ra,Xi),I(Ar,Ar.current)}function ph(){Xi=ra.current,J(Ar),J(ra)}var as=0,pe=null,Ae=null,Je=null,na=!1,Br=!1,Xs=!1,la=0,Ln=0,zr=null,oS=0;function Fe(){throw Error(l(321))}function mh(t,s){if(s===null)return!1;for(var r=0;r<s.length&&r<t.length;r++)if(!Kt(t[r],s[r]))return!1;return!0}function Sh(t,s,r,a,h,u){return as=u,pe=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,k.H=t===null||t.memoizedState===null?h_:c_,Xs=!1,u=r(a,h),Xs=!1,Br&&(u=Df(s,r,a,h)),Mf(t),u}function Mf(t){k.H=da;var s=Ae!==null&&Ae.next!==null;if(as=0,Je=Ae=pe=null,na=!1,Ln=0,zr=null,s)throw Error(l(300));t===null||ut||(t=t.dependencies,t!==null&&Jl(t)&&(ut=!0))}function Df(t,s,r,a){pe=t;var h=0;do{if(Br&&(zr=null),Ln=0,Br=!1,25<=h)throw Error(l(301));if(h+=1,Je=Ae=null,t.updateQueue!=null){var u=t.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}k.H=vS,u=s(r,a)}while(Br);return u}function hS(){var t=k.H,s=t.useState()[0];return s=typeof s.then=="function"?Nn(s):s,t=t.useState()[0],(Ae!==null?Ae.memoizedState:null)!==t&&(pe.flags|=1024),s}function yh(){var t=la!==0;return la=0,t}function bh(t,s,r){s.updateQueue=t.updateQueue,s.flags&=-2053,t.lanes&=~r}function wh(t){if(na){for(t=t.memoizedState;t!==null;){var s=t.queue;s!==null&&(s.pending=null),t=t.next}na=!1}as=0,Je=Ae=pe=null,Br=!1,Ln=la=0,zr=null}function Ht(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Je===null?pe.memoizedState=Je=t:Je=Je.next=t,Je}function et(){if(Ae===null){var t=pe.alternate;t=t!==null?t.memoizedState:null}else t=Ae.next;var s=Je===null?pe.memoizedState:Je.next;if(s!==null)Je=s,Ae=t;else{if(t===null)throw pe.alternate===null?Error(l(467)):Error(l(310));Ae=t,t={memoizedState:Ae.memoizedState,baseState:Ae.baseState,baseQueue:Ae.baseQueue,queue:Ae.queue,next:null},Je===null?pe.memoizedState=Je=t:Je=Je.next=t}return Je}function Ch(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Nn(t){var s=Ln;return Ln+=1,zr===null&&(zr=[]),t=bf(zr,t,s),s=pe,(Je===null?s.memoizedState:Je.next)===null&&(s=s.alternate,k.H=s===null||s.memoizedState===null?h_:c_),t}function aa(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Nn(t);if(t.$$typeof===G)return Et(t)}throw Error(l(438,String(t)))}function xh(t){var s=null,r=pe.updateQueue;if(r!==null&&(s=r.memoCache),s==null){var a=pe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(s={data:a.data.map(function(h){return h.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),r===null&&(r=Ch(),pe.updateQueue=r),r.memoCache=s,r=s.data[s.index],r===void 0)for(r=s.data[s.index]=Array(t),a=0;a<t;a++)r[a]=Qe;return s.index++,r}function ji(t,s){return typeof s=="function"?s(t):s}function oa(t){var s=et();return Eh(s,Ae,t)}function Eh(t,s,r){var a=t.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=r;var h=t.baseQueue,u=a.pending;if(u!==null){if(h!==null){var g=h.next;h.next=u.next,u.next=g}s.baseQueue=h=u,a.pending=null}if(u=t.baseState,h===null)t.memoizedState=u;else{s=h.next;var p=g=null,b=null,T=s,j=!1;do{var V=T.lane&-536870913;if(V!==T.lane?(Ce&V)===V:(as&V)===V){var A=T.revertLane;if(A===0)b!==null&&(b=b.next={lane:0,revertLane:0,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null}),V===Rr&&(j=!0);else if((as&A)===A){T=T.next,A===Rr&&(j=!0);continue}else V={lane:0,revertLane:T.revertLane,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},b===null?(p=b=V,g=u):b=b.next=V,pe.lanes|=A,_s|=A;V=T.action,Xs&&r(u,V),u=T.hasEagerState?T.eagerState:r(u,V)}else A={lane:V,revertLane:T.revertLane,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},b===null?(p=b=A,g=u):b=b.next=A,pe.lanes|=V,_s|=V;T=T.next}while(T!==null&&T!==s);if(b===null?g=u:b.next=p,!Kt(u,t.memoizedState)&&(ut=!0,j&&(r=Tr,r!==null)))throw r;t.memoizedState=u,t.baseState=g,t.baseQueue=b,a.lastRenderedState=u}return h===null&&(a.lanes=0),[t.memoizedState,a.dispatch]}function kh(t){var s=et(),r=s.queue;if(r===null)throw Error(l(311));r.lastRenderedReducer=t;var a=r.dispatch,h=r.pending,u=s.memoizedState;if(h!==null){r.pending=null;var g=h=h.next;do u=t(u,g.action),g=g.next;while(g!==h);Kt(u,s.memoizedState)||(ut=!0),s.memoizedState=u,s.baseQueue===null&&(s.baseState=u),r.lastRenderedState=u}return[u,a]}function Rf(t,s,r){var a=pe,h=et(),u=ke;if(u){if(r===void 0)throw Error(l(407));r=r()}else r=s();var g=!Kt((Ae||h).memoizedState,r);g&&(h.memoizedState=r,ut=!0),h=h.queue;var p=Bf.bind(null,a,h,t);if(Hn(2048,8,p,[t]),h.getSnapshot!==s||g||Je!==null&&Je.memoizedState.tag&1){if(a.flags|=2048,Or(9,ha(),Af.bind(null,a,h,r,s),null),He===null)throw Error(l(349));u||(as&124)!==0||Tf(a,s,r)}return r}function Tf(t,s,r){t.flags|=16384,t={getSnapshot:s,value:r},s=pe.updateQueue,s===null?(s=Ch(),pe.updateQueue=s,s.stores=[t]):(r=s.stores,r===null?s.stores=[t]:r.push(t))}function Af(t,s,r,a){s.value=r,s.getSnapshot=a,zf(s)&&Of(t)}function Bf(t,s,r){return r(function(){zf(s)&&Of(t)})}function zf(t){var s=t.getSnapshot;t=t.value;try{var r=s();return!Kt(t,r)}catch{return!0}}function Of(t){var s=Er(t,2);s!==null&&It(s,t,2)}function Mh(t){var s=Ht();if(typeof t=="function"){var r=t;if(t=r(),Xs){es(!0);try{r()}finally{es(!1)}}}return s.memoizedState=s.baseState=t,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:t},s}function Lf(t,s,r,a){return t.baseState=r,Eh(t,Ae,typeof a=="function"?a:ji)}function cS(t,s,r,a,h){if(ua(t))throw Error(l(485));if(t=s.action,t!==null){var u={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){u.listeners.push(g)}};k.T!==null?r(!0):u.isTransition=!1,a(u),r=s.pending,r===null?(u.next=s.pending=u,Nf(s,u)):(u.next=r.next,s.pending=r.next=u)}}function Nf(t,s){var r=s.action,a=s.payload,h=t.state;if(s.isTransition){var u=k.T,g={};k.T=g;try{var p=r(h,a),b=k.S;b!==null&&b(g,p),Hf(t,s,p)}catch(T){Dh(t,s,T)}finally{k.T=u}}else try{u=r(h,a),Hf(t,s,u)}catch(T){Dh(t,s,T)}}function Hf(t,s,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(a){Uf(t,s,a)},function(a){return Dh(t,s,a)}):Uf(t,s,r)}function Uf(t,s,r){s.status="fulfilled",s.value=r,Pf(s),t.state=r,s=t.pending,s!==null&&(r=s.next,r===s?t.pending=null:(r=r.next,s.next=r,Nf(t,r)))}function Dh(t,s,r){var a=t.pending;if(t.pending=null,a!==null){a=a.next;do s.status="rejected",s.reason=r,Pf(s),s=s.next;while(s!==a)}t.action=null}function Pf(t){t=t.listeners;for(var s=0;s<t.length;s++)(0,t[s])()}function jf(t,s){return s}function qf(t,s){if(ke){var r=He.formState;if(r!==null){e:{var a=pe;if(ke){if(Ve){t:{for(var h=Ve,u=yi;h.nodeType!==8;){if(!u){h=null;break t}if(h=gi(h.nextSibling),h===null){h=null;break t}}u=h.data,h=u==="F!"||u==="F"?h:null}if(h){Ve=gi(h.nextSibling),a=h.data==="F!";break e}}Ws(a)}a=!1}a&&(s=r[0])}}return r=Ht(),r.memoizedState=r.baseState=s,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jf,lastRenderedState:s},r.queue=a,r=l_.bind(null,pe,a),a.dispatch=r,a=Mh(!1),u=zh.bind(null,pe,!1,a.queue),a=Ht(),h={state:s,dispatch:null,action:t,pending:null},a.queue=h,r=cS.bind(null,pe,h,u,r),h.dispatch=r,a.memoizedState=t,[s,r,!1]}function Wf(t){var s=et();return Yf(s,Ae,t)}function Yf(t,s,r){if(s=Eh(t,s,jf)[0],t=oa(ji)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var a=Nn(s)}catch(g){throw g===Tn?ia:g}else a=s;s=et();var h=s.queue,u=h.dispatch;return r!==s.memoizedState&&(pe.flags|=2048,Or(9,ha(),uS.bind(null,h,r),null)),[a,u,t]}function uS(t,s){t.action=s}function Kf(t){var s=et(),r=Ae;if(r!==null)return Yf(s,r,t);et(),s=s.memoizedState,r=et();var a=r.queue.dispatch;return r.memoizedState=t,[s,a,!1]}function Or(t,s,r,a){return t={tag:t,create:r,deps:a,inst:s,next:null},s=pe.updateQueue,s===null&&(s=Ch(),pe.updateQueue=s),r=s.lastEffect,r===null?s.lastEffect=t.next=t:(a=r.next,r.next=t,t.next=a,s.lastEffect=t),t}function ha(){return{destroy:void 0,resource:void 0}}function Vf(){return et().memoizedState}function ca(t,s,r,a){var h=Ht();a=a===void 0?null:a,pe.flags|=t,h.memoizedState=Or(1|s,ha(),r,a)}function Hn(t,s,r,a){var h=et();a=a===void 0?null:a;var u=h.memoizedState.inst;Ae!==null&&a!==null&&mh(a,Ae.memoizedState.deps)?h.memoizedState=Or(s,u,r,a):(pe.flags|=t,h.memoizedState=Or(1|s,u,r,a))}function Xf(t,s){ca(8390656,8,t,s)}function Gf(t,s){Hn(2048,8,t,s)}function $f(t,s){return Hn(4,2,t,s)}function Ff(t,s){return Hn(4,4,t,s)}function If(t,s){if(typeof s=="function"){t=t();var r=s(t);return function(){typeof r=="function"?r():s(null)}}if(s!=null)return t=t(),s.current=t,function(){s.current=null}}function Zf(t,s,r){r=r!=null?r.concat([t]):null,Hn(4,4,If.bind(null,s,t),r)}function Rh(){}function Qf(t,s){var r=et();s=s===void 0?null:s;var a=r.memoizedState;return s!==null&&mh(s,a[1])?a[0]:(r.memoizedState=[t,s],t)}function Jf(t,s){var r=et();s=s===void 0?null:s;var a=r.memoizedState;if(s!==null&&mh(s,a[1]))return a[0];if(a=t(),Xs){es(!0);try{t()}finally{es(!1)}}return r.memoizedState=[a,s],a}function Th(t,s,r){return r===void 0||(as&1073741824)!==0?t.memoizedState=s:(t.memoizedState=r,t=iv(),pe.lanes|=t,_s|=t,r)}function e_(t,s,r,a){return Kt(r,s)?r:Ar.current!==null?(t=Th(t,r,a),Kt(t,s)||(ut=!0),t):(as&42)===0?(ut=!0,t.memoizedState=r):(t=iv(),pe.lanes|=t,_s|=t,s)}function t_(t,s,r,a,h){var u=P.p;P.p=u!==0&&8>u?u:8;var g=k.T,p={};k.T=p,zh(t,!1,s,r);try{var b=h(),T=k.S;if(T!==null&&T(p,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var j=aS(b,a);Un(t,s,j,Ft(t))}else Un(t,s,a,Ft(t))}catch(V){Un(t,s,{then:function(){},status:"rejected",reason:V},Ft())}finally{P.p=u,k.T=g}}function dS(){}function Ah(t,s,r,a){if(t.tag!==5)throw Error(l(476));var h=i_(t).queue;t_(t,h,s,U,r===null?dS:function(){return s_(t),r(a)})}function i_(t){var s=t.memoizedState;if(s!==null)return s;s={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:U},next:null};var r={};return s.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:r},next:null},t.memoizedState=s,t=t.alternate,t!==null&&(t.memoizedState=s),s}function s_(t){var s=i_(t).next.queue;Un(t,s,{},Ft())}function Bh(){return Et(il)}function r_(){return et().memoizedState}function n_(){return et().memoizedState}function fS(t){for(var s=t.return;s!==null;){switch(s.tag){case 24:case 3:var r=Ft();t=ns(r);var a=ls(s,t,r);a!==null&&(It(a,s,r),Bn(a,s,r)),s={cache:oh()},t.payload=s;return}s=s.return}}function _S(t,s,r){var a=Ft();r={lane:a,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null},ua(t)?a_(s,r):(r=Qo(t,s,r,a),r!==null&&(It(r,t,a),o_(r,s,a)))}function l_(t,s,r){var a=Ft();Un(t,s,r,a)}function Un(t,s,r,a){var h={lane:a,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null};if(ua(t))a_(s,h);else{var u=t.alternate;if(t.lanes===0&&(u===null||u.lanes===0)&&(u=s.lastRenderedReducer,u!==null))try{var g=s.lastRenderedState,p=u(g,r);if(h.hasEagerState=!0,h.eagerState=p,Kt(p,g))return $l(t,s,h,0),He===null&&Gl(),!1}catch{}finally{}if(r=Qo(t,s,h,a),r!==null)return It(r,t,a),o_(r,s,a),!0}return!1}function zh(t,s,r,a){if(a={lane:2,revertLane:uc(),action:a,hasEagerState:!1,eagerState:null,next:null},ua(t)){if(s)throw Error(l(479))}else s=Qo(t,r,a,2),s!==null&&It(s,t,2)}function ua(t){var s=t.alternate;return t===pe||s!==null&&s===pe}function a_(t,s){Br=na=!0;var r=t.pending;r===null?s.next=s:(s.next=r.next,r.next=s),t.pending=s}function o_(t,s,r){if((r&4194048)!==0){var a=s.lanes;a&=t.pendingLanes,r|=a,s.lanes=r,vd(t,r)}}var da={readContext:Et,use:aa,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useLayoutEffect:Fe,useInsertionEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useSyncExternalStore:Fe,useId:Fe,useHostTransitionStatus:Fe,useFormState:Fe,useActionState:Fe,useOptimistic:Fe,useMemoCache:Fe,useCacheRefresh:Fe},h_={readContext:Et,use:aa,useCallback:function(t,s){return Ht().memoizedState=[t,s===void 0?null:s],t},useContext:Et,useEffect:Xf,useImperativeHandle:function(t,s,r){r=r!=null?r.concat([t]):null,ca(4194308,4,If.bind(null,s,t),r)},useLayoutEffect:function(t,s){return ca(4194308,4,t,s)},useInsertionEffect:function(t,s){ca(4,2,t,s)},useMemo:function(t,s){var r=Ht();s=s===void 0?null:s;var a=t();if(Xs){es(!0);try{t()}finally{es(!1)}}return r.memoizedState=[a,s],a},useReducer:function(t,s,r){var a=Ht();if(r!==void 0){var h=r(s);if(Xs){es(!0);try{r(s)}finally{es(!1)}}}else h=s;return a.memoizedState=a.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},a.queue=t,t=t.dispatch=_S.bind(null,pe,t),[a.memoizedState,t]},useRef:function(t){var s=Ht();return t={current:t},s.memoizedState=t},useState:function(t){t=Mh(t);var s=t.queue,r=l_.bind(null,pe,s);return s.dispatch=r,[t.memoizedState,r]},useDebugValue:Rh,useDeferredValue:function(t,s){var r=Ht();return Th(r,t,s)},useTransition:function(){var t=Mh(!1);return t=t_.bind(null,pe,t.queue,!0,!1),Ht().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,s,r){var a=pe,h=Ht();if(ke){if(r===void 0)throw Error(l(407));r=r()}else{if(r=s(),He===null)throw Error(l(349));(Ce&124)!==0||Tf(a,s,r)}h.memoizedState=r;var u={value:r,getSnapshot:s};return h.queue=u,Xf(Bf.bind(null,a,u,t),[t]),a.flags|=2048,Or(9,ha(),Af.bind(null,a,u,r,s),null),r},useId:function(){var t=Ht(),s=He.identifierPrefix;if(ke){var r=Hi,a=Ni;r=(a&~(1<<32-Yt(a)-1)).toString(32)+r,s="«"+s+"R"+r,r=la++,0<r&&(s+="H"+r.toString(32)),s+="»"}else r=oS++,s="«"+s+"r"+r.toString(32)+"»";return t.memoizedState=s},useHostTransitionStatus:Bh,useFormState:qf,useActionState:qf,useOptimistic:function(t){var s=Ht();s.memoizedState=s.baseState=t;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=r,s=zh.bind(null,pe,!0,r),r.dispatch=s,[t,s]},useMemoCache:xh,useCacheRefresh:function(){return Ht().memoizedState=fS.bind(null,pe)}},c_={readContext:Et,use:aa,useCallback:Qf,useContext:Et,useEffect:Gf,useImperativeHandle:Zf,useInsertionEffect:$f,useLayoutEffect:Ff,useMemo:Jf,useReducer:oa,useRef:Vf,useState:function(){return oa(ji)},useDebugValue:Rh,useDeferredValue:function(t,s){var r=et();return e_(r,Ae.memoizedState,t,s)},useTransition:function(){var t=oa(ji)[0],s=et().memoizedState;return[typeof t=="boolean"?t:Nn(t),s]},useSyncExternalStore:Rf,useId:r_,useHostTransitionStatus:Bh,useFormState:Wf,useActionState:Wf,useOptimistic:function(t,s){var r=et();return Lf(r,Ae,t,s)},useMemoCache:xh,useCacheRefresh:n_},vS={readContext:Et,use:aa,useCallback:Qf,useContext:Et,useEffect:Gf,useImperativeHandle:Zf,useInsertionEffect:$f,useLayoutEffect:Ff,useMemo:Jf,useReducer:kh,useRef:Vf,useState:function(){return kh(ji)},useDebugValue:Rh,useDeferredValue:function(t,s){var r=et();return Ae===null?Th(r,t,s):e_(r,Ae.memoizedState,t,s)},useTransition:function(){var t=kh(ji)[0],s=et().memoizedState;return[typeof t=="boolean"?t:Nn(t),s]},useSyncExternalStore:Rf,useId:r_,useHostTransitionStatus:Bh,useFormState:Kf,useActionState:Kf,useOptimistic:function(t,s){var r=et();return Ae!==null?Lf(r,Ae,t,s):(r.baseState=t,[t,r.queue.dispatch])},useMemoCache:xh,useCacheRefresh:n_},Lr=null,Pn=0;function fa(t){var s=Pn;return Pn+=1,Lr===null&&(Lr=[]),bf(Lr,t,s)}function jn(t,s){s=s.props.ref,t.ref=s!==void 0?s:null}function _a(t,s){throw s.$$typeof===S?Error(l(525)):(t=Object.prototype.toString.call(s),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":t)))}function u_(t){var s=t._init;return s(t._payload)}function d_(t){function s(D,x){if(t){var R=D.deletions;R===null?(D.deletions=[x],D.flags|=16):R.push(x)}}function r(D,x){if(!t)return null;for(;x!==null;)s(D,x),x=x.sibling;return null}function a(D){for(var x=new Map;D!==null;)D.key!==null?x.set(D.key,D):x.set(D.index,D),D=D.sibling;return x}function h(D,x){return D=Li(D,x),D.index=0,D.sibling=null,D}function u(D,x,R){return D.index=R,t?(R=D.alternate,R!==null?(R=R.index,R<x?(D.flags|=67108866,x):R):(D.flags|=67108866,x)):(D.flags|=1048576,x)}function g(D){return t&&D.alternate===null&&(D.flags|=67108866),D}function p(D,x,R,Y){return x===null||x.tag!==6?(x=eh(R,D.mode,Y),x.return=D,x):(x=h(x,R),x.return=D,x)}function b(D,x,R,Y){var ne=R.type;return ne===C?j(D,x,R.props.children,Y,R.key):x!==null&&(x.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===_e&&u_(ne)===x.type)?(x=h(x,R.props),jn(x,R),x.return=D,x):(x=Il(R.type,R.key,R.props,null,D.mode,Y),jn(x,R),x.return=D,x)}function T(D,x,R,Y){return x===null||x.tag!==4||x.stateNode.containerInfo!==R.containerInfo||x.stateNode.implementation!==R.implementation?(x=th(R,D.mode,Y),x.return=D,x):(x=h(x,R.children||[]),x.return=D,x)}function j(D,x,R,Y,ne){return x===null||x.tag!==7?(x=Us(R,D.mode,Y,ne),x.return=D,x):(x=h(x,R),x.return=D,x)}function V(D,x,R){if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return x=eh(""+x,D.mode,R),x.return=D,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case y:return R=Il(x.type,x.key,x.props,null,D.mode,R),jn(R,x),R.return=D,R;case M:return x=th(x,D.mode,R),x.return=D,x;case _e:var Y=x._init;return x=Y(x._payload),V(D,x,R)}if($(x)||X(x))return x=Us(x,D.mode,R,null),x.return=D,x;if(typeof x.then=="function")return V(D,fa(x),R);if(x.$$typeof===G)return V(D,ea(D,x),R);_a(D,x)}return null}function A(D,x,R,Y){var ne=x!==null?x.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return ne!==null?null:p(D,x,""+R,Y);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case y:return R.key===ne?b(D,x,R,Y):null;case M:return R.key===ne?T(D,x,R,Y):null;case _e:return ne=R._init,R=ne(R._payload),A(D,x,R,Y)}if($(R)||X(R))return ne!==null?null:j(D,x,R,Y,null);if(typeof R.then=="function")return A(D,x,fa(R),Y);if(R.$$typeof===G)return A(D,x,ea(D,R),Y);_a(D,R)}return null}function z(D,x,R,Y,ne){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return D=D.get(R)||null,p(x,D,""+Y,ne);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case y:return D=D.get(Y.key===null?R:Y.key)||null,b(x,D,Y,ne);case M:return D=D.get(Y.key===null?R:Y.key)||null,T(x,D,Y,ne);case _e:var ye=Y._init;return Y=ye(Y._payload),z(D,x,R,Y,ne)}if($(Y)||X(Y))return D=D.get(R)||null,j(x,D,Y,ne,null);if(typeof Y.then=="function")return z(D,x,R,fa(Y),ne);if(Y.$$typeof===G)return z(D,x,R,ea(x,Y),ne);_a(x,Y)}return null}function ue(D,x,R,Y){for(var ne=null,ye=null,ae=x,ce=x=0,ft=null;ae!==null&&ce<R.length;ce++){ae.index>ce?(ft=ae,ae=null):ft=ae.sibling;var Ee=A(D,ae,R[ce],Y);if(Ee===null){ae===null&&(ae=ft);break}t&&ae&&Ee.alternate===null&&s(D,ae),x=u(Ee,x,ce),ye===null?ne=Ee:ye.sibling=Ee,ye=Ee,ae=ft}if(ce===R.length)return r(D,ae),ke&&js(D,ce),ne;if(ae===null){for(;ce<R.length;ce++)ae=V(D,R[ce],Y),ae!==null&&(x=u(ae,x,ce),ye===null?ne=ae:ye.sibling=ae,ye=ae);return ke&&js(D,ce),ne}for(ae=a(ae);ce<R.length;ce++)ft=z(ae,D,ce,R[ce],Y),ft!==null&&(t&&ft.alternate!==null&&ae.delete(ft.key===null?ce:ft.key),x=u(ft,x,ce),ye===null?ne=ft:ye.sibling=ft,ye=ft);return t&&ae.forEach(function(Cs){return s(D,Cs)}),ke&&js(D,ce),ne}function he(D,x,R,Y){if(R==null)throw Error(l(151));for(var ne=null,ye=null,ae=x,ce=x=0,ft=null,Ee=R.next();ae!==null&&!Ee.done;ce++,Ee=R.next()){ae.index>ce?(ft=ae,ae=null):ft=ae.sibling;var Cs=A(D,ae,Ee.value,Y);if(Cs===null){ae===null&&(ae=ft);break}t&&ae&&Cs.alternate===null&&s(D,ae),x=u(Cs,x,ce),ye===null?ne=Cs:ye.sibling=Cs,ye=Cs,ae=ft}if(Ee.done)return r(D,ae),ke&&js(D,ce),ne;if(ae===null){for(;!Ee.done;ce++,Ee=R.next())Ee=V(D,Ee.value,Y),Ee!==null&&(x=u(Ee,x,ce),ye===null?ne=Ee:ye.sibling=Ee,ye=Ee);return ke&&js(D,ce),ne}for(ae=a(ae);!Ee.done;ce++,Ee=R.next())Ee=z(ae,D,ce,Ee.value,Y),Ee!==null&&(t&&Ee.alternate!==null&&ae.delete(Ee.key===null?ce:Ee.key),x=u(Ee,x,ce),ye===null?ne=Ee:ye.sibling=Ee,ye=Ee);return t&&ae.forEach(function(gy){return s(D,gy)}),ke&&js(D,ce),ne}function ze(D,x,R,Y){if(typeof R=="object"&&R!==null&&R.type===C&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case y:e:{for(var ne=R.key;x!==null;){if(x.key===ne){if(ne=R.type,ne===C){if(x.tag===7){r(D,x.sibling),Y=h(x,R.props.children),Y.return=D,D=Y;break e}}else if(x.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===_e&&u_(ne)===x.type){r(D,x.sibling),Y=h(x,R.props),jn(Y,R),Y.return=D,D=Y;break e}r(D,x);break}else s(D,x);x=x.sibling}R.type===C?(Y=Us(R.props.children,D.mode,Y,R.key),Y.return=D,D=Y):(Y=Il(R.type,R.key,R.props,null,D.mode,Y),jn(Y,R),Y.return=D,D=Y)}return g(D);case M:e:{for(ne=R.key;x!==null;){if(x.key===ne)if(x.tag===4&&x.stateNode.containerInfo===R.containerInfo&&x.stateNode.implementation===R.implementation){r(D,x.sibling),Y=h(x,R.children||[]),Y.return=D,D=Y;break e}else{r(D,x);break}else s(D,x);x=x.sibling}Y=th(R,D.mode,Y),Y.return=D,D=Y}return g(D);case _e:return ne=R._init,R=ne(R._payload),ze(D,x,R,Y)}if($(R))return ue(D,x,R,Y);if(X(R)){if(ne=X(R),typeof ne!="function")throw Error(l(150));return R=ne.call(R),he(D,x,R,Y)}if(typeof R.then=="function")return ze(D,x,fa(R),Y);if(R.$$typeof===G)return ze(D,x,ea(D,R),Y);_a(D,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,x!==null&&x.tag===6?(r(D,x.sibling),Y=h(x,R),Y.return=D,D=Y):(r(D,x),Y=eh(R,D.mode,Y),Y.return=D,D=Y),g(D)):r(D,x)}return function(D,x,R,Y){try{Pn=0;var ne=ze(D,x,R,Y);return Lr=null,ne}catch(ae){if(ae===Tn||ae===ia)throw ae;var ye=Vt(29,ae,null,D.mode);return ye.lanes=Y,ye.return=D,ye}finally{}}}var Nr=d_(!0),f_=d_(!1),li=W(null),bi=null;function os(t){var s=t.alternate;I(nt,nt.current&1),I(li,t),bi===null&&(s===null||Ar.current!==null||s.memoizedState!==null)&&(bi=t)}function __(t){if(t.tag===22){if(I(nt,nt.current),I(li,t),bi===null){var s=t.alternate;s!==null&&s.memoizedState!==null&&(bi=t)}}else hs()}function hs(){I(nt,nt.current),I(li,li.current)}function qi(t){J(li),bi===t&&(bi=null),J(nt)}var nt=W(0);function va(t){for(var s=t;s!==null;){if(s.tag===13){var r=s.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||Cc(r)))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}function Oh(t,s,r,a){s=t.memoizedState,r=r(a,s),r=r==null?s:m({},s,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var Lh={enqueueSetState:function(t,s,r){t=t._reactInternals;var a=Ft(),h=ns(a);h.payload=s,r!=null&&(h.callback=r),s=ls(t,h,a),s!==null&&(It(s,t,a),Bn(s,t,a))},enqueueReplaceState:function(t,s,r){t=t._reactInternals;var a=Ft(),h=ns(a);h.tag=1,h.payload=s,r!=null&&(h.callback=r),s=ls(t,h,a),s!==null&&(It(s,t,a),Bn(s,t,a))},enqueueForceUpdate:function(t,s){t=t._reactInternals;var r=Ft(),a=ns(r);a.tag=2,s!=null&&(a.callback=s),s=ls(t,a,r),s!==null&&(It(s,t,r),Bn(s,t,r))}};function v_(t,s,r,a,h,u,g){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(a,u,g):s.prototype&&s.prototype.isPureReactComponent?!wn(r,a)||!wn(h,u):!0}function g_(t,s,r,a){t=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(r,a),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(r,a),s.state!==t&&Lh.enqueueReplaceState(s,s.state,null)}function Gs(t,s){var r=s;if("ref"in s){r={};for(var a in s)a!=="ref"&&(r[a]=s[a])}if(t=t.defaultProps){r===s&&(r=m({},r));for(var h in t)r[h]===void 0&&(r[h]=t[h])}return r}var ga=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function p_(t){ga(t)}function m_(t){console.error(t)}function S_(t){ga(t)}function pa(t,s){try{var r=t.onUncaughtError;r(s.value,{componentStack:s.stack})}catch(a){setTimeout(function(){throw a})}}function y_(t,s,r){try{var a=t.onCaughtError;a(r.value,{componentStack:r.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Nh(t,s,r){return r=ns(r),r.tag=3,r.payload={element:null},r.callback=function(){pa(t,s)},r}function b_(t){return t=ns(t),t.tag=3,t}function w_(t,s,r,a){var h=r.type.getDerivedStateFromError;if(typeof h=="function"){var u=a.value;t.payload=function(){return h(u)},t.callback=function(){y_(s,r,a)}}var g=r.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(t.callback=function(){y_(s,r,a),typeof h!="function"&&(vs===null?vs=new Set([this]):vs.add(this));var p=a.stack;this.componentDidCatch(a.value,{componentStack:p!==null?p:""})})}function gS(t,s,r,a,h){if(r.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(s=r.alternate,s!==null&&Mn(s,r,h,!0),r=li.current,r!==null){switch(r.tag){case 13:return bi===null?lc():r.alternate===null&&Xe===0&&(Xe=3),r.flags&=-257,r.flags|=65536,r.lanes=h,a===uh?r.flags|=16384:(s=r.updateQueue,s===null?r.updateQueue=new Set([a]):s.add(a),oc(t,a,h)),!1;case 22:return r.flags|=65536,a===uh?r.flags|=16384:(s=r.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([a])},r.updateQueue=s):(r=s.retryQueue,r===null?s.retryQueue=new Set([a]):r.add(a)),oc(t,a,h)),!1}throw Error(l(435,r.tag))}return oc(t,a,h),lc(),!1}if(ke)return s=li.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=h,a!==rh&&(t=Error(l(422),{cause:a}),kn(ii(t,r)))):(a!==rh&&(s=Error(l(423),{cause:a}),kn(ii(s,r))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,a=ii(a,r),h=Nh(t.stateNode,a,h),_h(t,h),Xe!==4&&(Xe=2)),!1;var u=Error(l(520),{cause:a});if(u=ii(u,r),Gn===null?Gn=[u]:Gn.push(u),Xe!==4&&(Xe=2),s===null)return!0;a=ii(a,r),r=s;do{switch(r.tag){case 3:return r.flags|=65536,t=h&-h,r.lanes|=t,t=Nh(r.stateNode,a,t),_h(r,t),!1;case 1:if(s=r.type,u=r.stateNode,(r.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(vs===null||!vs.has(u))))return r.flags|=65536,h&=-h,r.lanes|=h,h=b_(h),w_(h,t,r,a),_h(r,h),!1}r=r.return}while(r!==null);return!1}var C_=Error(l(461)),ut=!1;function St(t,s,r,a){s.child=t===null?f_(s,null,r,a):Nr(s,t.child,r,a)}function x_(t,s,r,a,h){r=r.render;var u=s.ref;if("ref"in a){var g={};for(var p in a)p!=="ref"&&(g[p]=a[p])}else g=a;return Ks(s),a=Sh(t,s,r,g,u,h),p=yh(),t!==null&&!ut?(bh(t,s,h),Wi(t,s,h)):(ke&&p&&ih(s),s.flags|=1,St(t,s,a,h),s.child)}function E_(t,s,r,a,h){if(t===null){var u=r.type;return typeof u=="function"&&!Jo(u)&&u.defaultProps===void 0&&r.compare===null?(s.tag=15,s.type=u,k_(t,s,u,a,h)):(t=Il(r.type,null,a,s,s.mode,h),t.ref=s.ref,t.return=s,s.child=t)}if(u=t.child,!Kh(t,h)){var g=u.memoizedProps;if(r=r.compare,r=r!==null?r:wn,r(g,a)&&t.ref===s.ref)return Wi(t,s,h)}return s.flags|=1,t=Li(u,a),t.ref=s.ref,t.return=s,s.child=t}function k_(t,s,r,a,h){if(t!==null){var u=t.memoizedProps;if(wn(u,a)&&t.ref===s.ref)if(ut=!1,s.pendingProps=a=u,Kh(t,h))(t.flags&131072)!==0&&(ut=!0);else return s.lanes=t.lanes,Wi(t,s,h)}return Hh(t,s,r,a,h)}function M_(t,s,r){var a=s.pendingProps,h=a.children,u=t!==null?t.memoizedState:null;if(a.mode==="hidden"){if((s.flags&128)!==0){if(a=u!==null?u.baseLanes|r:r,t!==null){for(h=s.child=t.child,u=0;h!==null;)u=u|h.lanes|h.childLanes,h=h.sibling;s.childLanes=u&~a}else s.childLanes=0,s.child=null;return D_(t,s,a,r)}if((r&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},t!==null&&ta(s,u!==null?u.cachePool:null),u!==null?kf(s,u):gh(),__(s);else return s.lanes=s.childLanes=536870912,D_(t,s,u!==null?u.baseLanes|r:r,r)}else u!==null?(ta(s,u.cachePool),kf(s,u),hs(),s.memoizedState=null):(t!==null&&ta(s,null),gh(),hs());return St(t,s,h,r),s.child}function D_(t,s,r,a){var h=ch();return h=h===null?null:{parent:rt._currentValue,pool:h},s.memoizedState={baseLanes:r,cachePool:h},t!==null&&ta(s,null),gh(),__(s),t!==null&&Mn(t,s,a,!0),null}function ma(t,s){var r=s.ref;if(r===null)t!==null&&t.ref!==null&&(s.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(l(284));(t===null||t.ref!==r)&&(s.flags|=4194816)}}function Hh(t,s,r,a,h){return Ks(s),r=Sh(t,s,r,a,void 0,h),a=yh(),t!==null&&!ut?(bh(t,s,h),Wi(t,s,h)):(ke&&a&&ih(s),s.flags|=1,St(t,s,r,h),s.child)}function R_(t,s,r,a,h,u){return Ks(s),s.updateQueue=null,r=Df(s,a,r,h),Mf(t),a=yh(),t!==null&&!ut?(bh(t,s,u),Wi(t,s,u)):(ke&&a&&ih(s),s.flags|=1,St(t,s,r,u),s.child)}function T_(t,s,r,a,h){if(Ks(s),s.stateNode===null){var u=kr,g=r.contextType;typeof g=="object"&&g!==null&&(u=Et(g)),u=new r(a,u),s.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Lh,s.stateNode=u,u._reactInternals=s,u=s.stateNode,u.props=a,u.state=s.memoizedState,u.refs={},dh(s),g=r.contextType,u.context=typeof g=="object"&&g!==null?Et(g):kr,u.state=s.memoizedState,g=r.getDerivedStateFromProps,typeof g=="function"&&(Oh(s,r,g,a),u.state=s.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(g=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),g!==u.state&&Lh.enqueueReplaceState(u,u.state,null),On(s,a,u,h),zn(),u.state=s.memoizedState),typeof u.componentDidMount=="function"&&(s.flags|=4194308),a=!0}else if(t===null){u=s.stateNode;var p=s.memoizedProps,b=Gs(r,p);u.props=b;var T=u.context,j=r.contextType;g=kr,typeof j=="object"&&j!==null&&(g=Et(j));var V=r.getDerivedStateFromProps;j=typeof V=="function"||typeof u.getSnapshotBeforeUpdate=="function",p=s.pendingProps!==p,j||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(p||T!==g)&&g_(s,u,a,g),rs=!1;var A=s.memoizedState;u.state=A,On(s,a,u,h),zn(),T=s.memoizedState,p||A!==T||rs?(typeof V=="function"&&(Oh(s,r,V,a),T=s.memoizedState),(b=rs||v_(s,r,b,a,A,T,g))?(j||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(s.flags|=4194308)):(typeof u.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=a,s.memoizedState=T),u.props=a,u.state=T,u.context=g,a=b):(typeof u.componentDidMount=="function"&&(s.flags|=4194308),a=!1)}else{u=s.stateNode,fh(t,s),g=s.memoizedProps,j=Gs(r,g),u.props=j,V=s.pendingProps,A=u.context,T=r.contextType,b=kr,typeof T=="object"&&T!==null&&(b=Et(T)),p=r.getDerivedStateFromProps,(T=typeof p=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g!==V||A!==b)&&g_(s,u,a,b),rs=!1,A=s.memoizedState,u.state=A,On(s,a,u,h),zn();var z=s.memoizedState;g!==V||A!==z||rs||t!==null&&t.dependencies!==null&&Jl(t.dependencies)?(typeof p=="function"&&(Oh(s,r,p,a),z=s.memoizedState),(j=rs||v_(s,r,j,a,A,z,b)||t!==null&&t.dependencies!==null&&Jl(t.dependencies))?(T||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(a,z,b),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(a,z,b)),typeof u.componentDidUpdate=="function"&&(s.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof u.componentDidUpdate!="function"||g===t.memoizedProps&&A===t.memoizedState||(s.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===t.memoizedProps&&A===t.memoizedState||(s.flags|=1024),s.memoizedProps=a,s.memoizedState=z),u.props=a,u.state=z,u.context=b,a=j):(typeof u.componentDidUpdate!="function"||g===t.memoizedProps&&A===t.memoizedState||(s.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===t.memoizedProps&&A===t.memoizedState||(s.flags|=1024),a=!1)}return u=a,ma(t,s),a=(s.flags&128)!==0,u||a?(u=s.stateNode,r=a&&typeof r.getDerivedStateFromError!="function"?null:u.render(),s.flags|=1,t!==null&&a?(s.child=Nr(s,t.child,null,h),s.child=Nr(s,null,r,h)):St(t,s,r,h),s.memoizedState=u.state,t=s.child):t=Wi(t,s,h),t}function A_(t,s,r,a){return En(),s.flags|=256,St(t,s,r,a),s.child}var Uh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ph(t){return{baseLanes:t,cachePool:mf()}}function jh(t,s,r){return t=t!==null?t.childLanes&~r:0,s&&(t|=ai),t}function B_(t,s,r){var a=s.pendingProps,h=!1,u=(s.flags&128)!==0,g;if((g=u)||(g=t!==null&&t.memoizedState===null?!1:(nt.current&2)!==0),g&&(h=!0,s.flags&=-129),g=(s.flags&32)!==0,s.flags&=-33,t===null){if(ke){if(h?os(s):hs(),ke){var p=Ve,b;if(b=p){e:{for(b=p,p=yi;b.nodeType!==8;){if(!p){p=null;break e}if(b=gi(b.nextSibling),b===null){p=null;break e}}p=b}p!==null?(s.memoizedState={dehydrated:p,treeContext:Ps!==null?{id:Ni,overflow:Hi}:null,retryLane:536870912,hydrationErrors:null},b=Vt(18,null,null,0),b.stateNode=p,b.return=s,s.child=b,Tt=s,Ve=null,b=!0):b=!1}b||Ws(s)}if(p=s.memoizedState,p!==null&&(p=p.dehydrated,p!==null))return Cc(p)?s.lanes=32:s.lanes=536870912,null;qi(s)}return p=a.children,a=a.fallback,h?(hs(),h=s.mode,p=Sa({mode:"hidden",children:p},h),a=Us(a,h,r,null),p.return=s,a.return=s,p.sibling=a,s.child=p,h=s.child,h.memoizedState=Ph(r),h.childLanes=jh(t,g,r),s.memoizedState=Uh,a):(os(s),qh(s,p))}if(b=t.memoizedState,b!==null&&(p=b.dehydrated,p!==null)){if(u)s.flags&256?(os(s),s.flags&=-257,s=Wh(t,s,r)):s.memoizedState!==null?(hs(),s.child=t.child,s.flags|=128,s=null):(hs(),h=a.fallback,p=s.mode,a=Sa({mode:"visible",children:a.children},p),h=Us(h,p,r,null),h.flags|=2,a.return=s,h.return=s,a.sibling=h,s.child=a,Nr(s,t.child,null,r),a=s.child,a.memoizedState=Ph(r),a.childLanes=jh(t,g,r),s.memoizedState=Uh,s=h);else if(os(s),Cc(p)){if(g=p.nextSibling&&p.nextSibling.dataset,g)var T=g.dgst;g=T,a=Error(l(419)),a.stack="",a.digest=g,kn({value:a,source:null,stack:null}),s=Wh(t,s,r)}else if(ut||Mn(t,s,r,!1),g=(r&t.childLanes)!==0,ut||g){if(g=He,g!==null&&(a=r&-r,a=(a&42)!==0?1:xo(a),a=(a&(g.suspendedLanes|r))!==0?0:a,a!==0&&a!==b.retryLane))throw b.retryLane=a,Er(t,a),It(g,t,a),C_;p.data==="$?"||lc(),s=Wh(t,s,r)}else p.data==="$?"?(s.flags|=192,s.child=t.child,s=null):(t=b.treeContext,Ve=gi(p.nextSibling),Tt=s,ke=!0,qs=null,yi=!1,t!==null&&(ri[ni++]=Ni,ri[ni++]=Hi,ri[ni++]=Ps,Ni=t.id,Hi=t.overflow,Ps=s),s=qh(s,a.children),s.flags|=4096);return s}return h?(hs(),h=a.fallback,p=s.mode,b=t.child,T=b.sibling,a=Li(b,{mode:"hidden",children:a.children}),a.subtreeFlags=b.subtreeFlags&65011712,T!==null?h=Li(T,h):(h=Us(h,p,r,null),h.flags|=2),h.return=s,a.return=s,a.sibling=h,s.child=a,a=h,h=s.child,p=t.child.memoizedState,p===null?p=Ph(r):(b=p.cachePool,b!==null?(T=rt._currentValue,b=b.parent!==T?{parent:T,pool:T}:b):b=mf(),p={baseLanes:p.baseLanes|r,cachePool:b}),h.memoizedState=p,h.childLanes=jh(t,g,r),s.memoizedState=Uh,a):(os(s),r=t.child,t=r.sibling,r=Li(r,{mode:"visible",children:a.children}),r.return=s,r.sibling=null,t!==null&&(g=s.deletions,g===null?(s.deletions=[t],s.flags|=16):g.push(t)),s.child=r,s.memoizedState=null,r)}function qh(t,s){return s=Sa({mode:"visible",children:s},t.mode),s.return=t,t.child=s}function Sa(t,s){return t=Vt(22,t,null,s),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function Wh(t,s,r){return Nr(s,t.child,null,r),t=qh(s,s.pendingProps.children),t.flags|=2,s.memoizedState=null,t}function z_(t,s,r){t.lanes|=s;var a=t.alternate;a!==null&&(a.lanes|=s),lh(t.return,s,r)}function Yh(t,s,r,a,h){var u=t.memoizedState;u===null?t.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:a,tail:r,tailMode:h}:(u.isBackwards=s,u.rendering=null,u.renderingStartTime=0,u.last=a,u.tail=r,u.tailMode=h)}function O_(t,s,r){var a=s.pendingProps,h=a.revealOrder,u=a.tail;if(St(t,s,a.children,r),a=nt.current,(a&2)!==0)a=a&1|2,s.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=s.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&z_(t,r,s);else if(t.tag===19)z_(t,r,s);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===s)break e;for(;t.sibling===null;){if(t.return===null||t.return===s)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}a&=1}switch(I(nt,a),h){case"forwards":for(r=s.child,h=null;r!==null;)t=r.alternate,t!==null&&va(t)===null&&(h=r),r=r.sibling;r=h,r===null?(h=s.child,s.child=null):(h=r.sibling,r.sibling=null),Yh(s,!1,h,r,u);break;case"backwards":for(r=null,h=s.child,s.child=null;h!==null;){if(t=h.alternate,t!==null&&va(t)===null){s.child=h;break}t=h.sibling,h.sibling=r,r=h,h=t}Yh(s,!0,r,null,u);break;case"together":Yh(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Wi(t,s,r){if(t!==null&&(s.dependencies=t.dependencies),_s|=s.lanes,(r&s.childLanes)===0)if(t!==null){if(Mn(t,s,r,!1),(r&s.childLanes)===0)return null}else return null;if(t!==null&&s.child!==t.child)throw Error(l(153));if(s.child!==null){for(t=s.child,r=Li(t,t.pendingProps),s.child=r,r.return=s;t.sibling!==null;)t=t.sibling,r=r.sibling=Li(t,t.pendingProps),r.return=s;r.sibling=null}return s.child}function Kh(t,s){return(t.lanes&s)!==0?!0:(t=t.dependencies,!!(t!==null&&Jl(t)))}function pS(t,s,r){switch(s.tag){case 3:Me(s,s.stateNode.containerInfo),ss(s,rt,t.memoizedState.cache),En();break;case 27:case 5:Ji(s);break;case 4:Me(s,s.stateNode.containerInfo);break;case 10:ss(s,s.type,s.memoizedProps.value);break;case 13:var a=s.memoizedState;if(a!==null)return a.dehydrated!==null?(os(s),s.flags|=128,null):(r&s.child.childLanes)!==0?B_(t,s,r):(os(s),t=Wi(t,s,r),t!==null?t.sibling:null);os(s);break;case 19:var h=(t.flags&128)!==0;if(a=(r&s.childLanes)!==0,a||(Mn(t,s,r,!1),a=(r&s.childLanes)!==0),h){if(a)return O_(t,s,r);s.flags|=128}if(h=s.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),I(nt,nt.current),a)break;return null;case 22:case 23:return s.lanes=0,M_(t,s,r);case 24:ss(s,rt,t.memoizedState.cache)}return Wi(t,s,r)}function L_(t,s,r){if(t!==null)if(t.memoizedProps!==s.pendingProps)ut=!0;else{if(!Kh(t,r)&&(s.flags&128)===0)return ut=!1,pS(t,s,r);ut=(t.flags&131072)!==0}else ut=!1,ke&&(s.flags&1048576)!==0&&uf(s,Ql,s.index);switch(s.lanes=0,s.tag){case 16:e:{t=s.pendingProps;var a=s.elementType,h=a._init;if(a=h(a._payload),s.type=a,typeof a=="function")Jo(a)?(t=Gs(a,t),s.tag=1,s=T_(null,s,a,t,r)):(s.tag=0,s=Hh(null,s,a,t,r));else{if(a!=null){if(h=a.$$typeof,h===q){s.tag=11,s=x_(null,s,a,t,r);break e}else if(h===le){s.tag=14,s=E_(null,s,a,t,r);break e}}throw s=F(a)||a,Error(l(306,s,""))}}return s;case 0:return Hh(t,s,s.type,s.pendingProps,r);case 1:return a=s.type,h=Gs(a,s.pendingProps),T_(t,s,a,h,r);case 3:e:{if(Me(s,s.stateNode.containerInfo),t===null)throw Error(l(387));a=s.pendingProps;var u=s.memoizedState;h=u.element,fh(t,s),On(s,a,null,r);var g=s.memoizedState;if(a=g.cache,ss(s,rt,a),a!==u.cache&&ah(s,[rt],r,!0),zn(),a=g.element,u.isDehydrated)if(u={element:a,isDehydrated:!1,cache:g.cache},s.updateQueue.baseState=u,s.memoizedState=u,s.flags&256){s=A_(t,s,a,r);break e}else if(a!==h){h=ii(Error(l(424)),s),kn(h),s=A_(t,s,a,r);break e}else{switch(t=s.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Ve=gi(t.firstChild),Tt=s,ke=!0,qs=null,yi=!0,r=f_(s,null,a,r),s.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(En(),a===h){s=Wi(t,s,r);break e}St(t,s,a,r)}s=s.child}return s;case 26:return ma(t,s),t===null?(r=Pv(s.type,null,s.pendingProps,null))?s.memoizedState=r:ke||(r=s.type,t=s.pendingProps,a=za(re.current).createElement(r),a[xt]=s,a[Lt]=t,bt(a,r,t),ct(a),s.stateNode=a):s.memoizedState=Pv(s.type,t.memoizedProps,s.pendingProps,t.memoizedState),null;case 27:return Ji(s),t===null&&ke&&(a=s.stateNode=Nv(s.type,s.pendingProps,re.current),Tt=s,yi=!0,h=Ve,ms(s.type)?(xc=h,Ve=gi(a.firstChild)):Ve=h),St(t,s,s.pendingProps.children,r),ma(t,s),t===null&&(s.flags|=4194304),s.child;case 5:return t===null&&ke&&((h=a=Ve)&&(a=VS(a,s.type,s.pendingProps,yi),a!==null?(s.stateNode=a,Tt=s,Ve=gi(a.firstChild),yi=!1,h=!0):h=!1),h||Ws(s)),Ji(s),h=s.type,u=s.pendingProps,g=t!==null?t.memoizedProps:null,a=u.children,yc(h,u)?a=null:g!==null&&yc(h,g)&&(s.flags|=32),s.memoizedState!==null&&(h=Sh(t,s,hS,null,null,r),il._currentValue=h),ma(t,s),St(t,s,a,r),s.child;case 6:return t===null&&ke&&((t=r=Ve)&&(r=XS(r,s.pendingProps,yi),r!==null?(s.stateNode=r,Tt=s,Ve=null,t=!0):t=!1),t||Ws(s)),null;case 13:return B_(t,s,r);case 4:return Me(s,s.stateNode.containerInfo),a=s.pendingProps,t===null?s.child=Nr(s,null,a,r):St(t,s,a,r),s.child;case 11:return x_(t,s,s.type,s.pendingProps,r);case 7:return St(t,s,s.pendingProps,r),s.child;case 8:return St(t,s,s.pendingProps.children,r),s.child;case 12:return St(t,s,s.pendingProps.children,r),s.child;case 10:return a=s.pendingProps,ss(s,s.type,a.value),St(t,s,a.children,r),s.child;case 9:return h=s.type._context,a=s.pendingProps.children,Ks(s),h=Et(h),a=a(h),s.flags|=1,St(t,s,a,r),s.child;case 14:return E_(t,s,s.type,s.pendingProps,r);case 15:return k_(t,s,s.type,s.pendingProps,r);case 19:return O_(t,s,r);case 31:return a=s.pendingProps,r=s.mode,a={mode:a.mode,children:a.children},t===null?(r=Sa(a,r),r.ref=s.ref,s.child=r,r.return=s,s=r):(r=Li(t.child,a),r.ref=s.ref,s.child=r,r.return=s,s=r),s;case 22:return M_(t,s,r);case 24:return Ks(s),a=Et(rt),t===null?(h=ch(),h===null&&(h=He,u=oh(),h.pooledCache=u,u.refCount++,u!==null&&(h.pooledCacheLanes|=r),h=u),s.memoizedState={parent:a,cache:h},dh(s),ss(s,rt,h)):((t.lanes&r)!==0&&(fh(t,s),On(s,null,null,r),zn()),h=t.memoizedState,u=s.memoizedState,h.parent!==a?(h={parent:a,cache:a},s.memoizedState=h,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=h),ss(s,rt,a)):(a=u.cache,ss(s,rt,a),a!==h.cache&&ah(s,[rt],r,!0))),St(t,s,s.pendingProps.children,r),s.child;case 29:throw s.pendingProps}throw Error(l(156,s.tag))}function Yi(t){t.flags|=4}function N_(t,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Kv(s)){if(s=li.current,s!==null&&((Ce&4194048)===Ce?bi!==null:(Ce&62914560)!==Ce&&(Ce&536870912)===0||s!==bi))throw An=uh,Sf;t.flags|=8192}}function ya(t,s){s!==null&&(t.flags|=4),t.flags&16384&&(s=t.tag!==22?fd():536870912,t.lanes|=s,jr|=s)}function qn(t,s){if(!ke)switch(t.tailMode){case"hidden":s=t.tail;for(var r=null;s!==null;)s.alternate!==null&&(r=s),s=s.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?s||t.tail===null?t.tail=null:t.tail.sibling=null:a.sibling=null}}function We(t){var s=t.alternate!==null&&t.alternate.child===t.child,r=0,a=0;if(s)for(var h=t.child;h!==null;)r|=h.lanes|h.childLanes,a|=h.subtreeFlags&65011712,a|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)r|=h.lanes|h.childLanes,a|=h.subtreeFlags,a|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=a,t.childLanes=r,s}function mS(t,s,r){var a=s.pendingProps;switch(sh(s),s.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(s),null;case 1:return We(s),null;case 3:return r=s.stateNode,a=null,t!==null&&(a=t.memoizedState.cache),s.memoizedState.cache!==a&&(s.flags|=2048),Pi(rt),st(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(xn(s)?Yi(s):t===null||t.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,_f())),We(s),null;case 26:return r=s.memoizedState,t===null?(Yi(s),r!==null?(We(s),N_(s,r)):(We(s),s.flags&=-16777217)):r?r!==t.memoizedState?(Yi(s),We(s),N_(s,r)):(We(s),s.flags&=-16777217):(t.memoizedProps!==a&&Yi(s),We(s),s.flags&=-16777217),null;case 27:mi(s),r=re.current;var h=s.type;if(t!==null&&s.stateNode!=null)t.memoizedProps!==a&&Yi(s);else{if(!a){if(s.stateNode===null)throw Error(l(166));return We(s),null}t=se.current,xn(s)?df(s):(t=Nv(h,a,r),s.stateNode=t,Yi(s))}return We(s),null;case 5:if(mi(s),r=s.type,t!==null&&s.stateNode!=null)t.memoizedProps!==a&&Yi(s);else{if(!a){if(s.stateNode===null)throw Error(l(166));return We(s),null}if(t=se.current,xn(s))df(s);else{switch(h=za(re.current),t){case 1:t=h.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:t=h.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":t=h.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":t=h.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":t=h.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof a.is=="string"?h.createElement("select",{is:a.is}):h.createElement("select"),a.multiple?t.multiple=!0:a.size&&(t.size=a.size);break;default:t=typeof a.is=="string"?h.createElement(r,{is:a.is}):h.createElement(r)}}t[xt]=s,t[Lt]=a;e:for(h=s.child;h!==null;){if(h.tag===5||h.tag===6)t.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===s)break e;for(;h.sibling===null;){if(h.return===null||h.return===s)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}s.stateNode=t;e:switch(bt(t,r,a),r){case"button":case"input":case"select":case"textarea":t=!!a.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&Yi(s)}}return We(s),s.flags&=-16777217,null;case 6:if(t&&s.stateNode!=null)t.memoizedProps!==a&&Yi(s);else{if(typeof a!="string"&&s.stateNode===null)throw Error(l(166));if(t=re.current,xn(s)){if(t=s.stateNode,r=s.memoizedProps,a=null,h=Tt,h!==null)switch(h.tag){case 27:case 5:a=h.memoizedProps}t[xt]=s,t=!!(t.nodeValue===r||a!==null&&a.suppressHydrationWarning===!0||Rv(t.nodeValue,r)),t||Ws(s)}else t=za(t).createTextNode(a),t[xt]=s,s.stateNode=t}return We(s),null;case 13:if(a=s.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=xn(s),a!==null&&a.dehydrated!==null){if(t===null){if(!h)throw Error(l(318));if(h=s.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(l(317));h[xt]=s}else En(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;We(s),h=!1}else h=_f(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return s.flags&256?(qi(s),s):(qi(s),null)}if(qi(s),(s.flags&128)!==0)return s.lanes=r,s;if(r=a!==null,t=t!==null&&t.memoizedState!==null,r){a=s.child,h=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(h=a.alternate.memoizedState.cachePool.pool);var u=null;a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==h&&(a.flags|=2048)}return r!==t&&r&&(s.child.flags|=8192),ya(s,s.updateQueue),We(s),null;case 4:return st(),t===null&&vc(s.stateNode.containerInfo),We(s),null;case 10:return Pi(s.type),We(s),null;case 19:if(J(nt),h=s.memoizedState,h===null)return We(s),null;if(a=(s.flags&128)!==0,u=h.rendering,u===null)if(a)qn(h,!1);else{if(Xe!==0||t!==null&&(t.flags&128)!==0)for(t=s.child;t!==null;){if(u=va(t),u!==null){for(s.flags|=128,qn(h,!1),t=u.updateQueue,s.updateQueue=t,ya(s,t),s.subtreeFlags=0,t=r,r=s.child;r!==null;)cf(r,t),r=r.sibling;return I(nt,nt.current&1|2),s.child}t=t.sibling}h.tail!==null&&Si()>Ca&&(s.flags|=128,a=!0,qn(h,!1),s.lanes=4194304)}else{if(!a)if(t=va(u),t!==null){if(s.flags|=128,a=!0,t=t.updateQueue,s.updateQueue=t,ya(s,t),qn(h,!0),h.tail===null&&h.tailMode==="hidden"&&!u.alternate&&!ke)return We(s),null}else 2*Si()-h.renderingStartTime>Ca&&r!==536870912&&(s.flags|=128,a=!0,qn(h,!1),s.lanes=4194304);h.isBackwards?(u.sibling=s.child,s.child=u):(t=h.last,t!==null?t.sibling=u:s.child=u,h.last=u)}return h.tail!==null?(s=h.tail,h.rendering=s,h.tail=s.sibling,h.renderingStartTime=Si(),s.sibling=null,t=nt.current,I(nt,a?t&1|2:t&1),s):(We(s),null);case 22:case 23:return qi(s),ph(),a=s.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(s.flags|=8192):a&&(s.flags|=8192),a?(r&536870912)!==0&&(s.flags&128)===0&&(We(s),s.subtreeFlags&6&&(s.flags|=8192)):We(s),r=s.updateQueue,r!==null&&ya(s,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),a=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),a!==r&&(s.flags|=2048),t!==null&&J(Vs),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),s.memoizedState.cache!==r&&(s.flags|=2048),Pi(rt),We(s),null;case 25:return null;case 30:return null}throw Error(l(156,s.tag))}function SS(t,s){switch(sh(s),s.tag){case 1:return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return Pi(rt),st(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 26:case 27:case 5:return mi(s),null;case 13:if(qi(s),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(l(340));En()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return J(nt),null;case 4:return st(),null;case 10:return Pi(s.type),null;case 22:case 23:return qi(s),ph(),t!==null&&J(Vs),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 24:return Pi(rt),null;case 25:return null;default:return null}}function H_(t,s){switch(sh(s),s.tag){case 3:Pi(rt),st();break;case 26:case 27:case 5:mi(s);break;case 4:st();break;case 13:qi(s);break;case 19:J(nt);break;case 10:Pi(s.type);break;case 22:case 23:qi(s),ph(),t!==null&&J(Vs);break;case 24:Pi(rt)}}function Wn(t,s){try{var r=s.updateQueue,a=r!==null?r.lastEffect:null;if(a!==null){var h=a.next;r=h;do{if((r.tag&t)===t){a=void 0;var u=r.create,g=r.inst;a=u(),g.destroy=a}r=r.next}while(r!==h)}}catch(p){Ne(s,s.return,p)}}function cs(t,s,r){try{var a=s.updateQueue,h=a!==null?a.lastEffect:null;if(h!==null){var u=h.next;a=u;do{if((a.tag&t)===t){var g=a.inst,p=g.destroy;if(p!==void 0){g.destroy=void 0,h=s;var b=r,T=p;try{T()}catch(j){Ne(h,b,j)}}}a=a.next}while(a!==u)}}catch(j){Ne(s,s.return,j)}}function U_(t){var s=t.updateQueue;if(s!==null){var r=t.stateNode;try{Ef(s,r)}catch(a){Ne(t,t.return,a)}}}function P_(t,s,r){r.props=Gs(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(a){Ne(t,s,a)}}function Yn(t,s){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:a=t.stateNode;break;default:a=t.stateNode}typeof r=="function"?t.refCleanup=r(a):r.current=a}}catch(h){Ne(t,s,h)}}function wi(t,s){var r=t.ref,a=t.refCleanup;if(r!==null)if(typeof a=="function")try{a()}catch(h){Ne(t,s,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(h){Ne(t,s,h)}else r.current=null}function j_(t){var s=t.type,r=t.memoizedProps,a=t.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":r.autoFocus&&a.focus();break e;case"img":r.src?a.src=r.src:r.srcSet&&(a.srcset=r.srcSet)}}catch(h){Ne(t,t.return,h)}}function Vh(t,s,r){try{var a=t.stateNode;jS(a,t.type,r,s),a[Lt]=s}catch(h){Ne(t,t.return,h)}}function q_(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ms(t.type)||t.tag===4}function Xh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||q_(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ms(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Gh(t,s,r){var a=t.tag;if(a===5||a===6)t=t.stateNode,s?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(t,s):(s=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.appendChild(t),r=r._reactRootContainer,r!=null||s.onclick!==null||(s.onclick=Ba));else if(a!==4&&(a===27&&ms(t.type)&&(r=t.stateNode,s=null),t=t.child,t!==null))for(Gh(t,s,r),t=t.sibling;t!==null;)Gh(t,s,r),t=t.sibling}function ba(t,s,r){var a=t.tag;if(a===5||a===6)t=t.stateNode,s?r.insertBefore(t,s):r.appendChild(t);else if(a!==4&&(a===27&&ms(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(ba(t,s,r),t=t.sibling;t!==null;)ba(t,s,r),t=t.sibling}function W_(t){var s=t.stateNode,r=t.memoizedProps;try{for(var a=t.type,h=s.attributes;h.length;)s.removeAttributeNode(h[0]);bt(s,a,r),s[xt]=t,s[Lt]=r}catch(u){Ne(t,t.return,u)}}var Ki=!1,Ie=!1,$h=!1,Y_=typeof WeakSet=="function"?WeakSet:Set,dt=null;function yS(t,s){if(t=t.containerInfo,mc=Pa,t=Jd(t),Xo(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var a=r.getSelection&&r.getSelection();if(a&&a.rangeCount!==0){r=a.anchorNode;var h=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{r.nodeType,u.nodeType}catch{r=null;break e}var g=0,p=-1,b=-1,T=0,j=0,V=t,A=null;t:for(;;){for(var z;V!==r||h!==0&&V.nodeType!==3||(p=g+h),V!==u||a!==0&&V.nodeType!==3||(b=g+a),V.nodeType===3&&(g+=V.nodeValue.length),(z=V.firstChild)!==null;)A=V,V=z;for(;;){if(V===t)break t;if(A===r&&++T===h&&(p=g),A===u&&++j===a&&(b=g),(z=V.nextSibling)!==null)break;V=A,A=V.parentNode}V=z}r=p===-1||b===-1?null:{start:p,end:b}}else r=null}r=r||{start:0,end:0}}else r=null;for(Sc={focusedElem:t,selectionRange:r},Pa=!1,dt=s;dt!==null;)if(s=dt,t=s.child,(s.subtreeFlags&1024)!==0&&t!==null)t.return=s,dt=t;else for(;dt!==null;){switch(s=dt,u=s.alternate,t=s.flags,s.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&u!==null){t=void 0,r=s,h=u.memoizedProps,u=u.memoizedState,a=r.stateNode;try{var ue=Gs(r.type,h,r.elementType===r.type);t=a.getSnapshotBeforeUpdate(ue,u),a.__reactInternalSnapshotBeforeUpdate=t}catch(he){Ne(r,r.return,he)}}break;case 3:if((t&1024)!==0){if(t=s.stateNode.containerInfo,r=t.nodeType,r===9)wc(t);else if(r===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":wc(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(l(163))}if(t=s.sibling,t!==null){t.return=s.return,dt=t;break}dt=s.return}}function K_(t,s,r){var a=r.flags;switch(r.tag){case 0:case 11:case 15:us(t,r),a&4&&Wn(5,r);break;case 1:if(us(t,r),a&4)if(t=r.stateNode,s===null)try{t.componentDidMount()}catch(g){Ne(r,r.return,g)}else{var h=Gs(r.type,s.memoizedProps);s=s.memoizedState;try{t.componentDidUpdate(h,s,t.__reactInternalSnapshotBeforeUpdate)}catch(g){Ne(r,r.return,g)}}a&64&&U_(r),a&512&&Yn(r,r.return);break;case 3:if(us(t,r),a&64&&(t=r.updateQueue,t!==null)){if(s=null,r.child!==null)switch(r.child.tag){case 27:case 5:s=r.child.stateNode;break;case 1:s=r.child.stateNode}try{Ef(t,s)}catch(g){Ne(r,r.return,g)}}break;case 27:s===null&&a&4&&W_(r);case 26:case 5:us(t,r),s===null&&a&4&&j_(r),a&512&&Yn(r,r.return);break;case 12:us(t,r);break;case 13:us(t,r),a&4&&G_(t,r),a&64&&(t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(r=RS.bind(null,r),GS(t,r))));break;case 22:if(a=r.memoizedState!==null||Ki,!a){s=s!==null&&s.memoizedState!==null||Ie,h=Ki;var u=Ie;Ki=a,(Ie=s)&&!u?ds(t,r,(r.subtreeFlags&8772)!==0):us(t,r),Ki=h,Ie=u}break;case 30:break;default:us(t,r)}}function V_(t){var s=t.alternate;s!==null&&(t.alternate=null,V_(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&Mo(s)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var je=null,Ut=!1;function Vi(t,s,r){for(r=r.child;r!==null;)X_(t,s,r),r=r.sibling}function X_(t,s,r){if(Wt&&typeof Wt.onCommitFiberUnmount=="function")try{Wt.onCommitFiberUnmount(cn,r)}catch{}switch(r.tag){case 26:Ie||wi(r,s),Vi(t,s,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:Ie||wi(r,s);var a=je,h=Ut;ms(r.type)&&(je=r.stateNode,Ut=!1),Vi(t,s,r),Qn(r.stateNode),je=a,Ut=h;break;case 5:Ie||wi(r,s);case 6:if(a=je,h=Ut,je=null,Vi(t,s,r),je=a,Ut=h,je!==null)if(Ut)try{(je.nodeType===9?je.body:je.nodeName==="HTML"?je.ownerDocument.body:je).removeChild(r.stateNode)}catch(u){Ne(r,s,u)}else try{je.removeChild(r.stateNode)}catch(u){Ne(r,s,u)}break;case 18:je!==null&&(Ut?(t=je,Ov(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,r.stateNode),ll(t)):Ov(je,r.stateNode));break;case 4:a=je,h=Ut,je=r.stateNode.containerInfo,Ut=!0,Vi(t,s,r),je=a,Ut=h;break;case 0:case 11:case 14:case 15:Ie||cs(2,r,s),Ie||cs(4,r,s),Vi(t,s,r);break;case 1:Ie||(wi(r,s),a=r.stateNode,typeof a.componentWillUnmount=="function"&&P_(r,s,a)),Vi(t,s,r);break;case 21:Vi(t,s,r);break;case 22:Ie=(a=Ie)||r.memoizedState!==null,Vi(t,s,r),Ie=a;break;default:Vi(t,s,r)}}function G_(t,s){if(s.memoizedState===null&&(t=s.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ll(t)}catch(r){Ne(s,s.return,r)}}function bS(t){switch(t.tag){case 13:case 19:var s=t.stateNode;return s===null&&(s=t.stateNode=new Y_),s;case 22:return t=t.stateNode,s=t._retryCache,s===null&&(s=t._retryCache=new Y_),s;default:throw Error(l(435,t.tag))}}function Fh(t,s){var r=bS(t);s.forEach(function(a){var h=TS.bind(null,t,a);r.has(a)||(r.add(a),a.then(h,h))})}function Xt(t,s){var r=s.deletions;if(r!==null)for(var a=0;a<r.length;a++){var h=r[a],u=t,g=s,p=g;e:for(;p!==null;){switch(p.tag){case 27:if(ms(p.type)){je=p.stateNode,Ut=!1;break e}break;case 5:je=p.stateNode,Ut=!1;break e;case 3:case 4:je=p.stateNode.containerInfo,Ut=!0;break e}p=p.return}if(je===null)throw Error(l(160));X_(u,g,h),je=null,Ut=!1,u=h.alternate,u!==null&&(u.return=null),h.return=null}if(s.subtreeFlags&13878)for(s=s.child;s!==null;)$_(s,t),s=s.sibling}var vi=null;function $_(t,s){var r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Xt(s,t),Gt(t),a&4&&(cs(3,t,t.return),Wn(3,t),cs(5,t,t.return));break;case 1:Xt(s,t),Gt(t),a&512&&(Ie||r===null||wi(r,r.return)),a&64&&Ki&&(t=t.updateQueue,t!==null&&(a=t.callbacks,a!==null&&(r=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=r===null?a:r.concat(a))));break;case 26:var h=vi;if(Xt(s,t),Gt(t),a&512&&(Ie||r===null||wi(r,r.return)),a&4){var u=r!==null?r.memoizedState:null;if(a=t.memoizedState,r===null)if(a===null)if(t.stateNode===null){e:{a=t.type,r=t.memoizedProps,h=h.ownerDocument||h;t:switch(a){case"title":u=h.getElementsByTagName("title")[0],(!u||u[fn]||u[xt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=h.createElement(a),h.head.insertBefore(u,h.querySelector("head > title"))),bt(u,a,r),u[xt]=t,ct(u),a=u;break e;case"link":var g=Wv("link","href",h).get(a+(r.href||""));if(g){for(var p=0;p<g.length;p++)if(u=g[p],u.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&u.getAttribute("rel")===(r.rel==null?null:r.rel)&&u.getAttribute("title")===(r.title==null?null:r.title)&&u.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){g.splice(p,1);break t}}u=h.createElement(a),bt(u,a,r),h.head.appendChild(u);break;case"meta":if(g=Wv("meta","content",h).get(a+(r.content||""))){for(p=0;p<g.length;p++)if(u=g[p],u.getAttribute("content")===(r.content==null?null:""+r.content)&&u.getAttribute("name")===(r.name==null?null:r.name)&&u.getAttribute("property")===(r.property==null?null:r.property)&&u.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&u.getAttribute("charset")===(r.charSet==null?null:r.charSet)){g.splice(p,1);break t}}u=h.createElement(a),bt(u,a,r),h.head.appendChild(u);break;default:throw Error(l(468,a))}u[xt]=t,ct(u),a=u}t.stateNode=a}else Yv(h,t.type,t.stateNode);else t.stateNode=qv(h,a,t.memoizedProps);else u!==a?(u===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):u.count--,a===null?Yv(h,t.type,t.stateNode):qv(h,a,t.memoizedProps)):a===null&&t.stateNode!==null&&Vh(t,t.memoizedProps,r.memoizedProps)}break;case 27:Xt(s,t),Gt(t),a&512&&(Ie||r===null||wi(r,r.return)),r!==null&&a&4&&Vh(t,t.memoizedProps,r.memoizedProps);break;case 5:if(Xt(s,t),Gt(t),a&512&&(Ie||r===null||wi(r,r.return)),t.flags&32){h=t.stateNode;try{mr(h,"")}catch(z){Ne(t,t.return,z)}}a&4&&t.stateNode!=null&&(h=t.memoizedProps,Vh(t,h,r!==null?r.memoizedProps:h)),a&1024&&($h=!0);break;case 6:if(Xt(s,t),Gt(t),a&4){if(t.stateNode===null)throw Error(l(162));a=t.memoizedProps,r=t.stateNode;try{r.nodeValue=a}catch(z){Ne(t,t.return,z)}}break;case 3:if(Na=null,h=vi,vi=Oa(s.containerInfo),Xt(s,t),vi=h,Gt(t),a&4&&r!==null&&r.memoizedState.isDehydrated)try{ll(s.containerInfo)}catch(z){Ne(t,t.return,z)}$h&&($h=!1,F_(t));break;case 4:a=vi,vi=Oa(t.stateNode.containerInfo),Xt(s,t),Gt(t),vi=a;break;case 12:Xt(s,t),Gt(t);break;case 13:Xt(s,t),Gt(t),t.child.flags&8192&&t.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(tc=Si()),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,Fh(t,a)));break;case 22:h=t.memoizedState!==null;var b=r!==null&&r.memoizedState!==null,T=Ki,j=Ie;if(Ki=T||h,Ie=j||b,Xt(s,t),Ie=j,Ki=T,Gt(t),a&8192)e:for(s=t.stateNode,s._visibility=h?s._visibility&-2:s._visibility|1,h&&(r===null||b||Ki||Ie||$s(t)),r=null,s=t;;){if(s.tag===5||s.tag===26){if(r===null){b=r=s;try{if(u=b.stateNode,h)g=u.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{p=b.stateNode;var V=b.memoizedProps.style,A=V!=null&&V.hasOwnProperty("display")?V.display:null;p.style.display=A==null||typeof A=="boolean"?"":(""+A).trim()}}catch(z){Ne(b,b.return,z)}}}else if(s.tag===6){if(r===null){b=s;try{b.stateNode.nodeValue=h?"":b.memoizedProps}catch(z){Ne(b,b.return,z)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===t)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;r===s&&(r=null),s=s.return}r===s&&(r=null),s.sibling.return=s.return,s=s.sibling}a&4&&(a=t.updateQueue,a!==null&&(r=a.retryQueue,r!==null&&(a.retryQueue=null,Fh(t,r))));break;case 19:Xt(s,t),Gt(t),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,Fh(t,a)));break;case 30:break;case 21:break;default:Xt(s,t),Gt(t)}}function Gt(t){var s=t.flags;if(s&2){try{for(var r,a=t.return;a!==null;){if(q_(a)){r=a;break}a=a.return}if(r==null)throw Error(l(160));switch(r.tag){case 27:var h=r.stateNode,u=Xh(t);ba(t,u,h);break;case 5:var g=r.stateNode;r.flags&32&&(mr(g,""),r.flags&=-33);var p=Xh(t);ba(t,p,g);break;case 3:case 4:var b=r.stateNode.containerInfo,T=Xh(t);Gh(t,T,b);break;default:throw Error(l(161))}}catch(j){Ne(t,t.return,j)}t.flags&=-3}s&4096&&(t.flags&=-4097)}function F_(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var s=t;F_(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),t=t.sibling}}function us(t,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)K_(t,s.alternate,s),s=s.sibling}function $s(t){for(t=t.child;t!==null;){var s=t;switch(s.tag){case 0:case 11:case 14:case 15:cs(4,s,s.return),$s(s);break;case 1:wi(s,s.return);var r=s.stateNode;typeof r.componentWillUnmount=="function"&&P_(s,s.return,r),$s(s);break;case 27:Qn(s.stateNode);case 26:case 5:wi(s,s.return),$s(s);break;case 22:s.memoizedState===null&&$s(s);break;case 30:$s(s);break;default:$s(s)}t=t.sibling}}function ds(t,s,r){for(r=r&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var a=s.alternate,h=t,u=s,g=u.flags;switch(u.tag){case 0:case 11:case 15:ds(h,u,r),Wn(4,u);break;case 1:if(ds(h,u,r),a=u,h=a.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(T){Ne(a,a.return,T)}if(a=u,h=a.updateQueue,h!==null){var p=a.stateNode;try{var b=h.shared.hiddenCallbacks;if(b!==null)for(h.shared.hiddenCallbacks=null,h=0;h<b.length;h++)xf(b[h],p)}catch(T){Ne(a,a.return,T)}}r&&g&64&&U_(u),Yn(u,u.return);break;case 27:W_(u);case 26:case 5:ds(h,u,r),r&&a===null&&g&4&&j_(u),Yn(u,u.return);break;case 12:ds(h,u,r);break;case 13:ds(h,u,r),r&&g&4&&G_(h,u);break;case 22:u.memoizedState===null&&ds(h,u,r),Yn(u,u.return);break;case 30:break;default:ds(h,u,r)}s=s.sibling}}function Ih(t,s){var r=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),t=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(t=s.memoizedState.cachePool.pool),t!==r&&(t!=null&&t.refCount++,r!=null&&Dn(r))}function Zh(t,s){t=null,s.alternate!==null&&(t=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==t&&(s.refCount++,t!=null&&Dn(t))}function Ci(t,s,r,a){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)I_(t,s,r,a),s=s.sibling}function I_(t,s,r,a){var h=s.flags;switch(s.tag){case 0:case 11:case 15:Ci(t,s,r,a),h&2048&&Wn(9,s);break;case 1:Ci(t,s,r,a);break;case 3:Ci(t,s,r,a),h&2048&&(t=null,s.alternate!==null&&(t=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==t&&(s.refCount++,t!=null&&Dn(t)));break;case 12:if(h&2048){Ci(t,s,r,a),t=s.stateNode;try{var u=s.memoizedProps,g=u.id,p=u.onPostCommit;typeof p=="function"&&p(g,s.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(b){Ne(s,s.return,b)}}else Ci(t,s,r,a);break;case 13:Ci(t,s,r,a);break;case 23:break;case 22:u=s.stateNode,g=s.alternate,s.memoizedState!==null?u._visibility&2?Ci(t,s,r,a):Kn(t,s):u._visibility&2?Ci(t,s,r,a):(u._visibility|=2,Hr(t,s,r,a,(s.subtreeFlags&10256)!==0)),h&2048&&Ih(g,s);break;case 24:Ci(t,s,r,a),h&2048&&Zh(s.alternate,s);break;default:Ci(t,s,r,a)}}function Hr(t,s,r,a,h){for(h=h&&(s.subtreeFlags&10256)!==0,s=s.child;s!==null;){var u=t,g=s,p=r,b=a,T=g.flags;switch(g.tag){case 0:case 11:case 15:Hr(u,g,p,b,h),Wn(8,g);break;case 23:break;case 22:var j=g.stateNode;g.memoizedState!==null?j._visibility&2?Hr(u,g,p,b,h):Kn(u,g):(j._visibility|=2,Hr(u,g,p,b,h)),h&&T&2048&&Ih(g.alternate,g);break;case 24:Hr(u,g,p,b,h),h&&T&2048&&Zh(g.alternate,g);break;default:Hr(u,g,p,b,h)}s=s.sibling}}function Kn(t,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var r=t,a=s,h=a.flags;switch(a.tag){case 22:Kn(r,a),h&2048&&Ih(a.alternate,a);break;case 24:Kn(r,a),h&2048&&Zh(a.alternate,a);break;default:Kn(r,a)}s=s.sibling}}var Vn=8192;function Ur(t){if(t.subtreeFlags&Vn)for(t=t.child;t!==null;)Z_(t),t=t.sibling}function Z_(t){switch(t.tag){case 26:Ur(t),t.flags&Vn&&t.memoizedState!==null&&ly(vi,t.memoizedState,t.memoizedProps);break;case 5:Ur(t);break;case 3:case 4:var s=vi;vi=Oa(t.stateNode.containerInfo),Ur(t),vi=s;break;case 22:t.memoizedState===null&&(s=t.alternate,s!==null&&s.memoizedState!==null?(s=Vn,Vn=16777216,Ur(t),Vn=s):Ur(t));break;default:Ur(t)}}function Q_(t){var s=t.alternate;if(s!==null&&(t=s.child,t!==null)){s.child=null;do s=t.sibling,t.sibling=null,t=s;while(t!==null)}}function Xn(t){var s=t.deletions;if((t.flags&16)!==0){if(s!==null)for(var r=0;r<s.length;r++){var a=s[r];dt=a,ev(a,t)}Q_(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)J_(t),t=t.sibling}function J_(t){switch(t.tag){case 0:case 11:case 15:Xn(t),t.flags&2048&&cs(9,t,t.return);break;case 3:Xn(t);break;case 12:Xn(t);break;case 22:var s=t.stateNode;t.memoizedState!==null&&s._visibility&2&&(t.return===null||t.return.tag!==13)?(s._visibility&=-3,wa(t)):Xn(t);break;default:Xn(t)}}function wa(t){var s=t.deletions;if((t.flags&16)!==0){if(s!==null)for(var r=0;r<s.length;r++){var a=s[r];dt=a,ev(a,t)}Q_(t)}for(t=t.child;t!==null;){switch(s=t,s.tag){case 0:case 11:case 15:cs(8,s,s.return),wa(s);break;case 22:r=s.stateNode,r._visibility&2&&(r._visibility&=-3,wa(s));break;default:wa(s)}t=t.sibling}}function ev(t,s){for(;dt!==null;){var r=dt;switch(r.tag){case 0:case 11:case 15:cs(8,r,s);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var a=r.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Dn(r.memoizedState.cache)}if(a=r.child,a!==null)a.return=r,dt=a;else e:for(r=t;dt!==null;){a=dt;var h=a.sibling,u=a.return;if(V_(a),a===r){dt=null;break e}if(h!==null){h.return=u,dt=h;break e}dt=u}}}var wS={getCacheForType:function(t){var s=Et(rt),r=s.data.get(t);return r===void 0&&(r=t(),s.data.set(t,r)),r}},CS=typeof WeakMap=="function"?WeakMap:Map,De=0,He=null,be=null,Ce=0,Re=0,$t=null,fs=!1,Pr=!1,Qh=!1,Xi=0,Xe=0,_s=0,Fs=0,Jh=0,ai=0,jr=0,Gn=null,Pt=null,ec=!1,tc=0,Ca=1/0,xa=null,vs=null,yt=0,gs=null,qr=null,Wr=0,ic=0,sc=null,tv=null,$n=0,rc=null;function Ft(){if((De&2)!==0&&Ce!==0)return Ce&-Ce;if(k.T!==null){var t=Rr;return t!==0?t:uc()}return gd()}function iv(){ai===0&&(ai=(Ce&536870912)===0||ke?dd():536870912);var t=li.current;return t!==null&&(t.flags|=32),ai}function It(t,s,r){(t===He&&(Re===2||Re===9)||t.cancelPendingCommit!==null)&&(Yr(t,0),ps(t,Ce,ai,!1)),dn(t,r),((De&2)===0||t!==He)&&(t===He&&((De&2)===0&&(Fs|=r),Xe===4&&ps(t,Ce,ai,!1)),xi(t))}function sv(t,s,r){if((De&6)!==0)throw Error(l(327));var a=!r&&(s&124)===0&&(s&t.expiredLanes)===0||un(t,s),h=a?kS(t,s):ac(t,s,!0),u=a;do{if(h===0){Pr&&!a&&ps(t,s,0,!1);break}else{if(r=t.current.alternate,u&&!xS(r)){h=ac(t,s,!1),u=!1;continue}if(h===2){if(u=s,t.errorRecoveryDisabledLanes&u)var g=0;else g=t.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){s=g;e:{var p=t;h=Gn;var b=p.current.memoizedState.isDehydrated;if(b&&(Yr(p,g).flags|=256),g=ac(p,g,!1),g!==2){if(Qh&&!b){p.errorRecoveryDisabledLanes|=u,Fs|=u,h=4;break e}u=Pt,Pt=h,u!==null&&(Pt===null?Pt=u:Pt.push.apply(Pt,u))}h=g}if(u=!1,h!==2)continue}}if(h===1){Yr(t,0),ps(t,s,0,!0);break}e:{switch(a=t,u=h,u){case 0:case 1:throw Error(l(345));case 4:if((s&4194048)!==s)break;case 6:ps(a,s,ai,!fs);break e;case 2:Pt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((s&62914560)===s&&(h=tc+300-Si(),10<h)){if(ps(a,s,ai,!fs),Ll(a,0,!0)!==0)break e;a.timeoutHandle=Bv(rv.bind(null,a,r,Pt,xa,ec,s,ai,Fs,jr,fs,u,2,-0,0),h);break e}rv(a,r,Pt,xa,ec,s,ai,Fs,jr,fs,u,0,-0,0)}}break}while(!0);xi(t)}function rv(t,s,r,a,h,u,g,p,b,T,j,V,A,z){if(t.timeoutHandle=-1,V=s.subtreeFlags,(V&8192||(V&16785408)===16785408)&&(tl={stylesheets:null,count:0,unsuspend:ny},Z_(s),V=ay(),V!==null)){t.cancelPendingCommit=V(uv.bind(null,t,s,u,r,a,h,g,p,b,j,1,A,z)),ps(t,u,g,!T);return}uv(t,s,u,r,a,h,g,p,b)}function xS(t){for(var s=t;;){var r=s.tag;if((r===0||r===11||r===15)&&s.flags&16384&&(r=s.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var a=0;a<r.length;a++){var h=r[a],u=h.getSnapshot;h=h.value;try{if(!Kt(u(),h))return!1}catch{return!1}}if(r=s.child,s.subtreeFlags&16384&&r!==null)r.return=s,s=r;else{if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function ps(t,s,r,a){s&=~Jh,s&=~Fs,t.suspendedLanes|=s,t.pingedLanes&=~s,a&&(t.warmLanes|=s),a=t.expirationTimes;for(var h=s;0<h;){var u=31-Yt(h),g=1<<u;a[u]=-1,h&=~g}r!==0&&_d(t,r,s)}function Ea(){return(De&6)===0?(Fn(0),!1):!0}function nc(){if(be!==null){if(Re===0)var t=be.return;else t=be,Ui=Ys=null,wh(t),Lr=null,Pn=0,t=be;for(;t!==null;)H_(t.alternate,t),t=t.return;be=null}}function Yr(t,s){var r=t.timeoutHandle;r!==-1&&(t.timeoutHandle=-1,WS(r)),r=t.cancelPendingCommit,r!==null&&(t.cancelPendingCommit=null,r()),nc(),He=t,be=r=Li(t.current,null),Ce=s,Re=0,$t=null,fs=!1,Pr=un(t,s),Qh=!1,jr=ai=Jh=Fs=_s=Xe=0,Pt=Gn=null,ec=!1,(s&8)!==0&&(s|=s&32);var a=t.entangledLanes;if(a!==0)for(t=t.entanglements,a&=s;0<a;){var h=31-Yt(a),u=1<<h;s|=t[h],a&=~u}return Xi=s,Gl(),r}function nv(t,s){pe=null,k.H=da,s===Tn||s===ia?(s=wf(),Re=3):s===Sf?(s=wf(),Re=4):Re=s===C_?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,$t=s,be===null&&(Xe=1,pa(t,ii(s,t.current)))}function lv(){var t=k.H;return k.H=da,t===null?da:t}function av(){var t=k.A;return k.A=wS,t}function lc(){Xe=4,fs||(Ce&4194048)!==Ce&&li.current!==null||(Pr=!0),(_s&134217727)===0&&(Fs&134217727)===0||He===null||ps(He,Ce,ai,!1)}function ac(t,s,r){var a=De;De|=2;var h=lv(),u=av();(He!==t||Ce!==s)&&(xa=null,Yr(t,s)),s=!1;var g=Xe;e:do try{if(Re!==0&&be!==null){var p=be,b=$t;switch(Re){case 8:nc(),g=6;break e;case 3:case 2:case 9:case 6:li.current===null&&(s=!0);var T=Re;if(Re=0,$t=null,Kr(t,p,b,T),r&&Pr){g=0;break e}break;default:T=Re,Re=0,$t=null,Kr(t,p,b,T)}}ES(),g=Xe;break}catch(j){nv(t,j)}while(!0);return s&&t.shellSuspendCounter++,Ui=Ys=null,De=a,k.H=h,k.A=u,be===null&&(He=null,Ce=0,Gl()),g}function ES(){for(;be!==null;)ov(be)}function kS(t,s){var r=De;De|=2;var a=lv(),h=av();He!==t||Ce!==s?(xa=null,Ca=Si()+500,Yr(t,s)):Pr=un(t,s);e:do try{if(Re!==0&&be!==null){s=be;var u=$t;t:switch(Re){case 1:Re=0,$t=null,Kr(t,s,u,1);break;case 2:case 9:if(yf(u)){Re=0,$t=null,hv(s);break}s=function(){Re!==2&&Re!==9||He!==t||(Re=7),xi(t)},u.then(s,s);break e;case 3:Re=7;break e;case 4:Re=5;break e;case 7:yf(u)?(Re=0,$t=null,hv(s)):(Re=0,$t=null,Kr(t,s,u,7));break;case 5:var g=null;switch(be.tag){case 26:g=be.memoizedState;case 5:case 27:var p=be;if(!g||Kv(g)){Re=0,$t=null;var b=p.sibling;if(b!==null)be=b;else{var T=p.return;T!==null?(be=T,ka(T)):be=null}break t}}Re=0,$t=null,Kr(t,s,u,5);break;case 6:Re=0,$t=null,Kr(t,s,u,6);break;case 8:nc(),Xe=6;break e;default:throw Error(l(462))}}MS();break}catch(j){nv(t,j)}while(!0);return Ui=Ys=null,k.H=a,k.A=h,De=r,be!==null?0:(He=null,Ce=0,Gl(),Xe)}function MS(){for(;be!==null&&!Fm();)ov(be)}function ov(t){var s=L_(t.alternate,t,Xi);t.memoizedProps=t.pendingProps,s===null?ka(t):be=s}function hv(t){var s=t,r=s.alternate;switch(s.tag){case 15:case 0:s=R_(r,s,s.pendingProps,s.type,void 0,Ce);break;case 11:s=R_(r,s,s.pendingProps,s.type.render,s.ref,Ce);break;case 5:wh(s);default:H_(r,s),s=be=cf(s,Xi),s=L_(r,s,Xi)}t.memoizedProps=t.pendingProps,s===null?ka(t):be=s}function Kr(t,s,r,a){Ui=Ys=null,wh(s),Lr=null,Pn=0;var h=s.return;try{if(gS(t,h,s,r,Ce)){Xe=1,pa(t,ii(r,t.current)),be=null;return}}catch(u){if(h!==null)throw be=h,u;Xe=1,pa(t,ii(r,t.current)),be=null;return}s.flags&32768?(ke||a===1?t=!0:Pr||(Ce&536870912)!==0?t=!1:(fs=t=!0,(a===2||a===9||a===3||a===6)&&(a=li.current,a!==null&&a.tag===13&&(a.flags|=16384))),cv(s,t)):ka(s)}function ka(t){var s=t;do{if((s.flags&32768)!==0){cv(s,fs);return}t=s.return;var r=mS(s.alternate,s,Xi);if(r!==null){be=r;return}if(s=s.sibling,s!==null){be=s;return}be=s=t}while(s!==null);Xe===0&&(Xe=5)}function cv(t,s){do{var r=SS(t.alternate,t);if(r!==null){r.flags&=32767,be=r;return}if(r=t.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!s&&(t=t.sibling,t!==null)){be=t;return}be=t=r}while(t!==null);Xe=6,be=null}function uv(t,s,r,a,h,u,g,p,b){t.cancelPendingCommit=null;do Ma();while(yt!==0);if((De&6)!==0)throw Error(l(327));if(s!==null){if(s===t.current)throw Error(l(177));if(u=s.lanes|s.childLanes,u|=Zo,n0(t,r,u,g,p,b),t===He&&(be=He=null,Ce=0),qr=s,gs=t,Wr=r,ic=u,sc=h,tv=a,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,AS(Bl,function(){return gv(),null})):(t.callbackNode=null,t.callbackPriority=0),a=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||a){a=k.T,k.T=null,h=P.p,P.p=2,g=De,De|=4;try{yS(t,s,r)}finally{De=g,P.p=h,k.T=a}}yt=1,dv(),fv(),_v()}}function dv(){if(yt===1){yt=0;var t=gs,s=qr,r=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||r){r=k.T,k.T=null;var a=P.p;P.p=2;var h=De;De|=4;try{$_(s,t);var u=Sc,g=Jd(t.containerInfo),p=u.focusedElem,b=u.selectionRange;if(g!==p&&p&&p.ownerDocument&&Qd(p.ownerDocument.documentElement,p)){if(b!==null&&Xo(p)){var T=b.start,j=b.end;if(j===void 0&&(j=T),"selectionStart"in p)p.selectionStart=T,p.selectionEnd=Math.min(j,p.value.length);else{var V=p.ownerDocument||document,A=V&&V.defaultView||window;if(A.getSelection){var z=A.getSelection(),ue=p.textContent.length,he=Math.min(b.start,ue),ze=b.end===void 0?he:Math.min(b.end,ue);!z.extend&&he>ze&&(g=ze,ze=he,he=g);var D=Zd(p,he),x=Zd(p,ze);if(D&&x&&(z.rangeCount!==1||z.anchorNode!==D.node||z.anchorOffset!==D.offset||z.focusNode!==x.node||z.focusOffset!==x.offset)){var R=V.createRange();R.setStart(D.node,D.offset),z.removeAllRanges(),he>ze?(z.addRange(R),z.extend(x.node,x.offset)):(R.setEnd(x.node,x.offset),z.addRange(R))}}}}for(V=[],z=p;z=z.parentNode;)z.nodeType===1&&V.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<V.length;p++){var Y=V[p];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}Pa=!!mc,Sc=mc=null}finally{De=h,P.p=a,k.T=r}}t.current=s,yt=2}}function fv(){if(yt===2){yt=0;var t=gs,s=qr,r=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||r){r=k.T,k.T=null;var a=P.p;P.p=2;var h=De;De|=4;try{K_(t,s.alternate,s)}finally{De=h,P.p=a,k.T=r}}yt=3}}function _v(){if(yt===4||yt===3){yt=0,Im();var t=gs,s=qr,r=Wr,a=tv;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?yt=5:(yt=0,qr=gs=null,vv(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(vs=null),Eo(r),s=s.stateNode,Wt&&typeof Wt.onCommitFiberRoot=="function")try{Wt.onCommitFiberRoot(cn,s,void 0,(s.current.flags&128)===128)}catch{}if(a!==null){s=k.T,h=P.p,P.p=2,k.T=null;try{for(var u=t.onRecoverableError,g=0;g<a.length;g++){var p=a[g];u(p.value,{componentStack:p.stack})}}finally{k.T=s,P.p=h}}(Wr&3)!==0&&Ma(),xi(t),h=t.pendingLanes,(r&4194090)!==0&&(h&42)!==0?t===rc?$n++:($n=0,rc=t):$n=0,Fn(0)}}function vv(t,s){(t.pooledCacheLanes&=s)===0&&(s=t.pooledCache,s!=null&&(t.pooledCache=null,Dn(s)))}function Ma(t){return dv(),fv(),_v(),gv()}function gv(){if(yt!==5)return!1;var t=gs,s=ic;ic=0;var r=Eo(Wr),a=k.T,h=P.p;try{P.p=32>r?32:r,k.T=null,r=sc,sc=null;var u=gs,g=Wr;if(yt=0,qr=gs=null,Wr=0,(De&6)!==0)throw Error(l(331));var p=De;if(De|=4,J_(u.current),I_(u,u.current,g,r),De=p,Fn(0,!1),Wt&&typeof Wt.onPostCommitFiberRoot=="function")try{Wt.onPostCommitFiberRoot(cn,u)}catch{}return!0}finally{P.p=h,k.T=a,vv(t,s)}}function pv(t,s,r){s=ii(r,s),s=Nh(t.stateNode,s,2),t=ls(t,s,2),t!==null&&(dn(t,2),xi(t))}function Ne(t,s,r){if(t.tag===3)pv(t,t,r);else for(;s!==null;){if(s.tag===3){pv(s,t,r);break}else if(s.tag===1){var a=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(vs===null||!vs.has(a))){t=ii(r,t),r=b_(2),a=ls(s,r,2),a!==null&&(w_(r,a,s,t),dn(a,2),xi(a));break}}s=s.return}}function oc(t,s,r){var a=t.pingCache;if(a===null){a=t.pingCache=new CS;var h=new Set;a.set(s,h)}else h=a.get(s),h===void 0&&(h=new Set,a.set(s,h));h.has(r)||(Qh=!0,h.add(r),t=DS.bind(null,t,s,r),s.then(t,t))}function DS(t,s,r){var a=t.pingCache;a!==null&&a.delete(s),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,He===t&&(Ce&r)===r&&(Xe===4||Xe===3&&(Ce&62914560)===Ce&&300>Si()-tc?(De&2)===0&&Yr(t,0):Jh|=r,jr===Ce&&(jr=0)),xi(t)}function mv(t,s){s===0&&(s=fd()),t=Er(t,s),t!==null&&(dn(t,s),xi(t))}function RS(t){var s=t.memoizedState,r=0;s!==null&&(r=s.retryLane),mv(t,r)}function TS(t,s){var r=0;switch(t.tag){case 13:var a=t.stateNode,h=t.memoizedState;h!==null&&(r=h.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(l(314))}a!==null&&a.delete(s),mv(t,r)}function AS(t,s){return xe(t,s)}var Da=null,Vr=null,hc=!1,Ra=!1,cc=!1,Is=0;function xi(t){t!==Vr&&t.next===null&&(Vr===null?Da=Vr=t:Vr=Vr.next=t),Ra=!0,hc||(hc=!0,zS())}function Fn(t,s){if(!cc&&Ra){cc=!0;do for(var r=!1,a=Da;a!==null;){if(t!==0){var h=a.pendingLanes;if(h===0)var u=0;else{var g=a.suspendedLanes,p=a.pingedLanes;u=(1<<31-Yt(42|t)+1)-1,u&=h&~(g&~p),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(r=!0,wv(a,u))}else u=Ce,u=Ll(a,a===He?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||un(a,u)||(r=!0,wv(a,u));a=a.next}while(r);cc=!1}}function BS(){Sv()}function Sv(){Ra=hc=!1;var t=0;Is!==0&&(qS()&&(t=Is),Is=0);for(var s=Si(),r=null,a=Da;a!==null;){var h=a.next,u=yv(a,s);u===0?(a.next=null,r===null?Da=h:r.next=h,h===null&&(Vr=r)):(r=a,(t!==0||(u&3)!==0)&&(Ra=!0)),a=h}Fn(t)}function yv(t,s){for(var r=t.suspendedLanes,a=t.pingedLanes,h=t.expirationTimes,u=t.pendingLanes&-62914561;0<u;){var g=31-Yt(u),p=1<<g,b=h[g];b===-1?((p&r)===0||(p&a)!==0)&&(h[g]=r0(p,s)):b<=s&&(t.expiredLanes|=p),u&=~p}if(s=He,r=Ce,r=Ll(t,t===s?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),a=t.callbackNode,r===0||t===s&&(Re===2||Re===9)||t.cancelPendingCommit!==null)return a!==null&&a!==null&&Bs(a),t.callbackNode=null,t.callbackPriority=0;if((r&3)===0||un(t,r)){if(s=r&-r,s===t.callbackPriority)return s;switch(a!==null&&Bs(a),Eo(r)){case 2:case 8:r=cd;break;case 32:r=Bl;break;case 268435456:r=ud;break;default:r=Bl}return a=bv.bind(null,t),r=xe(r,a),t.callbackPriority=s,t.callbackNode=r,s}return a!==null&&a!==null&&Bs(a),t.callbackPriority=2,t.callbackNode=null,2}function bv(t,s){if(yt!==0&&yt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var r=t.callbackNode;if(Ma()&&t.callbackNode!==r)return null;var a=Ce;return a=Ll(t,t===He?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),a===0?null:(sv(t,a,s),yv(t,Si()),t.callbackNode!=null&&t.callbackNode===r?bv.bind(null,t):null)}function wv(t,s){if(Ma())return null;sv(t,s,!0)}function zS(){YS(function(){(De&6)!==0?xe(hd,BS):Sv()})}function uc(){return Is===0&&(Is=dd()),Is}function Cv(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:jl(""+t)}function xv(t,s){var r=s.ownerDocument.createElement("input");return r.name=s.name,r.value=s.value,t.id&&r.setAttribute("form",t.id),s.parentNode.insertBefore(r,s),t=new FormData(t),r.parentNode.removeChild(r),t}function OS(t,s,r,a,h){if(s==="submit"&&r&&r.stateNode===h){var u=Cv((h[Lt]||null).action),g=a.submitter;g&&(s=(s=g[Lt]||null)?Cv(s.formAction):g.getAttribute("formAction"),s!==null&&(u=s,g=null));var p=new Kl("action","action",null,a,h);t.push({event:p,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Is!==0){var b=g?xv(h,g):new FormData(h);Ah(r,{pending:!0,data:b,method:h.method,action:u},null,b)}}else typeof u=="function"&&(p.preventDefault(),b=g?xv(h,g):new FormData(h),Ah(r,{pending:!0,data:b,method:h.method,action:u},u,b))},currentTarget:h}]})}}for(var dc=0;dc<Io.length;dc++){var fc=Io[dc],LS=fc.toLowerCase(),NS=fc[0].toUpperCase()+fc.slice(1);_i(LS,"on"+NS)}_i(sf,"onAnimationEnd"),_i(rf,"onAnimationIteration"),_i(nf,"onAnimationStart"),_i("dblclick","onDoubleClick"),_i("focusin","onFocus"),_i("focusout","onBlur"),_i(J0,"onTransitionRun"),_i(eS,"onTransitionStart"),_i(tS,"onTransitionCancel"),_i(lf,"onTransitionEnd"),vr("onMouseEnter",["mouseout","mouseover"]),vr("onMouseLeave",["mouseout","mouseover"]),vr("onPointerEnter",["pointerout","pointerover"]),vr("onPointerLeave",["pointerout","pointerover"]),Os("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Os("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Os("onBeforeInput",["compositionend","keypress","textInput","paste"]),Os("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Os("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Os("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var In="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(" "),HS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(In));function Ev(t,s){s=(s&4)!==0;for(var r=0;r<t.length;r++){var a=t[r],h=a.event;a=a.listeners;e:{var u=void 0;if(s)for(var g=a.length-1;0<=g;g--){var p=a[g],b=p.instance,T=p.currentTarget;if(p=p.listener,b!==u&&h.isPropagationStopped())break e;u=p,h.currentTarget=T;try{u(h)}catch(j){ga(j)}h.currentTarget=null,u=b}else for(g=0;g<a.length;g++){if(p=a[g],b=p.instance,T=p.currentTarget,p=p.listener,b!==u&&h.isPropagationStopped())break e;u=p,h.currentTarget=T;try{u(h)}catch(j){ga(j)}h.currentTarget=null,u=b}}}}function we(t,s){var r=s[ko];r===void 0&&(r=s[ko]=new Set);var a=t+"__bubble";r.has(a)||(kv(s,t,2,!1),r.add(a))}function _c(t,s,r){var a=0;s&&(a|=4),kv(r,t,a,s)}var Ta="_reactListening"+Math.random().toString(36).slice(2);function vc(t){if(!t[Ta]){t[Ta]=!0,md.forEach(function(r){r!=="selectionchange"&&(HS.has(r)||_c(r,!1,t),_c(r,!0,t))});var s=t.nodeType===9?t:t.ownerDocument;s===null||s[Ta]||(s[Ta]=!0,_c("selectionchange",!1,s))}}function kv(t,s,r,a){switch(Iv(s)){case 2:var h=cy;break;case 8:h=uy;break;default:h=Rc}r=h.bind(null,s,r,t),h=void 0,!Ho||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(h=!0),a?h!==void 0?t.addEventListener(s,r,{capture:!0,passive:h}):t.addEventListener(s,r,!0):h!==void 0?t.addEventListener(s,r,{passive:h}):t.addEventListener(s,r,!1)}function gc(t,s,r,a,h){var u=a;if((s&1)===0&&(s&2)===0&&a!==null)e:for(;;){if(a===null)return;var g=a.tag;if(g===3||g===4){var p=a.stateNode.containerInfo;if(p===h)break;if(g===4)for(g=a.return;g!==null;){var b=g.tag;if((b===3||b===4)&&g.stateNode.containerInfo===h)return;g=g.return}for(;p!==null;){if(g=dr(p),g===null)return;if(b=g.tag,b===5||b===6||b===26||b===27){a=u=g;continue e}p=p.parentNode}}a=a.return}Bd(function(){var T=u,j=Lo(r),V=[];e:{var A=af.get(t);if(A!==void 0){var z=Kl,ue=t;switch(t){case"keypress":if(Wl(r)===0)break e;case"keydown":case"keyup":z=A0;break;case"focusin":ue="focus",z=qo;break;case"focusout":ue="blur",z=qo;break;case"beforeblur":case"afterblur":z=qo;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":z=Ld;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":z=S0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":z=O0;break;case sf:case rf:case nf:z=w0;break;case lf:z=N0;break;case"scroll":case"scrollend":z=p0;break;case"wheel":z=U0;break;case"copy":case"cut":case"paste":z=x0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":z=Hd;break;case"toggle":case"beforetoggle":z=j0}var he=(s&4)!==0,ze=!he&&(t==="scroll"||t==="scrollend"),D=he?A!==null?A+"Capture":null:A;he=[];for(var x=T,R;x!==null;){var Y=x;if(R=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||R===null||D===null||(Y=vn(x,D),Y!=null&&he.push(Zn(x,Y,R))),ze)break;x=x.return}0<he.length&&(A=new z(A,ue,null,r,j),V.push({event:A,listeners:he}))}}if((s&7)===0){e:{if(A=t==="mouseover"||t==="pointerover",z=t==="mouseout"||t==="pointerout",A&&r!==Oo&&(ue=r.relatedTarget||r.fromElement)&&(dr(ue)||ue[ur]))break e;if((z||A)&&(A=j.window===j?j:(A=j.ownerDocument)?A.defaultView||A.parentWindow:window,z?(ue=r.relatedTarget||r.toElement,z=T,ue=ue?dr(ue):null,ue!==null&&(ze=c(ue),he=ue.tag,ue!==ze||he!==5&&he!==27&&he!==6)&&(ue=null)):(z=null,ue=T),z!==ue)){if(he=Ld,Y="onMouseLeave",D="onMouseEnter",x="mouse",(t==="pointerout"||t==="pointerover")&&(he=Hd,Y="onPointerLeave",D="onPointerEnter",x="pointer"),ze=z==null?A:_n(z),R=ue==null?A:_n(ue),A=new he(Y,x+"leave",z,r,j),A.target=ze,A.relatedTarget=R,Y=null,dr(j)===T&&(he=new he(D,x+"enter",ue,r,j),he.target=R,he.relatedTarget=ze,Y=he),ze=Y,z&&ue)t:{for(he=z,D=ue,x=0,R=he;R;R=Xr(R))x++;for(R=0,Y=D;Y;Y=Xr(Y))R++;for(;0<x-R;)he=Xr(he),x--;for(;0<R-x;)D=Xr(D),R--;for(;x--;){if(he===D||D!==null&&he===D.alternate)break t;he=Xr(he),D=Xr(D)}he=null}else he=null;z!==null&&Mv(V,A,z,he,!1),ue!==null&&ze!==null&&Mv(V,ze,ue,he,!0)}}e:{if(A=T?_n(T):window,z=A.nodeName&&A.nodeName.toLowerCase(),z==="select"||z==="input"&&A.type==="file")var ne=Vd;else if(Yd(A))if(Xd)ne=I0;else{ne=$0;var ye=G0}else z=A.nodeName,!z||z.toLowerCase()!=="input"||A.type!=="checkbox"&&A.type!=="radio"?T&&zo(T.elementType)&&(ne=Vd):ne=F0;if(ne&&(ne=ne(t,T))){Kd(V,ne,r,j);break e}ye&&ye(t,A,T),t==="focusout"&&T&&A.type==="number"&&T.memoizedProps.value!=null&&Bo(A,"number",A.value)}switch(ye=T?_n(T):window,t){case"focusin":(Yd(ye)||ye.contentEditable==="true")&&(wr=ye,Go=T,Cn=null);break;case"focusout":Cn=Go=wr=null;break;case"mousedown":$o=!0;break;case"contextmenu":case"mouseup":case"dragend":$o=!1,ef(V,r,j);break;case"selectionchange":if(Q0)break;case"keydown":case"keyup":ef(V,r,j)}var ae;if(Yo)e:{switch(t){case"compositionstart":var ce="onCompositionStart";break e;case"compositionend":ce="onCompositionEnd";break e;case"compositionupdate":ce="onCompositionUpdate";break e}ce=void 0}else br?qd(t,r)&&(ce="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(ce="onCompositionStart");ce&&(Ud&&r.locale!=="ko"&&(br||ce!=="onCompositionStart"?ce==="onCompositionEnd"&&br&&(ae=zd()):(is=j,Uo="value"in is?is.value:is.textContent,br=!0)),ye=Aa(T,ce),0<ye.length&&(ce=new Nd(ce,t,null,r,j),V.push({event:ce,listeners:ye}),ae?ce.data=ae:(ae=Wd(r),ae!==null&&(ce.data=ae)))),(ae=W0?Y0(t,r):K0(t,r))&&(ce=Aa(T,"onBeforeInput"),0<ce.length&&(ye=new Nd("onBeforeInput","beforeinput",null,r,j),V.push({event:ye,listeners:ce}),ye.data=ae)),OS(V,t,T,r,j)}Ev(V,s)})}function Zn(t,s,r){return{instance:t,listener:s,currentTarget:r}}function Aa(t,s){for(var r=s+"Capture",a=[];t!==null;){var h=t,u=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||u===null||(h=vn(t,r),h!=null&&a.unshift(Zn(t,h,u)),h=vn(t,s),h!=null&&a.push(Zn(t,h,u))),t.tag===3)return a;t=t.return}return[]}function Xr(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Mv(t,s,r,a,h){for(var u=s._reactName,g=[];r!==null&&r!==a;){var p=r,b=p.alternate,T=p.stateNode;if(p=p.tag,b!==null&&b===a)break;p!==5&&p!==26&&p!==27||T===null||(b=T,h?(T=vn(r,u),T!=null&&g.unshift(Zn(r,T,b))):h||(T=vn(r,u),T!=null&&g.push(Zn(r,T,b)))),r=r.return}g.length!==0&&t.push({event:s,listeners:g})}var US=/\r\n?/g,PS=/\u0000|\uFFFD/g;function Dv(t){return(typeof t=="string"?t:""+t).replace(US,`
|
|
49
|
-
`).replace(PS,"")}function Rv(t,s){return s=Dv(s),Dv(t)===s}function Ba(){}function Be(t,s,r,a,h,u){switch(r){case"children":typeof a=="string"?s==="body"||s==="textarea"&&a===""||mr(t,a):(typeof a=="number"||typeof a=="bigint")&&s!=="body"&&mr(t,""+a);break;case"className":Hl(t,"class",a);break;case"tabIndex":Hl(t,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Hl(t,r,a);break;case"style":Td(t,a,u);break;case"data":if(s!=="object"){Hl(t,"data",a);break}case"src":case"href":if(a===""&&(s!=="a"||r!=="href")){t.removeAttribute(r);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(r);break}a=jl(""+a),t.setAttribute(r,a);break;case"action":case"formAction":if(typeof a=="function"){t.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(r==="formAction"?(s!=="input"&&Be(t,s,"name",h.name,h,null),Be(t,s,"formEncType",h.formEncType,h,null),Be(t,s,"formMethod",h.formMethod,h,null),Be(t,s,"formTarget",h.formTarget,h,null)):(Be(t,s,"encType",h.encType,h,null),Be(t,s,"method",h.method,h,null),Be(t,s,"target",h.target,h,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(r);break}a=jl(""+a),t.setAttribute(r,a);break;case"onClick":a!=null&&(t.onclick=Ba);break;case"onScroll":a!=null&&we("scroll",t);break;case"onScrollEnd":a!=null&&we("scrollend",t);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(r=a.__html,r!=null){if(h.children!=null)throw Error(l(60));t.innerHTML=r}}break;case"multiple":t.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":t.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){t.removeAttribute("xlink:href");break}r=jl(""+a),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(r,""+a):t.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(r,""):t.removeAttribute(r);break;case"capture":case"download":a===!0?t.setAttribute(r,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(r,a):t.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?t.setAttribute(r,a):t.removeAttribute(r);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?t.removeAttribute(r):t.setAttribute(r,a);break;case"popover":we("beforetoggle",t),we("toggle",t),Nl(t,"popover",a);break;case"xlinkActuate":zi(t,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":zi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":zi(t,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":zi(t,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":zi(t,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":zi(t,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":zi(t,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":zi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":zi(t,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Nl(t,"is",a);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=v0.get(r)||r,Nl(t,r,a))}}function pc(t,s,r,a,h,u){switch(r){case"style":Td(t,a,u);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(r=a.__html,r!=null){if(h.children!=null)throw Error(l(60));t.innerHTML=r}}break;case"children":typeof a=="string"?mr(t,a):(typeof a=="number"||typeof a=="bigint")&&mr(t,""+a);break;case"onScroll":a!=null&&we("scroll",t);break;case"onScrollEnd":a!=null&&we("scrollend",t);break;case"onClick":a!=null&&(t.onclick=Ba);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Sd.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(h=r.endsWith("Capture"),s=r.slice(2,h?r.length-7:void 0),u=t[Lt]||null,u=u!=null?u[r]:null,typeof u=="function"&&t.removeEventListener(s,u,h),typeof a=="function")){typeof u!="function"&&u!==null&&(r in t?t[r]=null:t.hasAttribute(r)&&t.removeAttribute(r)),t.addEventListener(s,a,h);break e}r in t?t[r]=a:a===!0?t.setAttribute(r,""):Nl(t,r,a)}}}function bt(t,s,r){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":we("error",t),we("load",t);var a=!1,h=!1,u;for(u in r)if(r.hasOwnProperty(u)){var g=r[u];if(g!=null)switch(u){case"src":a=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,s));default:Be(t,s,u,g,r,null)}}h&&Be(t,s,"srcSet",r.srcSet,r,null),a&&Be(t,s,"src",r.src,r,null);return;case"input":we("invalid",t);var p=u=g=h=null,b=null,T=null;for(a in r)if(r.hasOwnProperty(a)){var j=r[a];if(j!=null)switch(a){case"name":h=j;break;case"type":g=j;break;case"checked":b=j;break;case"defaultChecked":T=j;break;case"value":u=j;break;case"defaultValue":p=j;break;case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(l(137,s));break;default:Be(t,s,a,j,r,null)}}kd(t,u,p,b,T,g,h,!1),Ul(t);return;case"select":we("invalid",t),a=g=u=null;for(h in r)if(r.hasOwnProperty(h)&&(p=r[h],p!=null))switch(h){case"value":u=p;break;case"defaultValue":g=p;break;case"multiple":a=p;default:Be(t,s,h,p,r,null)}s=u,r=g,t.multiple=!!a,s!=null?pr(t,!!a,s,!1):r!=null&&pr(t,!!a,r,!0);return;case"textarea":we("invalid",t),u=h=a=null;for(g in r)if(r.hasOwnProperty(g)&&(p=r[g],p!=null))switch(g){case"value":a=p;break;case"defaultValue":h=p;break;case"children":u=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(l(91));break;default:Be(t,s,g,p,r,null)}Dd(t,a,h,u),Ul(t);return;case"option":for(b in r)if(r.hasOwnProperty(b)&&(a=r[b],a!=null))switch(b){case"selected":t.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Be(t,s,b,a,r,null)}return;case"dialog":we("beforetoggle",t),we("toggle",t),we("cancel",t),we("close",t);break;case"iframe":case"object":we("load",t);break;case"video":case"audio":for(a=0;a<In.length;a++)we(In[a],t);break;case"image":we("error",t),we("load",t);break;case"details":we("toggle",t);break;case"embed":case"source":case"link":we("error",t),we("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(T in r)if(r.hasOwnProperty(T)&&(a=r[T],a!=null))switch(T){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,s));default:Be(t,s,T,a,r,null)}return;default:if(zo(s)){for(j in r)r.hasOwnProperty(j)&&(a=r[j],a!==void 0&&pc(t,s,j,a,r,void 0));return}}for(p in r)r.hasOwnProperty(p)&&(a=r[p],a!=null&&Be(t,s,p,a,r,null))}function jS(t,s,r,a){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,u=null,g=null,p=null,b=null,T=null,j=null;for(z in r){var V=r[z];if(r.hasOwnProperty(z)&&V!=null)switch(z){case"checked":break;case"value":break;case"defaultValue":b=V;default:a.hasOwnProperty(z)||Be(t,s,z,null,a,V)}}for(var A in a){var z=a[A];if(V=r[A],a.hasOwnProperty(A)&&(z!=null||V!=null))switch(A){case"type":u=z;break;case"name":h=z;break;case"checked":T=z;break;case"defaultChecked":j=z;break;case"value":g=z;break;case"defaultValue":p=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(l(137,s));break;default:z!==V&&Be(t,s,A,z,a,V)}}Ao(t,g,p,b,T,j,u,h);return;case"select":z=g=p=A=null;for(u in r)if(b=r[u],r.hasOwnProperty(u)&&b!=null)switch(u){case"value":break;case"multiple":z=b;default:a.hasOwnProperty(u)||Be(t,s,u,null,a,b)}for(h in a)if(u=a[h],b=r[h],a.hasOwnProperty(h)&&(u!=null||b!=null))switch(h){case"value":A=u;break;case"defaultValue":p=u;break;case"multiple":g=u;default:u!==b&&Be(t,s,h,u,a,b)}s=p,r=g,a=z,A!=null?pr(t,!!r,A,!1):!!a!=!!r&&(s!=null?pr(t,!!r,s,!0):pr(t,!!r,r?[]:"",!1));return;case"textarea":z=A=null;for(p in r)if(h=r[p],r.hasOwnProperty(p)&&h!=null&&!a.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:Be(t,s,p,null,a,h)}for(g in a)if(h=a[g],u=r[g],a.hasOwnProperty(g)&&(h!=null||u!=null))switch(g){case"value":A=h;break;case"defaultValue":z=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(l(91));break;default:h!==u&&Be(t,s,g,h,a,u)}Md(t,A,z);return;case"option":for(var ue in r)if(A=r[ue],r.hasOwnProperty(ue)&&A!=null&&!a.hasOwnProperty(ue))switch(ue){case"selected":t.selected=!1;break;default:Be(t,s,ue,null,a,A)}for(b in a)if(A=a[b],z=r[b],a.hasOwnProperty(b)&&A!==z&&(A!=null||z!=null))switch(b){case"selected":t.selected=A&&typeof A!="function"&&typeof A!="symbol";break;default:Be(t,s,b,A,a,z)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var he in r)A=r[he],r.hasOwnProperty(he)&&A!=null&&!a.hasOwnProperty(he)&&Be(t,s,he,null,a,A);for(T in a)if(A=a[T],z=r[T],a.hasOwnProperty(T)&&A!==z&&(A!=null||z!=null))switch(T){case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(l(137,s));break;default:Be(t,s,T,A,a,z)}return;default:if(zo(s)){for(var ze in r)A=r[ze],r.hasOwnProperty(ze)&&A!==void 0&&!a.hasOwnProperty(ze)&&pc(t,s,ze,void 0,a,A);for(j in a)A=a[j],z=r[j],!a.hasOwnProperty(j)||A===z||A===void 0&&z===void 0||pc(t,s,j,A,a,z);return}}for(var D in r)A=r[D],r.hasOwnProperty(D)&&A!=null&&!a.hasOwnProperty(D)&&Be(t,s,D,null,a,A);for(V in a)A=a[V],z=r[V],!a.hasOwnProperty(V)||A===z||A==null&&z==null||Be(t,s,V,A,a,z)}var mc=null,Sc=null;function za(t){return t.nodeType===9?t:t.ownerDocument}function Tv(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Av(t,s){if(t===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&s==="foreignObject"?0:t}function yc(t,s){return t==="textarea"||t==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var bc=null;function qS(){var t=window.event;return t&&t.type==="popstate"?t===bc?!1:(bc=t,!0):(bc=null,!1)}var Bv=typeof setTimeout=="function"?setTimeout:void 0,WS=typeof clearTimeout=="function"?clearTimeout:void 0,zv=typeof Promise=="function"?Promise:void 0,YS=typeof queueMicrotask=="function"?queueMicrotask:typeof zv<"u"?function(t){return zv.resolve(null).then(t).catch(KS)}:Bv;function KS(t){setTimeout(function(){throw t})}function ms(t){return t==="head"}function Ov(t,s){var r=s,a=0,h=0;do{var u=r.nextSibling;if(t.removeChild(r),u&&u.nodeType===8)if(r=u.data,r==="/$"){if(0<a&&8>a){r=a;var g=t.ownerDocument;if(r&1&&Qn(g.documentElement),r&2&&Qn(g.body),r&4)for(r=g.head,Qn(r),g=r.firstChild;g;){var p=g.nextSibling,b=g.nodeName;g[fn]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&g.rel.toLowerCase()==="stylesheet"||r.removeChild(g),g=p}}if(h===0){t.removeChild(u),ll(s);return}h--}else r==="$"||r==="$?"||r==="$!"?h++:a=r.charCodeAt(0)-48;else a=0;r=u}while(r);ll(s)}function wc(t){var s=t.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var r=s;switch(s=s.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":wc(r),Mo(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}t.removeChild(r)}}function VS(t,s,r,a){for(;t.nodeType===1;){var h=r;if(t.nodeName.toLowerCase()!==s.toLowerCase()){if(!a&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(a){if(!t[fn])switch(s){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(u=t.getAttribute("rel"),u==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(u!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(u=t.getAttribute("src"),(u!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&u&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(s==="input"&&t.type==="hidden"){var u=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===u)return t}else return t;if(t=gi(t.nextSibling),t===null)break}return null}function XS(t,s,r){if(s==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=gi(t.nextSibling),t===null))return null;return t}function Cc(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function GS(t,s){var r=t.ownerDocument;if(t.data!=="$?"||r.readyState==="complete")s();else{var a=function(){s(),r.removeEventListener("DOMContentLoaded",a)};r.addEventListener("DOMContentLoaded",a),t._reactRetry=a}}function gi(t){for(;t!=null;t=t.nextSibling){var s=t.nodeType;if(s===1||s===3)break;if(s===8){if(s=t.data,s==="$"||s==="$!"||s==="$?"||s==="F!"||s==="F")break;if(s==="/$")return null}}return t}var xc=null;function Lv(t){t=t.previousSibling;for(var s=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(s===0)return t;s--}else r==="/$"&&s++}t=t.previousSibling}return null}function Nv(t,s,r){switch(s=za(r),t){case"html":if(t=s.documentElement,!t)throw Error(l(452));return t;case"head":if(t=s.head,!t)throw Error(l(453));return t;case"body":if(t=s.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function Qn(t){for(var s=t.attributes;s.length;)t.removeAttributeNode(s[0]);Mo(t)}var oi=new Map,Hv=new Set;function Oa(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Gi=P.d;P.d={f:$S,r:FS,D:IS,C:ZS,L:QS,m:JS,X:ty,S:ey,M:iy};function $S(){var t=Gi.f(),s=Ea();return t||s}function FS(t){var s=fr(t);s!==null&&s.tag===5&&s.type==="form"?s_(s):Gi.r(t)}var Gr=typeof document>"u"?null:document;function Uv(t,s,r){var a=Gr;if(a&&typeof s=="string"&&s){var h=ti(s);h='link[rel="'+t+'"][href="'+h+'"]',typeof r=="string"&&(h+='[crossorigin="'+r+'"]'),Hv.has(h)||(Hv.add(h),t={rel:t,crossOrigin:r,href:s},a.querySelector(h)===null&&(s=a.createElement("link"),bt(s,"link",t),ct(s),a.head.appendChild(s)))}}function IS(t){Gi.D(t),Uv("dns-prefetch",t,null)}function ZS(t,s){Gi.C(t,s),Uv("preconnect",t,s)}function QS(t,s,r){Gi.L(t,s,r);var a=Gr;if(a&&t&&s){var h='link[rel="preload"][as="'+ti(s)+'"]';s==="image"&&r&&r.imageSrcSet?(h+='[imagesrcset="'+ti(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(h+='[imagesizes="'+ti(r.imageSizes)+'"]')):h+='[href="'+ti(t)+'"]';var u=h;switch(s){case"style":u=$r(t);break;case"script":u=Fr(t)}oi.has(u)||(t=m({rel:"preload",href:s==="image"&&r&&r.imageSrcSet?void 0:t,as:s},r),oi.set(u,t),a.querySelector(h)!==null||s==="style"&&a.querySelector(Jn(u))||s==="script"&&a.querySelector(el(u))||(s=a.createElement("link"),bt(s,"link",t),ct(s),a.head.appendChild(s)))}}function JS(t,s){Gi.m(t,s);var r=Gr;if(r&&t){var a=s&&typeof s.as=="string"?s.as:"script",h='link[rel="modulepreload"][as="'+ti(a)+'"][href="'+ti(t)+'"]',u=h;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Fr(t)}if(!oi.has(u)&&(t=m({rel:"modulepreload",href:t},s),oi.set(u,t),r.querySelector(h)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(el(u)))return}a=r.createElement("link"),bt(a,"link",t),ct(a),r.head.appendChild(a)}}}function ey(t,s,r){Gi.S(t,s,r);var a=Gr;if(a&&t){var h=_r(a).hoistableStyles,u=$r(t);s=s||"default";var g=h.get(u);if(!g){var p={loading:0,preload:null};if(g=a.querySelector(Jn(u)))p.loading=5;else{t=m({rel:"stylesheet",href:t,"data-precedence":s},r),(r=oi.get(u))&&Ec(t,r);var b=g=a.createElement("link");ct(b),bt(b,"link",t),b._p=new Promise(function(T,j){b.onload=T,b.onerror=j}),b.addEventListener("load",function(){p.loading|=1}),b.addEventListener("error",function(){p.loading|=2}),p.loading|=4,La(g,s,a)}g={type:"stylesheet",instance:g,count:1,state:p},h.set(u,g)}}}function ty(t,s){Gi.X(t,s);var r=Gr;if(r&&t){var a=_r(r).hoistableScripts,h=Fr(t),u=a.get(h);u||(u=r.querySelector(el(h)),u||(t=m({src:t,async:!0},s),(s=oi.get(h))&&kc(t,s),u=r.createElement("script"),ct(u),bt(u,"link",t),r.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(h,u))}}function iy(t,s){Gi.M(t,s);var r=Gr;if(r&&t){var a=_r(r).hoistableScripts,h=Fr(t),u=a.get(h);u||(u=r.querySelector(el(h)),u||(t=m({src:t,async:!0,type:"module"},s),(s=oi.get(h))&&kc(t,s),u=r.createElement("script"),ct(u),bt(u,"link",t),r.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(h,u))}}function Pv(t,s,r,a){var h=(h=re.current)?Oa(h):null;if(!h)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(s=$r(r.href),r=_r(h).hoistableStyles,a=r.get(s),a||(a={type:"style",instance:null,count:0,state:null},r.set(s,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=$r(r.href);var u=_r(h).hoistableStyles,g=u.get(t);if(g||(h=h.ownerDocument||h,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(t,g),(u=h.querySelector(Jn(t)))&&!u._p&&(g.instance=u,g.state.loading=5),oi.has(t)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},oi.set(t,r),u||sy(h,t,r,g.state))),s&&a===null)throw Error(l(528,""));return g}if(s&&a!==null)throw Error(l(529,""));return null;case"script":return s=r.async,r=r.src,typeof r=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Fr(r),r=_r(h).hoistableScripts,a=r.get(s),a||(a={type:"script",instance:null,count:0,state:null},r.set(s,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function $r(t){return'href="'+ti(t)+'"'}function Jn(t){return'link[rel="stylesheet"]['+t+"]"}function jv(t){return m({},t,{"data-precedence":t.precedence,precedence:null})}function sy(t,s,r,a){t.querySelector('link[rel="preload"][as="style"]['+s+"]")?a.loading=1:(s=t.createElement("link"),a.preload=s,s.addEventListener("load",function(){return a.loading|=1}),s.addEventListener("error",function(){return a.loading|=2}),bt(s,"link",r),ct(s),t.head.appendChild(s))}function Fr(t){return'[src="'+ti(t)+'"]'}function el(t){return"script[async]"+t}function qv(t,s,r){if(s.count++,s.instance===null)switch(s.type){case"style":var a=t.querySelector('style[data-href~="'+ti(r.href)+'"]');if(a)return s.instance=a,ct(a),a;var h=m({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),ct(a),bt(a,"style",h),La(a,r.precedence,t),s.instance=a;case"stylesheet":h=$r(r.href);var u=t.querySelector(Jn(h));if(u)return s.state.loading|=4,s.instance=u,ct(u),u;a=jv(r),(h=oi.get(h))&&Ec(a,h),u=(t.ownerDocument||t).createElement("link"),ct(u);var g=u;return g._p=new Promise(function(p,b){g.onload=p,g.onerror=b}),bt(u,"link",a),s.state.loading|=4,La(u,r.precedence,t),s.instance=u;case"script":return u=Fr(r.src),(h=t.querySelector(el(u)))?(s.instance=h,ct(h),h):(a=r,(h=oi.get(u))&&(a=m({},r),kc(a,h)),t=t.ownerDocument||t,h=t.createElement("script"),ct(h),bt(h,"link",a),t.head.appendChild(h),s.instance=h);case"void":return null;default:throw Error(l(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(a=s.instance,s.state.loading|=4,La(a,r.precedence,t));return s.instance}function La(t,s,r){for(var a=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=a.length?a[a.length-1]:null,u=h,g=0;g<a.length;g++){var p=a[g];if(p.dataset.precedence===s)u=p;else if(u!==h)break}u?u.parentNode.insertBefore(t,u.nextSibling):(s=r.nodeType===9?r.head:r,s.insertBefore(t,s.firstChild))}function Ec(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.title==null&&(t.title=s.title)}function kc(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.integrity==null&&(t.integrity=s.integrity)}var Na=null;function Wv(t,s,r){if(Na===null){var a=new Map,h=Na=new Map;h.set(r,a)}else h=Na,a=h.get(r),a||(a=new Map,h.set(r,a));if(a.has(t))return a;for(a.set(t,null),r=r.getElementsByTagName(t),h=0;h<r.length;h++){var u=r[h];if(!(u[fn]||u[xt]||t==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var g=u.getAttribute(s)||"";g=t+g;var p=a.get(g);p?p.push(u):a.set(g,[u])}}return a}function Yv(t,s,r){t=t.ownerDocument||t,t.head.insertBefore(r,s==="title"?t.querySelector("head > title"):null)}function ry(t,s,r){if(r===1||s.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return t=s.disabled,typeof s.precedence=="string"&&t==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function Kv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var tl=null;function ny(){}function ly(t,s,r){if(tl===null)throw Error(l(475));var a=tl;if(s.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var h=$r(r.href),u=t.querySelector(Jn(h));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(a.count++,a=Ha.bind(a),t.then(a,a)),s.state.loading|=4,s.instance=u,ct(u);return}u=t.ownerDocument||t,r=jv(r),(h=oi.get(h))&&Ec(r,h),u=u.createElement("link"),ct(u);var g=u;g._p=new Promise(function(p,b){g.onload=p,g.onerror=b}),bt(u,"link",r),s.instance=u}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(a.count++,s=Ha.bind(a),t.addEventListener("load",s),t.addEventListener("error",s))}}function ay(){if(tl===null)throw Error(l(475));var t=tl;return t.stylesheets&&t.count===0&&Mc(t,t.stylesheets),0<t.count?function(s){var r=setTimeout(function(){if(t.stylesheets&&Mc(t,t.stylesheets),t.unsuspend){var a=t.unsuspend;t.unsuspend=null,a()}},6e4);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(r)}}:null}function Ha(){if(this.count--,this.count===0){if(this.stylesheets)Mc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ua=null;function Mc(t,s){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ua=new Map,s.forEach(oy,t),Ua=null,Ha.call(t))}function oy(t,s){if(!(s.state.loading&4)){var r=Ua.get(t);if(r)var a=r.get(null);else{r=new Map,Ua.set(t,r);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<h.length;u++){var g=h[u];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(r.set(g.dataset.precedence,g),a=g)}a&&r.set(null,a)}h=s.instance,g=h.getAttribute("data-precedence"),u=r.get(g)||a,u===a&&r.set(null,h),r.set(g,h),this.count++,a=Ha.bind(this),h.addEventListener("load",a),h.addEventListener("error",a),u?u.parentNode.insertBefore(h,u.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),s.state.loading|=4}}var il={$$typeof:G,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function hy(t,s,r,a,h,u,g,p){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Co(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Co(0),this.hiddenUpdates=Co(null),this.identifierPrefix=a,this.onUncaughtError=h,this.onCaughtError=u,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=p,this.incompleteTransitions=new Map}function Vv(t,s,r,a,h,u,g,p,b,T,j,V){return t=new hy(t,s,r,g,p,b,T,V),s=1,u===!0&&(s|=24),u=Vt(3,null,null,s),t.current=u,u.stateNode=t,s=oh(),s.refCount++,t.pooledCache=s,s.refCount++,u.memoizedState={element:a,isDehydrated:r,cache:s},dh(u),t}function Xv(t){return t?(t=kr,t):kr}function Gv(t,s,r,a,h,u){h=Xv(h),a.context===null?a.context=h:a.pendingContext=h,a=ns(s),a.payload={element:r},u=u===void 0?null:u,u!==null&&(a.callback=u),r=ls(t,a,s),r!==null&&(It(r,t,s),Bn(r,t,s))}function $v(t,s){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<s?r:s}}function Dc(t,s){$v(t,s),(t=t.alternate)&&$v(t,s)}function Fv(t){if(t.tag===13){var s=Er(t,67108864);s!==null&&It(s,t,67108864),Dc(t,67108864)}}var Pa=!0;function cy(t,s,r,a){var h=k.T;k.T=null;var u=P.p;try{P.p=2,Rc(t,s,r,a)}finally{P.p=u,k.T=h}}function uy(t,s,r,a){var h=k.T;k.T=null;var u=P.p;try{P.p=8,Rc(t,s,r,a)}finally{P.p=u,k.T=h}}function Rc(t,s,r,a){if(Pa){var h=Tc(a);if(h===null)gc(t,s,a,ja,r),Zv(t,a);else if(fy(h,t,s,r,a))a.stopPropagation();else if(Zv(t,a),s&4&&-1<dy.indexOf(t)){for(;h!==null;){var u=fr(h);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var g=zs(u.pendingLanes);if(g!==0){var p=u;for(p.pendingLanes|=2,p.entangledLanes|=2;g;){var b=1<<31-Yt(g);p.entanglements[1]|=b,g&=~b}xi(u),(De&6)===0&&(Ca=Si()+500,Fn(0))}}break;case 13:p=Er(u,2),p!==null&&It(p,u,2),Ea(),Dc(u,2)}if(u=Tc(a),u===null&&gc(t,s,a,ja,r),u===h)break;h=u}h!==null&&a.stopPropagation()}else gc(t,s,a,null,r)}}function Tc(t){return t=Lo(t),Ac(t)}var ja=null;function Ac(t){if(ja=null,t=dr(t),t!==null){var s=c(t);if(s===null)t=null;else{var r=s.tag;if(r===13){if(t=d(s),t!==null)return t;t=null}else if(r===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;t=null}else s!==t&&(t=null)}}return ja=t,null}function Iv(t){switch(t){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Zm()){case hd:return 2;case cd:return 8;case Bl:case Qm:return 32;case ud:return 268435456;default:return 32}default:return 32}}var Bc=!1,Ss=null,ys=null,bs=null,sl=new Map,rl=new Map,ws=[],dy="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".split(" ");function Zv(t,s){switch(t){case"focusin":case"focusout":Ss=null;break;case"dragenter":case"dragleave":ys=null;break;case"mouseover":case"mouseout":bs=null;break;case"pointerover":case"pointerout":sl.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":rl.delete(s.pointerId)}}function nl(t,s,r,a,h,u){return t===null||t.nativeEvent!==u?(t={blockedOn:s,domEventName:r,eventSystemFlags:a,nativeEvent:u,targetContainers:[h]},s!==null&&(s=fr(s),s!==null&&Fv(s)),t):(t.eventSystemFlags|=a,s=t.targetContainers,h!==null&&s.indexOf(h)===-1&&s.push(h),t)}function fy(t,s,r,a,h){switch(s){case"focusin":return Ss=nl(Ss,t,s,r,a,h),!0;case"dragenter":return ys=nl(ys,t,s,r,a,h),!0;case"mouseover":return bs=nl(bs,t,s,r,a,h),!0;case"pointerover":var u=h.pointerId;return sl.set(u,nl(sl.get(u)||null,t,s,r,a,h)),!0;case"gotpointercapture":return u=h.pointerId,rl.set(u,nl(rl.get(u)||null,t,s,r,a,h)),!0}return!1}function Qv(t){var s=dr(t.target);if(s!==null){var r=c(s);if(r!==null){if(s=r.tag,s===13){if(s=d(r),s!==null){t.blockedOn=s,l0(t.priority,function(){if(r.tag===13){var a=Ft();a=xo(a);var h=Er(r,a);h!==null&&It(h,r,a),Dc(r,a)}});return}}else if(s===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function qa(t){if(t.blockedOn!==null)return!1;for(var s=t.targetContainers;0<s.length;){var r=Tc(t.nativeEvent);if(r===null){r=t.nativeEvent;var a=new r.constructor(r.type,r);Oo=a,r.target.dispatchEvent(a),Oo=null}else return s=fr(r),s!==null&&Fv(s),t.blockedOn=r,!1;s.shift()}return!0}function Jv(t,s,r){qa(t)&&r.delete(s)}function _y(){Bc=!1,Ss!==null&&qa(Ss)&&(Ss=null),ys!==null&&qa(ys)&&(ys=null),bs!==null&&qa(bs)&&(bs=null),sl.forEach(Jv),rl.forEach(Jv)}function Wa(t,s){t.blockedOn===s&&(t.blockedOn=null,Bc||(Bc=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,_y)))}var Ya=null;function eg(t){Ya!==t&&(Ya=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ya===t&&(Ya=null);for(var s=0;s<t.length;s+=3){var r=t[s],a=t[s+1],h=t[s+2];if(typeof a!="function"){if(Ac(a||r)===null)continue;break}var u=fr(r);u!==null&&(t.splice(s,3),s-=3,Ah(u,{pending:!0,data:h,method:r.method,action:a},a,h))}}))}function ll(t){function s(b){return Wa(b,t)}Ss!==null&&Wa(Ss,t),ys!==null&&Wa(ys,t),bs!==null&&Wa(bs,t),sl.forEach(s),rl.forEach(s);for(var r=0;r<ws.length;r++){var a=ws[r];a.blockedOn===t&&(a.blockedOn=null)}for(;0<ws.length&&(r=ws[0],r.blockedOn===null);)Qv(r),r.blockedOn===null&&ws.shift();if(r=(t.ownerDocument||t).$$reactFormReplay,r!=null)for(a=0;a<r.length;a+=3){var h=r[a],u=r[a+1],g=h[Lt]||null;if(typeof u=="function")g||eg(r);else if(g){var p=null;if(u&&u.hasAttribute("formAction")){if(h=u,g=u[Lt]||null)p=g.formAction;else if(Ac(h)!==null)continue}else p=g.action;typeof p=="function"?r[a+1]=p:(r.splice(a,3),a-=3),eg(r)}}}function zc(t){this._internalRoot=t}Ka.prototype.render=zc.prototype.render=function(t){var s=this._internalRoot;if(s===null)throw Error(l(409));var r=s.current,a=Ft();Gv(r,a,t,s,null,null)},Ka.prototype.unmount=zc.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var s=t.containerInfo;Gv(t.current,2,null,t,null,null),Ea(),s[ur]=null}};function Ka(t){this._internalRoot=t}Ka.prototype.unstable_scheduleHydration=function(t){if(t){var s=gd();t={blockedOn:null,target:t,priority:s};for(var r=0;r<ws.length&&s!==0&&s<ws[r].priority;r++);ws.splice(r,0,t),r===0&&Qv(t)}};var tg=i.version;if(tg!=="19.1.0")throw Error(l(527,tg,"19.1.0"));P.findDOMNode=function(t){var s=t._reactInternals;if(s===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=v(s),t=t!==null?f(t):null,t=t===null?null:t.stateNode,t};var vy={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Va=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Va.isDisabled&&Va.supportsFiber)try{cn=Va.inject(vy),Wt=Va}catch{}}return hl.createRoot=function(t,s){if(!o(t))throw Error(l(299));var r=!1,a="",h=p_,u=m_,g=S_,p=null;return s!=null&&(s.unstable_strictMode===!0&&(r=!0),s.identifierPrefix!==void 0&&(a=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(u=s.onCaughtError),s.onRecoverableError!==void 0&&(g=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&(p=s.unstable_transitionCallbacks)),s=Vv(t,1,!1,null,null,r,a,h,u,g,p,null),t[ur]=s.current,vc(t),new zc(s)},hl.hydrateRoot=function(t,s,r){if(!o(t))throw Error(l(299));var a=!1,h="",u=p_,g=m_,p=S_,b=null,T=null;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(h=r.identifierPrefix),r.onUncaughtError!==void 0&&(u=r.onUncaughtError),r.onCaughtError!==void 0&&(g=r.onCaughtError),r.onRecoverableError!==void 0&&(p=r.onRecoverableError),r.unstable_transitionCallbacks!==void 0&&(b=r.unstable_transitionCallbacks),r.formState!==void 0&&(T=r.formState)),s=Vv(t,1,!0,s,r??null,a,h,u,g,p,b,T),s.context=Xv(null),r=s.current,a=Ft(),a=xo(a),h=ns(a),h.callback=null,ls(r,h,a),r=a,s.current.lanes=r,dn(s,r),xi(s),t[ur]=s.current,vc(t),new Ka(s)},hl.version="19.1.0",hl}var vg;function ky(){if(vg)return Lc.exports;vg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Lc.exports=Ey(),Lc.exports}var My=ky(),fe=Ku();const Xa=py(fe),gg=e=>{let i;const n=new Set,l=(f,m)=>{const S=typeof f=="function"?f(i):f;if(!Object.is(S,i)){const y=i;i=m??(typeof S!="object"||S===null)?S:Object.assign({},i,S),n.forEach(M=>M(i,y))}},o=()=>i,_={setState:l,getState:o,getInitialState:()=>v,subscribe:f=>(n.add(f),()=>n.delete(f))},v=i=e(l,o,_);return _},Dy=(e=>e?gg(e):gg),Ry=e=>e;function Ty(e,i=Ry){const n=Xa.useSyncExternalStore(e.subscribe,Xa.useCallback(()=>i(e.getState()),[e,i]),Xa.useCallback(()=>i(e.getInitialState()),[e,i]));return Xa.useDebugValue(n),n}const pg=e=>{const i=Dy(e),n=l=>Ty(i,l);return Object.assign(n,i),n},mo=(e=>e?pg(e):pg),Ay={"mobile-portrait":{w:375,h:812},"mobile-landscape":{w:812,h:375},"tablet-portrait":{w:768,h:1024},"tablet-landscape":{w:1024,h:768},desktop:{w:1280,h:800}},mg="unloved_view_mode",Sg="unloved_preview_viewport",By=["both","side-by-side","terminal","preview"],zy=["default","mobile-portrait","mobile-landscape","tablet-portrait","tablet-landscape","desktop"];function yg(e,i,n){const l=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`)),o=l==null?void 0:l[1];return o&&i.includes(o)?o:n}function bg(e,i){document.cookie=`${e}=${i};path=/;max-age=31536000;SameSite=Lax`}const fi=mo(e=>({sidebarOpen:!0,viewMode:yg(mg,By,"both"),previewViewport:yg(Sg,zy,"default"),toggleSidebar:()=>e(i=>({sidebarOpen:!i.sidebarOpen})),closeSidebar:()=>e({sidebarOpen:!1}),setViewMode:i=>{bg(mg,i),e({viewMode:i})},setPreviewViewport:i=>{bg(Sg,i),e({previewViewport:i})}}));/**
|
|
50
|
-
* @license lucide-react v0.511.0 - ISC
|
|
51
|
-
*
|
|
52
|
-
* This source code is licensed under the ISC license.
|
|
53
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/const Oy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ly=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,n,l)=>l?l.toUpperCase():n.toLowerCase()),wg=e=>{const i=Ly(e);return i.charAt(0).toUpperCase()+i.slice(1)},Kp=(...e)=>e.filter((i,n,l)=>!!i&&i.trim()!==""&&l.indexOf(i)===n).join(" ").trim(),Ny=e=>{for(const i in e)if(i.startsWith("aria-")||i==="role"||i==="title")return!0};/**
|
|
55
|
-
* @license lucide-react v0.511.0 - ISC
|
|
56
|
-
*
|
|
57
|
-
* This source code is licensed under the ISC license.
|
|
58
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/var Hy={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
60
|
-
* @license lucide-react v0.511.0 - ISC
|
|
61
|
-
*
|
|
62
|
-
* This source code is licensed under the ISC license.
|
|
63
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const Uy=fe.forwardRef(({color:e="currentColor",size:i=24,strokeWidth:n=2,absoluteStrokeWidth:l,className:o="",children:c,iconNode:d,..._},v)=>fe.createElement("svg",{ref:v,...Hy,width:i,height:i,stroke:e,strokeWidth:l?Number(n)*24/Number(i):n,className:Kp("lucide",o),...!c&&!Ny(_)&&{"aria-hidden":"true"},..._},[...d.map(([f,m])=>fe.createElement(f,m)),...Array.isArray(c)?c:[c]]));/**
|
|
65
|
-
* @license lucide-react v0.511.0 - ISC
|
|
66
|
-
*
|
|
67
|
-
* This source code is licensed under the ISC license.
|
|
68
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const ht=(e,i)=>{const n=fe.forwardRef(({className:l,...o},c)=>fe.createElement(Uy,{ref:c,iconNode:i,className:Kp(`lucide-${Oy(wg(e))}`,`lucide-${e}`,l),...o}));return n.displayName=wg(e),n};/**
|
|
70
|
-
* @license lucide-react v0.511.0 - ISC
|
|
71
|
-
*
|
|
72
|
-
* This source code is licensed under the ISC license.
|
|
73
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/const Py=[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]],jy=ht("app-window",Py);/**
|
|
75
|
-
* @license lucide-react v0.511.0 - ISC
|
|
76
|
-
*
|
|
77
|
-
* This source code is licensed under the ISC license.
|
|
78
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const qy=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Wy=ht("columns-2",qy);/**
|
|
80
|
-
* @license lucide-react v0.511.0 - ISC
|
|
81
|
-
*
|
|
82
|
-
* This source code is licensed under the ISC license.
|
|
83
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/const Yy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Ky=ht("globe",Yy);/**
|
|
85
|
-
* @license lucide-react v0.511.0 - ISC
|
|
86
|
-
*
|
|
87
|
-
* This source code is licensed under the ISC license.
|
|
88
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/const Vy=[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]],Xy=ht("hammer",Vy);/**
|
|
90
|
-
* @license lucide-react v0.511.0 - ISC
|
|
91
|
-
*
|
|
92
|
-
* This source code is licensed under the ISC license.
|
|
93
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/const Gy=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],$y=ht("maximize",Gy);/**
|
|
95
|
-
* @license lucide-react v0.511.0 - ISC
|
|
96
|
-
*
|
|
97
|
-
* This source code is licensed under the ISC license.
|
|
98
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
-
*/const Fy=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],Iy=ht("menu",Fy);/**
|
|
100
|
-
* @license lucide-react v0.511.0 - ISC
|
|
101
|
-
*
|
|
102
|
-
* This source code is licensed under the ISC license.
|
|
103
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/const Zy=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Qy=ht("monitor",Zy);/**
|
|
105
|
-
* @license lucide-react v0.511.0 - ISC
|
|
106
|
-
*
|
|
107
|
-
* This source code is licensed under the ISC license.
|
|
108
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/const Jy=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],e1=ht("moon",Jy);/**
|
|
110
|
-
* @license lucide-react v0.511.0 - ISC
|
|
111
|
-
*
|
|
112
|
-
* This source code is licensed under the ISC license.
|
|
113
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
-
*/const t1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],i1=ht("plus",t1);/**
|
|
115
|
-
* @license lucide-react v0.511.0 - ISC
|
|
116
|
-
*
|
|
117
|
-
* This source code is licensed under the ISC license.
|
|
118
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const s1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],r1=ht("rotate-ccw",s1);/**
|
|
120
|
-
* @license lucide-react v0.511.0 - ISC
|
|
121
|
-
*
|
|
122
|
-
* This source code is licensed under the ISC license.
|
|
123
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const n1=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],l1=ht("rotate-cw",n1);/**
|
|
125
|
-
* @license lucide-react v0.511.0 - ISC
|
|
126
|
-
*
|
|
127
|
-
* This source code is licensed under the ISC license.
|
|
128
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const a1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]],o1=ht("rows-2",a1);/**
|
|
130
|
-
* @license lucide-react v0.511.0 - ISC
|
|
131
|
-
*
|
|
132
|
-
* This source code is licensed under the ISC license.
|
|
133
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/const h1=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],c1=ht("settings",h1);/**
|
|
135
|
-
* @license lucide-react v0.511.0 - ISC
|
|
136
|
-
*
|
|
137
|
-
* This source code is licensed under the ISC license.
|
|
138
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/const u1=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],d1=ht("smartphone",u1);/**
|
|
140
|
-
* @license lucide-react v0.511.0 - ISC
|
|
141
|
-
*
|
|
142
|
-
* This source code is licensed under the ISC license.
|
|
143
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
-
*/const f1=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],_1=ht("square-terminal",f1);/**
|
|
145
|
-
* @license lucide-react v0.511.0 - ISC
|
|
146
|
-
*
|
|
147
|
-
* This source code is licensed under the ISC license.
|
|
148
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/const v1=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],g1=ht("sun",v1);/**
|
|
150
|
-
* @license lucide-react v0.511.0 - ISC
|
|
151
|
-
*
|
|
152
|
-
* This source code is licensed under the ISC license.
|
|
153
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/const p1=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]],m1=ht("tablet",p1);/**
|
|
155
|
-
* @license lucide-react v0.511.0 - ISC
|
|
156
|
-
*
|
|
157
|
-
* This source code is licensed under the ISC license.
|
|
158
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
-
*/const S1=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],y1=ht("trash-2",S1);/**
|
|
160
|
-
* @license lucide-react v0.511.0 - ISC
|
|
161
|
-
*
|
|
162
|
-
* This source code is licensed under the ISC license.
|
|
163
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
-
*/const b1=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],w1=ht("unplug",b1),C1={primary:"bg-accent text-white hover:bg-accent-hover",secondary:"bg-[#E5E7EB] text-text-primary hover:bg-[#D1D5DB] dark:bg-divider-dark dark:text-text-dark dark:hover:bg-divider-dark",ghost:"bg-transparent hover:bg-sidebar-hover dark:hover:bg-divider-dark"},x1="h-9 cursor-pointer rounded-button px-3.5 text-sm font-medium transition-colors duration-150";function Cg({variant:e="primary",className:i,children:n,type:l="button",...o}){return O.jsx("button",{type:l,className:[x1,C1[e],i].filter(Boolean).join(" "),...o,children:n})}const E1="h-10 w-full rounded-input border border-divider bg-white px-3.5 text-base transition-colors outline-none focus:border-accent focus:ring-3 focus:ring-accent-ring dark:border-divider-dark dark:bg-card-dark dark:text-text-dark";function k1({className:e,...i}){return O.jsx("input",{className:[E1,e].filter(Boolean).join(" "),...i})}const xg=e=>{document.documentElement.classList.toggle("dark",e==="dark")},iu=mo((e,i)=>({mode:"dark",setMode:n=>{e({mode:n}),xg(n),fetch("/api/config",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({theme:n})})},toggle:()=>{const n=i().mode==="dark"?"light":"dark";i().setMode(n)},hydrate:async()=>{try{const n=await fetch("/api/config");if(!n.ok)return;const l=await n.json();e({mode:l.theme}),xg(l.theme)}catch{}}}));function M1({className:e}){const i=iu(l=>l.mode),n=iu(l=>l.toggle);return O.jsx("button",{type:"button",onClick:n,className:["flex h-8 w-8 cursor-pointer items-center justify-center rounded-full text-text-primary transition-colors duration-150 hover:bg-sidebar-hover dark:text-text-dark dark:hover:bg-divider-dark",e].filter(Boolean).join(" "),"aria-label":"Toggle theme",children:i==="dark"?O.jsx(e1,{size:18,strokeWidth:1.8}):O.jsx(g1,{size:18,strokeWidth:1.8})})}let Ir=null;const Rt=mo((e,i)=>({sessions:[],activeSessionName:null,sessionMetas:{},error:null,fetchSessions:async()=>{try{const n=await fetch("/api/tmux/sessions");if(!n.ok)return;const l=await n.json();e({sessions:l})}catch{}},setActiveSession:n=>{e({activeSessionName:n,error:null}),i().fetchMeta(n)},clearActiveSession:()=>{e({activeSessionName:null})},createSession:async n=>{e({error:null});try{const l=await fetch("/api/tmux/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n})});if(!l.ok){const o=await l.json();e({error:o.error??"Failed to create session"});return}await i().fetchSessions(),i().setActiveSession(n)}catch{e({error:"Server unreachable"})}},fetchMeta:async n=>{try{const l=await fetch(`/api/sessions/${encodeURIComponent(n)}/meta`);if(!l.ok)return;const o=await l.json();e(c=>({sessionMetas:{...c.sessionMetas,[n]:o}}))}catch{}},killSession:async n=>{try{await fetch(`/api/tmux/sessions/${encodeURIComponent(n)}`,{method:"DELETE"}),e({activeSessionName:null}),await i().fetchSessions()}catch{}},triggerRestart:async n=>{try{await fetch(`/api/sessions/${encodeURIComponent(n)}/restart`,{method:"POST"})}catch{}},startPolling:()=>{Ir&&clearInterval(Ir);const n=()=>{i().fetchSessions();const l=i().activeSessionName;l&&i().fetchMeta(l)};return n(),Ir=setInterval(n,3e3),()=>{Ir&&(clearInterval(Ir),Ir=null)}}}));function D1({name:e,attached:i,active:n,onClick:l}){return O.jsxs("button",{type:"button",onClick:l,className:["flex w-full cursor-pointer items-center gap-2.5 rounded-sidebar px-3 py-2 text-left text-sm transition-colors",n?"bg-sidebar-active font-medium text-text-primary shadow-subtle dark:bg-divider-dark dark:text-text-dark":"text-text-secondary hover:bg-sidebar-hover dark:hover:bg-divider-dark"].join(" "),children:[i&&O.jsx("span",{className:"inline-block h-2 w-2 shrink-0 rounded-full bg-green-500"}),O.jsx("span",{className:"truncate font-mono text-[13px]",children:e})]})}function R1(){const e=Rt(o=>o.sessions),i=Rt(o=>o.activeSessionName),n=Rt(o=>o.setActiveSession),l=fi(o=>o.closeSidebar);return e.length===0?O.jsx("p",{className:"px-3 py-4 text-xs text-text-secondary",children:"No tmux sessions running."}):O.jsx("div",{className:"flex flex-col gap-0.5",children:e.map(o=>O.jsx(D1,{name:o.name,attached:o.attached,active:o.name===i,onClick:()=>{n(o.name),l()}},o.name))})}function T1({onClose:e}){const[i,n]=fe.useState(""),l=Rt(_=>_.createSession),o=Rt(_=>_.error),c=fi(_=>_.closeSidebar),d=async _=>{_.preventDefault();const v=i.trim();v&&(await l(v),Rt.getState().error||(e(),c()))};return O.jsxs("form",{onSubmit:d,className:"flex flex-col gap-2 rounded-sidebar bg-sidebar-active p-3 shadow-subtle dark:bg-bg-dark",children:[O.jsx(k1,{value:i,onChange:_=>n(_.target.value),placeholder:"Session name",autoFocus:!0,className:"h-8 text-sm"}),o&&O.jsx("p",{className:"text-xs text-red-500",children:o}),O.jsxs("div",{className:"flex gap-2",children:[O.jsx(Cg,{type:"submit",className:"flex-1 h-8 text-xs",children:"Create"}),O.jsx(Cg,{variant:"ghost",onClick:e,className:"h-8 text-xs",children:"Cancel"})]})]})}function Eg(){const[e,i]=fe.useState(!1);return O.jsxs("aside",{className:"flex h-full min-w-[var(--sidebar-width)] flex-col border-r border-divider bg-sidebar dark:border-divider-dark dark:bg-card-dark",children:[O.jsxs("div",{className:"flex items-center gap-2.5 px-5 py-4",children:[O.jsx("img",{src:"/logo.png",alt:"unloved",className:"h-7 w-7"}),O.jsx("span",{className:"text-sm font-semibold text-text-primary dark:text-text-dark",children:"unloved"})]}),O.jsx("div",{className:"h-px bg-divider dark:bg-divider-dark"}),O.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:O.jsx(R1,{})}),O.jsx("div",{className:"px-3 pb-2",children:e?O.jsx(T1,{onClose:()=>i(!1)}):O.jsxs("button",{type:"button",onClick:()=>i(!0),className:"flex w-full cursor-pointer items-center gap-2 rounded-sidebar px-3 py-2 text-sm text-text-secondary transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark",children:[O.jsx(i1,{size:16}),"New session"]})}),O.jsx("div",{className:"border-t border-divider px-3 py-3 dark:border-divider-dark",children:O.jsx(M1,{className:"static h-8 w-8"})})]})}const A1=[{value:"both",icon:o1,label:"Stacked"},{value:"side-by-side",icon:Wy,label:"Side by side"},{value:"terminal",icon:_1,label:"Chat only"},{value:"preview",icon:jy,label:"Workspace only"}];function B1(){const e=fi(n=>n.viewMode),i=fi(n=>n.setViewMode);return O.jsx("div",{className:"flex h-8 items-center rounded-lg border border-divider bg-sidebar dark:border-divider-dark dark:bg-bg-dark",children:A1.map(({value:n,icon:l,label:o})=>O.jsx("button",{type:"button",onClick:()=>i(n),className:["flex h-full cursor-pointer items-center gap-1.5 px-2.5 text-xs transition-colors first:rounded-l-lg last:rounded-r-lg",e===n?"bg-accent text-white":"text-text-secondary hover:bg-sidebar-hover dark:hover:bg-divider-dark"].join(" "),"aria-label":o,title:o,children:O.jsx(l,{size:14})},n))})}const z1=[{portrait:"mobile-portrait",landscape:"mobile-landscape",icon:d1,label:"Mobile"},{portrait:"tablet-portrait",landscape:"tablet-landscape",icon:m1,label:"Tablet"}];function O1(){const e=fi(c=>c.previewViewport),i=fi(c=>c.setPreviewViewport),n=c=>e===c,l=c=>n(c.portrait)||n(c.landscape),o=c=>["flex h-full cursor-pointer items-center gap-1 px-2 text-xs transition-colors",c?"bg-accent text-white":"text-text-secondary hover:bg-sidebar-hover dark:hover:bg-divider-dark"].join(" ");return O.jsxs("div",{className:"flex h-8 items-center rounded-lg border border-divider bg-sidebar dark:border-divider-dark dark:bg-bg-dark",children:[z1.map(c=>{const d=l(c),_=n(c.landscape);return O.jsxs("div",{className:"flex h-full items-center",children:[O.jsx("button",{type:"button",onClick:()=>i(d?"default":c.portrait),className:o(d),"aria-label":c.label,title:c.label,children:O.jsx(c.icon,{size:14})}),d&&O.jsx("button",{type:"button",onClick:()=>i(_?c.portrait:c.landscape),className:"flex h-full cursor-pointer items-center px-1.5 text-text-secondary transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark","aria-label":"Toggle orientation",title:_?"Portrait":"Landscape",children:O.jsx(r1,{size:11})})]},c.portrait)}),O.jsx("button",{type:"button",onClick:()=>i(n("desktop")?"default":"desktop"),className:[o(n("desktop")),"rounded-none"].join(" "),"aria-label":"Desktop (1280px)",title:"Desktop (1280px)",children:O.jsx(Qy,{size:14})}),O.jsx("button",{type:"button",onClick:()=>i("default"),className:[o(n("default")),"rounded-r-lg"].join(" "),"aria-label":"Full width",title:"Full width",children:O.jsx($y,{size:14})})]})}function L1(){const[e,i]=fe.useState(!1),n=fe.useRef(null),l=Rt(d=>d.activeSessionName),o=Rt(d=>d.clearActiveSession),c=Rt(d=>d.killSession);return fe.useEffect(()=>{if(!e)return;function d(_){n.current&&!n.current.contains(_.target)&&i(!1)}return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[e]),O.jsxs("div",{ref:n,className:"relative",children:[O.jsx("button",{type:"button",onClick:()=>i(d=>!d),className:"flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-sidebar text-text-secondary transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark","aria-label":"Session settings",children:O.jsx(c1,{size:16})}),O.jsxs("div",{className:["absolute right-0 top-full z-50 mt-1 w-52 origin-top-right overflow-hidden rounded-lg border border-divider bg-sidebar shadow-lg transition-all duration-150 dark:border-divider-dark dark:bg-bg-dark",e?"scale-100 opacity-100":"pointer-events-none scale-95 opacity-0"].join(" "),children:[O.jsxs("button",{type:"button",onClick:()=>{o(),i(!1)},className:"flex w-full cursor-pointer items-center gap-2.5 px-3 py-2.5 text-left text-sm text-text-secondary transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark",children:[O.jsx(w1,{size:14}),"Disconnect"]}),O.jsxs("button",{type:"button",onClick:()=>{l&&c(l),i(!1)},className:"flex w-full cursor-pointer items-center gap-2.5 px-3 py-2.5 text-left text-sm text-red-400 transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark",children:[O.jsx(y1,{size:14}),"Kill tmux session"]})]})]})}function N1(){const e=Rt(f=>f.activeSessionName),i=Rt(f=>f.sessionMetas),n=Rt(f=>f.triggerRestart),l=fi(f=>f.toggleSidebar),o=fi(f=>f.viewMode),c=e?i[e]:null,d=c==null?void 0:c.previewUrl,_=o!=="terminal",v=()=>{const f=document.querySelector('iframe[title="Preview"]');if(!f)return;const m=f.src;f.src="about:blank",requestAnimationFrame(()=>{f.src=m})};return O.jsxs("header",{className:"flex h-[var(--header-height)] shrink-0 items-center gap-3 border-b border-divider px-4 dark:border-divider-dark",children:[O.jsx("button",{type:"button",onClick:l,className:"flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-sidebar text-text-secondary transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark","aria-label":"Toggle sidebar",children:O.jsx(Iy,{size:18})}),e?O.jsxs(O.Fragment,{children:[O.jsx("span",{className:"shrink-0 font-mono text-sm font-medium text-text-primary dark:text-text-dark",children:e}),d&&O.jsxs("div",{className:"flex h-9 w-[var(--console-width)] max-w-[420px] shrink-0 items-center gap-2 rounded-input border border-divider bg-sidebar px-3 dark:border-divider-dark dark:bg-bg-dark",children:[O.jsx("span",{className:"flex-1 truncate font-mono text-xs text-text-secondary","data-testid":"header-url",children:d}),O.jsx("button",{type:"button",onClick:v,className:"flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded text-text-secondary transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark","aria-label":"Refresh preview",children:O.jsx(l1,{size:13})})]}),O.jsx("div",{className:"flex-1"}),O.jsx(B1,{}),O.jsx("div",{className:"flex-1"}),_&&O.jsx(O1,{}),(c==null?void 0:c.restartCommand)&&O.jsxs("button",{type:"button",onClick:()=>n(e),className:"flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-button bg-accent px-3 text-xs font-medium text-white transition-colors hover:bg-accent-hover","aria-label":"Rebuild",children:[O.jsx(Xy,{size:14}),"Rebuild"]}),O.jsx(L1,{})]}):O.jsx("span",{className:"text-sm text-text-secondary",children:"Select a session"})]})}function H1(){return O.jsxs("div",{className:"w-full max-w-md rounded-card bg-card p-8 shadow-card dark:bg-card-dark",children:[O.jsxs("div",{className:"flex flex-col items-center gap-3",children:[O.jsx("img",{src:"/logo.png",alt:"unloved",className:"h-12 w-12"}),O.jsx("h1",{className:"text-[28px] font-semibold text-text-primary dark:text-text-dark",children:"unloved"}),O.jsx("p",{className:"text-sm text-text-secondary",children:"Local AI coding cockpit"})]}),O.jsx("div",{className:"h-6"}),O.jsx("p",{className:"text-center text-sm text-text-secondary",children:"Select a session from the sidebar to get started, or create a new one."})]})}function U1(){return O.jsxs("div",{className:"fixed inset-0 -z-10 overflow-hidden",children:[O.jsx("div",{className:"absolute top-[-140px] left-1/2 h-[400px] w-[400px] -translate-x-1/2 rounded-full bg-gradient-top opacity-70 blur-[120px] dark:bg-gradient-mid dark:opacity-25"}),O.jsx("div",{className:"absolute top-1/2 left-1/2 h-[500px] w-[500px] -translate-x-1/2 -translate-y-1/2 rounded-full bg-gradient-mid opacity-30 blur-[120px] dark:opacity-15"}),O.jsx("div",{className:"absolute right-[-100px] bottom-[-100px] h-[350px] w-[350px] rounded-full bg-linear-to-br from-gradient-pink to-gradient-red opacity-40 blur-[120px] dark:opacity-20"})]})}function P1(e,i){const n=getComputedStyle(e),l=parseFloat(n.fontSize);return i*l}function j1(e,i){const n=getComputedStyle(e.ownerDocument.body),l=parseFloat(n.fontSize);return i*l}function q1(e){return e/100*window.innerHeight}function W1(e){return e/100*window.innerWidth}function Y1(e){switch(typeof e){case"number":return[e,"px"];case"string":{const i=parseFloat(e);return e.endsWith("%")?[i,"%"]:e.endsWith("px")?[i,"px"]:e.endsWith("rem")?[i,"rem"]:e.endsWith("em")?[i,"em"]:e.endsWith("vh")?[i,"vh"]:e.endsWith("vw")?[i,"vw"]:[i,"%"]}}}function Ga({groupSize:e,panelElement:i,styleProp:n}){let l;const[o,c]=Y1(n);switch(c){case"%":{l=o/100*e;break}case"px":{l=o;break}case"rem":{l=j1(i,o);break}case"em":{l=P1(i,o);break}case"vh":{l=q1(o);break}case"vw":{l=W1(o);break}}return l}function qt(e){return parseFloat(e.toFixed(3))}function ln({group:e}){const{orientation:i,panels:n}=e;return n.reduce((l,o)=>(l+=i==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,l),0)}function su(e){const{panels:i}=e,n=ln({group:e});return n===0?i.map(l=>({groupResizeBehavior:l.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:l.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:l.panelConstraints.disabled,minSize:0,maxSize:100,panelId:l.id})):i.map(l=>{const{element:o,panelConstraints:c}=l;let d=0;if(c.collapsedSize!==void 0){const m=Ga({groupSize:n,panelElement:o,styleProp:c.collapsedSize});d=qt(m/n*100)}let _;if(c.defaultSize!==void 0){const m=Ga({groupSize:n,panelElement:o,styleProp:c.defaultSize});_=qt(m/n*100)}let v=0;if(c.minSize!==void 0){const m=Ga({groupSize:n,panelElement:o,styleProp:c.minSize});v=qt(m/n*100)}let f=100;if(c.maxSize!==void 0){const m=Ga({groupSize:n,panelElement:o,styleProp:c.maxSize});f=qt(m/n*100)}return{groupResizeBehavior:c.groupResizeBehavior,collapsedSize:d,collapsible:c.collapsible===!0,defaultSize:_,disabled:c.disabled,minSize:v,maxSize:f,panelId:l.id}})}function Le(e,i="Assertion error"){if(!e)throw Error(i)}function ru(e,i){return Array.from(i).sort(e==="horizontal"?K1:V1)}function K1(e,i){const n=e.element.offsetLeft-i.element.offsetLeft;return n!==0?n:e.element.offsetWidth-i.element.offsetWidth}function V1(e,i){const n=e.element.offsetTop-i.element.offsetTop;return n!==0?n:e.element.offsetHeight-i.element.offsetHeight}function Vp(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Xp(e,i){return{x:e.x>=i.left&&e.x<=i.right?0:Math.min(Math.abs(e.x-i.left),Math.abs(e.x-i.right)),y:e.y>=i.top&&e.y<=i.bottom?0:Math.min(Math.abs(e.y-i.top),Math.abs(e.y-i.bottom))}}function X1({orientation:e,rects:i,targetRect:n}){const l={x:n.x+n.width/2,y:n.y+n.height/2};let o,c=Number.MAX_VALUE;for(const d of i){const{x:_,y:v}=Xp(l,d),f=e==="horizontal"?_:v;f<c&&(c=f,o=d)}return Le(o,"No rect found"),o}let $a;function G1(){return $a===void 0&&(typeof matchMedia=="function"?$a=!!matchMedia("(pointer:coarse)").matches:$a=!1),$a}function Gp(e){const{element:i,orientation:n,panels:l,separators:o}=e,c=ru(n,Array.from(i.children).filter(Vp).map(C=>({element:C}))).map(({element:C})=>C),d=[];let _=!1,v=!1,f=-1,m=-1,S=0,y,M=[];{let C=-1;for(const E of c)E.hasAttribute("data-panel")&&(C++,E.ariaDisabled===null&&(S++,f===-1&&(f=C),m=C))}if(S>1){let C=-1;for(const E of c)if(E.hasAttribute("data-panel")){C++;const B=l.find(L=>L.element===E);if(B){if(y){const L=y.element.getBoundingClientRect(),Q=E.getBoundingClientRect();let G;if(v){const q=n==="horizontal"?new DOMRect(L.right,L.top,0,L.height):new DOMRect(L.left,L.bottom,L.width,0),N=n==="horizontal"?new DOMRect(Q.left,Q.top,0,Q.height):new DOMRect(Q.left,Q.top,Q.width,0);switch(M.length){case 0:{G=[q,N];break}case 1:{const ee=M[0],le=X1({orientation:n,rects:[L,Q],targetRect:ee.element.getBoundingClientRect()});G=[ee,le===L?N:q];break}default:{G=M;break}}}else M.length?G=M:G=[n==="horizontal"?new DOMRect(L.right,Q.top,Q.left-L.right,Q.height):new DOMRect(Q.left,L.bottom,Q.width,Q.top-L.bottom)];for(const q of G){let N="width"in q?q:q.element.getBoundingClientRect();const ee=G1()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(N.width<ee){const _e=ee-N.width;N=new DOMRect(N.x-_e/2,N.y,N.width+_e,N.height)}if(N.height<ee){const _e=ee-N.height;N=new DOMRect(N.x,N.y-_e/2,N.width,N.height+_e)}const le=C<=f||C>m;!_&&!le&&d.push({group:e,groupSize:ln({group:e}),panels:[y,B],separator:"width"in q?void 0:q,rect:N}),_=!1}}v=!1,y=B,M=[]}}else if(E.hasAttribute("data-separator")){E.ariaDisabled!==null&&(_=!0);const B=o.find(L=>L.element===E);B?M.push(B):(y=void 0,M=[])}else v=!0}return d}var Ds,jp;let $p=(jp=class{constructor(){rg(this,Ds,{})}addListener(i,n){const l=al(this,Ds)[i];return l===void 0?al(this,Ds)[i]=[n]:l.includes(n)||l.push(n),()=>{this.removeListener(i,n)}}emit(i,n){const l=al(this,Ds)[i];if(l!==void 0)if(l.length===1)l[0].call(null,n);else{let o=!1,c=null;const d=Array.from(l);for(let _=0;_<d.length;_++){const v=d[_];try{v.call(null,n)}catch(f){c===null&&(o=!0,c=f)}}if(o)throw c}}removeAllListeners(){ng(this,Ds,{})}removeListener(i,n){const l=al(this,Ds)[i];if(l!==void 0){const o=l.indexOf(n);o>=0&&l.splice(o,1)}}},Ds=new WeakMap,jp),Ri=new Map;const Fp=new $p;function $1(e){Ri=new Map(Ri),Ri.delete(e)}function kg(e,i){for(const[n]of Ri)if(n.id===e)return n}function Ts(e,i){for(const[n,l]of Ri)if(n.id===e)return l;if(i)throw Error(`Could not find data for Group with id ${e}`)}function or(){return Ri}function Vu(e,i){return Fp.addListener("groupChange",n=>{n.group.id===e&&i(n)})}function Ii(e,i){const n=Ri.get(e);Ri=new Map(Ri),Ri.set(e,i),Fp.emit("groupChange",{group:e,prev:n,next:i})}function F1(e,i,n){let l,o={x:1/0,y:1/0};for(const c of i){const d=Xp(n,c.rect);switch(e){case"horizontal":{d.x<=o.x&&(l=c,o=d);break}case"vertical":{d.y<=o.y&&(l=c,o=d);break}}}return l?{distance:o,hitRegion:l}:void 0}function I1(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Z1(e,i){if(e===i)throw new Error("Cannot compare node with itself");const n={a:Rg(e),b:Rg(i)};let l;for(;n.a.at(-1)===n.b.at(-1);)l=n.a.pop(),n.b.pop();Le(l,"Stacking order can only be calculated for elements with a common ancestor");const o={a:Dg(Mg(n.a)),b:Dg(Mg(n.b))};if(o.a===o.b){const c=l.childNodes,d={a:n.a.at(-1),b:n.b.at(-1)};let _=c.length;for(;_--;){const v=c[_];if(v===d.a)return 1;if(v===d.b)return-1}}return Math.sign(o.a-o.b)}const Q1=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function J1(e){const i=getComputedStyle(Ip(e)??e).display;return i==="flex"||i==="inline-flex"}function eb(e){const i=getComputedStyle(e);return!!(i.position==="fixed"||i.zIndex!=="auto"&&(i.position!=="static"||J1(e))||+i.opacity<1||"transform"in i&&i.transform!=="none"||"webkitTransform"in i&&i.webkitTransform!=="none"||"mixBlendMode"in i&&i.mixBlendMode!=="normal"||"filter"in i&&i.filter!=="none"||"webkitFilter"in i&&i.webkitFilter!=="none"||"isolation"in i&&i.isolation==="isolate"||Q1.test(i.willChange)||i.webkitOverflowScrolling==="touch")}function Mg(e){let i=e.length;for(;i--;){const n=e[i];if(Le(n,"Missing node"),eb(n))return n}return null}function Dg(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Rg(e){const i=[];for(;e;)i.push(e),e=Ip(e);return i}function Ip(e){const{parentNode:i}=e;return I1(i)?i.host:i}function tb(e,i){return e.x<i.x+i.width&&e.x+e.width>i.x&&e.y<i.y+i.height&&e.y+e.height>i.y}function ib({groupElement:e,hitRegion:i,pointerEventTarget:n}){if(!Vp(n)||n.contains(e)||e.contains(n))return!0;if(Z1(n,e)>0){let l=n;for(;l;){if(l.contains(e))return!0;if(tb(l.getBoundingClientRect(),i))return!1;l=l.parentElement}}return!0}function Xu(e,i){const n=[];return i.forEach((l,o)=>{if(o.disabled)return;const c=Gp(o),d=F1(o.orientation,c,{x:e.clientX,y:e.clientY});d&&d.distance.x<=0&&d.distance.y<=0&&ib({groupElement:o.element,hitRegion:d.hitRegion.rect,pointerEventTarget:e.target})&&n.push(d.hitRegion)}),n}function sb(e,i){if(e.length!==i.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=i[n])return!1;return!0}function Bt(e,i,n=0){return Math.abs(qt(e)-qt(i))<=n}function Di(e,i){return Bt(e,i)?0:e>i?1:-1}function tn({overrideDisabledPanels:e,panelConstraints:i,prevSize:n,size:l}){const{collapsedSize:o=0,collapsible:c,disabled:d,maxSize:_=100,minSize:v=0}=i;if(d&&!e)return n;if(Di(l,v)<0)if(c){const f=(o+v)/2;Di(l,f)<0?l=o:l=v}else l=v;return l=Math.min(_,l),l=qt(l),l}function xl({delta:e,initialLayout:i,panelConstraints:n,pivotIndices:l,prevLayout:o,trigger:c}){if(Bt(e,0))return i;const d=c==="imperative-api",_=Object.values(i),v=Object.values(o),f=[..._],[m,S]=l;Le(m!=null,"Invalid first pivot index"),Le(S!=null,"Invalid second pivot index");let y=0;switch(c){case"keyboard":{{const E=e<0?S:m,B=n[E];Le(B,`Panel constraints not found for index ${E}`);const{collapsedSize:L=0,collapsible:Q,minSize:G=0}=B;if(Q){const q=_[E];if(Le(q!=null,`Previous layout not found for panel index ${E}`),Bt(q,L)){const N=G-q;Di(N,Math.abs(e))>0&&(e=e<0?0-N:N)}}}{const E=e<0?m:S,B=n[E];Le(B,`No panel constraints found for index ${E}`);const{collapsedSize:L=0,collapsible:Q,minSize:G=0}=B;if(Q){const q=_[E];if(Le(q!=null,`Previous layout not found for panel index ${E}`),Bt(q,G)){const N=q-L;Di(N,Math.abs(e))>0&&(e=e<0?0-N:N)}}}break}default:{const E=e<0?S:m,B=n[E];Le(B,`Panel constraints not found for index ${E}`);const L=_[E],{collapsible:Q,collapsedSize:G,minSize:q}=B;if(Q&&Di(L,q)<0)if(e>0){const N=q-G,ee=N/2,le=L+e;Di(le,q)<0&&(e=Di(e,ee)<=0?0:N)}else{const N=q-G,ee=100-N/2,le=L-e;Di(le,q)<0&&(e=Di(100+e,ee)>0?0:-N)}break}}{const E=e<0?1:-1;let B=e<0?S:m,L=0;for(;;){const G=_[B];Le(G!=null,`Previous layout not found for panel index ${B}`);const q=tn({overrideDisabledPanels:d,panelConstraints:n[B],prevSize:G,size:100})-G;if(L+=q,B+=E,B<0||B>=n.length)break}const Q=Math.min(Math.abs(e),Math.abs(L));e=e<0?0-Q:Q}{let E=e<0?m:S;for(;E>=0&&E<n.length;){const B=Math.abs(e)-Math.abs(y),L=_[E];Le(L!=null,`Previous layout not found for panel index ${E}`);const Q=L-B,G=tn({overrideDisabledPanels:d,panelConstraints:n[E],prevSize:L,size:Q});if(!Bt(L,G)&&(y+=L-G,f[E]=G,y.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?E--:E++}}if(sb(v,f))return o;{const E=e<0?S:m,B=_[E];Le(B!=null,`Previous layout not found for panel index ${E}`);const L=B+y,Q=tn({overrideDisabledPanels:d,panelConstraints:n[E],prevSize:B,size:L});if(f[E]=Q,!Bt(Q,L)){let G=L-Q,q=e<0?S:m;for(;q>=0&&q<n.length;){const N=f[q];Le(N!=null,`Previous layout not found for panel index ${q}`);const ee=N+G,le=tn({overrideDisabledPanels:d,panelConstraints:n[q],prevSize:N,size:ee});if(Bt(N,le)||(G-=le-N,f[q]=le),Bt(G,0))break;e>0?q--:q++}}}const M=Object.values(f).reduce((E,B)=>B+E,0);if(!Bt(M,100,.1))return o;const C=Object.keys(o);return f.reduce((E,B,L)=>(E[C[L]]=B,E),{})}function sr(e,i){if(Object.keys(e).length!==Object.keys(i).length)return!1;for(const n in e)if(i[n]===void 0||Di(e[n],i[n])!==0)return!1;return!0}function rr({layout:e,panelConstraints:i}){const n=Object.values(e),l=[...n],o=l.reduce((_,v)=>_+v,0);if(l.length!==i.length)throw Error(`Invalid ${i.length} panel layout: ${l.map(_=>`${_}%`).join(", ")}`);if(!Bt(o,100)&&l.length>0)for(let _=0;_<i.length;_++){const v=l[_];Le(v!=null,`No layout data found for index ${_}`);const f=100/o*v;l[_]=f}let c=0;for(let _=0;_<i.length;_++){const v=n[_];Le(v!=null,`No layout data found for index ${_}`);const f=l[_];Le(f!=null,`No layout data found for index ${_}`);const m=tn({overrideDisabledPanels:!0,panelConstraints:i[_],prevSize:v,size:f});f!=m&&(c+=f-m,l[_]=m)}if(!Bt(c,0))for(let _=0;_<i.length;_++){const v=l[_];Le(v!=null,`No layout data found for index ${_}`);const f=v+c,m=tn({overrideDisabledPanels:!0,panelConstraints:i[_],prevSize:v,size:f});if(v!==m&&(c-=m-v,l[_]=m,Bt(c,0)))break}const d=Object.keys(e);return l.reduce((_,v,f)=>(_[d[f]]=v,_),{})}function Zp({groupId:e,panelId:i}){const n=()=>{const _=or();for(const[v,{defaultLayoutDeferred:f,derivedPanelConstraints:m,layout:S,groupSize:y,separatorToPanels:M}]of _)if(v.id===e)return{defaultLayoutDeferred:f,derivedPanelConstraints:m,group:v,groupSize:y,layout:S,separatorToPanels:M};throw Error(`Group ${e} not found`)},l=()=>{const _=n().derivedPanelConstraints.find(v=>v.panelId===i);if(_!==void 0)return _;throw Error(`Panel constraints not found for Panel ${i}`)},o=()=>{const _=n().group.panels.find(v=>v.id===i);if(_!==void 0)return _;throw Error(`Layout not found for Panel ${i}`)},c=()=>{const _=n().layout[i];if(_!==void 0)return _;throw Error(`Layout not found for Panel ${i}`)},d=_=>{const v=c();if(_===v)return;const{defaultLayoutDeferred:f,derivedPanelConstraints:m,group:S,groupSize:y,layout:M,separatorToPanels:C}=n(),E=S.panels.findIndex(G=>G.id===i),B=E===S.panels.length-1,L=xl({delta:B?v-_:_-v,initialLayout:M,panelConstraints:m,pivotIndices:B?[E-1,E]:[E,E+1],prevLayout:M,trigger:"imperative-api"}),Q=rr({layout:L,panelConstraints:m});sr(M,Q)||Ii(S,{defaultLayoutDeferred:f,derivedPanelConstraints:m,groupSize:y,layout:Q,separatorToPanels:C})};return{collapse:()=>{const{collapsible:_,collapsedSize:v}=l(),{mutableValues:f}=o(),m=c();_&&m!==v&&(f.expandToSize=m,d(v))},expand:()=>{const{collapsible:_,collapsedSize:v,minSize:f}=l(),{mutableValues:m}=o(),S=c();if(_&&S===v){let y=m.expandToSize??f;y===0&&(y=1),d(y)}},getSize:()=>{const{group:_}=n(),v=c(),{element:f}=o(),m=_.orientation==="horizontal"?f.offsetWidth:f.offsetHeight;return{asPercentage:v,inPixels:m}},isCollapsed:()=>{const{collapsible:_,collapsedSize:v}=l(),f=c();return _&&Bt(v,f)},resize:_=>{if(c()!==_){let v;switch(typeof _){case"number":{const{group:f}=n(),m=ln({group:f});v=qt(_/m*100);break}case"string":{v=parseFloat(_);break}}d(v)}}}}function Tg(e){if(e.defaultPrevented)return;const i=or();Xu(e,i).forEach(n=>{if(n.separator){const l=n.panels.find(o=>o.panelConstraints.defaultSize!==void 0);if(l){const o=l.panelConstraints.defaultSize,c=Zp({groupId:n.group.id,panelId:l.id});c&&o!==void 0&&(c.resize(o),e.preventDefault())}}})}function so(e){const i=or();for(const[n]of i)if(n.separators.some(l=>l.element===e))return n;throw Error("Could not find parent Group for separator element")}function Qp({groupId:e}){const i=()=>{const n=or();for(const[l,o]of n)if(l.id===e)return{group:l,...o};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:l}=i();return n?{}:l},setLayout(n){const{defaultLayoutDeferred:l,derivedPanelConstraints:o,group:c,groupSize:d,layout:_,separatorToPanels:v}=i(),f=rr({layout:n,panelConstraints:o});return l?_:(sr(_,f)||Ii(c,{defaultLayoutDeferred:l,derivedPanelConstraints:o,groupSize:d,layout:f,separatorToPanels:v}),f)}}}function Zs(e,i){const n=so(e),l=Ts(n.id,!0),o=n.separators.find(m=>m.element===e);Le(o,"Matching separator not found");const c=l.separatorToPanels.get(o);Le(c,"Matching panels not found");const d=c.map(m=>n.panels.indexOf(m)),_=Qp({groupId:n.id}).getLayout(),v=xl({delta:i,initialLayout:_,panelConstraints:l.derivedPanelConstraints,pivotIndices:d,prevLayout:_,trigger:"keyboard"}),f=rr({layout:v,panelConstraints:l.derivedPanelConstraints});sr(_,f)||Ii(n,{defaultLayoutDeferred:l.defaultLayoutDeferred,derivedPanelConstraints:l.derivedPanelConstraints,groupSize:l.groupSize,layout:f,separatorToPanels:l.separatorToPanels})}function Ag(e){if(e.defaultPrevented)return;const i=e.currentTarget,n=so(i);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Zs(i,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Zs(i,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Zs(i,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Zs(i,-5);break}case"End":{e.preventDefault(),Zs(i,100);break}case"Enter":{e.preventDefault();const l=so(i),o=Ts(l.id,!0),{derivedPanelConstraints:c,layout:d,separatorToPanels:_}=o,v=l.separators.find(y=>y.element===i);Le(v,"Matching separator not found");const f=_.get(v);Le(f,"Matching panels not found");const m=f[0],S=c.find(y=>y.panelId===m.id);if(Le(S,"Panel metadata not found"),S.collapsible){const y=d[m.id],M=S.collapsedSize===y?l.mutableState.expandedPanelSizes[m.id]??S.minSize:S.collapsedSize;Zs(i,M-y)}break}case"F6":{e.preventDefault();const l=so(i).separators.map(d=>d.element),o=Array.from(l).findIndex(d=>d===e.currentTarget);Le(o!==null,"Index not found");const c=e.shiftKey?o>0?o-1:l.length-1:o+1<l.length?o+1:0;l[c].focus();break}case"Home":{e.preventDefault(),Zs(i,-100);break}}}let rn={cursorFlags:0,state:"inactive"};const Gu=new $p;function nr(){return rn}function rb(e){return Gu.addListener("change",e)}function nb(e){const i=rn,n={...rn};n.cursorFlags=e,rn=n,Gu.emit("change",{prev:i,next:n})}function nn(e){const i=rn;rn=e,Gu.emit("change",{prev:i,next:e})}function Bg(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const i=or(),n=Xu(e,i),l=new Map;let o=!1;n.forEach(c=>{c.separator&&(o||(o=!0,c.separator.element.focus()));const d=i.get(c.group);d&&l.set(c.group,d.layout)}),nn({cursorFlags:0,hitRegions:n,initialLayoutMap:l,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const lb=e=>e,jc=()=>{},Jp=1,em=2,tm=4,im=8,zg=3,Og=12;let Fa;function Lg(){return Fa===void 0&&(Fa=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Fa=!0)),Fa}function ab({cursorFlags:e,groups:i,state:n}){let l=0,o=0;switch(n){case"active":case"hover":i.forEach(c=>{if(!c.mutableState.disableCursor)switch(c.orientation){case"horizontal":{l++;break}case"vertical":{o++;break}}})}if(!(l===0&&o===0)){switch(n){case"active":{if(e&&Lg()){const c=(e&Jp)!==0,d=(e&em)!==0,_=(e&tm)!==0,v=(e&im)!==0;if(c)return _?"se-resize":v?"ne-resize":"e-resize";if(d)return _?"sw-resize":v?"nw-resize":"w-resize";if(_)return"s-resize";if(v)return"n-resize"}break}}return Lg()?l>0&&o>0?"move":l>0?"ew-resize":"ns-resize":l>0&&o>0?"grab":l>0?"col-resize":"row-resize"}}const Ng=new WeakMap;function $u(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:i,styleSheet:n}=Ng.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));const l=nr();switch(l.state){case"active":case"hover":{const o=ab({cursorFlags:l.cursorFlags,groups:l.hitRegions.map(d=>d.group),state:l.state}),c=`*, *:hover {cursor: ${o} !important; }`;if(i===c)return;i=c,o?n.cssRules.length===0?n.insertRule(c):n.replaceSync(c):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{i=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}Ng.set(e,{prevStyle:i,styleSheet:n})}function sm({document:e,event:i,hitRegions:n,initialLayoutMap:l,mountedGroups:o,pointerDownAtPoint:c,prevCursorFlags:d}){let _=0;n.forEach(f=>{const{group:m,groupSize:S}=f,{orientation:y,panels:M}=m,{disableCursor:C}=m.mutableState;let E=0;c?y==="horizontal"?E=(i.clientX-c.x)/S*100:E=(i.clientY-c.y)/S*100:y==="horizontal"?E=i.clientX<0?-100:100:E=i.clientY<0?-100:100;const B=l.get(m),L=o.get(m);if(!B||!L)return;const{defaultLayoutDeferred:Q,derivedPanelConstraints:G,groupSize:q,layout:N,separatorToPanels:ee}=L;if(G&&N&&ee){const le=xl({delta:E,initialLayout:B,panelConstraints:G,pivotIndices:f.panels.map(_e=>M.indexOf(_e)),prevLayout:N,trigger:"mouse-or-touch"});if(sr(le,N)){if(E!==0&&!C)switch(y){case"horizontal":{_|=E<0?Jp:em;break}case"vertical":{_|=E<0?tm:im;break}}}else Ii(f.group,{defaultLayoutDeferred:Q,derivedPanelConstraints:G,groupSize:q,layout:le,separatorToPanels:ee})}});let v=0;i.movementX===0?v|=d&zg:v|=_&zg,i.movementY===0?v|=d&Og:v|=_&Og,nb(v),$u(e)}function Hg(e){const i=or(),n=nr();switch(n.state){case"active":sm({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:i,prevCursorFlags:n.cursorFlags})}}function Ug(e){if(e.defaultPrevented)return;const i=nr(),n=or();switch(i.state){case"active":{if(e.buttons===0){nn({cursorFlags:0,state:"inactive"}),i.hitRegions.forEach(l=>{const o=Ts(l.group.id,!0);Ii(l.group,o)});return}sm({document:e.currentTarget,event:e,hitRegions:i.hitRegions,initialLayoutMap:i.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:i.pointerDownAtPoint,prevCursorFlags:i.cursorFlags});break}default:{const l=Xu(e,n);l.length===0?i.state!=="inactive"&&nn({cursorFlags:0,state:"inactive"}):nn({cursorFlags:0,hitRegions:l,state:"hover"}),$u(e.currentTarget);break}}}function Pg(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(nr().state){case"hover":nn({cursorFlags:0,state:"inactive"})}}function jg(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const i=nr();switch(i.state){case"active":nn({cursorFlags:0,state:"inactive"}),i.hitRegions.length>0&&($u(e.currentTarget),i.hitRegions.forEach(n=>{const l=Ts(n.group.id,!0);Ii(n.group,l)}),e.preventDefault())}}function qg(e){let i=0,n=0;const l={};for(const c of e)if(c.defaultSize!==void 0){i++;const d=qt(c.defaultSize);n+=d,l[c.panelId]=d}else l[c.panelId]=void 0;const o=e.length-i;if(o!==0){const c=qt((100-n)/o);for(const d of e)d.defaultSize===void 0&&(l[d.panelId]=c)}return l}function ob(e,i,n){if(!n[0])return;const l=e.panels.find(v=>v.element===i);if(!l||!l.onResize)return;const o=ln({group:e}),c=e.orientation==="horizontal"?l.element.offsetWidth:l.element.offsetHeight,d=l.mutableValues.prevSize,_={asPercentage:qt(c/o*100),inPixels:c};l.mutableValues.prevSize=_,l.onResize(_,l.id,d)}function hb(e,i){if(Object.keys(e).length!==Object.keys(i).length)return!1;for(const n in e)if(e[n]!==i[n])return!1;return!0}function cb({group:e,nextGroupSize:i,prevGroupSize:n,prevLayout:l}){if(n<=0||i<=0||n===i)return l;let o=0,c=0,d=!1;const _=new Map,v=[];for(const S of e.panels){const y=l[S.id]??0;switch(S.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{d=!0;const M=y/100*n,C=qt(M/i*100);_.set(S.id,C),o+=C;break}case"preserve-relative-size":default:{v.push(S.id),c+=y;break}}}if(!d||v.length===0)return l;const f=100-o,m={...l};if(_.forEach((S,y)=>{m[y]=S}),c>0)for(const S of v){const y=l[S]??0;m[S]=qt(y/c*f)}else{const S=qt(f/v.length);for(const y of v)m[y]=S}return m}function ub(e,i){const n=e.map(o=>o.id),l=Object.keys(i);if(n.length!==l.length)return!1;for(const o of n)if(!l.includes(o))return!1;return!0}const Zr=new Map;function db(e){let i=!0;Le(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,l=new Set,o=new Set,c=new n(C=>{for(const E of C){const{borderBoxSize:B,target:L}=E;if(L===e.element){if(i){const Q=ln({group:e});if(Q===0)return;const G=Ts(e.id);if(!G)return;const q=su(e),N=G.defaultLayoutDeferred?qg(q):G.layout,ee=cb({group:e,nextGroupSize:Q,prevGroupSize:G.groupSize,prevLayout:N}),le=rr({layout:ee,panelConstraints:q});if(!G.defaultLayoutDeferred&&sr(G.layout,le)&&hb(G.derivedPanelConstraints,q)&&G.groupSize===Q)return;Ii(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:q,groupSize:Q,layout:le,separatorToPanels:G.separatorToPanels})}}else ob(e,L,B)}});c.observe(e.element),e.panels.forEach(C=>{Le(!l.has(C.id),`Panel ids must be unique; id "${C.id}" was used more than once`),l.add(C.id),C.onResize&&c.observe(C.element)});const d=ln({group:e}),_=su(e),v=e.panels.map(({id:C})=>C).join(",");let f=e.mutableState.defaultLayout;f&&(ub(e.panels,f)||(f=void 0));const m=e.mutableState.layouts[v]??f??qg(_),S=rr({layout:m,panelConstraints:_}),y=e.element.ownerDocument;Zr.set(y,(Zr.get(y)??0)+1);const M=new Map;return Gp(e).forEach(C=>{C.separator&&M.set(C.separator,C.panels)}),Ii(e,{defaultLayoutDeferred:d===0,derivedPanelConstraints:_,groupSize:d,layout:S,separatorToPanels:M}),e.separators.forEach(C=>{Le(!o.has(C.id),`Separator ids must be unique; id "${C.id}" was used more than once`),o.add(C.id),C.element.addEventListener("keydown",Ag)}),Zr.get(y)===1&&(y.addEventListener("dblclick",Tg,!0),y.addEventListener("pointerdown",Bg,!0),y.addEventListener("pointerleave",Hg),y.addEventListener("pointermove",Ug),y.addEventListener("pointerout",Pg),y.addEventListener("pointerup",jg,!0)),function(){i=!1,Zr.set(y,Math.max(0,(Zr.get(y)??0)-1)),$1(e),e.separators.forEach(C=>{C.element.removeEventListener("keydown",Ag)}),Zr.get(y)||(y.removeEventListener("dblclick",Tg,!0),y.removeEventListener("pointerdown",Bg,!0),y.removeEventListener("pointerleave",Hg),y.removeEventListener("pointermove",Ug),y.removeEventListener("pointerout",Pg),y.removeEventListener("pointerup",jg,!0)),c.disconnect()}}function fb(){const[e,i]=fe.useState({}),n=fe.useCallback(()=>i({}),[]);return[e,n]}function Fu(e){const i=fe.useId();return`${e??i}`}const hr=typeof window<"u"?fe.useLayoutEffect:fe.useEffect;function wl(e){const i=fe.useRef(e);return hr(()=>{i.current=e},[e]),fe.useCallback((...n)=>{var l;return(l=i.current)==null?void 0:l.call(i,...n)},[i])}function Iu(...e){return wl(i=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(i);break}case"object":{n.current=i;break}}})})}function Zu(e){const i=fe.useRef({...e});return hr(()=>{for(const n in e)i.current[n]=e[n]},[e]),i.current}const rm=fe.createContext(null);function _b(e,i){const n=fe.useRef({getLayout:()=>({}),setLayout:lb});fe.useImperativeHandle(i,()=>n.current,[]),hr(()=>{Object.assign(n.current,Qp({groupId:e}))})}function nu({children:e,className:i,defaultLayout:n,disableCursor:l,disabled:o,elementRef:c,groupRef:d,id:_,onLayoutChange:v,onLayoutChanged:f,orientation:m="horizontal",resizeTargetMinimumSize:S={coarse:20,fine:10},style:y,...M}){const C=fe.useRef({onLayoutChange:{},onLayoutChanged:{}}),E=wl(ie=>{sr(C.current.onLayoutChange,ie)||(C.current.onLayoutChange=ie,v==null||v(ie))}),B=wl(ie=>{sr(C.current.onLayoutChanged,ie)||(C.current.onLayoutChanged=ie,f==null||f(ie))}),L=Fu(_),Q=fe.useRef(null),[G,q]=fb(),N=fe.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:S,separators:[]}),ee=Iu(Q,c);_b(L,d);const le=wl((ie,X)=>{const H=nr(),F=kg(ie),$=Ts(ie);if($){let k=!1;switch(H.state){case"active":{k=H.hitRegions.some(P=>P.group===F);break}}return{flexGrow:$.layout[X]??1,pointerEvents:k?"none":void 0}}return{flexGrow:(n==null?void 0:n[X])??1}}),_e=Zu({defaultLayout:n,disableCursor:l}),Te=fe.useMemo(()=>({get disableCursor(){return!!_e.disableCursor},getPanelStyles:le,id:L,orientation:m,registerPanel:ie=>{const X=N.current;return X.panels=ru(m,[...X.panels,ie]),q(),()=>{X.panels=X.panels.filter(H=>H!==ie),q()}},registerSeparator:ie=>{const X=N.current;return X.separators=ru(m,[...X.separators,ie]),q(),()=>{X.separators=X.separators.filter(H=>H!==ie),q()}},togglePanelDisabled:(ie,X)=>{const H=N.current.panels.find(k=>k.id===ie);H&&(H.panelConstraints.disabled=X);const F=kg(L),$=Ts(L);F&&$&&Ii(F,{...$,derivedPanelConstraints:su(F)})},toggleSeparatorDisabled:(ie,X)=>{const H=N.current.separators.find(F=>F.id===ie);H&&(H.disabled=X)}}),[le,L,q,m,_e]),Qe=fe.useRef(null);return hr(()=>{const ie=Q.current;if(ie===null)return;const X=N.current;let H;if(_e.defaultLayout!==void 0&&Object.keys(_e.defaultLayout).length===X.panels.length){H={};for(const w of X.panels){const W=_e.defaultLayout[w.id];W!==void 0&&(H[w.id]=W)}}const F={disabled:!!o,element:ie,id:L,mutableState:{defaultLayout:H,disableCursor:!!_e.disableCursor,expandedPanelSizes:N.current.lastExpandedPanelSizes,layouts:N.current.layouts},orientation:m,panels:X.panels,resizeTargetMinimumSize:X.resizeTargetMinimumSize,separators:X.separators};Qe.current=F;const $=db(F),{defaultLayoutDeferred:k,derivedPanelConstraints:P,layout:U}=Ts(F.id,!0);!k&&P.length>0&&(E(U),B(U));const oe=Vu(L,w=>{const{defaultLayoutDeferred:W,derivedPanelConstraints:J,layout:I}=w.next;if(W||J.length===0)return;const se=F.panels.map(({id:re})=>re).join(",");F.mutableState.layouts[se]=I,J.forEach(re=>{if(re.collapsible){const{layout:Ue}=w.prev??{};if(Ue){const Me=Bt(re.collapsedSize,I[re.panelId]),st=Bt(re.collapsedSize,Ue[re.panelId]);Me&&!st&&(F.mutableState.expandedPanelSizes[re.panelId]=Ue[re.panelId])}}});const ve=nr().state!=="active";E(I),ve&&B(I)});return()=>{Qe.current=null,$(),oe()}},[o,L,B,E,m,G,_e]),fe.useEffect(()=>{const ie=Qe.current;ie&&(ie.mutableState.defaultLayout=n,ie.mutableState.disableCursor=!!l)}),O.jsx(rm.Provider,{value:Te,children:O.jsx("div",{...M,className:i,"data-group":!0,"data-testid":L,id:L,ref:ee,style:{height:"100%",width:"100%",overflow:"hidden",...y,display:"flex",flexDirection:m==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:m==="horizontal"?"pan-y":"pan-x"},children:e})})}nu.displayName="Group";function Qu(){const e=fe.useContext(rm);return Le(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function vb(e,i){const{id:n}=Qu(),l=fe.useRef({collapse:jc,expand:jc,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:jc});fe.useImperativeHandle(i,()=>l.current,[]),hr(()=>{Object.assign(l.current,Zp({groupId:n,panelId:e}))})}function gl({children:e,className:i,collapsedSize:n="0%",collapsible:l=!1,defaultSize:o,disabled:c,elementRef:d,groupResizeBehavior:_="preserve-relative-size",id:v,maxSize:f="100%",minSize:m="0%",onResize:S,panelRef:y,style:M,...C}){const E=!!v,B=Fu(v),L=Zu({disabled:c}),Q=fe.useRef(null),G=Iu(Q,d),{getPanelStyles:q,id:N,orientation:ee,registerPanel:le,togglePanelDisabled:_e}=Qu(),Te=S!==null,Qe=wl((X,H,F)=>{S==null||S(X,v,F)});hr(()=>{const X=Q.current;if(X!==null){const H={element:X,id:B,idIsStable:E,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:Te?Qe:void 0,panelConstraints:{groupResizeBehavior:_,collapsedSize:n,collapsible:l,defaultSize:o,disabled:L.disabled,maxSize:f,minSize:m}};return le(H)}},[_,n,l,o,Te,B,E,f,m,Qe,le,L]),fe.useEffect(()=>{_e(B,!!c)},[c,B,_e]),vb(B,y);const ie=fe.useSyncExternalStore(X=>Vu(N,X),()=>JSON.stringify(q(N,B)),()=>JSON.stringify(q(N,B)));return O.jsx("div",{...C,"aria-disabled":c||void 0,"data-panel":!0,"data-testid":B,id:B,ref:G,style:{...gb,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...JSON.parse(ie)},children:O.jsx("div",{className:i,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...M,touchAction:ee==="horizontal"?"pan-y":"pan-x"},children:e})})}gl.displayName="Panel";const gb={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function pb({layout:e,panelConstraints:i,panelId:n,panelIndex:l}){let o,c;const d=e[n],_=i.find(v=>v.panelId===n);if(_){const v=_.maxSize,f=_.collapsible?_.collapsedSize:_.minSize,m=[l,l+1];c=rr({layout:xl({delta:f-d,initialLayout:e,panelConstraints:i,pivotIndices:m,prevLayout:e}),panelConstraints:i})[n],o=rr({layout:xl({delta:v-d,initialLayout:e,panelConstraints:i,pivotIndices:m,prevLayout:e}),panelConstraints:i})[n]}return{valueControls:n,valueMax:o,valueMin:c,valueNow:d}}function lu({children:e,className:i,disabled:n,elementRef:l,id:o,style:c,...d}){const _=Fu(o),v=Zu({disabled:n}),[f,m]=fe.useState({}),[S,y]=fe.useState("inactive"),M=fe.useRef(null),C=Iu(M,l),{disableCursor:E,id:B,orientation:L,registerSeparator:Q,toggleSeparatorDisabled:G}=Qu(),q=L==="horizontal"?"vertical":"horizontal";hr(()=>{const ee=M.current;if(ee!==null){const le={disabled:v.disabled,element:ee,id:_},_e=Q(le),Te=rb(ie=>{y(ie.next.state!=="inactive"&&ie.next.hitRegions.some(X=>X.separator===le)?ie.next.state:"inactive")}),Qe=Vu(B,ie=>{const{derivedPanelConstraints:X,layout:H,separatorToPanels:F}=ie.next,$=F.get(le);if($){const k=$[0],P=$.indexOf(k);m(pb({layout:H,panelConstraints:X,panelId:k.id,panelIndex:P}))}});return()=>{Te(),Qe(),_e()}}},[B,_,Q,v]),fe.useEffect(()=>{G(_,!!n)},[n,_,G]);let N;return n&&!E&&(N="not-allowed"),O.jsx("div",{...d,"aria-controls":f.valueControls,"aria-disabled":n||void 0,"aria-orientation":q,"aria-valuemax":f.valueMax,"aria-valuemin":f.valueMin,"aria-valuenow":f.valueNow,children:e,className:i,"data-separator":n?"disabled":S,"data-testid":_,id:_,ref:C,role:"separator",style:{flexBasis:"auto",cursor:N,...c,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}lu.displayName="Separator";/**
|
|
165
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
166
|
-
* @license MIT
|
|
167
|
-
*
|
|
168
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
169
|
-
* @license MIT
|
|
170
|
-
*
|
|
171
|
-
* Originally forked from (with the author's permission):
|
|
172
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
173
|
-
* http://bellard.org/jslinux/
|
|
174
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
175
|
-
*/var nm=Object.defineProperty,mb=Object.getOwnPropertyDescriptor,Sb=(e,i)=>{for(var n in i)nm(e,n,{get:i[n],enumerable:!0})},$e=(e,i,n,l)=>{for(var o=l>1?void 0:l?mb(i,n):i,c=e.length-1,d;c>=0;c--)(d=e[c])&&(o=(l?d(i,n,o):d(o))||o);return l&&o&&nm(i,n,o),o},te=(e,i)=>(n,l)=>i(n,l,e),Wg="Terminal input",au={get:()=>Wg,set:e=>Wg=e},Yg="Too much output to announce, navigate to rows manually to read",ou={get:()=>Yg,set:e=>Yg=e};function yb(e){return e.replace(/\r?\n/g,"\r")}function bb(e,i){return i?"\x1B[200~"+e+"\x1B[201~":e}function wb(e,i){e.clipboardData&&e.clipboardData.setData("text/plain",i.selectionText),e.preventDefault()}function Cb(e,i,n,l){if(e.stopPropagation(),e.clipboardData){let o=e.clipboardData.getData("text/plain");lm(o,i,n,l)}}function lm(e,i,n,l){e=yb(e),e=bb(e,n.decPrivateModes.bracketedPasteMode&&l.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),i.value=""}function am(e,i,n){let l=n.getBoundingClientRect(),o=e.clientX-l.left-10,c=e.clientY-l.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${o}px`,i.style.top=`${c}px`,i.style.zIndex="1000",i.focus()}function Kg(e,i,n,l,o){am(e,i,n),o&&l.rightClickSelect(e),i.value=l.selectionText,i.select()}function Ms(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function So(e,i=0,n=e.length){let l="";for(let o=i;o<n;++o){let c=e[o];c>65535?(c-=65536,l+=String.fromCharCode((c>>10)+55296)+String.fromCharCode(c%1024+56320)):l+=String.fromCharCode(c)}return l}var xb=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let n=e.length;if(!n)return 0;let l=0,o=0;if(this._interim){let c=e.charCodeAt(o++);56320<=c&&c<=57343?i[l++]=(this._interim-55296)*1024+c-56320+65536:(i[l++]=this._interim,i[l++]=c),this._interim=0}for(let c=o;c<n;++c){let d=e.charCodeAt(c);if(55296<=d&&d<=56319){if(++c>=n)return this._interim=d,l;let _=e.charCodeAt(c);56320<=_&&_<=57343?i[l++]=(d-55296)*1024+_-56320+65536:(i[l++]=d,i[l++]=_);continue}d!==65279&&(i[l++]=d)}return l}},Eb=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let n=e.length;if(!n)return 0;let l=0,o,c,d,_,v=0,f=0;if(this.interim[0]){let y=!1,M=this.interim[0];M&=(M&224)===192?31:(M&240)===224?15:7;let C=0,E;for(;(E=this.interim[++C]&63)&&C<4;)M<<=6,M|=E;let B=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,L=B-C;for(;f<L;){if(f>=n)return 0;if(E=e[f++],(E&192)!==128){f--,y=!0;break}else this.interim[C++]=E,M<<=6,M|=E&63}y||(B===2?M<128?f--:i[l++]=M:B===3?M<2048||M>=55296&&M<=57343||M===65279||(i[l++]=M):M<65536||M>1114111||(i[l++]=M)),this.interim.fill(0)}let m=n-4,S=f;for(;S<n;){for(;S<m&&!((o=e[S])&128)&&!((c=e[S+1])&128)&&!((d=e[S+2])&128)&&!((_=e[S+3])&128);)i[l++]=o,i[l++]=c,i[l++]=d,i[l++]=_,S+=4;if(o=e[S++],o<128)i[l++]=o;else if((o&224)===192){if(S>=n)return this.interim[0]=o,l;if(c=e[S++],(c&192)!==128){S--;continue}if(v=(o&31)<<6|c&63,v<128){S--;continue}i[l++]=v}else if((o&240)===224){if(S>=n)return this.interim[0]=o,l;if(c=e[S++],(c&192)!==128){S--;continue}if(S>=n)return this.interim[0]=o,this.interim[1]=c,l;if(d=e[S++],(d&192)!==128){S--;continue}if(v=(o&15)<<12|(c&63)<<6|d&63,v<2048||v>=55296&&v<=57343||v===65279)continue;i[l++]=v}else if((o&248)===240){if(S>=n)return this.interim[0]=o,l;if(c=e[S++],(c&192)!==128){S--;continue}if(S>=n)return this.interim[0]=o,this.interim[1]=c,l;if(d=e[S++],(d&192)!==128){S--;continue}if(S>=n)return this.interim[0]=o,this.interim[1]=c,this.interim[2]=d,l;if(_=e[S++],(_&192)!==128){S--;continue}if(v=(o&7)<<18|(c&63)<<12|(d&63)<<6|_&63,v<65536||v>1114111)continue;i[l++]=v}}return l}},om="",Rs=" ",Dl=class hm{constructor(){this.fg=0,this.bg=0,this.extended=new uo}static toColorRGB(i){return[i>>>16&255,i>>>8&255,i&255]}static fromColorRGB(i){return(i[0]&255)<<16|(i[1]&255)<<8|i[2]&255}clone(){let i=new hm;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},uo=class cm{constructor(i=0,n=0){this._ext=0,this._urlId=0,this._ext=i,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(i){this._ext=i}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(i){this._ext&=-469762049,this._ext|=i<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(i){this._ext&=-67108864,this._ext|=i&67108863}get urlId(){return this._urlId}set urlId(i){this._urlId=i}get underlineVariantOffset(){let i=(this._ext&3758096384)>>29;return i<0?i^4294967288:i}set underlineVariantOffset(i){this._ext&=536870911,this._ext|=i<<29&3758096384}clone(){return new cm(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},di=class um extends Dl{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new uo,this.combinedData=""}static fromCharData(i){let n=new um;return n.setFromCharData(i),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Ms(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(i){this.fg=i[0],this.bg=0;let n=!1;if(i[1].length>2)n=!0;else if(i[1].length===2){let l=i[1].charCodeAt(0);if(55296<=l&&l<=56319){let o=i[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(l-55296)*1024+o-56320+65536|i[2]<<22:n=!0}else n=!0}else this.content=i[1].charCodeAt(0)|i[2]<<22;n&&(this.combinedData=i[1],this.content=2097152|i[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Vg="di$target",hu="di$dependencies",qc=new Map;function kb(e){return e[hu]||[]}function mt(e){if(qc.has(e))return qc.get(e);let i=function(n,l,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Mb(i,n,o)};return i._id=e,qc.set(e,i),i}function Mb(e,i,n){i[Vg]===i?i[hu].push({id:e,index:n}):(i[hu]=[{id:e,index:n}],i[Vg]=i)}var zt=mt("BufferService"),dm=mt("CoreMouseService"),cr=mt("CoreService"),Db=mt("CharsetService"),Ju=mt("InstantiationService"),fm=mt("LogService"),Ot=mt("OptionsService"),_m=mt("OscLinkService"),Rb=mt("UnicodeService"),Rl=mt("DecorationService"),cu=class{constructor(e,i,n){this._bufferService=e,this._optionsService=i,this._oscLinkService=n}provideLinks(e,i){var m;let n=this._bufferService.buffer.lines.get(e-1);if(!n){i(void 0);return}let l=[],o=this._optionsService.rawOptions.linkHandler,c=new di,d=n.getTrimmedLength(),_=-1,v=-1,f=!1;for(let S=0;S<d;S++)if(!(v===-1&&!n.hasContent(S))){if(n.loadCell(S,c),c.hasExtendedAttrs()&&c.extended.urlId)if(v===-1){v=S,_=c.extended.urlId;continue}else f=c.extended.urlId!==_;else v!==-1&&(f=!0);if(f||v!==-1&&S===d-1){let y=(m=this._oscLinkService.getLinkData(_))==null?void 0:m.uri;if(y){let M={start:{x:v+1,y:e},end:{x:S+(!f&&S===d-1?1:0),y:e}},C=!1;if(!(o!=null&&o.allowNonHttpProtocols))try{let E=new URL(y);["http:","https:"].includes(E.protocol)||(C=!0)}catch{C=!0}C||l.push({text:y,range:M,activate:(E,B)=>o?o.activate(E,B,M):Tb(E,B),hover:(E,B)=>{var L;return(L=o==null?void 0:o.hover)==null?void 0:L.call(o,E,B,M)},leave:(E,B)=>{var L;return(L=o==null?void 0:o.leave)==null?void 0:L.call(o,E,B,M)}})}f=!1,c.hasExtendedAttrs()&&c.extended.urlId?(v=S,_=c.extended.urlId):(v=-1,_=-1)}}i(l)}};cu=$e([te(0,zt),te(1,Ot),te(2,_m)],cu);function Tb(e,i){if(confirm(`Do you want to navigate to ${i}?
|
|
176
|
-
|
|
177
|
-
WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}}var yo=mt("CharSizeService"),Zi=mt("CoreBrowserService"),ed=mt("MouseService"),Qi=mt("RenderService"),Ab=mt("SelectionService"),vm=mt("CharacterJoinerService"),on=mt("ThemeService"),gm=mt("LinkProviderService"),Bb=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Xg.isErrorNoTelemetry(e)?new Xg(e.message+`
|
|
178
|
-
|
|
179
|
-
`+e.stack):new Error(e.message+`
|
|
180
|
-
|
|
181
|
-
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(i=>{i(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},zb=new Bb;function ro(e){Ob(e)||zb.onUnexpectedError(e)}var uu="Canceled";function Ob(e){return e instanceof Lb?!0:e instanceof Error&&e.name===uu&&e.message===uu}var Lb=class extends Error{constructor(){super(uu),this.name=this.message}};function Nb(e){return new Error(`Illegal argument: ${e}`)}var Xg=class du extends Error{constructor(i){super(i),this.name="CodeExpectedError"}static fromError(i){if(i instanceof du)return i;let n=new du;return n.message=i.message,n.stack=i.stack,n}static isErrorNoTelemetry(i){return i.name==="CodeExpectedError"}},fu=class pm extends Error{constructor(i){super(i||"An unexpected bug occurred."),Object.setPrototypeOf(this,pm.prototype)}};function Zt(e,i=0){return e[e.length-(1+i)]}var Hb;(e=>{function i(c){return c<0}e.isLessThan=i;function n(c){return c<=0}e.isLessThanOrEqual=n;function l(c){return c>0}e.isGreaterThan=l;function o(c){return c===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Hb||(Hb={}));function Ub(e,i){let n=this,l=!1,o;return function(){return l||(l=!0,i||(o=e.apply(n,arguments))),o}}var mm;(e=>{function i(q){return q&&typeof q=="object"&&typeof q[Symbol.iterator]=="function"}e.is=i;let n=Object.freeze([]);function l(){return n}e.empty=l;function*o(q){yield q}e.single=o;function c(q){return i(q)?q:o(q)}e.wrap=c;function d(q){return q||n}e.from=d;function*_(q){for(let N=q.length-1;N>=0;N--)yield q[N]}e.reverse=_;function v(q){return!q||q[Symbol.iterator]().next().done===!0}e.isEmpty=v;function f(q){return q[Symbol.iterator]().next().value}e.first=f;function m(q,N){let ee=0;for(let le of q)if(N(le,ee++))return!0;return!1}e.some=m;function S(q,N){for(let ee of q)if(N(ee))return ee}e.find=S;function*y(q,N){for(let ee of q)N(ee)&&(yield ee)}e.filter=y;function*M(q,N){let ee=0;for(let le of q)yield N(le,ee++)}e.map=M;function*C(q,N){let ee=0;for(let le of q)yield*N(le,ee++)}e.flatMap=C;function*E(...q){for(let N of q)yield*N}e.concat=E;function B(q,N,ee){let le=ee;for(let _e of q)le=N(le,_e);return le}e.reduce=B;function*L(q,N,ee=q.length){for(N<0&&(N+=q.length),ee<0?ee+=q.length:ee>q.length&&(ee=q.length);N<ee;N++)yield q[N]}e.slice=L;function Q(q,N=Number.POSITIVE_INFINITY){let ee=[];if(N===0)return[ee,q];let le=q[Symbol.iterator]();for(let _e=0;_e<N;_e++){let Te=le.next();if(Te.done)return[ee,e.empty()];ee.push(Te.value)}return[ee,{[Symbol.iterator](){return le}}]}e.consume=Q;async function G(q){let N=[];for await(let ee of q)N.push(ee);return Promise.resolve(N)}e.asyncToArray=G})(mm||(mm={}));function lr(e){if(mm.is(e)){let i=[];for(let n of e)if(n)try{n.dispose()}catch(l){i.push(l)}if(i.length===1)throw i[0];if(i.length>1)throw new AggregateError(i,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Pb(...e){return qe(()=>lr(e))}function qe(e){return{dispose:Ub(()=>{e()})}}var Sm=class ym{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{lr(this._toDispose)}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?ym.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(i),i}delete(i){if(i){if(i===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(i),i.dispose()}}deleteAndLeak(i){i&&this._toDispose.has(i)&&(this._toDispose.delete(i),void 0)}};Sm.DISABLE_DISPOSED_WARNING=!1;var As=Sm,Se=class{constructor(){this._store=new As,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Se.None=Object.freeze({dispose(){}});var an=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var i;this._isDisposed||e===this._value||((i=this._value)==null||i.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},Fi=typeof window=="object"?window:globalThis,_u=class vu{constructor(i){this.element=i,this.next=vu.Undefined,this.prev=vu.Undefined}};_u.Undefined=new _u(void 0);var Ye=_u,Gg=class{constructor(){this._first=Ye.Undefined,this._last=Ye.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Ye.Undefined}clear(){let e=this._first;for(;e!==Ye.Undefined;){let i=e.next;e.prev=Ye.Undefined,e.next=Ye.Undefined,e=i}this._first=Ye.Undefined,this._last=Ye.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,i){let n=new Ye(e);if(this._first===Ye.Undefined)this._first=n,this._last=n;else if(i){let o=this._last;this._last=n,n.prev=o,o.next=n}else{let o=this._first;this._first=n,n.next=o,o.prev=n}this._size+=1;let l=!1;return()=>{l||(l=!0,this._remove(n))}}shift(){if(this._first!==Ye.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ye.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ye.Undefined&&e.next!==Ye.Undefined){let i=e.prev;i.next=e.next,e.next.prev=i}else e.prev===Ye.Undefined&&e.next===Ye.Undefined?(this._first=Ye.Undefined,this._last=Ye.Undefined):e.next===Ye.Undefined?(this._last=this._last.prev,this._last.next=Ye.Undefined):e.prev===Ye.Undefined&&(this._first=this._first.next,this._first.prev=Ye.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ye.Undefined;)yield e.element,e=e.next}},jb=globalThis.performance&&typeof globalThis.performance.now=="function",qb=class bm{static create(i){return new bm(i)}constructor(i){this._now=jb&&i===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Ct;(e=>{e.None=()=>Se.None;function i(X,H){return S(X,()=>{},0,void 0,!0,void 0,H)}e.defer=i;function n(X){return(H,F=null,$)=>{let k=!1,P;return P=X(U=>{if(!k)return P?P.dispose():k=!0,H.call(F,U)},null,$),k&&P.dispose(),P}}e.once=n;function l(X,H,F){return f(($,k=null,P)=>X(U=>$.call(k,H(U)),null,P),F)}e.map=l;function o(X,H,F){return f(($,k=null,P)=>X(U=>{H(U),$.call(k,U)},null,P),F)}e.forEach=o;function c(X,H,F){return f(($,k=null,P)=>X(U=>H(U)&&$.call(k,U),null,P),F)}e.filter=c;function d(X){return X}e.signal=d;function _(...X){return(H,F=null,$)=>{let k=Pb(...X.map(P=>P(U=>H.call(F,U))));return m(k,$)}}e.any=_;function v(X,H,F,$){let k=F;return l(X,P=>(k=H(k,P),k),$)}e.reduce=v;function f(X,H){let F,$={onWillAddFirstListener(){F=X(k.fire,k)},onDidRemoveLastListener(){F==null||F.dispose()}},k=new Z($);return H==null||H.add(k),k.event}function m(X,H){return H instanceof Array?H.push(X):H&&H.add(X),X}function S(X,H,F=100,$=!1,k=!1,P,U){let oe,w,W,J=0,I,se={leakWarningThreshold:P,onWillAddFirstListener(){oe=X(re=>{J++,w=H(w,re),$&&!W&&(ve.fire(w),w=void 0),I=()=>{let Ue=w;w=void 0,W=void 0,(!$||J>1)&&ve.fire(Ue),J=0},typeof F=="number"?(clearTimeout(W),W=setTimeout(I,F)):W===void 0&&(W=0,queueMicrotask(I))})},onWillRemoveListener(){k&&J>0&&(I==null||I())},onDidRemoveLastListener(){I=void 0,oe.dispose()}},ve=new Z(se);return U==null||U.add(ve),ve.event}e.debounce=S;function y(X,H=0,F){return e.debounce(X,($,k)=>$?($.push(k),$):[k],H,void 0,!0,void 0,F)}e.accumulate=y;function M(X,H=($,k)=>$===k,F){let $=!0,k;return c(X,P=>{let U=$||!H(P,k);return $=!1,k=P,U},F)}e.latch=M;function C(X,H,F){return[e.filter(X,H,F),e.filter(X,$=>!H($),F)]}e.split=C;function E(X,H=!1,F=[],$){let k=F.slice(),P=X(w=>{k?k.push(w):oe.fire(w)});$&&$.add(P);let U=()=>{k==null||k.forEach(w=>oe.fire(w)),k=null},oe=new Z({onWillAddFirstListener(){P||(P=X(w=>oe.fire(w)),$&&$.add(P))},onDidAddFirstListener(){k&&(H?setTimeout(U):U())},onDidRemoveLastListener(){P&&P.dispose(),P=null}});return $&&$.add(oe),oe.event}e.buffer=E;function B(X,H){return(F,$,k)=>{let P=H(new Q);return X(function(U){let oe=P.evaluate(U);oe!==L&&F.call($,oe)},void 0,k)}}e.chain=B;let L=Symbol("HaltChainable");class Q{constructor(){this.steps=[]}map(H){return this.steps.push(H),this}forEach(H){return this.steps.push(F=>(H(F),F)),this}filter(H){return this.steps.push(F=>H(F)?F:L),this}reduce(H,F){let $=F;return this.steps.push(k=>($=H($,k),$)),this}latch(H=(F,$)=>F===$){let F=!0,$;return this.steps.push(k=>{let P=F||!H(k,$);return F=!1,$=k,P?k:L}),this}evaluate(H){for(let F of this.steps)if(H=F(H),H===L)break;return H}}function G(X,H,F=$=>$){let $=(...oe)=>U.fire(F(...oe)),k=()=>X.on(H,$),P=()=>X.removeListener(H,$),U=new Z({onWillAddFirstListener:k,onDidRemoveLastListener:P});return U.event}e.fromNodeEventEmitter=G;function q(X,H,F=$=>$){let $=(...oe)=>U.fire(F(...oe)),k=()=>X.addEventListener(H,$),P=()=>X.removeEventListener(H,$),U=new Z({onWillAddFirstListener:k,onDidRemoveLastListener:P});return U.event}e.fromDOMEventEmitter=q;function N(X){return new Promise(H=>n(X)(H))}e.toPromise=N;function ee(X){let H=new Z;return X.then(F=>{H.fire(F)},()=>{H.fire(void 0)}).finally(()=>{H.dispose()}),H.event}e.fromPromise=ee;function le(X,H){return X(F=>H.fire(F))}e.forward=le;function _e(X,H,F){return H(F),X($=>H($))}e.runAndSubscribe=_e;class Te{constructor(H,F){this._observable=H,this._counter=0,this._hasChanged=!1;let $={onWillAddFirstListener:()=>{H.addObserver(this)},onDidRemoveLastListener:()=>{H.removeObserver(this)}};this.emitter=new Z($),F&&F.add(this.emitter)}beginUpdate(H){this._counter++}handlePossibleChange(H){}handleChange(H,F){this._hasChanged=!0}endUpdate(H){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Qe(X,H){return new Te(X,H).emitter.event}e.fromObservable=Qe;function ie(X){return(H,F,$)=>{let k=0,P=!1,U={beginUpdate(){k++},endUpdate(){k--,k===0&&(X.reportChanges(),P&&(P=!1,H.call(F)))},handlePossibleChange(){},handleChange(){P=!0}};X.addObserver(U),X.reportChanges();let oe={dispose(){X.removeObserver(U)}};return $ instanceof As?$.add(oe):Array.isArray($)&&$.push(oe),oe}}e.fromObservableLight=ie})(Ct||(Ct={}));var gu=class pu{constructor(i){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${i}_${pu._idPool++}`,pu.all.add(this)}start(i){this._stopWatch=new qb,this.listenerCount=i}stop(){if(this._stopWatch){let i=this._stopWatch.elapsed();this.durations.push(i),this.elapsedOverall+=i,this.invocationCount+=1,this._stopWatch=void 0}}};gu.all=new Set,gu._idPool=0;var Wb=gu,Yb=-1,wm=class Cm{constructor(i,n,l=(Cm._idPool++).toString(16).padStart(3,"0")){this._errorHandler=i,this.threshold=n,this.name=l,this._warnCountdown=0}dispose(){var i;(i=this._stacks)==null||i.clear()}check(i,n){let l=this.threshold;if(l<=0||n<l)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(i.value)||0;if(this._stacks.set(i.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=l*.5;let[c,d]=this.getMostFrequentStack(),_=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${d}):`;console.warn(_),console.warn(c);let v=new Xb(_,c);this._errorHandler(v)}return()=>{let c=this._stacks.get(i.value)||0;this._stacks.set(i.value,c-1)}}getMostFrequentStack(){if(!this._stacks)return;let i,n=0;for(let[l,o]of this._stacks)(!i||n<o)&&(i=[l,o],n=o);return i}};wm._idPool=1;var Kb=wm,Vb=class xm{constructor(i){this.value=i}static create(){let i=new Error;return new xm(i.stack??"")}print(){console.warn(this.value.split(`
|
|
182
|
-
`).slice(2).join(`
|
|
183
|
-
`))}},Xb=class extends Error{constructor(e,i){super(e),this.name="ListenerLeakError",this.stack=i}},Gb=class extends Error{constructor(e,i){super(e),this.name="ListenerRefusalError",this.stack=i}},$b=0,Wc=class{constructor(e){this.value=e,this.id=$b++}},Fb=2,Ib,Z=class{constructor(i){var n,l,o,c;this._size=0,this._options=i,this._leakageMon=(n=this._options)!=null&&n.leakWarningThreshold?new Kb((i==null?void 0:i.onListenerError)??ro,((l=this._options)==null?void 0:l.leakWarningThreshold)??Yb):void 0,this._perfMon=(o=this._options)!=null&&o._profName?new Wb(this._options._profName):void 0,this._deliveryQueue=(c=this._options)==null?void 0:c.deliveryQueue}dispose(){var i,n,l,o;this._disposed||(this._disposed=!0,((i=this._deliveryQueue)==null?void 0:i.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(l=(n=this._options)==null?void 0:n.onDidRemoveLastListener)==null||l.call(n),(o=this._leakageMon)==null||o.dispose())}get event(){return this._event??(this._event=(i,n,l)=>{var _,v,f,m,S;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let y=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(y);let M=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],C=new Gb(`${y}. HINT: Stack shows most frequent listener (${M[1]}-times)`,M[0]);return(((_=this._options)==null?void 0:_.onListenerError)||ro)(C),Se.None}if(this._disposed)return Se.None;n&&(i=i.bind(n));let o=new Wc(i),c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Vb.create(),c=this._leakageMon.check(o.stack,this._size+1)),this._listeners?this._listeners instanceof Wc?(this._deliveryQueue??(this._deliveryQueue=new Zb),this._listeners=[this._listeners,o]):this._listeners.push(o):((f=(v=this._options)==null?void 0:v.onWillAddFirstListener)==null||f.call(v,this),this._listeners=o,(S=(m=this._options)==null?void 0:m.onDidAddFirstListener)==null||S.call(m,this)),this._size++;let d=qe(()=>{c==null||c(),this._removeListener(o)});return l instanceof As?l.add(d):Array.isArray(l)&&l.push(d),d}),this._event}_removeListener(i){var c,d,_,v;if((d=(c=this._options)==null?void 0:c.onWillRemoveListener)==null||d.call(c,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(v=(_=this._options)==null?void 0:_.onDidRemoveLastListener)==null||v.call(_,this),this._size=0;return}let n=this._listeners,l=n.indexOf(i);if(l===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[l]=void 0;let o=this._deliveryQueue.current===this;if(this._size*Fb<=n.length){let f=0;for(let m=0;m<n.length;m++)n[m]?n[f++]=n[m]:o&&(this._deliveryQueue.end--,f<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=f}}_deliver(i,n){var o;if(!i)return;let l=((o=this._options)==null?void 0:o.onListenerError)||ro;if(!l){i.value(n);return}try{i.value(n)}catch(c){l(c)}}_deliverQueue(i){let n=i.current._listeners;for(;i.i<i.end;)this._deliver(n[i.i++],i.value);i.reset()}fire(i){var n,l,o,c;if((n=this._deliveryQueue)!=null&&n.current&&(this._deliverQueue(this._deliveryQueue),(l=this._perfMon)==null||l.stop()),(o=this._perfMon)==null||o.start(this._size),this._listeners)if(this._listeners instanceof Wc)this._deliver(this._listeners,i);else{let d=this._deliveryQueue;d.enqueue(this,i,this._listeners.length),this._deliverQueue(d)}(c=this._perfMon)==null||c.stop()}hasListeners(){return this._size>0}},Zb=class{constructor(){this.i=-1,this.end=0}enqueue(e,i,n){this.i=0,this.end=n,this.current=e,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},mu=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Z,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Z,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(i){return this.mapWindowIdToZoomLevel.get(this.getWindowId(i))??0}setZoomLevel(i,n){if(this.getZoomLevel(n)===i)return;let l=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(l,i),this._onDidChangeZoomLevel.fire(l)}getZoomFactor(i){return this.mapWindowIdToZoomFactor.get(this.getWindowId(i))??1}setZoomFactor(i,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),i)}setFullscreen(i,n){if(this.isFullscreen(n)===i)return;let l=this.getWindowId(n);this.mapWindowIdToFullScreen.set(l,i),this._onDidChangeFullscreen.fire(l)}isFullscreen(i){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(i))}getWindowId(i){return i.vscodeWindowId}};mu.INSTANCE=new mu;var td=mu;function Qb(e,i,n){typeof i=="string"&&(i=e.matchMedia(i)),i.addEventListener("change",n)}td.INSTANCE.onDidChangeZoomLevel;function Jb(e){return td.INSTANCE.getZoomFactor(e)}td.INSTANCE.onDidChangeFullscreen;var hn=typeof navigator=="object"?navigator.userAgent:"",Su=hn.indexOf("Firefox")>=0,ew=hn.indexOf("AppleWebKit")>=0,id=hn.indexOf("Chrome")>=0,tw=!id&&hn.indexOf("Safari")>=0;hn.indexOf("Electron/")>=0;hn.indexOf("Android")>=0;var Yc=!1;if(typeof Fi.matchMedia=="function"){let e=Fi.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),i=Fi.matchMedia("(display-mode: fullscreen)");Yc=e.matches,Qb(Fi,e,({matches:n})=>{Yc&&i.matches||(Yc=n)})}var sn="en",yu=!1,bu=!1,no=!1,Em=!1,Ia,lo=sn,$g=sn,iw,pi,ir=globalThis,wt,qp;typeof ir.vscode<"u"&&typeof ir.vscode.process<"u"?wt=ir.vscode.process:typeof process<"u"&&typeof((qp=process==null?void 0:process.versions)==null?void 0:qp.node)=="string"&&(wt=process);var Wp,sw=typeof((Wp=wt==null?void 0:wt.versions)==null?void 0:Wp.electron)=="string",rw=sw&&(wt==null?void 0:wt.type)==="renderer",Yp;if(typeof wt=="object"){yu=wt.platform==="win32",bu=wt.platform==="darwin",no=wt.platform==="linux",no&&wt.env.SNAP&&wt.env.SNAP_REVISION,wt.env.CI||wt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ia=sn,lo=sn;let e=wt.env.VSCODE_NLS_CONFIG;if(e)try{let i=JSON.parse(e);Ia=i.userLocale,$g=i.osLocale,lo=i.resolvedLanguage||sn,iw=(Yp=i.languagePack)==null?void 0:Yp.translationsConfigFile}catch{}Em=!0}else typeof navigator=="object"&&!rw?(pi=navigator.userAgent,yu=pi.indexOf("Windows")>=0,bu=pi.indexOf("Macintosh")>=0,(pi.indexOf("Macintosh")>=0||pi.indexOf("iPad")>=0||pi.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,no=pi.indexOf("Linux")>=0,(pi==null?void 0:pi.indexOf("Mobi"))>=0,lo=globalThis._VSCODE_NLS_LANGUAGE||sn,Ia=navigator.language.toLowerCase(),$g=Ia):console.error("Unable to resolve platform.");var km=yu,Ai=bu,nw=no,Fg=Em,Bi=pi,xs=lo,lw;(e=>{function i(){return xs}e.value=i;function n(){return xs.length===2?xs==="en":xs.length>=3?xs[0]==="e"&&xs[1]==="n"&&xs[2]==="-":!1}e.isDefaultVariant=n;function l(){return xs==="en"}e.isDefault=l})(lw||(lw={}));var aw=typeof ir.postMessage=="function"&&!ir.importScripts;(()=>{if(aw){let e=[];ir.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let l=0,o=e.length;l<o;l++){let c=e[l];if(c.id===n.data.vscodeScheduleAsyncWork){e.splice(l,1),c.callback();return}}});let i=0;return n=>{let l=++i;e.push({id:l,callback:n}),ir.postMessage({vscodeScheduleAsyncWork:l},"*")}}return e=>setTimeout(e)})();var ow=!!(Bi&&Bi.indexOf("Chrome")>=0);Bi&&Bi.indexOf("Firefox")>=0;!ow&&Bi&&Bi.indexOf("Safari")>=0;Bi&&Bi.indexOf("Edg/")>=0;Bi&&Bi.indexOf("Android")>=0;var Qr=typeof navigator=="object"?navigator:{};Fg||document.queryCommandSupported&&document.queryCommandSupported("copy")||Qr&&Qr.clipboard&&Qr.clipboard.writeText,Fg||Qr&&Qr.clipboard&&Qr.clipboard.readText;var sd=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,i){this._keyCodeToStr[e]=i,this._strToKeyCode[i.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Kc=new sd,Ig=new sd,Zg=new sd,hw=new Array(230),Mm;(e=>{function i(_){return Kc.keyCodeToStr(_)}e.toString=i;function n(_){return Kc.strToKeyCode(_)}e.fromString=n;function l(_){return Ig.keyCodeToStr(_)}e.toUserSettingsUS=l;function o(_){return Zg.keyCodeToStr(_)}e.toUserSettingsGeneral=o;function c(_){return Ig.strToKeyCode(_)||Zg.strToKeyCode(_)}e.fromUserSettings=c;function d(_){if(_>=98&&_<=113)return null;switch(_){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Kc.keyCodeToStr(_)}e.toElectronAccelerator=d})(Mm||(Mm={}));var cw=class Dm{constructor(i,n,l,o,c){this.ctrlKey=i,this.shiftKey=n,this.altKey=l,this.metaKey=o,this.keyCode=c}equals(i){return i instanceof Dm&&this.ctrlKey===i.ctrlKey&&this.shiftKey===i.shiftKey&&this.altKey===i.altKey&&this.metaKey===i.metaKey&&this.keyCode===i.keyCode}getHashCode(){let i=this.ctrlKey?"1":"0",n=this.shiftKey?"1":"0",l=this.altKey?"1":"0",o=this.metaKey?"1":"0";return`K${i}${n}${l}${o}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new uw([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},uw=class{constructor(e){if(e.length===0)throw Nb("chords");this.chords=e}getHashCode(){let e="";for(let i=0,n=this.chords.length;i<n;i++)i!==0&&(e+=";"),e+=this.chords[i].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let i=0;i<this.chords.length;i++)if(!this.chords[i].equals(e.chords[i]))return!1;return!0}};function dw(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return Mm.fromString(n)}let i=e.keyCode;if(i===3)return 7;if(Su)switch(i){case 59:return 85;case 60:if(nw)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Ai)return 57;break}else if(ew&&(Ai&&i===93||!Ai&&i===92))return 57;return hw[i]||0}var fw=Ai?256:2048,_w=512,vw=1024,gw=Ai?2048:256,Qg=class{constructor(e){var n;this._standardKeyboardEventBrand=!0;let i=e;this.browserEvent=i,this.target=i.target,this.ctrlKey=i.ctrlKey,this.shiftKey=i.shiftKey,this.altKey=i.altKey,this.metaKey=i.metaKey,this.altGraphKey=(n=i.getModifierState)==null?void 0:n.call(i,"AltGraph"),this.keyCode=dw(i),this.code=i.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let i=0;return this.ctrlKey&&(i|=fw),this.altKey&&(i|=_w),this.shiftKey&&(i|=vw),this.metaKey&&(i|=gw),i|=e,i}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new cw(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Jg=new WeakMap;function pw(e){if(!e.parent||e.parent===e)return null;try{let i=e.location,n=e.parent.location;if(i.origin!=="null"&&n.origin!=="null"&&i.origin!==n.origin)return null}catch{return null}return e.parent}var mw=class{static getSameOriginWindowChain(e){let i=Jg.get(e);if(!i){i=[],Jg.set(e,i);let n=e,l;do l=pw(n),l?i.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):i.push({window:new WeakRef(n),iframeElement:null}),n=l;while(n)}return i.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,i){if(!i||e===i)return{top:0,left:0};let n=0,l=0,o=this.getSameOriginWindowChain(e);for(let c of o){let d=c.window.deref();if(n+=(d==null?void 0:d.scrollY)??0,l+=(d==null?void 0:d.scrollX)??0,d===i||!c.iframeElement)break;let _=c.iframeElement.getBoundingClientRect();n+=_.top,l+=_.left}return{top:n,left:l}}},Za=class{constructor(e,i){this.timestamp=Date.now(),this.browserEvent=i,this.leftButton=i.button===0,this.middleButton=i.button===1,this.rightButton=i.button===2,this.buttons=i.buttons,this.target=i.target,this.detail=i.detail||1,i.type==="dblclick"&&(this.detail=2),this.ctrlKey=i.ctrlKey,this.shiftKey=i.shiftKey,this.altKey=i.altKey,this.metaKey=i.metaKey,typeof i.pageX=="number"?(this.posx=i.pageX,this.posy=i.pageY):(this.posx=i.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=i.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=mw.getPositionOfChildWindowRelativeToAncestorWindow(e,i.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},ep=class{constructor(e,i=0,n=0){var o;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=i;let l=!1;if(id){let c=navigator.userAgent.match(/Chrome\/(\d+)/);l=(c?parseInt(c[1]):123)<=122}if(e){let c=e,d=e,_=((o=e.view)==null?void 0:o.devicePixelRatio)||1;if(typeof c.wheelDeltaY<"u")l?this.deltaY=c.wheelDeltaY/(120*_):this.deltaY=c.wheelDeltaY/120;else if(typeof d.VERTICAL_AXIS<"u"&&d.axis===d.VERTICAL_AXIS)this.deltaY=-d.detail/3;else if(e.type==="wheel"){let v=e;v.deltaMode===v.DOM_DELTA_LINE?Su&&!Ai?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof c.wheelDeltaX<"u")tw&&km?this.deltaX=-(c.wheelDeltaX/120):l?this.deltaX=c.wheelDeltaX/(120*_):this.deltaX=c.wheelDeltaX/120;else if(typeof d.HORIZONTAL_AXIS<"u"&&d.axis===d.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let v=e;v.deltaMode===v.DOM_DELTA_LINE?Su&&!Ai?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(l?this.deltaY=e.wheelDelta/(120*_):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},Rm=Object.freeze(function(e,i){let n=setTimeout(e.bind(i),0);return{dispose(){clearTimeout(n)}}}),Sw;(e=>{function i(n){return n===e.None||n===e.Cancelled||n instanceof yw?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=i,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ct.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Rm})})(Sw||(Sw={}));var yw=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Rm:(this._emitter||(this._emitter=new Z),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},rd=class{constructor(e,i){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof i=="number"&&this.setIfNotSet(e,i)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,i){if(this._isDisposed)throw new fu("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},i)}setIfNotSet(e,i){if(this._isDisposed)throw new fu("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},i))}},bw=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,i,n=globalThis){if(this.isDisposed)throw new fu("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let l=n.setInterval(()=>{e()},i);this.disposable=qe(()=>{n.clearInterval(l),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},ww;(e=>{async function i(l){let o,c=await Promise.all(l.map(d=>d.then(_=>_,_=>{o||(o=_)})));if(typeof o<"u")throw o;return c}e.settled=i;function n(l){return new Promise(async(o,c)=>{try{await l(o,c)}catch(d){c(d)}})}e.withAsyncBody=n})(ww||(ww={}));var tp=class ci{static fromArray(i){return new ci(n=>{n.emitMany(i)})}static fromPromise(i){return new ci(async n=>{n.emitMany(await i)})}static fromPromises(i){return new ci(async n=>{await Promise.all(i.map(async l=>n.emitOne(await l)))})}static merge(i){return new ci(async n=>{await Promise.all(i.map(async l=>{for await(let o of l)n.emitOne(o)}))})}constructor(i,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new Z,queueMicrotask(async()=>{let l={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(i(l)),this.resolve()}catch(o){this.reject(o)}finally{l.emitOne=void 0,l.emitMany=void 0,l.reject=void 0}})}[Symbol.asyncIterator](){let i=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(i<this._results.length)return{done:!1,value:this._results[i++]};if(this._state===1)return{done:!0,value:void 0};await Ct.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var n;return(n=this._onReturn)==null||n.call(this),{done:!0,value:void 0}}}}static map(i,n){return new ci(async l=>{for await(let o of i)l.emitOne(n(o))})}map(i){return ci.map(this,i)}static filter(i,n){return new ci(async l=>{for await(let o of i)n(o)&&l.emitOne(o)})}filter(i){return ci.filter(this,i)}static coalesce(i){return ci.filter(i,n=>!!n)}coalesce(){return ci.coalesce(this)}static async toPromise(i){let n=[];for await(let l of i)n.push(l);return n}toPromise(){return ci.toPromise(this)}emitOne(i){this._state===0&&(this._results.push(i),this._onStateChanged.fire())}emitMany(i){this._state===0&&(this._results=this._results.concat(i),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(i){this._state===0&&(this._state=2,this._error=i,this._onStateChanged.fire())}};tp.EMPTY=tp.fromArray([]);var{getWindow:Ti,getWindowId:Cw,onDidRegisterWindow:xw}=(function(){let e=new Map,i={window:Fi,disposables:new As};e.set(Fi.vscodeWindowId,i);let n=new Z,l=new Z,o=new Z;function c(d,_){return(typeof d=="number"?e.get(d):void 0)??(_?i:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:l.event,registerWindow(d){if(e.has(d.vscodeWindowId))return Se.None;let _=new As,v={window:d,disposables:_.add(new As)};return e.set(d.vscodeWindowId,v),_.add(qe(()=>{e.delete(d.vscodeWindowId),l.fire(d)})),_.add(de(d,_t.BEFORE_UNLOAD,()=>{o.fire(d)})),n.fire(v),_},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(d){return d.vscodeWindowId},hasWindow(d){return e.has(d)},getWindowById:c,getWindow(d){var f;let _=d;if((f=_==null?void 0:_.ownerDocument)!=null&&f.defaultView)return _.ownerDocument.defaultView.window;let v=d;return v!=null&&v.view?v.view.window:Fi},getDocument(d){return Ti(d).document}}})(),Ew=class{constructor(e,i,n,l){this._node=e,this._type=i,this._handler=n,this._options=l||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function de(e,i,n,l){return new Ew(e,i,n,l)}var ip=function(e,i,n,l){return de(e,i,n,l)},nd,kw=class extends bw{constructor(e){super(),this.defaultTarget=e&&Ti(e)}cancelAndSet(e,i,n){return super.cancelAndSet(e,i,n??this.defaultTarget)}},sp=class{constructor(e,i=0){this._runner=e,this.priority=i,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){ro(e)}}static sort(e,i){return i.priority-e.priority}};(function(){let e=new Map,i=new Map,n=new Map,l=new Map,o=c=>{n.set(c,!1);let d=e.get(c)??[];for(i.set(c,d),e.set(c,[]),l.set(c,!0);d.length>0;)d.sort(sp.sort),d.shift().execute();l.set(c,!1)};nd=(c,d,_=0)=>{let v=Cw(c),f=new sp(d,_),m=e.get(v);return m||(m=[],e.set(v,m)),m.push(f),n.get(v)||(n.set(v,!0),c.requestAnimationFrame(()=>o(v))),f}})();function Mw(e){let i=e.getBoundingClientRect(),n=Ti(e);return{left:i.left+n.scrollX,top:i.top+n.scrollY,width:i.width,height:i.height}}var _t={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},Dw=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let i=jt(e);this._maxWidth!==i&&(this._maxWidth=i,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let i=jt(e);this._width!==i&&(this._width=i,this.domNode.style.width=this._width)}setHeight(e){let i=jt(e);this._height!==i&&(this._height=i,this.domNode.style.height=this._height)}setTop(e){let i=jt(e);this._top!==i&&(this._top=i,this.domNode.style.top=this._top)}setLeft(e){let i=jt(e);this._left!==i&&(this._left=i,this.domNode.style.left=this._left)}setBottom(e){let i=jt(e);this._bottom!==i&&(this._bottom=i,this.domNode.style.bottom=this._bottom)}setRight(e){let i=jt(e);this._right!==i&&(this._right=i,this.domNode.style.right=this._right)}setPaddingTop(e){let i=jt(e);this._paddingTop!==i&&(this._paddingTop=i,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let i=jt(e);this._paddingLeft!==i&&(this._paddingLeft=i,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let i=jt(e);this._paddingBottom!==i&&(this._paddingBottom=i,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let i=jt(e);this._paddingRight!==i&&(this._paddingRight=i,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let i=jt(e);this._fontSize!==i&&(this._fontSize=i,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let i=jt(e);this._lineHeight!==i&&(this._lineHeight=i,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let i=jt(e);this._letterSpacing!==i&&(this._letterSpacing=i,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,i){this.domNode.classList.toggle(e,i),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,i){this.domNode.setAttribute(e,i)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function jt(e){return typeof e=="number"?`${e}px`:e}function Cl(e){return new Dw(e)}var Tm=class{constructor(){this._hooks=new As,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,i){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(i)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,i,n,l,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=l,this._onStopCallback=o;let c=e;try{e.setPointerCapture(i),this._hooks.add(qe(()=>{try{e.releasePointerCapture(i)}catch{}}))}catch{c=Ti(e)}this._hooks.add(de(c,_t.POINTER_MOVE,d=>{if(d.buttons!==n){this.stopMonitoring(!0);return}d.preventDefault(),this._pointerMoveCallback(d)})),this._hooks.add(de(c,_t.POINTER_UP,d=>this.stopMonitoring(!0)))}};function Rw(e,i,n){let l=null,o=null;if(typeof n.value=="function"?(l="value",o=n.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(l="get",o=n.get),!o)throw new Error("not supported");let c=`$memoize$${i}`;n[l]=function(...d){return this.hasOwnProperty(c)||Object.defineProperty(this,c,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,d)}),this[c]}}var Mi;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Mi||(Mi={}));var pl=class Dt extends Se{constructor(){super(),this.dispatched=!1,this.targets=new Gg,this.ignoreTargets=new Gg,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Ct.runAndSubscribe(xw,({window:i,disposables:n})=>{n.add(de(i.document,"touchstart",l=>this.onTouchStart(l),{passive:!1})),n.add(de(i.document,"touchend",l=>this.onTouchEnd(i,l))),n.add(de(i.document,"touchmove",l=>this.onTouchMove(l),{passive:!1}))},{window:Fi,disposables:this._store}))}static addTarget(i){if(!Dt.isTouchDevice())return Se.None;Dt.INSTANCE||(Dt.INSTANCE=new Dt);let n=Dt.INSTANCE.targets.push(i);return qe(n)}static ignoreTarget(i){if(!Dt.isTouchDevice())return Se.None;Dt.INSTANCE||(Dt.INSTANCE=new Dt);let n=Dt.INSTANCE.ignoreTargets.push(i);return qe(n)}static isTouchDevice(){return"ontouchstart"in Fi||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(i){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let l=0,o=i.targetTouches.length;l<o;l++){let c=i.targetTouches.item(l);this.activeTouches[c.identifier]={id:c.identifier,initialTarget:c.target,initialTimeStamp:n,initialPageX:c.pageX,initialPageY:c.pageY,rollingTimestamps:[n],rollingPageX:[c.pageX],rollingPageY:[c.pageY]};let d=this.newGestureEvent(Mi.Start,c.target);d.pageX=c.pageX,d.pageY=c.pageY,this.dispatchEvent(d)}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}onTouchEnd(i,n){let l=Date.now(),o=Object.keys(this.activeTouches).length;for(let c=0,d=n.changedTouches.length;c<d;c++){let _=n.changedTouches.item(c);if(!this.activeTouches.hasOwnProperty(String(_.identifier))){console.warn("move of an UNKNOWN touch",_);continue}let v=this.activeTouches[_.identifier],f=Date.now()-v.initialTimeStamp;if(f<Dt.HOLD_DELAY&&Math.abs(v.initialPageX-Zt(v.rollingPageX))<30&&Math.abs(v.initialPageY-Zt(v.rollingPageY))<30){let m=this.newGestureEvent(Mi.Tap,v.initialTarget);m.pageX=Zt(v.rollingPageX),m.pageY=Zt(v.rollingPageY),this.dispatchEvent(m)}else if(f>=Dt.HOLD_DELAY&&Math.abs(v.initialPageX-Zt(v.rollingPageX))<30&&Math.abs(v.initialPageY-Zt(v.rollingPageY))<30){let m=this.newGestureEvent(Mi.Contextmenu,v.initialTarget);m.pageX=Zt(v.rollingPageX),m.pageY=Zt(v.rollingPageY),this.dispatchEvent(m)}else if(o===1){let m=Zt(v.rollingPageX),S=Zt(v.rollingPageY),y=Zt(v.rollingTimestamps)-v.rollingTimestamps[0],M=m-v.rollingPageX[0],C=S-v.rollingPageY[0],E=[...this.targets].filter(B=>v.initialTarget instanceof Node&&B.contains(v.initialTarget));this.inertia(i,E,l,Math.abs(M)/y,M>0?1:-1,m,Math.abs(C)/y,C>0?1:-1,S)}this.dispatchEvent(this.newGestureEvent(Mi.End,v.initialTarget)),delete this.activeTouches[_.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(i,n){let l=document.createEvent("CustomEvent");return l.initEvent(i,!1,!0),l.initialTarget=n,l.tapCount=0,l}dispatchEvent(i){if(i.type===Mi.Tap){let n=new Date().getTime(),l=0;n-this._lastSetTapCountTime>Dt.CLEAR_TAP_COUNT_TIME?l=1:l=2,this._lastSetTapCountTime=n,i.tapCount=l}else(i.type===Mi.Change||i.type===Mi.Contextmenu)&&(this._lastSetTapCountTime=0);if(i.initialTarget instanceof Node){for(let l of this.ignoreTargets)if(l.contains(i.initialTarget))return;let n=[];for(let l of this.targets)if(l.contains(i.initialTarget)){let o=0,c=i.initialTarget;for(;c&&c!==l;)o++,c=c.parentElement;n.push([o,l])}n.sort((l,o)=>l[0]-o[0]);for(let[l,o]of n)o.dispatchEvent(i),this.dispatched=!0}}inertia(i,n,l,o,c,d,_,v,f){this.handle=nd(i,()=>{let m=Date.now(),S=m-l,y=0,M=0,C=!0;o+=Dt.SCROLL_FRICTION*S,_+=Dt.SCROLL_FRICTION*S,o>0&&(C=!1,y=c*o*S),_>0&&(C=!1,M=v*_*S);let E=this.newGestureEvent(Mi.Change);E.translationX=y,E.translationY=M,n.forEach(B=>B.dispatchEvent(E)),C||this.inertia(i,n,m,o,c,d+y,_,v,f+M)})}onTouchMove(i){let n=Date.now();for(let l=0,o=i.changedTouches.length;l<o;l++){let c=i.changedTouches.item(l);if(!this.activeTouches.hasOwnProperty(String(c.identifier))){console.warn("end of an UNKNOWN touch",c);continue}let d=this.activeTouches[c.identifier],_=this.newGestureEvent(Mi.Change,d.initialTarget);_.translationX=c.pageX-Zt(d.rollingPageX),_.translationY=c.pageY-Zt(d.rollingPageY),_.pageX=c.pageX,_.pageY=c.pageY,this.dispatchEvent(_),d.rollingPageX.length>3&&(d.rollingPageX.shift(),d.rollingPageY.shift(),d.rollingTimestamps.shift()),d.rollingPageX.push(c.pageX),d.rollingPageY.push(c.pageY),d.rollingTimestamps.push(n)}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}};pl.SCROLL_FRICTION=-.005,pl.HOLD_DELAY=700,pl.CLEAR_TAP_COUNT_TIME=400,$e([Rw],pl,"isTouchDevice",1);var Tw=pl,ld=class extends Se{onclick(e,i){this._register(de(e,_t.CLICK,n=>i(new Za(Ti(e),n))))}onmousedown(e,i){this._register(de(e,_t.MOUSE_DOWN,n=>i(new Za(Ti(e),n))))}onmouseover(e,i){this._register(de(e,_t.MOUSE_OVER,n=>i(new Za(Ti(e),n))))}onmouseleave(e,i){this._register(de(e,_t.MOUSE_LEAVE,n=>i(new Za(Ti(e),n))))}onkeydown(e,i){this._register(de(e,_t.KEY_DOWN,n=>i(new Qg(n))))}onkeyup(e,i){this._register(de(e,_t.KEY_UP,n=>i(new Qg(n))))}oninput(e,i){this._register(de(e,_t.INPUT,i))}onblur(e,i){this._register(de(e,_t.BLUR,i))}onfocus(e,i){this._register(de(e,_t.FOCUS,i))}onchange(e,i){this._register(de(e,_t.CHANGE,i))}ignoreGesture(e){return Tw.ignoreTarget(e)}},rp=11,Aw=class extends ld{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=rp+"px",this.domNode.style.height=rp+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new Tm),this._register(ip(this.bgDomNode,_t.POINTER_DOWN,i=>this._arrowPointerDown(i))),this._register(ip(this.domNode,_t.POINTER_DOWN,i=>this._arrowPointerDown(i))),this._pointerdownRepeatTimer=this._register(new kw),this._pointerdownScheduleRepeatTimer=this._register(new rd)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Ti(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(i,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},Bw=class wu{constructor(i,n,l,o,c,d,_){this._forceIntegerValues=i,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,l=l|0,o=o|0,c=c|0,d=d|0,_=_|0),this.rawScrollLeft=o,this.rawScrollTop=_,n<0&&(n=0),o+n>l&&(o=l-n),o<0&&(o=0),c<0&&(c=0),_+c>d&&(_=d-c),_<0&&(_=0),this.width=n,this.scrollWidth=l,this.scrollLeft=o,this.height=c,this.scrollHeight=d,this.scrollTop=_}equals(i){return this.rawScrollLeft===i.rawScrollLeft&&this.rawScrollTop===i.rawScrollTop&&this.width===i.width&&this.scrollWidth===i.scrollWidth&&this.scrollLeft===i.scrollLeft&&this.height===i.height&&this.scrollHeight===i.scrollHeight&&this.scrollTop===i.scrollTop}withScrollDimensions(i,n){return new wu(this._forceIntegerValues,typeof i.width<"u"?i.width:this.width,typeof i.scrollWidth<"u"?i.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof i.height<"u"?i.height:this.height,typeof i.scrollHeight<"u"?i.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(i){return new wu(this._forceIntegerValues,this.width,this.scrollWidth,typeof i.scrollLeft<"u"?i.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof i.scrollTop<"u"?i.scrollTop:this.rawScrollTop)}createScrollEvent(i,n){let l=this.width!==i.width,o=this.scrollWidth!==i.scrollWidth,c=this.scrollLeft!==i.scrollLeft,d=this.height!==i.height,_=this.scrollHeight!==i.scrollHeight,v=this.scrollTop!==i.scrollTop;return{inSmoothScrolling:n,oldWidth:i.width,oldScrollWidth:i.scrollWidth,oldScrollLeft:i.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:i.height,oldScrollHeight:i.scrollHeight,oldScrollTop:i.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:l,scrollWidthChanged:o,scrollLeftChanged:c,heightChanged:d,scrollHeightChanged:_,scrollTopChanged:v}}},zw=class extends Se{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Z),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new Bw(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,i){var l;let n=this._state.withScrollDimensions(e,i);this._setState(n,!!this._smoothScrolling),(l=this._smoothScrolling)==null||l.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let i=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(i,!1)}setScrollPositionSmooth(e,i){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let l;i?l=new lp(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):l=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=l}else{let n=this._state.withScrollPosition(e);this._smoothScrolling=lp.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),i=this._state.withScrollPosition(e);if(this._setState(i,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,i){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,i)))}},np=class{constructor(e,i,n){this.scrollLeft=e,this.scrollTop=i,this.isDone=n}};function Vc(e,i){let n=i-e;return function(l){return e+n*Nw(l)}}function Ow(e,i,n){return function(l){return l<n?e(l/n):i((l-n)/(1-n))}}var lp=class Cu{constructor(i,n,l,o){this.from=i,this.to=n,this.duration=o,this.startTime=l,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(i,n,l){if(Math.abs(i-n)>2.5*l){let o,c;return i<n?(o=i+.75*l,c=n-.75*l):(o=i-.75*l,c=n+.75*l),Ow(Vc(i,o),Vc(c,n),.33)}return Vc(i,n)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(i){this.to=i.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(i){let n=(i-this.startTime)/this.duration;if(n<1){let l=this.scrollLeft(n),o=this.scrollTop(n);return new np(l,o,!1)}return new np(this.to.scrollLeft,this.to.scrollTop,!0)}combine(i,n,l){return Cu.start(i,n,l)}static start(i,n,l){l=l+10;let o=Date.now()-10;return new Cu(i,n,o,l)}};function Lw(e){return Math.pow(e,3)}function Nw(e){return 1-Lw(1-e)}var Hw=class extends Se{constructor(e,i,n){super(),this._visibility=e,this._visibleClassName=i,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new rd)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var i;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(i=this._domNode)==null||i.setClassName(this._invisibleClassName+(e?" fade":"")))}},Uw=140,Am=class extends ld{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new Hw(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Tm),this._shouldRender=!0,this.domNode=Cl(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(de(this.domNode.domNode,_t.POINTER_DOWN,i=>this._domNodePointerDown(i)))}_createArrow(e){let i=this._register(new Aw(e));this.domNode.domNode.appendChild(i.bgDomNode),this.domNode.domNode.appendChild(i.domNode)}_createSlider(e,i,n,l){this.slider=Cl(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(i),typeof n=="number"&&this.slider.setWidth(n),typeof l=="number"&&this.slider.setHeight(l),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(de(this.slider.domNode,_t.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let i=this.domNode.domNode.getClientRects()[0].top,n=i+this._scrollbarState.getSliderPosition(),l=i+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);n<=o&&o<=l?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let i,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")i=e.offsetX,n=e.offsetY;else{let o=Mw(this.domNode.domNode);i=e.pageX-o.left,n=e.pageY-o.top}let l=this._pointerDownRelativePosition(i,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(l):this._scrollbarState.getDesiredScrollPositionFromOffset(l)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),l=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{let c=this._sliderOrthogonalPointerPosition(o),d=Math.abs(c-n);if(km&&d>Uw){this._setDesiredScrollPositionNow(l.getScrollPosition());return}let _=this._sliderPointerPosition(o)-i;this._setDesiredScrollPositionNow(l.getDesiredScrollPositionFromDelta(_))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let i={};this.writeScrollPosition(i,e),this._scrollable.setScrollPositionNow(i)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},Bm=class xu{constructor(i,n,l,o,c,d){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(l),this._arrowSize=Math.round(i),this._visibleSize=o,this._scrollSize=c,this._scrollPosition=d,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new xu(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(i){let n=Math.round(i);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(i){let n=Math.round(i);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(i){let n=Math.round(i);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(i){this._scrollbarSize=Math.round(i)}setOppositeScrollbarSize(i){this._oppositeScrollbarSize=Math.round(i)}static _computeValues(i,n,l,o,c){let d=Math.max(0,l-i),_=Math.max(0,d-2*n),v=o>0&&o>l;if(!v)return{computedAvailableSize:Math.round(d),computedIsNeeded:v,computedSliderSize:Math.round(_),computedSliderRatio:0,computedSliderPosition:0};let f=Math.round(Math.max(20,Math.floor(l*_/o))),m=(_-f)/(o-l),S=c*m;return{computedAvailableSize:Math.round(d),computedIsNeeded:v,computedSliderSize:Math.round(f),computedSliderRatio:m,computedSliderPosition:Math.round(S)}}_refreshComputedValues(){let i=xu._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=i.computedAvailableSize,this._computedIsNeeded=i.computedIsNeeded,this._computedSliderSize=i.computedSliderSize,this._computedSliderRatio=i.computedSliderRatio,this._computedSliderPosition=i.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(i){if(!this._computedIsNeeded)return 0;let n=i-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(i){if(!this._computedIsNeeded)return 0;let n=i-this._arrowSize,l=this._scrollPosition;return n<this._computedSliderPosition?l-=this._visibleSize:l+=this._visibleSize,l}getDesiredScrollPositionFromDelta(i){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+i;return Math.round(n/this._computedSliderRatio)}},Pw=class extends Am{constructor(e,i,n){let l=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:n,scrollbarState:new Bm(i.horizontalHasArrows?i.arrowSize:0,i.horizontal===2?0:i.horizontalScrollbarSize,i.vertical===2?0:i.verticalScrollbarSize,l.width,l.scrollWidth,o.scrollLeft),visibility:i.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:i.scrollByPage}),i.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((i.horizontalScrollbarSize-i.horizontalSliderSize)/2),0,void 0,i.horizontalSliderSize)}_updateSlider(e,i){this.slider.setWidth(e),this.slider.setLeft(i)}_renderDomNode(e,i){this.domNode.setWidth(e),this.domNode.setHeight(i),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,i){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,i){e.scrollLeft=i}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},jw=class extends Am{constructor(e,i,n){let l=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:n,scrollbarState:new Bm(i.verticalHasArrows?i.arrowSize:0,i.vertical===2?0:i.verticalScrollbarSize,0,l.height,l.scrollHeight,o.scrollTop),visibility:i.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:i.scrollByPage}),i.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((i.verticalScrollbarSize-i.verticalSliderSize)/2),i.verticalSliderSize,void 0)}_updateSlider(e,i){this.slider.setHeight(e),this.slider.setTop(i)}_renderDomNode(e,i){this.domNode.setWidth(i),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,i){return i}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,i){e.scrollTop=i}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},qw=500,ap=50,Ww=class{constructor(e,i,n){this.timestamp=e,this.deltaX=i,this.deltaY=n,this.score=0}},Eu=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let i=1,n=0,l=1,o=this._rear;do{let c=o===this._front?i:Math.pow(2,-l);if(i-=c,n+=this._memory[o].score*c,o===this._front)break;o=(this._capacity+o-1)%this._capacity,l++}while(!0);return n<=.5}acceptStandardWheelEvent(i){if(id){let n=Ti(i.browserEvent),l=Jb(n);this.accept(Date.now(),i.deltaX*l,i.deltaY*l)}else this.accept(Date.now(),i.deltaX,i.deltaY)}accept(i,n,l){let o=null,c=new Ww(i,n,l);this._front===-1&&this._rear===-1?(this._memory[0]=c,this._front=0,this._rear=0):(o=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=c),c.score=this._computeScore(c,o)}_computeScore(i,n){if(Math.abs(i.deltaX)>0&&Math.abs(i.deltaY)>0)return 1;let l=.5;if((!this._isAlmostInt(i.deltaX)||!this._isAlmostInt(i.deltaY))&&(l+=.25),n){let o=Math.abs(i.deltaX),c=Math.abs(i.deltaY),d=Math.abs(n.deltaX),_=Math.abs(n.deltaY),v=Math.max(Math.min(o,d),1),f=Math.max(Math.min(c,_),1),m=Math.max(o,d),S=Math.max(c,_);m%v===0&&S%f===0&&(l-=.5)}return Math.min(Math.max(l,0),1)}_isAlmostInt(i){return Math.abs(Math.round(i)-i)<.01}};Eu.INSTANCE=new Eu;var Yw=Eu,Kw=class extends ld{constructor(e,i,n){super(),this._onScroll=this._register(new Z),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Z),this.onWillScroll=this._onWillScroll.event,this._options=Xw(i),this._scrollable=n,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));let l={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new jw(this._scrollable,this._options,l)),this._horizontalScrollbar=this._register(new Pw(this._scrollable,this._options,l)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Cl(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Cl(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Cl(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new rd),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=lr(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Ai&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new ep(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=lr(this._mouseWheelToDispose),e)){let i=n=>{this._onMouseWheel(new ep(n))};this._mouseWheelToDispose.push(de(this._listenOnDomNode,_t.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var o;if((o=e.browserEvent)!=null&&o.defaultPrevented)return;let i=Yw.INSTANCE;i.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let c=e.deltaY*this._options.mouseWheelScrollSensitivity,d=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&d+c===0?d=c=0:Math.abs(c)>=Math.abs(d)?d=0:c=0),this._options.flipAxes&&([c,d]=[d,c]);let _=!Ai&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||_)&&!d&&(d=c,c=0),e.browserEvent&&e.browserEvent.altKey&&(d=d*this._options.fastScrollSensitivity,c=c*this._options.fastScrollSensitivity);let v=this._scrollable.getFutureScrollPosition(),f={};if(c){let m=ap*c,S=v.scrollTop-(m<0?Math.floor(m):Math.ceil(m));this._verticalScrollbar.writeScrollPosition(f,S)}if(d){let m=ap*d,S=v.scrollLeft-(m<0?Math.floor(m):Math.ceil(m));this._horizontalScrollbar.writeScrollPosition(f,S)}f=this._scrollable.validateScrollPosition(f),(v.scrollLeft!==f.scrollLeft||v.scrollTop!==f.scrollTop)&&(this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(f):this._scrollable.setScrollPositionNow(f),n=!0)}let l=n;!l&&this._options.alwaysConsumeMouseWheel&&(l=!0),!l&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(l=!0),l&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),i=e.scrollTop>0,n=e.scrollLeft>0,l=n?" left":"",o=i?" top":"",c=n||i?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${l}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${c}${o}${l}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),qw)}},Vw=class extends Kw{constructor(e,i,n){super(e,i,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function Xw(e){let i={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return i.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:i.horizontalScrollbarSize,i.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:i.verticalScrollbarSize,Ai&&(i.className+=" mac"),i}var ku=class extends Se{constructor(e,i,n,l,o,c,d,_){super(),this._bufferService=n,this._optionsService=d,this._renderService=_,this._onRequestScrollLines=this._register(new Z),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let v=this._register(new zw({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:f=>nd(l.window,f)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{v.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new Vw(i,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},v)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(o.onProtocolChange(f=>{this._scrollableElement.updateOptions({handleMouseWheel:!(f&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Ct.runAndSubscribe(c.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=c.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(qe(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=l.mainDocument.createElement("style"),i.appendChild(this._styleElement),this._register(qe(()=>this._styleElement.remove())),this._register(Ct.runAndSubscribe(c.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${c.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${c.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${c.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
184
|
-
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(f=>this._handleScroll(f)))}scrollLines(e){let i=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:i.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,i){i&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!i,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let i=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=i-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=i,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};ku=$e([te(2,zt),te(3,Zi),te(4,dm),te(5,on),te(6,Ot),te(7,Qi)],ku);var Mu=class extends Se{constructor(e,i,n,l,o){super(),this._screenElement=e,this._bufferService=i,this._coreBrowserService=n,this._decorationService=l,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(c=>this._removeDecoration(c))),this._register(qe(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var l;let i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",((l=e==null?void 0:e.options)==null?void 0:l.layer)==="top"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){let i=e.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${i*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,i=e.element){if(!i)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?i.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":i.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var i;(i=this._decorationElements.get(e))==null||i.remove(),this._decorationElements.delete(e),e.dispose()}};Mu=$e([te(1,zt),te(2,Zi),te(3,Rl),te(4,Qi)],Mu);var Gw=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(e){if(e.options.overviewRulerOptions){for(let i of this._zones)if(i.color===e.options.overviewRulerOptions.color&&i.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(i,e.marker.line))return;if(this._lineAdjacentToZone(i,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(i,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,i){return i>=e.startBufferLine&&i<=e.endBufferLine}_lineAdjacentToZone(e,i,n){return i>=e.startBufferLine-this._linePadding[n||"full"]&&i<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,i){e.startBufferLine=Math.min(e.startBufferLine,i),e.endBufferLine=Math.max(e.endBufferLine,i)}},Ei={full:0,left:0,center:0,right:0},Es={full:0,left:0,center:0,right:0},cl={full:0,left:0,center:0,right:0},fo=class extends Se{constructor(e,i,n,l,o,c,d,_){var f;super(),this._viewportElement=e,this._screenElement=i,this._bufferService=n,this._decorationService=l,this._renderService=o,this._optionsService=c,this._themeService=d,this._coreBrowserService=_,this._colorZoneStore=new Gw,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(),(f=this._viewportElement.parentElement)==null||f.insertBefore(this._canvas,this._viewportElement),this._register(qe(()=>{var m;return(m=this._canvas)==null?void 0:m.remove()}));let v=this._canvas.getContext("2d");if(v)this._ctx=v;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),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())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),i=Math.ceil((this._canvas.width-1)/3);Es.full=this._canvas.width,Es.left=e,Es.center=i,Es.right=e,this._refreshDrawHeightConstants(),cl.full=1,cl.left=1,cl.center=1+Es.left,cl.right=1+Es.left+Es.center}_refreshDrawHeightConstants(){Ei.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,i=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Ei.left=i,Ei.center=i,Ei.right=i}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ei.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ei.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ei.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ei.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(let i of this._decorationService.decorations)this._colorZoneStore.addDecoration(i);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let i of e)i.position!=="full"&&this._renderColorZone(i);for(let i of e)i.position==="full"&&this._renderColorZone(i);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(cl[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Ei[e.position||"full"]/2),Es[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Ei[e.position||"full"]))}_queueRefresh(e,i){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=i||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};fo=$e([te(2,zt),te(3,Rl),te(4,Qi),te(5,Ot),te(6,on),te(7,Zi)],fo);var K;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
185
|
-
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(K||(K={}));var ao;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(ao||(ao={}));var zm;(e=>e.ST=`${K.ESC}\\`)(zm||(zm={}));var Du=class{constructor(e,i,n,l,o,c){this._textarea=e,this._compositionView=i,this._bufferService=n,this._optionsService=l,this._coreService=o,this._renderService=c,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;i.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(i.start,this._compositionPosition.start):n=this._textarea.value.substring(i.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let i=this._textarea.value,n=i.replace(e,"");this._dataAlreadySent=n,i.length>e.length?this._coreService.triggerDataEvent(n,!0):i.length<e.length?this._coreService.triggerDataEvent(`${K.DEL}`,!0):i.length===e.length&&i!==e&&this._coreService.triggerDataEvent(i,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,l=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,o=i*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=o+"px",this._compositionView.style.top=l+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let c=this._compositionView.getBoundingClientRect();this._textarea.style.left=o+"px",this._textarea.style.top=l+"px",this._textarea.style.width=Math.max(c.width,1)+"px",this._textarea.style.height=Math.max(c.height,1)+"px",this._textarea.style.lineHeight=c.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Du=$e([te(2,zt),te(3,Ot),te(4,cr),te(5,Qi)],Du);var vt=0,gt=0,pt=0,Ge=0,op={css:"#00000000",rgba:0},it;(e=>{function i(o,c,d,_){return _!==void 0?`#${Qs(o)}${Qs(c)}${Qs(d)}${Qs(_)}`:`#${Qs(o)}${Qs(c)}${Qs(d)}`}e.toCss=i;function n(o,c,d,_=255){return(o<<24|c<<16|d<<8|_)>>>0}e.toRgba=n;function l(o,c,d,_){return{css:e.toCss(o,c,d,_),rgba:e.toRgba(o,c,d,_)}}e.toColor=l})(it||(it={}));var Pe;(e=>{function i(v,f){if(Ge=(f.rgba&255)/255,Ge===1)return{css:f.css,rgba:f.rgba};let m=f.rgba>>24&255,S=f.rgba>>16&255,y=f.rgba>>8&255,M=v.rgba>>24&255,C=v.rgba>>16&255,E=v.rgba>>8&255;vt=M+Math.round((m-M)*Ge),gt=C+Math.round((S-C)*Ge),pt=E+Math.round((y-E)*Ge);let B=it.toCss(vt,gt,pt),L=it.toRgba(vt,gt,pt);return{css:B,rgba:L}}e.blend=i;function n(v){return(v.rgba&255)===255}e.isOpaque=n;function l(v,f,m){let S=oo.ensureContrastRatio(v.rgba,f.rgba,m);if(S)return it.toColor(S>>24&255,S>>16&255,S>>8&255)}e.ensureContrastRatio=l;function o(v){let f=(v.rgba|255)>>>0;return[vt,gt,pt]=oo.toChannels(f),{css:it.toCss(vt,gt,pt),rgba:f}}e.opaque=o;function c(v,f){return Ge=Math.round(f*255),[vt,gt,pt]=oo.toChannels(v.rgba),{css:it.toCss(vt,gt,pt,Ge),rgba:it.toRgba(vt,gt,pt,Ge)}}e.opacity=c;function d(v,f){return Ge=v.rgba&255,c(v,Ge*f/255)}e.multiplyOpacity=d;function _(v){return[v.rgba>>24&255,v.rgba>>16&255,v.rgba>>8&255]}e.toColorRGB=_})(Pe||(Pe={}));var Ke;(e=>{let i,n;try{let o=document.createElement("canvas");o.width=1,o.height=1;let c=o.getContext("2d",{willReadFrequently:!0});c&&(i=c,i.globalCompositeOperation="copy",n=i.createLinearGradient(0,0,1,1))}catch{}function l(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return vt=parseInt(o.slice(1,2).repeat(2),16),gt=parseInt(o.slice(2,3).repeat(2),16),pt=parseInt(o.slice(3,4).repeat(2),16),it.toColor(vt,gt,pt);case 5:return vt=parseInt(o.slice(1,2).repeat(2),16),gt=parseInt(o.slice(2,3).repeat(2),16),pt=parseInt(o.slice(3,4).repeat(2),16),Ge=parseInt(o.slice(4,5).repeat(2),16),it.toColor(vt,gt,pt,Ge);case 7:return{css:o,rgba:(parseInt(o.slice(1),16)<<8|255)>>>0};case 9:return{css:o,rgba:parseInt(o.slice(1),16)>>>0}}let c=o.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(c)return vt=parseInt(c[1]),gt=parseInt(c[2]),pt=parseInt(c[3]),Ge=Math.round((c[5]===void 0?1:parseFloat(c[5]))*255),it.toColor(vt,gt,pt,Ge);if(!i||!n)throw new Error("css.toColor: Unsupported css format");if(i.fillStyle=n,i.fillStyle=o,typeof i.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(i.fillRect(0,0,1,1),[vt,gt,pt,Ge]=i.getImageData(0,0,1,1).data,Ge!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:it.toRgba(vt,gt,pt,Ge),css:o}}e.toColor=l})(Ke||(Ke={}));var At;(e=>{function i(l){return n(l>>16&255,l>>8&255,l&255)}e.relativeLuminance=i;function n(l,o,c){let d=l/255,_=o/255,v=c/255,f=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4),m=_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4),S=v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4);return f*.2126+m*.7152+S*.0722}e.relativeLuminance2=n})(At||(At={}));var oo;(e=>{function i(d,_){if(Ge=(_&255)/255,Ge===1)return _;let v=_>>24&255,f=_>>16&255,m=_>>8&255,S=d>>24&255,y=d>>16&255,M=d>>8&255;return vt=S+Math.round((v-S)*Ge),gt=y+Math.round((f-y)*Ge),pt=M+Math.round((m-M)*Ge),it.toRgba(vt,gt,pt)}e.blend=i;function n(d,_,v){let f=At.relativeLuminance(d>>8),m=At.relativeLuminance(_>>8);if($i(f,m)<v){if(m<f){let M=l(d,_,v),C=$i(f,At.relativeLuminance(M>>8));if(C<v){let E=o(d,_,v),B=$i(f,At.relativeLuminance(E>>8));return C>B?M:E}return M}let S=o(d,_,v),y=$i(f,At.relativeLuminance(S>>8));if(y<v){let M=l(d,_,v),C=$i(f,At.relativeLuminance(M>>8));return y>C?S:M}return S}}e.ensureContrastRatio=n;function l(d,_,v){let f=d>>24&255,m=d>>16&255,S=d>>8&255,y=_>>24&255,M=_>>16&255,C=_>>8&255,E=$i(At.relativeLuminance2(y,M,C),At.relativeLuminance2(f,m,S));for(;E<v&&(y>0||M>0||C>0);)y-=Math.max(0,Math.ceil(y*.1)),M-=Math.max(0,Math.ceil(M*.1)),C-=Math.max(0,Math.ceil(C*.1)),E=$i(At.relativeLuminance2(y,M,C),At.relativeLuminance2(f,m,S));return(y<<24|M<<16|C<<8|255)>>>0}e.reduceLuminance=l;function o(d,_,v){let f=d>>24&255,m=d>>16&255,S=d>>8&255,y=_>>24&255,M=_>>16&255,C=_>>8&255,E=$i(At.relativeLuminance2(y,M,C),At.relativeLuminance2(f,m,S));for(;E<v&&(y<255||M<255||C<255);)y=Math.min(255,y+Math.ceil((255-y)*.1)),M=Math.min(255,M+Math.ceil((255-M)*.1)),C=Math.min(255,C+Math.ceil((255-C)*.1)),E=$i(At.relativeLuminance2(y,M,C),At.relativeLuminance2(f,m,S));return(y<<24|M<<16|C<<8|255)>>>0}e.increaseLuminance=o;function c(d){return[d>>24&255,d>>16&255,d>>8&255,d&255]}e.toChannels=c})(oo||(oo={}));function Qs(e){let i=e.toString(16);return i.length<2?"0"+i:i}function $i(e,i){return e<i?(i+.05)/(e+.05):(e+.05)/(i+.05)}var $w=class extends Dl{constructor(e,i,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},_o=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new di}register(e){let i={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(i),i.id}deregister(e){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===e)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let i=this._bufferService.buffer.lines.get(e);if(!i||i.length===0)return[];let n=[],l=i.translateToString(!0),o=0,c=0,d=0,_=i.getFg(0),v=i.getBg(0);for(let f=0;f<i.getTrimmedLength();f++)if(i.loadCell(f,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==_||this._workCell.bg!==v){if(f-o>1){let m=this._getJoinedRanges(l,d,c,i,o);for(let S=0;S<m.length;S++)n.push(m[S])}o=f,d=c,_=this._workCell.fg,v=this._workCell.bg}c+=this._workCell.getChars().length||Rs.length}if(this._bufferService.cols-o>1){let f=this._getJoinedRanges(l,d,c,i,o);for(let m=0;m<f.length;m++)n.push(f[m])}return n}_getJoinedRanges(e,i,n,l,o){let c=e.substring(i,n),d=[];try{d=this._characterJoiners[0].handler(c)}catch(_){console.error(_)}for(let _=1;_<this._characterJoiners.length;_++)try{let v=this._characterJoiners[_].handler(c);for(let f=0;f<v.length;f++)_o._mergeRanges(d,v[f])}catch(v){console.error(v)}return this._stringRangesToCellRanges(d,l,o),d}_stringRangesToCellRanges(e,i,n){let l=0,o=!1,c=0,d=e[l];if(d){for(let _=n;_<this._bufferService.cols;_++){let v=i.getWidth(_),f=i.getString(_).length||Rs.length;if(v!==0){if(!o&&d[0]<=c&&(d[0]=_,o=!0),d[1]<=c){if(d[1]=_,d=e[++l],!d)break;d[0]<=c?(d[0]=_,o=!0):o=!1}c+=f}}d&&(d[1]=this._bufferService.cols)}}static _mergeRanges(e,i){let n=!1;for(let l=0;l<e.length;l++){let o=e[l];if(n){if(i[1]<=o[0])return e[l-1][1]=i[1],e;if(i[1]<=o[1])return e[l-1][1]=Math.max(i[1],o[1]),e.splice(l,1),e;e.splice(l,1),l--}else{if(i[1]<=o[0])return e.splice(l,0,i),e;if(i[1]<=o[1])return o[0]=Math.min(i[0],o[0]),e;i[0]<o[1]&&(o[0]=Math.min(i[0],o[0]),n=!0);continue}}return n?e[e.length-1][1]=i[1]:e.push(i),e}};_o=$e([te(0,zt)],_o);function Fw(e){return 57508<=e&&e<=57558}function Iw(e){return 9472<=e&&e<=9631}function Zw(e){return Fw(e)||Iw(e)}function Qw(){return{css:{canvas:Qa(),cell:Qa()},device:{canvas:Qa(),cell:Qa(),char:{width:0,height:0,left:0,top:0}}}}function Qa(){return{width:0,height:0}}var Ru=class{constructor(e,i,n,l,o,c,d){this._document=e,this._characterJoinerService=i,this._optionsService=n,this._coreBrowserService=l,this._coreService=o,this._decorationService=c,this._themeService=d,this._workCell=new di,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,i,n){this._selectionStart=e,this._selectionEnd=i,this._columnSelectMode=n}createRow(e,i,n,l,o,c,d,_,v,f,m){let S=[],y=this._characterJoinerService.getJoinedCharacters(i),M=this._themeService.colors,C=e.getNoBgTrimmedLength();n&&C<c+1&&(C=c+1);let E,B=0,L="",Q=0,G=0,q=0,N=0,ee=!1,le=0,_e=!1,Te=0,Qe=0,ie=[],X=f!==-1&&m!==-1;for(let H=0;H<C;H++){e.loadCell(H,this._workCell);let F=this._workCell.getWidth();if(F===0)continue;let $=!1,k=H>=Qe,P=H,U=this._workCell;if(y.length>0&&H===y[0][0]&&k){let xe=y.shift(),Bs=this._isCellInSelection(xe[0],i);for(Q=xe[0]+1;Q<xe[1];Q++)k&&(k=Bs===this._isCellInSelection(Q,i));k&&(k=!n||c<xe[0]||c>=xe[1]),k?($=!0,U=new $w(this._workCell,e.translateToString(!0,xe[0],xe[1]),xe[1]-xe[0]),P=xe[1]-1,F=U.getWidth()):Qe=xe[1]}let oe=this._isCellInSelection(H,i),w=n&&H===c,W=X&&H>=f&&H<=m,J=!1;this._decorationService.forEachDecorationAtCell(H,i,void 0,xe=>{J=!0});let I=U.getChars()||Rs;if(I===" "&&(U.isUnderline()||U.isOverline())&&(I=" "),Te=F*_-v.get(I,U.isBold(),U.isItalic()),!E)E=this._document.createElement("span");else if(B&&(oe&&_e||!oe&&!_e&&U.bg===G)&&(oe&&_e&&M.selectionForeground||U.fg===q)&&U.extended.ext===N&&W===ee&&Te===le&&!w&&!$&&!J&&k){U.isInvisible()?L+=Rs:L+=I,B++;continue}else B&&(E.textContent=L),E=this._document.createElement("span"),B=0,L="";if(G=U.bg,q=U.fg,N=U.extended.ext,ee=W,le=Te,_e=oe,$&&c>=H&&c<=P&&(c=H),!this._coreService.isCursorHidden&&w&&this._coreService.isCursorInitialized){if(ie.push("xterm-cursor"),this._coreBrowserService.isFocused)d&&ie.push("xterm-cursor-blink"),ie.push(l==="bar"?"xterm-cursor-bar":l==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(o)switch(o){case"outline":ie.push("xterm-cursor-outline");break;case"block":ie.push("xterm-cursor-block");break;case"bar":ie.push("xterm-cursor-bar");break;case"underline":ie.push("xterm-cursor-underline");break}}if(U.isBold()&&ie.push("xterm-bold"),U.isItalic()&&ie.push("xterm-italic"),U.isDim()&&ie.push("xterm-dim"),U.isInvisible()?L=Rs:L=U.getChars()||Rs,U.isUnderline()&&(ie.push(`xterm-underline-${U.extended.underlineStyle}`),L===" "&&(L=" "),!U.isUnderlineColorDefault()))if(U.isUnderlineColorRGB())E.style.textDecorationColor=`rgb(${Dl.toColorRGB(U.getUnderlineColor()).join(",")})`;else{let xe=U.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&U.isBold()&&xe<8&&(xe+=8),E.style.textDecorationColor=M.ansi[xe].css}U.isOverline()&&(ie.push("xterm-overline"),L===" "&&(L=" ")),U.isStrikethrough()&&ie.push("xterm-strikethrough"),W&&(E.style.textDecoration="underline");let se=U.getFgColor(),ve=U.getFgColorMode(),re=U.getBgColor(),Ue=U.getBgColorMode(),Me=!!U.isInverse();if(Me){let xe=se;se=re,re=xe;let Bs=ve;ve=Ue,Ue=Bs}let st,Ji,mi=!1;this._decorationService.forEachDecorationAtCell(H,i,void 0,xe=>{xe.options.layer!=="top"&&mi||(xe.backgroundColorRGB&&(Ue=50331648,re=xe.backgroundColorRGB.rgba>>8&16777215,st=xe.backgroundColorRGB),xe.foregroundColorRGB&&(ve=50331648,se=xe.foregroundColorRGB.rgba>>8&16777215,Ji=xe.foregroundColorRGB),mi=xe.options.layer==="top")}),!mi&&oe&&(st=this._coreBrowserService.isFocused?M.selectionBackgroundOpaque:M.selectionInactiveBackgroundOpaque,re=st.rgba>>8&16777215,Ue=50331648,mi=!0,M.selectionForeground&&(ve=50331648,se=M.selectionForeground.rgba>>8&16777215,Ji=M.selectionForeground)),mi&&ie.push("xterm-decoration-top");let Jt;switch(Ue){case 16777216:case 33554432:Jt=M.ansi[re],ie.push(`xterm-bg-${re}`);break;case 50331648:Jt=it.toColor(re>>16,re>>8&255,re&255),this._addStyle(E,`background-color:#${hp((re>>>0).toString(16),"0",6)}`);break;case 0:default:Me?(Jt=M.foreground,ie.push("xterm-bg-257")):Jt=M.background}switch(st||U.isDim()&&(st=Pe.multiplyOpacity(Jt,.5)),ve){case 16777216:case 33554432:U.isBold()&&se<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(se+=8),this._applyMinimumContrast(E,Jt,M.ansi[se],U,st,void 0)||ie.push(`xterm-fg-${se}`);break;case 50331648:let xe=it.toColor(se>>16&255,se>>8&255,se&255);this._applyMinimumContrast(E,Jt,xe,U,st,Ji)||this._addStyle(E,`color:#${hp(se.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(E,Jt,M.foreground,U,st,Ji)||Me&&ie.push("xterm-fg-257")}ie.length&&(E.className=ie.join(" "),ie.length=0),!w&&!$&&!J&&k?B++:E.textContent=L,Te!==this.defaultSpacing&&(E.style.letterSpacing=`${Te}px`),S.push(E),H=P}return E&&B&&(E.textContent=L),S}_applyMinimumContrast(e,i,n,l,o,c){if(this._optionsService.rawOptions.minimumContrastRatio===1||Zw(l.getCode()))return!1;let d=this._getContrastCache(l),_;if(!o&&!c&&(_=d.getColor(i.rgba,n.rgba)),_===void 0){let v=this._optionsService.rawOptions.minimumContrastRatio/(l.isDim()?2:1);_=Pe.ensureContrastRatio(o||i,c||n,v),d.setColor((o||i).rgba,(c||n).rgba,_??null)}return _?(this._addStyle(e,`color:${_.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,i){e.setAttribute("style",`${e.getAttribute("style")||""}${i};`)}_isCellInSelection(e,i){let n=this._selectionStart,l=this._selectionEnd;return!n||!l?!1:this._columnSelectMode?n[0]<=l[0]?e>=n[0]&&i>=n[1]&&e<l[0]&&i<=l[1]:e<n[0]&&i>=n[1]&&e>=l[0]&&i<=l[1]:i>n[1]&&i<l[1]||n[1]===l[1]&&i===n[1]&&e>=n[0]&&e<l[0]||n[1]<l[1]&&i===l[1]&&e<l[0]||n[1]<l[1]&&i===n[1]&&e>=n[0]}};Ru=$e([te(1,vm),te(2,Ot),te(3,Zi),te(4,cr),te(5,Rl),te(6,on)],Ru);function hp(e,i,n){for(;e.length<n;)e=i+e;return e}var Jw=class{constructor(e,i){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.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";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let l=e.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontStyle="italic";let c=e.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontWeight="bold",c.style.fontStyle="italic",this._measureElements=[n,l,o,c],this._container.appendChild(n),this._container.appendChild(l),this._container.appendChild(o),this._container.appendChild(c),i.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(e,i,n,l){e===this._font&&i===this._fontSize&&n===this._weight&&l===this._weightBold||(this._font=e,this._fontSize=i,this._weight=n,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(e,i,n){let l=0;if(!i&&!n&&e.length===1&&(l=e.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];let d=this._measure(e,0);return d>0&&(this._flat[l]=d),d}let o=e;i&&(o+="B"),n&&(o+="I");let c=this._holey.get(o);if(c===void 0){let d=0;i&&(d|=1),n&&(d|=2),c=this._measure(e,d),c>0&&this._holey.set(o,c)}return c}_measure(e,i){let n=this._measureElements[i];return n.textContent=e.repeat(32),n.offsetWidth/32}},eC=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,i,n,l=!1){if(this.selectionStart=i,this.selectionEnd=n,!i||!n||i[0]===n[0]&&i[1]===n[1]){this.clear();return}let o=e.buffers.active.ydisp,c=i[1]-o,d=n[1]-o,_=Math.max(c,0),v=Math.min(d,e.rows-1);if(_>=e.rows||v<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=l,this.viewportStartRow=c,this.viewportEndRow=d,this.viewportCappedStartRow=_,this.viewportCappedEndRow=v,this.startCol=i[0],this.endCol=n[0]}isCellSelected(e,i,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?i>=this.startCol&&n>=this.viewportCappedStartRow&&i<this.endCol&&n<=this.viewportCappedEndRow:i<this.startCol&&n>=this.viewportCappedStartRow&&i>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol):!1}};function tC(){return new eC}var Xc="xterm-dom-renderer-owner-",hi="xterm-rows",Ja="xterm-fg-",cp="xterm-bg-",ul="xterm-focus",eo="xterm-selection",iC=1,Tu=class extends Se{constructor(e,i,n,l,o,c,d,_,v,f,m,S,y,M){super(),this._terminal=e,this._document=i,this._element=n,this._screenElement=l,this._viewportElement=o,this._helperContainer=c,this._linkifier2=d,this._charSizeService=v,this._optionsService=f,this._bufferService=m,this._coreService=S,this._coreBrowserService=y,this._themeService=M,this._terminalClass=iC++,this._rowElements=[],this._selectionRenderModel=tC(),this.onRequestRedraw=this._register(new Z).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(hi),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(eo),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=Qw(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(C=>this._injectCss(C))),this._injectCss(this._themeService.colors),this._rowFactory=_.createInstance(Ru,document),this._element.classList.add(Xc+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(C=>this._handleLinkHover(C))),this._register(this._linkifier2.onHideLinkUnderline(C=>this._handleLinkLeave(C))),this._register(qe(()=>{this._element.classList.remove(Xc+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new Jw(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(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),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/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),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(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let i=`${this._terminalSelector} .${hi} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=i,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(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let i=`${this._terminalSelector} .${hi} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;i+=`${this._terminalSelector} .${hi} .xterm-dim { color: ${Pe.multiplyOpacity(e.foreground,.5).css};}`,i+=`${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;}`;let n=`blink_underline_${this._terminalClass}`,l=`blink_bar_${this._terminalClass}`,o=`blink_block_${this._terminalClass}`;i+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,i+=`@keyframes ${l} { 50% { box-shadow: none; }}`,i+=`@keyframes ${o} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,i+=`${this._terminalSelector} .${hi}.${ul} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${hi}.${ul} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${l} 1s step-end infinite;}${this._terminalSelector} .${hi}.${ul} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${hi} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${hi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${hi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${hi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${hi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,i+=`${this._terminalSelector} .${eo} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${eo} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${eo} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[c,d]of e.ansi.entries())i+=`${this._terminalSelector} .${Ja}${c} { color: ${d.css}; }${this._terminalSelector} .${Ja}${c}.xterm-dim { color: ${Pe.multiplyOpacity(d,.5).css}; }${this._terminalSelector} .${cp}${c} { background-color: ${d.css}; }`;i+=`${this._terminalSelector} .${Ja}257 { color: ${Pe.opaque(e.background).css}; }${this._terminalSelector} .${Ja}257.xterm-dim { color: ${Pe.multiplyOpacity(Pe.opaque(e.background),.5).css}; }${this._terminalSelector} .${cp}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=i}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,i){for(let n=this._rowElements.length;n<=i;n++){let l=this._document.createElement("div");this._rowContainer.appendChild(l),this._rowElements.push(l)}for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,i){this._refreshRowElements(e,i),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(ul),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(ul),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,i,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,i,n),this.renderRows(0,this._bufferService.rows-1),!e||!i||(this._selectionRenderModel.update(this._terminal,e,i,n),!this._selectionRenderModel.hasSelection))return;let l=this._selectionRenderModel.viewportStartRow,o=this._selectionRenderModel.viewportEndRow,c=this._selectionRenderModel.viewportCappedStartRow,d=this._selectionRenderModel.viewportCappedEndRow,_=this._document.createDocumentFragment();if(n){let v=e[0]>i[0];_.appendChild(this._createSelectionElement(c,v?i[0]:e[0],v?e[0]:i[0],d-c+1))}else{let v=l===c?e[0]:0,f=c===o?i[0]:this._bufferService.cols;_.appendChild(this._createSelectionElement(c,v,f));let m=d-c-1;if(_.appendChild(this._createSelectionElement(c+1,0,this._bufferService.cols,m)),c!==d){let S=o===d?i[0]:this._bufferService.cols;_.appendChild(this._createSelectionElement(d,0,S))}}this._selectionContainer.appendChild(_)}_createSelectionElement(e,i,n,l=1){let o=this._document.createElement("div"),c=i*this.dimensions.css.cell.width,d=this.dimensions.css.cell.width*(n-i);return c+d>this.dimensions.css.canvas.width&&(d=this.dimensions.css.canvas.width-c),o.style.height=`${l*this.dimensions.css.cell.height}px`,o.style.top=`${e*this.dimensions.css.cell.height}px`,o.style.left=`${c}px`,o.style.width=`${d}px`,o}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(let e of this._rowElements)e.replaceChildren()}renderRows(e,i){let n=this._bufferService.buffer,l=n.ybase+n.y,o=Math.min(n.x,this._bufferService.cols-1),c=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,d=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,_=this._optionsService.rawOptions.cursorInactiveStyle;for(let v=e;v<=i;v++){let f=v+n.ydisp,m=this._rowElements[v],S=n.lines.get(f);if(!m||!S)break;m.replaceChildren(...this._rowFactory.createRow(S,f,f===l,d,_,o,c,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Xc}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,i,n,l,o,c){n<0&&(e=0),l<0&&(i=0);let d=this._bufferService.rows-1;n=Math.max(Math.min(n,d),0),l=Math.max(Math.min(l,d),0),o=Math.min(o,this._bufferService.cols);let _=this._bufferService.buffer,v=_.ybase+_.y,f=Math.min(_.x,o-1),m=this._optionsService.rawOptions.cursorBlink,S=this._optionsService.rawOptions.cursorStyle,y=this._optionsService.rawOptions.cursorInactiveStyle;for(let M=n;M<=l;++M){let C=M+_.ydisp,E=this._rowElements[M],B=_.lines.get(C);if(!E||!B)break;E.replaceChildren(...this._rowFactory.createRow(B,C,C===v,S,y,f,m,this.dimensions.css.cell.width,this._widthCache,c?M===n?e:0:-1,c?(M===l?i:o)-1:-1))}}};Tu=$e([te(7,Ju),te(8,yo),te(9,Ot),te(10,zt),te(11,cr),te(12,Zi),te(13,on)],Tu);var Au=class extends Se{constructor(e,i,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new Z),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new rC(this._optionsService))}catch{this._measureStrategy=this._register(new sC(e,i,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Au=$e([te(2,Ot)],Au);var Om=class extends Se{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,i){e!==void 0&&e>0&&i!==void 0&&i>0&&(this._result.width=e,this._result.height=i)}},sC=class extends Om{constructor(e,i,n){super(),this._document=e,this._parentElement=i,this._optionsService=n,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}},rC=class extends Om{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let i=this._ctx.measureText("W");if(!("width"in i&&"fontBoundingBoxAscent"in i&&"fontBoundingBoxDescent"in i))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},nC=class extends Se{constructor(e,i,n){super(),this._textarea=e,this._window=i,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new lC(this._window)),this._onDprChange=this._register(new Z),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new Z),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(l=>this._screenDprMonitor.setWindow(l))),this._register(Ct.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(de(this._textarea,"focus",()=>this._isFocused=!0)),this._register(de(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,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}},lC=class extends Se{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new an),this._onDprChange=this._register(new Z),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(qe(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=de(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.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)}},aC=class extends Se{constructor(){super(),this.linkProviders=[],this._register(qe(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let i=this.linkProviders.indexOf(e);i!==-1&&this.linkProviders.splice(i,1)}}}};function ad(e,i,n){let l=n.getBoundingClientRect(),o=e.getComputedStyle(n),c=parseInt(o.getPropertyValue("padding-left")),d=parseInt(o.getPropertyValue("padding-top"));return[i.clientX-l.left-c,i.clientY-l.top-d]}function oC(e,i,n,l,o,c,d,_,v){if(!c)return;let f=ad(e,i,n);if(f)return f[0]=Math.ceil((f[0]+(v?d/2:0))/d),f[1]=Math.ceil(f[1]/_),f[0]=Math.min(Math.max(f[0],1),l+(v?1:0)),f[1]=Math.min(Math.max(f[1],1),o),f}var Bu=class{constructor(e,i){this._renderService=e,this._charSizeService=i}getCoords(e,i,n,l,o){return oC(window,e,i,n,l,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(e,i){let n=ad(window,e,i);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])}}};Bu=$e([te(0,Qi),te(1,yo)],Bu);var hC=class{constructor(e,i){this._renderCallback=e,this._coreBrowserService=i,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i,!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){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},Lm={};Sb(Lm,{getSafariVersion:()=>uC,isChromeOS:()=>Pm,isFirefox:()=>Nm,isIpad:()=>dC,isIphone:()=>fC,isLegacyEdge:()=>cC,isLinux:()=>od,isMac:()=>vo,isNode:()=>bo,isSafari:()=>Hm,isWindows:()=>Um});var bo=typeof process<"u"&&"title"in process,Tl=bo?"node":navigator.userAgent,Al=bo?"node":navigator.platform,Nm=Tl.includes("Firefox"),cC=Tl.includes("Edge"),Hm=/^((?!chrome|android).)*safari/i.test(Tl);function uC(){if(!Hm)return 0;let e=Tl.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var vo=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Al),dC=Al==="iPad",fC=Al==="iPhone",Um=["Windows","Win16","Win32","WinCE"].includes(Al),od=Al.indexOf("Linux")>=0,Pm=/\bCrOS\b/.test(Tl),jm=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),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(e){this._idleCallback=void 0;let i=0,n=0,l=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(i=performance.now(),this._tasks[this._i]()||this._i++,i=Math.max(1,performance.now()-i),n=Math.max(i,n),o=e.timeRemaining(),n*1.5>o){l-i<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(l-i))}ms`),this._start();return}l=o}this.clear()}},_C=class extends jm{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let i=performance.now()+e;return{timeRemaining:()=>Math.max(0,i-performance.now())}}},vC=class extends jm{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},go=!bo&&"requestIdleCallback"in window?vC:_C,gC=class{constructor(){this._queue=new go}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},zu=class extends Se{constructor(e,i,n,l,o,c,d,_,v){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=l,this._coreService=o,this._coreBrowserService=_,this._renderer=this._register(new an),this._pausedResizeTask=new gC,this._observerDisposable=this._register(new an),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 Z),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new Z),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new Z),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new Z),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new hC((f,m)=>this._renderRows(f,m),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new pC(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(qe(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(d.onResize(()=>this._fullRefresh())),this._register(d.buffers.onBufferActivate(()=>{var f;return(f=this._renderer.value)==null?void 0:f.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(c.onDecorationRegistered(()=>this._fullRefresh())),this._register(c.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(d.cols,d.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(d.buffer.y,d.buffer.y,!0))),this._register(v.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,i),this._register(this._coreBrowserService.onWindowChange(f=>this._registerIntersectionObserver(f,i)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,i){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(l=>this._handleIntersectionChange(l[l.length-1]),{threshold:0});n.observe(i),this._observerDisposable.value=qe(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,i,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}let l=this._syncOutputHandler.flush();l&&(e=Math.min(e,l.start),i=Math.max(i,l.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,i,this._rowCount)}_renderRows(e,i){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}e=Math.min(e,this._rowCount-1),i=Math.min(i,this._rowCount-1),this._renderer.value.renderRows(e,i),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:i}),this._onRender.fire({start:e,end:i}),this._isNextRenderRedrawOnly=!0}}resize(e,i){this._rowCount=i,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(i=>this.refreshRows(i.start,i.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,i;this._renderer.value&&((i=(e=this._renderer.value).clearTextureAtlas)==null||i.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var n;return(n=this._renderer.value)==null?void 0:n.handleResize(e,i)}):this._renderer.value.handleResize(e,i),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,i,n){var l;this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=n,(l=this._renderer.value)==null||l.handleSelectionChanged(e,i,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};zu=$e([te(2,Ot),te(3,yo),te(4,cr),te(5,Rl),te(6,zt),te(7,Zi),te(8,on)],zu);var pC=class{constructor(e,i,n){this._coreBrowserService=e,this._coreService=i,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,i){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,i)):(this._start=e,this._end=i,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function mC(e,i,n,l){let o=n.buffer.x,c=n.buffer.y;if(!n.buffer.hasScrollback)return bC(o,c,e,i,n,l)+wo(c,i,n,l)+wC(o,c,e,i,n,l);let d;if(c===i)return d=o>e?"D":"C",kl(Math.abs(o-e),El(d,l));d=c>i?"D":"C";let _=Math.abs(c-i),v=yC(c>i?e:o,n)+(_-1)*n.cols+1+SC(c>i?o:e);return kl(v,El(d,l))}function SC(e,i){return e-1}function yC(e,i){return i.cols-e}function bC(e,i,n,l,o,c){return wo(i,l,o,c).length===0?"":kl(Wm(e,i,e,i-ar(i,o),!1,o).length,El("D",c))}function wo(e,i,n,l){let o=e-ar(e,n),c=i-ar(i,n),d=Math.abs(o-c)-CC(e,i,n);return kl(d,El(qm(e,i),l))}function wC(e,i,n,l,o,c){let d;wo(i,l,o,c).length>0?d=l-ar(l,o):d=i;let _=l,v=xC(e,i,n,l,o,c);return kl(Wm(e,d,n,_,v==="C",o).length,El(v,c))}function CC(e,i,n){var d;let l=0,o=e-ar(e,n),c=i-ar(i,n);for(let _=0;_<Math.abs(o-c);_++){let v=qm(e,i)==="A"?-1:1;(d=n.buffer.lines.get(o+v*_))!=null&&d.isWrapped&&l++}return l}function ar(e,i){let n=0,l=i.buffer.lines.get(e),o=l==null?void 0:l.isWrapped;for(;o&&e>=0&&e<i.rows;)n++,l=i.buffer.lines.get(--e),o=l==null?void 0:l.isWrapped;return n}function xC(e,i,n,l,o,c){let d;return wo(n,l,o,c).length>0?d=l-ar(l,o):d=i,e<n&&d<=l||e>=n&&d<l?"C":"D"}function qm(e,i){return e>i?"A":"B"}function Wm(e,i,n,l,o,c){let d=e,_=i,v="";for(;(d!==n||_!==l)&&_>=0&&_<c.buffer.lines.length;)d+=o?1:-1,o&&d>c.cols-1?(v+=c.buffer.translateBufferLineToString(_,!1,e,d),d=0,e=0,_++):!o&&d<0&&(v+=c.buffer.translateBufferLineToString(_,!1,0,e+1),d=c.cols-1,e=d,_--);return v+c.buffer.translateBufferLineToString(_,!1,e,d)}function El(e,i){let n=i?"O":"[";return K.ESC+n+e}function kl(e,i){e=Math.floor(e);let n="";for(let l=0;l<e;l++)n+=i;return n}var EC=class{constructor(e){this._bufferService=e,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.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()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,i=this.selectionEnd;return!e||!i?!1:e[1]>i[1]||e[1]===i[1]&&e[0]>i[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function up(e,i){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return i*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Gc=50,kC=15,MC=50,DC=500,RC=" ",TC=new RegExp(RC,"g"),Ou=class extends Se{constructor(e,i,n,l,o,c,d,_,v){super(),this._element=e,this._screenElement=i,this._linkifier=n,this._bufferService=l,this._coreService=o,this._mouseService=c,this._optionsService=d,this._renderService=_,this._coreBrowserService=v,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new di,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new Z),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new Z),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new Z),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new Z),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=f=>this._handleMouseMove(f),this._mouseUpListener=f=>this._handleMouseUp(f),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(f=>this._handleTrim(f)),this._register(this._bufferService.buffers.onBufferActivate(f=>this._handleBufferActivate(f))),this.enable(),this._model=new EC(this._bufferService),this._activeSelectionMode=0,this._register(qe(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(f=>{f.rowsChanged&&this.clearSelection()}))}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(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!e||!i?!1:e[0]!==i[0]||e[1]!==i[1]}get selectionText(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;if(!e||!i)return"";let n=this._bufferService.buffer,l=[];if(this._activeSelectionMode===3){if(e[0]===i[0])return"";let o=e[0]<i[0]?e[0]:i[0],c=e[0]<i[0]?i[0]:e[0];for(let d=e[1];d<=i[1];d++){let _=n.translateBufferLineToString(d,!0,o,c);l.push(_)}}else{let o=e[1]===i[1]?i[0]:void 0;l.push(n.translateBufferLineToString(e[1],!0,e[0],o));for(let c=e[1]+1;c<=i[1]-1;c++){let d=n.lines.get(c),_=n.translateBufferLineToString(c,!0);d!=null&&d.isWrapped?l[l.length-1]+=_:l.push(_)}if(e[1]!==i[1]){let c=n.lines.get(i[1]),d=n.translateBufferLineToString(i[1],!0,0,i[0]);c&&c.isWrapped?l[l.length-1]+=d:l.push(d)}}return l.map(o=>o.replace(TC," ")).join(Um?`\r
|
|
186
|
-
`:`
|
|
187
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),od&&e&&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(e){let i=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,l=this._model.finalSelectionEnd;return!n||!l||!i?!1:this._areCoordsInSelection(i,n,l)}isCellInSelection(e,i){let n=this._model.finalSelectionStart,l=this._model.finalSelectionEnd;return!n||!l?!1:this._areCoordsInSelection([e,i],n,l)}_areCoordsInSelection(e,i,n){return e[1]>i[1]&&e[1]<n[1]||i[1]===n[1]&&e[1]===i[1]&&e[0]>=i[0]&&e[0]<n[0]||i[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||i[1]<n[1]&&e[1]===i[1]&&e[0]>=i[0]}_selectWordAtCursor(e,i){var o,c;let n=(c=(o=this._linkifier.currentLink)==null?void 0:o.link)==null?void 0:c.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=up(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let l=this._getMouseBufferCoords(e);return l?(this._selectWordAt(l,i),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,i){this._model.clearSelection(),e=Math.max(e,0),i=Math.min(i,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,i],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let i=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(i)return i[0]--,i[1]--,i[1]+=this._bufferService.buffer.ydisp,i}_getMouseEventScrollAmount(e){let i=ad(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return i>=0&&i<=n?0:(i>n&&(i-=n),i=Math.min(Math.max(i,-Gc),Gc),i/=Gc,i/Math.abs(i)+Math.round(i*(kC-1)))}shouldForceSelection(e){return vo?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),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(),MC)}_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(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let i=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);i&&i.length!==this._model.selectionStart[0]&&i.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let i=this._getMouseBufferCoords(e);i&&(this._activeSelectionMode=2,this._selectLineAt(i[1]))}shouldColumnSelect(e){return e.altKey&&!(vo&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let i=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}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(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let l=n.lines.get(this._model.selectionEnd[1]);l&&l.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!i||i[0]!==this._model.selectionEnd[0]||i[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});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let i=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&i<DC&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let l=mC(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(l,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd,n=!!e&&!!i&&(e[0]!==i[0]||e[1]!==i[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,i,n);return}!e||!i||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||i[0]!==this._oldSelectionEnd[0]||i[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,i,n)}_fireOnSelectionChange(e,i,n){this._oldSelectionStart=e,this._oldSelectionEnd=i,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(i=>this._handleTrim(i))}_convertViewportColToCharacterIndex(e,i){let n=i;for(let l=0;i>=l;l++){let o=e.loadCell(l,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:o>1&&i!==l&&(n+=o-1)}return n}setSelection(e,i,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,i],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,i,n=!0,l=!0){if(e[0]>=this._bufferService.cols)return;let o=this._bufferService.buffer,c=o.lines.get(e[1]);if(!c)return;let d=o.translateBufferLineToString(e[1],!1),_=this._convertViewportColToCharacterIndex(c,e[0]),v=_,f=e[0]-_,m=0,S=0,y=0,M=0;if(d.charAt(_)===" "){for(;_>0&&d.charAt(_-1)===" ";)_--;for(;v<d.length&&d.charAt(v+1)===" ";)v++}else{let B=e[0],L=e[0];c.getWidth(B)===0&&(m++,B--),c.getWidth(L)===2&&(S++,L++);let Q=c.getString(L).length;for(Q>1&&(M+=Q-1,v+=Q-1);B>0&&_>0&&!this._isCharWordSeparator(c.loadCell(B-1,this._workCell));){c.loadCell(B-1,this._workCell);let G=this._workCell.getChars().length;this._workCell.getWidth()===0?(m++,B--):G>1&&(y+=G-1,_-=G-1),_--,B--}for(;L<c.length&&v+1<d.length&&!this._isCharWordSeparator(c.loadCell(L+1,this._workCell));){c.loadCell(L+1,this._workCell);let G=this._workCell.getChars().length;this._workCell.getWidth()===2?(S++,L++):G>1&&(M+=G-1,v+=G-1),v++,L++}}v++;let C=_+f-m+y,E=Math.min(this._bufferService.cols,v-_+m+S-y-M);if(!(!i&&d.slice(_,v).trim()==="")){if(n&&C===0&&c.getCodePoint(0)!==32){let B=o.lines.get(e[1]-1);if(B&&c.isWrapped&&B.getCodePoint(this._bufferService.cols-1)!==32){let L=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(L){let Q=this._bufferService.cols-L.start;C-=Q,E+=Q}}}if(l&&C+E===this._bufferService.cols&&c.getCodePoint(this._bufferService.cols-1)!==32){let B=o.lines.get(e[1]+1);if(B!=null&&B.isWrapped&&B.getCodePoint(0)!==32){let L=this._getWordAt([0,e[1]+1],!1,!1,!0);L&&(E+=L.length)}}return{start:C,length:E}}}_selectWordAt(e,i){let n=this._getWordAt(e,i);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let i=this._getWordAt(e,!0);if(i){let n=e[1];for(;i.start<0;)i.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._bufferService.cols;)i.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let i=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:i.first},end:{x:this._bufferService.cols-1,y:i.last}};this._model.selectionStart=[0,i.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=up(n,this._bufferService.cols)}};Ou=$e([te(3,zt),te(4,cr),te(5,ed),te(6,Ot),te(7,Qi),te(8,Zi)],Ou);var dp=class{constructor(){this._data={}}set(e,i,n){this._data[e]||(this._data[e]={}),this._data[e][i]=n}get(e,i){return this._data[e]?this._data[e][i]:void 0}clear(){this._data={}}},fp=class{constructor(){this._color=new dp,this._css=new dp}setCss(e,i,n){this._css.set(e,i,n)}getCss(e,i){return this._css.get(e,i)}setColor(e,i,n){this._color.set(e,i,n)}getColor(e,i){return this._color.get(e,i)}clear(){this._color.clear(),this._css.clear()}},lt=Object.freeze((()=>{let e=[Ke.toColor("#2e3436"),Ke.toColor("#cc0000"),Ke.toColor("#4e9a06"),Ke.toColor("#c4a000"),Ke.toColor("#3465a4"),Ke.toColor("#75507b"),Ke.toColor("#06989a"),Ke.toColor("#d3d7cf"),Ke.toColor("#555753"),Ke.toColor("#ef2929"),Ke.toColor("#8ae234"),Ke.toColor("#fce94f"),Ke.toColor("#729fcf"),Ke.toColor("#ad7fa8"),Ke.toColor("#34e2e2"),Ke.toColor("#eeeeec")],i=[0,95,135,175,215,255];for(let n=0;n<216;n++){let l=i[n/36%6|0],o=i[n/6%6|0],c=i[n%6];e.push({css:it.toCss(l,o,c),rgba:it.toRgba(l,o,c)})}for(let n=0;n<24;n++){let l=8+n*10;e.push({css:it.toCss(l,l,l),rgba:it.toRgba(l,l,l)})}return e})()),Js=Ke.toColor("#ffffff"),ml=Ke.toColor("#000000"),_p=Ke.toColor("#ffffff"),vp=ml,dl={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},AC=Js,Lu=class extends Se{constructor(e){super(),this._optionsService=e,this._contrastCache=new fp,this._halfContrastCache=new fp,this._onChangeColors=this._register(new Z),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Js,background:ml,cursor:_p,cursorAccent:vp,selectionForeground:void 0,selectionBackgroundTransparent:dl,selectionBackgroundOpaque:Pe.blend(ml,dl),selectionInactiveBackgroundTransparent:dl,selectionInactiveBackgroundOpaque:Pe.blend(ml,dl),scrollbarSliderBackground:Pe.opacity(Js,.2),scrollbarSliderHoverBackground:Pe.opacity(Js,.4),scrollbarSliderActiveBackground:Pe.opacity(Js,.5),overviewRulerBorder:Js,ansi:lt.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)))}get colors(){return this._colors}_setTheme(e={}){let i=this._colors;if(i.foreground=Oe(e.foreground,Js),i.background=Oe(e.background,ml),i.cursor=Pe.blend(i.background,Oe(e.cursor,_p)),i.cursorAccent=Pe.blend(i.background,Oe(e.cursorAccent,vp)),i.selectionBackgroundTransparent=Oe(e.selectionBackground,dl),i.selectionBackgroundOpaque=Pe.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=Oe(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=Pe.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?Oe(e.selectionForeground,op):void 0,i.selectionForeground===op&&(i.selectionForeground=void 0),Pe.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=Pe.opacity(i.selectionBackgroundTransparent,.3)),Pe.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=Pe.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.scrollbarSliderBackground=Oe(e.scrollbarSliderBackground,Pe.opacity(i.foreground,.2)),i.scrollbarSliderHoverBackground=Oe(e.scrollbarSliderHoverBackground,Pe.opacity(i.foreground,.4)),i.scrollbarSliderActiveBackground=Oe(e.scrollbarSliderActiveBackground,Pe.opacity(i.foreground,.5)),i.overviewRulerBorder=Oe(e.overviewRulerBorder,AC),i.ansi=lt.slice(),i.ansi[0]=Oe(e.black,lt[0]),i.ansi[1]=Oe(e.red,lt[1]),i.ansi[2]=Oe(e.green,lt[2]),i.ansi[3]=Oe(e.yellow,lt[3]),i.ansi[4]=Oe(e.blue,lt[4]),i.ansi[5]=Oe(e.magenta,lt[5]),i.ansi[6]=Oe(e.cyan,lt[6]),i.ansi[7]=Oe(e.white,lt[7]),i.ansi[8]=Oe(e.brightBlack,lt[8]),i.ansi[9]=Oe(e.brightRed,lt[9]),i.ansi[10]=Oe(e.brightGreen,lt[10]),i.ansi[11]=Oe(e.brightYellow,lt[11]),i.ansi[12]=Oe(e.brightBlue,lt[12]),i.ansi[13]=Oe(e.brightMagenta,lt[13]),i.ansi[14]=Oe(e.brightCyan,lt[14]),i.ansi[15]=Oe(e.brightWhite,lt[15]),e.extendedAnsi){let n=Math.min(i.ansi.length-16,e.extendedAnsi.length);for(let l=0;l<n;l++)i.ansi[l+16]=Oe(e.extendedAnsi[l],lt[l+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let i=0;i<this._restoreColors.ansi.length;++i)this._colors.ansi[i]=this._restoreColors.ansi[i];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};Lu=$e([te(0,Ot)],Lu);function Oe(e,i){if(e!==void 0)try{return Ke.toColor(e)}catch{}return i}var BC=class{constructor(...e){this._entries=new Map;for(let[i,n]of e)this.set(i,n)}set(e,i){let n=this._entries.get(e);return this._entries.set(e,i),n}forEach(e){for(let[i,n]of this._entries.entries())e(i,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},zC=class{constructor(){this._services=new BC,this._services.set(Ju,this)}setService(e,i){this._services.set(e,i)}getService(e){return this._services.get(e)}createInstance(e,...i){let n=kb(e).sort((c,d)=>c.index-d.index),l=[];for(let c of n){let d=this._services.get(c.id);if(!d)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${c.id._id}.`);l.push(d)}let o=n.length>0?n[0].index:i.length;if(i.length!==o)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${i.length} static arguments`);return new e(...i,...l)}},OC={trace:0,debug:1,info:2,warn:3,error:4,off:5},LC="xterm.js: ",Nu=class extends Se{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=OC[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;i<e.length;i++)typeof e[i]=="function"&&(e[i]=e[i]())}_log(e,i,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":LC)+i,...n)}trace(e,...i){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,e,i)}debug(e,...i){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,e,i)}info(e,...i){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,e,i)}warn(e,...i){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,e,i)}error(e,...i){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,e,i)}};Nu=$e([te(0,Ot)],Nu);var gp=class extends Se{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new Z),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new Z),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new Z),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let i=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)i[n]=this._array[this._getCyclicIndex(n)];this._array=i,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let i=this._length;i<e;i++)this._array[i]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,i){this._array[this._getCyclicIndex(e)]=i}push(e){this._array[this._getCyclicIndex(this._length)]=e,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(e,i,...n){if(i){for(let l=e;l<this._length-i;l++)this._array[this._getCyclicIndex(l)]=this._array[this._getCyclicIndex(l+i)];this._length-=i,this.onDeleteEmitter.fire({index:e,amount:i})}for(let l=this._length-1;l>=e;l--)this._array[this._getCyclicIndex(l+n.length)]=this._array[this._getCyclicIndex(l)];for(let l=0;l<n.length;l++)this._array[this._getCyclicIndex(e+l)]=n[l];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let l=this._length+n.length-this._maxLength;this._startIndex+=l,this._length=this._maxLength,this.onTrimEmitter.fire(l)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,i,n){if(!(i<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let o=i-1;o>=0;o--)this.set(e+o+n,this.get(e+o));let l=e+i+n-this._length;if(l>0)for(this._length+=l;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let l=0;l<i;l++)this.set(e+l+n,this.get(e+l))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},me=3,tt=Object.freeze(new Dl),to=0,$c=2,Sl=class Ym{constructor(i,n,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(i*me);let o=n||di.fromCharData([0,om,1,0]);for(let c=0;c<i;++c)this.setCell(c,o);this.length=i}get(i){let n=this._data[i*me+0],l=n&2097151;return[this._data[i*me+1],n&2097152?this._combined[i]:l?Ms(l):"",n>>22,n&2097152?this._combined[i].charCodeAt(this._combined[i].length-1):l]}set(i,n){this._data[i*me+1]=n[0],n[1].length>1?(this._combined[i]=n[1],this._data[i*me+0]=i|2097152|n[2]<<22):this._data[i*me+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(i){return this._data[i*me+0]>>22}hasWidth(i){return this._data[i*me+0]&12582912}getFg(i){return this._data[i*me+1]}getBg(i){return this._data[i*me+2]}hasContent(i){return this._data[i*me+0]&4194303}getCodePoint(i){let n=this._data[i*me+0];return n&2097152?this._combined[i].charCodeAt(this._combined[i].length-1):n&2097151}isCombined(i){return this._data[i*me+0]&2097152}getString(i){let n=this._data[i*me+0];return n&2097152?this._combined[i]:n&2097151?Ms(n&2097151):""}isProtected(i){return this._data[i*me+2]&536870912}loadCell(i,n){return to=i*me,n.content=this._data[to+0],n.fg=this._data[to+1],n.bg=this._data[to+2],n.content&2097152&&(n.combinedData=this._combined[i]),n.bg&268435456&&(n.extended=this._extendedAttrs[i]),n}setCell(i,n){n.content&2097152&&(this._combined[i]=n.combinedData),n.bg&268435456&&(this._extendedAttrs[i]=n.extended),this._data[i*me+0]=n.content,this._data[i*me+1]=n.fg,this._data[i*me+2]=n.bg}setCellFromCodepoint(i,n,l,o){o.bg&268435456&&(this._extendedAttrs[i]=o.extended),this._data[i*me+0]=n|l<<22,this._data[i*me+1]=o.fg,this._data[i*me+2]=o.bg}addCodepointToCell(i,n,l){let o=this._data[i*me+0];o&2097152?this._combined[i]+=Ms(n):o&2097151?(this._combined[i]=Ms(o&2097151)+Ms(n),o&=-2097152,o|=2097152):o=n|1<<22,l&&(o&=-12582913,o|=l<<22),this._data[i*me+0]=o}insertCells(i,n,l){if(i%=this.length,i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,l),n<this.length-i){let o=new di;for(let c=this.length-i-n-1;c>=0;--c)this.setCell(i+n+c,this.loadCell(i+c,o));for(let c=0;c<n;++c)this.setCell(i+c,l)}else for(let o=i;o<this.length;++o)this.setCell(o,l);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,l)}deleteCells(i,n,l){if(i%=this.length,n<this.length-i){let o=new di;for(let c=0;c<this.length-i-n;++c)this.setCell(i+c,this.loadCell(i+n+c,o));for(let c=this.length-n;c<this.length;++c)this.setCell(c,l)}else for(let o=i;o<this.length;++o)this.setCell(o,l);i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,l),this.getWidth(i)===0&&!this.hasContent(i)&&this.setCellFromCodepoint(i,0,1,l)}replaceCells(i,n,l,o=!1){if(o){for(i&&this.getWidth(i-1)===2&&!this.isProtected(i-1)&&this.setCellFromCodepoint(i-1,0,1,l),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,l);i<n&&i<this.length;)this.isProtected(i)||this.setCell(i,l),i++;return}for(i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,l),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,l);i<n&&i<this.length;)this.setCell(i++,l)}resize(i,n){if(i===this.length)return this._data.length*4*$c<this._data.buffer.byteLength;let l=i*me;if(i>this.length){if(this._data.buffer.byteLength>=l*4)this._data=new Uint32Array(this._data.buffer,0,l);else{let o=new Uint32Array(l);o.set(this._data),this._data=o}for(let o=this.length;o<i;++o)this.setCell(o,n)}else{this._data=this._data.subarray(0,l);let o=Object.keys(this._combined);for(let d=0;d<o.length;d++){let _=parseInt(o[d],10);_>=i&&delete this._combined[_]}let c=Object.keys(this._extendedAttrs);for(let d=0;d<c.length;d++){let _=parseInt(c[d],10);_>=i&&delete this._extendedAttrs[_]}}return this.length=i,l*4*$c<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*$c<this._data.buffer.byteLength){let i=new Uint32Array(this._data.length);return i.set(this._data),this._data=i,1}return 0}fill(i,n=!1){if(n){for(let l=0;l<this.length;++l)this.isProtected(l)||this.setCell(l,i);return}this._combined={},this._extendedAttrs={};for(let l=0;l<this.length;++l)this.setCell(l,i)}copyFrom(i){this.length!==i.length?this._data=new Uint32Array(i._data):this._data.set(i._data),this.length=i.length,this._combined={};for(let n in i._combined)this._combined[n]=i._combined[n];this._extendedAttrs={};for(let n in i._extendedAttrs)this._extendedAttrs[n]=i._extendedAttrs[n];this.isWrapped=i.isWrapped}clone(){let i=new Ym(0);i._data=new Uint32Array(this._data),i.length=this.length;for(let n in this._combined)i._combined[n]=this._combined[n];for(let n in this._extendedAttrs)i._extendedAttrs[n]=this._extendedAttrs[n];return i.isWrapped=this.isWrapped,i}getTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(this._data[i*me+0]&4194303)return i+(this._data[i*me+0]>>22);return 0}getNoBgTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(this._data[i*me+0]&4194303||this._data[i*me+2]&50331648)return i+(this._data[i*me+0]>>22);return 0}copyCellsFrom(i,n,l,o,c){let d=i._data;if(c)for(let v=o-1;v>=0;v--){for(let f=0;f<me;f++)this._data[(l+v)*me+f]=d[(n+v)*me+f];d[(n+v)*me+2]&268435456&&(this._extendedAttrs[l+v]=i._extendedAttrs[n+v])}else for(let v=0;v<o;v++){for(let f=0;f<me;f++)this._data[(l+v)*me+f]=d[(n+v)*me+f];d[(n+v)*me+2]&268435456&&(this._extendedAttrs[l+v]=i._extendedAttrs[n+v])}let _=Object.keys(i._combined);for(let v=0;v<_.length;v++){let f=parseInt(_[v],10);f>=n&&(this._combined[f-n+l]=i._combined[f])}}translateToString(i,n,l,o){n=n??0,l=l??this.length,i&&(l=Math.min(l,this.getTrimmedLength())),o&&(o.length=0);let c="";for(;n<l;){let d=this._data[n*me+0],_=d&2097151,v=d&2097152?this._combined[n]:_?Ms(_):Rs;if(c+=v,o)for(let f=0;f<v.length;++f)o.push(n);n+=d>>22||1}return o&&o.push(n),c}};function NC(e,i,n,l,o,c){let d=[];for(let _=0;_<e.length-1;_++){let v=_,f=e.get(++v);if(!f.isWrapped)continue;let m=[e.get(_)];for(;v<e.length&&f.isWrapped;)m.push(f),f=e.get(++v);if(!c&&l>=_&&l<v){_+=m.length-1;continue}let S=0,y=Ml(m,S,i),M=1,C=0;for(;M<m.length;){let B=Ml(m,M,i),L=B-C,Q=n-y,G=Math.min(L,Q);m[S].copyCellsFrom(m[M],C,y,G,!1),y+=G,y===n&&(S++,y=0),C+=G,C===B&&(M++,C=0),y===0&&S!==0&&m[S-1].getWidth(n-1)===2&&(m[S].copyCellsFrom(m[S-1],n-1,y++,1,!1),m[S-1].setCell(n-1,o))}m[S].replaceCells(y,n,o);let E=0;for(let B=m.length-1;B>0&&(B>S||m[B].getTrimmedLength()===0);B--)E++;E>0&&(d.push(_+m.length-E),d.push(E)),_+=m.length-1}return d}function HC(e,i){let n=[],l=0,o=i[l],c=0;for(let d=0;d<e.length;d++)if(o===d){let _=i[++l];e.onDeleteEmitter.fire({index:d-c,amount:_}),d+=_-1,c+=_,o=i[++l]}else n.push(d);return{layout:n,countRemoved:c}}function UC(e,i){let n=[];for(let l=0;l<i.length;l++)n.push(e.get(i[l]));for(let l=0;l<n.length;l++)e.set(l,n[l]);e.length=i.length}function PC(e,i,n){let l=[],o=e.map((v,f)=>Ml(e,f,i)).reduce((v,f)=>v+f),c=0,d=0,_=0;for(;_<o;){if(o-_<n){l.push(o-_);break}c+=n;let v=Ml(e,d,i);c>v&&(c-=v,d++);let f=e[d].getWidth(c-1)===2;f&&c--;let m=f?n-1:n;l.push(m),_+=m}return l}function Ml(e,i,n){if(i===e.length-1)return e[i].getTrimmedLength();let l=!e[i].hasContent(n-1)&&e[i].getWidth(n-1)===1,o=e[i+1].getWidth(0)===2;return l&&o?n-1:n}var Km=class Vm{constructor(i){this.line=i,this.isDisposed=!1,this._disposables=[],this._id=Vm._nextId++,this._onDispose=this.register(new Z),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),lr(this._disposables),this._disposables.length=0)}register(i){return this._disposables.push(i),i}};Km._nextId=1;var jC=Km,ot={},er=ot.B;ot[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:"≥","{":"π","|":"≠","}":"£","~":"·"};ot.A={"#":"£"};ot.B=void 0;ot[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};ot.C=ot[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ot.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};ot.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};ot.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};ot.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};ot.E=ot[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};ot.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};ot.H=ot[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ot["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var pp=4294967295,mp=class{constructor(e,i,n){this._hasScrollback=e,this._optionsService=i,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=tt.clone(),this.savedCharset=er,this.markers=[],this._nullCell=di.fromCharData([0,om,1,0]),this._whitespaceCell=di.fromCharData([0,Rs,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new go,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new gp(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new uo),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new uo),this._whitespaceCell}getBlankLine(e,i){return new Sl(this._bufferService.cols,this.getNullCell(e),i)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let i=e+this._optionsService.rawOptions.scrollback;return i>pp?pp:i}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=tt);let i=this._rows;for(;i--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new gp(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,i){let n=this.getNullCell(tt),l=0,o=this._getCorrectBufferLength(i);if(o>this.lines.maxLength&&(this.lines.maxLength=o),this.lines.length>0){if(this._cols<e)for(let d=0;d<this.lines.length;d++)l+=+this.lines.get(d).resize(e,n);let c=0;if(this._rows<i)for(let d=this._rows;d<i;d++)this.lines.length<i+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Sl(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+c+1?(this.ybase--,c++,this.ydisp>0&&this.ydisp--):this.lines.push(new Sl(e,n)));else for(let d=this._rows;d>i;d--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(o<this.lines.maxLength){let d=this.lines.length-o;d>0&&(this.lines.trimStart(d),this.ybase=Math.max(this.ybase-d,0),this.ydisp=Math.max(this.ydisp-d,0),this.savedY=Math.max(this.savedY-d,0)),this.lines.maxLength=o}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,i-1),c&&(this.y+=c),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(e,i),this._cols>e))for(let c=0;c<this.lines.length;c++)l+=+this.lines.get(c).resize(e,n);this._cols=e,this._rows=i,this._memoryCleanupQueue.clear(),l>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let i=0;for(;this._memoryCleanupPosition<this.lines.length;)if(i+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),i>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,i){this._cols!==e&&(e>this._cols?this._reflowLarger(e,i):this._reflowSmaller(e,i))}_reflowLarger(e,i){let n=this._optionsService.rawOptions.reflowCursorLine,l=NC(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(tt),n);if(l.length>0){let o=HC(this.lines,l);UC(this.lines,o.layout),this._reflowLargerAdjustViewport(e,i,o.countRemoved)}}_reflowLargerAdjustViewport(e,i,n){let l=this.getNullCell(tt),o=n;for(;o-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new Sl(e,l))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,i){let n=this._optionsService.rawOptions.reflowCursorLine,l=this.getNullCell(tt),o=[],c=0;for(let d=this.lines.length-1;d>=0;d--){let _=this.lines.get(d);if(!_||!_.isWrapped&&_.getTrimmedLength()<=e)continue;let v=[_];for(;_.isWrapped&&d>0;)_=this.lines.get(--d),v.unshift(_);if(!n){let G=this.ybase+this.y;if(G>=d&&G<d+v.length)continue}let f=v[v.length-1].getTrimmedLength(),m=PC(v,this._cols,e),S=m.length-v.length,y;this.ybase===0&&this.y!==this.lines.length-1?y=Math.max(0,this.y-this.lines.maxLength+S):y=Math.max(0,this.lines.length-this.lines.maxLength+S);let M=[];for(let G=0;G<S;G++){let q=this.getBlankLine(tt,!0);M.push(q)}M.length>0&&(o.push({start:d+v.length+c,newLines:M}),c+=M.length),v.push(...M);let C=m.length-1,E=m[C];E===0&&(C--,E=m[C]);let B=v.length-S-1,L=f;for(;B>=0;){let G=Math.min(L,E);if(v[C]===void 0)break;if(v[C].copyCellsFrom(v[B],L-G,E-G,G,!0),E-=G,E===0&&(C--,E=m[C]),L-=G,L===0){B--;let q=Math.max(B,0);L=Ml(v,q,this._cols)}}for(let G=0;G<v.length;G++)m[G]<e&&v[G].setCell(m[G],l);let Q=S-y;for(;Q-- >0;)this.ybase===0?this.y<i-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+c)-i&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+S,this.ybase+i-1)}if(o.length>0){let d=[],_=[];for(let E=0;E<this.lines.length;E++)_.push(this.lines.get(E));let v=this.lines.length,f=v-1,m=0,S=o[m];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+c);let y=0;for(let E=Math.min(this.lines.maxLength-1,v+c-1);E>=0;E--)if(S&&S.start>f+y){for(let B=S.newLines.length-1;B>=0;B--)this.lines.set(E--,S.newLines[B]);E++,d.push({index:f+1,amount:S.newLines.length}),y+=S.newLines.length,S=o[++m]}else this.lines.set(E,_[f--]);let M=0;for(let E=d.length-1;E>=0;E--)d[E].index+=M,this.lines.onInsertEmitter.fire(d[E]),M+=d[E].amount;let C=Math.max(0,v+c-this.lines.maxLength);C>0&&this.lines.onTrimEmitter.fire(C)}}translateBufferLineToString(e,i,n=0,l){let o=this.lines.get(e);return o?o.translateToString(i,n,l):""}getWrappedRangeForLine(e){let i=e,n=e;for(;i>0&&this.lines.get(i).isWrapped;)i--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:i,last:n}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].line===e&&(this.markers[i].dispose(),this.markers.splice(i--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let i=new jC(e);return this.markers.push(i),i.register(this.lines.onTrim(n=>{i.line-=n,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(n=>{i.line>=n.index&&(i.line+=n.amount)})),i.register(this.lines.onDelete(n=>{i.line>=n.index&&i.line<n.index+n.amount&&i.dispose(),i.line>n.index&&(i.line-=n.amount)})),i.register(i.onDispose(()=>this._removeMarker(i))),i}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},qC=class extends Se{constructor(e,i){super(),this._optionsService=e,this._bufferService=i,this._onBufferActivate=this._register(new Z),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 mp(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new mp(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,i){this._normal.resize(e,i),this._alt.resize(e,i),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},Xm=2,Gm=1,Hu=class extends Se{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new Z),this.onResize=this._onResize.event,this._onScroll=this._register(new Z),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,Xm),this.rows=Math.max(e.rawOptions.rows||0,Gm),this.buffers=this._register(new qC(e,this)),this._register(this.buffers.onBufferActivate(i=>{this._onScroll.fire(i.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,i){let n=this.cols!==e,l=this.rows!==i;this.cols=e,this.rows=i,this.buffers.resize(e,i),this._onResize.fire({cols:e,rows:i,colsChanged:n,rowsChanged:l})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,i=!1){let n=this.buffer,l;l=this._cachedBlankLine,(!l||l.length!==this.cols||l.getFg(0)!==e.fg||l.getBg(0)!==e.bg)&&(l=n.getBlankLine(e,i),this._cachedBlankLine=l),l.isWrapped=i;let o=n.ybase+n.scrollTop,c=n.ybase+n.scrollBottom;if(n.scrollTop===0){let d=n.lines.isFull;c===n.lines.length-1?d?n.lines.recycle().copyFrom(l):n.lines.push(l.clone()):n.lines.splice(c+1,0,l.clone()),d?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let d=c-o+1;n.lines.shiftElements(o+1,d-1,-1),n.lines.set(c,l.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,i){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let l=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),l!==n.ydisp&&(i||this._onScroll.fire(n.ydisp))}};Hu=$e([te(0,Ot)],Hu);var Jr={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:vo,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},WC=["normal","bold","100","200","300","400","500","600","700","800","900"],YC=class extends Se{constructor(e){super(),this._onOptionChange=this._register(new Z),this.onOptionChange=this._onOptionChange.event;let i={...Jr};for(let n in e)if(n in i)try{let l=e[n];i[n]=this._sanitizeAndValidateOption(n,l)}catch(l){console.error(l)}this.rawOptions=i,this.options={...i},this._setupOptions(),this._register(qe(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,i){return this.onOptionChange(n=>{n===e&&i(this.rawOptions[e])})}onMultipleOptionChange(e,i){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&i()})}_setupOptions(){let e=n=>{if(!(n in Jr))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},i=(n,l)=>{if(!(n in Jr))throw new Error(`No option with key "${n}"`);l=this._sanitizeAndValidateOption(n,l),this.rawOptions[n]!==l&&(this.rawOptions[n]=l,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let l={get:e.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this.options,n,l)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=Jr[e]),!KC(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=Jr[e]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=WC.includes(i)?i:Jr[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(i*10)/10));break;case"scrollback":if(i=Math.min(i,4294967295),i<0)throw new Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&i!==0)throw new Error(`${e} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{};break}return i}};function KC(e){return e==="block"||e==="underline"||e==="bar"}function yl(e,i=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let l in e)n[l]=i<=1?e[l]:e[l]&&yl(e[l],i-1);return n}var Sp=Object.freeze({insertMode:!1}),yp=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Uu=class extends Se{constructor(e,i,n){super(),this._bufferService=e,this._logService=i,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new Z),this.onData=this._onData.event,this._onUserInput=this._register(new Z),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new Z),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new Z),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=yl(Sp),this.decPrivateModes=yl(yp)}reset(){this.modes=yl(Sp),this.decPrivateModes=yl(yp)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(l=>l.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(i=>i.charCodeAt(0))),this._onBinary.fire(e))}};Uu=$e([te(0,zt),te(1,fm),te(2,Ot)],Uu);var bp={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Fc(e,i){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!i&&(n|=3)),n}var Ic=String.fromCharCode,wp={DEFAULT:e=>{let i=[Fc(e,!1)+32,e.col+32,e.row+32];return i[0]>255||i[1]>255||i[2]>255?"":`\x1B[M${Ic(i[0])}${Ic(i[1])}${Ic(i[2])}`},SGR:e=>{let i=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Fc(e,!0)};${e.col};${e.row}${i}`},SGR_PIXELS:e=>{let i=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Fc(e,!0)};${e.x};${e.y}${i}`}},Pu=class extends Se{constructor(e,i,n){super(),this._bufferService=e,this._coreService=i,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new Z),this.onProtocolChange=this._onProtocolChange.event;for(let l of Object.keys(bp))this.addProtocol(l,bp[l]);for(let l of Object.keys(wp))this.addEncoding(l,wp[l]);this.reset()}addProtocol(e,i){this._protocols[e]=i}addEncoding(e,i){this._encodings[e]=i}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,i,n){if(e.deltaY===0||e.shiftKey||i===void 0||n===void 0)return 0;let l=i/n,o=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=l+0,Math.abs(e.deltaY)<50&&(o*=.3),this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(e,i){return i.altKey||i.ctrlKey||i.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let i=this._encodings[this._activeEncoding](e);return i&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(i):this._coreService.triggerDataEvent(i,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,i,n){if(n){if(e.x!==i.x||e.y!==i.y)return!1}else if(e.col!==i.col||e.row!==i.row)return!1;return!(e.button!==i.button||e.action!==i.action||e.ctrl!==i.ctrl||e.alt!==i.alt||e.shift!==i.shift)}};Pu=$e([te(0,zt),te(1,cr),te(2,Ot)],Pu);var Zc=[[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]],VC=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],at;function XC(e,i){let n=0,l=i.length-1,o;if(e<i[0][0]||e>i[l][1])return!1;for(;l>=n;)if(o=n+l>>1,e>i[o][1])n=o+1;else if(e<i[o][0])l=o-1;else return!0;return!1}var GC=class{constructor(){if(this.version="6",!at){at=new Uint8Array(65536),at.fill(1),at[0]=0,at.fill(0,1,32),at.fill(0,127,160),at.fill(2,4352,4448),at[9001]=2,at[9002]=2,at.fill(2,11904,42192),at[12351]=1,at.fill(2,44032,55204),at.fill(2,63744,64256),at.fill(2,65040,65050),at.fill(2,65072,65136),at.fill(2,65280,65377),at.fill(2,65504,65511);for(let e=0;e<Zc.length;++e)at.fill(0,Zc[e][0],Zc[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?at[e]:XC(e,VC)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,i){let n=this.wcwidth(e),l=n===0&&i!==0;if(l){let o=tr.extractWidth(i);o===0?l=!1:o>n&&(n=o)}return tr.createPropertyValue(0,n,l)}},tr=class ho{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Z,this.onChange=this._onChange.event;let i=new GC;this.register(i),this._active=i.version,this._activeProvider=i}static extractShouldJoin(i){return(i&1)!==0}static extractWidth(i){return i>>1&3}static extractCharKind(i){return i>>3}static createPropertyValue(i,n,l=!1){return(i&16777215)<<3|(n&3)<<1|(l?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(i){if(!this._providers[i])throw new Error(`unknown Unicode version "${i}"`);this._active=i,this._activeProvider=this._providers[i],this._onChange.fire(i)}register(i){this._providers[i.version]=i}wcwidth(i){return this._activeProvider.wcwidth(i)}getStringCellWidth(i){let n=0,l=0,o=i.length;for(let c=0;c<o;++c){let d=i.charCodeAt(c);if(55296<=d&&d<=56319){if(++c>=o)return n+this.wcwidth(d);let f=i.charCodeAt(c);56320<=f&&f<=57343?d=(d-55296)*1024+f-56320+65536:n+=this.wcwidth(f)}let _=this.charProperties(d,l),v=ho.extractWidth(_);ho.extractShouldJoin(_)&&(v-=ho.extractWidth(l)),n+=v,l=_}return n}charProperties(i,n){return this._activeProvider.charProperties(i,n)}},$C=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,i){this._charsets[e]=i,this.glevel===e&&(this.charset=i)}};function Cp(e){var l;let i=(l=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:l.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&i&&(n.isWrapped=i[3]!==0&&i[3]!==32)}var fl=2147483647,FC=256,$m=class ju{constructor(i=32,n=32){if(this.maxLength=i,this.maxSubParamsLength=n,n>FC)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(i),this.length=0,this._subParams=new Int32Array(n),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(i),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(i){let n=new ju;if(!i.length)return n;for(let l=Array.isArray(i[0])?1:0;l<i.length;++l){let o=i[l];if(Array.isArray(o))for(let c=0;c<o.length;++c)n.addSubParam(o[c]);else n.addParam(o)}return n}clone(){let i=new ju(this.maxLength,this.maxSubParamsLength);return i.params.set(this.params),i.length=this.length,i._subParams.set(this._subParams),i._subParamsLength=this._subParamsLength,i._subParamsIdx.set(this._subParamsIdx),i._rejectDigits=this._rejectDigits,i._rejectSubDigits=this._rejectSubDigits,i._digitIsSub=this._digitIsSub,i}toArray(){let i=[];for(let n=0;n<this.length;++n){i.push(this.params[n]);let l=this._subParamsIdx[n]>>8,o=this._subParamsIdx[n]&255;o-l>0&&i.push(Array.prototype.slice.call(this._subParams,l,o))}return i}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(i){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(i<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=i>fl?fl:i}addSubParam(i){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(i<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=i>fl?fl:i,this._subParamsIdx[this.length-1]++}}hasSubParams(i){return(this._subParamsIdx[i]&255)-(this._subParamsIdx[i]>>8)>0}getSubParams(i){let n=this._subParamsIdx[i]>>8,l=this._subParamsIdx[i]&255;return l-n>0?this._subParams.subarray(n,l):null}getSubParamsAll(){let i={};for(let n=0;n<this.length;++n){let l=this._subParamsIdx[n]>>8,o=this._subParamsIdx[n]&255;o-l>0&&(i[n]=this._subParams.slice(l,o))}return i}addDigit(i){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let l=this._digitIsSub?this._subParams:this.params,o=l[n-1];l[n-1]=~o?Math.min(o*10+i,fl):i}},_l=[],IC=class{constructor(){this._state=0,this._active=_l,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let l=n.indexOf(i);l!==-1&&n.splice(l,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_l}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=_l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||_l,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,i,n){if(!this._active.length)this._handlerFb(this._id,"PUT",So(e,i,n));else for(let l=this._active.length-1;l>=0;l--)this._active[l].put(e,i,n)}start(){this.reset(),this._state=1}put(e,i,n){if(this._state!==3){if(this._state===1)for(;i<n;){let l=e[i++];if(l===59){this._state=2,this._start();break}if(l<48||57<l){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+l-48}this._state===2&&n-i>0&&this._put(e,i,n)}}end(e,i=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,l=this._active.length-1,o=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,n=i,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;l>=0&&(n=this._active[l].end(e),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].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,n}this._active=_l,this._id=-1,this._state=0}}},Qt=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,i,n){this._hitLimit||(this._data+=So(e,i,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data),i instanceof Promise))return i.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,i}},vl=[],ZC=class{constructor(){this._handlers=Object.create(null),this._active=vl,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=vl}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let l=n.indexOf(i);l!==-1&&n.splice(l,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=vl,this._ident=0}hook(e,i){if(this.reset(),this._ident=e,this._active=this._handlers[e]||vl,!this._active.length)this._handlerFb(this._ident,"HOOK",i);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(i)}put(e,i,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",So(e,i,n));else for(let l=this._active.length-1;l>=0;l--)this._active[l].put(e,i,n)}unhook(e,i=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,l=this._active.length-1,o=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,n=i,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;l>=0&&(n=this._active[l].unhook(e),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}this._active=vl,this._ident=0}},bl=new $m;bl.addParam(0);var xp=class{constructor(e){this._handler=e,this._data="",this._params=bl,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():bl,this._data="",this._hitLimit=!1}put(e,i,n){this._hitLimit||(this._data+=So(e,i,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data,this._params),i instanceof Promise))return i.then(n=>(this._params=bl,this._data="",this._hitLimit=!1,n));return this._params=bl,this._data="",this._hitLimit=!1,i}},QC=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,i){this.table.fill(e<<4|i)}add(e,i,n,l){this.table[i<<8|e]=n<<4|l}addMany(e,i,n,l){for(let o=0;o<e.length;o++)this.table[i<<8|e[o]]=n<<4|l}},ui=160,JC=(function(){let e=new QC(4095),i=Array.apply(null,Array(256)).map((_,v)=>v),n=(_,v)=>i.slice(_,v),l=n(32,127),o=n(0,24);o.push(25),o.push.apply(o,n(28,32));let c=n(0,14),d;e.setDefault(1,0),e.addMany(l,0,2,0);for(d in c)e.addMany([24,26,153,154],d,3,0),e.addMany(n(128,144),d,3,0),e.addMany(n(144,152),d,3,0),e.add(156,d,0,0),e.add(27,d,11,1),e.add(157,d,4,8),e.addMany([152,158,159],d,0,7),e.add(155,d,11,3),e.add(144,d,11,9);return e.addMany(o,0,3,0),e.addMany(o,1,3,1),e.add(127,1,0,1),e.addMany(o,8,0,8),e.addMany(o,3,3,3),e.add(127,3,0,3),e.addMany(o,4,3,4),e.add(127,4,0,4),e.addMany(o,6,3,6),e.addMany(o,5,3,5),e.add(127,5,0,5),e.addMany(o,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(l,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(l,7,0,7),e.addMany(o,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(o,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(o,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(o,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(o,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(o,13,13,13),e.addMany(l,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(ui,0,2,0),e.add(ui,8,5,8),e.add(ui,6,0,6),e.add(ui,11,0,11),e.add(ui,13,13,13),e})(),e2=class extends Se{constructor(e=JC){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new $m,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,n,l)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,n)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(qe(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new IC),this._dcsParser=this._register(new ZC),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,i=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let o=0;o<e.intermediates.length;++o){let c=e.intermediates.charCodeAt(o);if(32>c||c>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=c}}if(e.final.length!==1)throw new Error("final must be a single byte");let l=e.final.charCodeAt(0);if(i[0]>l||l>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return n<<=8,n|=l,n}identToString(e){let i=[];for(;e;)i.push(String.fromCharCode(e&255)),e>>=8;return i.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,i){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let l=this._escHandlers[n];return l.push(i),{dispose:()=>{let o=l.indexOf(i);o!==-1&&l.splice(o,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,i){this._executeHandlers[e.charCodeAt(0)]=i}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,i){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let l=this._csiHandlers[n];return l.push(i),{dispose:()=>{let o=l.indexOf(i);o!==-1&&l.splice(o,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,i){return this._dcsParser.registerHandler(this._identifier(e),i)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,i){return this._oscParser.registerHandler(e,i)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}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(e,i,n,l,o){this._parseStack.state=e,this._parseStack.handlers=i,this._parseStack.handlerPos=n,this._parseStack.transition=l,this._parseStack.chunkPos=o}parse(e,i,n){let l=0,o=0,c=0,d;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,c=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let _=this._parseStack.handlers,v=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&v>-1){for(;v>=0&&(d=_[v](this._params),d!==!0);v--)if(d instanceof Promise)return this._parseStack.handlerPos=v,d}this._parseStack.handlers=[];break;case 4:if(n===!1&&v>-1){for(;v>=0&&(d=_[v](),d!==!0);v--)if(d instanceof Promise)return this._parseStack.handlerPos=v,d}this._parseStack.handlers=[];break;case 6:if(l=e[this._parseStack.chunkPos],d=this._dcsParser.unhook(l!==24&&l!==26,n),d)return d;l===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(l=e[this._parseStack.chunkPos],d=this._oscParser.end(l!==24&&l!==26,n),d)return d;l===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,c=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let _=c;_<i;++_){switch(l=e[_],o=this._transitions.table[this.currentState<<8|(l<160?l:ui)],o>>4){case 2:for(let y=_+1;;++y){if(y>=i||(l=e[y])<32||l>126&&l<ui){this._printHandler(e,_,y),_=y-1;break}if(++y>=i||(l=e[y])<32||l>126&&l<ui){this._printHandler(e,_,y),_=y-1;break}if(++y>=i||(l=e[y])<32||l>126&&l<ui){this._printHandler(e,_,y),_=y-1;break}if(++y>=i||(l=e[y])<32||l>126&&l<ui){this._printHandler(e,_,y),_=y-1;break}}break;case 3:this._executeHandlers[l]?this._executeHandlers[l]():this._executeHandlerFb(l),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:_,code:l,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let v=this._csiHandlers[this._collect<<8|l],f=v?v.length-1:-1;for(;f>=0&&(d=v[f](this._params),d!==!0);f--)if(d instanceof Promise)return this._preserveStack(3,v,f,o,_),d;f<0&&this._csiHandlerFb(this._collect<<8|l,this._params),this.precedingJoinState=0;break;case 8:do switch(l){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(l-48)}while(++_<i&&(l=e[_])>47&&l<60);_--;break;case 9:this._collect<<=8,this._collect|=l;break;case 10:let m=this._escHandlers[this._collect<<8|l],S=m?m.length-1:-1;for(;S>=0&&(d=m[S](),d!==!0);S--)if(d instanceof Promise)return this._preserveStack(4,m,S,o,_),d;S<0&&this._escHandlerFb(this._collect<<8|l),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|l,this._params);break;case 13:for(let y=_+1;;++y)if(y>=i||(l=e[y])===24||l===26||l===27||l>127&&l<ui){this._dcsParser.put(e,_,y),_=y-1;break}break;case 14:if(d=this._dcsParser.unhook(l!==24&&l!==26),d)return this._preserveStack(6,[],0,o,_),d;l===27&&(o|=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 y=_+1;;y++)if(y>=i||(l=e[y])<32||l>127&&l<ui){this._oscParser.put(e,_,y),_=y-1;break}break;case 6:if(d=this._oscParser.end(l!==24&&l!==26),d)return this._preserveStack(5,[],0,o,_),d;l===27&&(o|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=o&15}}},t2=/^([\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})$/,i2=/^[\da-f]+$/;function Ep(e){if(!e)return;let i=e.toLowerCase();if(i.indexOf("rgb:")===0){i=i.slice(4);let n=t2.exec(i);if(n){let l=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/l*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/l*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/l*255)]}}else if(i.indexOf("#")===0&&(i=i.slice(1),i2.exec(i)&&[3,6,9,12].includes(i.length))){let n=i.length/3,l=[0,0,0];for(let o=0;o<3;++o){let c=parseInt(i.slice(n*o,n*o+n),16);l[o]=n===1?c<<4:n===2?c:n===3?c>>4:c>>8}return l}}function Qc(e,i){let n=e.toString(16),l=n.length<2?"0"+n:n;switch(i){case 4:return n[0];case 8:return l;case 12:return(l+l).slice(0,3);default:return l+l}}function s2(e,i=16){let[n,l,o]=e;return`rgb:${Qc(n,i)}/${Qc(l,i)}/${Qc(o,i)}`}var r2={"(":0,")":1,"*":2,"+":3,"-":1,".":2},ks=131072,kp=10;function Mp(e,i){if(e>24)return i.setWinLines||!1;switch(e){case 1:return!!i.restoreWin;case 2:return!!i.minimizeWin;case 3:return!!i.setWinPosition;case 4:return!!i.setWinSizePixels;case 5:return!!i.raiseWin;case 6:return!!i.lowerWin;case 7:return!!i.refreshWin;case 8:return!!i.setWinSizeChars;case 9:return!!i.maximizeWin;case 10:return!!i.fullscreenWin;case 11:return!!i.getWinState;case 13:return!!i.getWinPosition;case 14:return!!i.getWinSizePixels;case 15:return!!i.getScreenSizePixels;case 16:return!!i.getCellSizePixels;case 18:return!!i.getWinSizeChars;case 19:return!!i.getScreenSizeChars;case 20:return!!i.getIconTitle;case 21:return!!i.getWinTitle;case 22:return!!i.pushTitle;case 23:return!!i.popTitle;case 24:return!!i.setWinLines}return!1}var Dp=5e3,Rp=0,n2=class extends Se{constructor(e,i,n,l,o,c,d,_,v=new e2){super(),this._bufferService=e,this._charsetService=i,this._coreService=n,this._logService=l,this._optionsService=o,this._oscLinkService=c,this._coreMouseService=d,this._unicodeService=_,this._parser=v,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new xb,this._utf8Decoder=new Eb,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=tt.clone(),this._eraseAttrDataInternal=tt.clone(),this._onRequestBell=this._register(new Z),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new Z),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new Z),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new Z),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new Z),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new Z),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new Z),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new Z),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new Z),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new Z),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new Z),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new Z),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new Z),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 qu(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(f=>this._activeBuffer=f.activeBuffer)),this._parser.setCsiHandlerFallback((f,m)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(f),params:m.toArray()})}),this._parser.setEscHandlerFallback(f=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(f)})}),this._parser.setExecuteHandlerFallback(f=>{this._logService.debug("Unknown EXECUTE code: ",{code:f})}),this._parser.setOscHandlerFallback((f,m,S)=>{this._logService.debug("Unknown OSC code: ",{identifier:f,action:m,data:S})}),this._parser.setDcsHandlerFallback((f,m,S)=>{m==="HOOK"&&(S=S.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(f),action:m,payload:S})}),this._parser.setPrintHandler((f,m,S)=>this.print(f,m,S)),this._parser.registerCsiHandler({final:"@"},f=>this.insertChars(f)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},f=>this.scrollLeft(f)),this._parser.registerCsiHandler({final:"A"},f=>this.cursorUp(f)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},f=>this.scrollRight(f)),this._parser.registerCsiHandler({final:"B"},f=>this.cursorDown(f)),this._parser.registerCsiHandler({final:"C"},f=>this.cursorForward(f)),this._parser.registerCsiHandler({final:"D"},f=>this.cursorBackward(f)),this._parser.registerCsiHandler({final:"E"},f=>this.cursorNextLine(f)),this._parser.registerCsiHandler({final:"F"},f=>this.cursorPrecedingLine(f)),this._parser.registerCsiHandler({final:"G"},f=>this.cursorCharAbsolute(f)),this._parser.registerCsiHandler({final:"H"},f=>this.cursorPosition(f)),this._parser.registerCsiHandler({final:"I"},f=>this.cursorForwardTab(f)),this._parser.registerCsiHandler({final:"J"},f=>this.eraseInDisplay(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},f=>this.eraseInDisplay(f,!0)),this._parser.registerCsiHandler({final:"K"},f=>this.eraseInLine(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},f=>this.eraseInLine(f,!0)),this._parser.registerCsiHandler({final:"L"},f=>this.insertLines(f)),this._parser.registerCsiHandler({final:"M"},f=>this.deleteLines(f)),this._parser.registerCsiHandler({final:"P"},f=>this.deleteChars(f)),this._parser.registerCsiHandler({final:"S"},f=>this.scrollUp(f)),this._parser.registerCsiHandler({final:"T"},f=>this.scrollDown(f)),this._parser.registerCsiHandler({final:"X"},f=>this.eraseChars(f)),this._parser.registerCsiHandler({final:"Z"},f=>this.cursorBackwardTab(f)),this._parser.registerCsiHandler({final:"`"},f=>this.charPosAbsolute(f)),this._parser.registerCsiHandler({final:"a"},f=>this.hPositionRelative(f)),this._parser.registerCsiHandler({final:"b"},f=>this.repeatPrecedingCharacter(f)),this._parser.registerCsiHandler({final:"c"},f=>this.sendDeviceAttributesPrimary(f)),this._parser.registerCsiHandler({prefix:">",final:"c"},f=>this.sendDeviceAttributesSecondary(f)),this._parser.registerCsiHandler({final:"d"},f=>this.linePosAbsolute(f)),this._parser.registerCsiHandler({final:"e"},f=>this.vPositionRelative(f)),this._parser.registerCsiHandler({final:"f"},f=>this.hVPosition(f)),this._parser.registerCsiHandler({final:"g"},f=>this.tabClear(f)),this._parser.registerCsiHandler({final:"h"},f=>this.setMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"h"},f=>this.setModePrivate(f)),this._parser.registerCsiHandler({final:"l"},f=>this.resetMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"l"},f=>this.resetModePrivate(f)),this._parser.registerCsiHandler({final:"m"},f=>this.charAttributes(f)),this._parser.registerCsiHandler({final:"n"},f=>this.deviceStatus(f)),this._parser.registerCsiHandler({prefix:"?",final:"n"},f=>this.deviceStatusPrivate(f)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},f=>this.softReset(f)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},f=>this.setCursorStyle(f)),this._parser.registerCsiHandler({final:"r"},f=>this.setScrollRegion(f)),this._parser.registerCsiHandler({final:"s"},f=>this.saveCursor(f)),this._parser.registerCsiHandler({final:"t"},f=>this.windowOptions(f)),this._parser.registerCsiHandler({final:"u"},f=>this.restoreCursor(f)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},f=>this.insertColumns(f)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},f=>this.deleteColumns(f)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},f=>this.selectProtected(f)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},f=>this.requestMode(f,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},f=>this.requestMode(f,!1)),this._parser.setExecuteHandler(K.BEL,()=>this.bell()),this._parser.setExecuteHandler(K.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(K.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(K.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(K.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(K.BS,()=>this.backspace()),this._parser.setExecuteHandler(K.HT,()=>this.tab()),this._parser.setExecuteHandler(K.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(K.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(ao.IND,()=>this.index()),this._parser.setExecuteHandler(ao.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(ao.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Qt(f=>(this.setTitle(f),this.setIconName(f),!0))),this._parser.registerOscHandler(1,new Qt(f=>this.setIconName(f))),this._parser.registerOscHandler(2,new Qt(f=>this.setTitle(f))),this._parser.registerOscHandler(4,new Qt(f=>this.setOrReportIndexedColor(f))),this._parser.registerOscHandler(8,new Qt(f=>this.setHyperlink(f))),this._parser.registerOscHandler(10,new Qt(f=>this.setOrReportFgColor(f))),this._parser.registerOscHandler(11,new Qt(f=>this.setOrReportBgColor(f))),this._parser.registerOscHandler(12,new Qt(f=>this.setOrReportCursorColor(f))),this._parser.registerOscHandler(104,new Qt(f=>this.restoreIndexedColor(f))),this._parser.registerOscHandler(110,new Qt(f=>this.restoreFgColor(f))),this._parser.registerOscHandler(111,new Qt(f=>this.restoreBgColor(f))),this._parser.registerOscHandler(112,new Qt(f=>this.restoreCursorColor(f))),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(let f in ot)this._parser.registerEscHandler({intermediates:"(",final:f},()=>this.selectCharset("("+f)),this._parser.registerEscHandler({intermediates:")",final:f},()=>this.selectCharset(")"+f)),this._parser.registerEscHandler({intermediates:"*",final:f},()=>this.selectCharset("*"+f)),this._parser.registerEscHandler({intermediates:"+",final:f},()=>this.selectCharset("+"+f)),this._parser.registerEscHandler({intermediates:"-",final:f},()=>this.selectCharset("-"+f)),this._parser.registerEscHandler({intermediates:".",final:f},()=>this.selectCharset("."+f)),this._parser.registerEscHandler({intermediates:"/",final:f},()=>this.selectCharset("/"+f));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(f=>(this._logService.error("Parsing error: ",f),f)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new xp((f,m)=>this.requestStatusString(f,m)))}getAttrData(){return this._curAttrData}_preserveStack(e,i,n,l){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=i,this._parseStack.decodedLength=n,this._parseStack.position=l}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((i,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),Dp))]).catch(i=>{if(i!=="#SLOW_TIMEOUT")throw i;console.warn(`async parser handler taking longer than ${Dp} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,i){let n,l=this._activeBuffer.x,o=this._activeBuffer.y,c=0,d=this._parseStack.paused;if(d){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,i))return this._logSlowResolvingAsync(n),n;l=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>ks&&(c=this._parseStack.position+ks)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,f=>String.fromCharCode(f)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(f=>f.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<ks&&(this._parseBuffer=new Uint32Array(Math.min(e.length,ks))),d||this._dirtyRowTracker.clearRange(),e.length>ks)for(let f=c;f<e.length;f+=ks){let m=f+ks<e.length?f+ks:e.length,S=typeof e=="string"?this._stringDecoder.decode(e.substring(f,m),this._parseBuffer):this._utf8Decoder.decode(e.subarray(f,m),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,S))return this._preserveStack(l,o,S,f),this._logSlowResolvingAsync(n),n}else if(!d){let f=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,f))return this._preserveStack(l,o,f,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==l||this._activeBuffer.y!==o)&&this._onCursorMove.fire();let _=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),v=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);v<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(v,this._bufferService.rows-1),end:Math.min(_,this._bufferService.rows-1)})}print(e,i,n){let l,o,c=this._charsetService.charset,d=this._optionsService.rawOptions.screenReaderMode,_=this._bufferService.cols,v=this._coreService.decPrivateModes.wraparound,f=this._coreService.modes.insertMode,m=this._curAttrData,S=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-i>0&&S.getWidth(this._activeBuffer.x-1)===2&&S.setCellFromCodepoint(this._activeBuffer.x-1,0,1,m);let y=this._parser.precedingJoinState;for(let M=i;M<n;++M){if(l=e[M],l<127&&c){let L=c[String.fromCharCode(l)];L&&(l=L.charCodeAt(0))}let C=this._unicodeService.charProperties(l,y);o=tr.extractWidth(C);let E=tr.extractShouldJoin(C),B=E?tr.extractWidth(y):0;if(y=C,d&&this._onA11yChar.fire(Ms(l)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+o-B>_){if(v){let L=S,Q=this._activeBuffer.x-B;for(this._activeBuffer.x=B,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),S=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),B>0&&S instanceof Sl&&S.copyCellsFrom(L,Q,0,B,!1);Q<_;)L.setCellFromCodepoint(Q++,0,1,m)}else if(this._activeBuffer.x=_-1,o===2)continue}if(E&&this._activeBuffer.x){let L=S.getWidth(this._activeBuffer.x-1)?1:2;S.addCodepointToCell(this._activeBuffer.x-L,l,o);for(let Q=o-B;--Q>=0;)S.setCellFromCodepoint(this._activeBuffer.x++,0,0,m);continue}if(f&&(S.insertCells(this._activeBuffer.x,o-B,this._activeBuffer.getNullCell(m)),S.getWidth(_-1)===2&&S.setCellFromCodepoint(_-1,0,1,m)),S.setCellFromCodepoint(this._activeBuffer.x++,l,o,m),o>0)for(;--o;)S.setCellFromCodepoint(this._activeBuffer.x++,0,0,m)}this._parser.precedingJoinState=y,this._activeBuffer.x<_&&n-i>0&&S.getWidth(this._activeBuffer.x)===0&&!S.hasContent(this._activeBuffer.x)&&S.setCellFromCodepoint(this._activeBuffer.x,0,1,m),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,i){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>Mp(n.params[0],this._optionsService.rawOptions.windowOptions)?i(n):!0):this._parser.registerCsiHandler(e,i)}registerDcsHandler(e,i){return this._parser.registerDcsHandler(e,new xp(i))}registerEscHandler(e,i){return this._parser.registerEscHandler(e,i)}registerOscHandler(e,i){return this._parser.registerOscHandler(e,new Qt(i))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;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&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);i.hasWidth(this._activeBuffer.x)&&!i.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,i){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+i):(this._activeBuffer.x=e,this._activeBuffer.y=i),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,i){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+i)}cursorUp(e){let i=this._activeBuffer.y-this._activeBuffer.scrollTop;return i>=0?this._moveCursor(0,-Math.min(i,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let i=this._activeBuffer.scrollBottom-this._activeBuffer.y;return i>=0?this._moveCursor(0,Math.min(i,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let i=e.params[0];return i===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:i===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i=e.params[0]||1;for(;i--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i=e.params[0]||1;for(;i--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let i=e.params[0];return i===1&&(this._curAttrData.bg|=536870912),(i===2||i===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,i,n,l=!1,o=!1){let c=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);c.replaceCells(i,n,this._activeBuffer.getNullCell(this._eraseAttrData()),o),l&&(c.isWrapped=!1)}_resetBufferLine(e,i=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),i),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,i=!1){var l;this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,i);n<this._bufferService.rows;n++)this._resetBufferLine(n,i);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,i),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,i);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!((l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n))!=null&&l.getTrimmedLength()););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,i);this._dirtyRowTracker.markDirty(0)}break;case 3:let o=this._activeBuffer.lines.length-this._bufferService.rows;o>0&&(this._activeBuffer.lines.trimStart(o),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-o,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-o,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,i=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,i);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,i);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,i);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let i=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,l=this._bufferService.rows-1-this._activeBuffer.scrollBottom,o=this._bufferService.rows-1+this._activeBuffer.ybase-l+1;for(;i--;)this._activeBuffer.lines.splice(o-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let i=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,l;for(l=this._bufferService.rows-1-this._activeBuffer.scrollBottom,l=this._bufferService.rows-1+this._activeBuffer.ybase-l;i--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(l,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let i=e.params[0]||1;for(;i--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let i=e.params[0]||1;for(;i--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(tt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);l.deleteCells(0,i,this._activeBuffer.getNullCell(this._eraseAttrData())),l.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);l.insertCells(0,i,this._activeBuffer.getNullCell(this._eraseAttrData())),l.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);l.insertCells(this._activeBuffer.x,i,this._activeBuffer.getNullCell(this._eraseAttrData())),l.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);l.deleteCells(this._activeBuffer.x,i,this._activeBuffer.getNullCell(this._eraseAttrData())),l.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let i=this._parser.precedingJoinState;if(!i)return!0;let n=e.params[0]||1,l=tr.extractWidth(i),o=this._activeBuffer.x-l,c=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(o),d=new Uint32Array(c.length*n),_=0;for(let f=0;f<c.length;){let m=c.codePointAt(f)||0;d[_++]=m,f+=m>65535?2:1}let v=_;for(let f=1;f<n;++f)d.copyWithin(v,0,_),v+=_;return this.print(d,0,v),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(K.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(K.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(K.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(K.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(K.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,er),this._charsetService.setgCharset(1,er),this._charsetService.setgCharset(2,er),this._charsetService.setgCharset(3,er);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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[i]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,i){(E=>(E[E.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",E[E.SET=1]="SET",E[E.RESET=2]="RESET",E[E.PERMANENTLY_SET=3]="PERMANENTLY_SET",E[E.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let l=this._coreService.decPrivateModes,{activeProtocol:o,activeEncoding:c}=this._coreMouseService,d=this._coreService,{buffers:_,cols:v}=this._bufferService,{active:f,alt:m}=_,S=this._optionsService.rawOptions,y=(E,B)=>(d.triggerDataEvent(`${K.ESC}[${i?"":"?"}${E};${B}$y`),!0),M=E=>E?1:2,C=e.params[0];return i?C===2?y(C,4):C===4?y(C,M(d.modes.insertMode)):C===12?y(C,3):C===20?y(C,M(S.convertEol)):y(C,0):C===1?y(C,M(l.applicationCursorKeys)):C===3?y(C,S.windowOptions.setWinLines?v===80?2:v===132?1:0:0):C===6?y(C,M(l.origin)):C===7?y(C,M(l.wraparound)):C===8?y(C,3):C===9?y(C,M(o==="X10")):C===12?y(C,M(S.cursorBlink)):C===25?y(C,M(!d.isCursorHidden)):C===45?y(C,M(l.reverseWraparound)):C===66?y(C,M(l.applicationKeypad)):C===67?y(C,4):C===1e3?y(C,M(o==="VT200")):C===1002?y(C,M(o==="DRAG")):C===1003?y(C,M(o==="ANY")):C===1004?y(C,M(l.sendFocus)):C===1005?y(C,4):C===1006?y(C,M(c==="SGR")):C===1015?y(C,4):C===1016?y(C,M(c==="SGR_PIXELS")):C===1048?y(C,1):C===47||C===1047||C===1049?y(C,M(f===m)):C===2004?y(C,M(l.bracketedPasteMode)):C===2026?y(C,M(l.synchronizedOutput)):y(C,0)}_updateAttrColor(e,i,n,l,o){return i===2?(e|=50331648,e&=-16777216,e|=Dl.fromColorRGB([n,l,o])):i===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,i,n){let l=[0,0,-1,0,0,0],o=0,c=0;do{if(l[c+o]=e.params[i+c],e.hasSubParams(i+c)){let d=e.getSubParams(i+c),_=0;do l[1]===5&&(o=1),l[c+_+1+o]=d[_];while(++_<d.length&&_+c+1+o<l.length);break}if(l[1]===5&&c+o>=2||l[1]===2&&c+o>=5)break;l[1]&&(o=1)}while(++c+i<e.length&&c+o<l.length);for(let d=2;d<l.length;++d)l[d]===-1&&(l[d]=0);switch(l[0]){case 38:n.fg=this._updateAttrColor(n.fg,l[1],l[3],l[4],l[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,l[1],l[3],l[4],l[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,l[1],l[3],l[4],l[5])}return c}_processUnderline(e,i){i.extended=i.extended.clone(),(!~e||e>5)&&(e=1),i.extended.underlineStyle=e,i.fg|=268435456,e===0&&(i.fg&=-268435457),i.updateExtended()}_processSGR0(e){e.fg=tt.fg,e.bg=tt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let i=e.length,n,l=this._curAttrData;for(let o=0;o<i;o++)n=e.params[o],n>=30&&n<=37?(l.fg&=-50331904,l.fg|=16777216|n-30):n>=40&&n<=47?(l.bg&=-50331904,l.bg|=16777216|n-40):n>=90&&n<=97?(l.fg&=-50331904,l.fg|=16777216|n-90|8):n>=100&&n<=107?(l.bg&=-50331904,l.bg|=16777216|n-100|8):n===0?this._processSGR0(l):n===1?l.fg|=134217728:n===3?l.bg|=67108864:n===4?(l.fg|=268435456,this._processUnderline(e.hasSubParams(o)?e.getSubParams(o)[0]:1,l)):n===5?l.fg|=536870912:n===7?l.fg|=67108864:n===8?l.fg|=1073741824:n===9?l.fg|=2147483648:n===2?l.bg|=134217728:n===21?this._processUnderline(2,l):n===22?(l.fg&=-134217729,l.bg&=-134217729):n===23?l.bg&=-67108865:n===24?(l.fg&=-268435457,this._processUnderline(0,l)):n===25?l.fg&=-536870913:n===27?l.fg&=-67108865:n===28?l.fg&=-1073741825:n===29?l.fg&=2147483647:n===39?(l.fg&=-67108864,l.fg|=tt.fg&16777215):n===49?(l.bg&=-67108864,l.bg|=tt.bg&16777215):n===38||n===48||n===58?o+=this._extractColor(e,o,l):n===53?l.bg|=1073741824:n===55?l.bg&=-1073741825:n===59?(l.extended=l.extended.clone(),l.extended.underlineColor=-1,l.updateExtended()):n===100?(l.fg&=-67108864,l.fg|=tt.fg&16777215,l.bg&=-67108864,l.bg|=tt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${K.ESC}[0n`);break;case 6:let i=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${K.ESC}[${i};${n}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let i=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${K.ESC}[?${i};${n}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=tt.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(e){let i=e.length===0?1:e.params[0];if(i===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(i){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let n=i%2===1;this._coreService.decPrivateModes.cursorBlink=n}return!0}setScrollRegion(e){let i=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>i&&(this._activeBuffer.scrollTop=i-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Mp(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let i=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:i!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${K.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(i===0||i===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>kp&&this._windowTitleStack.shift()),(i===0||i===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>kp&&this._iconNameStack.shift());break;case 23:(i===0||i===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(i===0||i===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let i=[],n=e.split(";");for(;n.length>1;){let l=n.shift(),o=n.shift();if(/^\d+$/.exec(l)){let c=parseInt(l);if(Tp(c))if(o==="?")i.push({type:0,index:c});else{let d=Ep(o);d&&i.push({type:1,index:c,color:d})}}}return i.length&&this._onColor.fire(i),!0}setHyperlink(e){let i=e.indexOf(";");if(i===-1)return!0;let n=e.slice(0,i).trim(),l=e.slice(i+1);return l?this._createHyperlink(n,l):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,i){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),l,o=n.findIndex(c=>c.startsWith("id="));return o!==-1&&(l=n[o].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:l,uri:i}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,i){let n=e.split(";");for(let l=0;l<n.length&&!(i>=this._specialColors.length);++l,++i)if(n[l]==="?")this._onColor.fire([{type:0,index:this._specialColors[i]}]);else{let o=Ep(n[l]);o&&this._onColor.fire([{type:1,index:this._specialColors[i],color:o}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let i=[],n=e.split(";");for(let l=0;l<n.length;++l)if(/^\d+$/.exec(n[l])){let o=parseInt(n[l]);Tp(o)&&i.push({type:2,index:o})}return i.length&&this._onColor.fire(i),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){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,er),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(r2[e[0]],ot[e[1]]||er),!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){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=tt.clone(),this._eraseAttrDataInternal=tt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new di;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let i=0;i<this._bufferService.rows;++i){let n=this._activeBuffer.ybase+this._activeBuffer.y+i,l=this._activeBuffer.lines.get(n);l&&(l.fill(e),l.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,i){let n=d=>(this._coreService.triggerDataEvent(`${K.ESC}${d}${K.ESC}\\`),!0),l=this._bufferService.buffer,o=this._optionsService.rawOptions;return n(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${l.scrollTop+1};${l.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[o.cursorStyle]-(o.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,i){this._dirtyRowTracker.markRangeDirty(e,i)}},qu=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,i){e>i&&(Rp=e,e=i,i=Rp),e<this.start&&(this.start=e),i>this.end&&(this.end=i)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};qu=$e([te(0,zt)],qu);function Tp(e){return 0<=e&&e<256}var l2=5e7,Ap=12,a2=50,o2=class extends Se{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new Z),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,i){if(i!==void 0&&this._syncCalls>i){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let l=this._callbacks.shift();l&&l()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,i){if(this._pendingData>l2)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i)}_innerWrite(e=0,i=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let l=this._writeBuffer[this._bufferOffset],o=this._action(l,i);if(o){let d=_=>performance.now()-n>=Ap?setTimeout(()=>this._innerWrite(0,_)):this._innerWrite(n,_);o.catch(_=>(queueMicrotask(()=>{throw _}),Promise.resolve(!1))).then(d);return}let c=this._callbacks[this._bufferOffset];if(c&&c(),this._bufferOffset++,this._pendingData-=l.length,performance.now()-n>=Ap)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>a2&&(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()}},Wu=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let i=this._bufferService.buffer;if(e.id===void 0){let _=i.addMarker(i.ybase+i.y),v={data:e,id:this._nextId++,lines:[_]};return _.onDispose(()=>this._removeMarkerFromLink(v,_)),this._dataByLinkId.set(v.id,v),v.id}let n=e,l=this._getEntryIdKey(n),o=this._entriesWithId.get(l);if(o)return this.addLineToLink(o.id,i.ybase+i.y),o.id;let c=i.addMarker(i.ybase+i.y),d={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(d,c)),this._entriesWithId.set(d.key,d),this._dataByLinkId.set(d.id,d),d.id}addLineToLink(e,i){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(l=>l.line!==i)){let l=this._bufferService.buffer.addMarker(i);n.lines.push(l),l.onDispose(()=>this._removeMarkerFromLink(n,l))}}getLinkData(e){var i;return(i=this._dataByLinkId.get(e))==null?void 0:i.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,i){let n=e.lines.indexOf(i);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Wu=$e([te(0,zt)],Wu);var Bp=!1,h2=class extends Se{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new an),this._onBinary=this._register(new Z),this.onBinary=this._onBinary.event,this._onData=this._register(new Z),this.onData=this._onData.event,this._onLineFeed=this._register(new Z),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new Z),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new Z),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new Z),this._instantiationService=new zC,this.optionsService=this._register(new YC(e)),this._instantiationService.setService(Ot,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Hu)),this._instantiationService.setService(zt,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Nu)),this._instantiationService.setService(fm,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Uu)),this._instantiationService.setService(cr,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Pu)),this._instantiationService.setService(dm,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(tr)),this._instantiationService.setService(Rb,this.unicodeService),this._charsetService=this._instantiationService.createInstance($C),this._instantiationService.setService(Db,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Wu),this._instantiationService.setService(_m,this._oscLinkService),this._inputHandler=this._register(new n2(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Ct.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Ct.forward(this._bufferService.onResize,this._onResize)),this._register(Ct.forward(this.coreService.onData,this._onData)),this._register(Ct.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new o2((i,n)=>this._inputHandler.parse(i,n))),this._register(Ct.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new Z),this._onScroll.event(e=>{var i;(i=this._onScrollApi)==null||i.fire(e.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(e){for(let i in e)this.optionsService.options[i]=e[i]}write(e,i){this._writeBuffer.write(e,i)}writeSync(e,i){this._logService.logLevel<=3&&!Bp&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Bp=!0),this._writeBuffer.writeSync(e,i)}input(e,i=!0){this.coreService.triggerDataEvent(e,i)}resize(e,i){isNaN(e)||isNaN(i)||(e=Math.max(e,Xm),i=Math.max(i,Gm),this._bufferService.resize(e,i))}scroll(e,i=!1){this._bufferService.scroll(e,i)}scrollLines(e,i){this._bufferService.scrollLines(e,i)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}registerEscHandler(e,i){return this._inputHandler.registerEscHandler(e,i)}registerDcsHandler(e,i){return this._inputHandler.registerDcsHandler(e,i)}registerCsiHandler(e,i){return this._inputHandler.registerCsiHandler(e,i)}registerOscHandler(e,i){return this._inputHandler.registerOscHandler(e,i)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,i=this.optionsService.rawOptions.windowsPty;i&&i.buildNumber!==void 0&&i.buildNumber!==void 0?e=i.backend==="conpty"&&i.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(Cp.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(Cp(this._bufferService),!1))),this._windowsWrappingHeuristics.value=qe(()=>{for(let i of e)i.dispose()})}}},c2={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:["'",'"']};function u2(e,i,n,l){var d;let o={type:0,cancel:!1,key:void 0},c=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?i?o.key=K.ESC+"OA":o.key=K.ESC+"[A":e.key==="UIKeyInputLeftArrow"?i?o.key=K.ESC+"OD":o.key=K.ESC+"[D":e.key==="UIKeyInputRightArrow"?i?o.key=K.ESC+"OC":o.key=K.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(i?o.key=K.ESC+"OB":o.key=K.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":K.DEL,e.altKey&&(o.key=K.ESC+o.key);break;case 9:if(e.shiftKey){o.key=K.ESC+"[Z";break}o.key=K.HT,o.cancel=!0;break;case 13:o.key=e.altKey?K.ESC+K.CR:K.CR,o.cancel=!0;break;case 27:o.key=K.ESC,e.altKey&&(o.key=K.ESC+K.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;c?o.key=K.ESC+"[1;"+(c+1)+"D":i?o.key=K.ESC+"OD":o.key=K.ESC+"[D";break;case 39:if(e.metaKey)break;c?o.key=K.ESC+"[1;"+(c+1)+"C":i?o.key=K.ESC+"OC":o.key=K.ESC+"[C";break;case 38:if(e.metaKey)break;c?o.key=K.ESC+"[1;"+(c+1)+"A":i?o.key=K.ESC+"OA":o.key=K.ESC+"[A";break;case 40:if(e.metaKey)break;c?o.key=K.ESC+"[1;"+(c+1)+"B":i?o.key=K.ESC+"OB":o.key=K.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(o.key=K.ESC+"[2~");break;case 46:c?o.key=K.ESC+"[3;"+(c+1)+"~":o.key=K.ESC+"[3~";break;case 36:c?o.key=K.ESC+"[1;"+(c+1)+"H":i?o.key=K.ESC+"OH":o.key=K.ESC+"[H";break;case 35:c?o.key=K.ESC+"[1;"+(c+1)+"F":i?o.key=K.ESC+"OF":o.key=K.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=K.ESC+"[5;"+(c+1)+"~":o.key=K.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=K.ESC+"[6;"+(c+1)+"~":o.key=K.ESC+"[6~";break;case 112:c?o.key=K.ESC+"[1;"+(c+1)+"P":o.key=K.ESC+"OP";break;case 113:c?o.key=K.ESC+"[1;"+(c+1)+"Q":o.key=K.ESC+"OQ";break;case 114:c?o.key=K.ESC+"[1;"+(c+1)+"R":o.key=K.ESC+"OR";break;case 115:c?o.key=K.ESC+"[1;"+(c+1)+"S":o.key=K.ESC+"OS";break;case 116:c?o.key=K.ESC+"[15;"+(c+1)+"~":o.key=K.ESC+"[15~";break;case 117:c?o.key=K.ESC+"[17;"+(c+1)+"~":o.key=K.ESC+"[17~";break;case 118:c?o.key=K.ESC+"[18;"+(c+1)+"~":o.key=K.ESC+"[18~";break;case 119:c?o.key=K.ESC+"[19;"+(c+1)+"~":o.key=K.ESC+"[19~";break;case 120:c?o.key=K.ESC+"[20;"+(c+1)+"~":o.key=K.ESC+"[20~";break;case 121:c?o.key=K.ESC+"[21;"+(c+1)+"~":o.key=K.ESC+"[21~";break;case 122:c?o.key=K.ESC+"[23;"+(c+1)+"~":o.key=K.ESC+"[23~";break;case 123:c?o.key=K.ESC+"[24;"+(c+1)+"~":o.key=K.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?o.key=K.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=K.DEL:e.keyCode===219?o.key=K.ESC:e.keyCode===220?o.key=K.FS:e.keyCode===221&&(o.key=K.GS);else if((!n||l)&&e.altKey&&!e.metaKey){let _=(d=c2[e.keyCode])==null?void 0:d[e.shiftKey?1:0];if(_)o.key=K.ESC+_;else if(e.keyCode>=65&&e.keyCode<=90){let v=e.ctrlKey?e.keyCode-64:e.keyCode+32,f=String.fromCharCode(v);e.shiftKey&&(f=f.toUpperCase()),o.key=K.ESC+f}else if(e.keyCode===32)o.key=K.ESC+(e.ctrlKey?K.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let v=e.code.slice(3,4);e.shiftKey||(v=v.toLowerCase()),o.key=K.ESC+v,o.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(o.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?o.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(o.key=K.US),e.key==="@"&&(o.key=K.NUL));break}return o}var Ze=0,d2=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new go,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new go,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((o,c)=>this._getKey(o)-this._getKey(c)),i=0,n=0,l=new Array(this._array.length+this._insertedValues.length);for(let o=0;o<l.length;o++)n>=this._array.length||this._getKey(e[i])<=this._getKey(this._array[n])?(l[o]=e[i],i++):l[o]=this._array[n++];this._array=l,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let i=this._getKey(e);if(i===void 0||(Ze=this._search(i),Ze===-1)||this._getKey(this._array[Ze])!==i)return!1;do if(this._array[Ze]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Ze),!0;while(++Ze<this._array.length&&this._getKey(this._array[Ze])===i);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((o,c)=>o-c),i=0,n=new Array(this._array.length-e.length),l=0;for(let o=0;o<this._array.length;o++)e[i]===o?i++:n[l++]=this._array[o];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Ze=this._search(e),!(Ze<0||Ze>=this._array.length)&&this._getKey(this._array[Ze])===e))do yield this._array[Ze];while(++Ze<this._array.length&&this._getKey(this._array[Ze])===e)}forEachByKey(e,i){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Ze=this._search(e),!(Ze<0||Ze>=this._array.length)&&this._getKey(this._array[Ze])===e))do i(this._array[Ze]);while(++Ze<this._array.length&&this._getKey(this._array[Ze])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let i=0,n=this._array.length-1;for(;n>=i;){let l=i+n>>1,o=this._getKey(this._array[l]);if(o>e)n=l-1;else if(o<e)i=l+1;else{for(;l>0&&this._getKey(this._array[l-1])===e;)l--;return l}}return i}},Jc=0,zp=0,f2=class extends Se{constructor(){super(),this._decorations=new d2(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new Z),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new Z),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(qe(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let i=new _2(e);if(i){let n=i.marker.onDispose(()=>i.dispose()),l=i.onDispose(()=>{l.dispose(),i&&(this._decorations.delete(i)&&this._onDecorationRemoved.fire(i),n.dispose())});this._decorations.insert(i),this._onDecorationRegistered.fire(i)}return i}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,i,n){let l=0,o=0;for(let c of this._decorations.getKeyIterator(i))l=c.options.x??0,o=l+(c.options.width??1),e>=l&&e<o&&(!n||(c.options.layer??"bottom")===n)&&(yield c)}forEachDecorationAtCell(e,i,n,l){this._decorations.forEachByKey(i,o=>{Jc=o.options.x??0,zp=Jc+(o.options.width??1),e>=Jc&&e<zp&&(!n||(o.options.layer??"bottom")===n)&&l(o)})}},_2=class extends As{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new Z),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new Z),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Ke.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Ke.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},v2=1e3,g2=class{constructor(e,i=v2){this._renderCallback=e,this._debounceThresholdMS=i,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i;let l=performance.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){let o=l-this._lastRefreshMs,c=this._debounceThresholdMS-o;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},c)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i)}},Op=20,po=class extends Se{constructor(e,i,n,l){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=l,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let o=this._coreBrowserService.mainDocument;this._accessibilityContainer=o.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=o.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._handleBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._handleBoundaryFocus(c,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=o.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new g2(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(c=>this._handleResize(c.rows))),this._register(this._terminal.onRender(c=>this._refreshRows(c.start,c.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(c=>this._handleChar(c))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
188
|
-
`))),this._register(this._terminal.onA11yTab(c=>this._handleTab(c))),this._register(this._terminal.onKey(c=>this._handleKey(c.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(de(o,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(qe(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let i=0;i<e;i++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Op+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
189
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Op+1&&(this._liveRegion.textContent+=ou.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,i){this._liveRegionDebouncer.refresh(e,i,this._terminal.rows)}_renderRows(e,i){let n=this._terminal.buffer,l=n.lines.length.toString();for(let o=e;o<=i;o++){let c=n.lines.get(n.ydisp+o),d=[],_=(c==null?void 0:c.translateToString(!0,void 0,void 0,d))||"",v=(n.ydisp+o+1).toString(),f=this._rowElements[o];f&&(_.length===0?(f.textContent=" ",this._rowColumns.set(f,[0,1])):(f.textContent=_,this._rowColumns.set(f,d)),f.setAttribute("aria-posinset",v),f.setAttribute("aria-setsize",l),this._alignRowWidth(f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,i){let n=e.target,l=this._rowElements[i===0?1:this._rowElements.length-2],o=n.getAttribute("aria-posinset"),c=i===0?"1":`${this._terminal.buffer.lines.length}`;if(o===c||e.relatedTarget!==l)return;let d,_;if(i===0?(d=n,_=this._rowElements.pop(),this._rowContainer.removeChild(_)):(d=this._rowElements.shift(),_=n,this._rowContainer.removeChild(d)),d.removeEventListener("focus",this._topBoundaryFocusListener),_.removeEventListener("focus",this._bottomBoundaryFocusListener),i===0){let v=this._createAccessibilityTreeNode();this._rowElements.unshift(v),this._rowContainer.insertAdjacentElement("afterbegin",v)}else{let 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(i===0?-1:1),this._rowElements[i===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var _;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let i={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((i.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||i.node===n.node&&i.offset>n.offset)&&([i,n]=[n,i]),i.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(i={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(i.node))return;let l=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(l)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:l,offset:((_=l.textContent)==null?void 0:_.length)??0}),!this._rowContainer.contains(n.node))return;let o=({node:v,offset:f})=>{let m=v instanceof Text?v.parentNode:v,S=parseInt(m==null?void 0:m.getAttribute("aria-posinset"),10)-1;if(isNaN(S))return console.warn("row is invalid. Race condition?"),null;let y=this._rowColumns.get(m);if(!y)return console.warn("columns is null. Race condition?"),null;let M=f<y.length?y[f]:y.slice(-1)[0]+1;return M>=this._terminal.cols&&(++S,M=0),{row:S,column:M}},c=o(i),d=o(n);if(!(!c||!d)){if(c.row>d.row||c.row===d.row&&c.column>=d.column)throw new Error("invalid range");this._terminal.select(c.column,c.row,(d.row-c.row)*this._terminal.cols-c.column+d.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let i=this._rowContainer.children.length;i<this._terminal.rows;i++)this._rowElements[i]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[i]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var o,c;e.style.transform="";let i=e.getBoundingClientRect().width,n=(c=(o=this._rowColumns.get(e))==null?void 0:o.slice(-1))==null?void 0:c[0];if(!n)return;let l=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${l/i})`}};po=$e([te(1,Ju),te(2,Zi),te(3,Qi)],po);var Yu=class extends Se{constructor(e,i,n,l,o){super(),this._element=e,this._mouseService=i,this._renderService=n,this._bufferService=l,this._linkProviderService=o,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new Z),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new Z),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(qe(()=>{var c;lr(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(c=this._activeProviderReplies)==null||c.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(de(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(de(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(de(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(de(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let i=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;let n=e.composedPath();for(let l=0;l<n.length;l++){let o=n[l];if(o.classList.contains("xterm"))break;if(o.classList.contains("xterm-hover"))return}(!this._lastBufferCell||i.x!==this._lastBufferCell.x||i.y!==this._lastBufferCell.y)&&(this._handleHover(i),this._lastBufferCell=i)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,i){var l,o;(!this._activeProviderReplies||!i)&&((l=this._activeProviderReplies)==null||l.forEach(c=>{c==null||c.forEach(d=>{d.link.dispose&&d.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[c,d]of this._linkProviderService.linkProviders.entries())i?(o=this._activeProviderReplies)!=null&&o.get(c)&&(n=this._checkLinkProviderResult(c,e,n)):d.provideLinks(e.y,_=>{var f,m;if(this._isMouseOut)return;let v=_==null?void 0:_.map(S=>({link:S}));(f=this._activeProviderReplies)==null||f.set(c,v),n=this._checkLinkProviderResult(c,e,n),((m=this._activeProviderReplies)==null?void 0:m.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,i){let n=new Set;for(let l=0;l<i.size;l++){let o=i.get(l);if(o)for(let c=0;c<o.length;c++){let d=o[c],_=d.link.range.start.y<e?0:d.link.range.start.x,v=d.link.range.end.y>e?this._bufferService.cols:d.link.range.end.x;for(let f=_;f<=v;f++){if(n.has(f)){o.splice(c--,1);break}n.add(f)}}}}_checkLinkProviderResult(e,i,n){var c;if(!this._activeProviderReplies)return n;let l=this._activeProviderReplies.get(e),o=!1;for(let d=0;d<e;d++)(!this._activeProviderReplies.has(d)||this._activeProviderReplies.get(d))&&(o=!0);if(!o&&l){let d=l.find(_=>this._linkAtPosition(_.link,i));d&&(n=!0,this._handleNewLink(d))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let d=0;d<this._activeProviderReplies.size;d++){let _=(c=this._activeProviderReplies.get(d))==null?void 0:c.find(v=>this._linkAtPosition(v.link,i));if(_){n=!0,this._handleNewLink(_);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let i=this._positionFromMouseEvent(e,this._element,this._mouseService);i&&this._mouseDownLink&&p2(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,i)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,i){!this._currentLink||!this._lastMouseEvent||(!e||!i||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,lr(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(e.link,i)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var n,l;return(l=(n=this._currentLink)==null?void 0:n.state)==null?void 0:l.decorations.pointerCursor},set:n=>{var l;(l=this._currentLink)!=null&&l.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,l;return(l=(n=this._currentLink)==null?void 0:n.state)==null?void 0:l.decorations.underline},set:n=>{var l,o,c;(l=this._currentLink)!=null&&l.state&&((c=(o=this._currentLink)==null?void 0:o.state)==null?void 0:c.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;let l=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(l,o),this._lastMouseEvent)){let c=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);c&&this._askForLink(c,!1)}})))}_linkHover(e,i,n){var l;(l=this._currentLink)!=null&&l.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(n,i.text)}_fireUnderlineEvent(e,i){let n=e.range,l=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-l-1,n.end.x,n.end.y-l-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,i,n){var l;(l=this._currentLink)!=null&&l.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(n,i.text)}_linkAtPosition(e,i){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,l=e.range.end.y*this._bufferService.cols+e.range.end.x,o=i.y*this._bufferService.cols+i.x;return n<=o&&o<=l}_positionFromMouseEvent(e,i,n){let l=n.getCoords(e,i,this._bufferService.cols,this._bufferService.rows);if(l)return{x:l[0],y:l[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,i,n,l,o){return{x1:e,y1:i,x2:n,y2:l,cols:this._bufferService.cols,fg:o}}};Yu=$e([te(1,ed),te(2,Qi),te(3,zt),te(4,gm)],Yu);function p2(e,i){return e.text===i.text&&e.range.start.x===i.range.start.x&&e.range.start.y===i.range.start.y&&e.range.end.x===i.range.end.x&&e.range.end.y===i.range.end.y}var m2=class extends h2{constructor(e={}){super(e),this._linkifier=this._register(new an),this.browser=Lm,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new an),this._onCursorMove=this._register(new Z),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new Z),this.onKey=this._onKey.event,this._onRender=this._register(new Z),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new Z),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new Z),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new Z),this.onBell=this._onBell.event,this._onFocus=this._register(new Z),this._onBlur=this._register(new Z),this._onA11yCharEmitter=this._register(new Z),this._onA11yTabEmitter=this._register(new Z),this._onWillOpen=this._register(new Z),this._setup(),this._decorationService=this._instantiationService.createInstance(f2),this._instantiationService.setService(Rl,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(aC),this._instantiationService.setService(gm,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(cu)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(i=>this.refresh((i==null?void 0:i.start)??0,(i==null?void 0:i.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(i=>this._reportWindowsOptions(i))),this._register(this._inputHandler.onColor(i=>this._handleColorEvent(i))),this._register(Ct.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Ct.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Ct.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Ct.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(i=>this._afterResize(i.cols,i.rows))),this._register(qe(()=>{var i,n;this._customKeyEventHandler=void 0,(n=(i=this.element)==null?void 0:i.parentNode)==null||n.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}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}_handleColorEvent(e){if(this._themeService)for(let i of e){let n,l="";switch(i.index){case 256:n="foreground",l="10";break;case 257:n="background",l="11";break;case 258:n="cursor",l="12";break;default:n="ansi",l="4;"+i.index}switch(i.type){case 0:let o=Pe.toColorRGB(n==="ansi"?this._themeService.colors.ansi[i.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${K.ESC}]${l};${s2(o)}${zm.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(c=>c.ansi[i.index]=it.toColor(...i.color));else{let c=n;this._themeService.modifyColors(d=>d[c]=it.toColor(...i.color))}break;case 2:this._themeService.restoreColor(i.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(po,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,i=this.buffer.lines.get(e);if(!i)return;let n=Math.min(this.buffer.x,this.cols-1),l=this._renderService.dimensions.css.cell.height,o=i.getWidth(n),c=this._renderService.dimensions.css.cell.width*o,d=this.buffer.y*this._renderService.dimensions.css.cell.height,_=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=_+"px",this.textarea.style.top=d+"px",this.textarea.style.width=c+"px",this.textarea.style.height=l+"px",this.textarea.style.lineHeight=l+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(de(this.element,"copy",i=>{this.hasSelection()&&wb(i,this._selectionService)}));let e=i=>Cb(i,this.textarea,this.coreService,this.optionsService);this._register(de(this.textarea,"paste",e)),this._register(de(this.element,"paste",e)),Nm?this._register(de(this.element,"mousedown",i=>{i.button===2&&Kg(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(de(this.element,"contextmenu",i=>{Kg(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),od&&this._register(de(this.element,"auxclick",i=>{i.button===1&&am(i,this.textarea,this.screenElement)}))}_bindKeys(){this._register(de(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(de(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(de(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(de(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(de(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(de(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(de(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var o;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((o=this.element)==null?void 0:o.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.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"),e.appendChild(this.element);let i=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(de(this.screenElement,"mousemove",c=>this.updateCursorStyle(c))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",au.get()),Pm||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._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(nC,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Zi,this._coreBrowserService),this._register(de(this.textarea,"focus",c=>this._handleTextAreaFocus(c))),this._register(de(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Au,this._document,this._helperContainer),this._instantiationService.setService(yo,this._charSizeService),this._themeService=this._instantiationService.createInstance(Lu),this._instantiationService.setService(on,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(_o),this._instantiationService.setService(vm,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(zu,this.rows,this.screenElement)),this._instantiationService.setService(Qi,this._renderService),this._register(this._renderService.onRenderedViewportChange(c=>this._onRender.fire(c))),this.onResize(c=>this._renderService.resize(c.cols,c.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Du,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Bu),this._instantiationService.setService(ed,this._mouseService);let l=this._linkifier.value=this._register(this._instantiationService.createInstance(Yu,this.screenElement));this.element.appendChild(i);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance(ku,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(c=>{super.scrollLines(c,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Ou,this.element,this.screenElement,l)),this._instantiationService.setService(Ab,this._selectionService),this._register(this._selectionService.onRequestScrollLines(c=>this.scrollLines(c.amount,c.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(c=>this._renderService.handleSelectionChanged(c.start,c.end,c.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(c=>{this.textarea.value=c,this.textarea.focus(),this.textarea.select()})),this._register(Ct.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var c;this._selectionService.refresh(),(c=this._viewport)==null||c.queueSync()})),this._register(this._instantiationService.createInstance(Mu,this.screenElement)),this._register(de(this.element,"mousedown",c=>this._selectionService.handleMouseDown(c))),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(po,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",c=>this._handleScreenReaderModeOptionChange(c))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(fo,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",c=>{!this._overviewRulerRenderer&&c&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(fo,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Tu,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i=this.element;function n(c){var f,m,S,y,M;let d=e._mouseService.getMouseReportCoords(c,e.screenElement);if(!d)return!1;let _,v;switch(c.overrideType||c.type){case"mousemove":v=32,c.buttons===void 0?(_=3,c.button!==void 0&&(_=c.button<3?c.button:3)):_=c.buttons&1?0:c.buttons&4?1:c.buttons&2?2:3;break;case"mouseup":v=0,_=c.button<3?c.button:3;break;case"mousedown":v=1,_=c.button<3?c.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(c)===!1)return!1;let C=c.deltaY;if(C===0||e.coreMouseService.consumeWheelEvent(c,(y=(S=(m=(f=e._renderService)==null?void 0:f.dimensions)==null?void 0:m.device)==null?void 0:S.cell)==null?void 0:y.height,(M=e._coreBrowserService)==null?void 0:M.dpr)===0)return!1;v=C<0?0:1,_=4;break;default:return!1}return v===void 0||_===void 0||_>4?!1:e.coreMouseService.triggerMouseEvent({col:d.col,row:d.row,x:d.x,y:d.y,button:_,action:v,ctrl:c.ctrlKey,alt:c.altKey,shift:c.shiftKey})}let l={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o={mouseup:c=>(n(c),c.buttons||(this._document.removeEventListener("mouseup",l.mouseup),l.mousedrag&&this._document.removeEventListener("mousemove",l.mousedrag)),this.cancel(c)),wheel:c=>(n(c),this.cancel(c,!0)),mousedrag:c=>{c.buttons&&n(c)},mousemove:c=>{c.buttons||n(c)}};this._register(this.coreMouseService.onProtocolChange(c=>{c?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(c)),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()),c&8?l.mousemove||(i.addEventListener("mousemove",o.mousemove),l.mousemove=o.mousemove):(i.removeEventListener("mousemove",l.mousemove),l.mousemove=null),c&16?l.wheel||(i.addEventListener("wheel",o.wheel,{passive:!1}),l.wheel=o.wheel):(i.removeEventListener("wheel",l.wheel),l.wheel=null),c&2?l.mouseup||(l.mouseup=o.mouseup):(this._document.removeEventListener("mouseup",l.mouseup),l.mouseup=null),c&4?l.mousedrag||(l.mousedrag=o.mousedrag):(this._document.removeEventListener("mousemove",l.mousedrag),l.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(de(i,"mousedown",c=>{if(c.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(c)))return n(c),l.mouseup&&this._document.addEventListener("mouseup",l.mouseup),l.mousedrag&&this._document.addEventListener("mousemove",l.mousedrag),this.cancel(c)})),this._register(de(i,"wheel",c=>{var d,_,v,f,m;if(!l.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(c)===!1)return!1;if(!this.buffer.hasScrollback){if(c.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(c,(f=(v=(_=(d=e._renderService)==null?void 0:d.dimensions)==null?void 0:_.device)==null?void 0:v.cell)==null?void 0:f.height,(m=e._coreBrowserService)==null?void 0:m.dpr)===0)return this.cancel(c,!0);let S=K.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(c.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(S,!0),this.cancel(c,!0)}}},{passive:!1}))}refresh(e,i){var n;(n=this._renderService)==null||n.refreshRows(e,i)}updateCursorStyle(e){var i;(i=this._selectionService)!=null&&i.shouldColumnSelect(e)?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(e,i){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,i),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}paste(e){lm(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let i=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),i}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,i,n){this._selectionService.setSelection(e,i,n)}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 e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,i){var n;(n=this._selectionService)==null||n.selectLines(e,i)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let i=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!i&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!i&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=u2(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let l=this.rows-1;return this.scrollLines(n.type===2?-l:l),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===K.ETX||n.key===K.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,i){let n=e.isMac&&!this.options.macOptionIsMeta&&i.altKey&&!i.ctrlKey&&!i.metaKey||e.isWindows&&i.altKey&&i.ctrlKey&&!i.metaKey||e.isWindows&&i.getModifierState("AltGraph");return i.type==="keypress"?n:n&&(!i.keyCode||i.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(S2(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let i;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)i=e.charCode;else if(e.which===null||e.which===void 0)i=e.keyCode;else if(e.which!==0&&e.charCode!==0)i=e.which;else return!1;return!i||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(i=String.fromCharCode(i),this._onKey.fire({key:i,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let i=e.data;return this.coreService.triggerDataEvent(i,!0),this.cancel(e),!0}return!1}resize(e,i){if(e===this.cols&&i===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,i)}_afterResize(e,i){var n;(n=this._charSizeService)==null||n.measure()}clear(){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 e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(tt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var i;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(i=this._selectionService)==null||i.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(K.ESC+"[I"):this.coreService.triggerDataEvent(K.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let i=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.ESC}[4;${n};${i}t`);break;case 1:let l=this._renderService.dimensions.css.cell.width.toFixed(0),o=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.ESC}[6;${o};${l}t`);break}}cancel(e,i){if(!(!this.options.cancelEvents&&!i))return e.preventDefault(),e.stopPropagation(),!1}};function S2(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var y2=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,i){let n={instance:i,dispose:i.dispose,isDisposed:!1};this._addons.push(n),i.dispose=()=>this._wrappedAddonDispose(n),i.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let i=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){i=n;break}if(i===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(i,1)}},b2=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,i){if(!(e<0||e>=this._line.length))return i?(this._line.loadCell(e,i),i):this._line.loadCell(e,new di)}translateToString(e,i,n){return this._line.translateToString(e,i,n)}},Lp=class{constructor(e,i){this._buffer=e,this.type=i}init(e){return this._buffer=e,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(e){let i=this._buffer.lines.get(e);if(i)return new b2(i)}getNullCell(){return new di}},w2=class extends Se{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new Z),this.onBufferChange=this._onBufferChange.event,this._normal=new Lp(this._core.buffers.normal,"normal"),this._alternate=new Lp(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)}},C2=class{constructor(e){this._core=e}registerCsiHandler(e,i){return this._core.registerCsiHandler(e,n=>i(n.toArray()))}addCsiHandler(e,i){return this.registerCsiHandler(e,i)}registerDcsHandler(e,i){return this._core.registerDcsHandler(e,(n,l)=>i(n,l.toArray()))}addDcsHandler(e,i){return this.registerDcsHandler(e,i)}registerEscHandler(e,i){return this._core.registerEscHandler(e,i)}addEscHandler(e,i){return this.registerEscHandler(e,i)}registerOscHandler(e,i){return this._core.registerOscHandler(e,i)}addOscHandler(e,i){return this.registerOscHandler(e,i)}},x2=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},E2=["cols","rows"],ki=0,k2=class extends Se{constructor(e){super(),this._core=this._register(new m2(e)),this._addonManager=this._register(new y2),this._publicOptions={...this._core.options};let i=l=>this._core.options[l],n=(l,o)=>{this._checkReadonlyOptions(l),this._core.options[l]=o};for(let l in this._core.options){let o={get:i.bind(this,l),set:n.bind(this,l)};Object.defineProperty(this._publicOptions,l,o)}}_checkReadonlyOptions(e){if(E2.includes(e))throw new Error(`Option "${e}" 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 C2(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x2(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 w2(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,i="none";switch(this._core.coreMouseService.activeProtocol){case"X10":i="x10";break;case"VT200":i="vt200";break;case"DRAG":i="drag";break;case"ANY":i="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:i,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let i in e)this._publicOptions[i]=e[i]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,i=!0){this._core.input(e,i)}resize(e,i){this._verifyIntegers(e,i),this._core.resize(e,i)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,i,n){this._verifyIntegers(e,i,n),this._core.select(e,i,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,i){this._verifyIntegers(e,i),this._core.selectLines(e,i)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,i){this._core.write(e,i)}writeln(e,i){this._core.write(e),this._core.write(`\r
|
|
190
|
-
`,i)}paste(e){this._core.paste(e)}refresh(e,i){this._verifyIntegers(e,i),this._core.refresh(e,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return au.get()},set promptLabel(e){au.set(e)},get tooMuchOutput(){return ou.get()},set tooMuchOutput(e){ou.set(e)}}}_verifyIntegers(...e){for(ki of e)if(ki===1/0||isNaN(ki)||ki%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(ki of e)if(ki&&(ki===1/0||isNaN(ki)||ki%1!==0||ki<0))throw new Error("This API only accepts positive integers")}};/**
|
|
191
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
192
|
-
* @license MIT
|
|
193
|
-
*
|
|
194
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
195
|
-
* @license MIT
|
|
196
|
-
*
|
|
197
|
-
* Originally forked from (with the author's permission):
|
|
198
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
199
|
-
* http://bellard.org/jslinux/
|
|
200
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
201
|
-
*/var M2=2,D2=1,R2=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let i=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(i._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var S;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let i=this._terminal.options.scrollback===0?0:((S=this._terminal.options.overviewRuler)==null?void 0:S.width)||14,n=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(n.getPropertyValue("height")),o=Math.max(0,parseInt(n.getPropertyValue("width"))),c=window.getComputedStyle(this._terminal.element),d={top:parseInt(c.getPropertyValue("padding-top")),bottom:parseInt(c.getPropertyValue("padding-bottom")),right:parseInt(c.getPropertyValue("padding-right")),left:parseInt(c.getPropertyValue("padding-left"))},_=d.top+d.bottom,v=d.right+d.left,f=l-_,m=o-v-i;return{cols:Math.max(M2,Math.floor(m/e.css.cell.width)),rows:Math.max(D2,Math.floor(f/e.css.cell.height))}}};/**
|
|
202
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
203
|
-
* @license MIT
|
|
204
|
-
*
|
|
205
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
206
|
-
* @license MIT
|
|
207
|
-
*
|
|
208
|
-
* Originally forked from (with the author's permission):
|
|
209
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
210
|
-
* http://bellard.org/jslinux/
|
|
211
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
212
|
-
*/var T2=class{constructor(e,i,n,l={}){this._terminal=e,this._regex=i,this._handler=n,this._options=l}provideLinks(e,i){let n=B2.computeLink(e,this._regex,this._terminal,this._handler);i(this._addCallbacks(n))}_addCallbacks(e){return e.map(i=>(i.leave=this._options.leave,i.hover=(n,l)=>{if(this._options.hover){let{range:o}=i;this._options.hover(n,l,o)}},i))}};function A2(e){try{let i=new URL(e),n=i.password&&i.username?`${i.protocol}//${i.username}:${i.password}@${i.host}`:i.username?`${i.protocol}//${i.username}@${i.host}`:`${i.protocol}//${i.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var B2=class co{static computeLink(i,n,l,o){let c=new RegExp(n.source,(n.flags||"")+"g"),[d,_]=co._getWindowedLineStrings(i-1,l),v=d.join(""),f,m=[];for(;f=c.exec(v);){let S=f[0];if(!A2(S))continue;let[y,M]=co._mapStrIdx(l,_,0,f.index),[C,E]=co._mapStrIdx(l,y,M,S.length);if(y===-1||M===-1||C===-1||E===-1)continue;let B={start:{x:M+1,y:y+1},end:{x:E,y:C+1}};m.push({range:B,text:S,activate:o})}return m}static _getWindowedLineStrings(i,n){let l,o=i,c=i,d=0,_="",v=[];if(l=n.buffer.active.getLine(i)){let f=l.translateToString(!0);if(l.isWrapped&&f[0]!==" "){for(d=0;(l=n.buffer.active.getLine(--o))&&d<2048&&(_=l.translateToString(!0),d+=_.length,v.push(_),!(!l.isWrapped||_.indexOf(" ")!==-1)););v.reverse()}for(v.push(f),d=0;(l=n.buffer.active.getLine(++c))&&l.isWrapped&&d<2048&&(_=l.translateToString(!0),d+=_.length,v.push(_),_.indexOf(" ")===-1););}return[v,o]}static _mapStrIdx(i,n,l,o){let c=i.buffer.active,d=c.getNullCell(),_=l;for(;o;){let v=c.getLine(n);if(!v)return[-1,-1];for(let f=_;f<v.length;++f){v.getCell(f,d);let m=d.getChars();if(d.getWidth()&&(o-=m.length||1,f===v.length-1&&m==="")){let S=c.getLine(n+1);S&&S.isWrapped&&(S.getCell(0,d),d.getWidth()===2&&(o+=1))}if(o<0)return[n,f]}n++,_=0}return[n,_]}},z2=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function O2(e,i){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}var L2=class{constructor(e=O2,i={}){this._handler=e,this._options=i}activate(e){this._terminal=e;let i=this._options,n=i.urlRegex||z2;this._linkProvider=this._terminal.registerLinkProvider(new T2(this._terminal,n,this._handler,i))}dispose(){var e;(e=this._linkProvider)==null||e.dispose()}};let Mt=null;const en=mo((e,i)=>({connected:!1,connectedSession:null,onMessage:null,connect:n=>{Mt&&(Mt.close(),Mt=null);const o=`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/ws/terminal/${encodeURIComponent(n)}`,c=new WebSocket(o);Mt=c,c.binaryType="arraybuffer",c.onopen=()=>{e({connected:!0,connectedSession:n})},c.onmessage=d=>{const _=i().onMessage;if(_)if(d.data instanceof ArrayBuffer)_(d.data);else try{const v=JSON.parse(d.data);v.type==="replay"?_(v.data):v.type==="error"&&console.error("[ws]",v.message)}catch{_(d.data)}},c.onclose=()=>{e({connected:!1,connectedSession:null}),Mt=null},c.onerror=()=>{c.close()}},disconnect:()=>{Mt&&(Mt.close(),Mt=null),e({connected:!1,connectedSession:null})},send:n=>{(Mt==null?void 0:Mt.readyState)===WebSocket.OPEN&&Mt.send(n)},resize:(n,l)=>{(Mt==null?void 0:Mt.readyState)===WebSocket.OPEN&&Mt.send(JSON.stringify({type:"resize",cols:n,rows:l}))},setOnMessage:n=>{e({onMessage:n})}}));function io(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}function N2(e,i){const n=fe.useRef(null),l=fe.useRef(null);fe.useEffect(()=>{const o=i.current;if(!o)return;const c=new k2({fontFamily:io("--font-mono")||"'JetBrains Mono', monospace",fontSize:14,theme:{background:io("--color-terminal-bg")||"#0D1117",foreground:io("--color-terminal-text")||"#E6EDF3",cursor:io("--color-terminal-text")||"#E6EDF3",selectionBackground:"rgba(91,107,255,0.3)"},cursorBlink:!0,allowProposedApi:!0}),d=new R2;c.loadAddon(d),c.loadAddon(new L2),c.open(o),d.fit(),c.focus(),o.addEventListener("click",()=>c.focus()),n.current=c,l.current=d,en.getState().setOnMessage(m=>{typeof m=="string"?c.write(m):c.write(new Uint8Array(m))});const _=/\x1b\[[\x3c-\x3f]?[\d;]*[cRn]|\x1bP[^\x1b]*\x1b\\/g,v=c.onData(m=>{const S=m.replace(_,"");S&&en.getState().send(S)});en.getState().connect(e);const f=new ResizeObserver(()=>{d.fit();const{cols:m,rows:S}=c;en.getState().resize(m,S)});return f.observe(o),()=>{f.disconnect(),v.dispose(),en.getState().setOnMessage(null),en.getState().disconnect(),c.dispose(),n.current=null,l.current=null}},[e,i])}function eu({sessionName:e}){const i=fe.useRef(null);return N2(e,i),O.jsx("div",{className:"flex h-full min-h-0 w-full flex-1 flex-col bg-terminal-bg p-3",children:O.jsx("div",{ref:i,className:"min-h-0 flex-1"})})}function tu({sessionName:e,url:i}){const[n,l]=fe.useState(""),[o,c]=fe.useState(!1),d=Rt(m=>m.fetchMeta),_=fi(m=>m.previewViewport);async function v(m){m.preventDefault();const S=n.trim();if(S){c(!0);try{await fetch(`/api/sessions/${encodeURIComponent(e)}/meta`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({previewUrl:S})}),await d(e),l("")}finally{c(!1)}}}if(!i)return O.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-4 bg-sidebar dark:bg-bg-dark",children:[O.jsx(Ky,{size:32,className:"text-text-secondary/40"}),O.jsx("p",{className:"text-sm text-text-secondary",children:"No preview URL set"}),O.jsxs("p",{className:"text-xs text-text-secondary/60",children:["Run ",O.jsxs("code",{className:"rounded bg-divider px-1.5 py-0.5 font-mono dark:bg-divider-dark",children:["unloved ",e," url <url>"]})," to set one"]}),O.jsxs("form",{onSubmit:v,className:"flex w-72 gap-2",children:[O.jsx("input",{type:"url",value:n,onChange:m=>l(m.target.value),placeholder:"https://localhost:3000",className:"flex-1 rounded-lg border border-divider bg-bg px-3 py-1.5 text-sm text-text outline-none focus:border-accent dark:border-divider-dark dark:bg-bg-dark dark:text-text-dark"}),O.jsx("button",{type:"submit",disabled:o||!n.trim(),className:"rounded-lg bg-accent px-3 py-1.5 text-sm text-white transition-opacity disabled:opacity-50",children:"Set"})]})]});if(_==="default")return O.jsx("iframe",{src:i,title:"Preview",className:"h-full w-full border-0"});const f=Ay[_];return O.jsx("div",{className:"flex h-full w-full items-center justify-center overflow-auto bg-sidebar dark:bg-bg-dark",children:O.jsx("iframe",{src:i,title:"Preview",className:"shrink-0 border border-divider dark:border-divider-dark",style:{width:f.w,height:f.h}})})}const Np="unloved_split_v",Hp="unloved_split_h";function Up(e,i){const n=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));if(!n)return i;try{const l=JSON.parse(decodeURIComponent(n[1]));if(Array.isArray(l)&&l.every(o=>typeof o=="number"))return l}catch{}return i}function Pp(e,i){const n=Object.values(i);document.cookie=`${e}=${encodeURIComponent(JSON.stringify(n))};path=/;max-age=31536000;SameSite=Lax`}function H2(){return O.jsx("div",{className:"flex h-full items-center justify-center",children:O.jsx("div",{className:"h-8 w-1 rounded-full bg-text-secondary/30"})})}function U2(){return O.jsx("div",{className:"flex w-full items-center justify-center",children:O.jsx("div",{className:"h-1 w-8 rounded-full bg-text-secondary/30"})})}function P2({sessionName:e}){const i=Rt(v=>v.sessionMetas),n=fi(v=>v.viewMode),l=i[e],o=l==null?void 0:l.previewUrl,c=fe.useCallback(v=>{Pp(Np,v)},[]),d=fe.useCallback(v=>{Pp(Hp,v)},[]);if(n==="preview")return O.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:O.jsx(tu,{sessionName:e,url:o})});if(n==="terminal")return O.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:O.jsx(eu,{sessionName:e})});if(n==="side-by-side"){const v=Up(Hp,[50,50]);return O.jsxs(nu,{orientation:"horizontal",className:"min-h-0 flex-1",onLayoutChanged:d,children:[O.jsx(gl,{defaultSize:`${v[0]}%`,minSize:"20%",children:O.jsx(eu,{sessionName:e})}),O.jsx(lu,{className:"w-1.5 bg-divider transition-colors hover:bg-accent dark:bg-divider-dark dark:hover:bg-accent-dark",children:O.jsx(H2,{})}),O.jsx(gl,{defaultSize:`${v[1]}%`,minSize:"20%",children:O.jsx(tu,{sessionName:e,url:o})})]})}const _=Up(Np,[60,40]);return O.jsxs(nu,{orientation:"vertical",className:"min-h-0 flex-1",onLayoutChanged:c,children:[O.jsx(gl,{defaultSize:`${_[0]}%`,minSize:"20%",children:O.jsx(eu,{sessionName:e})}),O.jsx(lu,{className:"h-1.5 bg-divider transition-colors hover:bg-accent dark:bg-divider-dark dark:hover:bg-accent-dark",children:O.jsx(U2,{})}),O.jsx(gl,{defaultSize:`${_[1]}%`,minSize:"15%",children:O.jsx(tu,{sessionName:e,url:o})})]})}function j2(){const e=Rt(i=>i.activeSessionName);return e?O.jsx(P2,{sessionName:e}):O.jsxs("div",{className:"relative flex min-h-0 flex-1 items-center justify-center overflow-hidden",children:[O.jsx(U1,{}),O.jsx(H1,{})]})}function q2(){return O.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[O.jsx(N1,{}),O.jsx(j2,{})]})}function W2(){const e=fi(n=>n.sidebarOpen),i=fi(n=>n.closeSidebar);return O.jsxs("div",{className:"flex h-dvh w-dvw overflow-hidden bg-bg dark:bg-bg-dark",children:[O.jsx("div",{className:"hidden shrink-0 overflow-hidden transition-[width] duration-300 ease-in-out md:block",style:{width:e?"var(--sidebar-width)":"0px"},children:O.jsx(Eg,{})}),e&&O.jsxs("div",{className:"fixed inset-0 z-40 flex md:hidden",children:[O.jsx("div",{className:"h-full w-[var(--sidebar-width)] shrink-0",children:O.jsx(Eg,{})}),O.jsx("button",{type:"button",className:"flex-1 cursor-default bg-black/40 backdrop-blur-sm",onClick:i,"aria-label":"Close sidebar"})]}),O.jsx(q2,{})]})}function Y2(){const e=iu(n=>n.hydrate),i=Rt(n=>n.startPolling);return fe.useEffect(()=>(e(),i()),[e,i]),O.jsx(W2,{})}My.createRoot(document.getElementById("root")).render(O.jsx(Y2,{}));
|