deskssh 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -55
- package/bin/deskssh.js +36 -0
- package/dist/server.js +851 -0
- package/dist/web/assets/index-Bf6XF_tt.css +32 -0
- package/dist/web/assets/index-D17lV7-E.js +234 -0
- package/{packages/web/dist → dist/web}/index.html +3 -2
- package/package.json +34 -38
- package/.eslintrc.cjs +0 -21
- package/.github/workflows/ci.yml +0 -40
- package/.prettierignore +0 -5
- package/.prettierrc.json +0 -6
- package/CONTRIBUTING.md +0 -59
- package/LICENSE +0 -661
- package/packages/cli/README.md +0 -11
- package/packages/cli/bin/deskssh.js +0 -12
- package/packages/cli/package.json +0 -37
- package/packages/core/dist/index.d.ts +0 -2
- package/packages/core/dist/index.d.ts.map +0 -1
- package/packages/core/dist/index.js +0 -6
- package/packages/core/dist/index.js.map +0 -1
- package/packages/core/package.json +0 -22
- package/packages/core/src/index.test.ts +0 -8
- package/packages/core/src/index.ts +0 -6
- package/packages/core/tsconfig.json +0 -9
- package/packages/server/dist/index.d.ts +0 -3
- package/packages/server/dist/index.d.ts.map +0 -1
- package/packages/server/dist/index.js +0 -7
- package/packages/server/dist/index.js.map +0 -1
- package/packages/server/package.json +0 -19
- package/packages/server/src/index.ts +0 -8
- package/packages/server/tsconfig.json +0 -10
- package/packages/web/dist/assets/index-DNUNZ8WK.js +0 -65
- package/packages/web/index.html +0 -12
- package/packages/web/node_modules/.bin/browserslist +0 -17
- package/packages/web/node_modules/.bin/vite +0 -17
- package/packages/web/package.json +0 -27
- package/packages/web/src/App.tsx +0 -17
- package/packages/web/src/i18n/en.ts +0 -8
- package/packages/web/src/i18n/es.ts +0 -7
- package/packages/web/src/i18n/index.ts +0 -27
- package/packages/web/src/main.tsx +0 -12
- package/packages/web/tsconfig.json +0 -14
- package/packages/web/vite.config.ts +0 -6
- package/pnpm-workspace.yaml +0 -2
- package/specs/001-core/plan.md +0 -246
- package/specs/001-core/spec.md +0 -206
- package/specs/001-core/tasks.md +0 -110
- package/specs/constitution.md +0 -110
- package/specs/glossary.md +0 -35
- package/specs/vision.md +0 -145
- package/tsconfig.base.json +0 -23
- package/tsconfig.json +0 -4
- package/vitest.config.ts +0 -7
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
function C0(e,t){for(var r=0;r<t.length;r++){const i=t[r];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in e)){const n=Object.getOwnPropertyDescriptor(i,s);n&&Object.defineProperty(e,s,n.get?n:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const n of s)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function r(s){const n={};return s.integrity&&(n.integrity=s.integrity),s.referrerPolicy&&(n.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?n.credentials="include":s.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(s){if(s.ep)return;s.ep=!0;const n=r(s);fetch(s.href,n)}})();function x0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d_={exports:{}},Bl={},f_={exports:{}},Z={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var $n=Symbol.for("react.element"),b0=Symbol.for("react.portal"),k0=Symbol.for("react.fragment"),E0=Symbol.for("react.strict_mode"),R0=Symbol.for("react.profiler"),P0=Symbol.for("react.provider"),D0=Symbol.for("react.context"),M0=Symbol.for("react.forward_ref"),L0=Symbol.for("react.suspense"),T0=Symbol.for("react.memo"),A0=Symbol.for("react.lazy"),yd=Symbol.iterator;function N0(e){return e===null||typeof e!="object"?null:(e=yd&&e[yd]||e["@@iterator"],typeof e=="function"?e:null)}var p_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},__=Object.assign,m_={};function Ms(e,t,r){this.props=e,this.context=t,this.refs=m_,this.updater=r||p_}Ms.prototype.isReactComponent={};Ms.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ms.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function g_(){}g_.prototype=Ms.prototype;function Vu(e,t,r){this.props=e,this.context=t,this.refs=m_,this.updater=r||p_}var Ku=Vu.prototype=new g_;Ku.constructor=Vu;__(Ku,Ms.prototype);Ku.isPureReactComponent=!0;var Sd=Array.isArray,v_=Object.prototype.hasOwnProperty,Yu={current:null},y_={key:!0,ref:!0,__self:!0,__source:!0};function S_(e,t,r){var i,s={},n=null,o=null;if(t!=null)for(i in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(n=""+t.key),t)v_.call(t,i)&&!y_.hasOwnProperty(i)&&(s[i]=t[i]);var l=arguments.length-2;if(l===1)s.children=r;else if(1<l){for(var c=Array(l),a=0;a<l;a++)c[a]=arguments[a+2];s.children=c}if(e&&e.defaultProps)for(i in l=e.defaultProps,l)s[i]===void 0&&(s[i]=l[i]);return{$$typeof:$n,type:e,key:n,ref:o,props:s,_owner:Yu.current}}function O0(e,t){return{$$typeof:$n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function qu(e){return typeof e=="object"&&e!==null&&e.$$typeof===$n}function B0(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var wd=/\/+/g;function da(e,t){return typeof e=="object"&&e!==null&&e.key!=null?B0(""+e.key):t.toString(36)}function Ao(e,t,r,i,s){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(n){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case $n:case b0:o=!0}}if(o)return o=e,s=s(o),e=i===""?"."+da(o,0):i,Sd(s)?(r="",e!=null&&(r=e.replace(wd,"$&/")+"/"),Ao(s,t,r,"",function(a){return a})):s!=null&&(qu(s)&&(s=O0(s,r+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(wd,"$&/")+"/")+e)),t.push(s)),1;if(o=0,i=i===""?".":i+":",Sd(e))for(var l=0;l<e.length;l++){n=e[l];var c=i+da(n,l);o+=Ao(n,t,r,c,s)}else if(c=N0(e),typeof c=="function")for(e=c.call(e),l=0;!(n=e.next()).done;)n=n.value,c=i+da(n,l++),o+=Ao(n,t,r,c,s);else if(n==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Jn(e,t,r){if(e==null)return e;var i=[],s=0;return Ao(e,i,"","",function(n){return t.call(r,n,s++)}),i}function I0(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ot={current:null},No={transition:null},z0={ReactCurrentDispatcher:ot,ReactCurrentBatchConfig:No,ReactCurrentOwner:Yu};function w_(){throw Error("act(...) is not supported in production builds of React.")}Z.Children={map:Jn,forEach:function(e,t,r){Jn(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Jn(e,function(){t++}),t},toArray:function(e){return Jn(e,function(t){return t})||[]},only:function(e){if(!qu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Z.Component=Ms;Z.Fragment=k0;Z.Profiler=R0;Z.PureComponent=Vu;Z.StrictMode=E0;Z.Suspense=L0;Z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=z0;Z.act=w_;Z.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=__({},e.props),s=e.key,n=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,o=Yu.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)v_.call(t,c)&&!y_.hasOwnProperty(c)&&(i[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)i.children=r;else if(1<c){l=Array(c);for(var a=0;a<c;a++)l[a]=arguments[a+2];i.children=l}return{$$typeof:$n,type:e.type,key:s,ref:n,props:i,_owner:o}};Z.createContext=function(e){return e={$$typeof:D0,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:P0,_context:e},e.Consumer=e};Z.createElement=S_;Z.createFactory=function(e){var t=S_.bind(null,e);return t.type=e,t};Z.createRef=function(){return{current:null}};Z.forwardRef=function(e){return{$$typeof:M0,render:e}};Z.isValidElement=qu;Z.lazy=function(e){return{$$typeof:A0,_payload:{_status:-1,_result:e},_init:I0}};Z.memo=function(e,t){return{$$typeof:T0,type:e,compare:t===void 0?null:t}};Z.startTransition=function(e){var t=No.transition;No.transition={};try{e()}finally{No.transition=t}};Z.unstable_act=w_;Z.useCallback=function(e,t){return ot.current.useCallback(e,t)};Z.useContext=function(e){return ot.current.useContext(e)};Z.useDebugValue=function(){};Z.useDeferredValue=function(e){return ot.current.useDeferredValue(e)};Z.useEffect=function(e,t){return ot.current.useEffect(e,t)};Z.useId=function(){return ot.current.useId()};Z.useImperativeHandle=function(e,t,r){return ot.current.useImperativeHandle(e,t,r)};Z.useInsertionEffect=function(e,t){return ot.current.useInsertionEffect(e,t)};Z.useLayoutEffect=function(e,t){return ot.current.useLayoutEffect(e,t)};Z.useMemo=function(e,t){return ot.current.useMemo(e,t)};Z.useReducer=function(e,t,r){return ot.current.useReducer(e,t,r)};Z.useRef=function(e){return ot.current.useRef(e)};Z.useState=function(e){return ot.current.useState(e)};Z.useSyncExternalStore=function(e,t,r){return ot.current.useSyncExternalStore(e,t,r)};Z.useTransition=function(){return ot.current.useTransition()};Z.version="18.3.1";f_.exports=Z;var y=f_.exports;const F0=x0(y),Gu=C0({__proto__:null,default:F0},[y]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var $0=y,W0=Symbol.for("react.element"),H0=Symbol.for("react.fragment"),j0=Object.prototype.hasOwnProperty,U0=$0.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,V0={key:!0,ref:!0,__self:!0,__source:!0};function C_(e,t,r){var i,s={},n=null,o=null;r!==void 0&&(n=""+r),t.key!==void 0&&(n=""+t.key),t.ref!==void 0&&(o=t.ref);for(i in t)j0.call(t,i)&&!V0.hasOwnProperty(i)&&(s[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)s[i]===void 0&&(s[i]=t[i]);return{$$typeof:W0,type:e,key:n,ref:o,props:s,_owner:U0.current}}Bl.Fragment=H0;Bl.jsx=C_;Bl.jsxs=C_;d_.exports=Bl;var S=d_.exports,x_={exports:{}},Et={},b_={exports:{}},k_={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(b,B){var D=b.length;b.push(B);e:for(;0<D;){var X=D-1>>>1,ee=b[X];if(0<s(ee,B))b[X]=B,b[D]=ee,D=X;else break e}}function r(b){return b.length===0?null:b[0]}function i(b){if(b.length===0)return null;var B=b[0],D=b.pop();if(D!==B){b[0]=D;e:for(var X=0,ee=b.length,Se=ee>>>1;X<Se;){var ne=2*(X+1)-1,re=b[ne],Q=ne+1,Me=b[Q];if(0>s(re,D))Q<ee&&0>s(Me,re)?(b[X]=Me,b[Q]=D,X=Q):(b[X]=re,b[ne]=D,X=ne);else if(Q<ee&&0>s(Me,D))b[X]=Me,b[Q]=D,X=Q;else break e}}return B}function s(b,B){var D=b.sortIndex-B.sortIndex;return D!==0?D:b.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var n=performance;e.unstable_now=function(){return n.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],a=[],h=1,u=null,d=3,f=!1,_=!1,p=!1,C=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(b){for(var B=r(a);B!==null;){if(B.callback===null)i(a);else if(B.startTime<=b)i(a),B.sortIndex=B.expirationTime,t(c,B);else break;B=r(a)}}function w(b){if(p=!1,v(b),!_)if(r(c)!==null)_=!0,L(x);else{var B=r(a);B!==null&&F(w,B.startTime-b)}}function x(b,B){_=!1,p&&(p=!1,m(k),k=-1),f=!0;var D=d;try{for(v(B),u=r(c);u!==null&&(!(u.expirationTime>B)||b&&!j());){var X=u.callback;if(typeof X=="function"){u.callback=null,d=u.priorityLevel;var ee=X(u.expirationTime<=B);B=e.unstable_now(),typeof ee=="function"?u.callback=ee:u===r(c)&&i(c),v(B)}else i(c);u=r(c)}if(u!==null)var Se=!0;else{var ne=r(a);ne!==null&&F(w,ne.startTime-B),Se=!1}return Se}finally{u=null,d=D,f=!1}}var E=!1,P=null,k=-1,I=5,$=-1;function j(){return!(e.unstable_now()-$<I)}function T(){if(P!==null){var b=e.unstable_now();$=b;var B=!0;try{B=P(!0,b)}finally{B?R():(E=!1,P=null)}}else E=!1}var R;if(typeof g=="function")R=function(){g(T)};else if(typeof MessageChannel<"u"){var A=new MessageChannel,N=A.port2;A.port1.onmessage=T,R=function(){N.postMessage(null)}}else R=function(){C(T,0)};function L(b){P=b,E||(E=!0,R())}function F(b,B){k=C(function(){b(e.unstable_now())},B)}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(b){b.callback=null},e.unstable_continueExecution=function(){_||f||(_=!0,L(x))},e.unstable_forceFrameRate=function(b){0>b||125<b?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<b?Math.floor(1e3/b):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(b){switch(d){case 1:case 2:case 3:var B=3;break;default:B=d}var D=d;d=B;try{return b()}finally{d=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(b,B){switch(b){case 1:case 2:case 3:case 4:case 5:break;default:b=3}var D=d;d=b;try{return B()}finally{d=D}},e.unstable_scheduleCallback=function(b,B,D){var X=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?X+D:X):D=X,b){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=D+ee,b={id:h++,callback:B,priorityLevel:b,startTime:D,expirationTime:ee,sortIndex:-1},D>X?(b.sortIndex=D,t(a,b),r(c)===null&&b===r(a)&&(p?(m(k),k=-1):p=!0,F(w,D-X))):(b.sortIndex=ee,t(c,b),_||f||(_=!0,L(x))),b},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(b){var B=d;return function(){var D=d;d=B;try{return b.apply(this,arguments)}finally{d=D}}}})(k_);b_.exports=k_;var K0=b_.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Y0=y,kt=K0;function O(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var E_=new Set,yn={};function Bi(e,t){vs(e,t),vs(e+"Capture",t)}function vs(e,t){for(yn[e]=t,e=0;e<t.length;e++)E_.add(t[e])}var xr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ac=Object.prototype.hasOwnProperty,q0=/^[: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]*$/,Cd={},xd={};function G0(e){return ac.call(xd,e)?!0:ac.call(Cd,e)?!1:q0.test(e)?xd[e]=!0:(Cd[e]=!0,!1)}function X0(e,t,r,i){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Q0(e,t,r,i){if(t===null||typeof t>"u"||X0(e,t,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function lt(e,t,r,i,s,n,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=n,this.removeEmptyString=o}var Ge={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ge[e]=new lt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ge[t]=new lt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ge[e]=new lt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ge[e]=new lt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ge[e]=new lt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ge[e]=new lt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ge[e]=new lt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ge[e]=new lt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ge[e]=new lt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Xu=/[\-:]([a-z])/g;function Qu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Xu,Qu);Ge[t]=new lt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Xu,Qu);Ge[t]=new lt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Xu,Qu);Ge[t]=new lt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ge[e]=new lt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ge.xlinkHref=new lt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ge[e]=new lt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Zu(e,t,r,i){var s=Ge.hasOwnProperty(t)?Ge[t]:null;(s!==null?s.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Q0(t,r,s,i)&&(r=null),i||s===null?G0(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,i=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,i?e.setAttributeNS(i,t,r):e.setAttribute(t,r))))}var Dr=Y0.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,eo=Symbol.for("react.element"),Xi=Symbol.for("react.portal"),Qi=Symbol.for("react.fragment"),Ju=Symbol.for("react.strict_mode"),cc=Symbol.for("react.profiler"),R_=Symbol.for("react.provider"),P_=Symbol.for("react.context"),eh=Symbol.for("react.forward_ref"),uc=Symbol.for("react.suspense"),hc=Symbol.for("react.suspense_list"),th=Symbol.for("react.memo"),$r=Symbol.for("react.lazy"),D_=Symbol.for("react.offscreen"),bd=Symbol.iterator;function zs(e){return e===null||typeof e!="object"?null:(e=bd&&e[bd]||e["@@iterator"],typeof e=="function"?e:null)}var ye=Object.assign,fa;function Js(e){if(fa===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);fa=t&&t[1]||""}return`
|
|
34
|
+
`+fa+e}var pa=!1;function _a(e,t){if(!e||pa)return"";pa=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(a){var i=a}Reflect.construct(e,[],t)}else{try{t.call()}catch(a){i=a}e.call(t.prototype)}else{try{throw Error()}catch(a){i=a}e()}}catch(a){if(a&&i&&typeof a.stack=="string"){for(var s=a.stack.split(`
|
|
35
|
+
`),n=i.stack.split(`
|
|
36
|
+
`),o=s.length-1,l=n.length-1;1<=o&&0<=l&&s[o]!==n[l];)l--;for(;1<=o&&0<=l;o--,l--)if(s[o]!==n[l]){if(o!==1||l!==1)do if(o--,l--,0>l||s[o]!==n[l]){var c=`
|
|
37
|
+
`+s[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{pa=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Js(e):""}function Z0(e){switch(e.tag){case 5:return Js(e.type);case 16:return Js("Lazy");case 13:return Js("Suspense");case 19:return Js("SuspenseList");case 0:case 2:case 15:return e=_a(e.type,!1),e;case 11:return e=_a(e.type.render,!1),e;case 1:return e=_a(e.type,!0),e;default:return""}}function dc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Qi:return"Fragment";case Xi:return"Portal";case cc:return"Profiler";case Ju:return"StrictMode";case uc:return"Suspense";case hc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case P_:return(e.displayName||"Context")+".Consumer";case R_:return(e._context.displayName||"Context")+".Provider";case eh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case th:return t=e.displayName||null,t!==null?t:dc(e.type)||"Memo";case $r:t=e._payload,e=e._init;try{return dc(e(t))}catch{}}return null}function J0(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return dc(t);case 8:return t===Ju?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ii(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function M_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function eS(e){var t=M_(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,n=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){i=""+o,n.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function to(e){e._valueTracker||(e._valueTracker=eS(e))}function L_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=M_(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function el(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function fc(e,t){var r=t.checked;return ye({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function kd(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=ii(t.value!=null?t.value:r),e._wrapperState={initialChecked:i,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function T_(e,t){t=t.checked,t!=null&&Zu(e,"checked",t,!1)}function pc(e,t){T_(e,t);var r=ii(t.value),i=t.type;if(r!=null)i==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?_c(e,t.type,r):t.hasOwnProperty("defaultValue")&&_c(e,t.type,ii(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ed(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function _c(e,t,r){(t!=="number"||el(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var en=Array.isArray;function cs(e,t,r,i){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&i&&(e[r].defaultSelected=!0)}else{for(r=""+ii(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,i&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function mc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(O(91));return ye({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Rd(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(O(92));if(en(r)){if(1<r.length)throw Error(O(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:ii(r)}}function A_(e,t){var r=ii(t.value),i=ii(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),i!=null&&(e.defaultValue=""+i)}function Pd(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function N_(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function gc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?N_(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ro,O_=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ro=ro||document.createElement("div"),ro.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ro.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Sn(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var cn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tS=["Webkit","ms","Moz","O"];Object.keys(cn).forEach(function(e){tS.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),cn[t]=cn[e]})});function B_(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||cn.hasOwnProperty(e)&&cn[e]?(""+t).trim():t+"px"}function I_(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,s=B_(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,s):e[r]=s}}var rS=ye({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function vc(e,t){if(t){if(rS[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(O(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(O(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(O(61))}if(t.style!=null&&typeof t.style!="object")throw Error(O(62))}}function yc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Sc=null;function rh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wc=null,us=null,hs=null;function Dd(e){if(e=jn(e)){if(typeof wc!="function")throw Error(O(280));var t=e.stateNode;t&&(t=Wl(t),wc(e.stateNode,e.type,t))}}function z_(e){us?hs?hs.push(e):hs=[e]:us=e}function F_(){if(us){var e=us,t=hs;if(hs=us=null,Dd(e),t)for(e=0;e<t.length;e++)Dd(t[e])}}function $_(e,t){return e(t)}function W_(){}var ma=!1;function H_(e,t,r){if(ma)return e(t,r);ma=!0;try{return $_(e,t,r)}finally{ma=!1,(us!==null||hs!==null)&&(W_(),F_())}}function wn(e,t){var r=e.stateNode;if(r===null)return null;var i=Wl(r);if(i===null)return null;r=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(O(231,t,typeof r));return r}var Cc=!1;if(xr)try{var Fs={};Object.defineProperty(Fs,"passive",{get:function(){Cc=!0}}),window.addEventListener("test",Fs,Fs),window.removeEventListener("test",Fs,Fs)}catch{Cc=!1}function iS(e,t,r,i,s,n,o,l,c){var a=Array.prototype.slice.call(arguments,3);try{t.apply(r,a)}catch(h){this.onError(h)}}var un=!1,tl=null,rl=!1,xc=null,sS={onError:function(e){un=!0,tl=e}};function nS(e,t,r,i,s,n,o,l,c){un=!1,tl=null,iS.apply(sS,arguments)}function oS(e,t,r,i,s,n,o,l,c){if(nS.apply(this,arguments),un){if(un){var a=tl;un=!1,tl=null}else throw Error(O(198));rl||(rl=!0,xc=a)}}function Ii(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function j_(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Md(e){if(Ii(e)!==e)throw Error(O(188))}function lS(e){var t=e.alternate;if(!t){if(t=Ii(e),t===null)throw Error(O(188));return t!==e?null:e}for(var r=e,i=t;;){var s=r.return;if(s===null)break;var n=s.alternate;if(n===null){if(i=s.return,i!==null){r=i;continue}break}if(s.child===n.child){for(n=s.child;n;){if(n===r)return Md(s),e;if(n===i)return Md(s),t;n=n.sibling}throw Error(O(188))}if(r.return!==i.return)r=s,i=n;else{for(var o=!1,l=s.child;l;){if(l===r){o=!0,r=s,i=n;break}if(l===i){o=!0,i=s,r=n;break}l=l.sibling}if(!o){for(l=n.child;l;){if(l===r){o=!0,r=n,i=s;break}if(l===i){o=!0,i=n,r=s;break}l=l.sibling}if(!o)throw Error(O(189))}}if(r.alternate!==i)throw Error(O(190))}if(r.tag!==3)throw Error(O(188));return r.stateNode.current===r?e:t}function U_(e){return e=lS(e),e!==null?V_(e):null}function V_(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=V_(e);if(t!==null)return t;e=e.sibling}return null}var K_=kt.unstable_scheduleCallback,Ld=kt.unstable_cancelCallback,aS=kt.unstable_shouldYield,cS=kt.unstable_requestPaint,Ee=kt.unstable_now,uS=kt.unstable_getCurrentPriorityLevel,ih=kt.unstable_ImmediatePriority,Y_=kt.unstable_UserBlockingPriority,il=kt.unstable_NormalPriority,hS=kt.unstable_LowPriority,q_=kt.unstable_IdlePriority,Il=null,lr=null;function dS(e){if(lr&&typeof lr.onCommitFiberRoot=="function")try{lr.onCommitFiberRoot(Il,e,void 0,(e.current.flags&128)===128)}catch{}}var jt=Math.clz32?Math.clz32:_S,fS=Math.log,pS=Math.LN2;function _S(e){return e>>>=0,e===0?32:31-(fS(e)/pS|0)|0}var io=64,so=4194304;function tn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function sl(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,s=e.suspendedLanes,n=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~s;l!==0?i=tn(l):(n&=o,n!==0&&(i=tn(n)))}else o=r&~s,o!==0?i=tn(o):n!==0&&(i=tn(n));if(i===0)return 0;if(t!==0&&t!==i&&!(t&s)&&(s=i&-i,n=t&-t,s>=n||s===16&&(n&4194240)!==0))return t;if(i&4&&(i|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)r=31-jt(t),s=1<<r,i|=e[r],t&=~s;return i}function mS(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function gS(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,n=e.pendingLanes;0<n;){var o=31-jt(n),l=1<<o,c=s[o];c===-1?(!(l&r)||l&i)&&(s[o]=mS(l,t)):c<=t&&(e.expiredLanes|=l),n&=~l}}function bc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function G_(){var e=io;return io<<=1,!(io&4194240)&&(io=64),e}function ga(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Wn(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-jt(t),e[t]=r}function vS(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-jt(r),n=1<<s;t[s]=0,i[s]=-1,e[s]=-1,r&=~n}}function sh(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-jt(r),s=1<<i;s&t|e[i]&t&&(e[i]|=t),r&=~s}}var se=0;function X_(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Q_,nh,Z_,J_,em,kc=!1,no=[],qr=null,Gr=null,Xr=null,Cn=new Map,xn=new Map,jr=[],yS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Td(e,t){switch(e){case"focusin":case"focusout":qr=null;break;case"dragenter":case"dragleave":Gr=null;break;case"mouseover":case"mouseout":Xr=null;break;case"pointerover":case"pointerout":Cn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xn.delete(t.pointerId)}}function $s(e,t,r,i,s,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:n,targetContainers:[s]},t!==null&&(t=jn(t),t!==null&&nh(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function SS(e,t,r,i,s){switch(t){case"focusin":return qr=$s(qr,e,t,r,i,s),!0;case"dragenter":return Gr=$s(Gr,e,t,r,i,s),!0;case"mouseover":return Xr=$s(Xr,e,t,r,i,s),!0;case"pointerover":var n=s.pointerId;return Cn.set(n,$s(Cn.get(n)||null,e,t,r,i,s)),!0;case"gotpointercapture":return n=s.pointerId,xn.set(n,$s(xn.get(n)||null,e,t,r,i,s)),!0}return!1}function tm(e){var t=yi(e.target);if(t!==null){var r=Ii(t);if(r!==null){if(t=r.tag,t===13){if(t=j_(r),t!==null){e.blockedOn=t,em(e.priority,function(){Z_(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Oo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Ec(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);Sc=i,r.target.dispatchEvent(i),Sc=null}else return t=jn(r),t!==null&&nh(t),e.blockedOn=r,!1;t.shift()}return!0}function Ad(e,t,r){Oo(e)&&r.delete(t)}function wS(){kc=!1,qr!==null&&Oo(qr)&&(qr=null),Gr!==null&&Oo(Gr)&&(Gr=null),Xr!==null&&Oo(Xr)&&(Xr=null),Cn.forEach(Ad),xn.forEach(Ad)}function Ws(e,t){e.blockedOn===t&&(e.blockedOn=null,kc||(kc=!0,kt.unstable_scheduleCallback(kt.unstable_NormalPriority,wS)))}function bn(e){function t(s){return Ws(s,e)}if(0<no.length){Ws(no[0],e);for(var r=1;r<no.length;r++){var i=no[r];i.blockedOn===e&&(i.blockedOn=null)}}for(qr!==null&&Ws(qr,e),Gr!==null&&Ws(Gr,e),Xr!==null&&Ws(Xr,e),Cn.forEach(t),xn.forEach(t),r=0;r<jr.length;r++)i=jr[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<jr.length&&(r=jr[0],r.blockedOn===null);)tm(r),r.blockedOn===null&&jr.shift()}var ds=Dr.ReactCurrentBatchConfig,nl=!0;function CS(e,t,r,i){var s=se,n=ds.transition;ds.transition=null;try{se=1,oh(e,t,r,i)}finally{se=s,ds.transition=n}}function xS(e,t,r,i){var s=se,n=ds.transition;ds.transition=null;try{se=4,oh(e,t,r,i)}finally{se=s,ds.transition=n}}function oh(e,t,r,i){if(nl){var s=Ec(e,t,r,i);if(s===null)Ra(e,t,i,ol,r),Td(e,i);else if(SS(s,e,t,r,i))i.stopPropagation();else if(Td(e,i),t&4&&-1<yS.indexOf(e)){for(;s!==null;){var n=jn(s);if(n!==null&&Q_(n),n=Ec(e,t,r,i),n===null&&Ra(e,t,i,ol,r),n===s)break;s=n}s!==null&&i.stopPropagation()}else Ra(e,t,i,null,r)}}var ol=null;function Ec(e,t,r,i){if(ol=null,e=rh(i),e=yi(e),e!==null)if(t=Ii(e),t===null)e=null;else if(r=t.tag,r===13){if(e=j_(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ol=e,null}function rm(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(uS()){case ih:return 1;case Y_:return 4;case il:case hS:return 16;case q_:return 536870912;default:return 16}default:return 16}}var Vr=null,lh=null,Bo=null;function im(){if(Bo)return Bo;var e,t=lh,r=t.length,i,s="value"in Vr?Vr.value:Vr.textContent,n=s.length;for(e=0;e<r&&t[e]===s[e];e++);var o=r-e;for(i=1;i<=o&&t[r-i]===s[n-i];i++);return Bo=s.slice(e,1<i?1-i:void 0)}function Io(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function oo(){return!0}function Nd(){return!1}function Rt(e){function t(r,i,s,n,o){this._reactName=r,this._targetInst=s,this.type=i,this.nativeEvent=n,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(n):n[l]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?oo:Nd,this.isPropagationStopped=Nd,this}return ye(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=oo)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=oo)},persist:function(){},isPersistent:oo}),t}var Ls={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ah=Rt(Ls),Hn=ye({},Ls,{view:0,detail:0}),bS=Rt(Hn),va,ya,Hs,zl=ye({},Hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ch,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Hs&&(Hs&&e.type==="mousemove"?(va=e.screenX-Hs.screenX,ya=e.screenY-Hs.screenY):ya=va=0,Hs=e),va)},movementY:function(e){return"movementY"in e?e.movementY:ya}}),Od=Rt(zl),kS=ye({},zl,{dataTransfer:0}),ES=Rt(kS),RS=ye({},Hn,{relatedTarget:0}),Sa=Rt(RS),PS=ye({},Ls,{animationName:0,elapsedTime:0,pseudoElement:0}),DS=Rt(PS),MS=ye({},Ls,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),LS=Rt(MS),TS=ye({},Ls,{data:0}),Bd=Rt(TS),AS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NS={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"},OS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function BS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=OS[e])?!!t[e]:!1}function ch(){return BS}var IS=ye({},Hn,{key:function(e){if(e.key){var t=AS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Io(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?NS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ch,charCode:function(e){return e.type==="keypress"?Io(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Io(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),zS=Rt(IS),FS=ye({},zl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Id=Rt(FS),$S=ye({},Hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ch}),WS=Rt($S),HS=ye({},Ls,{propertyName:0,elapsedTime:0,pseudoElement:0}),jS=Rt(HS),US=ye({},zl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),VS=Rt(US),KS=[9,13,27,32],uh=xr&&"CompositionEvent"in window,hn=null;xr&&"documentMode"in document&&(hn=document.documentMode);var YS=xr&&"TextEvent"in window&&!hn,sm=xr&&(!uh||hn&&8<hn&&11>=hn),zd=" ",Fd=!1;function nm(e,t){switch(e){case"keyup":return KS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function om(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zi=!1;function qS(e,t){switch(e){case"compositionend":return om(t);case"keypress":return t.which!==32?null:(Fd=!0,zd);case"textInput":return e=t.data,e===zd&&Fd?null:e;default:return null}}function GS(e,t){if(Zi)return e==="compositionend"||!uh&&nm(e,t)?(e=im(),Bo=lh=Vr=null,Zi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return sm&&t.locale!=="ko"?null:t.data;default:return null}}var XS={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 $d(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!XS[e.type]:t==="textarea"}function lm(e,t,r,i){z_(i),t=ll(t,"onChange"),0<t.length&&(r=new ah("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var dn=null,kn=null;function QS(e){vm(e,0)}function Fl(e){var t=ts(e);if(L_(t))return e}function ZS(e,t){if(e==="change")return t}var am=!1;if(xr){var wa;if(xr){var Ca="oninput"in document;if(!Ca){var Wd=document.createElement("div");Wd.setAttribute("oninput","return;"),Ca=typeof Wd.oninput=="function"}wa=Ca}else wa=!1;am=wa&&(!document.documentMode||9<document.documentMode)}function Hd(){dn&&(dn.detachEvent("onpropertychange",cm),kn=dn=null)}function cm(e){if(e.propertyName==="value"&&Fl(kn)){var t=[];lm(t,kn,e,rh(e)),H_(QS,t)}}function JS(e,t,r){e==="focusin"?(Hd(),dn=t,kn=r,dn.attachEvent("onpropertychange",cm)):e==="focusout"&&Hd()}function ew(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Fl(kn)}function tw(e,t){if(e==="click")return Fl(t)}function rw(e,t){if(e==="input"||e==="change")return Fl(t)}function iw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Vt=typeof Object.is=="function"?Object.is:iw;function En(e,t){if(Vt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var s=r[i];if(!ac.call(t,s)||!Vt(e[s],t[s]))return!1}return!0}function jd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ud(e,t){var r=jd(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=jd(r)}}function um(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?um(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hm(){for(var e=window,t=el();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=el(e.document)}return t}function hh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function sw(e){var t=hm(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&um(r.ownerDocument.documentElement,r)){if(i!==null&&hh(r)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,n=Math.min(i.start,s);i=i.end===void 0?n:Math.min(i.end,s),!e.extend&&n>i&&(s=i,i=n,n=s),s=Ud(r,n);var o=Ud(r,i);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),n>i?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var nw=xr&&"documentMode"in document&&11>=document.documentMode,Ji=null,Rc=null,fn=null,Pc=!1;function Vd(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Pc||Ji==null||Ji!==el(i)||(i=Ji,"selectionStart"in i&&hh(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),fn&&En(fn,i)||(fn=i,i=ll(Rc,"onSelect"),0<i.length&&(t=new ah("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=Ji)))}function lo(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var es={animationend:lo("Animation","AnimationEnd"),animationiteration:lo("Animation","AnimationIteration"),animationstart:lo("Animation","AnimationStart"),transitionend:lo("Transition","TransitionEnd")},xa={},dm={};xr&&(dm=document.createElement("div").style,"AnimationEvent"in window||(delete es.animationend.animation,delete es.animationiteration.animation,delete es.animationstart.animation),"TransitionEvent"in window||delete es.transitionend.transition);function $l(e){if(xa[e])return xa[e];if(!es[e])return e;var t=es[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in dm)return xa[e]=t[r];return e}var fm=$l("animationend"),pm=$l("animationiteration"),_m=$l("animationstart"),mm=$l("transitionend"),gm=new Map,Kd="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function li(e,t){gm.set(e,t),Bi(t,[e])}for(var ba=0;ba<Kd.length;ba++){var ka=Kd[ba],ow=ka.toLowerCase(),lw=ka[0].toUpperCase()+ka.slice(1);li(ow,"on"+lw)}li(fm,"onAnimationEnd");li(pm,"onAnimationIteration");li(_m,"onAnimationStart");li("dblclick","onDoubleClick");li("focusin","onFocus");li("focusout","onBlur");li(mm,"onTransitionEnd");vs("onMouseEnter",["mouseout","mouseover"]);vs("onMouseLeave",["mouseout","mouseover"]);vs("onPointerEnter",["pointerout","pointerover"]);vs("onPointerLeave",["pointerout","pointerover"]);Bi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Bi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Bi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Bi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Bi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Bi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rn="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(" "),aw=new Set("cancel close invalid load scroll toggle".split(" ").concat(rn));function Yd(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,oS(i,t,void 0,e),e.currentTarget=null}function vm(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],s=i.event;i=i.listeners;e:{var n=void 0;if(t)for(var o=i.length-1;0<=o;o--){var l=i[o],c=l.instance,a=l.currentTarget;if(l=l.listener,c!==n&&s.isPropagationStopped())break e;Yd(s,l,a),n=c}else for(o=0;o<i.length;o++){if(l=i[o],c=l.instance,a=l.currentTarget,l=l.listener,c!==n&&s.isPropagationStopped())break e;Yd(s,l,a),n=c}}}if(rl)throw e=xc,rl=!1,xc=null,e}function ce(e,t){var r=t[Ac];r===void 0&&(r=t[Ac]=new Set);var i=e+"__bubble";r.has(i)||(ym(t,e,2,!1),r.add(i))}function Ea(e,t,r){var i=0;t&&(i|=4),ym(r,e,i,t)}var ao="_reactListening"+Math.random().toString(36).slice(2);function Rn(e){if(!e[ao]){e[ao]=!0,E_.forEach(function(r){r!=="selectionchange"&&(aw.has(r)||Ea(r,!1,e),Ea(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ao]||(t[ao]=!0,Ea("selectionchange",!1,t))}}function ym(e,t,r,i){switch(rm(t)){case 1:var s=CS;break;case 4:s=xS;break;default:s=oh}r=s.bind(null,t,r,e),s=void 0,!Cc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),i?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function Ra(e,t,r,i,s){var n=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var l=i.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(o===4)for(o=i.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;o=o.return}for(;l!==null;){if(o=yi(l),o===null)return;if(c=o.tag,c===5||c===6){i=n=o;continue e}l=l.parentNode}}i=i.return}H_(function(){var a=n,h=rh(r),u=[];e:{var d=gm.get(e);if(d!==void 0){var f=ah,_=e;switch(e){case"keypress":if(Io(r)===0)break e;case"keydown":case"keyup":f=zS;break;case"focusin":_="focus",f=Sa;break;case"focusout":_="blur",f=Sa;break;case"beforeblur":case"afterblur":f=Sa;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":f=Od;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=ES;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=WS;break;case fm:case pm:case _m:f=DS;break;case mm:f=jS;break;case"scroll":f=bS;break;case"wheel":f=VS;break;case"copy":case"cut":case"paste":f=LS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=Id}var p=(t&4)!==0,C=!p&&e==="scroll",m=p?d!==null?d+"Capture":null:d;p=[];for(var g=a,v;g!==null;){v=g;var w=v.stateNode;if(v.tag===5&&w!==null&&(v=w,m!==null&&(w=wn(g,m),w!=null&&p.push(Pn(g,w,v)))),C)break;g=g.return}0<p.length&&(d=new f(d,_,null,r,h),u.push({event:d,listeners:p}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",f=e==="mouseout"||e==="pointerout",d&&r!==Sc&&(_=r.relatedTarget||r.fromElement)&&(yi(_)||_[br]))break e;if((f||d)&&(d=h.window===h?h:(d=h.ownerDocument)?d.defaultView||d.parentWindow:window,f?(_=r.relatedTarget||r.toElement,f=a,_=_?yi(_):null,_!==null&&(C=Ii(_),_!==C||_.tag!==5&&_.tag!==6)&&(_=null)):(f=null,_=a),f!==_)){if(p=Od,w="onMouseLeave",m="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(p=Id,w="onPointerLeave",m="onPointerEnter",g="pointer"),C=f==null?d:ts(f),v=_==null?d:ts(_),d=new p(w,g+"leave",f,r,h),d.target=C,d.relatedTarget=v,w=null,yi(h)===a&&(p=new p(m,g+"enter",_,r,h),p.target=v,p.relatedTarget=C,w=p),C=w,f&&_)t:{for(p=f,m=_,g=0,v=p;v;v=Hi(v))g++;for(v=0,w=m;w;w=Hi(w))v++;for(;0<g-v;)p=Hi(p),g--;for(;0<v-g;)m=Hi(m),v--;for(;g--;){if(p===m||m!==null&&p===m.alternate)break t;p=Hi(p),m=Hi(m)}p=null}else p=null;f!==null&&qd(u,d,f,p,!1),_!==null&&C!==null&&qd(u,C,_,p,!0)}}e:{if(d=a?ts(a):window,f=d.nodeName&&d.nodeName.toLowerCase(),f==="select"||f==="input"&&d.type==="file")var x=ZS;else if($d(d))if(am)x=rw;else{x=ew;var E=JS}else(f=d.nodeName)&&f.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(x=tw);if(x&&(x=x(e,a))){lm(u,x,r,h);break e}E&&E(e,d,a),e==="focusout"&&(E=d._wrapperState)&&E.controlled&&d.type==="number"&&_c(d,"number",d.value)}switch(E=a?ts(a):window,e){case"focusin":($d(E)||E.contentEditable==="true")&&(Ji=E,Rc=a,fn=null);break;case"focusout":fn=Rc=Ji=null;break;case"mousedown":Pc=!0;break;case"contextmenu":case"mouseup":case"dragend":Pc=!1,Vd(u,r,h);break;case"selectionchange":if(nw)break;case"keydown":case"keyup":Vd(u,r,h)}var P;if(uh)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Zi?nm(e,r)&&(k="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(k="onCompositionStart");k&&(sm&&r.locale!=="ko"&&(Zi||k!=="onCompositionStart"?k==="onCompositionEnd"&&Zi&&(P=im()):(Vr=h,lh="value"in Vr?Vr.value:Vr.textContent,Zi=!0)),E=ll(a,k),0<E.length&&(k=new Bd(k,e,null,r,h),u.push({event:k,listeners:E}),P?k.data=P:(P=om(r),P!==null&&(k.data=P)))),(P=YS?qS(e,r):GS(e,r))&&(a=ll(a,"onBeforeInput"),0<a.length&&(h=new Bd("onBeforeInput","beforeinput",null,r,h),u.push({event:h,listeners:a}),h.data=P))}vm(u,t)})}function Pn(e,t,r){return{instance:e,listener:t,currentTarget:r}}function ll(e,t){for(var r=t+"Capture",i=[];e!==null;){var s=e,n=s.stateNode;s.tag===5&&n!==null&&(s=n,n=wn(e,r),n!=null&&i.unshift(Pn(e,n,s)),n=wn(e,t),n!=null&&i.push(Pn(e,n,s))),e=e.return}return i}function Hi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function qd(e,t,r,i,s){for(var n=t._reactName,o=[];r!==null&&r!==i;){var l=r,c=l.alternate,a=l.stateNode;if(c!==null&&c===i)break;l.tag===5&&a!==null&&(l=a,s?(c=wn(r,n),c!=null&&o.unshift(Pn(r,c,l))):s||(c=wn(r,n),c!=null&&o.push(Pn(r,c,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var cw=/\r\n?/g,uw=/\u0000|\uFFFD/g;function Gd(e){return(typeof e=="string"?e:""+e).replace(cw,`
|
|
38
|
+
`).replace(uw,"")}function co(e,t,r){if(t=Gd(t),Gd(e)!==t&&r)throw Error(O(425))}function al(){}var Dc=null,Mc=null;function Lc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Tc=typeof setTimeout=="function"?setTimeout:void 0,hw=typeof clearTimeout=="function"?clearTimeout:void 0,Xd=typeof Promise=="function"?Promise:void 0,dw=typeof queueMicrotask=="function"?queueMicrotask:typeof Xd<"u"?function(e){return Xd.resolve(null).then(e).catch(fw)}:Tc;function fw(e){setTimeout(function(){throw e})}function Pa(e,t){var r=t,i=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(i===0){e.removeChild(s),bn(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=s}while(r);bn(t)}function Qr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Qd(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Ts=Math.random().toString(36).slice(2),ir="__reactFiber$"+Ts,Dn="__reactProps$"+Ts,br="__reactContainer$"+Ts,Ac="__reactEvents$"+Ts,pw="__reactListeners$"+Ts,_w="__reactHandles$"+Ts;function yi(e){var t=e[ir];if(t)return t;for(var r=e.parentNode;r;){if(t=r[br]||r[ir]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Qd(e);e!==null;){if(r=e[ir])return r;e=Qd(e)}return t}e=r,r=e.parentNode}return null}function jn(e){return e=e[ir]||e[br],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ts(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(O(33))}function Wl(e){return e[Dn]||null}var Nc=[],rs=-1;function ai(e){return{current:e}}function he(e){0>rs||(e.current=Nc[rs],Nc[rs]=null,rs--)}function ae(e,t){rs++,Nc[rs]=e.current,e.current=t}var si={},tt=ai(si),pt=ai(!1),Ei=si;function ys(e,t){var r=e.type.contextTypes;if(!r)return si;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var s={},n;for(n in r)s[n]=t[n];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function _t(e){return e=e.childContextTypes,e!=null}function cl(){he(pt),he(tt)}function Zd(e,t,r){if(tt.current!==si)throw Error(O(168));ae(tt,t),ae(pt,r)}function Sm(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var s in i)if(!(s in t))throw Error(O(108,J0(e)||"Unknown",s));return ye({},r,i)}function ul(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||si,Ei=tt.current,ae(tt,e),ae(pt,pt.current),!0}function Jd(e,t,r){var i=e.stateNode;if(!i)throw Error(O(169));r?(e=Sm(e,t,Ei),i.__reactInternalMemoizedMergedChildContext=e,he(pt),he(tt),ae(tt,e)):he(pt),ae(pt,r)}var gr=null,Hl=!1,Da=!1;function wm(e){gr===null?gr=[e]:gr.push(e)}function mw(e){Hl=!0,wm(e)}function ci(){if(!Da&&gr!==null){Da=!0;var e=0,t=se;try{var r=gr;for(se=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}gr=null,Hl=!1}catch(s){throw gr!==null&&(gr=gr.slice(e+1)),K_(ih,ci),s}finally{se=t,Da=!1}}return null}var is=[],ss=0,hl=null,dl=0,Lt=[],Tt=0,Ri=null,vr=1,yr="";function _i(e,t){is[ss++]=dl,is[ss++]=hl,hl=e,dl=t}function Cm(e,t,r){Lt[Tt++]=vr,Lt[Tt++]=yr,Lt[Tt++]=Ri,Ri=e;var i=vr;e=yr;var s=32-jt(i)-1;i&=~(1<<s),r+=1;var n=32-jt(t)+s;if(30<n){var o=s-s%5;n=(i&(1<<o)-1).toString(32),i>>=o,s-=o,vr=1<<32-jt(t)+s|r<<s|i,yr=n+e}else vr=1<<n|r<<s|i,yr=e}function dh(e){e.return!==null&&(_i(e,1),Cm(e,1,0))}function fh(e){for(;e===hl;)hl=is[--ss],is[ss]=null,dl=is[--ss],is[ss]=null;for(;e===Ri;)Ri=Lt[--Tt],Lt[Tt]=null,yr=Lt[--Tt],Lt[Tt]=null,vr=Lt[--Tt],Lt[Tt]=null}var xt=null,Ct=null,de=!1,Ht=null;function xm(e,t){var r=At(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function ef(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,xt=e,Ct=Qr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,xt=e,Ct=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Ri!==null?{id:vr,overflow:yr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=At(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,xt=e,Ct=null,!0):!1;default:return!1}}function Oc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Bc(e){if(de){var t=Ct;if(t){var r=t;if(!ef(e,t)){if(Oc(e))throw Error(O(418));t=Qr(r.nextSibling);var i=xt;t&&ef(e,t)?xm(i,r):(e.flags=e.flags&-4097|2,de=!1,xt=e)}}else{if(Oc(e))throw Error(O(418));e.flags=e.flags&-4097|2,de=!1,xt=e}}}function tf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;xt=e}function uo(e){if(e!==xt)return!1;if(!de)return tf(e),de=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Lc(e.type,e.memoizedProps)),t&&(t=Ct)){if(Oc(e))throw bm(),Error(O(418));for(;t;)xm(e,t),t=Qr(t.nextSibling)}if(tf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Ct=Qr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Ct=null}}else Ct=xt?Qr(e.stateNode.nextSibling):null;return!0}function bm(){for(var e=Ct;e;)e=Qr(e.nextSibling)}function Ss(){Ct=xt=null,de=!1}function ph(e){Ht===null?Ht=[e]:Ht.push(e)}var gw=Dr.ReactCurrentBatchConfig;function js(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(O(309));var i=r.stateNode}if(!i)throw Error(O(147,e));var s=i,n=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===n?t.ref:(t=function(o){var l=s.refs;o===null?delete l[n]:l[n]=o},t._stringRef=n,t)}if(typeof e!="string")throw Error(O(284));if(!r._owner)throw Error(O(290,e))}return e}function ho(e,t){throw e=Object.prototype.toString.call(t),Error(O(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function rf(e){var t=e._init;return t(e._payload)}function km(e){function t(m,g){if(e){var v=m.deletions;v===null?(m.deletions=[g],m.flags|=16):v.push(g)}}function r(m,g){if(!e)return null;for(;g!==null;)t(m,g),g=g.sibling;return null}function i(m,g){for(m=new Map;g!==null;)g.key!==null?m.set(g.key,g):m.set(g.index,g),g=g.sibling;return m}function s(m,g){return m=ti(m,g),m.index=0,m.sibling=null,m}function n(m,g,v){return m.index=v,e?(v=m.alternate,v!==null?(v=v.index,v<g?(m.flags|=2,g):v):(m.flags|=2,g)):(m.flags|=1048576,g)}function o(m){return e&&m.alternate===null&&(m.flags|=2),m}function l(m,g,v,w){return g===null||g.tag!==6?(g=Ba(v,m.mode,w),g.return=m,g):(g=s(g,v),g.return=m,g)}function c(m,g,v,w){var x=v.type;return x===Qi?h(m,g,v.props.children,w,v.key):g!==null&&(g.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===$r&&rf(x)===g.type)?(w=s(g,v.props),w.ref=js(m,g,v),w.return=m,w):(w=Uo(v.type,v.key,v.props,null,m.mode,w),w.ref=js(m,g,v),w.return=m,w)}function a(m,g,v,w){return g===null||g.tag!==4||g.stateNode.containerInfo!==v.containerInfo||g.stateNode.implementation!==v.implementation?(g=Ia(v,m.mode,w),g.return=m,g):(g=s(g,v.children||[]),g.return=m,g)}function h(m,g,v,w,x){return g===null||g.tag!==7?(g=bi(v,m.mode,w,x),g.return=m,g):(g=s(g,v),g.return=m,g)}function u(m,g,v){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Ba(""+g,m.mode,v),g.return=m,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case eo:return v=Uo(g.type,g.key,g.props,null,m.mode,v),v.ref=js(m,null,g),v.return=m,v;case Xi:return g=Ia(g,m.mode,v),g.return=m,g;case $r:var w=g._init;return u(m,w(g._payload),v)}if(en(g)||zs(g))return g=bi(g,m.mode,v,null),g.return=m,g;ho(m,g)}return null}function d(m,g,v,w){var x=g!==null?g.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return x!==null?null:l(m,g,""+v,w);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case eo:return v.key===x?c(m,g,v,w):null;case Xi:return v.key===x?a(m,g,v,w):null;case $r:return x=v._init,d(m,g,x(v._payload),w)}if(en(v)||zs(v))return x!==null?null:h(m,g,v,w,null);ho(m,v)}return null}function f(m,g,v,w,x){if(typeof w=="string"&&w!==""||typeof w=="number")return m=m.get(v)||null,l(g,m,""+w,x);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case eo:return m=m.get(w.key===null?v:w.key)||null,c(g,m,w,x);case Xi:return m=m.get(w.key===null?v:w.key)||null,a(g,m,w,x);case $r:var E=w._init;return f(m,g,v,E(w._payload),x)}if(en(w)||zs(w))return m=m.get(v)||null,h(g,m,w,x,null);ho(g,w)}return null}function _(m,g,v,w){for(var x=null,E=null,P=g,k=g=0,I=null;P!==null&&k<v.length;k++){P.index>k?(I=P,P=null):I=P.sibling;var $=d(m,P,v[k],w);if($===null){P===null&&(P=I);break}e&&P&&$.alternate===null&&t(m,P),g=n($,g,k),E===null?x=$:E.sibling=$,E=$,P=I}if(k===v.length)return r(m,P),de&&_i(m,k),x;if(P===null){for(;k<v.length;k++)P=u(m,v[k],w),P!==null&&(g=n(P,g,k),E===null?x=P:E.sibling=P,E=P);return de&&_i(m,k),x}for(P=i(m,P);k<v.length;k++)I=f(P,m,k,v[k],w),I!==null&&(e&&I.alternate!==null&&P.delete(I.key===null?k:I.key),g=n(I,g,k),E===null?x=I:E.sibling=I,E=I);return e&&P.forEach(function(j){return t(m,j)}),de&&_i(m,k),x}function p(m,g,v,w){var x=zs(v);if(typeof x!="function")throw Error(O(150));if(v=x.call(v),v==null)throw Error(O(151));for(var E=x=null,P=g,k=g=0,I=null,$=v.next();P!==null&&!$.done;k++,$=v.next()){P.index>k?(I=P,P=null):I=P.sibling;var j=d(m,P,$.value,w);if(j===null){P===null&&(P=I);break}e&&P&&j.alternate===null&&t(m,P),g=n(j,g,k),E===null?x=j:E.sibling=j,E=j,P=I}if($.done)return r(m,P),de&&_i(m,k),x;if(P===null){for(;!$.done;k++,$=v.next())$=u(m,$.value,w),$!==null&&(g=n($,g,k),E===null?x=$:E.sibling=$,E=$);return de&&_i(m,k),x}for(P=i(m,P);!$.done;k++,$=v.next())$=f(P,m,k,$.value,w),$!==null&&(e&&$.alternate!==null&&P.delete($.key===null?k:$.key),g=n($,g,k),E===null?x=$:E.sibling=$,E=$);return e&&P.forEach(function(T){return t(m,T)}),de&&_i(m,k),x}function C(m,g,v,w){if(typeof v=="object"&&v!==null&&v.type===Qi&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case eo:e:{for(var x=v.key,E=g;E!==null;){if(E.key===x){if(x=v.type,x===Qi){if(E.tag===7){r(m,E.sibling),g=s(E,v.props.children),g.return=m,m=g;break e}}else if(E.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===$r&&rf(x)===E.type){r(m,E.sibling),g=s(E,v.props),g.ref=js(m,E,v),g.return=m,m=g;break e}r(m,E);break}else t(m,E);E=E.sibling}v.type===Qi?(g=bi(v.props.children,m.mode,w,v.key),g.return=m,m=g):(w=Uo(v.type,v.key,v.props,null,m.mode,w),w.ref=js(m,g,v),w.return=m,m=w)}return o(m);case Xi:e:{for(E=v.key;g!==null;){if(g.key===E)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){r(m,g.sibling),g=s(g,v.children||[]),g.return=m,m=g;break e}else{r(m,g);break}else t(m,g);g=g.sibling}g=Ia(v,m.mode,w),g.return=m,m=g}return o(m);case $r:return E=v._init,C(m,g,E(v._payload),w)}if(en(v))return _(m,g,v,w);if(zs(v))return p(m,g,v,w);ho(m,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,g!==null&&g.tag===6?(r(m,g.sibling),g=s(g,v),g.return=m,m=g):(r(m,g),g=Ba(v,m.mode,w),g.return=m,m=g),o(m)):r(m,g)}return C}var ws=km(!0),Em=km(!1),fl=ai(null),pl=null,ns=null,_h=null;function mh(){_h=ns=pl=null}function gh(e){var t=fl.current;he(fl),e._currentValue=t}function Ic(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function fs(e,t){pl=e,_h=ns=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ft=!0),e.firstContext=null)}function Bt(e){var t=e._currentValue;if(_h!==e)if(e={context:e,memoizedValue:t,next:null},ns===null){if(pl===null)throw Error(O(308));ns=e,pl.dependencies={lanes:0,firstContext:e}}else ns=ns.next=e;return t}var Si=null;function vh(e){Si===null?Si=[e]:Si.push(e)}function Rm(e,t,r,i){var s=t.interleaved;return s===null?(r.next=r,vh(t)):(r.next=s.next,s.next=r),t.interleaved=r,kr(e,i)}function kr(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Wr=!1;function yh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Pm(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function wr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Zr(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,te&2){var s=i.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),i.pending=t,kr(e,r)}return s=i.interleaved,s===null?(t.next=t,vh(i)):(t.next=s.next,s.next=t),i.interleaved=t,kr(e,r)}function zo(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,sh(e,r)}}function sf(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var s=null,n=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};n===null?s=n=o:n=n.next=o,r=r.next}while(r!==null);n===null?s=n=t:n=n.next=t}else s=n=t;r={baseState:i.baseState,firstBaseUpdate:s,lastBaseUpdate:n,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function _l(e,t,r,i){var s=e.updateQueue;Wr=!1;var n=s.firstBaseUpdate,o=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,a=c.next;c.next=null,o===null?n=a:o.next=a,o=c;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==o&&(l===null?h.firstBaseUpdate=a:l.next=a,h.lastBaseUpdate=c))}if(n!==null){var u=s.baseState;o=0,h=a=c=null,l=n;do{var d=l.lane,f=l.eventTime;if((i&d)===d){h!==null&&(h=h.next={eventTime:f,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var _=e,p=l;switch(d=t,f=r,p.tag){case 1:if(_=p.payload,typeof _=="function"){u=_.call(f,u,d);break e}u=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=p.payload,d=typeof _=="function"?_.call(f,u,d):_,d==null)break e;u=ye({},u,d);break e;case 2:Wr=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,d=s.effects,d===null?s.effects=[l]:d.push(l))}else f={eventTime:f,lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(a=h=f,c=u):h=h.next=f,o|=d;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;d=l,l=d.next,d.next=null,s.lastBaseUpdate=d,s.shared.pending=null}}while(!0);if(h===null&&(c=u),s.baseState=c,s.firstBaseUpdate=a,s.lastBaseUpdate=h,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else n===null&&(s.shared.lanes=0);Di|=o,e.lanes=o,e.memoizedState=u}}function nf(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],s=i.callback;if(s!==null){if(i.callback=null,i=r,typeof s!="function")throw Error(O(191,s));s.call(i)}}}var Un={},ar=ai(Un),Mn=ai(Un),Ln=ai(Un);function wi(e){if(e===Un)throw Error(O(174));return e}function Sh(e,t){switch(ae(Ln,t),ae(Mn,e),ae(ar,Un),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:gc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=gc(t,e)}he(ar),ae(ar,t)}function Cs(){he(ar),he(Mn),he(Ln)}function Dm(e){wi(Ln.current);var t=wi(ar.current),r=gc(t,e.type);t!==r&&(ae(Mn,e),ae(ar,r))}function wh(e){Mn.current===e&&(he(ar),he(Mn))}var me=ai(0);function ml(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ma=[];function Ch(){for(var e=0;e<Ma.length;e++)Ma[e]._workInProgressVersionPrimary=null;Ma.length=0}var Fo=Dr.ReactCurrentDispatcher,La=Dr.ReactCurrentBatchConfig,Pi=0,ge=null,Ne=null,Fe=null,gl=!1,pn=!1,Tn=0,vw=0;function Qe(){throw Error(O(321))}function xh(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Vt(e[r],t[r]))return!1;return!0}function bh(e,t,r,i,s,n){if(Pi=n,ge=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Fo.current=e===null||e.memoizedState===null?Cw:xw,e=r(i,s),pn){n=0;do{if(pn=!1,Tn=0,25<=n)throw Error(O(301));n+=1,Fe=Ne=null,t.updateQueue=null,Fo.current=bw,e=r(i,s)}while(pn)}if(Fo.current=vl,t=Ne!==null&&Ne.next!==null,Pi=0,Fe=Ne=ge=null,gl=!1,t)throw Error(O(300));return e}function kh(){var e=Tn!==0;return Tn=0,e}function rr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fe===null?ge.memoizedState=Fe=e:Fe=Fe.next=e,Fe}function It(){if(Ne===null){var e=ge.alternate;e=e!==null?e.memoizedState:null}else e=Ne.next;var t=Fe===null?ge.memoizedState:Fe.next;if(t!==null)Fe=t,Ne=e;else{if(e===null)throw Error(O(310));Ne=e,e={memoizedState:Ne.memoizedState,baseState:Ne.baseState,baseQueue:Ne.baseQueue,queue:Ne.queue,next:null},Fe===null?ge.memoizedState=Fe=e:Fe=Fe.next=e}return Fe}function An(e,t){return typeof t=="function"?t(e):t}function Ta(e){var t=It(),r=t.queue;if(r===null)throw Error(O(311));r.lastRenderedReducer=e;var i=Ne,s=i.baseQueue,n=r.pending;if(n!==null){if(s!==null){var o=s.next;s.next=n.next,n.next=o}i.baseQueue=s=n,r.pending=null}if(s!==null){n=s.next,i=i.baseState;var l=o=null,c=null,a=n;do{var h=a.lane;if((Pi&h)===h)c!==null&&(c=c.next={lane:0,action:a.action,hasEagerState:a.hasEagerState,eagerState:a.eagerState,next:null}),i=a.hasEagerState?a.eagerState:e(i,a.action);else{var u={lane:h,action:a.action,hasEagerState:a.hasEagerState,eagerState:a.eagerState,next:null};c===null?(l=c=u,o=i):c=c.next=u,ge.lanes|=h,Di|=h}a=a.next}while(a!==null&&a!==n);c===null?o=i:c.next=l,Vt(i,t.memoizedState)||(ft=!0),t.memoizedState=i,t.baseState=o,t.baseQueue=c,r.lastRenderedState=i}if(e=r.interleaved,e!==null){s=e;do n=s.lane,ge.lanes|=n,Di|=n,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Aa(e){var t=It(),r=t.queue;if(r===null)throw Error(O(311));r.lastRenderedReducer=e;var i=r.dispatch,s=r.pending,n=t.memoizedState;if(s!==null){r.pending=null;var o=s=s.next;do n=e(n,o.action),o=o.next;while(o!==s);Vt(n,t.memoizedState)||(ft=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),r.lastRenderedState=n}return[n,i]}function Mm(){}function Lm(e,t){var r=ge,i=It(),s=t(),n=!Vt(i.memoizedState,s);if(n&&(i.memoizedState=s,ft=!0),i=i.queue,Eh(Nm.bind(null,r,i,e),[e]),i.getSnapshot!==t||n||Fe!==null&&Fe.memoizedState.tag&1){if(r.flags|=2048,Nn(9,Am.bind(null,r,i,s,t),void 0,null),je===null)throw Error(O(349));Pi&30||Tm(r,t,s)}return s}function Tm(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ge.updateQueue,t===null?(t={lastEffect:null,stores:null},ge.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Am(e,t,r,i){t.value=r,t.getSnapshot=i,Om(t)&&Bm(e)}function Nm(e,t,r){return r(function(){Om(t)&&Bm(e)})}function Om(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Vt(e,r)}catch{return!0}}function Bm(e){var t=kr(e,1);t!==null&&Ut(t,e,1,-1)}function of(e){var t=rr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:An,lastRenderedState:e},t.queue=e,e=e.dispatch=ww.bind(null,ge,e),[t.memoizedState,e]}function Nn(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=ge.updateQueue,t===null?(t={lastEffect:null,stores:null},ge.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function Im(){return It().memoizedState}function $o(e,t,r,i){var s=rr();ge.flags|=e,s.memoizedState=Nn(1|t,r,void 0,i===void 0?null:i)}function jl(e,t,r,i){var s=It();i=i===void 0?null:i;var n=void 0;if(Ne!==null){var o=Ne.memoizedState;if(n=o.destroy,i!==null&&xh(i,o.deps)){s.memoizedState=Nn(t,r,n,i);return}}ge.flags|=e,s.memoizedState=Nn(1|t,r,n,i)}function lf(e,t){return $o(8390656,8,e,t)}function Eh(e,t){return jl(2048,8,e,t)}function zm(e,t){return jl(4,2,e,t)}function Fm(e,t){return jl(4,4,e,t)}function $m(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Wm(e,t,r){return r=r!=null?r.concat([e]):null,jl(4,4,$m.bind(null,t,e),r)}function Rh(){}function Hm(e,t){var r=It();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&xh(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function jm(e,t){var r=It();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&xh(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function Um(e,t,r){return Pi&21?(Vt(r,t)||(r=G_(),ge.lanes|=r,Di|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ft=!0),e.memoizedState=r)}function yw(e,t){var r=se;se=r!==0&&4>r?r:4,e(!0);var i=La.transition;La.transition={};try{e(!1),t()}finally{se=r,La.transition=i}}function Vm(){return It().memoizedState}function Sw(e,t,r){var i=ei(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},Km(e))Ym(t,r);else if(r=Rm(e,t,r,i),r!==null){var s=nt();Ut(r,e,i,s),qm(r,t,i)}}function ww(e,t,r){var i=ei(e),s={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(Km(e))Ym(t,s);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var o=t.lastRenderedState,l=n(o,r);if(s.hasEagerState=!0,s.eagerState=l,Vt(l,o)){var c=t.interleaved;c===null?(s.next=s,vh(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}r=Rm(e,t,s,i),r!==null&&(s=nt(),Ut(r,e,i,s),qm(r,t,i))}}function Km(e){var t=e.alternate;return e===ge||t!==null&&t===ge}function Ym(e,t){pn=gl=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function qm(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,sh(e,r)}}var vl={readContext:Bt,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useInsertionEffect:Qe,useLayoutEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useMutableSource:Qe,useSyncExternalStore:Qe,useId:Qe,unstable_isNewReconciler:!1},Cw={readContext:Bt,useCallback:function(e,t){return rr().memoizedState=[e,t===void 0?null:t],e},useContext:Bt,useEffect:lf,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,$o(4194308,4,$m.bind(null,t,e),r)},useLayoutEffect:function(e,t){return $o(4194308,4,e,t)},useInsertionEffect:function(e,t){return $o(4,2,e,t)},useMemo:function(e,t){var r=rr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=rr();return t=r!==void 0?r(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Sw.bind(null,ge,e),[i.memoizedState,e]},useRef:function(e){var t=rr();return e={current:e},t.memoizedState=e},useState:of,useDebugValue:Rh,useDeferredValue:function(e){return rr().memoizedState=e},useTransition:function(){var e=of(!1),t=e[0];return e=yw.bind(null,e[1]),rr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=ge,s=rr();if(de){if(r===void 0)throw Error(O(407));r=r()}else{if(r=t(),je===null)throw Error(O(349));Pi&30||Tm(i,t,r)}s.memoizedState=r;var n={value:r,getSnapshot:t};return s.queue=n,lf(Nm.bind(null,i,n,e),[e]),i.flags|=2048,Nn(9,Am.bind(null,i,n,r,t),void 0,null),r},useId:function(){var e=rr(),t=je.identifierPrefix;if(de){var r=yr,i=vr;r=(i&~(1<<32-jt(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=Tn++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=vw++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},xw={readContext:Bt,useCallback:Hm,useContext:Bt,useEffect:Eh,useImperativeHandle:Wm,useInsertionEffect:zm,useLayoutEffect:Fm,useMemo:jm,useReducer:Ta,useRef:Im,useState:function(){return Ta(An)},useDebugValue:Rh,useDeferredValue:function(e){var t=It();return Um(t,Ne.memoizedState,e)},useTransition:function(){var e=Ta(An)[0],t=It().memoizedState;return[e,t]},useMutableSource:Mm,useSyncExternalStore:Lm,useId:Vm,unstable_isNewReconciler:!1},bw={readContext:Bt,useCallback:Hm,useContext:Bt,useEffect:Eh,useImperativeHandle:Wm,useInsertionEffect:zm,useLayoutEffect:Fm,useMemo:jm,useReducer:Aa,useRef:Im,useState:function(){return Aa(An)},useDebugValue:Rh,useDeferredValue:function(e){var t=It();return Ne===null?t.memoizedState=e:Um(t,Ne.memoizedState,e)},useTransition:function(){var e=Aa(An)[0],t=It().memoizedState;return[e,t]},useMutableSource:Mm,useSyncExternalStore:Lm,useId:Vm,unstable_isNewReconciler:!1};function $t(e,t){if(e&&e.defaultProps){t=ye({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function zc(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:ye({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Ul={isMounted:function(e){return(e=e._reactInternals)?Ii(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=nt(),s=ei(e),n=wr(i,s);n.payload=t,r!=null&&(n.callback=r),t=Zr(e,n,s),t!==null&&(Ut(t,e,s,i),zo(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=nt(),s=ei(e),n=wr(i,s);n.tag=1,n.payload=t,r!=null&&(n.callback=r),t=Zr(e,n,s),t!==null&&(Ut(t,e,s,i),zo(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=nt(),i=ei(e),s=wr(r,i);s.tag=2,t!=null&&(s.callback=t),t=Zr(e,s,i),t!==null&&(Ut(t,e,i,r),zo(t,e,i))}};function af(e,t,r,i,s,n,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,n,o):t.prototype&&t.prototype.isPureReactComponent?!En(r,i)||!En(s,n):!0}function Gm(e,t,r){var i=!1,s=si,n=t.contextType;return typeof n=="object"&&n!==null?n=Bt(n):(s=_t(t)?Ei:tt.current,i=t.contextTypes,n=(i=i!=null)?ys(e,s):si),t=new t(r,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ul,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=n),t}function cf(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&Ul.enqueueReplaceState(t,t.state,null)}function Fc(e,t,r,i){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},yh(e);var n=t.contextType;typeof n=="object"&&n!==null?s.context=Bt(n):(n=_t(t)?Ei:tt.current,s.context=ys(e,n)),s.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(zc(e,t,n,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Ul.enqueueReplaceState(s,s.state,null),_l(e,r,s,i),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function xs(e,t){try{var r="",i=t;do r+=Z0(i),i=i.return;while(i);var s=r}catch(n){s=`
|
|
39
|
+
Error generating stack: `+n.message+`
|
|
40
|
+
`+n.stack}return{value:e,source:t,stack:s,digest:null}}function Na(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function $c(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var kw=typeof WeakMap=="function"?WeakMap:Map;function Xm(e,t,r){r=wr(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){Sl||(Sl=!0,Xc=i),$c(e,t)},r}function Qm(e,t,r){r=wr(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var s=t.value;r.payload=function(){return i(s)},r.callback=function(){$c(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(r.callback=function(){$c(e,t),typeof i!="function"&&(Jr===null?Jr=new Set([this]):Jr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function uf(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new kw;var s=new Set;i.set(t,s)}else s=i.get(t),s===void 0&&(s=new Set,i.set(t,s));s.has(r)||(s.add(r),e=Fw.bind(null,e,t,r),t.then(e,e))}function hf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function df(e,t,r,i,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=wr(-1,1),t.tag=2,Zr(r,t,1))),r.lanes|=1),e)}var Ew=Dr.ReactCurrentOwner,ft=!1;function st(e,t,r,i){t.child=e===null?Em(t,null,r,i):ws(t,e.child,r,i)}function ff(e,t,r,i,s){r=r.render;var n=t.ref;return fs(t,s),i=bh(e,t,r,i,n,s),r=kh(),e!==null&&!ft?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Er(e,t,s)):(de&&r&&dh(t),t.flags|=1,st(e,t,i,s),t.child)}function pf(e,t,r,i,s){if(e===null){var n=r.type;return typeof n=="function"&&!Oh(n)&&n.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=n,Zm(e,t,n,i,s)):(e=Uo(r.type,null,i,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,!(e.lanes&s)){var o=n.memoizedProps;if(r=r.compare,r=r!==null?r:En,r(o,i)&&e.ref===t.ref)return Er(e,t,s)}return t.flags|=1,e=ti(n,i),e.ref=t.ref,e.return=t,t.child=e}function Zm(e,t,r,i,s){if(e!==null){var n=e.memoizedProps;if(En(n,i)&&e.ref===t.ref)if(ft=!1,t.pendingProps=i=n,(e.lanes&s)!==0)e.flags&131072&&(ft=!0);else return t.lanes=e.lanes,Er(e,t,s)}return Wc(e,t,r,i,s)}function Jm(e,t,r){var i=t.pendingProps,s=i.children,n=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ae(ls,St),St|=r;else{if(!(r&1073741824))return e=n!==null?n.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ae(ls,St),St|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=n!==null?n.baseLanes:r,ae(ls,St),St|=i}else n!==null?(i=n.baseLanes|r,t.memoizedState=null):i=r,ae(ls,St),St|=i;return st(e,t,s,r),t.child}function eg(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Wc(e,t,r,i,s){var n=_t(r)?Ei:tt.current;return n=ys(t,n),fs(t,s),r=bh(e,t,r,i,n,s),i=kh(),e!==null&&!ft?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Er(e,t,s)):(de&&i&&dh(t),t.flags|=1,st(e,t,r,s),t.child)}function _f(e,t,r,i,s){if(_t(r)){var n=!0;ul(t)}else n=!1;if(fs(t,s),t.stateNode===null)Wo(e,t),Gm(t,r,i),Fc(t,r,i,s),i=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,a=r.contextType;typeof a=="object"&&a!==null?a=Bt(a):(a=_t(r)?Ei:tt.current,a=ys(t,a));var h=r.getDerivedStateFromProps,u=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==i||c!==a)&&cf(t,o,i,a),Wr=!1;var d=t.memoizedState;o.state=d,_l(t,i,o,s),c=t.memoizedState,l!==i||d!==c||pt.current||Wr?(typeof h=="function"&&(zc(t,r,h,i),c=t.memoizedState),(l=Wr||af(t,r,l,i,d,c,a))?(u||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=c),o.props=i,o.state=c,o.context=a,i=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{o=t.stateNode,Pm(e,t),l=t.memoizedProps,a=t.type===t.elementType?l:$t(t.type,l),o.props=a,u=t.pendingProps,d=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=Bt(c):(c=_t(r)?Ei:tt.current,c=ys(t,c));var f=r.getDerivedStateFromProps;(h=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==u||d!==c)&&cf(t,o,i,c),Wr=!1,d=t.memoizedState,o.state=d,_l(t,i,o,s);var _=t.memoizedState;l!==u||d!==_||pt.current||Wr?(typeof f=="function"&&(zc(t,r,f,i),_=t.memoizedState),(a=Wr||af(t,r,a,i,d,_,c)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,_,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,_,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=_),o.props=i,o.state=_,o.context=c,i=a):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),i=!1)}return Hc(e,t,r,i,n,s)}function Hc(e,t,r,i,s,n){eg(e,t);var o=(t.flags&128)!==0;if(!i&&!o)return s&&Jd(t,r,!1),Er(e,t,n);i=t.stateNode,Ew.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&o?(t.child=ws(t,e.child,null,n),t.child=ws(t,null,l,n)):st(e,t,l,n),t.memoizedState=i.state,s&&Jd(t,r,!0),t.child}function tg(e){var t=e.stateNode;t.pendingContext?Zd(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Zd(e,t.context,!1),Sh(e,t.containerInfo)}function mf(e,t,r,i,s){return Ss(),ph(s),t.flags|=256,st(e,t,r,i),t.child}var jc={dehydrated:null,treeContext:null,retryLane:0};function Uc(e){return{baseLanes:e,cachePool:null,transitions:null}}function rg(e,t,r){var i=t.pendingProps,s=me.current,n=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(n=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),ae(me,s&1),e===null)return Bc(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=i.children,e=i.fallback,n?(i=t.mode,n=t.child,o={mode:"hidden",children:o},!(i&1)&&n!==null?(n.childLanes=0,n.pendingProps=o):n=Yl(o,i,0,null),e=bi(e,i,r,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=Uc(r),t.memoizedState=jc,e):Ph(t,o));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return Rw(e,t,o,i,l,s,r);if(n){n=i.fallback,o=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:i.children};return!(o&1)&&t.child!==s?(i=t.child,i.childLanes=0,i.pendingProps=c,t.deletions=null):(i=ti(s,c),i.subtreeFlags=s.subtreeFlags&14680064),l!==null?n=ti(l,n):(n=bi(n,o,r,null),n.flags|=2),n.return=t,i.return=t,i.sibling=n,t.child=i,i=n,n=t.child,o=e.child.memoizedState,o=o===null?Uc(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},n.memoizedState=o,n.childLanes=e.childLanes&~r,t.memoizedState=jc,i}return n=e.child,e=n.sibling,i=ti(n,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Ph(e,t){return t=Yl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function fo(e,t,r,i){return i!==null&&ph(i),ws(t,e.child,null,r),e=Ph(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Rw(e,t,r,i,s,n,o){if(r)return t.flags&256?(t.flags&=-257,i=Na(Error(O(422))),fo(e,t,o,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=i.fallback,s=t.mode,i=Yl({mode:"visible",children:i.children},s,0,null),n=bi(n,s,o,null),n.flags|=2,i.return=t,n.return=t,i.sibling=n,t.child=i,t.mode&1&&ws(t,e.child,null,o),t.child.memoizedState=Uc(o),t.memoizedState=jc,n);if(!(t.mode&1))return fo(e,t,o,null);if(s.data==="$!"){if(i=s.nextSibling&&s.nextSibling.dataset,i)var l=i.dgst;return i=l,n=Error(O(419)),i=Na(n,i,void 0),fo(e,t,o,i)}if(l=(o&e.childLanes)!==0,ft||l){if(i=je,i!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(i.suspendedLanes|o)?0:s,s!==0&&s!==n.retryLane&&(n.retryLane=s,kr(e,s),Ut(i,e,s,-1))}return Nh(),i=Na(Error(O(421))),fo(e,t,o,i)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=$w.bind(null,e),s._reactRetry=t,null):(e=n.treeContext,Ct=Qr(s.nextSibling),xt=t,de=!0,Ht=null,e!==null&&(Lt[Tt++]=vr,Lt[Tt++]=yr,Lt[Tt++]=Ri,vr=e.id,yr=e.overflow,Ri=t),t=Ph(t,i.children),t.flags|=4096,t)}function gf(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Ic(e.return,t,r)}function Oa(e,t,r,i,s){var n=e.memoizedState;n===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:s}:(n.isBackwards=t,n.rendering=null,n.renderingStartTime=0,n.last=i,n.tail=r,n.tailMode=s)}function ig(e,t,r){var i=t.pendingProps,s=i.revealOrder,n=i.tail;if(st(e,t,i.children,r),i=me.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gf(e,r,t);else if(e.tag===19)gf(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(ae(me,i),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&ml(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),Oa(t,!1,s,r,n);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&ml(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}Oa(t,!0,r,null,n);break;case"together":Oa(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Wo(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Er(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Di|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(O(153));if(t.child!==null){for(e=t.child,r=ti(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=ti(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Pw(e,t,r){switch(t.tag){case 3:tg(t),Ss();break;case 5:Dm(t);break;case 1:_t(t.type)&&ul(t);break;case 4:Sh(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,s=t.memoizedProps.value;ae(fl,i._currentValue),i._currentValue=s;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(ae(me,me.current&1),t.flags|=128,null):r&t.child.childLanes?rg(e,t,r):(ae(me,me.current&1),e=Er(e,t,r),e!==null?e.sibling:null);ae(me,me.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return ig(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ae(me,me.current),i)break;return null;case 22:case 23:return t.lanes=0,Jm(e,t,r)}return Er(e,t,r)}var sg,Vc,ng,og;sg=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Vc=function(){};ng=function(e,t,r,i){var s=e.memoizedProps;if(s!==i){e=t.stateNode,wi(ar.current);var n=null;switch(r){case"input":s=fc(e,s),i=fc(e,i),n=[];break;case"select":s=ye({},s,{value:void 0}),i=ye({},i,{value:void 0}),n=[];break;case"textarea":s=mc(e,s),i=mc(e,i),n=[];break;default:typeof s.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=al)}vc(r,i);var o;r=null;for(a in s)if(!i.hasOwnProperty(a)&&s.hasOwnProperty(a)&&s[a]!=null)if(a==="style"){var l=s[a];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else a!=="dangerouslySetInnerHTML"&&a!=="children"&&a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(yn.hasOwnProperty(a)?n||(n=[]):(n=n||[]).push(a,null));for(a in i){var c=i[a];if(l=s!=null?s[a]:void 0,i.hasOwnProperty(a)&&c!==l&&(c!=null||l!=null))if(a==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(n||(n=[]),n.push(a,r)),r=c;else a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(n=n||[]).push(a,c)):a==="children"?typeof c!="string"&&typeof c!="number"||(n=n||[]).push(a,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&(yn.hasOwnProperty(a)?(c!=null&&a==="onScroll"&&ce("scroll",e),n||l===c||(n=[])):(n=n||[]).push(a,c))}r&&(n=n||[]).push("style",r);var a=n;(t.updateQueue=a)&&(t.flags|=4)}};og=function(e,t,r,i){r!==i&&(t.flags|=4)};function Us(e,t){if(!de)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Ze(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,i|=s.subtreeFlags&14680064,i|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function Dw(e,t,r){var i=t.pendingProps;switch(fh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(t),null;case 1:return _t(t.type)&&cl(),Ze(t),null;case 3:return i=t.stateNode,Cs(),he(pt),he(tt),Ch(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(uo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ht!==null&&(Jc(Ht),Ht=null))),Vc(e,t),Ze(t),null;case 5:wh(t);var s=wi(Ln.current);if(r=t.type,e!==null&&t.stateNode!=null)ng(e,t,r,i,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(O(166));return Ze(t),null}if(e=wi(ar.current),uo(t)){i=t.stateNode,r=t.type;var n=t.memoizedProps;switch(i[ir]=t,i[Dn]=n,e=(t.mode&1)!==0,r){case"dialog":ce("cancel",i),ce("close",i);break;case"iframe":case"object":case"embed":ce("load",i);break;case"video":case"audio":for(s=0;s<rn.length;s++)ce(rn[s],i);break;case"source":ce("error",i);break;case"img":case"image":case"link":ce("error",i),ce("load",i);break;case"details":ce("toggle",i);break;case"input":kd(i,n),ce("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!n.multiple},ce("invalid",i);break;case"textarea":Rd(i,n),ce("invalid",i)}vc(r,n),s=null;for(var o in n)if(n.hasOwnProperty(o)){var l=n[o];o==="children"?typeof l=="string"?i.textContent!==l&&(n.suppressHydrationWarning!==!0&&co(i.textContent,l,e),s=["children",l]):typeof l=="number"&&i.textContent!==""+l&&(n.suppressHydrationWarning!==!0&&co(i.textContent,l,e),s=["children",""+l]):yn.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&ce("scroll",i)}switch(r){case"input":to(i),Ed(i,n,!0);break;case"textarea":to(i),Pd(i);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(i.onclick=al)}i=s,t.updateQueue=i,i!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=N_(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=o.createElement(r,{is:i.is}):(e=o.createElement(r),r==="select"&&(o=e,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):e=o.createElementNS(e,r),e[ir]=t,e[Dn]=i,sg(e,t,!1,!1),t.stateNode=e;e:{switch(o=yc(r,i),r){case"dialog":ce("cancel",e),ce("close",e),s=i;break;case"iframe":case"object":case"embed":ce("load",e),s=i;break;case"video":case"audio":for(s=0;s<rn.length;s++)ce(rn[s],e);s=i;break;case"source":ce("error",e),s=i;break;case"img":case"image":case"link":ce("error",e),ce("load",e),s=i;break;case"details":ce("toggle",e),s=i;break;case"input":kd(e,i),s=fc(e,i),ce("invalid",e);break;case"option":s=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},s=ye({},i,{value:void 0}),ce("invalid",e);break;case"textarea":Rd(e,i),s=mc(e,i),ce("invalid",e);break;default:s=i}vc(r,s),l=s;for(n in l)if(l.hasOwnProperty(n)){var c=l[n];n==="style"?I_(e,c):n==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&O_(e,c)):n==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Sn(e,c):typeof c=="number"&&Sn(e,""+c):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(yn.hasOwnProperty(n)?c!=null&&n==="onScroll"&&ce("scroll",e):c!=null&&Zu(e,n,c,o))}switch(r){case"input":to(e),Ed(e,i,!1);break;case"textarea":to(e),Pd(e);break;case"option":i.value!=null&&e.setAttribute("value",""+ii(i.value));break;case"select":e.multiple=!!i.multiple,n=i.value,n!=null?cs(e,!!i.multiple,n,!1):i.defaultValue!=null&&cs(e,!!i.multiple,i.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=al)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ze(t),null;case 6:if(e&&t.stateNode!=null)og(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(O(166));if(r=wi(Ln.current),wi(ar.current),uo(t)){if(i=t.stateNode,r=t.memoizedProps,i[ir]=t,(n=i.nodeValue!==r)&&(e=xt,e!==null))switch(e.tag){case 3:co(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&co(i.nodeValue,r,(e.mode&1)!==0)}n&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[ir]=t,t.stateNode=i}return Ze(t),null;case 13:if(he(me),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(de&&Ct!==null&&t.mode&1&&!(t.flags&128))bm(),Ss(),t.flags|=98560,n=!1;else if(n=uo(t),i!==null&&i.dehydrated!==null){if(e===null){if(!n)throw Error(O(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(O(317));n[ir]=t}else Ss(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ze(t),n=!1}else Ht!==null&&(Jc(Ht),Ht=null),n=!0;if(!n)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||me.current&1?Oe===0&&(Oe=3):Nh())),t.updateQueue!==null&&(t.flags|=4),Ze(t),null);case 4:return Cs(),Vc(e,t),e===null&&Rn(t.stateNode.containerInfo),Ze(t),null;case 10:return gh(t.type._context),Ze(t),null;case 17:return _t(t.type)&&cl(),Ze(t),null;case 19:if(he(me),n=t.memoizedState,n===null)return Ze(t),null;if(i=(t.flags&128)!==0,o=n.rendering,o===null)if(i)Us(n,!1);else{if(Oe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ml(e),o!==null){for(t.flags|=128,Us(n,!1),i=o.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)n=r,e=i,n.flags&=14680066,o=n.alternate,o===null?(n.childLanes=0,n.lanes=e,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=o.childLanes,n.lanes=o.lanes,n.child=o.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=o.memoizedProps,n.memoizedState=o.memoizedState,n.updateQueue=o.updateQueue,n.type=o.type,e=o.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return ae(me,me.current&1|2),t.child}e=e.sibling}n.tail!==null&&Ee()>bs&&(t.flags|=128,i=!0,Us(n,!1),t.lanes=4194304)}else{if(!i)if(e=ml(o),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Us(n,!0),n.tail===null&&n.tailMode==="hidden"&&!o.alternate&&!de)return Ze(t),null}else 2*Ee()-n.renderingStartTime>bs&&r!==1073741824&&(t.flags|=128,i=!0,Us(n,!1),t.lanes=4194304);n.isBackwards?(o.sibling=t.child,t.child=o):(r=n.last,r!==null?r.sibling=o:t.child=o,n.last=o)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=Ee(),t.sibling=null,r=me.current,ae(me,i?r&1|2:r&1),t):(Ze(t),null);case 22:case 23:return Ah(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?St&1073741824&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),null;case 24:return null;case 25:return null}throw Error(O(156,t.tag))}function Mw(e,t){switch(fh(t),t.tag){case 1:return _t(t.type)&&cl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Cs(),he(pt),he(tt),Ch(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return wh(t),null;case 13:if(he(me),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(O(340));Ss()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return he(me),null;case 4:return Cs(),null;case 10:return gh(t.type._context),null;case 22:case 23:return Ah(),null;case 24:return null;default:return null}}var po=!1,et=!1,Lw=typeof WeakSet=="function"?WeakSet:Set,V=null;function os(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){Ce(e,t,i)}else r.current=null}function Kc(e,t,r){try{r()}catch(i){Ce(e,t,i)}}var vf=!1;function Tw(e,t){if(Dc=nl,e=hm(),hh(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var s=i.anchorOffset,n=i.focusNode;i=i.focusOffset;try{r.nodeType,n.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,a=0,h=0,u=e,d=null;t:for(;;){for(var f;u!==r||s!==0&&u.nodeType!==3||(l=o+s),u!==n||i!==0&&u.nodeType!==3||(c=o+i),u.nodeType===3&&(o+=u.nodeValue.length),(f=u.firstChild)!==null;)d=u,u=f;for(;;){if(u===e)break t;if(d===r&&++a===s&&(l=o),d===n&&++h===i&&(c=o),(f=u.nextSibling)!==null)break;u=d,d=u.parentNode}u=f}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Mc={focusedElem:e,selectionRange:r},nl=!1,V=t;V!==null;)if(t=V,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,V=e;else for(;V!==null;){t=V;try{var _=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var p=_.memoizedProps,C=_.memoizedState,m=t.stateNode,g=m.getSnapshotBeforeUpdate(t.elementType===t.type?p:$t(t.type,p),C);m.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(O(163))}}catch(w){Ce(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,V=e;break}V=t.return}return _=vf,vf=!1,_}function _n(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&e)===e){var n=s.destroy;s.destroy=void 0,n!==void 0&&Kc(t,r,n)}s=s.next}while(s!==i)}}function Vl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function Yc(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function lg(e){var t=e.alternate;t!==null&&(e.alternate=null,lg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ir],delete t[Dn],delete t[Ac],delete t[pw],delete t[_w])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ag(e){return e.tag===5||e.tag===3||e.tag===4}function yf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ag(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qc(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=al));else if(i!==4&&(e=e.child,e!==null))for(qc(e,t,r),e=e.sibling;e!==null;)qc(e,t,r),e=e.sibling}function Gc(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Gc(e,t,r),e=e.sibling;e!==null;)Gc(e,t,r),e=e.sibling}var Ve=null,Wt=!1;function Nr(e,t,r){for(r=r.child;r!==null;)cg(e,t,r),r=r.sibling}function cg(e,t,r){if(lr&&typeof lr.onCommitFiberUnmount=="function")try{lr.onCommitFiberUnmount(Il,r)}catch{}switch(r.tag){case 5:et||os(r,t);case 6:var i=Ve,s=Wt;Ve=null,Nr(e,t,r),Ve=i,Wt=s,Ve!==null&&(Wt?(e=Ve,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ve.removeChild(r.stateNode));break;case 18:Ve!==null&&(Wt?(e=Ve,r=r.stateNode,e.nodeType===8?Pa(e.parentNode,r):e.nodeType===1&&Pa(e,r),bn(e)):Pa(Ve,r.stateNode));break;case 4:i=Ve,s=Wt,Ve=r.stateNode.containerInfo,Wt=!0,Nr(e,t,r),Ve=i,Wt=s;break;case 0:case 11:case 14:case 15:if(!et&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var n=s,o=n.destroy;n=n.tag,o!==void 0&&(n&2||n&4)&&Kc(r,t,o),s=s.next}while(s!==i)}Nr(e,t,r);break;case 1:if(!et&&(os(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(l){Ce(r,t,l)}Nr(e,t,r);break;case 21:Nr(e,t,r);break;case 22:r.mode&1?(et=(i=et)||r.memoizedState!==null,Nr(e,t,r),et=i):Nr(e,t,r);break;default:Nr(e,t,r)}}function Sf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Lw),t.forEach(function(i){var s=Ww.bind(null,e,i);r.has(i)||(r.add(i),i.then(s,s))})}}function zt(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var s=r[i];try{var n=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Ve=l.stateNode,Wt=!1;break e;case 3:Ve=l.stateNode.containerInfo,Wt=!0;break e;case 4:Ve=l.stateNode.containerInfo,Wt=!0;break e}l=l.return}if(Ve===null)throw Error(O(160));cg(n,o,s),Ve=null,Wt=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(a){Ce(s,t,a)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ug(t,e),t=t.sibling}function ug(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(zt(t,e),Xt(e),i&4){try{_n(3,e,e.return),Vl(3,e)}catch(p){Ce(e,e.return,p)}try{_n(5,e,e.return)}catch(p){Ce(e,e.return,p)}}break;case 1:zt(t,e),Xt(e),i&512&&r!==null&&os(r,r.return);break;case 5:if(zt(t,e),Xt(e),i&512&&r!==null&&os(r,r.return),e.flags&32){var s=e.stateNode;try{Sn(s,"")}catch(p){Ce(e,e.return,p)}}if(i&4&&(s=e.stateNode,s!=null)){var n=e.memoizedProps,o=r!==null?r.memoizedProps:n,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&n.type==="radio"&&n.name!=null&&T_(s,n),yc(l,o);var a=yc(l,n);for(o=0;o<c.length;o+=2){var h=c[o],u=c[o+1];h==="style"?I_(s,u):h==="dangerouslySetInnerHTML"?O_(s,u):h==="children"?Sn(s,u):Zu(s,h,u,a)}switch(l){case"input":pc(s,n);break;case"textarea":A_(s,n);break;case"select":var d=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!n.multiple;var f=n.value;f!=null?cs(s,!!n.multiple,f,!1):d!==!!n.multiple&&(n.defaultValue!=null?cs(s,!!n.multiple,n.defaultValue,!0):cs(s,!!n.multiple,n.multiple?[]:"",!1))}s[Dn]=n}catch(p){Ce(e,e.return,p)}}break;case 6:if(zt(t,e),Xt(e),i&4){if(e.stateNode===null)throw Error(O(162));s=e.stateNode,n=e.memoizedProps;try{s.nodeValue=n}catch(p){Ce(e,e.return,p)}}break;case 3:if(zt(t,e),Xt(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{bn(t.containerInfo)}catch(p){Ce(e,e.return,p)}break;case 4:zt(t,e),Xt(e);break;case 13:zt(t,e),Xt(e),s=e.child,s.flags&8192&&(n=s.memoizedState!==null,s.stateNode.isHidden=n,!n||s.alternate!==null&&s.alternate.memoizedState!==null||(Lh=Ee())),i&4&&Sf(e);break;case 22:if(h=r!==null&&r.memoizedState!==null,e.mode&1?(et=(a=et)||h,zt(t,e),et=a):zt(t,e),Xt(e),i&8192){if(a=e.memoizedState!==null,(e.stateNode.isHidden=a)&&!h&&e.mode&1)for(V=e,h=e.child;h!==null;){for(u=V=h;V!==null;){switch(d=V,f=d.child,d.tag){case 0:case 11:case 14:case 15:_n(4,d,d.return);break;case 1:os(d,d.return);var _=d.stateNode;if(typeof _.componentWillUnmount=="function"){i=d,r=d.return;try{t=i,_.props=t.memoizedProps,_.state=t.memoizedState,_.componentWillUnmount()}catch(p){Ce(i,r,p)}}break;case 5:os(d,d.return);break;case 22:if(d.memoizedState!==null){Cf(u);continue}}f!==null?(f.return=d,V=f):Cf(u)}h=h.sibling}e:for(h=null,u=e;;){if(u.tag===5){if(h===null){h=u;try{s=u.stateNode,a?(n=s.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"):(l=u.stateNode,c=u.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=B_("display",o))}catch(p){Ce(e,e.return,p)}}}else if(u.tag===6){if(h===null)try{u.stateNode.nodeValue=a?"":u.memoizedProps}catch(p){Ce(e,e.return,p)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;h===u&&(h=null),u=u.return}h===u&&(h=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:zt(t,e),Xt(e),i&4&&Sf(e);break;case 21:break;default:zt(t,e),Xt(e)}}function Xt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(ag(r)){var i=r;break e}r=r.return}throw Error(O(160))}switch(i.tag){case 5:var s=i.stateNode;i.flags&32&&(Sn(s,""),i.flags&=-33);var n=yf(e);Gc(e,n,s);break;case 3:case 4:var o=i.stateNode.containerInfo,l=yf(e);qc(e,l,o);break;default:throw Error(O(161))}}catch(c){Ce(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Aw(e,t,r){V=e,hg(e)}function hg(e,t,r){for(var i=(e.mode&1)!==0;V!==null;){var s=V,n=s.child;if(s.tag===22&&i){var o=s.memoizedState!==null||po;if(!o){var l=s.alternate,c=l!==null&&l.memoizedState!==null||et;l=po;var a=et;if(po=o,(et=c)&&!a)for(V=s;V!==null;)o=V,c=o.child,o.tag===22&&o.memoizedState!==null?xf(s):c!==null?(c.return=o,V=c):xf(s);for(;n!==null;)V=n,hg(n),n=n.sibling;V=s,po=l,et=a}wf(e)}else s.subtreeFlags&8772&&n!==null?(n.return=s,V=n):wf(e)}}function wf(e){for(;V!==null;){var t=V;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:et||Vl(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!et)if(r===null)i.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:$t(t.type,r.memoizedProps);i.componentDidUpdate(s,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&nf(t,n,i);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}nf(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var a=t.alternate;if(a!==null){var h=a.memoizedState;if(h!==null){var u=h.dehydrated;u!==null&&bn(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(O(163))}et||t.flags&512&&Yc(t)}catch(d){Ce(t,t.return,d)}}if(t===e){V=null;break}if(r=t.sibling,r!==null){r.return=t.return,V=r;break}V=t.return}}function Cf(e){for(;V!==null;){var t=V;if(t===e){V=null;break}var r=t.sibling;if(r!==null){r.return=t.return,V=r;break}V=t.return}}function xf(e){for(;V!==null;){var t=V;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Vl(4,t)}catch(c){Ce(t,r,c)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var s=t.return;try{i.componentDidMount()}catch(c){Ce(t,s,c)}}var n=t.return;try{Yc(t)}catch(c){Ce(t,n,c)}break;case 5:var o=t.return;try{Yc(t)}catch(c){Ce(t,o,c)}}}catch(c){Ce(t,t.return,c)}if(t===e){V=null;break}var l=t.sibling;if(l!==null){l.return=t.return,V=l;break}V=t.return}}var Nw=Math.ceil,yl=Dr.ReactCurrentDispatcher,Dh=Dr.ReactCurrentOwner,Nt=Dr.ReactCurrentBatchConfig,te=0,je=null,De=null,qe=0,St=0,ls=ai(0),Oe=0,On=null,Di=0,Kl=0,Mh=0,mn=null,dt=null,Lh=0,bs=1/0,mr=null,Sl=!1,Xc=null,Jr=null,_o=!1,Kr=null,wl=0,gn=0,Qc=null,Ho=-1,jo=0;function nt(){return te&6?Ee():Ho!==-1?Ho:Ho=Ee()}function ei(e){return e.mode&1?te&2&&qe!==0?qe&-qe:gw.transition!==null?(jo===0&&(jo=G_()),jo):(e=se,e!==0||(e=window.event,e=e===void 0?16:rm(e.type)),e):1}function Ut(e,t,r,i){if(50<gn)throw gn=0,Qc=null,Error(O(185));Wn(e,r,i),(!(te&2)||e!==je)&&(e===je&&(!(te&2)&&(Kl|=r),Oe===4&&Ur(e,qe)),mt(e,i),r===1&&te===0&&!(t.mode&1)&&(bs=Ee()+500,Hl&&ci()))}function mt(e,t){var r=e.callbackNode;gS(e,t);var i=sl(e,e===je?qe:0);if(i===0)r!==null&&Ld(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&Ld(r),t===1)e.tag===0?mw(bf.bind(null,e)):wm(bf.bind(null,e)),dw(function(){!(te&6)&&ci()}),r=null;else{switch(X_(i)){case 1:r=ih;break;case 4:r=Y_;break;case 16:r=il;break;case 536870912:r=q_;break;default:r=il}r=yg(r,dg.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function dg(e,t){if(Ho=-1,jo=0,te&6)throw Error(O(327));var r=e.callbackNode;if(ps()&&e.callbackNode!==r)return null;var i=sl(e,e===je?qe:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=Cl(e,i);else{t=i;var s=te;te|=2;var n=pg();(je!==e||qe!==t)&&(mr=null,bs=Ee()+500,xi(e,t));do try{Iw();break}catch(l){fg(e,l)}while(!0);mh(),yl.current=n,te=s,De!==null?t=0:(je=null,qe=0,t=Oe)}if(t!==0){if(t===2&&(s=bc(e),s!==0&&(i=s,t=Zc(e,s))),t===1)throw r=On,xi(e,0),Ur(e,i),mt(e,Ee()),r;if(t===6)Ur(e,i);else{if(s=e.current.alternate,!(i&30)&&!Ow(s)&&(t=Cl(e,i),t===2&&(n=bc(e),n!==0&&(i=n,t=Zc(e,n))),t===1))throw r=On,xi(e,0),Ur(e,i),mt(e,Ee()),r;switch(e.finishedWork=s,e.finishedLanes=i,t){case 0:case 1:throw Error(O(345));case 2:mi(e,dt,mr);break;case 3:if(Ur(e,i),(i&130023424)===i&&(t=Lh+500-Ee(),10<t)){if(sl(e,0)!==0)break;if(s=e.suspendedLanes,(s&i)!==i){nt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Tc(mi.bind(null,e,dt,mr),t);break}mi(e,dt,mr);break;case 4:if(Ur(e,i),(i&4194240)===i)break;for(t=e.eventTimes,s=-1;0<i;){var o=31-jt(i);n=1<<o,o=t[o],o>s&&(s=o),i&=~n}if(i=s,i=Ee()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Nw(i/1960))-i,10<i){e.timeoutHandle=Tc(mi.bind(null,e,dt,mr),i);break}mi(e,dt,mr);break;case 5:mi(e,dt,mr);break;default:throw Error(O(329))}}}return mt(e,Ee()),e.callbackNode===r?dg.bind(null,e):null}function Zc(e,t){var r=mn;return e.current.memoizedState.isDehydrated&&(xi(e,t).flags|=256),e=Cl(e,t),e!==2&&(t=dt,dt=r,t!==null&&Jc(t)),e}function Jc(e){dt===null?dt=e:dt.push.apply(dt,e)}function Ow(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var s=r[i],n=s.getSnapshot;s=s.value;try{if(!Vt(n(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ur(e,t){for(t&=~Mh,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-jt(t),i=1<<r;e[r]=-1,t&=~i}}function bf(e){if(te&6)throw Error(O(327));ps();var t=sl(e,0);if(!(t&1))return mt(e,Ee()),null;var r=Cl(e,t);if(e.tag!==0&&r===2){var i=bc(e);i!==0&&(t=i,r=Zc(e,i))}if(r===1)throw r=On,xi(e,0),Ur(e,t),mt(e,Ee()),r;if(r===6)throw Error(O(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,mi(e,dt,mr),mt(e,Ee()),null}function Th(e,t){var r=te;te|=1;try{return e(t)}finally{te=r,te===0&&(bs=Ee()+500,Hl&&ci())}}function Mi(e){Kr!==null&&Kr.tag===0&&!(te&6)&&ps();var t=te;te|=1;var r=Nt.transition,i=se;try{if(Nt.transition=null,se=1,e)return e()}finally{se=i,Nt.transition=r,te=t,!(te&6)&&ci()}}function Ah(){St=ls.current,he(ls)}function xi(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,hw(r)),De!==null)for(r=De.return;r!==null;){var i=r;switch(fh(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&cl();break;case 3:Cs(),he(pt),he(tt),Ch();break;case 5:wh(i);break;case 4:Cs();break;case 13:he(me);break;case 19:he(me);break;case 10:gh(i.type._context);break;case 22:case 23:Ah()}r=r.return}if(je=e,De=e=ti(e.current,null),qe=St=t,Oe=0,On=null,Mh=Kl=Di=0,dt=mn=null,Si!==null){for(t=0;t<Si.length;t++)if(r=Si[t],i=r.interleaved,i!==null){r.interleaved=null;var s=i.next,n=r.pending;if(n!==null){var o=n.next;n.next=s,i.next=o}r.pending=i}Si=null}return e}function fg(e,t){do{var r=De;try{if(mh(),Fo.current=vl,gl){for(var i=ge.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}gl=!1}if(Pi=0,Fe=Ne=ge=null,pn=!1,Tn=0,Dh.current=null,r===null||r.return===null){Oe=1,On=t,De=null;break}e:{var n=e,o=r.return,l=r,c=t;if(t=qe,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var a=c,h=l,u=h.tag;if(!(h.mode&1)&&(u===0||u===11||u===15)){var d=h.alternate;d?(h.updateQueue=d.updateQueue,h.memoizedState=d.memoizedState,h.lanes=d.lanes):(h.updateQueue=null,h.memoizedState=null)}var f=hf(o);if(f!==null){f.flags&=-257,df(f,o,l,n,t),f.mode&1&&uf(n,a,t),t=f,c=a;var _=t.updateQueue;if(_===null){var p=new Set;p.add(c),t.updateQueue=p}else _.add(c);break e}else{if(!(t&1)){uf(n,a,t),Nh();break e}c=Error(O(426))}}else if(de&&l.mode&1){var C=hf(o);if(C!==null){!(C.flags&65536)&&(C.flags|=256),df(C,o,l,n,t),ph(xs(c,l));break e}}n=c=xs(c,l),Oe!==4&&(Oe=2),mn===null?mn=[n]:mn.push(n),n=o;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var m=Xm(n,c,t);sf(n,m);break e;case 1:l=c;var g=n.type,v=n.stateNode;if(!(n.flags&128)&&(typeof g.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Jr===null||!Jr.has(v)))){n.flags|=65536,t&=-t,n.lanes|=t;var w=Qm(n,l,t);sf(n,w);break e}}n=n.return}while(n!==null)}mg(r)}catch(x){t=x,De===r&&r!==null&&(De=r=r.return);continue}break}while(!0)}function pg(){var e=yl.current;return yl.current=vl,e===null?vl:e}function Nh(){(Oe===0||Oe===3||Oe===2)&&(Oe=4),je===null||!(Di&268435455)&&!(Kl&268435455)||Ur(je,qe)}function Cl(e,t){var r=te;te|=2;var i=pg();(je!==e||qe!==t)&&(mr=null,xi(e,t));do try{Bw();break}catch(s){fg(e,s)}while(!0);if(mh(),te=r,yl.current=i,De!==null)throw Error(O(261));return je=null,qe=0,Oe}function Bw(){for(;De!==null;)_g(De)}function Iw(){for(;De!==null&&!aS();)_g(De)}function _g(e){var t=vg(e.alternate,e,St);e.memoizedProps=e.pendingProps,t===null?mg(e):De=t,Dh.current=null}function mg(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Mw(r,t),r!==null){r.flags&=32767,De=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Oe=6,De=null;return}}else if(r=Dw(r,t,St),r!==null){De=r;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);Oe===0&&(Oe=5)}function mi(e,t,r){var i=se,s=Nt.transition;try{Nt.transition=null,se=1,zw(e,t,r,i)}finally{Nt.transition=s,se=i}return null}function zw(e,t,r,i){do ps();while(Kr!==null);if(te&6)throw Error(O(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(O(177));e.callbackNode=null,e.callbackPriority=0;var n=r.lanes|r.childLanes;if(vS(e,n),e===je&&(De=je=null,qe=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||_o||(_o=!0,yg(il,function(){return ps(),null})),n=(r.flags&15990)!==0,r.subtreeFlags&15990||n){n=Nt.transition,Nt.transition=null;var o=se;se=1;var l=te;te|=4,Dh.current=null,Tw(e,r),ug(r,e),sw(Mc),nl=!!Dc,Mc=Dc=null,e.current=r,Aw(r),cS(),te=l,se=o,Nt.transition=n}else e.current=r;if(_o&&(_o=!1,Kr=e,wl=s),n=e.pendingLanes,n===0&&(Jr=null),dS(r.stateNode),mt(e,Ee()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],i(s.value,{componentStack:s.stack,digest:s.digest});if(Sl)throw Sl=!1,e=Xc,Xc=null,e;return wl&1&&e.tag!==0&&ps(),n=e.pendingLanes,n&1?e===Qc?gn++:(gn=0,Qc=e):gn=0,ci(),null}function ps(){if(Kr!==null){var e=X_(wl),t=Nt.transition,r=se;try{if(Nt.transition=null,se=16>e?16:e,Kr===null)var i=!1;else{if(e=Kr,Kr=null,wl=0,te&6)throw Error(O(331));var s=te;for(te|=4,V=e.current;V!==null;){var n=V,o=n.child;if(V.flags&16){var l=n.deletions;if(l!==null){for(var c=0;c<l.length;c++){var a=l[c];for(V=a;V!==null;){var h=V;switch(h.tag){case 0:case 11:case 15:_n(8,h,n)}var u=h.child;if(u!==null)u.return=h,V=u;else for(;V!==null;){h=V;var d=h.sibling,f=h.return;if(lg(h),h===a){V=null;break}if(d!==null){d.return=f,V=d;break}V=f}}}var _=n.alternate;if(_!==null){var p=_.child;if(p!==null){_.child=null;do{var C=p.sibling;p.sibling=null,p=C}while(p!==null)}}V=n}}if(n.subtreeFlags&2064&&o!==null)o.return=n,V=o;else e:for(;V!==null;){if(n=V,n.flags&2048)switch(n.tag){case 0:case 11:case 15:_n(9,n,n.return)}var m=n.sibling;if(m!==null){m.return=n.return,V=m;break e}V=n.return}}var g=e.current;for(V=g;V!==null;){o=V;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,V=v;else e:for(o=g;V!==null;){if(l=V,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Vl(9,l)}}catch(x){Ce(l,l.return,x)}if(l===o){V=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,V=w;break e}V=l.return}}if(te=s,ci(),lr&&typeof lr.onPostCommitFiberRoot=="function")try{lr.onPostCommitFiberRoot(Il,e)}catch{}i=!0}return i}finally{se=r,Nt.transition=t}}return!1}function kf(e,t,r){t=xs(r,t),t=Xm(e,t,1),e=Zr(e,t,1),t=nt(),e!==null&&(Wn(e,1,t),mt(e,t))}function Ce(e,t,r){if(e.tag===3)kf(e,e,r);else for(;t!==null;){if(t.tag===3){kf(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Jr===null||!Jr.has(i))){e=xs(r,e),e=Qm(t,e,1),t=Zr(t,e,1),e=nt(),t!==null&&(Wn(t,1,e),mt(t,e));break}}t=t.return}}function Fw(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=nt(),e.pingedLanes|=e.suspendedLanes&r,je===e&&(qe&r)===r&&(Oe===4||Oe===3&&(qe&130023424)===qe&&500>Ee()-Lh?xi(e,0):Mh|=r),mt(e,t)}function gg(e,t){t===0&&(e.mode&1?(t=so,so<<=1,!(so&130023424)&&(so=4194304)):t=1);var r=nt();e=kr(e,t),e!==null&&(Wn(e,t,r),mt(e,r))}function $w(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),gg(e,r)}function Ww(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(O(314))}i!==null&&i.delete(t),gg(e,r)}var vg;vg=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||pt.current)ft=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return ft=!1,Pw(e,t,r);ft=!!(e.flags&131072)}else ft=!1,de&&t.flags&1048576&&Cm(t,dl,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Wo(e,t),e=t.pendingProps;var s=ys(t,tt.current);fs(t,r),s=bh(null,t,i,e,s,r);var n=kh();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,_t(i)?(n=!0,ul(t)):n=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,yh(t),s.updater=Ul,t.stateNode=s,s._reactInternals=t,Fc(t,i,e,r),t=Hc(null,t,i,!0,n,r)):(t.tag=0,de&&n&&dh(t),st(null,t,s,r),t=t.child),t;case 16:i=t.elementType;e:{switch(Wo(e,t),e=t.pendingProps,s=i._init,i=s(i._payload),t.type=i,s=t.tag=jw(i),e=$t(i,e),s){case 0:t=Wc(null,t,i,e,r);break e;case 1:t=_f(null,t,i,e,r);break e;case 11:t=ff(null,t,i,e,r);break e;case 14:t=pf(null,t,i,$t(i.type,e),r);break e}throw Error(O(306,i,""))}return t;case 0:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:$t(i,s),Wc(e,t,i,s,r);case 1:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:$t(i,s),_f(e,t,i,s,r);case 3:e:{if(tg(t),e===null)throw Error(O(387));i=t.pendingProps,n=t.memoizedState,s=n.element,Pm(e,t),_l(t,i,null,r);var o=t.memoizedState;if(i=o.element,n.isDehydrated)if(n={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){s=xs(Error(O(423)),t),t=mf(e,t,i,r,s);break e}else if(i!==s){s=xs(Error(O(424)),t),t=mf(e,t,i,r,s);break e}else for(Ct=Qr(t.stateNode.containerInfo.firstChild),xt=t,de=!0,Ht=null,r=Em(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ss(),i===s){t=Er(e,t,r);break e}st(e,t,i,r)}t=t.child}return t;case 5:return Dm(t),e===null&&Bc(t),i=t.type,s=t.pendingProps,n=e!==null?e.memoizedProps:null,o=s.children,Lc(i,s)?o=null:n!==null&&Lc(i,n)&&(t.flags|=32),eg(e,t),st(e,t,o,r),t.child;case 6:return e===null&&Bc(t),null;case 13:return rg(e,t,r);case 4:return Sh(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=ws(t,null,i,r):st(e,t,i,r),t.child;case 11:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:$t(i,s),ff(e,t,i,s,r);case 7:return st(e,t,t.pendingProps,r),t.child;case 8:return st(e,t,t.pendingProps.children,r),t.child;case 12:return st(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,s=t.pendingProps,n=t.memoizedProps,o=s.value,ae(fl,i._currentValue),i._currentValue=o,n!==null)if(Vt(n.value,o)){if(n.children===s.children&&!pt.current){t=Er(e,t,r);break e}}else for(n=t.child,n!==null&&(n.return=t);n!==null;){var l=n.dependencies;if(l!==null){o=n.child;for(var c=l.firstContext;c!==null;){if(c.context===i){if(n.tag===1){c=wr(-1,r&-r),c.tag=2;var a=n.updateQueue;if(a!==null){a=a.shared;var h=a.pending;h===null?c.next=c:(c.next=h.next,h.next=c),a.pending=c}}n.lanes|=r,c=n.alternate,c!==null&&(c.lanes|=r),Ic(n.return,r,t),l.lanes|=r;break}c=c.next}}else if(n.tag===10)o=n.type===t.type?null:n.child;else if(n.tag===18){if(o=n.return,o===null)throw Error(O(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Ic(o,r,t),o=n.sibling}else o=n.child;if(o!==null)o.return=n;else for(o=n;o!==null;){if(o===t){o=null;break}if(n=o.sibling,n!==null){n.return=o.return,o=n;break}o=o.return}n=o}st(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,i=t.pendingProps.children,fs(t,r),s=Bt(s),i=i(s),t.flags|=1,st(e,t,i,r),t.child;case 14:return i=t.type,s=$t(i,t.pendingProps),s=$t(i.type,s),pf(e,t,i,s,r);case 15:return Zm(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:$t(i,s),Wo(e,t),t.tag=1,_t(i)?(e=!0,ul(t)):e=!1,fs(t,r),Gm(t,i,s),Fc(t,i,s,r),Hc(null,t,i,!0,e,r);case 19:return ig(e,t,r);case 22:return Jm(e,t,r)}throw Error(O(156,t.tag))};function yg(e,t){return K_(e,t)}function Hw(e,t,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function At(e,t,r,i){return new Hw(e,t,r,i)}function Oh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function jw(e){if(typeof e=="function")return Oh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===eh)return 11;if(e===th)return 14}return 2}function ti(e,t){var r=e.alternate;return r===null?(r=At(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Uo(e,t,r,i,s,n){var o=2;if(i=e,typeof e=="function")Oh(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Qi:return bi(r.children,s,n,t);case Ju:o=8,s|=8;break;case cc:return e=At(12,r,t,s|2),e.elementType=cc,e.lanes=n,e;case uc:return e=At(13,r,t,s),e.elementType=uc,e.lanes=n,e;case hc:return e=At(19,r,t,s),e.elementType=hc,e.lanes=n,e;case D_:return Yl(r,s,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case R_:o=10;break e;case P_:o=9;break e;case eh:o=11;break e;case th:o=14;break e;case $r:o=16,i=null;break e}throw Error(O(130,e==null?e:typeof e,""))}return t=At(o,r,t,s),t.elementType=e,t.type=i,t.lanes=n,t}function bi(e,t,r,i){return e=At(7,e,i,t),e.lanes=r,e}function Yl(e,t,r,i){return e=At(22,e,i,t),e.elementType=D_,e.lanes=r,e.stateNode={isHidden:!1},e}function Ba(e,t,r){return e=At(6,e,null,t),e.lanes=r,e}function Ia(e,t,r){return t=At(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Uw(e,t,r,i,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ga(0),this.expirationTimes=ga(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ga(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Bh(e,t,r,i,s,n,o,l,c){return e=new Uw(e,t,r,l,c),t===1?(t=1,n===!0&&(t|=8)):t=0,n=At(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},yh(n),e}function Vw(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Xi,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function Sg(e){if(!e)return si;e=e._reactInternals;e:{if(Ii(e)!==e||e.tag!==1)throw Error(O(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(_t(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(O(171))}if(e.tag===1){var r=e.type;if(_t(r))return Sm(e,r,t)}return t}function wg(e,t,r,i,s,n,o,l,c){return e=Bh(r,i,!0,e,s,n,o,l,c),e.context=Sg(null),r=e.current,i=nt(),s=ei(r),n=wr(i,s),n.callback=t??null,Zr(r,n,s),e.current.lanes=s,Wn(e,s,i),mt(e,i),e}function ql(e,t,r,i){var s=t.current,n=nt(),o=ei(s);return r=Sg(r),t.context===null?t.context=r:t.pendingContext=r,t=wr(n,o),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=Zr(s,t,o),e!==null&&(Ut(e,s,o,n),zo(e,s,o)),o}function xl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ef(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Ih(e,t){Ef(e,t),(e=e.alternate)&&Ef(e,t)}function Kw(){return null}var Cg=typeof reportError=="function"?reportError:function(e){console.error(e)};function zh(e){this._internalRoot=e}Gl.prototype.render=zh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(O(409));ql(e,t,null,null)};Gl.prototype.unmount=zh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Mi(function(){ql(null,e,null,null)}),t[br]=null}};function Gl(e){this._internalRoot=e}Gl.prototype.unstable_scheduleHydration=function(e){if(e){var t=J_();e={blockedOn:null,target:e,priority:t};for(var r=0;r<jr.length&&t!==0&&t<jr[r].priority;r++);jr.splice(r,0,e),r===0&&tm(e)}};function Fh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Xl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Rf(){}function Yw(e,t,r,i,s){if(s){if(typeof i=="function"){var n=i;i=function(){var a=xl(o);n.call(a)}}var o=wg(t,i,e,0,null,!1,!1,"",Rf);return e._reactRootContainer=o,e[br]=o.current,Rn(e.nodeType===8?e.parentNode:e),Mi(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof i=="function"){var l=i;i=function(){var a=xl(c);l.call(a)}}var c=Bh(e,0,!1,null,null,!1,!1,"",Rf);return e._reactRootContainer=c,e[br]=c.current,Rn(e.nodeType===8?e.parentNode:e),Mi(function(){ql(t,c,r,i)}),c}function Ql(e,t,r,i,s){var n=r._reactRootContainer;if(n){var o=n;if(typeof s=="function"){var l=s;s=function(){var c=xl(o);l.call(c)}}ql(t,o,e,s)}else o=Yw(r,t,e,s,i);return xl(o)}Q_=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=tn(t.pendingLanes);r!==0&&(sh(t,r|1),mt(t,Ee()),!(te&6)&&(bs=Ee()+500,ci()))}break;case 13:Mi(function(){var i=kr(e,1);if(i!==null){var s=nt();Ut(i,e,1,s)}}),Ih(e,1)}};nh=function(e){if(e.tag===13){var t=kr(e,134217728);if(t!==null){var r=nt();Ut(t,e,134217728,r)}Ih(e,134217728)}};Z_=function(e){if(e.tag===13){var t=ei(e),r=kr(e,t);if(r!==null){var i=nt();Ut(r,e,t,i)}Ih(e,t)}};J_=function(){return se};em=function(e,t){var r=se;try{return se=e,t()}finally{se=r}};wc=function(e,t,r){switch(t){case"input":if(pc(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var s=Wl(i);if(!s)throw Error(O(90));L_(i),pc(i,s)}}}break;case"textarea":A_(e,r);break;case"select":t=r.value,t!=null&&cs(e,!!r.multiple,t,!1)}};$_=Th;W_=Mi;var qw={usingClientEntryPoint:!1,Events:[jn,ts,Wl,z_,F_,Th]},Vs={findFiberByHostInstance:yi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Gw={bundleType:Vs.bundleType,version:Vs.version,rendererPackageName:Vs.rendererPackageName,rendererConfig:Vs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Dr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=U_(e),e===null?null:e.stateNode},findFiberByHostInstance:Vs.findFiberByHostInstance||Kw,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mo.isDisabled&&mo.supportsFiber)try{Il=mo.inject(Gw),lr=mo}catch{}}Et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qw;Et.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Fh(t))throw Error(O(200));return Vw(e,t,null,r)};Et.createRoot=function(e,t){if(!Fh(e))throw Error(O(299));var r=!1,i="",s=Cg;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Bh(e,1,!1,null,null,r,!1,i,s),e[br]=t.current,Rn(e.nodeType===8?e.parentNode:e),new zh(t)};Et.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(O(188)):(e=Object.keys(e).join(","),Error(O(268,e)));return e=U_(t),e=e===null?null:e.stateNode,e};Et.flushSync=function(e){return Mi(e)};Et.hydrate=function(e,t,r){if(!Xl(t))throw Error(O(200));return Ql(null,e,t,!0,r)};Et.hydrateRoot=function(e,t,r){if(!Fh(e))throw Error(O(405));var i=r!=null&&r.hydratedSources||null,s=!1,n="",o=Cg;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(n=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=wg(t,null,e,1,r??null,s,!1,n,o),e[br]=t.current,Rn(e),i)for(e=0;e<i.length;e++)r=i[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new Gl(t)};Et.render=function(e,t,r){if(!Xl(t))throw Error(O(200));return Ql(null,e,t,!1,r)};Et.unmountComponentAtNode=function(e){if(!Xl(e))throw Error(O(40));return e._reactRootContainer?(Mi(function(){Ql(null,null,e,!1,function(){e._reactRootContainer=null,e[br]=null})}),!0):!1};Et.unstable_batchedUpdates=Th;Et.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!Xl(r))throw Error(O(200));if(e==null||e._reactInternals===void 0)throw Error(O(38));return Ql(e,t,r,!1,i)};Et.version="18.3.1-next-f1338f8080-20240426";function xg(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(xg)}catch(e){console.error(e)}}xg(),x_.exports=Et;var Zl=x_.exports,bg,Pf=Zl;bg=Pf.createRoot,Pf.hydrateRoot;const kg={"app.tagline":"A graphical desktop over plain SSH","login.title":"Connect to a server","login.host":"Host / IP","login.port":"Port","login.username":"Username","login.authMethod":"Authentication","login.auth.password":"Password","login.auth.key":"Private key (PEM)","login.password":"Password","login.keyFile":"Key file","login.keyHint":"Paste your private key or choose a file","login.passphrase":"Passphrase (optional)","login.submit":"Connect","login.connecting":"Connecting…","login.error":"Could not connect","hostkey.title":"Verify host authenticity","hostkey.body":"The server's identity is not yet known. Make sure this fingerprint matches the server you trust before continuing.","hostkey.fingerprint":"Fingerprint","hostkey.cancel":"Cancel","hostkey.confirm":"Trust and connect","connected.title":"Connected","connected.os":"Operating system","connected.home":"Home","connected.listing":"Home directory","connected.transparency":"Commands run (transparency)","connected.disconnect":"Disconnect","connected.empty":"Empty directory","desktop.start":"Apps","desktop.disconnect":"Disconnect","desktop.comingSoon":"Coming soon","apps.files":"Files","apps.system":"System info","apps.terminal":"Terminal","apps.monitor":"System monitor","apps.editor":"Stallman","system.os":"Operating system","system.host":"Host","system.home":"Home","system.transparency":"Commands run (transparency)","monitor.uptime":"Uptime","monitor.load":"Load average (1 / 5 / 15 min)","monitor.memory":"Memory","monitor.memoryUsage":"{used} of {total} ({pct}%)","monitor.unavailable":"Metrics unavailable","files.up":"Up","files.empty":"Empty directory","files.error":"Could not list directory","editor.untitled":"No file open","editor.save":"Save","editor.saved":"Saved","editor.saving":"Saving…","editor.unsaved":"Unsaved changes","editor.loadError":"Could not open file","editor.saveError":"Could not save","editor.binary":"This file does not look like text and was not opened."},Xw={"app.tagline":"Un escritorio gráfico sobre SSH puro","login.title":"Conectar a un servidor","login.host":"Host / IP","login.port":"Puerto","login.username":"Usuario","login.authMethod":"Autenticación","login.auth.password":"Contraseña","login.auth.key":"Clave privada (PEM)","login.password":"Contraseña","login.keyFile":"Archivo de clave","login.keyHint":"Pega tu clave privada o elige un archivo","login.passphrase":"Frase de paso (opcional)","login.submit":"Conectar","login.connecting":"Conectando…","login.error":"No se pudo conectar","hostkey.title":"Verificar la autenticidad del servidor","hostkey.body":"La identidad del servidor aún no se conoce. Asegúrate de que esta huella coincide con el servidor en el que confías antes de continuar.","hostkey.fingerprint":"Huella","hostkey.cancel":"Cancelar","hostkey.confirm":"Confiar y conectar","connected.title":"Conectado","connected.os":"Sistema operativo","connected.home":"Inicio","connected.listing":"Directorio de inicio","connected.transparency":"Comandos ejecutados (transparencia)","connected.disconnect":"Desconectar","connected.empty":"Directorio vacío","desktop.start":"Apps","desktop.disconnect":"Desconectar","desktop.comingSoon":"Próximamente","apps.files":"Archivos","apps.system":"Información del sistema","apps.terminal":"Terminal","apps.monitor":"Monitor del sistema","apps.editor":"Stallman","system.os":"Sistema operativo","system.host":"Host","system.home":"Inicio","system.transparency":"Comandos ejecutados (transparencia)","monitor.uptime":"Tiempo encendido","monitor.load":"Carga media (1 / 5 / 15 min)","monitor.memory":"Memoria","monitor.memoryUsage":"{used} de {total} ({pct}%)","monitor.unavailable":"Métricas no disponibles","files.up":"Subir","files.empty":"Directorio vacío","files.error":"No se pudo listar el directorio","editor.untitled":"Ningún archivo abierto","editor.save":"Guardar","editor.saved":"Guardado","editor.saving":"Guardando…","editor.unsaved":"Cambios sin guardar","editor.loadError":"No se pudo abrir el archivo","editor.saveError":"No se pudo guardar","editor.binary":"Este archivo no parece de texto y no se abrió."},Qw={en:kg,es:Xw},Zw=["en","es"],Jw="en";function e1(e=typeof navigator<"u"?navigator.languages:[]){for(const t of e){const r=t.toLowerCase().split("-")[0];if(r&&Zw.includes(r))return r}return Jw}function t1(e,t,r){const i=Qw[e][t]??kg[t];return r?i.replace(/\{(\w+)\}/g,(s,n)=>n in r?String(r[n]):`{${n}}`):i}function r1(e){return(t,r)=>t1(e,t,r)}async function As(e,t){const r=await fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),i=await r.json().catch(()=>({}));if(!r.ok){const s=typeof i=="object"&&i!==null&&"error"in i?String(i.error):`Request failed (${r.status})`;throw new Error(s)}return i}function i1(e){return As("/api/connect",e)}function Eg(e,t){return As("/api/listdir",{sessionId:e,path:t})}function s1(e){return As("/api/disconnect",{sessionId:e})}function n1(e){return As("/api/metrics",{sessionId:e})}function o1(e,t){return As("/api/readfile",{sessionId:e,path:t})}function l1(e,t,r){return As("/api/writefile",{sessionId:e,path:t,base64:r})}/**
|
|
41
|
+
* @license lucide-react v0.395.0 - ISC
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the ISC license.
|
|
44
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/const a1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Rg=(...e)=>e.filter((t,r,i)=>!!t&&i.indexOf(t)===r).join(" ");/**
|
|
46
|
+
* @license lucide-react v0.395.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/var c1={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"};/**
|
|
51
|
+
* @license lucide-react v0.395.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/const u1=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:s="",children:n,iconNode:o,...l},c)=>y.createElement("svg",{ref:c,...c1,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:Rg("lucide",s),...l},[...o.map(([a,h])=>y.createElement(a,h)),...Array.isArray(n)?n:[n]]));/**
|
|
56
|
+
* @license lucide-react v0.395.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/const Ie=(e,t)=>{const r=y.forwardRef(({className:i,...s},n)=>y.createElement(u1,{ref:n,iconNode:t,className:Rg(`lucide-${a1(e)}`,i),...s}));return r.displayName=`${e}`,r};/**
|
|
61
|
+
* @license lucide-react v0.395.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const h1=Ie("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
66
|
+
* @license lucide-react v0.395.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const d1=Ie("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
71
|
+
* @license lucide-react v0.395.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const f1=Ie("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
76
|
+
* @license lucide-react v0.395.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const p1=Ie("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
81
|
+
* @license lucide-react v0.395.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const _1=Ie("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
|
|
86
|
+
* @license lucide-react v0.395.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const Pg=Ie("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
91
|
+
* @license lucide-react v0.395.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const m1=Ie("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
96
|
+
* @license lucide-react v0.395.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const g1=Ie("KeyRound",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
101
|
+
* @license lucide-react v0.395.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const v1=Ie("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
106
|
+
* @license lucide-react v0.395.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const y1=Ie("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
111
|
+
* @license lucide-react v0.395.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const S1=Ie("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
116
|
+
* @license lucide-react v0.395.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const w1=Ie("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
121
|
+
* @license lucide-react v0.395.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const C1=Ie("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
126
|
+
* @license lucide-react v0.395.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const x1=Ie("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
131
|
+
* @license lucide-react v0.395.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const Dg=Ie("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
136
|
+
* @license lucide-react v0.395.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const b1=Ie("ShieldQuestion",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
141
|
+
* @license lucide-react v0.395.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const k1=Ie("SquareTerminal",[["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"}]]);/**
|
|
146
|
+
* @license lucide-react v0.395.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const E1=Ie("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
151
|
+
* @license lucide-react v0.395.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const R1=Ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Mg(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Mg(e[t]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function Lg(){for(var e,t,r=0,i="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Mg(e))&&(i&&(i+=" "),i+=t);return i}const Df=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Mf=Lg,$h=(e,t)=>r=>{var i;if((t==null?void 0:t.variants)==null)return Mf(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:n}=t,o=Object.keys(s).map(a=>{const h=r==null?void 0:r[a],u=n==null?void 0:n[a];if(h===null)return null;const d=Df(h)||Df(u);return s[a][d]}),l=r&&Object.entries(r).reduce((a,h)=>{let[u,d]=h;return d===void 0||(a[u]=d),a},{}),c=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((a,h)=>{let{class:u,className:d,...f}=h;return Object.entries(f).every(_=>{let[p,C]=_;return Array.isArray(C)?C.includes({...n,...l}[p]):{...n,...l}[p]===C})?[...a,u,d]:a},[]);return Mf(e,o,c,r==null?void 0:r.class,r==null?void 0:r.className)};function Lf(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function P1(...e){return t=>{let r=!1;const i=e.map(s=>{const n=Lf(s,t);return!r&&typeof n=="function"&&(r=!0),n});if(r)return()=>{for(let s=0;s<i.length;s++){const n=i[s];typeof n=="function"?n():Lf(e[s],null)}}}}function rt(...e){return y.useCallback(P1(...e),e)}function ks(e){const t=y.forwardRef((r,i)=>{let{children:s,...n}=r,o=null,l=!1;const c=[];Tf(s)&&typeof go=="function"&&(s=go(s._payload)),y.Children.forEach(s,d=>{var f;if(N1(d)){l=!0;const _=d;let p="child"in _.props?_.props.child:_.props.children;Tf(p)&&typeof go=="function"&&(p=go(p._payload)),o=L1(_,p),c.push((f=o==null?void 0:o.props)==null?void 0:f.children)}else c.push(d)}),o?o=y.cloneElement(o,void 0,c):!l&&y.Children.count(s)===1&&y.isValidElement(s)&&(o=s);const a=o?A1(o):void 0,h=rt(i,a);if(!o){if(s||s===0)throw new Error(l?z1(e):I1(e));return s}const u=T1(n,o.props??{});return o.type!==y.Fragment&&(u.ref=i?h:a),y.cloneElement(o,u)});return t.displayName=`${e}.Slot`,t}var D1=ks("Slot"),M1=Symbol.for("radix.slottable"),L1=(e,t)=>{if("child"in e.props){const r=e.props.child;return y.isValidElement(r)?y.cloneElement(r,void 0,e.props.children(r.props.children)):null}return y.isValidElement(t)?t:null};function T1(e,t){const r={...t};for(const i in t){const s=e[i],n=t[i];/^on[A-Z]/.test(i)?s&&n?r[i]=(...l)=>{const c=n(...l);return s(...l),c}:s&&(r[i]=s):i==="style"?r[i]={...s,...n}:i==="className"&&(r[i]=[s,n].filter(Boolean).join(" "))}return{...e,...r}}function A1(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function N1(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===M1}var O1=Symbol.for("react.lazy");function Tf(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===O1&&"_payload"in e&&B1(e._payload)}function B1(e){return typeof e=="object"&&e!==null&&"then"in e}var I1=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,z1=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,go=Gu[" use ".trim().toString()],F1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xe=F1.reduce((e,t)=>{const r=ks(`Primitive.${t}`),i=y.forwardRef((s,n)=>{const{asChild:o,...l}=s,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(c,{...l,ref:n})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function $1(e,t){e&&Zl.flushSync(()=>e.dispatchEvent(t))}function zi(e,t=[]){let r=[];function i(n,o){const l=y.createContext(o);l.displayName=n+"Context";const c=r.length;r=[...r,o];const a=u=>{var m;const{scope:d,children:f,..._}=u,p=((m=d==null?void 0:d[e])==null?void 0:m[c])||l,C=y.useMemo(()=>_,Object.values(_));return S.jsx(p.Provider,{value:C,children:f})};a.displayName=n+"Provider";function h(u,d){var p;const f=((p=d==null?void 0:d[e])==null?void 0:p[c])||l,_=y.useContext(f);if(_)return _;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${n}\``)}return[a,h]}const s=()=>{const n=r.map(o=>y.createContext(o));return function(l){const c=(l==null?void 0:l[e])||n;return y.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[i,W1(s,...t)]}function W1(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(n){const o=i.reduce((l,{useScope:c,scopeName:a})=>{const u=c(n)[`__scope${a}`];return{...l,...u}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function H1(e){const t=e+"CollectionProvider",[r,i]=zi(t),[s,n]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:C,children:m}=p,g=y.useRef(null),v=y.useRef(new Map).current;return S.jsx(s,{scope:C,itemMap:v,collectionRef:g,children:m})};o.displayName=t;const l=e+"CollectionSlot",c=ks(l),a=y.forwardRef((p,C)=>{const{scope:m,children:g}=p,v=n(l,m),w=rt(C,v.collectionRef);return S.jsx(c,{ref:w,children:g})});a.displayName=l;const h=e+"CollectionItemSlot",u="data-radix-collection-item",d=ks(h),f=y.forwardRef((p,C)=>{const{scope:m,children:g,...v}=p,w=y.useRef(null),x=rt(C,w),E=n(h,m);return y.useEffect(()=>(E.itemMap.set(w,{ref:w,...v}),()=>void E.itemMap.delete(w))),S.jsx(d,{[u]:"",ref:x,children:g})});f.displayName=h;function _(p){const C=n(e+"CollectionConsumer",p);return y.useCallback(()=>{const g=C.collectionRef.current;if(!g)return[];const v=Array.from(g.querySelectorAll(`[${u}]`));return Array.from(C.itemMap.values()).sort((E,P)=>v.indexOf(E.ref.current)-v.indexOf(P.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:o,Slot:a,ItemSlot:f},_,i]}function ve(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}var Cr=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},j1=Gu[" useInsertionEffect ".trim().toString()]||Cr;function Jl({prop:e,defaultProp:t,onChange:r=()=>{},caller:i}){const[s,n,o]=U1({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:s;{const h=y.useRef(e!==void 0);y.useEffect(()=>{const u=h.current;u!==l&&console.warn(`${i} is changing from ${u?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=l},[l,i])}const a=y.useCallback(h=>{var u;if(l){const d=V1(h)?h(e):h;d!==e&&((u=o.current)==null||u.call(o,d))}else n(h)},[l,e,n,o]);return[c,a]}function U1({defaultProp:e,onChange:t}){const[r,i]=y.useState(e),s=y.useRef(r),n=y.useRef(t);return j1(()=>{n.current=t},[t]),y.useEffect(()=>{var o;s.current!==r&&((o=n.current)==null||o.call(n,r),s.current=r)},[r,s]),[r,i,n]}function V1(e){return typeof e=="function"}function K1(e,t){return y.useReducer((r,i)=>t[r][i]??r,e)}var Fi=e=>{const{present:t,children:r}=e,i=Y1(t),s=typeof r=="function"?r({present:i.isPresent}):y.Children.only(r),n=q1(i.ref,G1(s));return typeof r=="function"||i.isPresent?y.cloneElement(s,{ref:n}):null};Fi.displayName="Presence";function Y1(e){const[t,r]=y.useState(),i=y.useRef(null),s=y.useRef(e),n=y.useRef("none"),o=e?"mounted":"unmounted",[l,c]=K1(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const a=vo(i.current);n.current=l==="mounted"?a:"none"},[l]),Cr(()=>{const a=i.current,h=s.current;if(h!==e){const d=n.current,f=vo(a);e?c("MOUNT"):f==="none"||(a==null?void 0:a.display)==="none"?c("UNMOUNT"):c(h&&d!==f?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Cr(()=>{if(t){let a;const h=t.ownerDocument.defaultView??window,u=f=>{const p=vo(i.current).includes(CSS.escape(f.animationName));if(f.target===t&&p&&(c("ANIMATION_END"),!s.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",a=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},d=f=>{f.target===t&&(n.current=vo(i.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{h.clearTimeout(a),t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:y.useCallback(a=>{i.current=a?getComputedStyle(a):null,r(a)},[])}}function Af(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function q1(...e){const t=y.useRef(e);return t.current=e,y.useCallback(r=>{const i=t.current;let s=!1;const n=i.map(o=>{const l=Af(o,r);return!s&&typeof l=="function"&&(s=!0),l});if(s)return()=>{for(let o=0;o<n.length;o++){const l=n[o];typeof l=="function"?l():Af(i[o],null)}}},[])}function vo(e){return(e==null?void 0:e.animationName)||"none"}function G1(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var X1=Gu[" useId ".trim().toString()]||(()=>{}),Q1=0;function _s(e){const[t,r]=y.useState(X1());return Cr(()=>{r(i=>i??String(Q1++))},[e]),e||(t?`radix-${t}`:"")}var Z1=y.createContext(void 0);function Tg(e){const t=y.useContext(Z1);return e||t||"ltr"}function Li(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...r)=>{var i;return(i=t.current)==null?void 0:i.call(t,...r)},[])}function J1(e,t=globalThis==null?void 0:globalThis.document){const r=Li(e);y.useEffect(()=>{const i=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[r,t])}var eC="DismissableLayer",eu="dismissableLayer.update",tC="dismissableLayer.pointerDownOutside",rC="dismissableLayer.focusOutside",Nf,Wh=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Hh=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:s,onPointerDownOutside:n,onFocusOutside:o,onInteractOutside:l,onDismiss:c,...a}=e,h=y.useContext(Wh),[u,d]=y.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=y.useState({}),p=rt(t,I=>d(I)),C=Array.from(h.layers),[m]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),g=C.indexOf(m),v=u?C.indexOf(u):-1,w=h.layersWithOutsidePointerEventsDisabled.size>0,x=v>=g,E=y.useRef(!1),P=oC(I=>{const $=I.target;if(!($ instanceof Node))return;const j=[...h.branches].some(T=>T.contains($));!x||j||(n==null||n(I),l==null||l(I),I.defaultPrevented||c==null||c())},{ownerDocument:f,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:E,dismissableSurfaces:h.dismissableSurfaces}),k=lC(I=>{if(i&&E.current)return;const $=I.target;[...h.branches].some(T=>T.contains($))||(o==null||o(I),l==null||l(I),I.defaultPrevented||c==null||c())},f);return J1(I=>{v===h.layers.size-1&&(s==null||s(I),!I.defaultPrevented&&c&&(I.preventDefault(),c()))},f),y.useEffect(()=>{if(u)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(Nf=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(u)),h.layers.add(u),Of(),()=>{r&&(h.layersWithOutsidePointerEventsDisabled.delete(u),h.layersWithOutsidePointerEventsDisabled.size===0&&(f.body.style.pointerEvents=Nf))}},[u,f,r,h]),y.useEffect(()=>()=>{u&&(h.layers.delete(u),h.layersWithOutsidePointerEventsDisabled.delete(u),Of())},[u,h]),y.useEffect(()=>{const I=()=>_({});return document.addEventListener(eu,I),()=>document.removeEventListener(eu,I)},[]),S.jsx(xe.div,{...a,ref:p,style:{pointerEvents:w?x?"auto":"none":void 0,...e.style},onFocusCapture:ve(e.onFocusCapture,k.onFocusCapture),onBlurCapture:ve(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:ve(e.onPointerDownCapture,P.onPointerDownCapture)})});Hh.displayName=eC;var iC="DismissableLayerBranch",sC=y.forwardRef((e,t)=>{const r=y.useContext(Wh),i=y.useRef(null),s=rt(t,i);return y.useEffect(()=>{const n=i.current;if(n)return r.branches.add(n),()=>{r.branches.delete(n)}},[r.branches]),S.jsx(xe.div,{...e,ref:s})});sC.displayName=iC;function nC(){const e=y.useContext(Wh),[t,r]=y.useState(null);return y.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}function oC(e,t){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:n}=t,o=Li(e),l=y.useRef(!1),c=y.useRef(!1),a=y.useRef(new Map),h=y.useRef(()=>{});return y.useEffect(()=>{function u(){c.current=!1,s.current=!1,a.current.clear()}function d(){return Array.from(a.current.values()).some(Boolean)}function f(g){if(!c.current)return;const v=g.target;v instanceof Node&&[...n].some(x=>x.contains(v))||a.current.set(g.type,!0),g.type==="click"&&window.setTimeout(()=>{c.current&&h.current()},0)}function _(g){c.current&&a.current.set(g.type,!1)}const p=g=>{if(g.target&&!l.current){let v=function(){r.removeEventListener("click",h.current);const x=d();u(),x||Ag(tC,o,w,{discrete:!0})};const w={originalEvent:g};c.current=!0,s.current=i&&g.button===0,a.current.clear(),!i||g.button!==0?v():(r.removeEventListener("click",h.current),h.current=v,r.addEventListener("click",h.current,{once:!0}))}else r.removeEventListener("click",h.current),u();l.current=!1},C=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const g of C)r.addEventListener(g,f,!0),r.addEventListener(g,_);const m=window.setTimeout(()=>{r.addEventListener("pointerdown",p)},0);return()=>{window.clearTimeout(m),r.removeEventListener("pointerdown",p),r.removeEventListener("click",h.current);for(const g of C)r.removeEventListener(g,f,!0),r.removeEventListener(g,_)}},[r,o,i,s,n]),{onPointerDownCapture:()=>l.current=!0}}function lC(e,t=globalThis==null?void 0:globalThis.document){const r=Li(e),i=y.useRef(!1);return y.useEffect(()=>{const s=n=>{n.target&&!i.current&&Ag(rC,r,{originalEvent:n},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Of(){const e=new CustomEvent(eu);document.dispatchEvent(e)}function Ag(e,t,r,{discrete:i}){const s=r.originalEvent.target,n=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),i?$1(s,n):s.dispatchEvent(n)}var za="focusScope.autoFocusOnMount",Fa="focusScope.autoFocusOnUnmount",Bf={bubbles:!1,cancelable:!0},aC="FocusScope",jh=y.forwardRef((e,t)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:n,...o}=e,[l,c]=y.useState(null),a=Li(s),h=Li(n),u=y.useRef(null),d=rt(t,p=>c(p)),f=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(i){let p=function(v){if(f.paused||!l)return;const w=v.target;l.contains(w)?u.current=w:Fr(u.current,{select:!0})},C=function(v){if(f.paused||!l)return;const w=v.relatedTarget;w!==null&&(l.contains(w)||Fr(u.current,{select:!0}))},m=function(v){if(document.activeElement===document.body)for(const x of v)x.removedNodes.length>0&&Fr(l)};document.addEventListener("focusin",p),document.addEventListener("focusout",C);const g=new MutationObserver(m);return l&&g.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",C),g.disconnect()}}},[i,l,f.paused]),y.useEffect(()=>{if(l){zf.add(f);const p=document.activeElement;if(!l.contains(p)){const m=new CustomEvent(za,Bf);l.addEventListener(za,a),l.dispatchEvent(m),m.defaultPrevented||(cC(pC(Ng(l)),{select:!0}),document.activeElement===p&&Fr(l))}return()=>{l.removeEventListener(za,a),setTimeout(()=>{const m=new CustomEvent(Fa,Bf);l.addEventListener(Fa,h),l.dispatchEvent(m),m.defaultPrevented||Fr(p??document.body,{select:!0}),l.removeEventListener(Fa,h),zf.remove(f)},0)}}},[l,a,h,f]);const _=y.useCallback(p=>{if(!r&&!i||f.paused)return;const C=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,m=document.activeElement;if(C&&m){const g=p.currentTarget,[v,w]=uC(g);v&&w?!p.shiftKey&&m===w?(p.preventDefault(),r&&Fr(v,{select:!0})):p.shiftKey&&m===v&&(p.preventDefault(),r&&Fr(w,{select:!0})):m===g&&p.preventDefault()}},[r,i,f.paused]);return S.jsx(xe.div,{tabIndex:-1,...o,ref:d,onKeyDown:_})});jh.displayName=aC;function cC(e,{select:t=!1}={}){const r=document.activeElement;for(const i of e)if(Fr(i,{select:t}),document.activeElement!==r)return}function uC(e){const t=Ng(e),r=If(t,e),i=If(t.reverse(),e);return[r,i]}function Ng(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const s=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||s?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function If(e,t){for(const r of e)if(!hC(r,{upTo:t}))return r}function hC(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function dC(e){return e instanceof HTMLInputElement&&"select"in e}function Fr(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&dC(e)&&t&&e.select()}}var zf=fC();function fC(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Ff(e,t),e.unshift(t)},remove(t){var r;e=Ff(e,t),(r=e[0])==null||r.resume()}}}function Ff(e,t){const r=[...e],i=r.indexOf(t);return i!==-1&&r.splice(i,1),r}function pC(e){return e.filter(t=>t.tagName!=="A")}var _C="Portal",Uh=y.forwardRef((e,t)=>{var l;const{container:r,...i}=e,[s,n]=y.useState(!1);Cr(()=>n(!0),[]);const o=r||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?Zl.createPortal(S.jsx(xe.div,{...i,ref:t}),o):null});Uh.displayName=_C;var yo=0,Qt=null;function Og(){y.useEffect(()=>{Qt||(Qt={start:$f(),end:$f()});const{start:e,end:t}=Qt;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),yo++,()=>{yo===1&&(Qt==null||Qt.start.remove(),Qt==null||Qt.end.remove(),Qt=null),yo=Math.max(0,yo-1)}},[])}function $f(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var sr=function(){return sr=Object.assign||function(t){for(var r,i=1,s=arguments.length;i<s;i++){r=arguments[i];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},sr.apply(this,arguments)};function Bg(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r}function mC(e,t,r){if(r||arguments.length===2)for(var i=0,s=t.length,n;i<s;i++)(n||!(i in t))&&(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}var Vo="right-scroll-bar-position",Ko="width-before-scroll-bar",gC="with-scroll-bars-hidden",vC="--removed-body-scroll-bar-size";function $a(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function yC(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(i){var s=r.value;s!==i&&(r.value=i,r.callback(i,s))}}}})[0];return r.callback=t,r.facade}var SC=typeof window<"u"?y.useLayoutEffect:y.useEffect,Wf=new WeakMap;function wC(e,t){var r=yC(null,function(i){return e.forEach(function(s){return $a(s,i)})});return SC(function(){var i=Wf.get(r);if(i){var s=new Set(i),n=new Set(e),o=r.current;s.forEach(function(l){n.has(l)||$a(l,null)}),n.forEach(function(l){s.has(l)||$a(l,o)})}Wf.set(r,e)},[e]),r}function CC(e){return e}function xC(e,t){t===void 0&&(t=CC);var r=[],i=!1,s={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(n){var o=t(n,i);return r.push(o),function(){r=r.filter(function(l){return l!==o})}},assignSyncMedium:function(n){for(i=!0;r.length;){var o=r;r=[],o.forEach(n)}r={push:function(l){return n(l)},filter:function(){return r}}},assignMedium:function(n){i=!0;var o=[];if(r.length){var l=r;r=[],l.forEach(n),o=r}var c=function(){var h=o;o=[],h.forEach(n)},a=function(){return Promise.resolve().then(c)};a(),r={push:function(h){o.push(h),a()},filter:function(h){return o=o.filter(h),r}}}};return s}function bC(e){e===void 0&&(e={});var t=xC(null);return t.options=sr({async:!0,ssr:!1},e),t}var Ig=function(e){var t=e.sideCar,r=Bg(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return y.createElement(i,sr({},r))};Ig.isSideCarExport=!0;function kC(e,t){return e.useMedium(t),Ig}var zg=bC(),Wa=function(){},ea=y.forwardRef(function(e,t){var r=y.useRef(null),i=y.useState({onScrollCapture:Wa,onWheelCapture:Wa,onTouchMoveCapture:Wa}),s=i[0],n=i[1],o=e.forwardProps,l=e.children,c=e.className,a=e.removeScrollBar,h=e.enabled,u=e.shards,d=e.sideCar,f=e.noRelative,_=e.noIsolation,p=e.inert,C=e.allowPinchZoom,m=e.as,g=m===void 0?"div":m,v=e.gapMode,w=Bg(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=d,E=wC([r,t]),P=sr(sr({},w),s);return y.createElement(y.Fragment,null,h&&y.createElement(x,{sideCar:zg,removeScrollBar:a,shards:u,noRelative:f,noIsolation:_,inert:p,setCallbacks:n,allowPinchZoom:!!C,lockRef:r,gapMode:v}),o?y.cloneElement(y.Children.only(l),sr(sr({},P),{ref:E})):y.createElement(g,sr({},P,{className:c,ref:E}),l))});ea.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ea.classNames={fullWidth:Ko,zeroRight:Vo};var EC=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function RC(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=EC();return t&&e.setAttribute("nonce",t),e}function PC(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function DC(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var MC=function(){var e=0,t=null;return{add:function(r){e==0&&(t=RC())&&(PC(t,r),DC(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},LC=function(){var e=MC();return function(t,r){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Fg=function(){var e=LC(),t=function(r){var i=r.styles,s=r.dynamic;return e(i,s),null};return t},TC={left:0,top:0,right:0,gap:0},Ha=function(e){return parseInt(e||"",10)||0},AC=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],i=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Ha(r),Ha(i),Ha(s)]},NC=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return TC;var t=AC(e),r=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-r+t[2]-t[0])}},OC=Fg(),ms="data-scroll-locked",BC=function(e,t,r,i){var s=e.left,n=e.top,o=e.right,l=e.gap;return r===void 0&&(r="margin"),`
|
|
156
|
+
.`.concat(gC,` {
|
|
157
|
+
overflow: hidden `).concat(i,`;
|
|
158
|
+
padding-right: `).concat(l,"px ").concat(i,`;
|
|
159
|
+
}
|
|
160
|
+
body[`).concat(ms,`] {
|
|
161
|
+
overflow: hidden `).concat(i,`;
|
|
162
|
+
overscroll-behavior: contain;
|
|
163
|
+
`).concat([t&&"position: relative ".concat(i,";"),r==="margin"&&`
|
|
164
|
+
padding-left: `.concat(s,`px;
|
|
165
|
+
padding-top: `).concat(n,`px;
|
|
166
|
+
padding-right: `).concat(o,`px;
|
|
167
|
+
margin-left:0;
|
|
168
|
+
margin-top:0;
|
|
169
|
+
margin-right: `).concat(l,"px ").concat(i,`;
|
|
170
|
+
`),r==="padding"&&"padding-right: ".concat(l,"px ").concat(i,";")].filter(Boolean).join(""),`
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.`).concat(Vo,` {
|
|
174
|
+
right: `).concat(l,"px ").concat(i,`;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.`).concat(Ko,` {
|
|
178
|
+
margin-right: `).concat(l,"px ").concat(i,`;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.`).concat(Vo," .").concat(Vo,` {
|
|
182
|
+
right: 0 `).concat(i,`;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.`).concat(Ko," .").concat(Ko,` {
|
|
186
|
+
margin-right: 0 `).concat(i,`;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
body[`).concat(ms,`] {
|
|
190
|
+
`).concat(vC,": ").concat(l,`px;
|
|
191
|
+
}
|
|
192
|
+
`)},Hf=function(){var e=parseInt(document.body.getAttribute(ms)||"0",10);return isFinite(e)?e:0},IC=function(){y.useEffect(function(){return document.body.setAttribute(ms,(Hf()+1).toString()),function(){var e=Hf()-1;e<=0?document.body.removeAttribute(ms):document.body.setAttribute(ms,e.toString())}},[])},zC=function(e){var t=e.noRelative,r=e.noImportant,i=e.gapMode,s=i===void 0?"margin":i;IC();var n=y.useMemo(function(){return NC(s)},[s]);return y.createElement(OC,{styles:BC(n,!t,s,r?"":"!important")})},tu=!1;if(typeof window<"u")try{var So=Object.defineProperty({},"passive",{get:function(){return tu=!0,!0}});window.addEventListener("test",So,So),window.removeEventListener("test",So,So)}catch{tu=!1}var ji=tu?{passive:!1}:!1,FC=function(e){return e.tagName==="TEXTAREA"},$g=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!FC(e)&&r[t]==="visible")},$C=function(e){return $g(e,"overflowY")},WC=function(e){return $g(e,"overflowX")},jf=function(e,t){var r=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var s=Wg(e,i);if(s){var n=Hg(e,i),o=n[1],l=n[2];if(o>l)return!0}i=i.parentNode}while(i&&i!==r.body);return!1},HC=function(e){var t=e.scrollTop,r=e.scrollHeight,i=e.clientHeight;return[t,r,i]},jC=function(e){var t=e.scrollLeft,r=e.scrollWidth,i=e.clientWidth;return[t,r,i]},Wg=function(e,t){return e==="v"?$C(t):WC(t)},Hg=function(e,t){return e==="v"?HC(t):jC(t)},UC=function(e,t){return e==="h"&&t==="rtl"?-1:1},VC=function(e,t,r,i,s){var n=UC(e,window.getComputedStyle(t).direction),o=n*i,l=r.target,c=t.contains(l),a=!1,h=o>0,u=0,d=0;do{if(!l)break;var f=Hg(e,l),_=f[0],p=f[1],C=f[2],m=p-C-n*_;(_||m)&&Wg(e,l)&&(u+=m,d+=_);var g=l.parentNode;l=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(h&&Math.abs(u)<1||!h&&Math.abs(d)<1)&&(a=!0),a},wo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Uf=function(e){return[e.deltaX,e.deltaY]},Vf=function(e){return e&&"current"in e?e.current:e},KC=function(e,t){return e[0]===t[0]&&e[1]===t[1]},YC=function(e){return`
|
|
193
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
194
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
195
|
+
`)},qC=0,Ui=[];function GC(e){var t=y.useRef([]),r=y.useRef([0,0]),i=y.useRef(),s=y.useState(qC++)[0],n=y.useState(Fg)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var p=mC([e.lockRef.current],(e.shards||[]).map(Vf),!0).filter(Boolean);return p.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),p.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=y.useCallback(function(p,C){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var m=wo(p),g=r.current,v="deltaX"in p?p.deltaX:g[0]-m[0],w="deltaY"in p?p.deltaY:g[1]-m[1],x,E=p.target,P=Math.abs(v)>Math.abs(w)?"h":"v";if("touches"in p&&P==="h"&&E.type==="range")return!1;var k=window.getSelection(),I=k&&k.anchorNode,$=I?I===E||I.contains(E):!1;if($)return!1;var j=jf(P,E);if(!j)return!0;if(j?x=P:(x=P==="v"?"h":"v",j=jf(P,E)),!j)return!1;if(!i.current&&"changedTouches"in p&&(v||w)&&(i.current=x),!x)return!0;var T=i.current||x;return VC(T,C,p,T==="h"?v:w)},[]),c=y.useCallback(function(p){var C=p;if(!(!Ui.length||Ui[Ui.length-1]!==n)){var m="deltaY"in C?Uf(C):wo(C),g=t.current.filter(function(x){return x.name===C.type&&(x.target===C.target||C.target===x.shadowParent)&&KC(x.delta,m)})[0];if(g&&g.should){C.cancelable&&C.preventDefault();return}if(!g){var v=(o.current.shards||[]).map(Vf).filter(Boolean).filter(function(x){return x.contains(C.target)}),w=v.length>0?l(C,v[0]):!o.current.noIsolation;w&&C.cancelable&&C.preventDefault()}}},[]),a=y.useCallback(function(p,C,m,g){var v={name:p,delta:C,target:m,should:g,shadowParent:XC(m)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(w){return w!==v})},1)},[]),h=y.useCallback(function(p){r.current=wo(p),i.current=void 0},[]),u=y.useCallback(function(p){a(p.type,Uf(p),p.target,l(p,e.lockRef.current))},[]),d=y.useCallback(function(p){a(p.type,wo(p),p.target,l(p,e.lockRef.current))},[]);y.useEffect(function(){return Ui.push(n),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:d}),document.addEventListener("wheel",c,ji),document.addEventListener("touchmove",c,ji),document.addEventListener("touchstart",h,ji),function(){Ui=Ui.filter(function(p){return p!==n}),document.removeEventListener("wheel",c,ji),document.removeEventListener("touchmove",c,ji),document.removeEventListener("touchstart",h,ji)}},[]);var f=e.removeScrollBar,_=e.inert;return y.createElement(y.Fragment,null,_?y.createElement(n,{styles:YC(s)}):null,f?y.createElement(zC,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function XC(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const QC=kC(zg,GC);var Vh=y.forwardRef(function(e,t){return y.createElement(ea,sr({},e,{ref:t,sideCar:QC}))});Vh.classNames=ea.classNames;var ZC=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Vi=new WeakMap,Co=new WeakMap,xo={},ja=0,jg=function(e){return e&&(e.host||jg(e.parentNode))},JC=function(e,t){return t.map(function(r){if(e.contains(r))return r;var i=jg(r);return i&&e.contains(i)?i:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},ex=function(e,t,r,i){var s=JC(t,Array.isArray(e)?e:[e]);xo[r]||(xo[r]=new WeakMap);var n=xo[r],o=[],l=new Set,c=new Set(s),a=function(u){!u||l.has(u)||(l.add(u),a(u.parentNode))};s.forEach(a);var h=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(d){if(l.has(d))h(d);else try{var f=d.getAttribute(i),_=f!==null&&f!=="false",p=(Vi.get(d)||0)+1,C=(n.get(d)||0)+1;Vi.set(d,p),n.set(d,C),o.push(d),p===1&&_&&Co.set(d,!0),C===1&&d.setAttribute(r,"true"),_||d.setAttribute(i,"true")}catch(m){console.error("aria-hidden: cannot operate on ",d,m)}})};return h(t),l.clear(),ja++,function(){o.forEach(function(u){var d=Vi.get(u)-1,f=n.get(u)-1;Vi.set(u,d),n.set(u,f),d||(Co.has(u)||u.removeAttribute(i),Co.delete(u)),f||u.removeAttribute(r)}),ja--,ja||(Vi=new WeakMap,Vi=new WeakMap,Co=new WeakMap,xo={})}},Ug=function(e,t,r){r===void 0&&(r="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),s=ZC(e);return s?(i.push.apply(i,Array.from(s.querySelectorAll("[aria-live], script"))),ex(i,s,r,"aria-hidden")):function(){return null}},ta="Dialog",[Vg,Kg]=zi(ta),[tx,qt]=Vg(ta),Yg=e=>{const{__scopeDialog:t,children:r,open:i,defaultOpen:s,onOpenChange:n,modal:o=!0}=e,l=y.useRef(null),c=y.useRef(null),[a,h]=Jl({prop:i,defaultProp:s??!1,onChange:n,caller:ta});return S.jsx(tx,{scope:t,triggerRef:l,contentRef:c,contentId:_s(),titleId:_s(),descriptionId:_s(),open:a,onOpenChange:h,onOpenToggle:y.useCallback(()=>h(u=>!u),[h]),modal:o,children:r})};Yg.displayName=ta;var qg="DialogTrigger",Gg=y.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,s=qt(qg,r),n=rt(t,s.triggerRef);return S.jsx(xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":qh(s.open),...i,ref:n,onClick:ve(e.onClick,s.onOpenToggle)})});Gg.displayName=qg;var Kh="DialogPortal",[rx,Xg]=Vg(Kh,{forceMount:void 0}),Qg=e=>{const{__scopeDialog:t,forceMount:r,children:i,container:s}=e,n=qt(Kh,t);return S.jsx(rx,{scope:t,forceMount:r,children:y.Children.map(i,o=>S.jsx(Fi,{present:r||n.open,children:S.jsx(Uh,{asChild:!0,container:s,children:o})}))})};Qg.displayName=Kh;var bl="DialogOverlay",Zg=y.forwardRef((e,t)=>{const r=Xg(bl,e.__scopeDialog),{forceMount:i=r.forceMount,...s}=e,n=qt(bl,e.__scopeDialog);return n.modal?S.jsx(Fi,{present:i||n.open,children:S.jsx(sx,{...s,ref:t})}):null});Zg.displayName=bl;var ix=ks("DialogOverlay.RemoveScroll"),sx=y.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,s=qt(bl,r),n=nC(),o=rt(t,n);return S.jsx(Vh,{as:ix,allowPinchZoom:!0,shards:[s.contentRef],children:S.jsx(xe.div,{"data-state":qh(s.open),...i,ref:o,style:{pointerEvents:"auto",...i.style}})})}),Es="DialogContent",Jg=y.forwardRef((e,t)=>{const r=Xg(Es,e.__scopeDialog),{forceMount:i=r.forceMount,...s}=e,n=qt(Es,e.__scopeDialog);return S.jsx(Fi,{present:i||n.open,children:n.modal?S.jsx(nx,{...s,ref:t}):S.jsx(ox,{...s,ref:t})})});Jg.displayName=Es;var nx=y.forwardRef((e,t)=>{const r=qt(Es,e.__scopeDialog),i=y.useRef(null),s=rt(t,r.contentRef,i);return y.useEffect(()=>{const n=i.current;if(n)return Ug(n)},[]),S.jsx(ev,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:ve(e.onCloseAutoFocus,n=>{var o;n.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ve(e.onPointerDownOutside,n=>{const o=n.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&n.preventDefault()}),onFocusOutside:ve(e.onFocusOutside,n=>n.preventDefault())})}),ox=y.forwardRef((e,t)=>{const r=qt(Es,e.__scopeDialog),i=y.useRef(!1),s=y.useRef(!1);return S.jsx(ev,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,n),n.defaultPrevented||(i.current||(l=r.triggerRef.current)==null||l.focus(),n.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:n=>{var c,a;(c=e.onInteractOutside)==null||c.call(e,n),n.defaultPrevented||(i.current=!0,n.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=n.target;((a=r.triggerRef.current)==null?void 0:a.contains(o))&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&s.current&&n.preventDefault()}})}),ev=y.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:n,...o}=e,l=qt(Es,r);return Og(),S.jsx(S.Fragment,{children:S.jsx(jh,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:n,children:S.jsx(Hh,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":qh(l.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})}),tv="DialogTitle",rv=y.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,s=qt(tv,r);return S.jsx(xe.h2,{id:s.titleId,...i,ref:t})});rv.displayName=tv;var iv="DialogDescription",sv=y.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,s=qt(iv,r);return S.jsx(xe.p,{id:s.descriptionId,...i,ref:t})});sv.displayName=iv;var nv="DialogClose",Yh=y.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,s=qt(nv,r);return S.jsx(xe.button,{type:"button",...i,ref:t,onClick:ve(e.onClick,()=>s.onOpenChange(!1))})});Yh.displayName=nv;function qh(e){return e?"open":"closed"}var ov="AlertDialog",[lx]=zi(ov,[Kg]),Mr=Kg(),lv=e=>{const{__scopeAlertDialog:t,...r}=e,i=Mr(t);return S.jsx(Yg,{...i,...r,modal:!0})};lv.displayName=ov;var ax="AlertDialogTrigger",cx=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...i}=e,s=Mr(r);return S.jsx(Gg,{...s,...i,ref:t})});cx.displayName=ax;var ux="AlertDialogPortal",av=e=>{const{__scopeAlertDialog:t,...r}=e,i=Mr(t);return S.jsx(Qg,{...i,...r})};av.displayName=ux;var hx="AlertDialogOverlay",cv=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...i}=e,s=Mr(r);return S.jsx(Zg,{...s,...i,ref:t})});cv.displayName=hx;var uv="AlertDialogContent",[dx,fx]=lx(uv),hv=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:i,...s}=e,n=Mr(r),o=y.useRef(null),l=rt(t,o),c=y.useRef(null);return S.jsx(dx,{scope:r,cancelRef:c,children:S.jsx(Jg,{role:"alertdialog",...n,...s,ref:l,onOpenAutoFocus:ve(s.onOpenAutoFocus,a=>{var h;a.preventDefault(),(h=c.current)==null||h.focus({preventScroll:!0})}),onPointerDownOutside:a=>a.preventDefault(),onInteractOutside:a=>a.preventDefault(),children:i})})});hv.displayName=uv;var px="AlertDialogTitle",dv=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...i}=e,s=Mr(r);return S.jsx(rv,{...s,...i,ref:t})});dv.displayName=px;var _x="AlertDialogDescription",fv=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...i}=e,s=Mr(r);return S.jsx(sv,{...s,...i,ref:t})});fv.displayName=_x;var mx="AlertDialogAction",pv=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...i}=e,s=Mr(r);return S.jsx(Yh,{...s,...i,ref:t})});pv.displayName=mx;var _v="AlertDialogCancel",mv=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...i}=e,{cancelRef:s}=fx(_v,r),n=Mr(r),o=rt(t,s);return S.jsx(Yh,{...n,...i,ref:o})});mv.displayName=_v;var gx=lv,vx=av,yx=cv,Sx=hv,wx=pv,Cx=mv,xx=dv,bx=fv;function kx(e){const[t,r]=y.useState(void 0);return Cr(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const n=s[0];let o,l;if("borderBoxSize"in n){const c=n.borderBoxSize,a=Array.isArray(c)?c[0]:c;o=a.inlineSize,l=a.blockSize}else o=e.offsetWidth,l=e.offsetHeight;r({width:o,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else r(void 0)},[e]),t}const Ex=["top","right","bottom","left"],ni=Math.min,wt=Math.max,kl=Math.round,bo=Math.floor,cr=e=>({x:e,y:e}),Rx={left:"right",right:"left",bottom:"top",top:"bottom"};function ru(e,t,r){return wt(e,ni(t,r))}function Rr(e,t){return typeof e=="function"?e(t):e}function Pr(e){return e.split("-")[0]}function Ns(e){return e.split("-")[1]}function Gh(e){return e==="x"?"y":"x"}function Xh(e){return e==="y"?"height":"width"}function nr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Qh(e){return Gh(nr(e))}function Px(e,t,r){r===void 0&&(r=!1);const i=Ns(e),s=Qh(e),n=Xh(s);let o=s==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(o=El(o)),[o,El(o)]}function Dx(e){const t=El(e);return[iu(e),t,iu(t)]}function iu(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Kf=["left","right"],Yf=["right","left"],Mx=["top","bottom"],Lx=["bottom","top"];function Tx(e,t,r){switch(e){case"top":case"bottom":return r?t?Yf:Kf:t?Kf:Yf;case"left":case"right":return t?Mx:Lx;default:return[]}}function Ax(e,t,r,i){const s=Ns(e);let n=Tx(Pr(e),r==="start",i);return s&&(n=n.map(o=>o+"-"+s),t&&(n=n.concat(n.map(iu)))),n}function El(e){const t=Pr(e);return Rx[t]+e.slice(t.length)}function Nx(e){return{top:0,right:0,bottom:0,left:0,...e}}function gv(e){return typeof e!="number"?Nx(e):{top:e,right:e,bottom:e,left:e}}function Rl(e){const{x:t,y:r,width:i,height:s}=e;return{width:i,height:s,top:r,left:t,right:t+i,bottom:r+s,x:t,y:r}}function qf(e,t,r){let{reference:i,floating:s}=e;const n=nr(t),o=Qh(t),l=Xh(o),c=Pr(t),a=n==="y",h=i.x+i.width/2-s.width/2,u=i.y+i.height/2-s.height/2,d=i[l]/2-s[l]/2;let f;switch(c){case"top":f={x:h,y:i.y-s.height};break;case"bottom":f={x:h,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:u};break;case"left":f={x:i.x-s.width,y:u};break;default:f={x:i.x,y:i.y}}switch(Ns(t)){case"start":f[o]-=d*(r&&a?-1:1);break;case"end":f[o]+=d*(r&&a?-1:1);break}return f}async function Ox(e,t){var r;t===void 0&&(t={});const{x:i,y:s,platform:n,rects:o,elements:l,strategy:c}=e,{boundary:a="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:d=!1,padding:f=0}=Rr(t,e),_=gv(f),C=l[d?u==="floating"?"reference":"floating":u],m=Rl(await n.getClippingRect({element:(r=await(n.isElement==null?void 0:n.isElement(C)))==null||r?C:C.contextElement||await(n.getDocumentElement==null?void 0:n.getDocumentElement(l.floating)),boundary:a,rootBoundary:h,strategy:c})),g=u==="floating"?{x:i,y:s,width:o.floating.width,height:o.floating.height}:o.reference,v=await(n.getOffsetParent==null?void 0:n.getOffsetParent(l.floating)),w=await(n.isElement==null?void 0:n.isElement(v))?await(n.getScale==null?void 0:n.getScale(v))||{x:1,y:1}:{x:1,y:1},x=Rl(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:v,strategy:c}):g);return{top:(m.top-x.top+_.top)/w.y,bottom:(x.bottom-m.bottom+_.bottom)/w.y,left:(m.left-x.left+_.left)/w.x,right:(x.right-m.right+_.right)/w.x}}const Bx=50,Ix=async(e,t,r)=>{const{placement:i="bottom",strategy:s="absolute",middleware:n=[],platform:o}=r,l=o.detectOverflow?o:{...o,detectOverflow:Ox},c=await(o.isRTL==null?void 0:o.isRTL(t));let a=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:u}=qf(a,i,c),d=i,f=0;const _={};for(let p=0;p<n.length;p++){const C=n[p];if(!C)continue;const{name:m,fn:g}=C,{x:v,y:w,data:x,reset:E}=await g({x:h,y:u,initialPlacement:i,placement:d,strategy:s,middlewareData:_,rects:a,platform:l,elements:{reference:e,floating:t}});h=v??h,u=w??u,_[m]={..._[m],...x},E&&f<Bx&&(f++,typeof E=="object"&&(E.placement&&(d=E.placement),E.rects&&(a=E.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):E.rects),{x:h,y:u}=qf(a,d,c)),p=-1)}return{x:h,y:u,placement:d,strategy:s,middlewareData:_}},zx=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:i,placement:s,rects:n,platform:o,elements:l,middlewareData:c}=t,{element:a,padding:h=0}=Rr(e,t)||{};if(a==null)return{};const u=gv(h),d={x:r,y:i},f=Qh(s),_=Xh(f),p=await o.getDimensions(a),C=f==="y",m=C?"top":"left",g=C?"bottom":"right",v=C?"clientHeight":"clientWidth",w=n.reference[_]+n.reference[f]-d[f]-n.floating[_],x=d[f]-n.reference[f],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a));let P=E?E[v]:0;(!P||!await(o.isElement==null?void 0:o.isElement(E)))&&(P=l.floating[v]||n.floating[_]);const k=w/2-x/2,I=P/2-p[_]/2-1,$=ni(u[m],I),j=ni(u[g],I),T=$,R=P-p[_]-j,A=P/2-p[_]/2+k,N=ru(T,A,R),L=!c.arrow&&Ns(s)!=null&&A!==N&&n.reference[_]/2-(A<T?$:j)-p[_]/2<0,F=L?A<T?A-T:A-R:0;return{[f]:d[f]+F,data:{[f]:N,centerOffset:A-N-F,...L&&{alignmentOffset:F}},reset:L}}}),Fx=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,i;const{placement:s,middlewareData:n,rects:o,initialPlacement:l,platform:c,elements:a}=t,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:p=!0,...C}=Rr(e,t);if((r=n.arrow)!=null&&r.alignmentOffset)return{};const m=Pr(s),g=nr(l),v=Pr(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(a.floating)),x=d||(v||!p?[El(l)]:Dx(l)),E=_!=="none";!d&&E&&x.push(...Ax(l,p,_,w));const P=[l,...x],k=await c.detectOverflow(t,C),I=[];let $=((i=n.flip)==null?void 0:i.overflows)||[];if(h&&I.push(k[m]),u){const A=Px(s,o,w);I.push(k[A[0]],k[A[1]])}if($=[...$,{placement:s,overflows:I}],!I.every(A=>A<=0)){var j,T;const A=(((j=n.flip)==null?void 0:j.index)||0)+1,N=P[A];if(N&&(!(u==="alignment"?g!==nr(N):!1)||$.every(b=>nr(b.placement)===g?b.overflows[0]>0:!0)))return{data:{index:A,overflows:$},reset:{placement:N}};let L=(T=$.filter(F=>F.overflows[0]<=0).sort((F,b)=>F.overflows[1]-b.overflows[1])[0])==null?void 0:T.placement;if(!L)switch(f){case"bestFit":{var R;const F=(R=$.filter(b=>{if(E){const B=nr(b.placement);return B===g||B==="y"}return!0}).map(b=>[b.placement,b.overflows.filter(B=>B>0).reduce((B,D)=>B+D,0)]).sort((b,B)=>b[1]-B[1])[0])==null?void 0:R[0];F&&(L=F);break}case"initialPlacement":L=l;break}if(s!==L)return{reset:{placement:L}}}return{}}}};function Gf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xf(e){return Ex.some(t=>e[t]>=0)}const $x=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:i}=t,{strategy:s="referenceHidden",...n}=Rr(e,t);switch(s){case"referenceHidden":{const o=await i.detectOverflow(t,{...n,elementContext:"reference"}),l=Gf(o,r.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Xf(l)}}}case"escaped":{const o=await i.detectOverflow(t,{...n,altBoundary:!0}),l=Gf(o,r.floating);return{data:{escapedOffsets:l,escaped:Xf(l)}}}default:return{}}}}},vv=new Set(["left","top"]);async function Wx(e,t){const{placement:r,platform:i,elements:s}=e,n=await(i.isRTL==null?void 0:i.isRTL(s.floating)),o=Pr(r),l=Ns(r),c=nr(r)==="y",a=vv.has(o)?-1:1,h=n&&c?-1:1,u=Rr(t,e);let{mainAxis:d,crossAxis:f,alignmentAxis:_}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof _=="number"&&(f=l==="end"?_*-1:_),c?{x:f*h,y:d*a}:{x:d*a,y:f*h}}const Hx=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,i;const{x:s,y:n,placement:o,middlewareData:l}=t,c=await Wx(t,e);return o===((r=l.offset)==null?void 0:r.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:s+c.x,y:n+c.y,data:{...c,placement:o}}}}},jx=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:i,placement:s,platform:n}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:m=>{let{x:g,y:v}=m;return{x:g,y:v}}},...a}=Rr(e,t),h={x:r,y:i},u=await n.detectOverflow(t,a),d=nr(Pr(s)),f=Gh(d);let _=h[f],p=h[d];if(o){const m=f==="y"?"top":"left",g=f==="y"?"bottom":"right",v=_+u[m],w=_-u[g];_=ru(v,_,w)}if(l){const m=d==="y"?"top":"left",g=d==="y"?"bottom":"right",v=p+u[m],w=p-u[g];p=ru(v,p,w)}const C=c.fn({...t,[f]:_,[d]:p});return{...C,data:{x:C.x-r,y:C.y-i,enabled:{[f]:o,[d]:l}}}}}},Ux=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:i,placement:s,rects:n,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:a=!0}=Rr(e,t),h={x:r,y:i},u=nr(s),d=Gh(u);let f=h[d],_=h[u];const p=Rr(l,t),C=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const v=d==="y"?"height":"width",w=n.reference[d]-n.floating[v]+C.mainAxis,x=n.reference[d]+n.reference[v]-C.mainAxis;f<w?f=w:f>x&&(f=x)}if(a){var m,g;const v=d==="y"?"width":"height",w=vv.has(Pr(s)),x=n.reference[u]-n.floating[v]+(w&&((m=o.offset)==null?void 0:m[u])||0)+(w?0:C.crossAxis),E=n.reference[u]+n.reference[v]+(w?0:((g=o.offset)==null?void 0:g[u])||0)-(w?C.crossAxis:0);_<x?_=x:_>E&&(_=E)}return{[d]:f,[u]:_}}}},Vx=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,i;const{placement:s,rects:n,platform:o,elements:l}=t,{apply:c=()=>{},...a}=Rr(e,t),h=await o.detectOverflow(t,a),u=Pr(s),d=Ns(s),f=nr(s)==="y",{width:_,height:p}=n.floating;let C,m;u==="top"||u==="bottom"?(C=u,m=d===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(m=u,C=d==="end"?"top":"bottom");const g=p-h.top-h.bottom,v=_-h.left-h.right,w=ni(p-h[C],g),x=ni(_-h[m],v),E=!t.middlewareData.shift;let P=w,k=x;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(k=v),(i=t.middlewareData.shift)!=null&&i.enabled.y&&(P=g),E&&!d){const $=wt(h.left,0),j=wt(h.right,0),T=wt(h.top,0),R=wt(h.bottom,0);f?k=_-2*($!==0||j!==0?$+j:wt(h.left,h.right)):P=p-2*(T!==0||R!==0?T+R:wt(h.top,h.bottom))}await c({...t,availableWidth:k,availableHeight:P});const I=await o.getDimensions(l.floating);return _!==I.width||p!==I.height?{reset:{rects:!0}}:{}}}};function ra(){return typeof window<"u"}function Os(e){return yv(e)?(e.nodeName||"").toLowerCase():"#document"}function bt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function dr(e){var t;return(t=(yv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yv(e){return ra()?e instanceof Node||e instanceof bt(e).Node:!1}function Kt(e){return ra()?e instanceof Element||e instanceof bt(e).Element:!1}function Lr(e){return ra()?e instanceof HTMLElement||e instanceof bt(e).HTMLElement:!1}function Qf(e){return!ra()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof bt(e).ShadowRoot}function Vn(e){const{overflow:t,overflowX:r,overflowY:i,display:s}=Yt(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+r)&&s!=="inline"&&s!=="contents"}function Kx(e){return/^(table|td|th)$/.test(Os(e))}function ia(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Yx=/transform|translate|scale|rotate|perspective|filter/,qx=/paint|layout|strict|content/,di=e=>!!e&&e!=="none";let Ua;function Zh(e){const t=Kt(e)?Yt(e):e;return di(t.transform)||di(t.translate)||di(t.scale)||di(t.rotate)||di(t.perspective)||!Jh()&&(di(t.backdropFilter)||di(t.filter))||Yx.test(t.willChange||"")||qx.test(t.contain||"")}function Gx(e){let t=oi(e);for(;Lr(t)&&!Rs(t);){if(Zh(t))return t;if(ia(t))return null;t=oi(t)}return null}function Jh(){return Ua==null&&(Ua=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ua}function Rs(e){return/^(html|body|#document)$/.test(Os(e))}function Yt(e){return bt(e).getComputedStyle(e)}function sa(e){return Kt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oi(e){if(Os(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Qf(e)&&e.host||dr(e);return Qf(t)?t.host:t}function Sv(e){const t=oi(e);return Rs(t)?e.ownerDocument?e.ownerDocument.body:e.body:Lr(t)&&Vn(t)?t:Sv(t)}function Bn(e,t,r){var i;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=Sv(e),n=s===((i=e.ownerDocument)==null?void 0:i.body),o=bt(s);if(n){const l=su(o);return t.concat(o,o.visualViewport||[],Vn(s)?s:[],l&&r?Bn(l):[])}else return t.concat(s,Bn(s,[],r))}function su(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wv(e){const t=Yt(e);let r=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const s=Lr(e),n=s?e.offsetWidth:r,o=s?e.offsetHeight:i,l=kl(r)!==n||kl(i)!==o;return l&&(r=n,i=o),{width:r,height:i,$:l}}function ed(e){return Kt(e)?e:e.contextElement}function gs(e){const t=ed(e);if(!Lr(t))return cr(1);const r=t.getBoundingClientRect(),{width:i,height:s,$:n}=wv(t);let o=(n?kl(r.width):r.width)/i,l=(n?kl(r.height):r.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Xx=cr(0);function Cv(e){const t=bt(e);return!Jh()||!t.visualViewport?Xx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qx(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==bt(e)?!1:t}function Ti(e,t,r,i){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),n=ed(e);let o=cr(1);t&&(i?Kt(i)&&(o=gs(i)):o=gs(e));const l=Qx(n,r,i)?Cv(n):cr(0);let c=(s.left+l.x)/o.x,a=(s.top+l.y)/o.y,h=s.width/o.x,u=s.height/o.y;if(n){const d=bt(n),f=i&&Kt(i)?bt(i):i;let _=d,p=su(_);for(;p&&i&&f!==_;){const C=gs(p),m=p.getBoundingClientRect(),g=Yt(p),v=m.left+(p.clientLeft+parseFloat(g.paddingLeft))*C.x,w=m.top+(p.clientTop+parseFloat(g.paddingTop))*C.y;c*=C.x,a*=C.y,h*=C.x,u*=C.y,c+=v,a+=w,_=bt(p),p=su(_)}}return Rl({width:h,height:u,x:c,y:a})}function na(e,t){const r=sa(e).scrollLeft;return t?t.left+r:Ti(dr(e)).left+r}function xv(e,t){const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-na(e,r),s=r.top+t.scrollTop;return{x:i,y:s}}function Zx(e){let{elements:t,rect:r,offsetParent:i,strategy:s}=e;const n=s==="fixed",o=dr(i),l=t?ia(t.floating):!1;if(i===o||l&&n)return r;let c={scrollLeft:0,scrollTop:0},a=cr(1);const h=cr(0),u=Lr(i);if((u||!u&&!n)&&((Os(i)!=="body"||Vn(o))&&(c=sa(i)),u)){const f=Ti(i);a=gs(i),h.x=f.x+i.clientLeft,h.y=f.y+i.clientTop}const d=o&&!u&&!n?xv(o,c):cr(0);return{width:r.width*a.x,height:r.height*a.y,x:r.x*a.x-c.scrollLeft*a.x+h.x+d.x,y:r.y*a.y-c.scrollTop*a.y+h.y+d.y}}function Jx(e){return Array.from(e.getClientRects())}function eb(e){const t=dr(e),r=sa(e),i=e.ownerDocument.body,s=wt(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),n=wt(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let o=-r.scrollLeft+na(e);const l=-r.scrollTop;return Yt(i).direction==="rtl"&&(o+=wt(t.clientWidth,i.clientWidth)-s),{width:s,height:n,x:o,y:l}}const Zf=25;function tb(e,t){const r=bt(e),i=dr(e),s=r.visualViewport;let n=i.clientWidth,o=i.clientHeight,l=0,c=0;if(s){n=s.width,o=s.height;const h=Jh();(!h||h&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}const a=na(i);if(a<=0){const h=i.ownerDocument,u=h.body,d=getComputedStyle(u),f=h.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,_=Math.abs(i.clientWidth-u.clientWidth-f);_<=Zf&&(n-=_)}else a<=Zf&&(n+=a);return{width:n,height:o,x:l,y:c}}function rb(e,t){const r=Ti(e,!0,t==="fixed"),i=r.top+e.clientTop,s=r.left+e.clientLeft,n=Lr(e)?gs(e):cr(1),o=e.clientWidth*n.x,l=e.clientHeight*n.y,c=s*n.x,a=i*n.y;return{width:o,height:l,x:c,y:a}}function Jf(e,t,r){let i;if(t==="viewport")i=tb(e,r);else if(t==="document")i=eb(dr(e));else if(Kt(t))i=rb(t,r);else{const s=Cv(e);i={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Rl(i)}function bv(e,t){const r=oi(e);return r===t||!Kt(r)||Rs(r)?!1:Yt(r).position==="fixed"||bv(r,t)}function ib(e,t){const r=t.get(e);if(r)return r;let i=Bn(e,[],!1).filter(l=>Kt(l)&&Os(l)!=="body"),s=null;const n=Yt(e).position==="fixed";let o=n?oi(e):e;for(;Kt(o)&&!Rs(o);){const l=Yt(o),c=Zh(o);!c&&l.position==="fixed"&&(s=null),(n?!c&&!s:!c&&l.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||Vn(o)&&!c&&bv(e,o))?i=i.filter(h=>h!==o):s=l,o=oi(o)}return t.set(e,i),i}function sb(e){let{element:t,boundary:r,rootBoundary:i,strategy:s}=e;const o=[...r==="clippingAncestors"?ia(t)?[]:ib(t,this._c):[].concat(r),i],l=Jf(t,o[0],s);let c=l.top,a=l.right,h=l.bottom,u=l.left;for(let d=1;d<o.length;d++){const f=Jf(t,o[d],s);c=wt(f.top,c),a=ni(f.right,a),h=ni(f.bottom,h),u=wt(f.left,u)}return{width:a-u,height:h-c,x:u,y:c}}function nb(e){const{width:t,height:r}=wv(e);return{width:t,height:r}}function ob(e,t,r){const i=Lr(t),s=dr(t),n=r==="fixed",o=Ti(e,!0,n,t);let l={scrollLeft:0,scrollTop:0};const c=cr(0);function a(){c.x=na(s)}if(i||!i&&!n)if((Os(t)!=="body"||Vn(s))&&(l=sa(t)),i){const f=Ti(t,!0,n,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else s&&a();n&&!i&&s&&a();const h=s&&!i&&!n?xv(s,l):cr(0),u=o.left+l.scrollLeft-c.x-h.x,d=o.top+l.scrollTop-c.y-h.y;return{x:u,y:d,width:o.width,height:o.height}}function Va(e){return Yt(e).position==="static"}function ep(e,t){if(!Lr(e)||Yt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return dr(e)===r&&(r=r.ownerDocument.body),r}function kv(e,t){const r=bt(e);if(ia(e))return r;if(!Lr(e)){let s=oi(e);for(;s&&!Rs(s);){if(Kt(s)&&!Va(s))return s;s=oi(s)}return r}let i=ep(e,t);for(;i&&Kx(i)&&Va(i);)i=ep(i,t);return i&&Rs(i)&&Va(i)&&!Zh(i)?r:i||Gx(e)||r}const lb=async function(e){const t=this.getOffsetParent||kv,r=this.getDimensions,i=await r(e.floating);return{reference:ob(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function ab(e){return Yt(e).direction==="rtl"}const cb={convertOffsetParentRelativeRectToViewportRelativeRect:Zx,getDocumentElement:dr,getClippingRect:sb,getOffsetParent:kv,getElementRects:lb,getClientRects:Jx,getDimensions:nb,getScale:gs,isElement:Kt,isRTL:ab};function Ev(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ub(e,t){let r=null,i;const s=dr(e);function n(){var l;clearTimeout(i),(l=r)==null||l.disconnect(),r=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),n();const a=e.getBoundingClientRect(),{left:h,top:u,width:d,height:f}=a;if(l||t(),!d||!f)return;const _=bo(u),p=bo(s.clientWidth-(h+d)),C=bo(s.clientHeight-(u+f)),m=bo(h),v={rootMargin:-_+"px "+-p+"px "+-C+"px "+-m+"px",threshold:wt(0,ni(1,c))||1};let w=!0;function x(E){const P=E[0].intersectionRatio;if(P!==c){if(!w)return o();P?o(!1,P):i=setTimeout(()=>{o(!1,1e-7)},1e3)}P===1&&!Ev(a,e.getBoundingClientRect())&&o(),w=!1}try{r=new IntersectionObserver(x,{...v,root:s.ownerDocument})}catch{r=new IntersectionObserver(x,v)}r.observe(e)}return o(!0),n}function hb(e,t,r,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:n=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,a=ed(e),h=s||n?[...a?Bn(a):[],...t?Bn(t):[]]:[];h.forEach(m=>{s&&m.addEventListener("scroll",r,{passive:!0}),n&&m.addEventListener("resize",r)});const u=a&&l?ub(a,r):null;let d=-1,f=null;o&&(f=new ResizeObserver(m=>{let[g]=m;g&&g.target===a&&f&&t&&(f.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var v;(v=f)==null||v.observe(t)})),r()}),a&&!c&&f.observe(a),t&&f.observe(t));let _,p=c?Ti(e):null;c&&C();function C(){const m=Ti(e);p&&!Ev(p,m)&&r(),p=m,_=requestAnimationFrame(C)}return r(),()=>{var m;h.forEach(g=>{s&&g.removeEventListener("scroll",r),n&&g.removeEventListener("resize",r)}),u==null||u(),(m=f)==null||m.disconnect(),f=null,c&&cancelAnimationFrame(_)}}const db=Hx,fb=jx,pb=Fx,_b=Vx,mb=$x,tp=zx,gb=Ux,vb=(e,t,r)=>{const i=new Map,s={platform:cb,...r},n={...s.platform,_c:i};return Ix(e,t,{...s,platform:n})};var yb=typeof document<"u",Sb=function(){},Yo=yb?y.useLayoutEffect:Sb;function Pl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,i,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(i=r;i--!==0;)if(!Pl(e[i],t[i]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(t,s[i]))return!1;for(i=r;i--!==0;){const n=s[i];if(!(n==="_owner"&&e.$$typeof)&&!Pl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Rv(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rp(e,t){const r=Rv(e);return Math.round(t*r)/r}function Ka(e){const t=y.useRef(e);return Yo(()=>{t.current=e}),t}function wb(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:i=[],platform:s,elements:{reference:n,floating:o}={},transform:l=!0,whileElementsMounted:c,open:a}=e,[h,u]=y.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[d,f]=y.useState(i);Pl(d,i)||f(i);const[_,p]=y.useState(null),[C,m]=y.useState(null),g=y.useCallback(b=>{b!==E.current&&(E.current=b,p(b))},[]),v=y.useCallback(b=>{b!==P.current&&(P.current=b,m(b))},[]),w=n||_,x=o||C,E=y.useRef(null),P=y.useRef(null),k=y.useRef(h),I=c!=null,$=Ka(c),j=Ka(s),T=Ka(a),R=y.useCallback(()=>{if(!E.current||!P.current)return;const b={placement:t,strategy:r,middleware:d};j.current&&(b.platform=j.current),vb(E.current,P.current,b).then(B=>{const D={...B,isPositioned:T.current!==!1};A.current&&!Pl(k.current,D)&&(k.current=D,Zl.flushSync(()=>{u(D)}))})},[d,t,r,j,T]);Yo(()=>{a===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,u(b=>({...b,isPositioned:!1})))},[a]);const A=y.useRef(!1);Yo(()=>(A.current=!0,()=>{A.current=!1}),[]),Yo(()=>{if(w&&(E.current=w),x&&(P.current=x),w&&x){if($.current)return $.current(w,x,R);R()}},[w,x,R,$,I]);const N=y.useMemo(()=>({reference:E,floating:P,setReference:g,setFloating:v}),[g,v]),L=y.useMemo(()=>({reference:w,floating:x}),[w,x]),F=y.useMemo(()=>{const b={position:r,left:0,top:0};if(!L.floating)return b;const B=rp(L.floating,h.x),D=rp(L.floating,h.y);return l?{...b,transform:"translate("+B+"px, "+D+"px)",...Rv(L.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:B,top:D}},[r,l,L.floating,h.x,h.y]);return y.useMemo(()=>({...h,update:R,refs:N,elements:L,floatingStyles:F}),[h,R,N,L,F])}const Cb=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:i,padding:s}=typeof e=="function"?e(r):e;return i&&t(i)?i.current!=null?tp({element:i.current,padding:s}).fn(r):{}:i?tp({element:i,padding:s}).fn(r):{}}}},xb=(e,t)=>{const r=db(e);return{name:r.name,fn:r.fn,options:[e,t]}},bb=(e,t)=>{const r=fb(e);return{name:r.name,fn:r.fn,options:[e,t]}},kb=(e,t)=>({fn:gb(e).fn,options:[e,t]}),Eb=(e,t)=>{const r=pb(e);return{name:r.name,fn:r.fn,options:[e,t]}},Rb=(e,t)=>{const r=_b(e);return{name:r.name,fn:r.fn,options:[e,t]}},Pb=(e,t)=>{const r=mb(e);return{name:r.name,fn:r.fn,options:[e,t]}},Db=(e,t)=>{const r=Cb(e);return{name:r.name,fn:r.fn,options:[e,t]}};var Mb="Arrow",Pv=y.forwardRef((e,t)=>{const{children:r,width:i=10,height:s=5,...n}=e;return S.jsx(xe.svg,{...n,ref:t,width:i,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});Pv.displayName=Mb;var Lb=Pv,td="Popper",[Dv,Mv]=zi(td),[Tb,Lv]=Dv(td),Tv=e=>{const{__scopePopper:t,children:r}=e,[i,s]=y.useState(null),[n,o]=y.useState(void 0);return S.jsx(Tb,{scope:t,anchor:i,onAnchorChange:s,placementState:n,setPlacementState:o,children:r})};Tv.displayName=td;var Av="PopperAnchor",Nv=y.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:i,...s}=e,n=Lv(Av,r),o=y.useRef(null),l=n.onAnchorChange,c=y.useCallback(_=>{o.current=_,_&&l(_)},[l]),a=rt(t,c),h=y.useRef(null);y.useEffect(()=>{if(!i)return;const _=h.current;h.current=i.current,_!==h.current&&l(h.current)});const u=n.placementState&&id(n.placementState),d=u==null?void 0:u[0],f=u==null?void 0:u[1];return i?null:S.jsx(xe.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...s,ref:a})});Nv.displayName=Av;var rd="PopperContent",[Ab,Nb]=Dv(rd),Ov=y.forwardRef((e,t)=>{var fr,ie,Gt,gt,Xe,J;const{__scopePopper:r,side:i="bottom",sideOffset:s=0,align:n="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:a=[],collisionPadding:h=0,sticky:u="partial",hideWhenDetached:d=!1,updatePositionStrategy:f="optimized",onPlaced:_,...p}=e,C=Lv(rd,r),[m,g]=y.useState(null),v=rt(t,ut=>g(ut)),[w,x]=y.useState(null),E=kx(w),P=(E==null?void 0:E.width)??0,k=(E==null?void 0:E.height)??0,I=i+(n!=="center"?"-"+n:""),$=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},j=Array.isArray(a)?a:[a],T=j.length>0,R={padding:$,boundary:j.filter(Bb),altBoundary:T},{refs:A,floatingStyles:N,placement:L,isPositioned:F,middlewareData:b}=wb({strategy:"fixed",placement:I,whileElementsMounted:(...ut)=>hb(...ut,{animationFrame:f==="always"}),elements:{reference:C.anchor},middleware:[xb({mainAxis:s+k,alignmentAxis:o}),c&&bb({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?kb():void 0,...R}),c&&Eb({...R}),Rb({...R,apply:({elements:ut,rects:vd,availableWidth:v0,availableHeight:y0})=>{const{width:S0,height:w0}=vd.reference,Zn=ut.floating.style;Zn.setProperty("--radix-popper-available-width",`${v0}px`),Zn.setProperty("--radix-popper-available-height",`${y0}px`),Zn.setProperty("--radix-popper-anchor-width",`${S0}px`),Zn.setProperty("--radix-popper-anchor-height",`${w0}px`)}}),w&&Db({element:w,padding:l}),Ib({arrowWidth:P,arrowHeight:k}),d&&Pb({strategy:"referenceHidden",...R,boundary:T?R.boundary:void 0})]}),B=C.setPlacementState;Cr(()=>(B(L),()=>{B(void 0)}),[L,B]);const[D,X]=id(L),ee=Li(_);Cr(()=>{F&&(ee==null||ee())},[F,ee]);const Se=(fr=b.arrow)==null?void 0:fr.x,ne=(ie=b.arrow)==null?void 0:ie.y,re=((Gt=b.arrow)==null?void 0:Gt.centerOffset)!==0,[Q,Me]=y.useState();return Cr(()=>{m&&Me(window.getComputedStyle(m).zIndex)},[m]),S.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...N,transform:F?N.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(gt=b.transformOrigin)==null?void 0:gt.x,(Xe=b.transformOrigin)==null?void 0:Xe.y].join(" "),...((J=b.hide)==null?void 0:J.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(Ab,{scope:r,placedSide:D,placedAlign:X,onArrowChange:x,arrowX:Se,arrowY:ne,shouldHideArrow:re,children:S.jsx(xe.div,{"data-side":D,"data-align":X,...p,ref:v,style:{...p.style,animation:F?void 0:"none"}})})})});Ov.displayName=rd;var Bv="PopperArrow",Ob={top:"bottom",right:"left",bottom:"top",left:"right"},Iv=y.forwardRef(function(t,r){const{__scopePopper:i,...s}=t,n=Nb(Bv,i),o=Ob[n.placedSide];return S.jsx("span",{ref:n.onArrowChange,style:{position:"absolute",left:n.arrowX,top:n.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[n.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[n.placedSide],visibility:n.shouldHideArrow?"hidden":void 0},children:S.jsx(Lb,{...s,ref:r,style:{...s.style,display:"block"}})})});Iv.displayName=Bv;function Bb(e){return e!==null}var Ib=e=>({name:"transformOrigin",options:e,fn(t){var C,m,g;const{placement:r,rects:i,middlewareData:s}=t,o=((C=s.arrow)==null?void 0:C.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[a,h]=id(r),u={start:"0%",center:"50%",end:"100%"}[h],d=(((m=s.arrow)==null?void 0:m.x)??0)+l/2,f=(((g=s.arrow)==null?void 0:g.y)??0)+c/2;let _="",p="";return a==="bottom"?(_=o?u:`${d}px`,p=`${-c}px`):a==="top"?(_=o?u:`${d}px`,p=`${i.floating.height+c}px`):a==="right"?(_=`${-c}px`,p=o?u:`${f}px`):a==="left"&&(_=`${i.floating.width+c}px`,p=o?u:`${f}px`),{data:{x:_,y:p}}}});function id(e){const[t,r="center"]=e.split("-");return[t,r]}var zb=Tv,zv=Nv,Fb=Ov,$b=Iv,Ya="rovingFocusGroup.onEntryFocus",Wb={bubbles:!1,cancelable:!0},Kn="RovingFocusGroup",[nu,Fv,Hb]=H1(Kn),[jb,$v]=zi(Kn,[Hb]),[Ub,Vb]=jb(Kn),Wv=y.forwardRef((e,t)=>S.jsx(nu.Provider,{scope:e.__scopeRovingFocusGroup,children:S.jsx(nu.Slot,{scope:e.__scopeRovingFocusGroup,children:S.jsx(Kb,{...e,ref:t})})}));Wv.displayName=Kn;var Kb=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:i,loop:s=!1,dir:n,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:a,preventScrollOnEntryFocus:h=!1,...u}=e,d=y.useRef(null),f=rt(t,d),_=Tg(n),[p,C]=Jl({prop:o,defaultProp:l??null,onChange:c,caller:Kn}),[m,g]=y.useState(!1),v=Li(a),w=Fv(r),x=y.useRef(!1),[E,P]=y.useState(0);return y.useEffect(()=>{const k=d.current;if(k)return k.addEventListener(Ya,v),()=>k.removeEventListener(Ya,v)},[v]),S.jsx(Ub,{scope:r,orientation:i,dir:_,loop:s,currentTabStopId:p,onItemFocus:y.useCallback(k=>C(k),[C]),onItemShiftTab:y.useCallback(()=>g(!0),[]),onFocusableItemAdd:y.useCallback(()=>P(k=>k+1),[]),onFocusableItemRemove:y.useCallback(()=>P(k=>k-1),[]),children:S.jsx(xe.div,{tabIndex:m||E===0?-1:0,"data-orientation":i,...u,ref:f,style:{outline:"none",...e.style},onMouseDown:ve(e.onMouseDown,()=>{x.current=!0}),onFocus:ve(e.onFocus,k=>{const I=!x.current;if(k.target===k.currentTarget&&I&&!m){const $=new CustomEvent(Ya,Wb);if(k.currentTarget.dispatchEvent($),!$.defaultPrevented){const j=w().filter(L=>L.focusable),T=j.find(L=>L.active),R=j.find(L=>L.id===p),N=[T,R,...j].filter(Boolean).map(L=>L.ref.current);Uv(N,h)}}x.current=!1}),onBlur:ve(e.onBlur,()=>g(!1))})})}),Hv="RovingFocusGroupItem",jv=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:i=!0,active:s=!1,tabStopId:n,children:o,...l}=e,c=_s(),a=n||c,h=Vb(Hv,r),u=h.currentTabStopId===a,d=Fv(r),{onFocusableItemAdd:f,onFocusableItemRemove:_,currentTabStopId:p}=h;return y.useEffect(()=>{if(i)return f(),()=>_()},[i,f,_]),S.jsx(nu.ItemSlot,{scope:r,id:a,focusable:i,active:s,children:S.jsx(xe.span,{tabIndex:u?0:-1,"data-orientation":h.orientation,...l,ref:t,onMouseDown:ve(e.onMouseDown,C=>{i?h.onItemFocus(a):C.preventDefault()}),onFocus:ve(e.onFocus,()=>h.onItemFocus(a)),onKeyDown:ve(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){h.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const m=Gb(C,h.orientation,h.dir);if(m!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let v=d().filter(w=>w.focusable).map(w=>w.ref.current);if(m==="last")v.reverse();else if(m==="prev"||m==="next"){m==="prev"&&v.reverse();const w=v.indexOf(C.currentTarget);v=h.loop?Xb(v,w+1):v.slice(w+1)}setTimeout(()=>Uv(v))}}),children:typeof o=="function"?o({isCurrentTabStop:u,hasTabStop:p!=null}):o})})});jv.displayName=Hv;var Yb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function qb(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Gb(e,t,r){const i=qb(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return Yb[i]}function Uv(e,t=!1){const r=document.activeElement;for(const i of e)if(i===r||(i.focus({preventScroll:t}),document.activeElement!==r))return}function Xb(e,t){return e.map((r,i)=>e[(t+i)%e.length])}var Qb=Wv,Zb=jv,Jb="Label",Vv=y.forwardRef((e,t)=>S.jsx(xe.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Vv.displayName=Jb;var ek=Vv,oa="Popover",[Kv]=zi(oa,[Mv]),Yn=Mv(),[tk,ui]=Kv(oa),Yv=e=>{const{__scopePopover:t,children:r,open:i,defaultOpen:s,onOpenChange:n,modal:o=!1}=e,l=Yn(t),c=y.useRef(null),[a,h]=y.useState(!1),[u,d]=Jl({prop:i,defaultProp:s??!1,onChange:n,caller:oa});return S.jsx(zb,{...l,children:S.jsx(tk,{scope:t,contentId:_s(),triggerRef:c,open:u,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(f=>!f),[d]),hasCustomAnchor:a,onCustomAnchorAdd:y.useCallback(()=>h(!0),[]),onCustomAnchorRemove:y.useCallback(()=>h(!1),[]),modal:o,children:r})})};Yv.displayName=oa;var qv="PopoverAnchor",rk=y.forwardRef((e,t)=>{const{__scopePopover:r,...i}=e,s=ui(qv,r),n=Yn(r),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=s;return y.useEffect(()=>(o(),()=>l()),[o,l]),S.jsx(zv,{...n,...i,ref:t})});rk.displayName=qv;var Gv="PopoverTrigger",Xv=y.forwardRef((e,t)=>{const{__scopePopover:r,...i}=e,s=ui(Gv,r),n=Yn(r),o=rt(t,s.triggerRef),l=S.jsx(xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":ty(s.open),...i,ref:o,onClick:ve(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:S.jsx(zv,{asChild:!0,...n,children:l})});Xv.displayName=Gv;var sd="PopoverPortal",[ik,sk]=Kv(sd,{forceMount:void 0}),Qv=e=>{const{__scopePopover:t,forceMount:r,children:i,container:s}=e,n=ui(sd,t);return S.jsx(ik,{scope:t,forceMount:r,children:S.jsx(Fi,{present:r||n.open,children:S.jsx(Uh,{asChild:!0,container:s,children:i})})})};Qv.displayName=sd;var Ps="PopoverContent",Zv=y.forwardRef((e,t)=>{const r=sk(Ps,e.__scopePopover),{forceMount:i=r.forceMount,...s}=e,n=ui(Ps,e.__scopePopover);return S.jsx(Fi,{present:i||n.open,children:n.modal?S.jsx(ok,{...s,ref:t}):S.jsx(lk,{...s,ref:t})})});Zv.displayName=Ps;var nk=ks("PopoverContent.RemoveScroll"),ok=y.forwardRef((e,t)=>{const r=ui(Ps,e.__scopePopover),i=y.useRef(null),s=rt(t,i),n=y.useRef(!1);return y.useEffect(()=>{const o=i.current;if(o)return Ug(o)},[]),S.jsx(Vh,{as:nk,allowPinchZoom:!0,children:S.jsx(Jv,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ve(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),n.current||(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ve(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,a=l.button===2||c;n.current=a},{checkForDefaultPrevented:!1}),onFocusOutside:ve(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),lk=y.forwardRef((e,t)=>{const r=ui(Ps,e.__scopePopover),i=y.useRef(!1),s=y.useRef(!1);return S.jsx(Jv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,n),n.defaultPrevented||(i.current||(l=r.triggerRef.current)==null||l.focus(),n.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:n=>{var c,a;(c=e.onInteractOutside)==null||c.call(e,n),n.defaultPrevented||(i.current=!0,n.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=n.target;((a=r.triggerRef.current)==null?void 0:a.contains(o))&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&s.current&&n.preventDefault()}})}),Jv=y.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:n,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:a,onInteractOutside:h,...u}=e,d=ui(Ps,r),f=Yn(r);return Og(),S.jsx(jh,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:n,children:S.jsx(Hh,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:a,onDismiss:()=>d.onOpenChange(!1),deferPointerDownOutside:!0,children:S.jsx(Fb,{"data-state":ty(d.open),role:"dialog",id:d.contentId,...f,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),ey="PopoverClose",ak=y.forwardRef((e,t)=>{const{__scopePopover:r,...i}=e,s=ui(ey,r);return S.jsx(xe.button,{type:"button",...i,ref:t,onClick:ve(e.onClick,()=>s.onOpenChange(!1))})});ak.displayName=ey;var ck="PopoverArrow",uk=y.forwardRef((e,t)=>{const{__scopePopover:r,...i}=e,s=Yn(r);return S.jsx($b,{...s,...i,ref:t})});uk.displayName=ck;function ty(e){return e?"open":"closed"}var hk=Yv,dk=Xv,fk=Qv,pk=Zv,_k="Separator",ip="horizontal",mk=["horizontal","vertical"],ry=y.forwardRef((e,t)=>{const{decorative:r,orientation:i=ip,...s}=e,n=gk(i)?i:ip,l=r?{role:"none"}:{"aria-orientation":n==="vertical"?n:void 0,role:"separator"};return S.jsx(xe.div,{"data-orientation":n,...l,...s,ref:t})});ry.displayName=_k;function gk(e){return mk.includes(e)}var vk=ry,la="Tabs",[yk]=zi(la,[$v]),iy=$v(),[Sk,nd]=yk(la),sy=y.forwardRef((e,t)=>{const{__scopeTabs:r,value:i,onValueChange:s,defaultValue:n,orientation:o="horizontal",dir:l,activationMode:c="automatic",...a}=e,h=Tg(l),[u,d]=Jl({prop:i,onChange:s,defaultProp:n??"",caller:la});return S.jsx(Sk,{scope:r,baseId:_s(),value:u,onValueChange:d,orientation:o,dir:h,activationMode:c,children:S.jsx(xe.div,{dir:h,"data-orientation":o,...a,ref:t})})});sy.displayName=la;var ny="TabsList",oy=y.forwardRef((e,t)=>{const{__scopeTabs:r,loop:i=!0,...s}=e,n=nd(ny,r),o=iy(r);return S.jsx(Qb,{asChild:!0,...o,orientation:n.orientation,dir:n.dir,loop:i,children:S.jsx(xe.div,{role:"tablist","aria-orientation":n.orientation,...s,ref:t})})});oy.displayName=ny;var ly="TabsTrigger",ay=y.forwardRef((e,t)=>{const{__scopeTabs:r,value:i,disabled:s=!1,...n}=e,o=nd(ly,r),l=iy(r),c=hy(o.baseId,i),a=dy(o.baseId,i),h=i===o.value;return S.jsx(Zb,{asChild:!0,...l,focusable:!s,active:h,children:S.jsx(xe.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":a,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...n,ref:t,onMouseDown:ve(e.onMouseDown,u=>{!s&&u.button===0&&u.ctrlKey===!1?o.onValueChange(i):u.preventDefault()}),onKeyDown:ve(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&o.onValueChange(i)}),onFocus:ve(e.onFocus,()=>{const u=o.activationMode!=="manual";!h&&!s&&u&&o.onValueChange(i)})})})});ay.displayName=ly;var cy="TabsContent",uy=y.forwardRef((e,t)=>{const{__scopeTabs:r,value:i,forceMount:s,children:n,...o}=e,l=nd(cy,r),c=hy(l.baseId,i),a=dy(l.baseId,i),h=i===l.value,u=y.useRef(h);return y.useEffect(()=>{const d=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(d)},[]),S.jsx(Fi,{present:s||h,children:({present:d})=>S.jsx(xe.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:a,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0},children:d&&n})})});uy.displayName=cy;function hy(e,t){return`${e}-trigger-${t}`}function dy(e,t){return`${e}-content-${t}`}var wk=sy,Ck=oy,xk=ay,bk=uy;const kk=(e,t)=>{const r=new Array(e.length+t.length);for(let i=0;i<e.length;i++)r[i]=e[i];for(let i=0;i<t.length;i++)r[e.length+i]=t[i];return r},Ek=(e,t)=>({classGroupId:e,validator:t}),fy=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Dl="-",sp=[],Rk="arbitrary..",Pk=e=>{const t=Mk(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Dk(o);const l=o.split(Dl),c=l[0]===""&&l.length>1?1:0;return py(l,c,t)},getConflictingClassGroupIds:(o,l)=>{if(l){const c=i[o],a=r[o];return c?a?kk(a,c):c:a||sp}return r[o]||sp}}},py=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],n=r.nextPart.get(s);if(n){const a=py(e,t+1,n);if(a)return a}const o=r.validators;if(o===null)return;const l=t===0?e.join(Dl):e.slice(t).join(Dl),c=o.length;for(let a=0;a<c;a++){const h=o[a];if(h.validator(l))return h.classGroupId}},Dk=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),i=t.slice(0,r);return i?Rk+i:void 0})(),Mk=e=>{const{theme:t,classGroups:r}=e;return Lk(r,t)},Lk=(e,t)=>{const r=fy();for(const i in e){const s=e[i];od(s,r,i,t)}return r},od=(e,t,r,i)=>{const s=e.length;for(let n=0;n<s;n++){const o=e[n];Tk(o,t,r,i)}},Tk=(e,t,r,i)=>{if(typeof e=="string"){Ak(e,t,r);return}if(typeof e=="function"){Nk(e,t,r,i);return}Ok(e,t,r,i)},Ak=(e,t,r)=>{const i=e===""?t:_y(t,e);i.classGroupId=r},Nk=(e,t,r,i)=>{if(Bk(e)){od(e(i),t,r,i);return}t.validators===null&&(t.validators=[]),t.validators.push(Ek(r,e))},Ok=(e,t,r,i)=>{const s=Object.entries(e),n=s.length;for(let o=0;o<n;o++){const[l,c]=s[o];od(c,_y(t,l),r,i)}},_y=(e,t)=>{let r=e;const i=t.split(Dl),s=i.length;for(let n=0;n<s;n++){const o=i[n];let l=r.nextPart.get(o);l||(l=fy(),r.nextPart.set(o,l)),r=l}return r},Bk=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Ik=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),i=Object.create(null);const s=(n,o)=>{r[n]=o,t++,t>e&&(t=0,i=r,r=Object.create(null))};return{get(n){let o=r[n];if(o!==void 0)return o;if((o=i[n])!==void 0)return s(n,o),o},set(n,o){n in r?r[n]=o:s(n,o)}}},ou="!",np=":",zk=[],op=(e,t,r,i,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:i,isExternal:s}),Fk=e=>{const{prefix:t,experimentalParseClassName:r}=e;let i=s=>{const n=[];let o=0,l=0,c=0,a;const h=s.length;for(let p=0;p<h;p++){const C=s[p];if(o===0&&l===0){if(C===np){n.push(s.slice(c,p)),c=p+1;continue}if(C==="/"){a=p;continue}}C==="["?o++:C==="]"?o--:C==="("?l++:C===")"&&l--}const u=n.length===0?s:s.slice(c);let d=u,f=!1;u.endsWith(ou)?(d=u.slice(0,-1),f=!0):u.startsWith(ou)&&(d=u.slice(1),f=!0);const _=a&&a>c?a-c:void 0;return op(n,f,d,_)};if(t){const s=t+np,n=i;i=o=>o.startsWith(s)?n(o.slice(s.length)):op(zk,!1,o,void 0,!0)}if(r){const s=i;i=n=>r({className:n,parseClassName:s})}return i},$k=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,i)=>{t.set(r,1e6+i)}),r=>{const i=[];let s=[];for(let n=0;n<r.length;n++){const o=r[n],l=o[0]==="[",c=t.has(o);l||c?(s.length>0&&(s.sort(),i.push(...s),s=[]),i.push(o)):s.push(o)}return s.length>0&&(s.sort(),i.push(...s)),i}},Wk=e=>({cache:Ik(e.cacheSize),parseClassName:Fk(e),sortModifiers:$k(e),postfixLookupClassGroupIds:Hk(e),...Pk(e)}),Hk=e=>{const t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let i=0;i<r.length;i++)t[r[i]]=!0;return t},jk=/\s+/,Uk=(e,t)=>{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:s,sortModifiers:n,postfixLookupClassGroupIds:o}=t,l=[],c=e.trim().split(jk);let a="";for(let h=c.length-1;h>=0;h-=1){const u=c[h],{isExternal:d,modifiers:f,hasImportantModifier:_,baseClassName:p,maybePostfixModifierPosition:C}=r(u);if(d){a=u+(a.length>0?" "+a:a);continue}let m=!!C,g;if(m){const P=p.substring(0,C);g=i(P);const k=g&&o[g]?i(p):void 0;k&&k!==g&&(g=k,m=!1)}else g=i(p);if(!g){if(!m){a=u+(a.length>0?" "+a:a);continue}if(g=i(p),!g){a=u+(a.length>0?" "+a:a);continue}m=!1}const v=f.length===0?"":f.length===1?f[0]:n(f).join(":"),w=_?v+ou:v,x=w+g;if(l.indexOf(x)>-1)continue;l.push(x);const E=s(g,m);for(let P=0;P<E.length;++P){const k=E[P];l.push(w+k)}a=u+(a.length>0?" "+a:a)}return a},Vk=(...e)=>{let t=0,r,i,s="";for(;t<e.length;)(r=e[t++])&&(i=my(r))&&(s&&(s+=" "),s+=i);return s},my=e=>{if(typeof e=="string")return e;let t,r="";for(let i=0;i<e.length;i++)e[i]&&(t=my(e[i]))&&(r&&(r+=" "),r+=t);return r},Kk=(e,...t)=>{let r,i,s,n;const o=c=>{const a=t.reduce((h,u)=>u(h),e());return r=Wk(a),i=r.cache.get,s=r.cache.set,n=l,l(c)},l=c=>{const a=i(c);if(a)return a;const h=Uk(c,r);return s(c,h),h};return n=o,(...c)=>n(Vk(...c))},Yk=[],Le=e=>{const t=r=>r[e]||Yk;return t.isThemeGetter=!0,t},gy=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,vy=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qk=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Gk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xk=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Qk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Zk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Or=e=>qk.test(e),q=e=>!!e&&!Number.isNaN(Number(e)),Zt=e=>!!e&&Number.isInteger(Number(e)),qa=e=>e.endsWith("%")&&q(e.slice(0,-1)),pr=e=>Gk.test(e),yy=()=>!0,e2=e=>Xk.test(e)&&!Qk.test(e),ld=()=>!1,t2=e=>Zk.test(e),r2=e=>Jk.test(e),i2=e=>!H(e)&&!U(e),s2=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),n2=e=>hi(e,Cy,ld),H=e=>gy.test(e),fi=e=>hi(e,xy,e2),lp=e=>hi(e,f2,q),o2=e=>hi(e,ky,yy),l2=e=>hi(e,by,ld),ap=e=>hi(e,Sy,ld),a2=e=>hi(e,wy,r2),ko=e=>hi(e,Ey,t2),U=e=>vy.test(e),Ks=e=>$i(e,xy),c2=e=>$i(e,by),cp=e=>$i(e,Sy),u2=e=>$i(e,Cy),h2=e=>$i(e,wy),Eo=e=>$i(e,Ey,!0),d2=e=>$i(e,ky,!0),hi=(e,t,r)=>{const i=gy.exec(e);return i?i[1]?t(i[1]):r(i[2]):!1},$i=(e,t,r=!1)=>{const i=vy.exec(e);return i?i[1]?t(i[1]):r:!1},Sy=e=>e==="position"||e==="percentage",wy=e=>e==="image"||e==="url",Cy=e=>e==="length"||e==="size"||e==="bg-size",xy=e=>e==="length",f2=e=>e==="number",by=e=>e==="family-name",ky=e=>e==="number"||e==="weight",Ey=e=>e==="shadow",p2=()=>{const e=Le("color"),t=Le("font"),r=Le("text"),i=Le("font-weight"),s=Le("tracking"),n=Le("leading"),o=Le("breakpoint"),l=Le("container"),c=Le("spacing"),a=Le("radius"),h=Le("shadow"),u=Le("inset-shadow"),d=Le("text-shadow"),f=Le("drop-shadow"),_=Le("blur"),p=Le("perspective"),C=Le("aspect"),m=Le("ease"),g=Le("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[...w(),U,H],E=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],k=()=>[U,H,c],I=()=>[Or,"full","auto",...k()],$=()=>[Zt,"none","subgrid",U,H],j=()=>["auto",{span:["full",Zt,U,H]},Zt,U,H],T=()=>[Zt,"auto",U,H],R=()=>["auto","min","max","fr",U,H],A=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],N=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...k()],F=()=>[Or,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],b=()=>[Or,"screen","full","dvw","lvw","svw","min","max","fit",...k()],B=()=>[Or,"screen","full","lh","dvh","lvh","svh","min","max","fit",...k()],D=()=>[e,U,H],X=()=>[...w(),cp,ap,{position:[U,H]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Se=()=>["auto","cover","contain",u2,n2,{size:[U,H]}],ne=()=>[qa,Ks,fi],re=()=>["","none","full",a,U,H],Q=()=>["",q,Ks,fi],Me=()=>["solid","dashed","dotted","double"],fr=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[q,qa,cp,ap],Gt=()=>["","none",_,U,H],gt=()=>["none",q,U,H],Xe=()=>["none",q,U,H],J=()=>[q,U,H],ut=()=>[Or,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[pr],breakpoint:[pr],color:[yy],container:[pr],"drop-shadow":[pr],ease:["in","out","in-out"],font:[i2],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[pr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[pr],shadow:[pr],spacing:["px",q],text:[pr],"text-shadow":[pr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Or,H,U,C]}],container:["container"],"container-type":[{"@container":["","normal","size",U,H]}],"container-named":[s2],columns:[{columns:[q,H,U,l]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Zt,"auto",U,H]}],basis:[{basis:[Or,"full","auto",l,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[q,Or,"auto","initial","none",H]}],grow:[{grow:["",q,U,H]}],shrink:[{shrink:["",q,U,H]}],order:[{order:[Zt,"first","last","none",U,H]}],"grid-cols":[{"grid-cols":$()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":$()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":R()}],"auto-rows":[{"auto-rows":R()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...A(),"normal"]}],"justify-items":[{"justify-items":[...N(),"normal"]}],"justify-self":[{"justify-self":["auto",...N()]}],"align-content":[{content:["normal",...A()]}],"align-items":[{items:[...N(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...N(),{baseline:["","last"]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...N(),"baseline"]}],"place-self":[{"place-self":["auto",...N()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pbs:[{pbs:k()}],pbe:[{pbe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mbs:[{mbs:L()}],mbe:[{mbe:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...b()]}],"min-inline-size":[{"min-inline":["auto",...b()]}],"max-inline-size":[{"max-inline":["none",...b()]}],"block-size":[{block:["auto",...B()]}],"min-block-size":[{"min-block":["auto",...B()]}],"max-block-size":[{"max-block":["none",...B()]}],w:[{w:[l,"screen",...F()]}],"min-w":[{"min-w":[l,"screen","none",...F()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",r,Ks,fi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,d2,o2]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qa,H]}],"font-family":[{font:[c2,l2,t]}],"font-features":[{"font-features":[H]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,U,H]}],"line-clamp":[{"line-clamp":[q,"none",U,lp]}],leading:[{leading:[n,...k()]}],"list-image":[{"list-image":["none",U,H]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",U,H]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Me(),"wavy"]}],"text-decoration-thickness":[{decoration:[q,"from-font","auto",U,fi]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[q,"auto",U,H]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"tab-size":[{tab:[Zt,U,H]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",U,H]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",U,H]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:X()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:Se()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zt,U,H],radial:["",U,H],conic:[Zt,U,H]},h2,a2]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-bs":[{"border-bs":Q()}],"border-w-be":[{"border-be":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Me(),"hidden","none"]}],"divide-style":[{divide:[...Me(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...Me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[q,U,H]}],"outline-w":[{outline:["",q,Ks,fi]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",h,Eo,ko]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",u,Eo,ko]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[q,fi]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",d,Eo,ko]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[q,U,H]}],"mix-blend":[{"mix-blend":[...fr(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fr()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[q]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[U,H]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[q]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:X()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:Se()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",U,H]}],filter:[{filter:["","none",U,H]}],blur:[{blur:Gt()}],brightness:[{brightness:[q,U,H]}],contrast:[{contrast:[q,U,H]}],"drop-shadow":[{"drop-shadow":["","none",f,Eo,ko]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",q,U,H]}],"hue-rotate":[{"hue-rotate":[q,U,H]}],invert:[{invert:["",q,U,H]}],saturate:[{saturate:[q,U,H]}],sepia:[{sepia:["",q,U,H]}],"backdrop-filter":[{"backdrop-filter":["","none",U,H]}],"backdrop-blur":[{"backdrop-blur":Gt()}],"backdrop-brightness":[{"backdrop-brightness":[q,U,H]}],"backdrop-contrast":[{"backdrop-contrast":[q,U,H]}],"backdrop-grayscale":[{"backdrop-grayscale":["",q,U,H]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[q,U,H]}],"backdrop-invert":[{"backdrop-invert":["",q,U,H]}],"backdrop-opacity":[{"backdrop-opacity":[q,U,H]}],"backdrop-saturate":[{"backdrop-saturate":[q,U,H]}],"backdrop-sepia":[{"backdrop-sepia":["",q,U,H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",U,H]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[q,"initial",U,H]}],ease:[{ease:["linear","initial",m,U,H]}],delay:[{delay:[q,U,H]}],animate:[{animate:["none",g,U,H]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,U,H]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:gt()}],"rotate-x":[{"rotate-x":gt()}],"rotate-y":[{"rotate-y":gt()}],"rotate-z":[{"rotate-z":gt()}],scale:[{scale:Xe()}],"scale-x":[{"scale-x":Xe()}],"scale-y":[{"scale-y":Xe()}],"scale-z":[{"scale-z":Xe()}],"scale-3d":["scale-3d"],skew:[{skew:J()}],"skew-x":[{"skew-x":J()}],"skew-y":[{"skew-y":J()}],transform:[{transform:[U,H,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ut()}],"translate-x":[{"translate-x":ut()}],"translate-y":[{"translate-y":ut()}],"translate-z":[{"translate-z":ut()}],"translate-none":["translate-none"],zoom:[{zoom:[Zt,U,H]}],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",U,H]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mbs":[{"scroll-mbs":k()}],"scroll-mbe":[{"scroll-mbe":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pbs":[{"scroll-pbs":k()}],"scroll-pbe":[{"scroll-pbe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",U,H]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[q,Ks,fi,lp]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},_2=Kk(p2);function le(...e){return _2(Lg(e))}const m2=$h("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ai({className:e,variant:t="default",size:r="default",asChild:i=!1,...s}){const n=i?D1:"button";return S.jsx(n,{"data-slot":"button","data-variant":t,"data-size":r,className:le(m2({variant:t,size:r,className:e})),...s})}function Ki({className:e,type:t,...r}){return S.jsx("input",{type:t,"data-slot":"input",className:le("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...r})}function Yi({className:e,...t}){return S.jsx(ek,{"data-slot":"label",className:le("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function g2({className:e,...t}){return S.jsx("textarea",{"data-slot":"textarea",className:le("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",e),...t})}function v2({className:e,orientation:t="horizontal",...r}){return S.jsx(wk,{"data-slot":"tabs","data-orientation":t,orientation:t,className:le("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...r})}const y2=$h("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function S2({className:e,variant:t="default",...r}){return S.jsx(Ck,{"data-slot":"tabs-list","data-variant":t,className:le(y2({variant:t}),e),...r})}function up({className:e,...t}){return S.jsx(xk,{"data-slot":"tabs-trigger",className:le("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function hp({className:e,...t}){return S.jsx(bk,{"data-slot":"tabs-content",className:le("flex-1 outline-none",e),...t})}const w2=$h("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function C2({className:e,variant:t,...r}){return S.jsx("div",{"data-slot":"alert",role:"alert",className:le(w2({variant:t}),e),...r})}function x2({className:e,...t}){return S.jsx("div",{"data-slot":"alert-description",className:le("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",e),...t})}function b2({className:e,...t}){return S.jsx("div",{"data-slot":"card",className:le("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}function k2({className:e,...t}){return S.jsx("div",{"data-slot":"card-header",className:le("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function E2({className:e,...t}){return S.jsx("div",{"data-slot":"card-title",className:le("leading-none font-semibold",e),...t})}function R2({className:e,...t}){return S.jsx("div",{"data-slot":"card-description",className:le("text-sm text-muted-foreground",e),...t})}function P2({className:e,...t}){return S.jsx("div",{"data-slot":"card-content",className:le("px-6",e),...t})}function D2({t:e,busy:t,error:r,onSubmit:i}){const[s,n]=y.useState(""),[o,l]=y.useState("22"),[c,a]=y.useState(""),[h,u]=y.useState("password"),[d,f]=y.useState(""),[_,p]=y.useState(""),[C,m]=y.useState("");async function g(w){w&&p(await w.text())}function v(w){w.preventDefault();const x=h==="password"?{kind:"password",password:d}:{kind:"privateKey",privateKey:_,...C?{passphrase:C}:{}};i({host:s.trim(),port:Number(o)||22,username:c.trim(),auth:x})}return S.jsxs(b2,{className:"w-full max-w-md",children:[S.jsxs(k2,{children:[S.jsxs(E2,{className:"flex items-center gap-2",children:[S.jsx(Dg,{className:"size-5","aria-hidden":!0})," ",e("login.title")]}),S.jsx(R2,{children:e("app.tagline")})]}),S.jsx(P2,{children:S.jsxs("form",{className:"flex flex-col gap-4",onSubmit:v,children:[S.jsxs("div",{className:"flex gap-3",children:[S.jsxs("div",{className:"flex flex-1 flex-col gap-2",children:[S.jsx(Yi,{htmlFor:"host",children:e("login.host")}),S.jsx(Ki,{id:"host",value:s,onChange:w=>n(w.target.value),placeholder:"192.168.1.10",autoComplete:"off",required:!0})]}),S.jsxs("div",{className:"flex w-24 flex-col gap-2",children:[S.jsx(Yi,{htmlFor:"port",children:e("login.port")}),S.jsx(Ki,{id:"port",value:o,onChange:w=>l(w.target.value),inputMode:"numeric",required:!0})]})]}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx(Yi,{htmlFor:"username",children:e("login.username")}),S.jsx(Ki,{id:"username",value:c,onChange:w=>a(w.target.value),autoComplete:"off",required:!0})]}),S.jsxs(v2,{value:h,onValueChange:w=>u(w),children:[S.jsxs(S2,{className:"w-full",children:[S.jsxs(up,{value:"password",className:"flex-1",children:[S.jsx(S1,{className:"size-4","aria-hidden":!0})," ",e("login.auth.password")]}),S.jsxs(up,{value:"key",className:"flex-1",children:[S.jsx(g1,{className:"size-4","aria-hidden":!0})," ",e("login.auth.key")]})]}),S.jsxs(hp,{value:"password",className:"mt-4 flex flex-col gap-2",children:[S.jsx(Yi,{htmlFor:"password",children:e("login.password")}),S.jsx(Ki,{id:"password",type:"password",value:d,onChange:w=>f(w.target.value),autoComplete:"off",required:h==="password"})]}),S.jsxs(hp,{value:"key",className:"mt-4 flex flex-col gap-3",children:[S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx(Yi,{htmlFor:"keyfile",children:e("login.keyFile")}),S.jsx(Ki,{id:"keyfile",type:"file",onChange:w=>{var x;return void g((x=w.target.files)==null?void 0:x[0])}})]}),S.jsx(g2,{value:_,onChange:w=>p(w.target.value),placeholder:e("login.keyHint"),rows:4,spellCheck:!1,className:"font-mono text-xs",required:h==="key"}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx(Yi,{htmlFor:"passphrase",children:e("login.passphrase")}),S.jsx(Ki,{id:"passphrase",type:"password",value:C,onChange:w=>m(w.target.value),autoComplete:"off"})]})]})]}),r&&S.jsx(C2,{variant:"destructive",children:S.jsx(x2,{children:`${e("login.error")}: ${r}`})}),S.jsx(Ai,{type:"submit",disabled:t,className:"w-full",children:e(t?"login.connecting":"login.submit")})]})})]})}function M2({...e}){return S.jsx(gx,{"data-slot":"alert-dialog",...e})}function L2({...e}){return S.jsx(vx,{"data-slot":"alert-dialog-portal",...e})}function T2({className:e,...t}){return S.jsx(yx,{"data-slot":"alert-dialog-overlay",className:le("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function A2({className:e,size:t="default",...r}){return S.jsxs(L2,{children:[S.jsx(T2,{}),S.jsx(Sx,{"data-slot":"alert-dialog-content","data-size":t,className:le("group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg",e),...r})]})}function N2({className:e,...t}){return S.jsx("div",{"data-slot":"alert-dialog-header",className:le("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function O2({className:e,...t}){return S.jsx("div",{"data-slot":"alert-dialog-footer",className:le("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function B2({className:e,...t}){return S.jsx(xx,{"data-slot":"alert-dialog-title",className:le("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function I2({className:e,...t}){return S.jsx(bx,{"data-slot":"alert-dialog-description",className:le("text-sm text-muted-foreground",e),...t})}function z2({className:e,variant:t="default",size:r="default",...i}){return S.jsx(Ai,{variant:t,size:r,asChild:!0,children:S.jsx(wx,{"data-slot":"alert-dialog-action",className:le(e),...i})})}function F2({className:e,variant:t="outline",size:r="default",...i}){return S.jsx(Ai,{variant:t,size:r,asChild:!0,children:S.jsx(Cx,{"data-slot":"alert-dialog-cancel",className:le(e),...i})})}function $2({t:e,prompt:t,onConfirm:r,onCancel:i}){return S.jsx(M2,{open:t!==null,children:S.jsxs(A2,{children:[S.jsxs(N2,{children:[S.jsxs(B2,{className:"flex items-center gap-2",children:[S.jsx(b1,{className:"size-5","aria-hidden":!0})," ",e("hostkey.title")]}),S.jsx(I2,{children:e("hostkey.body")})]}),t&&S.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[S.jsxs("div",{className:"text-xs text-muted-foreground",children:[e("hostkey.fingerprint")," · ",t.algorithm]}),S.jsx("code",{className:"font-mono break-all",children:t.fingerprint})]}),S.jsxs(O2,{children:[S.jsx(F2,{onClick:i,children:e("hostkey.cancel")}),S.jsx(z2,{onClick:r,children:e("hostkey.confirm")})]})]})})}let dp=0;function W2(){const[e,t]=y.useState([]),[r,i]=y.useState(1),s=y.useCallback(u=>{i(d=>{const f=d+1;return t(_=>_.map(p=>p.id===u?{...p,z:f,minimized:!1}:p)),f})},[]),n=y.useCallback(u=>{t(d=>{var v,w;const f=d.find(x=>x.appId===u.id);if(f){const x=r+1;return i(x),d.map(E=>E.id===f.id?{...E,minimized:!1,z:x}:E)}const _=r+1;i(_);const p=((v=u.defaultSize)==null?void 0:v.w)??560,C=((w=u.defaultSize)==null?void 0:w.h)??420,m=dp++%6*28,g={id:`win-${dp}`,appId:u.id,title:u.title,icon:u.icon,x:80+m,y:64+m,w:p,h:C,z:_,minimized:!1,maximized:!1};return[...d,g]})},[r]),o=y.useCallback(u=>{t(d=>d.filter(f=>f.id!==u))},[]),l=y.useCallback(u=>{t(d=>d.map(f=>f.id===u?{...f,minimized:!0}:f))},[]),c=y.useCallback(u=>{t(d=>d.map(f=>f.id===u?{...f,maximized:!f.maximized}:f))},[]),a=y.useCallback((u,d,f)=>{t(_=>_.map(p=>p.id===u?{...p,x:d,y:f}:p))},[]),h=y.useCallback((u,d,f)=>{t(_=>_.map(p=>p.id===u?{...p,w:d,h:f}:p))},[]);return{windows:e,openApp:n,close:o,focus:s,minimize:l,toggleMaximize:c,move:a,resize:h}}const H2=320,j2=200;function U2({win:e,active:t,children:r,onFocus:i,onClose:s,onMinimize:n,onToggleMaximize:o,onMove:l,onResize:c}){const a=y.useRef(null),h=y.useRef(null);function u(v){e.maximized||(i(),a.current={px:v.clientX,py:v.clientY,ox:e.x,oy:e.y},v.currentTarget.setPointerCapture(v.pointerId))}function d(v){a.current&&l(Math.max(0,a.current.ox+(v.clientX-a.current.px)),Math.max(0,a.current.oy+(v.clientY-a.current.py)))}function f(v){a.current=null,v.currentTarget.releasePointerCapture(v.pointerId)}function _(v){v.stopPropagation(),i(),h.current={px:v.clientX,py:v.clientY,ow:e.w,oh:e.h},v.currentTarget.setPointerCapture(v.pointerId)}function p(v){h.current&&c(Math.max(H2,h.current.ow+(v.clientX-h.current.px)),Math.max(j2,h.current.oh+(v.clientY-h.current.py)))}function C(v){h.current=null,v.currentTarget.releasePointerCapture(v.pointerId)}const m=e.icon,g=e.maximized?{inset:"0 0 0 0",zIndex:e.z}:{left:e.x,top:e.y,width:e.w,height:e.h,zIndex:e.z};return S.jsxs("section",{className:le("absolute flex flex-col overflow-hidden rounded-lg border bg-card shadow-2xl",t?"border-ring/60":"border-border"),style:g,onPointerDown:i,"aria-label":e.title,children:[S.jsxs("header",{className:"flex h-9 shrink-0 cursor-grab items-center gap-2 border-b bg-muted/40 px-2 select-none active:cursor-grabbing",onPointerDown:u,onPointerMove:d,onPointerUp:f,onDoubleClick:o,children:[S.jsx(m,{className:"size-4 text-muted-foreground","aria-hidden":!0}),S.jsx("span",{className:"flex-1 truncate text-sm font-medium",children:e.title}),S.jsx("button",{className:"grid size-6 place-items-center rounded hover:bg-accent",onClick:n,"aria-label":"Minimize",children:S.jsx(C1,{className:"size-3.5","aria-hidden":!0})}),S.jsx("button",{className:"grid size-6 place-items-center rounded hover:bg-accent",onClick:o,"aria-label":"Maximize",children:S.jsx(E1,{className:"size-3","aria-hidden":!0})}),S.jsx("button",{className:"grid size-6 place-items-center rounded hover:bg-destructive hover:text-white",onClick:s,"aria-label":"Close",children:S.jsx(R1,{className:"size-3.5","aria-hidden":!0})})]}),S.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:r}),!e.maximized&&S.jsx("div",{className:"absolute right-0 bottom-0 size-4 cursor-se-resize",onPointerDown:_,onPointerMove:p,onPointerUp:C})]})}function V2({...e}){return S.jsx(hk,{"data-slot":"popover",...e})}function K2({...e}){return S.jsx(dk,{"data-slot":"popover-trigger",...e})}function Y2({className:e,align:t="center",sideOffset:r=4,...i}){return S.jsx(fk,{children:S.jsx(pk,{"data-slot":"popover-content",align:t,sideOffset:r,className:le("z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...i})})}function fp({className:e,orientation:t="horizontal",decorative:r=!0,...i}){return S.jsx(vk,{"data-slot":"separator",decorative:r,orientation:t,className:le("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...i})}function q2(){const[e,t]=y.useState(()=>new Date);return y.useEffect(()=>{const r=setInterval(()=>t(new Date),1e4);return()=>clearInterval(r)},[]),S.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})}function G2({t:e,apps:t,windows:r,activeId:i,host:s,onLaunch:n,onSelectWindow:o,onDisconnect:l}){const[c,a]=y.useState(!1);return S.jsxs("footer",{className:"flex h-12 shrink-0 items-center gap-2 border-t bg-card/80 px-2 backdrop-blur",children:[S.jsxs(V2,{open:c,onOpenChange:a,children:[S.jsx(K2,{asChild:!0,children:S.jsxs(Ai,{variant:"ghost",size:"sm",className:"gap-2",children:[S.jsx(v1,{className:"size-4","aria-hidden":!0})," ",e("desktop.start")]})}),S.jsx(Y2,{align:"start",side:"top",className:"w-56 p-2",children:S.jsx("div",{className:"grid grid-cols-2 gap-1",children:t.map(h=>{const u=h.icon;return S.jsxs("button",{className:"flex flex-col items-center gap-2 rounded-md p-3 text-center text-xs hover:bg-accent",onClick:()=>{n(h),a(!1)},children:[S.jsx(u,{className:"size-6 text-muted-foreground","aria-hidden":!0}),h.title]},h.id)})})})]}),S.jsx(fp,{orientation:"vertical",className:"h-6"}),S.jsx("div",{className:"flex flex-1 items-center gap-1 overflow-x-auto",children:r.map(h=>{const u=h.icon;return S.jsxs("button",{onClick:()=>o(h.id),className:le("flex items-center gap-2 rounded-md px-3 py-1.5 text-xs",h.id===i&&!h.minimized?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/60"),children:[S.jsx(u,{className:"size-4","aria-hidden":!0}),S.jsx("span",{className:"max-w-32 truncate",children:h.title})]},h.id)})}),S.jsx(fp,{orientation:"vertical",className:"h-6"}),S.jsxs("span",{className:"hidden items-center gap-1.5 text-xs text-muted-foreground sm:flex",children:[S.jsx(Dg,{className:"size-3.5","aria-hidden":!0})," ",s]}),S.jsx(q2,{}),S.jsxs(Ai,{variant:"ghost",size:"sm",className:"gap-2",onClick:l,children:[S.jsx(w1,{className:"size-4","aria-hidden":!0})," ",e("desktop.disconnect")]})]})}function pp(e,t){return e==="/"?`/${t}`:`${e.replace(/\/+$/,"")}/${t}`}function X2(e){const t=e.replace(/\/+$/,""),r=t.lastIndexOf("/");return r<=0?"/":t.slice(0,r)}function lu(e){if(e<1024)return`${e} B`;const t=["KB","MB","GB","TB"];let r=e/1024,i=0;for(;r>=1024&&i<t.length-1;)r/=1024,i+=1;return`${r.toFixed(1)} ${t[i]}`}function Q2(e){const t=Math.floor(e/86400),r=Math.floor(e%86400/3600),i=Math.floor(e%3600/60),s=[];return t&&s.push(`${t}d`),r&&s.push(`${r}h`),s.push(`${i}m`),s.join(" ")}function Z2(e){const t=atob(e),r=Uint8Array.from(t,i=>i.charCodeAt(0));return new TextDecoder().decode(r)}function J2(e){const t=new TextEncoder().encode(e);let r="";for(const i of t)r+=String.fromCharCode(i);return btoa(r)}function eE(e){return!atob(e).slice(0,4096).includes("\0")}function tE({type:e}){const t="size-4 shrink-0 text-muted-foreground";return e==="directory"?S.jsx(Pg,{className:t,"aria-hidden":!0}):e==="symlink"?S.jsx(y1,{className:t,"aria-hidden":!0}):S.jsx(_1,{className:t,"aria-hidden":!0})}function rE({t:e,session:t,openEditor:r}){const[i,s]=y.useState(t.home),[n,o]=y.useState([]),[l,c]=y.useState(null);y.useEffect(()=>{let u=!0;return c(null),Eg(t.sessionId,i).then(d=>{u&&(d.result.kind==="ok"?o(d.result.value):c(e("files.error")))}).catch(d=>u&&c(d instanceof Error?d.message:String(d))),()=>{u=!1}},[t.sessionId,i,e]);function a(u){u.type==="directory"?s(pp(i,u.name)):u.type==="file"&&r(pp(i,u.name))}const h=[...n].sort((u,d)=>u.type==="directory"&&d.type!=="directory"?-1:u.type!=="directory"&&d.type==="directory"?1:u.name.localeCompare(d.name));return S.jsxs("div",{className:"flex h-full flex-col",children:[S.jsxs("div",{className:"flex items-center gap-2 border-b bg-muted/30 px-2 py-1.5",children:[S.jsx(Ai,{variant:"ghost",size:"icon",className:"size-7",disabled:i==="/",onClick:()=>s(X2(i)),"aria-label":e("files.up"),children:S.jsx(d1,{className:"size-4","aria-hidden":!0})}),S.jsx("code",{className:"truncate font-mono text-xs text-muted-foreground",children:i})]}),S.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[l&&S.jsx("p",{className:"p-3 text-sm text-destructive",children:l}),!l&&h.length===0&&S.jsx("p",{className:"p-3 text-sm text-muted-foreground",children:e("files.empty")}),S.jsx("ul",{children:h.map(u=>S.jsx("li",{children:S.jsxs("button",{className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm hover:bg-accent",onDoubleClick:()=>a(u),onClick:d=>d.detail===0&&a(u),children:[S.jsx(tE,{type:u.type}),S.jsx("span",{className:"flex-1 truncate",children:u.name}),S.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:u.type==="file"?lu(u.size):""})]})},u.name))})]})]})}function iE({t:e,session:t}){const[r,i]=y.useState(null),[s,n]=y.useState(!1);if(y.useEffect(()=>{let l=!0;async function c(){const{result:h}=await n1(t.sessionId).catch(()=>({result:null}));l&&((h==null?void 0:h.kind)==="ok"?(i(h.value),n(!1)):n(!0))}c();const a=setInterval(()=>void c(),2e3);return()=>{l=!1,clearInterval(a)}},[t.sessionId]),s&&!r)return S.jsx("div",{className:"grid h-full place-items-center p-6 text-sm text-muted-foreground",children:e("monitor.unavailable")});if(!r)return S.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"…"});const o=r.memory.totalBytes?Math.round(r.memory.usedBytes/r.memory.totalBytes*100):0;return S.jsxs("div",{className:"flex flex-col gap-4 p-4 text-sm",children:[S.jsxs("div",{className:"flex flex-col gap-1",children:[S.jsx("span",{className:"text-xs text-muted-foreground",children:e("monitor.uptime")}),S.jsx("span",{className:"text-lg font-medium tabular-nums",children:Q2(r.uptimeSeconds)})]}),S.jsxs("div",{className:"flex flex-col gap-1",children:[S.jsx("span",{className:"text-xs text-muted-foreground",children:e("monitor.load")}),S.jsx("span",{className:"font-mono tabular-nums",children:r.loadAverage.join(" · ")})]}),S.jsxs("div",{className:"flex flex-col gap-1.5",children:[S.jsx("span",{className:"text-xs text-muted-foreground",children:e("monitor.memory")}),S.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-muted",children:S.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${o}%`}})}),S.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:e("monitor.memoryUsage",{used:lu(r.memory.usedBytes),total:lu(r.memory.totalBytes),pct:o})})]})]})}function sE({t:e,session:t}){const[r,i]=y.useState(null);return y.useEffect(()=>{let s=!0;return Eg(t.sessionId).then(n=>s&&i(n)).catch(()=>{}),()=>{s=!1}},[t.sessionId]),S.jsxs("div",{className:"flex flex-col gap-4 p-4 text-sm",children:[S.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1",children:[S.jsx("dt",{className:"text-muted-foreground",children:e("system.os")}),S.jsx("dd",{children:t.os.prettyName??t.os.family}),S.jsx("dt",{className:"text-muted-foreground",children:e("system.host")}),S.jsx("dd",{children:t.host}),S.jsx("dt",{className:"text-muted-foreground",children:e("system.home")}),S.jsx("dd",{className:"font-mono text-xs",children:t.home})]}),S.jsxs("div",{children:[S.jsx("h3",{className:"mb-1 text-xs font-medium text-muted-foreground",children:e("system.transparency")}),S.jsx("ul",{className:"divide-y divide-border overflow-hidden rounded-md border font-mono text-xs",children:((r==null?void 0:r.transparency)??[]).map(s=>S.jsxs("li",{className:"flex items-center gap-2 px-3 py-1.5",children:[S.jsxs("span",{className:"text-primary",children:["[",s.exitCode??"ERR","]"]}),S.jsx("code",{className:"break-all",children:s.command})]},s.id))})]})]})}function nE({t:e,session:t,editorTarget:r}){const[i,s]=y.useState(null),[n,o]=y.useState(""),[l,c]=y.useState(!1),[a,h]=y.useState("idle"),[u,d]=y.useState(null);y.useEffect(()=>{if(!r||r===i)return;let _=!0;return h("loading"),d(null),o1(t.sessionId,r).then(({result:p})=>{if(_){if(p.kind!=="ok"){h("error"),d(e("editor.loadError"));return}if(!eE(p.base64)){h("error"),d(e("editor.binary"));return}s(r),o(Z2(p.base64)),c(!1),h("idle")}}).catch(()=>{_&&(h("error"),d(e("editor.loadError")))}),()=>{_=!1}},[r,i,t.sessionId,e]);function f(){i&&(h("saving"),l1(t.sessionId,i,J2(n)).then(({result:_})=>{_.kind==="ok"?(c(!1),h("saved"),d(null)):(h("error"),d(e("editor.saveError")))}).catch(()=>{h("error"),d(e("editor.saveError"))}))}return S.jsxs("div",{className:"flex h-full flex-col",children:[S.jsxs("div",{className:"flex items-center gap-2 border-b bg-muted/30 px-2 py-1.5",children:[l&&S.jsx(f1,{className:"size-2 fill-primary text-primary","aria-hidden":!0}),S.jsx("code",{className:"flex-1 truncate font-mono text-xs text-muted-foreground",children:i??e("editor.untitled")}),S.jsx("span",{className:"text-xs text-muted-foreground",children:a==="saving"?e("editor.saving"):a==="saved"?e("editor.saved"):l?e("editor.unsaved"):""}),S.jsxs(Ai,{size:"sm",variant:"outline",className:"h-7 gap-1.5",disabled:!i||!l||a==="saving",onClick:f,children:[S.jsx(x1,{className:"size-3.5","aria-hidden":!0})," ",e("editor.save")]})]}),u&&S.jsx("p",{className:"px-3 py-2 text-sm text-destructive",children:u}),S.jsx("textarea",{className:"min-h-0 flex-1 resize-none bg-transparent p-3 font-mono text-xs outline-none",value:n,spellCheck:!1,disabled:!i,onChange:_=>{o(_.target.value),c(!0),a==="saved"&&h("idle")},onKeyDown:_=>{(_.ctrlKey||_.metaKey)&&_.key==="s"&&(_.preventDefault(),f())}})]})}/**
|
|
196
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
197
|
+
* @license MIT
|
|
198
|
+
*
|
|
199
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
200
|
+
* @license MIT
|
|
201
|
+
*
|
|
202
|
+
* Originally forked from (with the author's permission):
|
|
203
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
204
|
+
* http://bellard.org/jslinux/
|
|
205
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
206
|
+
*/var Ry=Object.defineProperty,oE=Object.getOwnPropertyDescriptor,lE=(e,t)=>{for(var r in t)Ry(e,r,{get:t[r],enumerable:!0})},be=(e,t,r,i)=>{for(var s=i>1?void 0:i?oE(t,r):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(s=(i?o(t,r,s):o(s))||s);return i&&s&&Ry(t,r,s),s},W=(e,t)=>(r,i)=>t(r,i,e),_p="Terminal input",au={get:()=>_p,set:e=>_p=e},mp="Too much output to announce, navigate to rows manually to read",cu={get:()=>mp,set:e=>mp=e};function aE(e){return e.replace(/\r?\n/g,"\r")}function cE(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function uE(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function hE(e,t,r,i){if(e.stopPropagation(),e.clipboardData){let s=e.clipboardData.getData("text/plain");Py(s,t,r,i)}}function Py(e,t,r,i){e=aE(e),e=cE(e,r.decPrivateModes.bracketedPasteMode&&i.rawOptions.ignoreBracketedPasteMode!==!0),r.triggerDataEvent(e,!0),t.value=""}function Dy(e,t,r){let i=r.getBoundingClientRect(),s=e.clientX-i.left-10,n=e.clientY-i.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${s}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}function gp(e,t,r,i,s){Dy(e,t,r),s&&i.rightClickSelect(e),t.value=i.selectionText,t.select()}function Hr(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function aa(e,t=0,r=e.length){let i="";for(let s=t;s<r;++s){let n=e[s];n>65535?(n-=65536,i+=String.fromCharCode((n>>10)+55296)+String.fromCharCode(n%1024+56320)):i+=String.fromCharCode(n)}return i}var dE=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let r=e.length;if(!r)return 0;let i=0,s=0;if(this._interim){let n=e.charCodeAt(s++);56320<=n&&n<=57343?t[i++]=(this._interim-55296)*1024+n-56320+65536:(t[i++]=this._interim,t[i++]=n),this._interim=0}for(let n=s;n<r;++n){let o=e.charCodeAt(n);if(55296<=o&&o<=56319){if(++n>=r)return this._interim=o,i;let l=e.charCodeAt(n);56320<=l&&l<=57343?t[i++]=(o-55296)*1024+l-56320+65536:(t[i++]=o,t[i++]=l);continue}o!==65279&&(t[i++]=o)}return i}},fE=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let r=e.length;if(!r)return 0;let i=0,s,n,o,l,c=0,a=0;if(this.interim[0]){let d=!1,f=this.interim[0];f&=(f&224)===192?31:(f&240)===224?15:7;let _=0,p;for(;(p=this.interim[++_]&63)&&_<4;)f<<=6,f|=p;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,m=C-_;for(;a<m;){if(a>=r)return 0;if(p=e[a++],(p&192)!==128){a--,d=!0;break}else this.interim[_++]=p,f<<=6,f|=p&63}d||(C===2?f<128?a--:t[i++]=f:C===3?f<2048||f>=55296&&f<=57343||f===65279||(t[i++]=f):f<65536||f>1114111||(t[i++]=f)),this.interim.fill(0)}let h=r-4,u=a;for(;u<r;){for(;u<h&&!((s=e[u])&128)&&!((n=e[u+1])&128)&&!((o=e[u+2])&128)&&!((l=e[u+3])&128);)t[i++]=s,t[i++]=n,t[i++]=o,t[i++]=l,u+=4;if(s=e[u++],s<128)t[i++]=s;else if((s&224)===192){if(u>=r)return this.interim[0]=s,i;if(n=e[u++],(n&192)!==128){u--;continue}if(c=(s&31)<<6|n&63,c<128){u--;continue}t[i++]=c}else if((s&240)===224){if(u>=r)return this.interim[0]=s,i;if(n=e[u++],(n&192)!==128){u--;continue}if(u>=r)return this.interim[0]=s,this.interim[1]=n,i;if(o=e[u++],(o&192)!==128){u--;continue}if(c=(s&15)<<12|(n&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[i++]=c}else if((s&248)===240){if(u>=r)return this.interim[0]=s,i;if(n=e[u++],(n&192)!==128){u--;continue}if(u>=r)return this.interim[0]=s,this.interim[1]=n,i;if(o=e[u++],(o&192)!==128){u--;continue}if(u>=r)return this.interim[0]=s,this.interim[1]=n,this.interim[2]=o,i;if(l=e[u++],(l&192)!==128){u--;continue}if(c=(s&7)<<18|(n&63)<<12|(o&63)<<6|l&63,c<65536||c>1114111)continue;t[i++]=c}}return i}},My="",Yr=" ",qn=class Ly{constructor(){this.fg=0,this.bg=0,this.extended=new Ml}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new Ly;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}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}},Ml=class Ty{constructor(t=0,r=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new Ty(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Ot=class Ay extends qn{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ml,this.combinedData=""}static fromCharData(t){let r=new Ay;return r.setFromCharData(t),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Hr(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let r=!1;if(t[1].length>2)r=!0;else if(t[1].length===2){let i=t[1].charCodeAt(0);if(55296<=i&&i<=56319){let s=t[1].charCodeAt(1);56320<=s&&s<=57343?this.content=(i-55296)*1024+s-56320+65536|t[2]<<22:r=!0}else r=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;r&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},vp="di$target",uu="di$dependencies",Ga=new Map;function pE(e){return e[uu]||[]}function Ue(e){if(Ga.has(e))return Ga.get(e);let t=function(r,i,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");_E(t,r,s)};return t._id=e,Ga.set(e,t),t}function _E(e,t,r){t[vp]===t?t[uu].push({id:e,index:r}):(t[uu]=[{id:e,index:r}],t[vp]=t)}var at=Ue("BufferService"),Ny=Ue("CoreMouseService"),Wi=Ue("CoreService"),mE=Ue("CharsetService"),ad=Ue("InstantiationService"),Oy=Ue("LogService"),ct=Ue("OptionsService"),By=Ue("OscLinkService"),gE=Ue("UnicodeService"),Gn=Ue("DecorationService"),hu=class{constructor(e,t,r){this._bufferService=e,this._optionsService=t,this._oscLinkService=r}provideLinks(e,t){var h;let r=this._bufferService.buffer.lines.get(e-1);if(!r){t(void 0);return}let i=[],s=this._optionsService.rawOptions.linkHandler,n=new Ot,o=r.getTrimmedLength(),l=-1,c=-1,a=!1;for(let u=0;u<o;u++)if(!(c===-1&&!r.hasContent(u))){if(r.loadCell(u,n),n.hasExtendedAttrs()&&n.extended.urlId)if(c===-1){c=u,l=n.extended.urlId;continue}else a=n.extended.urlId!==l;else c!==-1&&(a=!0);if(a||c!==-1&&u===o-1){let d=(h=this._oscLinkService.getLinkData(l))==null?void 0:h.uri;if(d){let f={start:{x:c+1,y:e},end:{x:u+(!a&&u===o-1?1:0),y:e}},_=!1;if(!(s!=null&&s.allowNonHttpProtocols))try{let p=new URL(d);["http:","https:"].includes(p.protocol)||(_=!0)}catch{_=!0}_||i.push({text:d,range:f,activate:(p,C)=>s?s.activate(p,C,f):vE(p,C),hover:(p,C)=>{var m;return(m=s==null?void 0:s.hover)==null?void 0:m.call(s,p,C,f)},leave:(p,C)=>{var m;return(m=s==null?void 0:s.leave)==null?void 0:m.call(s,p,C,f)}})}a=!1,n.hasExtendedAttrs()&&n.extended.urlId?(c=u,l=n.extended.urlId):(c=-1,l=-1)}}t(i)}};hu=be([W(0,at),W(1,ct),W(2,By)],hu);function vE(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
207
|
+
|
|
208
|
+
WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var ca=Ue("CharSizeService"),Tr=Ue("CoreBrowserService"),cd=Ue("MouseService"),Ar=Ue("RenderService"),yE=Ue("SelectionService"),Iy=Ue("CharacterJoinerService"),Bs=Ue("ThemeService"),zy=Ue("LinkProviderService"),SE=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?yp.isErrorNoTelemetry(e)?new yp(e.message+`
|
|
209
|
+
|
|
210
|
+
`+e.stack):new Error(e.message+`
|
|
211
|
+
|
|
212
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(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)}},wE=new SE;function qo(e){CE(e)||wE.onUnexpectedError(e)}var du="Canceled";function CE(e){return e instanceof xE?!0:e instanceof Error&&e.name===du&&e.message===du}var xE=class extends Error{constructor(){super(du),this.name=this.message}};function bE(e){return new Error(`Illegal argument: ${e}`)}var yp=class fu extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof fu)return t;let r=new fu;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},pu=class Fy extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,Fy.prototype)}};function vt(e,t=0){return e[e.length-(1+t)]}var kE;(e=>{function t(n){return n<0}e.isLessThan=t;function r(n){return n<=0}e.isLessThanOrEqual=r;function i(n){return n>0}e.isGreaterThan=i;function s(n){return n===0}e.isNeitherLessOrGreaterThan=s,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(kE||(kE={}));function EE(e,t){let r=this,i=!1,s;return function(){return i||(i=!0,t||(s=e.apply(r,arguments))),s}}var $y;(e=>{function t(w){return w&&typeof w=="object"&&typeof w[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function i(){return r}e.empty=i;function*s(w){yield w}e.single=s;function n(w){return t(w)?w:s(w)}e.wrap=n;function o(w){return w||r}e.from=o;function*l(w){for(let x=w.length-1;x>=0;x--)yield w[x]}e.reverse=l;function c(w){return!w||w[Symbol.iterator]().next().done===!0}e.isEmpty=c;function a(w){return w[Symbol.iterator]().next().value}e.first=a;function h(w,x){let E=0;for(let P of w)if(x(P,E++))return!0;return!1}e.some=h;function u(w,x){for(let E of w)if(x(E))return E}e.find=u;function*d(w,x){for(let E of w)x(E)&&(yield E)}e.filter=d;function*f(w,x){let E=0;for(let P of w)yield x(P,E++)}e.map=f;function*_(w,x){let E=0;for(let P of w)yield*x(P,E++)}e.flatMap=_;function*p(...w){for(let x of w)yield*x}e.concat=p;function C(w,x,E){let P=E;for(let k of w)P=x(P,k);return P}e.reduce=C;function*m(w,x,E=w.length){for(x<0&&(x+=w.length),E<0?E+=w.length:E>w.length&&(E=w.length);x<E;x++)yield w[x]}e.slice=m;function g(w,x=Number.POSITIVE_INFINITY){let E=[];if(x===0)return[E,w];let P=w[Symbol.iterator]();for(let k=0;k<x;k++){let I=P.next();if(I.done)return[E,e.empty()];E.push(I.value)}return[E,{[Symbol.iterator](){return P}}]}e.consume=g;async function v(w){let x=[];for await(let E of w)x.push(E);return Promise.resolve(x)}e.asyncToArray=v})($y||($y={}));function Ni(e){if($y.is(e)){let t=[];for(let r of e)if(r)try{r.dispose()}catch(i){t.push(i)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function RE(...e){return fe(()=>Ni(e))}function fe(e){return{dispose:EE(()=>{e()})}}var Wy=class Hy{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{Ni(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Hy.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(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};Wy.DISABLE_DISPOSED_WARNING=!1;var ri=Wy,G=class{constructor(){this._store=new ri,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)}};G.None=Object.freeze({dispose(){}});var Ds=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.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}},Sr=typeof window=="object"?window:globalThis,_u=class mu{constructor(t){this.element=t,this.next=mu.Undefined,this.prev=mu.Undefined}};_u.Undefined=new _u(void 0);var pe=_u,Sp=class{constructor(){this._first=pe.Undefined,this._last=pe.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===pe.Undefined}clear(){let e=this._first;for(;e!==pe.Undefined;){let t=e.next;e.prev=pe.Undefined,e.next=pe.Undefined,e=t}this._first=pe.Undefined,this._last=pe.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new pe(e);if(this._first===pe.Undefined)this._first=r,this._last=r;else if(t){let s=this._last;this._last=r,r.prev=s,s.next=r}else{let s=this._first;this._first=r,r.next=s,s.prev=r}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(r))}}shift(){if(this._first!==pe.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==pe.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==pe.Undefined&&e.next!==pe.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===pe.Undefined&&e.next===pe.Undefined?(this._first=pe.Undefined,this._last=pe.Undefined):e.next===pe.Undefined?(this._last=this._last.prev,this._last.next=pe.Undefined):e.prev===pe.Undefined&&(this._first=this._first.next,this._first.prev=pe.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==pe.Undefined;)yield e.element,e=e.next}},PE=globalThis.performance&&typeof globalThis.performance.now=="function",DE=class jy{static create(t){return new jy(t)}constructor(t){this._now=PE&&t===!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}},Ye;(e=>{e.None=()=>G.None;function t(T,R){return u(T,()=>{},0,void 0,!0,void 0,R)}e.defer=t;function r(T){return(R,A=null,N)=>{let L=!1,F;return F=T(b=>{if(!L)return F?F.dispose():L=!0,R.call(A,b)},null,N),L&&F.dispose(),F}}e.once=r;function i(T,R,A){return a((N,L=null,F)=>T(b=>N.call(L,R(b)),null,F),A)}e.map=i;function s(T,R,A){return a((N,L=null,F)=>T(b=>{R(b),N.call(L,b)},null,F),A)}e.forEach=s;function n(T,R,A){return a((N,L=null,F)=>T(b=>R(b)&&N.call(L,b),null,F),A)}e.filter=n;function o(T){return T}e.signal=o;function l(...T){return(R,A=null,N)=>{let L=RE(...T.map(F=>F(b=>R.call(A,b))));return h(L,N)}}e.any=l;function c(T,R,A,N){let L=A;return i(T,F=>(L=R(L,F),L),N)}e.reduce=c;function a(T,R){let A,N={onWillAddFirstListener(){A=T(L.fire,L)},onDidRemoveLastListener(){A==null||A.dispose()}},L=new z(N);return R==null||R.add(L),L.event}function h(T,R){return R instanceof Array?R.push(T):R&&R.add(T),T}function u(T,R,A=100,N=!1,L=!1,F,b){let B,D,X,ee=0,Se,ne={leakWarningThreshold:F,onWillAddFirstListener(){B=T(Q=>{ee++,D=R(D,Q),N&&!X&&(re.fire(D),D=void 0),Se=()=>{let Me=D;D=void 0,X=void 0,(!N||ee>1)&&re.fire(Me),ee=0},typeof A=="number"?(clearTimeout(X),X=setTimeout(Se,A)):X===void 0&&(X=0,queueMicrotask(Se))})},onWillRemoveListener(){L&&ee>0&&(Se==null||Se())},onDidRemoveLastListener(){Se=void 0,B.dispose()}},re=new z(ne);return b==null||b.add(re),re.event}e.debounce=u;function d(T,R=0,A){return e.debounce(T,(N,L)=>N?(N.push(L),N):[L],R,void 0,!0,void 0,A)}e.accumulate=d;function f(T,R=(N,L)=>N===L,A){let N=!0,L;return n(T,F=>{let b=N||!R(F,L);return N=!1,L=F,b},A)}e.latch=f;function _(T,R,A){return[e.filter(T,R,A),e.filter(T,N=>!R(N),A)]}e.split=_;function p(T,R=!1,A=[],N){let L=A.slice(),F=T(D=>{L?L.push(D):B.fire(D)});N&&N.add(F);let b=()=>{L==null||L.forEach(D=>B.fire(D)),L=null},B=new z({onWillAddFirstListener(){F||(F=T(D=>B.fire(D)),N&&N.add(F))},onDidAddFirstListener(){L&&(R?setTimeout(b):b())},onDidRemoveLastListener(){F&&F.dispose(),F=null}});return N&&N.add(B),B.event}e.buffer=p;function C(T,R){return(A,N,L)=>{let F=R(new g);return T(function(b){let B=F.evaluate(b);B!==m&&A.call(N,B)},void 0,L)}}e.chain=C;let m=Symbol("HaltChainable");class g{constructor(){this.steps=[]}map(R){return this.steps.push(R),this}forEach(R){return this.steps.push(A=>(R(A),A)),this}filter(R){return this.steps.push(A=>R(A)?A:m),this}reduce(R,A){let N=A;return this.steps.push(L=>(N=R(N,L),N)),this}latch(R=(A,N)=>A===N){let A=!0,N;return this.steps.push(L=>{let F=A||!R(L,N);return A=!1,N=L,F?L:m}),this}evaluate(R){for(let A of this.steps)if(R=A(R),R===m)break;return R}}function v(T,R,A=N=>N){let N=(...B)=>b.fire(A(...B)),L=()=>T.on(R,N),F=()=>T.removeListener(R,N),b=new z({onWillAddFirstListener:L,onDidRemoveLastListener:F});return b.event}e.fromNodeEventEmitter=v;function w(T,R,A=N=>N){let N=(...B)=>b.fire(A(...B)),L=()=>T.addEventListener(R,N),F=()=>T.removeEventListener(R,N),b=new z({onWillAddFirstListener:L,onDidRemoveLastListener:F});return b.event}e.fromDOMEventEmitter=w;function x(T){return new Promise(R=>r(T)(R))}e.toPromise=x;function E(T){let R=new z;return T.then(A=>{R.fire(A)},()=>{R.fire(void 0)}).finally(()=>{R.dispose()}),R.event}e.fromPromise=E;function P(T,R){return T(A=>R.fire(A))}e.forward=P;function k(T,R,A){return R(A),T(N=>R(N))}e.runAndSubscribe=k;class I{constructor(R,A){this._observable=R,this._counter=0,this._hasChanged=!1;let N={onWillAddFirstListener:()=>{R.addObserver(this)},onDidRemoveLastListener:()=>{R.removeObserver(this)}};this.emitter=new z(N),A&&A.add(this.emitter)}beginUpdate(R){this._counter++}handlePossibleChange(R){}handleChange(R,A){this._hasChanged=!0}endUpdate(R){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function $(T,R){return new I(T,R).emitter.event}e.fromObservable=$;function j(T){return(R,A,N)=>{let L=0,F=!1,b={beginUpdate(){L++},endUpdate(){L--,L===0&&(T.reportChanges(),F&&(F=!1,R.call(A)))},handlePossibleChange(){},handleChange(){F=!0}};T.addObserver(b),T.reportChanges();let B={dispose(){T.removeObserver(b)}};return N instanceof ri?N.add(B):Array.isArray(N)&&N.push(B),B}}e.fromObservableLight=j})(Ye||(Ye={}));var gu=class vu{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${vu._idPool++}`,vu.all.add(this)}start(t){this._stopWatch=new DE,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};gu.all=new Set,gu._idPool=0;var ME=gu,LE=-1,Uy=class Vy{constructor(t,r,i=(Vy._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=i,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,r){let i=this.threshold;if(i<=0||r<i)return;this._stacks||(this._stacks=new Map);let s=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i*.5;let[n,o]=this.getMostFrequentStack(),l=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${o}):`;console.warn(l),console.warn(n);let c=new NE(l,n);this._errorHandler(c)}return()=>{let n=this._stacks.get(t.value)||0;this._stacks.set(t.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[i,s]of this._stacks)(!t||r<s)&&(t=[i,s],r=s);return t}};Uy._idPool=1;var TE=Uy,AE=class Ky{constructor(t){this.value=t}static create(){let t=new Error;return new Ky(t.stack??"")}print(){console.warn(this.value.split(`
|
|
213
|
+
`).slice(2).join(`
|
|
214
|
+
`))}},NE=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},OE=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},BE=0,Xa=class{constructor(e){this.value=e,this.id=BE++}},IE=2,zE,z=class{constructor(e){var t,r,i,s;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new TE((e==null?void 0:e.onListenerError)??qo,((r=this._options)==null?void 0:r.leakWarningThreshold)??LE):void 0,this._perfMon=(i=this._options)!=null&&i._profName?new ME(this._options._profName):void 0,this._deliveryQueue=(s=this._options)==null?void 0:s.deliveryQueue}dispose(){var e,t,r,i;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(r=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t),(i=this._leakageMon)==null||i.dispose())}get event(){return this._event??(this._event=(e,t,r)=>{var o,l,c,a,h;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let d=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=new OE(`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0]);return(((o=this._options)==null?void 0:o.onListenerError)||qo)(f),G.None}if(this._disposed)return G.None;t&&(e=e.bind(t));let i=new Xa(e),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=AE.create(),s=this._leakageMon.check(i.stack,this._size+1)),this._listeners?this._listeners instanceof Xa?(this._deliveryQueue??(this._deliveryQueue=new FE),this._listeners=[this._listeners,i]):this._listeners.push(i):((c=(l=this._options)==null?void 0:l.onWillAddFirstListener)==null||c.call(l,this),this._listeners=i,(h=(a=this._options)==null?void 0:a.onDidAddFirstListener)==null||h.call(a,this)),this._size++;let n=fe(()=>{s==null||s(),this._removeListener(i)});return r instanceof ri?r.add(n):Array.isArray(r)&&r.push(n),n}),this._event}_removeListener(e){var s,n,o,l;if((n=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||n.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(l=(o=this._options)==null?void 0:o.onDidRemoveLastListener)==null||l.call(o,this),this._size=0;return}let t=this._listeners,r=t.indexOf(e);if(r===-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--,t[r]=void 0;let i=this._deliveryQueue.current===this;if(this._size*IE<=t.length){let c=0;for(let a=0;a<t.length;a++)t[a]?t[c++]=t[a]:i&&(this._deliveryQueue.end--,c<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=c}}_deliver(e,t){var i;if(!e)return;let r=((i=this._options)==null?void 0:i.onListenerError)||qo;if(!r){e.value(t);return}try{e.value(t)}catch(s){r(s)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,r,i,s;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(r=this._perfMon)==null||r.stop()),(i=this._perfMon)==null||i.start(this._size),this._listeners)if(this._listeners instanceof Xa)this._deliver(this._listeners,e);else{let n=this._deliveryQueue;n.enqueue(this,e,this._listeners.length),this._deliverQueue(n)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}},FE=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},yu=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(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,r){if(this.getZoomLevel(r)===t)return;let i=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(i,t),this._onDidChangeZoomLevel.fire(i)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),t)}setFullscreen(t,r){if(this.isFullscreen(r)===t)return;let i=this.getWindowId(r);this.mapWindowIdToFullScreen.set(i,t),this._onDidChangeFullscreen.fire(i)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};yu.INSTANCE=new yu;var ud=yu;function $E(e,t,r){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",r)}ud.INSTANCE.onDidChangeZoomLevel;function WE(e){return ud.INSTANCE.getZoomFactor(e)}ud.INSTANCE.onDidChangeFullscreen;var Is=typeof navigator=="object"?navigator.userAgent:"",Su=Is.indexOf("Firefox")>=0,HE=Is.indexOf("AppleWebKit")>=0,hd=Is.indexOf("Chrome")>=0,jE=!hd&&Is.indexOf("Safari")>=0;Is.indexOf("Electron/")>=0;Is.indexOf("Android")>=0;var Qa=!1;if(typeof Sr.matchMedia=="function"){let e=Sr.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Sr.matchMedia("(display-mode: fullscreen)");Qa=e.matches,$E(Sr,e,({matches:r})=>{Qa&&t.matches||(Qa=r)})}var as="en",wu=!1,Cu=!1,Go=!1,Yy=!1,Ro,Xo=as,wp=as,UE,Ft,ki=globalThis,Ke,c_;typeof ki.vscode<"u"&&typeof ki.vscode.process<"u"?Ke=ki.vscode.process:typeof process<"u"&&typeof((c_=process==null?void 0:process.versions)==null?void 0:c_.node)=="string"&&(Ke=process);var u_,VE=typeof((u_=Ke==null?void 0:Ke.versions)==null?void 0:u_.electron)=="string",KE=VE&&(Ke==null?void 0:Ke.type)==="renderer",h_;if(typeof Ke=="object"){wu=Ke.platform==="win32",Cu=Ke.platform==="darwin",Go=Ke.platform==="linux",Go&&Ke.env.SNAP&&Ke.env.SNAP_REVISION,Ke.env.CI||Ke.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ro=as,Xo=as;let e=Ke.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Ro=t.userLocale,wp=t.osLocale,Xo=t.resolvedLanguage||as,UE=(h_=t.languagePack)==null?void 0:h_.translationsConfigFile}catch{}Yy=!0}else typeof navigator=="object"&&!KE?(Ft=navigator.userAgent,wu=Ft.indexOf("Windows")>=0,Cu=Ft.indexOf("Macintosh")>=0,(Ft.indexOf("Macintosh")>=0||Ft.indexOf("iPad")>=0||Ft.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Go=Ft.indexOf("Linux")>=0,(Ft==null?void 0:Ft.indexOf("Mobi"))>=0,Xo=globalThis._VSCODE_NLS_LANGUAGE||as,Ro=navigator.language.toLowerCase(),wp=Ro):console.error("Unable to resolve platform.");var qy=wu,ur=Cu,YE=Go,Cp=Yy,hr=Ft,Br=Xo,qE;(e=>{function t(){return Br}e.value=t;function r(){return Br.length===2?Br==="en":Br.length>=3?Br[0]==="e"&&Br[1]==="n"&&Br[2]==="-":!1}e.isDefaultVariant=r;function i(){return Br==="en"}e.isDefault=i})(qE||(qE={}));var GE=typeof ki.postMessage=="function"&&!ki.importScripts;(()=>{if(GE){let e=[];ki.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let i=0,s=e.length;i<s;i++){let n=e[i];if(n.id===r.data.vscodeScheduleAsyncWork){e.splice(i,1),n.callback();return}}});let t=0;return r=>{let i=++t;e.push({id:i,callback:r}),ki.postMessage({vscodeScheduleAsyncWork:i},"*")}}return e=>setTimeout(e)})();var XE=!!(hr&&hr.indexOf("Chrome")>=0);hr&&hr.indexOf("Firefox")>=0;!XE&&hr&&hr.indexOf("Safari")>=0;hr&&hr.indexOf("Edg/")>=0;hr&&hr.indexOf("Android")>=0;var qi=typeof navigator=="object"?navigator:{};Cp||document.queryCommandSupported&&document.queryCommandSupported("copy")||qi&&qi.clipboard&&qi.clipboard.writeText,Cp||qi&&qi.clipboard&&qi.clipboard.readText;var dd=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Za=new dd,xp=new dd,bp=new dd,QE=new Array(230),Gy;(e=>{function t(l){return Za.keyCodeToStr(l)}e.toString=t;function r(l){return Za.strToKeyCode(l)}e.fromString=r;function i(l){return xp.keyCodeToStr(l)}e.toUserSettingsUS=i;function s(l){return bp.keyCodeToStr(l)}e.toUserSettingsGeneral=s;function n(l){return xp.strToKeyCode(l)||bp.strToKeyCode(l)}e.fromUserSettings=n;function o(l){if(l>=98&&l<=113)return null;switch(l){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Za.keyCodeToStr(l)}e.toElectronAccelerator=o})(Gy||(Gy={}));var ZE=class Xy{constructor(t,r,i,s,n){this.ctrlKey=t,this.shiftKey=r,this.altKey=i,this.metaKey=s,this.keyCode=n}equals(t){return t instanceof Xy&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",r=this.shiftKey?"1":"0",i=this.altKey?"1":"0",s=this.metaKey?"1":"0";return`K${t}${r}${i}${s}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new JE([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},JE=class{constructor(e){if(e.length===0)throw bE("chords");this.chords=e}getHashCode(){let e="";for(let t=0,r=this.chords.length;t<r;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function eR(e){if(e.charCode){let r=String.fromCharCode(e.charCode).toUpperCase();return Gy.fromString(r)}let t=e.keyCode;if(t===3)return 7;if(Su)switch(t){case 59:return 85;case 60:if(YE)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(ur)return 57;break}else if(HE&&(ur&&t===93||!ur&&t===92))return 57;return QE[t]||0}var tR=ur?256:2048,rR=512,iR=1024,sR=ur?2048:256,kp=class{constructor(e){var r;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(r=t.getModifierState)==null?void 0:r.call(t,"AltGraph"),this.keyCode=eR(t),this.code=t.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 t=0;return this.ctrlKey&&(t|=tR),this.altKey&&(t|=rR),this.shiftKey&&(t|=iR),this.metaKey&&(t|=sR),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new ZE(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Ep=new WeakMap;function nR(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,r=e.parent.location;if(t.origin!=="null"&&r.origin!=="null"&&t.origin!==r.origin)return null}catch{return null}return e.parent}var oR=class{static getSameOriginWindowChain(e){let t=Ep.get(e);if(!t){t=[],Ep.set(e,t);let r=e,i;do i=nR(r),i?t.push({window:new WeakRef(r),iframeElement:r.frameElement||null}):t.push({window:new WeakRef(r),iframeElement:null}),r=i;while(r)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let r=0,i=0,s=this.getSameOriginWindowChain(e);for(let n of s){let o=n.window.deref();if(r+=(o==null?void 0:o.scrollY)??0,i+=(o==null?void 0:o.scrollX)??0,o===t||!n.iframeElement)break;let l=n.iframeElement.getBoundingClientRect();r+=l.top,i+=l.left}return{top:r,left:i}}},Po=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let r=oR.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=r.left,this.posy-=r.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Rp=class{constructor(e,t=0,r=0){var s;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=r,this.deltaX=t;let i=!1;if(hd){let n=navigator.userAgent.match(/Chrome\/(\d+)/);i=(n?parseInt(n[1]):123)<=122}if(e){let n=e,o=e,l=((s=e.view)==null?void 0:s.devicePixelRatio)||1;if(typeof n.wheelDeltaY<"u")i?this.deltaY=n.wheelDeltaY/(120*l):this.deltaY=n.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){let c=e;c.deltaMode===c.DOM_DELTA_LINE?Su&&!ur?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof n.wheelDeltaX<"u")jE&&qy?this.deltaX=-(n.wheelDeltaX/120):i?this.deltaX=n.wheelDeltaX/(120*l):this.deltaX=n.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let c=e;c.deltaMode===c.DOM_DELTA_LINE?Su&&!ur?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(i?this.deltaY=e.wheelDelta/(120*l):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},Qy=Object.freeze(function(e,t){let r=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(r)}}}),lR;(e=>{function t(r){return r===e.None||r===e.Cancelled||r instanceof aR?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ye.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Qy})})(lR||(lR={}));var aR=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?Qy:(this._emitter||(this._emitter=new z),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},fd=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new pu("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new pu("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},cR=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,r=globalThis){if(this.isDisposed)throw new pu("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let i=r.setInterval(()=>{e()},t);this.disposable=fe(()=>{r.clearInterval(i),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},uR;(e=>{async function t(i){let s,n=await Promise.all(i.map(o=>o.then(l=>l,l=>{s||(s=l)})));if(typeof s<"u")throw s;return n}e.settled=t;function r(i){return new Promise(async(s,n)=>{try{await i(s,n)}catch(o){n(o)}})}e.withAsyncBody=r})(uR||(uR={}));var Pp=class Dt{static fromArray(t){return new Dt(r=>{r.emitMany(t)})}static fromPromise(t){return new Dt(async r=>{r.emitMany(await t)})}static fromPromises(t){return new Dt(async r=>{await Promise.all(t.map(async i=>r.emitOne(await i)))})}static merge(t){return new Dt(async r=>{await Promise.all(t.map(async i=>{for await(let s of i)r.emitOne(s)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new z,queueMicrotask(async()=>{let i={emitOne:s=>this.emitOne(s),emitMany:s=>this.emitMany(s),reject:s=>this.reject(s)};try{await Promise.resolve(t(i)),this.resolve()}catch(s){this.reject(s)}finally{i.emitOne=void 0,i.emitMany=void 0,i.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await Ye.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var r;return(r=this._onReturn)==null||r.call(this),{done:!0,value:void 0}}}}static map(t,r){return new Dt(async i=>{for await(let s of t)i.emitOne(r(s))})}map(t){return Dt.map(this,t)}static filter(t,r){return new Dt(async i=>{for await(let s of t)r(s)&&i.emitOne(s)})}filter(t){return Dt.filter(this,t)}static coalesce(t){return Dt.filter(t,r=>!!r)}coalesce(){return Dt.coalesce(this)}static async toPromise(t){let r=[];for await(let i of t)r.push(i);return r}toPromise(){return Dt.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};Pp.EMPTY=Pp.fromArray([]);var{getWindow:or,getWindowId:hR,onDidRegisterWindow:dR}=function(){let e=new Map,t={window:Sr,disposables:new ri};e.set(Sr.vscodeWindowId,t);let r=new z,i=new z,s=new z;function n(o,l){return(typeof o=="number"?e.get(o):void 0)??(l?t:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:i.event,registerWindow(o){if(e.has(o.vscodeWindowId))return G.None;let l=new ri,c={window:o,disposables:l.add(new ri)};return e.set(o.vscodeWindowId,c),l.add(fe(()=>{e.delete(o.vscodeWindowId),i.fire(o)})),l.add(K(o,ze.BEFORE_UNLOAD,()=>{s.fire(o)})),r.fire(c),l},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return e.has(o)},getWindowById:n,getWindow(o){var a;let l=o;if((a=l==null?void 0:l.ownerDocument)!=null&&a.defaultView)return l.ownerDocument.defaultView.window;let c=o;return c!=null&&c.view?c.view.window:Sr},getDocument(o){return or(o).document}}}(),fR=class{constructor(e,t,r,i){this._node=e,this._type=t,this._handler=r,this._options=i||!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 K(e,t,r,i){return new fR(e,t,r,i)}var Dp=function(e,t,r,i){return K(e,t,r,i)},pd,pR=class extends cR{constructor(e){super(),this.defaultTarget=e&&or(e)}cancelAndSet(e,t,r){return super.cancelAndSet(e,t,r??this.defaultTarget)}},Mp=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){qo(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,r=new Map,i=new Map,s=n=>{r.set(n,!1);let o=e.get(n)??[];for(t.set(n,o),e.set(n,[]),i.set(n,!0);o.length>0;)o.sort(Mp.sort),o.shift().execute();i.set(n,!1)};pd=(n,o,l=0)=>{let c=hR(n),a=new Mp(o,l),h=e.get(c);return h||(h=[],e.set(c,h)),h.push(a),r.get(c)||(r.set(c,!0),n.requestAnimationFrame(()=>s(c))),a}})();function _R(e){let t=e.getBoundingClientRect(),r=or(e);return{left:t.left+r.scrollX,top:t.top+r.scrollY,width:t.width,height:t.height}}var ze={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"},mR=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 t=ht(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=ht(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=ht(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=ht(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=ht(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=ht(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=ht(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=ht(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=ht(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=ht(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=ht(e);this._paddingRight!==t&&(this._paddingRight=t,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 t=ht(e);this._fontSize!==t&&(this._fontSize=t,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 t=ht(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=ht(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),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,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function ht(e){return typeof e=="number"?`${e}px`:e}function vn(e){return new mR(e)}var Zy=class{constructor(){this._hooks=new ri,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let r=this._onStopCallback;this._onStopCallback=null,e&&r&&r(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,r,i,s){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=i,this._onStopCallback=s;let n=e;try{e.setPointerCapture(t),this._hooks.add(fe(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{n=or(e)}this._hooks.add(K(n,ze.POINTER_MOVE,o=>{if(o.buttons!==r){this.stopMonitoring(!0);return}o.preventDefault(),this._pointerMoveCallback(o)})),this._hooks.add(K(n,ze.POINTER_UP,o=>this.stopMonitoring(!0)))}};function gR(e,t,r){let i=null,s=null;if(typeof r.value=="function"?(i="value",s=r.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof r.get=="function"&&(i="get",s=r.get),!s)throw new Error("not supported");let n=`$memoize$${t}`;r[i]=function(...o){return this.hasOwnProperty(n)||Object.defineProperty(this,n,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,o)}),this[n]}}var tr;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(tr||(tr={}));var sn=class Je extends G{constructor(){super(),this.dispatched=!1,this.targets=new Sp,this.ignoreTargets=new Sp,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Ye.runAndSubscribe(dR,({window:t,disposables:r})=>{r.add(K(t.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),r.add(K(t.document,"touchend",i=>this.onTouchEnd(t,i))),r.add(K(t.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:Sr,disposables:this._store}))}static addTarget(t){if(!Je.isTouchDevice())return G.None;Je.INSTANCE||(Je.INSTANCE=new Je);let r=Je.INSTANCE.targets.push(t);return fe(r)}static ignoreTarget(t){if(!Je.isTouchDevice())return G.None;Je.INSTANCE||(Je.INSTANCE=new Je);let r=Je.INSTANCE.ignoreTargets.push(t);return fe(r)}static isTouchDevice(){return"ontouchstart"in Sr||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let r=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,s=t.targetTouches.length;i<s;i++){let n=t.targetTouches.item(i);this.activeTouches[n.identifier]={id:n.identifier,initialTarget:n.target,initialTimeStamp:r,initialPageX:n.pageX,initialPageY:n.pageY,rollingTimestamps:[r],rollingPageX:[n.pageX],rollingPageY:[n.pageY]};let o=this.newGestureEvent(tr.Start,n.target);o.pageX=n.pageX,o.pageY=n.pageY,this.dispatchEvent(o)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,r){let i=Date.now(),s=Object.keys(this.activeTouches).length;for(let n=0,o=r.changedTouches.length;n<o;n++){let l=r.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("move of an UNKNOWN touch",l);continue}let c=this.activeTouches[l.identifier],a=Date.now()-c.initialTimeStamp;if(a<Je.HOLD_DELAY&&Math.abs(c.initialPageX-vt(c.rollingPageX))<30&&Math.abs(c.initialPageY-vt(c.rollingPageY))<30){let h=this.newGestureEvent(tr.Tap,c.initialTarget);h.pageX=vt(c.rollingPageX),h.pageY=vt(c.rollingPageY),this.dispatchEvent(h)}else if(a>=Je.HOLD_DELAY&&Math.abs(c.initialPageX-vt(c.rollingPageX))<30&&Math.abs(c.initialPageY-vt(c.rollingPageY))<30){let h=this.newGestureEvent(tr.Contextmenu,c.initialTarget);h.pageX=vt(c.rollingPageX),h.pageY=vt(c.rollingPageY),this.dispatchEvent(h)}else if(s===1){let h=vt(c.rollingPageX),u=vt(c.rollingPageY),d=vt(c.rollingTimestamps)-c.rollingTimestamps[0],f=h-c.rollingPageX[0],_=u-c.rollingPageY[0],p=[...this.targets].filter(C=>c.initialTarget instanceof Node&&C.contains(c.initialTarget));this.inertia(t,p,i,Math.abs(f)/d,f>0?1:-1,h,Math.abs(_)/d,_>0?1:-1,u)}this.dispatchEvent(this.newGestureEvent(tr.End,c.initialTarget)),delete this.activeTouches[l.identifier]}this.dispatched&&(r.preventDefault(),r.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,r){let i=document.createEvent("CustomEvent");return i.initEvent(t,!1,!0),i.initialTarget=r,i.tapCount=0,i}dispatchEvent(t){if(t.type===tr.Tap){let r=new Date().getTime(),i=0;r-this._lastSetTapCountTime>Je.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=r,t.tapCount=i}else(t.type===tr.Change||t.type===tr.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let i of this.ignoreTargets)if(i.contains(t.initialTarget))return;let r=[];for(let i of this.targets)if(i.contains(t.initialTarget)){let s=0,n=t.initialTarget;for(;n&&n!==i;)s++,n=n.parentElement;r.push([s,i])}r.sort((i,s)=>i[0]-s[0]);for(let[i,s]of r)s.dispatchEvent(t),this.dispatched=!0}}inertia(t,r,i,s,n,o,l,c,a){this.handle=pd(t,()=>{let h=Date.now(),u=h-i,d=0,f=0,_=!0;s+=Je.SCROLL_FRICTION*u,l+=Je.SCROLL_FRICTION*u,s>0&&(_=!1,d=n*s*u),l>0&&(_=!1,f=c*l*u);let p=this.newGestureEvent(tr.Change);p.translationX=d,p.translationY=f,r.forEach(C=>C.dispatchEvent(p)),_||this.inertia(t,r,h,s,n,o+d,l,c,a+f)})}onTouchMove(t){let r=Date.now();for(let i=0,s=t.changedTouches.length;i<s;i++){let n=t.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(n.identifier))){console.warn("end of an UNKNOWN touch",n);continue}let o=this.activeTouches[n.identifier],l=this.newGestureEvent(tr.Change,o.initialTarget);l.translationX=n.pageX-vt(o.rollingPageX),l.translationY=n.pageY-vt(o.rollingPageY),l.pageX=n.pageX,l.pageY=n.pageY,this.dispatchEvent(l),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(n.pageX),o.rollingPageY.push(n.pageY),o.rollingTimestamps.push(r)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};sn.SCROLL_FRICTION=-.005,sn.HOLD_DELAY=700,sn.CLEAR_TAP_COUNT_TIME=400,be([gR],sn,"isTouchDevice",1);var vR=sn,_d=class extends G{onclick(e,t){this._register(K(e,ze.CLICK,r=>t(new Po(or(e),r))))}onmousedown(e,t){this._register(K(e,ze.MOUSE_DOWN,r=>t(new Po(or(e),r))))}onmouseover(e,t){this._register(K(e,ze.MOUSE_OVER,r=>t(new Po(or(e),r))))}onmouseleave(e,t){this._register(K(e,ze.MOUSE_LEAVE,r=>t(new Po(or(e),r))))}onkeydown(e,t){this._register(K(e,ze.KEY_DOWN,r=>t(new kp(r))))}onkeyup(e,t){this._register(K(e,ze.KEY_UP,r=>t(new kp(r))))}oninput(e,t){this._register(K(e,ze.INPUT,t))}onblur(e,t){this._register(K(e,ze.BLUR,t))}onfocus(e,t){this._register(K(e,ze.FOCUS,t))}onchange(e,t){this._register(K(e,ze.CHANGE,t))}ignoreGesture(e){return vR.ignoreTarget(e)}},Lp=11,yR=class extends _d{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=Lp+"px",this.domNode.style.height=Lp+"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 Zy),this._register(Dp(this.bgDomNode,ze.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Dp(this.domNode,ze.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new pR),this._pointerdownScheduleRepeatTimer=this._register(new fd)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,or(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},SR=class xu{constructor(t,r,i,s,n,o,l){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(r=r|0,i=i|0,s=s|0,n=n|0,o=o|0,l=l|0),this.rawScrollLeft=s,this.rawScrollTop=l,r<0&&(r=0),s+r>i&&(s=i-r),s<0&&(s=0),n<0&&(n=0),l+n>o&&(l=o-n),l<0&&(l=0),this.width=r,this.scrollWidth=i,this.scrollLeft=s,this.height=n,this.scrollHeight=o,this.scrollTop=l}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,r){return new xu(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,r?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,r?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new xu(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,r){let i=this.width!==t.width,s=this.scrollWidth!==t.scrollWidth,n=this.scrollLeft!==t.scrollLeft,o=this.height!==t.height,l=this.scrollHeight!==t.scrollHeight,c=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:r,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:s,scrollLeftChanged:n,heightChanged:o,scrollHeightChanged:l,scrollTopChanged:c}}},wR=class extends G{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 SR(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,t){var i;let r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),(i=this._smoothScrolling)==null||i.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){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 r=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let i;t?i=new Ap(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):i=this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=i}else{let r=this._state.withScrollPosition(e);this._smoothScrolling=Ap.start(this._state,r,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(),t=this._state.withScrollPosition(e);if(this._setState(t,!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,t){let r=this._state;r.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(r,t)))}},Tp=class{constructor(e,t,r){this.scrollLeft=e,this.scrollTop=t,this.isDone=r}};function Ja(e,t){let r=t-e;return function(i){return e+r*bR(i)}}function CR(e,t,r){return function(i){return i<r?e(i/r):t((i-r)/(1-r))}}var Ap=class bu{constructor(t,r,i,s){this.from=t,this.to=r,this.duration=s,this.startTime=i,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(t,r,i){if(Math.abs(t-r)>2.5*i){let s,n;return t<r?(s=t+.75*i,n=r-.75*i):(s=t-.75*i,n=r+.75*i),CR(Ja(t,s),Ja(n,r),.33)}return Ja(t,r)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let r=(t-this.startTime)/this.duration;if(r<1){let i=this.scrollLeft(r),s=this.scrollTop(r);return new Tp(i,s,!1)}return new Tp(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,r,i){return bu.start(t,r,i)}static start(t,r,i){i=i+10;let s=Date.now()-10;return new bu(t,r,s,i)}};function xR(e){return Math.pow(e,3)}function bR(e){return 1-xR(1-e)}var kR=class extends G{constructor(e,t,r){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=r,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new fd)}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 t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},ER=140,Jy=class extends _d{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 kR(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Zy),this._shouldRender=!0,this.domNode=vn(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(K(this.domNode.domNode,ze.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new yR(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,r,i){this.slider=vn(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof r=="number"&&this.slider.setWidth(r),typeof i=="number"&&this.slider.setHeight(i),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(K(this.slider.domNode,ze.POINTER_DOWN,s=>{s.button===0&&(s.preventDefault(),this._sliderPointerDown(s))})),this.onclick(this.slider.domNode,s=>{s.leftButton&&s.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 t=this.domNode.domNode.getClientRects()[0].top,r=t+this._scrollbarState.getSliderPosition(),i=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),s=this._sliderPointerPosition(e);r<=s&&s<=i?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,r;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,r=e.offsetY;else{let s=_R(this.domNode.domNode);t=e.pageX-s.left,r=e.pageY-s.top}let i=this._pointerDownRelativePosition(t,r);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(i):this._scrollbarState.getDesiredScrollPositionFromOffset(i)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),r=this._sliderOrthogonalPointerPosition(e),i=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{let n=this._sliderOrthogonalPointerPosition(s),o=Math.abs(n-r);if(qy&&o>ER){this._setDesiredScrollPositionNow(i.getScrollPosition());return}let l=this._sliderPointerPosition(s)-t;this._setDesiredScrollPositionNow(i.getDesiredScrollPositionFromDelta(l))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},e0=class ku{constructor(t,r,i,s,n,o){this._scrollbarSize=Math.round(r),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(t),this._visibleSize=s,this._scrollSize=n,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new ku(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let r=Math.round(t);return this._visibleSize!==r?(this._visibleSize=r,this._refreshComputedValues(),!0):!1}setScrollSize(t){let r=Math.round(t);return this._scrollSize!==r?(this._scrollSize=r,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let r=Math.round(t);return this._scrollPosition!==r?(this._scrollPosition=r,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,r,i,s,n){let o=Math.max(0,i-t),l=Math.max(0,o-2*r),c=s>0&&s>i;if(!c)return{computedAvailableSize:Math.round(o),computedIsNeeded:c,computedSliderSize:Math.round(l),computedSliderRatio:0,computedSliderPosition:0};let a=Math.round(Math.max(20,Math.floor(i*l/s))),h=(l-a)/(s-i),u=n*h;return{computedAvailableSize:Math.round(o),computedIsNeeded:c,computedSliderSize:Math.round(a),computedSliderRatio:h,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=ku._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.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(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize-this._computedSliderSize/2;return Math.round(r/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize,i=this._scrollPosition;return r<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let r=this._computedSliderPosition+t;return Math.round(r/this._computedSliderRatio)}},RR=class extends Jy{constructor(e,t,r){let i=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new e0(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,i.width,i.scrollWidth,s.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),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,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}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}},PR=class extends Jy{constructor(e,t,r){let i=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new e0(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,i.height,i.scrollHeight,s.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),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,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},DR=500,Np=50,MR=class{constructor(e,t,r){this.timestamp=e,this.deltaX=t,this.deltaY=r,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 t=1,r=0,i=1,s=this._rear;do{let n=s===this._front?t:Math.pow(2,-i);if(t-=n,r+=this._memory[s].score*n,s===this._front)break;s=(this._capacity+s-1)%this._capacity,i++}while(!0);return r<=.5}acceptStandardWheelEvent(t){if(hd){let r=or(t.browserEvent),i=WE(r);this.accept(Date.now(),t.deltaX*i,t.deltaY*i)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,r,i){let s=null,n=new MR(t,r,i);this._front===-1&&this._rear===-1?(this._memory[0]=n,this._front=0,this._rear=0):(s=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]=n),n.score=this._computeScore(n,s)}_computeScore(t,r){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(i+=.25),r){let s=Math.abs(t.deltaX),n=Math.abs(t.deltaY),o=Math.abs(r.deltaX),l=Math.abs(r.deltaY),c=Math.max(Math.min(s,o),1),a=Math.max(Math.min(n,l),1),h=Math.max(s,o),u=Math.max(n,l);h%c===0&&u%a===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Eu.INSTANCE=new Eu;var LR=Eu,TR=class extends _d{constructor(e,t,r){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=NR(t),this._scrollable=r,this._register(this._scrollable.onScroll(s=>{this._onWillScroll.fire(s),this._onDidScroll(s),this._onScroll.fire(s)}));let i={onMouseWheel:s=>this._onMouseWheel(s),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new PR(this._scrollable,this._options,i)),this._horizontalScrollbar=this._register(new RR(this._scrollable,this._options,i)),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=vn(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=vn(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=vn(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,s=>this._onMouseOver(s)),this.onmouseleave(this._listenOnDomNode,s=>this._onMouseLeave(s)),this._hideTimeout=this._register(new fd),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Ni(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,ur&&(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 Rp(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Ni(this._mouseWheelToDispose),e)){let t=r=>{this._onMouseWheel(new Rp(r))};this._mouseWheelToDispose.push(K(this._listenOnDomNode,ze.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var s;if((s=e.browserEvent)!=null&&s.defaultPrevented)return;let t=LR.INSTANCE;t.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let n=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&o+n===0?o=n=0:Math.abs(n)>=Math.abs(o)?o=0:n=0),this._options.flipAxes&&([n,o]=[o,n]);let l=!ur&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!o&&(o=n,n=0),e.browserEvent&&e.browserEvent.altKey&&(o=o*this._options.fastScrollSensitivity,n=n*this._options.fastScrollSensitivity);let c=this._scrollable.getFutureScrollPosition(),a={};if(n){let h=Np*n,u=c.scrollTop-(h<0?Math.floor(h):Math.ceil(h));this._verticalScrollbar.writeScrollPosition(a,u)}if(o){let h=Np*o,u=c.scrollLeft-(h<0?Math.floor(h):Math.ceil(h));this._horizontalScrollbar.writeScrollPosition(a,u)}a=this._scrollable.validateScrollPosition(a),(c.scrollLeft!==a.scrollLeft||c.scrollTop!==a.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(a):this._scrollable.setScrollPositionNow(a),r=!0)}let i=r;!i&&this._options.alwaysConsumeMouseWheel&&(i=!0),!i&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(i=!0),i&&(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(),t=e.scrollTop>0,r=e.scrollLeft>0,i=r?" left":"",s=t?" top":"",n=r||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${i}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${n}${s}${i}`)}}_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(),DR)}},AR=class extends TR{constructor(e,t,r){super(e,t,r)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function NR(e){let t={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 t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,ur&&(t.className+=" mac"),t}var Ru=class extends G{constructor(e,t,r,i,s,n,o,l){super(),this._bufferService=r,this._optionsService=o,this._renderService=l,this._onRequestScrollLines=this._register(new z),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let c=this._register(new wR({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:a=>pd(i.window,a)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{c.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new AR(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},c)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(s.onProtocolChange(a=>{this._scrollableElement.updateOptions({handleMouseWheel:!(a&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Ye.runAndSubscribe(n.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=n.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(fe(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=i.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(fe(()=>this._styleElement.remove())),this._register(Ye.runAndSubscribe(n.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${n.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${n.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${n.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
215
|
+
`)})),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(a=>this._handleScroll(a)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,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 t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),r=t-this._bufferService.buffer.ydisp;r!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(r)),this._isHandlingScroll=!1}};Ru=be([W(2,at),W(3,Tr),W(4,Ny),W(5,Bs),W(6,ct),W(7,Ar)],Ru);var Pu=class extends G{constructor(e,t,r,i,s){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=r,this._decorationService=i,this._renderService=s,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(n=>this._removeDecoration(n))),this._register(fe(()=>{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 i;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((i=e==null?void 0:e.options)==null?void 0:i.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let r=e.options.x??0;return r&&r>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let r=this._decorationElements.get(e);r||(r=this._createElement(e),e.element=r,this._decorationElements.set(e,r),this._container.appendChild(r),e.onDispose(()=>{this._decorationElements.delete(e),r.remove()})),r.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(r.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(r)}}_refreshXPosition(e,t=e.element){if(!t)return;let r=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=r?`${r*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=r?`${r*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};Pu=be([W(1,at),W(2,Tr),W(3,Gn),W(4,Ar)],Pu);var OR=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 t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,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,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,r){return t>=e.startBufferLine-this._linePadding[r||"full"]&&t<=e.endBufferLine+this._linePadding[r||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Jt={full:0,left:0,center:0,right:0},Ir={full:0,left:0,center:0,right:0},Ys={full:0,left:0,center:0,right:0},Ll=class extends G{constructor(e,t,r,i,s,n,o,l){var a;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=r,this._decorationService=i,this._renderService=s,this._optionsService=n,this._themeService=o,this._coreBrowserService=l,this._colorZoneStore=new OR,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(),(a=this._viewportElement.parentElement)==null||a.insertBefore(this._canvas,this._viewportElement),this._register(fe(()=>{var h;return(h=this._canvas)==null?void 0:h.remove()}));let c=this._canvas.getContext("2d");if(c)this._ctx=c;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),t=Math.ceil((this._canvas.width-1)/3);Ir.full=this._canvas.width,Ir.left=e,Ir.center=t,Ir.right=e,this._refreshDrawHeightConstants(),Ys.full=1,Ys.left=1,Ys.center=1+Ir.left,Ys.right=1+Ir.left+Ir.center}_refreshDrawHeightConstants(){Jt.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Jt.left=t,Jt.center=t,Jt.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Jt.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Jt.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Jt.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Jt.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 t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);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(Ys[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Jt[e.position||"full"]/2),Ir[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Jt[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Ll=be([W(2,at),W(3,Gn),W(4,Ar),W(5,ct),W(6,Bs),W(7,Tr)],Ll);var M;(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=`
|
|
216
|
+
`,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=""))(M||(M={}));var Qo;(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=""))(Qo||(Qo={}));var t0;(e=>e.ST=`${M.ESC}\\`)(t0||(t0={}));var Du=class{constructor(e,t,r,i,s,n){this._textarea=e,this._compositionView=t,this._bufferService=r,this._optionsService=i,this._coreService=s,this._renderService=n,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 t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let r;t.start+=this._dataAlreadySent.length,this._isComposing?r=this._textarea.value.substring(t.start,this._compositionPosition.start):r=this._textarea.value.substring(t.start),r.length>0&&this._coreService.triggerDataEvent(r,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,r=t.replace(e,"");this._dataAlreadySent=r,t.length>e.length?this._coreService.triggerDataEvent(r,!0):t.length<e.length?this._coreService.triggerDataEvent(`${M.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),r=this._renderService.dimensions.css.cell.height,i=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let n=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(n.width,1)+"px",this._textarea.style.height=Math.max(n.height,1)+"px",this._textarea.style.lineHeight=n.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Du=be([W(2,at),W(3,ct),W(4,Wi),W(5,Ar)],Du);var $e=0,We=0,He=0,we=0,Op={css:"#00000000",rgba:0},Pe;(e=>{function t(s,n,o,l){return l!==void 0?`#${pi(s)}${pi(n)}${pi(o)}${pi(l)}`:`#${pi(s)}${pi(n)}${pi(o)}`}e.toCss=t;function r(s,n,o,l=255){return(s<<24|n<<16|o<<8|l)>>>0}e.toRgba=r;function i(s,n,o,l){return{css:e.toCss(s,n,o,l),rgba:e.toRgba(s,n,o,l)}}e.toColor=i})(Pe||(Pe={}));var ue;(e=>{function t(c,a){if(we=(a.rgba&255)/255,we===1)return{css:a.css,rgba:a.rgba};let h=a.rgba>>24&255,u=a.rgba>>16&255,d=a.rgba>>8&255,f=c.rgba>>24&255,_=c.rgba>>16&255,p=c.rgba>>8&255;$e=f+Math.round((h-f)*we),We=_+Math.round((u-_)*we),He=p+Math.round((d-p)*we);let C=Pe.toCss($e,We,He),m=Pe.toRgba($e,We,He);return{css:C,rgba:m}}e.blend=t;function r(c){return(c.rgba&255)===255}e.isOpaque=r;function i(c,a,h){let u=Zo.ensureContrastRatio(c.rgba,a.rgba,h);if(u)return Pe.toColor(u>>24&255,u>>16&255,u>>8&255)}e.ensureContrastRatio=i;function s(c){let a=(c.rgba|255)>>>0;return[$e,We,He]=Zo.toChannels(a),{css:Pe.toCss($e,We,He),rgba:a}}e.opaque=s;function n(c,a){return we=Math.round(a*255),[$e,We,He]=Zo.toChannels(c.rgba),{css:Pe.toCss($e,We,He,we),rgba:Pe.toRgba($e,We,He,we)}}e.opacity=n;function o(c,a){return we=c.rgba&255,n(c,we*a/255)}e.multiplyOpacity=o;function l(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}e.toColorRGB=l})(ue||(ue={}));var _e;(e=>{let t,r;try{let s=document.createElement("canvas");s.width=1,s.height=1;let n=s.getContext("2d",{willReadFrequently:!0});n&&(t=n,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function i(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return $e=parseInt(s.slice(1,2).repeat(2),16),We=parseInt(s.slice(2,3).repeat(2),16),He=parseInt(s.slice(3,4).repeat(2),16),Pe.toColor($e,We,He);case 5:return $e=parseInt(s.slice(1,2).repeat(2),16),We=parseInt(s.slice(2,3).repeat(2),16),He=parseInt(s.slice(3,4).repeat(2),16),we=parseInt(s.slice(4,5).repeat(2),16),Pe.toColor($e,We,He,we);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let n=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n)return $e=parseInt(n[1]),We=parseInt(n[2]),He=parseInt(n[3]),we=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),Pe.toColor($e,We,He,we);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=s,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[$e,We,He,we]=t.getImageData(0,0,1,1).data,we!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Pe.toRgba($e,We,He,we),css:s}}e.toColor=i})(_e||(_e={}));var it;(e=>{function t(i){return r(i>>16&255,i>>8&255,i&255)}e.relativeLuminance=t;function r(i,s,n){let o=i/255,l=s/255,c=n/255,a=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),h=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),u=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4);return a*.2126+h*.7152+u*.0722}e.relativeLuminance2=r})(it||(it={}));var Zo;(e=>{function t(o,l){if(we=(l&255)/255,we===1)return l;let c=l>>24&255,a=l>>16&255,h=l>>8&255,u=o>>24&255,d=o>>16&255,f=o>>8&255;return $e=u+Math.round((c-u)*we),We=d+Math.round((a-d)*we),He=f+Math.round((h-f)*we),Pe.toRgba($e,We,He)}e.blend=t;function r(o,l,c){let a=it.relativeLuminance(o>>8),h=it.relativeLuminance(l>>8);if(_r(a,h)<c){if(h<a){let f=i(o,l,c),_=_r(a,it.relativeLuminance(f>>8));if(_<c){let p=s(o,l,c),C=_r(a,it.relativeLuminance(p>>8));return _>C?f:p}return f}let u=s(o,l,c),d=_r(a,it.relativeLuminance(u>>8));if(d<c){let f=i(o,l,c),_=_r(a,it.relativeLuminance(f>>8));return d>_?u:f}return u}}e.ensureContrastRatio=r;function i(o,l,c){let a=o>>24&255,h=o>>16&255,u=o>>8&255,d=l>>24&255,f=l>>16&255,_=l>>8&255,p=_r(it.relativeLuminance2(d,f,_),it.relativeLuminance2(a,h,u));for(;p<c&&(d>0||f>0||_>0);)d-=Math.max(0,Math.ceil(d*.1)),f-=Math.max(0,Math.ceil(f*.1)),_-=Math.max(0,Math.ceil(_*.1)),p=_r(it.relativeLuminance2(d,f,_),it.relativeLuminance2(a,h,u));return(d<<24|f<<16|_<<8|255)>>>0}e.reduceLuminance=i;function s(o,l,c){let a=o>>24&255,h=o>>16&255,u=o>>8&255,d=l>>24&255,f=l>>16&255,_=l>>8&255,p=_r(it.relativeLuminance2(d,f,_),it.relativeLuminance2(a,h,u));for(;p<c&&(d<255||f<255||_<255);)d=Math.min(255,d+Math.ceil((255-d)*.1)),f=Math.min(255,f+Math.ceil((255-f)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),p=_r(it.relativeLuminance2(d,f,_),it.relativeLuminance2(a,h,u));return(d<<24|f<<16|_<<8|255)>>>0}e.increaseLuminance=s;function n(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}e.toChannels=n})(Zo||(Zo={}));function pi(e){let t=e.toString(16);return t.length<2?"0"+t:t}function _r(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var BR=class extends qn{constructor(e,t,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=r}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()]}},Tl=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Ot}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let r=[],i=t.translateToString(!0),s=0,n=0,o=0,l=t.getFg(0),c=t.getBg(0);for(let a=0;a<t.getTrimmedLength();a++)if(t.loadCell(a,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==l||this._workCell.bg!==c){if(a-s>1){let h=this._getJoinedRanges(i,o,n,t,s);for(let u=0;u<h.length;u++)r.push(h[u])}s=a,o=n,l=this._workCell.fg,c=this._workCell.bg}n+=this._workCell.getChars().length||Yr.length}if(this._bufferService.cols-s>1){let a=this._getJoinedRanges(i,o,n,t,s);for(let h=0;h<a.length;h++)r.push(a[h])}return r}_getJoinedRanges(e,t,r,i,s){let n=e.substring(t,r),o=[];try{o=this._characterJoiners[0].handler(n)}catch(l){console.error(l)}for(let l=1;l<this._characterJoiners.length;l++)try{let c=this._characterJoiners[l].handler(n);for(let a=0;a<c.length;a++)Tl._mergeRanges(o,c[a])}catch(c){console.error(c)}return this._stringRangesToCellRanges(o,i,s),o}_stringRangesToCellRanges(e,t,r){let i=0,s=!1,n=0,o=e[i];if(o){for(let l=r;l<this._bufferService.cols;l++){let c=t.getWidth(l),a=t.getString(l).length||Yr.length;if(c!==0){if(!s&&o[0]<=n&&(o[0]=l,s=!0),o[1]<=n){if(o[1]=l,o=e[++i],!o)break;o[0]<=n?(o[0]=l,s=!0):s=!1}n+=a}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(r){if(t[1]<=s[0])return e[i-1][1]=t[1],e;if(t[1]<=s[1])return e[i-1][1]=Math.max(t[1],s[1]),e.splice(i,1),e;e.splice(i,1),i--}else{if(t[1]<=s[0])return e.splice(i,0,t),e;if(t[1]<=s[1])return s[0]=Math.min(t[0],s[0]),e;t[0]<s[1]&&(s[0]=Math.min(t[0],s[0]),r=!0);continue}}return r?e[e.length-1][1]=t[1]:e.push(t),e}};Tl=be([W(0,at)],Tl);function IR(e){return 57508<=e&&e<=57558}function zR(e){return 9472<=e&&e<=9631}function FR(e){return IR(e)||zR(e)}function $R(){return{css:{canvas:Do(),cell:Do()},device:{canvas:Do(),cell:Do(),char:{width:0,height:0,left:0,top:0}}}}function Do(){return{width:0,height:0}}var Mu=class{constructor(e,t,r,i,s,n,o){this._document=e,this._characterJoinerService=t,this._optionsService=r,this._coreBrowserService=i,this._coreService=s,this._decorationService=n,this._themeService=o,this._workCell=new Ot,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,r){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=r}createRow(e,t,r,i,s,n,o,l,c,a,h){let u=[],d=this._characterJoinerService.getJoinedCharacters(t),f=this._themeService.colors,_=e.getNoBgTrimmedLength();r&&_<n+1&&(_=n+1);let p,C=0,m="",g=0,v=0,w=0,x=0,E=!1,P=0,k=!1,I=0,$=0,j=[],T=a!==-1&&h!==-1;for(let R=0;R<_;R++){e.loadCell(R,this._workCell);let A=this._workCell.getWidth();if(A===0)continue;let N=!1,L=R>=$,F=R,b=this._workCell;if(d.length>0&&R===d[0][0]&&L){let J=d.shift(),ut=this._isCellInSelection(J[0],t);for(g=J[0]+1;g<J[1];g++)L&&(L=ut===this._isCellInSelection(g,t));L&&(L=!r||n<J[0]||n>=J[1]),L?(N=!0,b=new BR(this._workCell,e.translateToString(!0,J[0],J[1]),J[1]-J[0]),F=J[1]-1,A=b.getWidth()):$=J[1]}let B=this._isCellInSelection(R,t),D=r&&R===n,X=T&&R>=a&&R<=h,ee=!1;this._decorationService.forEachDecorationAtCell(R,t,void 0,J=>{ee=!0});let Se=b.getChars()||Yr;if(Se===" "&&(b.isUnderline()||b.isOverline())&&(Se=" "),I=A*l-c.get(Se,b.isBold(),b.isItalic()),!p)p=this._document.createElement("span");else if(C&&(B&&k||!B&&!k&&b.bg===v)&&(B&&k&&f.selectionForeground||b.fg===w)&&b.extended.ext===x&&X===E&&I===P&&!D&&!N&&!ee&&L){b.isInvisible()?m+=Yr:m+=Se,C++;continue}else C&&(p.textContent=m),p=this._document.createElement("span"),C=0,m="";if(v=b.bg,w=b.fg,x=b.extended.ext,E=X,P=I,k=B,N&&n>=R&&n<=F&&(n=R),!this._coreService.isCursorHidden&&D&&this._coreService.isCursorInitialized){if(j.push("xterm-cursor"),this._coreBrowserService.isFocused)o&&j.push("xterm-cursor-blink"),j.push(i==="bar"?"xterm-cursor-bar":i==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(s)switch(s){case"outline":j.push("xterm-cursor-outline");break;case"block":j.push("xterm-cursor-block");break;case"bar":j.push("xterm-cursor-bar");break;case"underline":j.push("xterm-cursor-underline");break}}if(b.isBold()&&j.push("xterm-bold"),b.isItalic()&&j.push("xterm-italic"),b.isDim()&&j.push("xterm-dim"),b.isInvisible()?m=Yr:m=b.getChars()||Yr,b.isUnderline()&&(j.push(`xterm-underline-${b.extended.underlineStyle}`),m===" "&&(m=" "),!b.isUnderlineColorDefault()))if(b.isUnderlineColorRGB())p.style.textDecorationColor=`rgb(${qn.toColorRGB(b.getUnderlineColor()).join(",")})`;else{let J=b.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&b.isBold()&&J<8&&(J+=8),p.style.textDecorationColor=f.ansi[J].css}b.isOverline()&&(j.push("xterm-overline"),m===" "&&(m=" ")),b.isStrikethrough()&&j.push("xterm-strikethrough"),X&&(p.style.textDecoration="underline");let ne=b.getFgColor(),re=b.getFgColorMode(),Q=b.getBgColor(),Me=b.getBgColorMode(),fr=!!b.isInverse();if(fr){let J=ne;ne=Q,Q=J;let ut=re;re=Me,Me=ut}let ie,Gt,gt=!1;this._decorationService.forEachDecorationAtCell(R,t,void 0,J=>{J.options.layer!=="top"&>||(J.backgroundColorRGB&&(Me=50331648,Q=J.backgroundColorRGB.rgba>>8&16777215,ie=J.backgroundColorRGB),J.foregroundColorRGB&&(re=50331648,ne=J.foregroundColorRGB.rgba>>8&16777215,Gt=J.foregroundColorRGB),gt=J.options.layer==="top")}),!gt&&B&&(ie=this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque,Q=ie.rgba>>8&16777215,Me=50331648,gt=!0,f.selectionForeground&&(re=50331648,ne=f.selectionForeground.rgba>>8&16777215,Gt=f.selectionForeground)),gt&&j.push("xterm-decoration-top");let Xe;switch(Me){case 16777216:case 33554432:Xe=f.ansi[Q],j.push(`xterm-bg-${Q}`);break;case 50331648:Xe=Pe.toColor(Q>>16,Q>>8&255,Q&255),this._addStyle(p,`background-color:#${Bp((Q>>>0).toString(16),"0",6)}`);break;case 0:default:fr?(Xe=f.foreground,j.push("xterm-bg-257")):Xe=f.background}switch(ie||b.isDim()&&(ie=ue.multiplyOpacity(Xe,.5)),re){case 16777216:case 33554432:b.isBold()&&ne<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ne+=8),this._applyMinimumContrast(p,Xe,f.ansi[ne],b,ie,void 0)||j.push(`xterm-fg-${ne}`);break;case 50331648:let J=Pe.toColor(ne>>16&255,ne>>8&255,ne&255);this._applyMinimumContrast(p,Xe,J,b,ie,Gt)||this._addStyle(p,`color:#${Bp(ne.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(p,Xe,f.foreground,b,ie,Gt)||fr&&j.push("xterm-fg-257")}j.length&&(p.className=j.join(" "),j.length=0),!D&&!N&&!ee&&L?C++:p.textContent=m,I!==this.defaultSpacing&&(p.style.letterSpacing=`${I}px`),u.push(p),R=F}return p&&C&&(p.textContent=m),u}_applyMinimumContrast(e,t,r,i,s,n){if(this._optionsService.rawOptions.minimumContrastRatio===1||FR(i.getCode()))return!1;let o=this._getContrastCache(i),l;if(!s&&!n&&(l=o.getColor(t.rgba,r.rgba)),l===void 0){let c=this._optionsService.rawOptions.minimumContrastRatio/(i.isDim()?2:1);l=ue.ensureContrastRatio(s||t,n||r,c),o.setColor((s||t).rgba,(n||r).rgba,l??null)}return l?(this._addStyle(e,`color:${l.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let r=this._selectionStart,i=this._selectionEnd;return!r||!i?!1:this._columnSelectMode?r[0]<=i[0]?e>=r[0]&&t>=r[1]&&e<i[0]&&t<=i[1]:e<r[0]&&t>=r[1]&&e>=i[0]&&t<=i[1]:t>r[1]&&t<i[1]||r[1]===i[1]&&t===r[1]&&e>=r[0]&&e<i[0]||r[1]<i[1]&&t===i[1]&&e<i[0]||r[1]<i[1]&&t===r[1]&&e>=r[0]}};Mu=be([W(1,Iy),W(2,ct),W(3,Tr),W(4,Wi),W(5,Gn),W(6,Bs)],Mu);function Bp(e,t,r){for(;e.length<r;)e=t+e;return e}var WR=class{constructor(e,t){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 r=e.createElement("span");r.classList.add("xterm-char-measure-element");let i=e.createElement("span");i.classList.add("xterm-char-measure-element"),i.style.fontWeight="bold";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontStyle="italic";let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold",n.style.fontStyle="italic",this._measureElements=[r,i,s,n],this._container.appendChild(r),this._container.appendChild(i),this._container.appendChild(s),this._container.appendChild(n),t.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,t,r,i){e===this._font&&t===this._fontSize&&r===this._weight&&i===this._weightBold||(this._font=e,this._fontSize=t,this._weight=r,this._weightBold=i,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${r}`,this._measureElements[1].style.fontWeight=`${i}`,this._measureElements[2].style.fontWeight=`${r}`,this._measureElements[3].style.fontWeight=`${i}`,this.clear())}get(e,t,r){let i=0;if(!t&&!r&&e.length===1&&(i=e.charCodeAt(0))<256){if(this._flat[i]!==-9999)return this._flat[i];let o=this._measure(e,0);return o>0&&(this._flat[i]=o),o}let s=e;t&&(s+="B"),r&&(s+="I");let n=this._holey.get(s);if(n===void 0){let o=0;t&&(o|=1),r&&(o|=2),n=this._measure(e,o),n>0&&this._holey.set(s,n)}return n}_measure(e,t){let r=this._measureElements[t];return r.textContent=e.repeat(32),r.offsetWidth/32}},HR=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,t,r,i=!1){if(this.selectionStart=t,this.selectionEnd=r,!t||!r||t[0]===r[0]&&t[1]===r[1]){this.clear();return}let s=e.buffers.active.ydisp,n=t[1]-s,o=r[1]-s,l=Math.max(n,0),c=Math.min(o,e.rows-1);if(l>=e.rows||c<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=i,this.viewportStartRow=n,this.viewportEndRow=o,this.viewportCappedStartRow=l,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=r[0]}isCellSelected(e,t,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&r>=this.viewportCappedStartRow&&t<this.endCol&&r<=this.viewportCappedEndRow:t<this.startCol&&r>=this.viewportCappedStartRow&&t>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol):!1}};function jR(){return new HR}var ec="xterm-dom-renderer-owner-",Pt="xterm-rows",Mo="xterm-fg-",Ip="xterm-bg-",qs="xterm-focus",Lo="xterm-selection",UR=1,Lu=class extends G{constructor(e,t,r,i,s,n,o,l,c,a,h,u,d,f){super(),this._terminal=e,this._document=t,this._element=r,this._screenElement=i,this._viewportElement=s,this._helperContainer=n,this._linkifier2=o,this._charSizeService=c,this._optionsService=a,this._bufferService=h,this._coreService=u,this._coreBrowserService=d,this._themeService=f,this._terminalClass=UR++,this._rowElements=[],this._selectionRenderModel=jR(),this.onRequestRedraw=this._register(new z).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Pt),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(Lo),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=$R(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(_=>this._injectCss(_))),this._injectCss(this._themeService.colors),this._rowFactory=l.createInstance(Mu,document),this._element.classList.add(ec+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(_=>this._handleLinkHover(_))),this._register(this._linkifier2.onHideLinkUnderline(_=>this._handleLinkLeave(_))),this._register(fe(()=>{this._element.classList.remove(ec+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new WR(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 r of this._rowElements)r.style.width=`${this.dimensions.css.canvas.width}px`,r.style.height=`${this.dimensions.css.cell.height}px`,r.style.lineHeight=`${this.dimensions.css.cell.height}px`,r.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Pt} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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 t=`${this._terminalSelector} .${Pt} { 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}`;t+=`${this._terminalSelector} .${Pt} .xterm-dim { color: ${ue.multiplyOpacity(e.foreground,.5).css};}`,t+=`${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 r=`blink_underline_${this._terminalClass}`,i=`blink_bar_${this._terminalClass}`,s=`blink_block_${this._terminalClass}`;t+=`@keyframes ${r} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${i} { 50% { box-shadow: none; }}`,t+=`@keyframes ${s} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Pt}.${qs} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Pt}.${qs} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${Pt}.${qs} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Pt} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Pt} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Pt} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Pt} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Pt} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Lo} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Lo} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Lo} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,o]of e.ansi.entries())t+=`${this._terminalSelector} .${Mo}${n} { color: ${o.css}; }${this._terminalSelector} .${Mo}${n}.xterm-dim { color: ${ue.multiplyOpacity(o,.5).css}; }${this._terminalSelector} .${Ip}${n} { background-color: ${o.css}; }`;t+=`${this._terminalSelector} .${Mo}257 { color: ${ue.opaque(e.background).css}; }${this._terminalSelector} .${Mo}257.xterm-dim { color: ${ue.multiplyOpacity(ue.opaque(e.background),.5).css}; }${this._terminalSelector} .${Ip}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_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,t){for(let r=this._rowElements.length;r<=t;r++){let i=this._document.createElement("div");this._rowContainer.appendChild(i),this._rowElements.push(i)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),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(qs),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(qs),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,r){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,r),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,r),!this._selectionRenderModel.hasSelection))return;let i=this._selectionRenderModel.viewportStartRow,s=this._selectionRenderModel.viewportEndRow,n=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,l=this._document.createDocumentFragment();if(r){let c=e[0]>t[0];l.appendChild(this._createSelectionElement(n,c?t[0]:e[0],c?e[0]:t[0],o-n+1))}else{let c=i===n?e[0]:0,a=n===s?t[0]:this._bufferService.cols;l.appendChild(this._createSelectionElement(n,c,a));let h=o-n-1;if(l.appendChild(this._createSelectionElement(n+1,0,this._bufferService.cols,h)),n!==o){let u=s===o?t[0]:this._bufferService.cols;l.appendChild(this._createSelectionElement(o,0,u))}}this._selectionContainer.appendChild(l)}_createSelectionElement(e,t,r,i=1){let s=this._document.createElement("div"),n=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(r-t);return n+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-n),s.style.height=`${i*this.dimensions.css.cell.height}px`,s.style.top=`${e*this.dimensions.css.cell.height}px`,s.style.left=`${n}px`,s.style.width=`${o}px`,s}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,t){let r=this._bufferService.buffer,i=r.ybase+r.y,s=Math.min(r.x,this._bufferService.cols-1),n=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,l=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=t;c++){let a=c+r.ydisp,h=this._rowElements[c],u=r.lines.get(a);if(!h||!u)break;h.replaceChildren(...this._rowFactory.createRow(u,a,a===i,o,l,s,n,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${ec}${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,t,r,i,s,n){r<0&&(e=0),i<0&&(t=0);let o=this._bufferService.rows-1;r=Math.max(Math.min(r,o),0),i=Math.max(Math.min(i,o),0),s=Math.min(s,this._bufferService.cols);let l=this._bufferService.buffer,c=l.ybase+l.y,a=Math.min(l.x,s-1),h=this._optionsService.rawOptions.cursorBlink,u=this._optionsService.rawOptions.cursorStyle,d=this._optionsService.rawOptions.cursorInactiveStyle;for(let f=r;f<=i;++f){let _=f+l.ydisp,p=this._rowElements[f],C=l.lines.get(_);if(!p||!C)break;p.replaceChildren(...this._rowFactory.createRow(C,_,_===c,u,d,a,h,this.dimensions.css.cell.width,this._widthCache,n?f===r?e:0:-1,n?(f===i?t:s)-1:-1))}}};Lu=be([W(7,ad),W(8,ca),W(9,ct),W(10,at),W(11,Wi),W(12,Tr),W(13,Bs)],Lu);var Tu=class extends G{constructor(e,t,r){super(),this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=this._register(new z),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new KR(this._optionsService))}catch{this._measureStrategy=this._register(new VR(e,t,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())}};Tu=be([W(2,ct)],Tu);var r0=class extends G{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},VR=class extends r0{constructor(e,t,r){super(),this._document=e,this._parentElement=t,this._optionsService=r,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}},KR=class extends r0{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))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}},YR=class extends G{constructor(e,t,r){super(),this._textarea=e,this._window=t,this.mainDocument=r,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new qR(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(i=>this._screenDprMonitor.setWindow(i))),this._register(Ye.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(K(this._textarea,"focus",()=>this._isFocused=!0)),this._register(K(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}},qR=class extends G{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Ds),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(fe(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=K(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)}},GR=class extends G{constructor(){super(),this.linkProviders=[],this._register(fe(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function md(e,t,r){let i=r.getBoundingClientRect(),s=e.getComputedStyle(r),n=parseInt(s.getPropertyValue("padding-left")),o=parseInt(s.getPropertyValue("padding-top"));return[t.clientX-i.left-n,t.clientY-i.top-o]}function XR(e,t,r,i,s,n,o,l,c){if(!n)return;let a=md(e,t,r);if(a)return a[0]=Math.ceil((a[0]+(c?o/2:0))/o),a[1]=Math.ceil(a[1]/l),a[0]=Math.min(Math.max(a[0],1),i+(c?1:0)),a[1]=Math.min(Math.max(a[1],1),s),a}var Au=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,r,i,s){return XR(window,e,t,r,i,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(e,t){let r=md(window,e,t);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};Au=be([W(0,Ar),W(1,ca)],Au);var QR=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,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,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t: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,t):t,!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),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},i0={};lE(i0,{getSafariVersion:()=>JR,isChromeOS:()=>l0,isFirefox:()=>s0,isIpad:()=>eP,isIphone:()=>tP,isLegacyEdge:()=>ZR,isLinux:()=>gd,isMac:()=>Al,isNode:()=>ua,isSafari:()=>n0,isWindows:()=>o0});var ua=typeof process<"u"&&"title"in process,Xn=ua?"node":navigator.userAgent,Qn=ua?"node":navigator.platform,s0=Xn.includes("Firefox"),ZR=Xn.includes("Edge"),n0=/^((?!chrome|android).)*safari/i.test(Xn);function JR(){if(!n0)return 0;let e=Xn.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Al=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Qn),eP=Qn==="iPad",tP=Qn==="iPhone",o0=["Windows","Win16","Win32","WinCE"].includes(Qn),gd=Qn.indexOf("Linux")>=0,l0=/\bCrOS\b/.test(Xn),a0=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 t=0,r=0,i=e.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),r=Math.max(t,r),s=e.timeRemaining(),r*1.5>s){i-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(i-t))}ms`),this._start();return}i=s}this.clear()}},rP=class extends a0{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},iP=class extends a0{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Nl=!ua&&"requestIdleCallback"in window?iP:rP,sP=class{constructor(){this._queue=new Nl}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Nu=class extends G{constructor(e,t,r,i,s,n,o,l,c){super(),this._rowCount=e,this._optionsService=r,this._charSizeService=i,this._coreService=s,this._coreBrowserService=l,this._renderer=this._register(new Ds),this._pausedResizeTask=new sP,this._observerDisposable=this._register(new Ds),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 QR((a,h)=>this._renderRows(a,h),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new nP(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(fe(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>{var a;return(a=this._renderer.value)==null?void 0:a.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(n.onDecorationRegistered(()=>this._fullRefresh())),this._register(n.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(c.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(a=>this._registerIntersectionObserver(a,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let r=new e.IntersectionObserver(i=>this._handleIntersectionChange(i[i.length-1]),{threshold:0});r.observe(t),this._observerDisposable.value=fe(()=>r.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,t,r=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let i=this._syncOutputHandler.flush();i&&(e=Math.min(e,i.start),t=Math.max(t,i.end)),r||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),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:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(t=>this.refreshRows(t.start,t.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,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var r;return(r=this._renderer.value)==null?void 0:r.handleResize(e,t)}):this._renderer.value.handleResize(e,t),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,t,r){var i;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=r,(i=this._renderer.value)==null||i.handleSelectionChanged(e,t,r)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};Nu=be([W(2,ct),W(3,ca),W(4,Wi),W(5,Gn),W(6,at),W(7,Tr),W(8,Bs)],Nu);var nP=class{constructor(e,t,r){this._coreBrowserService=e,this._coreService=t,this._onTimeout=r,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,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 oP(e,t,r,i){let s=r.buffer.x,n=r.buffer.y;if(!r.buffer.hasScrollback)return cP(s,n,e,t,r,i)+ha(n,t,r,i)+uP(s,n,e,t,r,i);let o;if(n===t)return o=s>e?"D":"C",zn(Math.abs(s-e),In(o,i));o=n>t?"D":"C";let l=Math.abs(n-t),c=aP(n>t?e:s,r)+(l-1)*r.cols+1+lP(n>t?s:e);return zn(c,In(o,i))}function lP(e,t){return e-1}function aP(e,t){return t.cols-e}function cP(e,t,r,i,s,n){return ha(t,i,s,n).length===0?"":zn(u0(e,t,e,t-Oi(t,s),!1,s).length,In("D",n))}function ha(e,t,r,i){let s=e-Oi(e,r),n=t-Oi(t,r),o=Math.abs(s-n)-hP(e,t,r);return zn(o,In(c0(e,t),i))}function uP(e,t,r,i,s,n){let o;ha(t,i,s,n).length>0?o=i-Oi(i,s):o=t;let l=i,c=dP(e,t,r,i,s,n);return zn(u0(e,o,r,l,c==="C",s).length,In(c,n))}function hP(e,t,r){var o;let i=0,s=e-Oi(e,r),n=t-Oi(t,r);for(let l=0;l<Math.abs(s-n);l++){let c=c0(e,t)==="A"?-1:1;(o=r.buffer.lines.get(s+c*l))!=null&&o.isWrapped&&i++}return i}function Oi(e,t){let r=0,i=t.buffer.lines.get(e),s=i==null?void 0:i.isWrapped;for(;s&&e>=0&&e<t.rows;)r++,i=t.buffer.lines.get(--e),s=i==null?void 0:i.isWrapped;return r}function dP(e,t,r,i,s,n){let o;return ha(r,i,s,n).length>0?o=i-Oi(i,s):o=t,e<r&&o<=i||e>=r&&o<i?"C":"D"}function c0(e,t){return e>t?"A":"B"}function u0(e,t,r,i,s,n){let o=e,l=t,c="";for(;(o!==r||l!==i)&&l>=0&&l<n.buffer.lines.length;)o+=s?1:-1,s&&o>n.cols-1?(c+=n.buffer.translateBufferLineToString(l,!1,e,o),o=0,e=0,l++):!s&&o<0&&(c+=n.buffer.translateBufferLineToString(l,!1,0,e+1),o=n.cols-1,e=o,l--);return c+n.buffer.translateBufferLineToString(l,!1,e,o)}function In(e,t){let r=t?"O":"[";return M.ESC+r+e}function zn(e,t){e=Math.floor(e);let r="";for(let i=0;i<e;i++)r+=t;return r}var fP=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,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[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 zp(e,t){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 t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var tc=50,pP=15,_P=50,mP=500,gP=" ",vP=new RegExp(gP,"g"),Ou=class extends G{constructor(e,t,r,i,s,n,o,l,c){super(),this._element=e,this._screenElement=t,this._linkifier=r,this._bufferService=i,this._coreService=s,this._mouseService=n,this._optionsService=o,this._renderService=l,this._coreBrowserService=c,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Ot,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=a=>this._handleMouseMove(a),this._mouseUpListener=a=>this._handleMouseUp(a),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(a=>this._handleTrim(a)),this._register(this._bufferService.buffers.onBufferActivate(a=>this._handleBufferActivate(a))),this.enable(),this._model=new fP(this._bufferService),this._activeSelectionMode=0,this._register(fe(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(a=>{a.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,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let r=this._bufferService.buffer,i=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let s=e[0]<t[0]?e[0]:t[0],n=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let l=r.translateBufferLineToString(o,!0,s,n);i.push(l)}}else{let s=e[1]===t[1]?t[0]:void 0;i.push(r.translateBufferLineToString(e[1],!0,e[0],s));for(let n=e[1]+1;n<=t[1]-1;n++){let o=r.lines.get(n),l=r.translateBufferLineToString(n,!0);o!=null&&o.isWrapped?i[i.length-1]+=l:i.push(l)}if(e[1]!==t[1]){let n=r.lines.get(t[1]),o=r.translateBufferLineToString(t[1],!0,0,t[0]);n&&n.isWrapped?i[i.length-1]+=o:i.push(o)}}return i.map(s=>s.replace(vP," ")).join(o0?`\r
|
|
217
|
+
`:`
|
|
218
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),gd&&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 t=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!r||!i||!t?!1:this._areCoordsInSelection(t,r,i)}isCellInSelection(e,t){let r=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!r||!i?!1:this._areCoordsInSelection([e,t],r,i)}_areCoordsInSelection(e,t,r){return e[1]>t[1]&&e[1]<r[1]||t[1]===r[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<r[0]||t[1]<r[1]&&e[1]===r[1]&&e[0]<r[0]||t[1]<r[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var s,n;let r=(n=(s=this._linkifier.currentLink)==null?void 0:s.link)==null?void 0:n.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=zp(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let i=this._getMouseBufferCoords(e);return i?(this._selectWordAt(i,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=md(this._coreBrowserService.window,e,this._screenElement)[1],r=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=r?0:(t>r&&(t-=r),t=Math.min(Math.max(t,-tc),tc),t/=tc,t/Math.abs(t)+Math.round(t*(pP-1)))}shouldForceSelection(e){return Al?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(),_P)}_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 t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Al&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=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 r=this._bufferService.buffer;if(this._model.selectionEnd[1]<r.lines.length){let i=r.lines.get(this._model.selectionEnd[1]);i&&i.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});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 t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<mP&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let r=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(r&&r[0]!==void 0&&r[1]!==void 0){let i=oP(r[0]-1,r[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(i,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,r=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!r){this._oldHasSelection&&this._fireOnSelectionChange(e,t,r);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,r)}_fireOnSelectionChange(e,t,r){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=r,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let r=t;for(let i=0;t>=i;i++){let s=e.loadCell(i,this._workCell).getChars().length;this._workCell.getWidth()===0?r--:s>1&&t!==i&&(r+=s-1)}return r}setSelection(e,t,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=r,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,r=!0,i=!0){if(e[0]>=this._bufferService.cols)return;let s=this._bufferService.buffer,n=s.lines.get(e[1]);if(!n)return;let o=s.translateBufferLineToString(e[1],!1),l=this._convertViewportColToCharacterIndex(n,e[0]),c=l,a=e[0]-l,h=0,u=0,d=0,f=0;if(o.charAt(l)===" "){for(;l>0&&o.charAt(l-1)===" ";)l--;for(;c<o.length&&o.charAt(c+1)===" ";)c++}else{let C=e[0],m=e[0];n.getWidth(C)===0&&(h++,C--),n.getWidth(m)===2&&(u++,m++);let g=n.getString(m).length;for(g>1&&(f+=g-1,c+=g-1);C>0&&l>0&&!this._isCharWordSeparator(n.loadCell(C-1,this._workCell));){n.loadCell(C-1,this._workCell);let v=this._workCell.getChars().length;this._workCell.getWidth()===0?(h++,C--):v>1&&(d+=v-1,l-=v-1),l--,C--}for(;m<n.length&&c+1<o.length&&!this._isCharWordSeparator(n.loadCell(m+1,this._workCell));){n.loadCell(m+1,this._workCell);let v=this._workCell.getChars().length;this._workCell.getWidth()===2?(u++,m++):v>1&&(f+=v-1,c+=v-1),c++,m++}}c++;let _=l+a-h+d,p=Math.min(this._bufferService.cols,c-l+h+u-d-f);if(!(!t&&o.slice(l,c).trim()==="")){if(r&&_===0&&n.getCodePoint(0)!==32){let C=s.lines.get(e[1]-1);if(C&&n.isWrapped&&C.getCodePoint(this._bufferService.cols-1)!==32){let m=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(m){let g=this._bufferService.cols-m.start;_-=g,p+=g}}}if(i&&_+p===this._bufferService.cols&&n.getCodePoint(this._bufferService.cols-1)!==32){let C=s.lines.get(e[1]+1);if(C!=null&&C.isWrapped&&C.getCodePoint(0)!==32){let m=this._getWordAt([0,e[1]+1],!1,!1,!0);m&&(p+=m.length)}}return{start:_,length:p}}}_selectWordAt(e,t){let r=this._getWordAt(e,t);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let r=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,r]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),r={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=zp(r,this._bufferService.cols)}};Ou=be([W(3,at),W(4,Wi),W(5,cd),W(6,ct),W(7,Ar),W(8,Tr)],Ou);var Fp=class{constructor(){this._data={}}set(e,t,r){this._data[e]||(this._data[e]={}),this._data[e][t]=r}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},$p=class{constructor(){this._color=new Fp,this._css=new Fp}setCss(e,t,r){this._css.set(e,t,r)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,r){this._color.set(e,t,r)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},Te=Object.freeze((()=>{let e=[_e.toColor("#2e3436"),_e.toColor("#cc0000"),_e.toColor("#4e9a06"),_e.toColor("#c4a000"),_e.toColor("#3465a4"),_e.toColor("#75507b"),_e.toColor("#06989a"),_e.toColor("#d3d7cf"),_e.toColor("#555753"),_e.toColor("#ef2929"),_e.toColor("#8ae234"),_e.toColor("#fce94f"),_e.toColor("#729fcf"),_e.toColor("#ad7fa8"),_e.toColor("#34e2e2"),_e.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let r=0;r<216;r++){let i=t[r/36%6|0],s=t[r/6%6|0],n=t[r%6];e.push({css:Pe.toCss(i,s,n),rgba:Pe.toRgba(i,s,n)})}for(let r=0;r<24;r++){let i=8+r*10;e.push({css:Pe.toCss(i,i,i),rgba:Pe.toRgba(i,i,i)})}return e})()),gi=_e.toColor("#ffffff"),nn=_e.toColor("#000000"),Wp=_e.toColor("#ffffff"),Hp=nn,Gs={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},yP=gi,Bu=class extends G{constructor(e){super(),this._optionsService=e,this._contrastCache=new $p,this._halfContrastCache=new $p,this._onChangeColors=this._register(new z),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:gi,background:nn,cursor:Wp,cursorAccent:Hp,selectionForeground:void 0,selectionBackgroundTransparent:Gs,selectionBackgroundOpaque:ue.blend(nn,Gs),selectionInactiveBackgroundTransparent:Gs,selectionInactiveBackgroundOpaque:ue.blend(nn,Gs),scrollbarSliderBackground:ue.opacity(gi,.2),scrollbarSliderHoverBackground:ue.opacity(gi,.4),scrollbarSliderActiveBackground:ue.opacity(gi,.5),overviewRulerBorder:gi,ansi:Te.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 t=this._colors;if(t.foreground=oe(e.foreground,gi),t.background=oe(e.background,nn),t.cursor=ue.blend(t.background,oe(e.cursor,Wp)),t.cursorAccent=ue.blend(t.background,oe(e.cursorAccent,Hp)),t.selectionBackgroundTransparent=oe(e.selectionBackground,Gs),t.selectionBackgroundOpaque=ue.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=oe(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=ue.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?oe(e.selectionForeground,Op):void 0,t.selectionForeground===Op&&(t.selectionForeground=void 0),ue.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=ue.opacity(t.selectionBackgroundTransparent,.3)),ue.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=ue.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=oe(e.scrollbarSliderBackground,ue.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=oe(e.scrollbarSliderHoverBackground,ue.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=oe(e.scrollbarSliderActiveBackground,ue.opacity(t.foreground,.5)),t.overviewRulerBorder=oe(e.overviewRulerBorder,yP),t.ansi=Te.slice(),t.ansi[0]=oe(e.black,Te[0]),t.ansi[1]=oe(e.red,Te[1]),t.ansi[2]=oe(e.green,Te[2]),t.ansi[3]=oe(e.yellow,Te[3]),t.ansi[4]=oe(e.blue,Te[4]),t.ansi[5]=oe(e.magenta,Te[5]),t.ansi[6]=oe(e.cyan,Te[6]),t.ansi[7]=oe(e.white,Te[7]),t.ansi[8]=oe(e.brightBlack,Te[8]),t.ansi[9]=oe(e.brightRed,Te[9]),t.ansi[10]=oe(e.brightGreen,Te[10]),t.ansi[11]=oe(e.brightYellow,Te[11]),t.ansi[12]=oe(e.brightBlue,Te[12]),t.ansi[13]=oe(e.brightMagenta,Te[13]),t.ansi[14]=oe(e.brightCyan,Te[14]),t.ansi[15]=oe(e.brightWhite,Te[15]),e.extendedAnsi){let r=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let i=0;i<r;i++)t.ansi[i+16]=oe(e.extendedAnsi[i],Te[i+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 t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];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()}}};Bu=be([W(0,ct)],Bu);function oe(e,t){if(e!==void 0)try{return _e.toColor(e)}catch{}return t}var SP=class{constructor(...e){this._entries=new Map;for(let[t,r]of e)this.set(t,r)}set(e,t){let r=this._entries.get(e);return this._entries.set(e,t),r}forEach(e){for(let[t,r]of this._entries.entries())e(t,r)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},wP=class{constructor(){this._services=new SP,this._services.set(ad,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let r=pE(e).sort((n,o)=>n.index-o.index),i=[];for(let n of r){let o=this._services.get(n.id);if(!o)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${n.id._id}.`);i.push(o)}let s=r.length>0?r[0].index:t.length;if(t.length!==s)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);return new e(...t,...i)}},CP={trace:0,debug:1,info:2,warn:3,error:4,off:5},xP="xterm.js: ",Iu=class extends G{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=CP[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":xP)+t,...r)}trace(e,...t){var r;this._logLevel<=0&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var r;this._logLevel<=1&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var r;this._logLevel<=2&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var r;this._logLevel<=3&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var r;this._logLevel<=4&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.error.bind(this._optionsService.options.logger))??console.error,e,t)}};Iu=be([W(0,ct)],Iu);var jp=class extends G{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 t=new Array(e);for(let r=0;r<Math.min(e,this.length);r++)t[r]=this._array[this._getCyclicIndex(r)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}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,t,...r){if(t){for(let i=e;i<this._length-t;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let i=this._length-1;i>=e;i--)this._array[this._getCyclicIndex(i+r.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;i<r.length;i++)this._array[this._getCyclicIndex(e+i)]=r[i];if(r.length&&this.onInsertEmitter.fire({index:e,amount:r.length}),this._length+r.length>this._maxLength){let i=this._length+r.length-this._maxLength;this._startIndex+=i,this._length=this._maxLength,this.onTrimEmitter.fire(i)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,r){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(let s=t-1;s>=0;s--)this.set(e+s+r,this.get(e+s));let i=e+t+r-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let i=0;i<t;i++)this.set(e+i+r,this.get(e+i))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Y=3,Re=Object.freeze(new qn),To=0,rc=2,on=class h0{constructor(t,r,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Y);let s=r||Ot.fromCharData([0,My,1,0]);for(let n=0;n<t;++n)this.setCell(n,s);this.length=t}get(t){let r=this._data[t*Y+0],i=r&2097151;return[this._data[t*Y+1],r&2097152?this._combined[t]:i?Hr(i):"",r>>22,r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i]}set(t,r){this._data[t*Y+1]=r[0],r[1].length>1?(this._combined[t]=r[1],this._data[t*Y+0]=t|2097152|r[2]<<22):this._data[t*Y+0]=r[1].charCodeAt(0)|r[2]<<22}getWidth(t){return this._data[t*Y+0]>>22}hasWidth(t){return this._data[t*Y+0]&12582912}getFg(t){return this._data[t*Y+1]}getBg(t){return this._data[t*Y+2]}hasContent(t){return this._data[t*Y+0]&4194303}getCodePoint(t){let r=this._data[t*Y+0];return r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r&2097151}isCombined(t){return this._data[t*Y+0]&2097152}getString(t){let r=this._data[t*Y+0];return r&2097152?this._combined[t]:r&2097151?Hr(r&2097151):""}isProtected(t){return this._data[t*Y+2]&536870912}loadCell(t,r){return To=t*Y,r.content=this._data[To+0],r.fg=this._data[To+1],r.bg=this._data[To+2],r.content&2097152&&(r.combinedData=this._combined[t]),r.bg&268435456&&(r.extended=this._extendedAttrs[t]),r}setCell(t,r){r.content&2097152&&(this._combined[t]=r.combinedData),r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*Y+0]=r.content,this._data[t*Y+1]=r.fg,this._data[t*Y+2]=r.bg}setCellFromCodepoint(t,r,i,s){s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*Y+0]=r|i<<22,this._data[t*Y+1]=s.fg,this._data[t*Y+2]=s.bg}addCodepointToCell(t,r,i){let s=this._data[t*Y+0];s&2097152?this._combined[t]+=Hr(r):s&2097151?(this._combined[t]=Hr(s&2097151)+Hr(r),s&=-2097152,s|=2097152):s=r|1<<22,i&&(s&=-12582913,s|=i<<22),this._data[t*Y+0]=s}insertCells(t,r,i){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),r<this.length-t){let s=new Ot;for(let n=this.length-t-r-1;n>=0;--n)this.setCell(t+r+n,this.loadCell(t+n,s));for(let n=0;n<r;++n)this.setCell(t+n,i)}else for(let s=t;s<this.length;++s)this.setCell(s,i);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,i)}deleteCells(t,r,i){if(t%=this.length,r<this.length-t){let s=new Ot;for(let n=0;n<this.length-t-r;++n)this.setCell(t+n,this.loadCell(t+r+n,s));for(let n=this.length-r;n<this.length;++n)this.setCell(n,i)}else for(let s=t;s<this.length;++s)this.setCell(s,i);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,i)}replaceCells(t,r,i,s=!1){if(s){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,i),r<this.length&&this.getWidth(r-1)===2&&!this.isProtected(r)&&this.setCellFromCodepoint(r,0,1,i);t<r&&t<this.length;)this.isProtected(t)||this.setCell(t,i),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),r<this.length&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r,0,1,i);t<r&&t<this.length;)this.setCell(t++,i)}resize(t,r){if(t===this.length)return this._data.length*4*rc<this._data.buffer.byteLength;let i=t*Y;if(t>this.length){if(this._data.buffer.byteLength>=i*4)this._data=new Uint32Array(this._data.buffer,0,i);else{let s=new Uint32Array(i);s.set(this._data),this._data=s}for(let s=this.length;s<t;++s)this.setCell(s,r)}else{this._data=this._data.subarray(0,i);let s=Object.keys(this._combined);for(let o=0;o<s.length;o++){let l=parseInt(s[o],10);l>=t&&delete this._combined[l]}let n=Object.keys(this._extendedAttrs);for(let o=0;o<n.length;o++){let l=parseInt(n[o],10);l>=t&&delete this._extendedAttrs[l]}}return this.length=t,i*4*rc<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*rc<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,r=!1){if(r){for(let i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,t);return}this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let r in t._combined)this._combined[r]=t._combined[r];this._extendedAttrs={};for(let r in t._extendedAttrs)this._extendedAttrs[r]=t._extendedAttrs[r];this.isWrapped=t.isWrapped}clone(){let t=new h0(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let r in this._combined)t._combined[r]=this._combined[r];for(let r in this._extendedAttrs)t._extendedAttrs[r]=this._extendedAttrs[r];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Y+0]&4194303)return t+(this._data[t*Y+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Y+0]&4194303||this._data[t*Y+2]&50331648)return t+(this._data[t*Y+0]>>22);return 0}copyCellsFrom(t,r,i,s,n){let o=t._data;if(n)for(let c=s-1;c>=0;c--){for(let a=0;a<Y;a++)this._data[(i+c)*Y+a]=o[(r+c)*Y+a];o[(r+c)*Y+2]&268435456&&(this._extendedAttrs[i+c]=t._extendedAttrs[r+c])}else for(let c=0;c<s;c++){for(let a=0;a<Y;a++)this._data[(i+c)*Y+a]=o[(r+c)*Y+a];o[(r+c)*Y+2]&268435456&&(this._extendedAttrs[i+c]=t._extendedAttrs[r+c])}let l=Object.keys(t._combined);for(let c=0;c<l.length;c++){let a=parseInt(l[c],10);a>=r&&(this._combined[a-r+i]=t._combined[a])}}translateToString(t,r,i,s){r=r??0,i=i??this.length,t&&(i=Math.min(i,this.getTrimmedLength())),s&&(s.length=0);let n="";for(;r<i;){let o=this._data[r*Y+0],l=o&2097151,c=o&2097152?this._combined[r]:l?Hr(l):Yr;if(n+=c,s)for(let a=0;a<c.length;++a)s.push(r);r+=o>>22||1}return s&&s.push(r),n}};function bP(e,t,r,i,s,n){let o=[];for(let l=0;l<e.length-1;l++){let c=l,a=e.get(++c);if(!a.isWrapped)continue;let h=[e.get(l)];for(;c<e.length&&a.isWrapped;)h.push(a),a=e.get(++c);if(!n&&i>=l&&i<c){l+=h.length-1;continue}let u=0,d=Fn(h,u,t),f=1,_=0;for(;f<h.length;){let C=Fn(h,f,t),m=C-_,g=r-d,v=Math.min(m,g);h[u].copyCellsFrom(h[f],_,d,v,!1),d+=v,d===r&&(u++,d=0),_+=v,_===C&&(f++,_=0),d===0&&u!==0&&h[u-1].getWidth(r-1)===2&&(h[u].copyCellsFrom(h[u-1],r-1,d++,1,!1),h[u-1].setCell(r-1,s))}h[u].replaceCells(d,r,s);let p=0;for(let C=h.length-1;C>0&&(C>u||h[C].getTrimmedLength()===0);C--)p++;p>0&&(o.push(l+h.length-p),o.push(p)),l+=h.length-1}return o}function kP(e,t){let r=[],i=0,s=t[i],n=0;for(let o=0;o<e.length;o++)if(s===o){let l=t[++i];e.onDeleteEmitter.fire({index:o-n,amount:l}),o+=l-1,n+=l,s=t[++i]}else r.push(o);return{layout:r,countRemoved:n}}function EP(e,t){let r=[];for(let i=0;i<t.length;i++)r.push(e.get(t[i]));for(let i=0;i<r.length;i++)e.set(i,r[i]);e.length=t.length}function RP(e,t,r){let i=[],s=e.map((c,a)=>Fn(e,a,t)).reduce((c,a)=>c+a),n=0,o=0,l=0;for(;l<s;){if(s-l<r){i.push(s-l);break}n+=r;let c=Fn(e,o,t);n>c&&(n-=c,o++);let a=e[o].getWidth(n-1)===2;a&&n--;let h=a?r-1:r;i.push(h),l+=h}return i}function Fn(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();let i=!e[t].hasContent(r-1)&&e[t].getWidth(r-1)===1,s=e[t+1].getWidth(0)===2;return i&&s?r-1:r}var d0=class f0{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=f0._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(),Ni(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};d0._nextId=1;var PP=d0,Be={},vi=Be.B;Be[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:"≥","{":"π","|":"≠","}":"£","~":"·"};Be.A={"#":"£"};Be.B=void 0;Be[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Be.C=Be[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Be.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Be.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Be.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Be.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Be.E=Be[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Be.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Be.H=Be[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Be["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Up=4294967295,Vp=class{constructor(e,t,r){this._hasScrollback=e,this._optionsService=t,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Re.clone(),this.savedCharset=vi,this.markers=[],this._nullCell=Ot.fromCharData([0,My,1,0]),this._whitespaceCell=Ot.fromCharData([0,Yr,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Nl,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new jp(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 Ml),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 Ml),this._whitespaceCell}getBlankLine(e,t){return new on(this._bufferService.cols,this.getNullCell(e),t)}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 t=e+this._optionsService.rawOptions.scrollback;return t>Up?Up:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Re);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new jp(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let r=this.getNullCell(Re),i=0,s=this._getCorrectBufferLength(t);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols<e)for(let o=0;o<this.lines.length;o++)i+=+this.lines.get(o).resize(e,r);let n=0;if(this._rows<t)for(let o=this._rows;o<t;o++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new on(e,r)):this.ybase>0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(new on(e,r)));else for(let o=this._rows;o>t;o--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s<this.lines.maxLength){let o=this.lines.length-s;o>0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),n&&(this.y+=n),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let n=0;n<this.lines.length;n++)i+=+this.lines.get(n).resize(e,r);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),i>.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 t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>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,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,i=bP(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Re),r);if(i.length>0){let s=kP(this.lines,i);EP(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}}_reflowLargerAdjustViewport(e,t,r){let i=this.getNullCell(Re),s=r;for(;s-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new on(e,i))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-r,0)}_reflowSmaller(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,i=this.getNullCell(Re),s=[],n=0;for(let o=this.lines.length-1;o>=0;o--){let l=this.lines.get(o);if(!l||!l.isWrapped&&l.getTrimmedLength()<=e)continue;let c=[l];for(;l.isWrapped&&o>0;)l=this.lines.get(--o),c.unshift(l);if(!r){let v=this.ybase+this.y;if(v>=o&&v<o+c.length)continue}let a=c[c.length-1].getTrimmedLength(),h=RP(c,this._cols,e),u=h.length-c.length,d;this.ybase===0&&this.y!==this.lines.length-1?d=Math.max(0,this.y-this.lines.maxLength+u):d=Math.max(0,this.lines.length-this.lines.maxLength+u);let f=[];for(let v=0;v<u;v++){let w=this.getBlankLine(Re,!0);f.push(w)}f.length>0&&(s.push({start:o+c.length+n,newLines:f}),n+=f.length),c.push(...f);let _=h.length-1,p=h[_];p===0&&(_--,p=h[_]);let C=c.length-u-1,m=a;for(;C>=0;){let v=Math.min(m,p);if(c[_]===void 0)break;if(c[_].copyCellsFrom(c[C],m-v,p-v,v,!0),p-=v,p===0&&(_--,p=h[_]),m-=v,m===0){C--;let w=Math.max(C,0);m=Fn(c,w,this._cols)}}for(let v=0;v<c.length;v++)h[v]<e&&c[v].setCell(h[v],i);let g=u-d;for(;g-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+n)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+u,this.ybase+t-1)}if(s.length>0){let o=[],l=[];for(let p=0;p<this.lines.length;p++)l.push(this.lines.get(p));let c=this.lines.length,a=c-1,h=0,u=s[h];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+n);let d=0;for(let p=Math.min(this.lines.maxLength-1,c+n-1);p>=0;p--)if(u&&u.start>a+d){for(let C=u.newLines.length-1;C>=0;C--)this.lines.set(p--,u.newLines[C]);p++,o.push({index:a+1,amount:u.newLines.length}),d+=u.newLines.length,u=s[++h]}else this.lines.set(p,l[a--]);let f=0;for(let p=o.length-1;p>=0;p--)o[p].index+=f,this.lines.onInsertEmitter.fire(o[p]),f+=o[p].amount;let _=Math.max(0,c+n-this.lines.maxLength);_>0&&this.lines.onTrimEmitter.fire(_)}}translateBufferLineToString(e,t,r=0,i){let s=this.lines.get(e);return s?s.translateToString(t,r,i):""}getWrappedRangeForLine(e){let t=e,r=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;r+1<this.lines.length&&this.lines.get(r+1).isWrapped;)r++;return{first:t,last:r}}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 t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,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 t=new PP(e);return this.markers.push(t),t.register(this.lines.onTrim(r=>{t.line-=r,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(r=>{t.line>=r.index&&(t.line+=r.amount)})),t.register(this.lines.onDelete(r=>{t.line>=r.index&&t.line<r.index+r.amount&&t.dispose(),t.line>r.index&&(t.line-=r.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},DP=class extends G{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,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 Vp(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Vp(!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,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},p0=2,_0=1,zu=class extends G{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,p0),this.rows=Math.max(e.rawOptions.rows||0,_0),this.buffers=this._register(new DP(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let r=this.cols!==e,i=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:r,rowsChanged:i})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let r=this.buffer,i;i=this._cachedBlankLine,(!i||i.length!==this.cols||i.getFg(0)!==e.fg||i.getBg(0)!==e.bg)&&(i=r.getBlankLine(e,t),this._cachedBlankLine=i),i.isWrapped=t;let s=r.ybase+r.scrollTop,n=r.ybase+r.scrollBottom;if(r.scrollTop===0){let o=r.lines.isFull;n===r.lines.length-1?o?r.lines.recycle().copyFrom(i):r.lines.push(i.clone()):r.lines.splice(n+1,0,i.clone()),o?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let o=n-s+1;r.lines.shiftElements(s+1,o-1,-1),r.lines.set(n,i.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(e,t){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let i=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),i!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};zu=be([W(0,ct)],zu);var Gi={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:Al,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},MP=["normal","bold","100","200","300","400","500","600","700","800","900"],LP=class extends G{constructor(e){super(),this._onOptionChange=this._register(new z),this.onOptionChange=this._onOptionChange.event;let t={...Gi};for(let r in e)if(r in t)try{let i=e[r];t[r]=this._sanitizeAndValidateOption(r,i)}catch(i){console.error(i)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(fe(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(r=>{r===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(r=>{e.indexOf(r)!==-1&&t()})}_setupOptions(){let e=r=>{if(!(r in Gi))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},t=(r,i)=>{if(!(r in Gi))throw new Error(`No option with key "${r}"`);i=this._sanitizeAndValidateOption(r,i),this.rawOptions[r]!==i&&(this.rawOptions[r]=i,this._onOptionChange.fire(r))};for(let r in this.rawOptions){let i={get:e.bind(this,r),set:t.bind(this,r)};Object.defineProperty(this.options,r,i)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Gi[e]),!TP(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Gi[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=MP.includes(t)?t:Gi[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function TP(e){return e==="block"||e==="underline"||e==="bar"}function ln(e,t=5){if(typeof e!="object")return e;let r=Array.isArray(e)?[]:{};for(let i in e)r[i]=t<=1?e[i]:e[i]&&ln(e[i],t-1);return r}var Kp=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}),Fu=class extends G{constructor(e,t,r){super(),this._bufferService=e,this._logService=t,this._optionsService=r,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=ln(Kp),this.decPrivateModes=ln(Yp)}reset(){this.modes=ln(Kp),this.decPrivateModes=ln(Yp)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let r=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&r.ybase!==r.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(i=>i.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(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};Fu=be([W(0,at),W(1,Oy),W(2,ct)],Fu);var qp={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 ic(e,t){let r=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(r|=64,r|=e.action):(r|=e.button&3,e.button&4&&(r|=64),e.button&8&&(r|=128),e.action===32?r|=32:e.action===0&&!t&&(r|=3)),r}var sc=String.fromCharCode,Gp={DEFAULT:e=>{let t=[ic(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${sc(t[0])}${sc(t[1])}${sc(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${ic(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${ic(e,!0)};${e.x};${e.y}${t}`}},$u=class extends G{constructor(e,t,r){super(),this._bufferService=e,this._coreService=t,this._optionsService=r,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 i of Object.keys(qp))this.addProtocol(i,qp[i]);for(let i of Object.keys(Gp))this.addEncoding(i,Gp[i]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}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,t,r){if(e.deltaY===0||e.shiftKey||t===void 0||r===void 0)return 0;let i=t/r,s=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=i+0,Math.abs(e.deltaY)<50&&(s*=.3),this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.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 t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!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,t,r){if(r){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};$u=be([W(0,at),W(1,Wi),W(2,ct)],$u);var nc=[[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]],AP=[[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]],Ae;function NP(e,t){let r=0,i=t.length-1,s;if(e<t[0][0]||e>t[i][1])return!1;for(;i>=r;)if(s=r+i>>1,e>t[s][1])r=s+1;else if(e<t[s][0])i=s-1;else return!0;return!1}var OP=class{constructor(){if(this.version="6",!Ae){Ae=new Uint8Array(65536),Ae.fill(1),Ae[0]=0,Ae.fill(0,1,32),Ae.fill(0,127,160),Ae.fill(2,4352,4448),Ae[9001]=2,Ae[9002]=2,Ae.fill(2,11904,42192),Ae[12351]=1,Ae.fill(2,44032,55204),Ae.fill(2,63744,64256),Ae.fill(2,65040,65050),Ae.fill(2,65072,65136),Ae.fill(2,65280,65377),Ae.fill(2,65504,65511);for(let e=0;e<nc.length;++e)Ae.fill(0,nc[e][0],nc[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Ae[e]:NP(e,AP)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let r=this.wcwidth(e),i=r===0&&t!==0;if(i){let s=Ci.extractWidth(t);s===0?i=!1:s>r&&(r=s)}return Ci.createPropertyValue(0,r,i)}},Ci=class Jo{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new z,this.onChange=this._onChange.event;let t=new OP;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,r,i=!1){return(t&16777215)<<3|(r&3)<<1|(i?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let r=0,i=0,s=t.length;for(let n=0;n<s;++n){let o=t.charCodeAt(n);if(55296<=o&&o<=56319){if(++n>=s)return r+this.wcwidth(o);let a=t.charCodeAt(n);56320<=a&&a<=57343?o=(o-55296)*1024+a-56320+65536:r+=this.wcwidth(a)}let l=this.charProperties(o,i),c=Jo.extractWidth(l);Jo.extractShouldJoin(l)&&(c-=Jo.extractWidth(i)),r+=c,i=l}return r}charProperties(t,r){return this._activeProvider.charProperties(t,r)}},BP=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,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function Xp(e){var i;let t=(i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:i.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&t&&(r.isWrapped=t[3]!==0&&t[3]!==32)}var Xs=2147483647,IP=256,m0=class Wu{constructor(t=32,r=32){if(this.maxLength=t,this.maxSubParamsLength=r,r>IP)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(r),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let r=new Wu;if(!t.length)return r;for(let i=Array.isArray(t[0])?1:0;i<t.length;++i){let s=t[i];if(Array.isArray(s))for(let n=0;n<s.length;++n)r.addSubParam(s[n]);else r.addParam(s)}return r}clone(){let t=new Wu(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let r=0;r<this.length;++r){t.push(this.params[r]);let i=this._subParamsIdx[r]>>8,s=this._subParamsIdx[r]&255;s-i>0&&t.push(Array.prototype.slice.call(this._subParams,i,s))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Xs?Xs:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Xs?Xs:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let r=this._subParamsIdx[t]>>8,i=this._subParamsIdx[t]&255;return i-r>0?this._subParams.subarray(r,i):null}getSubParamsAll(){let t={};for(let r=0;r<this.length;++r){let i=this._subParamsIdx[r]>>8,s=this._subParamsIdx[r]&255;s-i>0&&(t[r]=this._subParams.slice(i,s))}return t}addDigit(t){let r;if(this._rejectDigits||!(r=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let i=this._digitIsSub?this._subParams:this.params,s=i[r-1];i[r-1]=~s?Math.min(s*10+t,Xs):t}},Qs=[],zP=class{constructor(){this._state=0,this._active=Qs,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let i=r.indexOf(t);i!==-1&&r.splice(i,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=Qs}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=Qs,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Qs,!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,t,r){if(!this._active.length)this._handlerFb(this._id,"PUT",aa(e,t,r));else for(let i=this._active.length-1;i>=0;i--)this._active[i].put(e,t,r)}start(){this.reset(),this._state=1}put(e,t,r){if(this._state!==3){if(this._state===1)for(;t<r;){let i=e[t++];if(i===59){this._state=2,this._start();break}if(i<48||57<i){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+i-48}this._state===2&&r-t>0&&this._put(e,t,r)}}end(e,t=!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 r=!1,i=this._active.length-1,s=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,r=t,s=this._stack.fallThrough,this._stack.paused=!1),!s&&r===!1){for(;i>=0&&(r=this._active[i].end(e),r!==!0);i--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,r;i--}for(;i>=0;i--)if(r=this._active[i].end(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,r}this._active=Qs,this._id=-1,this._state=0}}},yt=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=aa(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(r=>(this._data="",this._hitLimit=!1,r));return this._data="",this._hitLimit=!1,t}},Zs=[],FP=class{constructor(){this._handlers=Object.create(null),this._active=Zs,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Zs}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let i=r.indexOf(t);i!==-1&&r.splice(i,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=Zs,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Zs,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(t)}put(e,t,r){if(!this._active.length)this._handlerFb(this._ident,"PUT",aa(e,t,r));else for(let i=this._active.length-1;i>=0;i--)this._active[i].put(e,t,r)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let r=!1,i=this._active.length-1,s=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,r=t,s=this._stack.fallThrough,this._stack.paused=!1),!s&&r===!1){for(;i>=0&&(r=this._active[i].unhook(e),r!==!0);i--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,r;i--}for(;i>=0;i--)if(r=this._active[i].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,r}this._active=Zs,this._ident=0}},an=new m0;an.addParam(0);var Qp=class{constructor(e){this._handler=e,this._data="",this._params=an,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():an,this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=aa(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(r=>(this._params=an,this._data="",this._hitLimit=!1,r));return this._params=an,this._data="",this._hitLimit=!1,t}},$P=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,r,i){this.table[t<<8|e]=r<<4|i}addMany(e,t,r,i){for(let s=0;s<e.length;s++)this.table[t<<8|e[s]]=r<<4|i}},Mt=160,WP=function(){let e=new $P(4095),t=Array.apply(null,Array(256)).map((l,c)=>c),r=(l,c)=>t.slice(l,c),i=r(32,127),s=r(0,24);s.push(25),s.push.apply(s,r(28,32));let n=r(0,14),o;e.setDefault(1,0),e.addMany(i,0,2,0);for(o in n)e.addMany([24,26,153,154],o,3,0),e.addMany(r(128,144),o,3,0),e.addMany(r(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(s,0,3,0),e.addMany(s,1,3,1),e.add(127,1,0,1),e.addMany(s,8,0,8),e.addMany(s,3,3,3),e.add(127,3,0,3),e.addMany(s,4,3,4),e.add(127,4,0,4),e.addMany(s,6,3,6),e.addMany(s,5,3,5),e.add(127,5,0,5),e.addMany(s,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(i,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(i,7,0,7),e.addMany(s,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(96,127),1,10,0),e.add(80,1,11,9),e.addMany(s,9,0,9),e.add(127,9,0,9),e.addMany(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(s,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(s,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(s,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(s,13,13,13),e.addMany(i,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Mt,0,2,0),e.add(Mt,8,5,8),e.add(Mt,6,0,6),e.add(Mt,11,0,11),e.add(Mt,13,13,13),e}(),HP=class extends G{constructor(e=WP){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 m0,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,r,i)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,r)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(fe(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new zP),this._dcsParser=this._register(new FP),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let r=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(r=e.prefix.charCodeAt(0),r&&60>r||r>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 s=0;s<e.intermediates.length;++s){let n=e.intermediates.charCodeAt(s);if(32>n||n>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=n}}if(e.final.length!==1)throw new Error("final must be a single byte");let i=e.final.charCodeAt(0);if(t[0]>i||i>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return r<<=8,r|=i,r}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let r=this._identifier(e,[48,126]);this._escHandlers[r]===void 0&&(this._escHandlers[r]=[]);let i=this._escHandlers[r];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,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,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let r=this._identifier(e);this._csiHandlers[r]===void 0&&(this._csiHandlers[r]=[]);let i=this._csiHandlers[r];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}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,t,r,i,s){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=r,this._parseStack.transition=i,this._parseStack.chunkPos=s}parse(e,t,r){let i=0,s=0,n=0,o;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,n=this._parseStack.chunkPos+1;else{if(r===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let l=this._parseStack.handlers,c=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(r===!1&&c>-1){for(;c>=0&&(o=l[c](this._params),o!==!0);c--)if(o instanceof Promise)return this._parseStack.handlerPos=c,o}this._parseStack.handlers=[];break;case 4:if(r===!1&&c>-1){for(;c>=0&&(o=l[c](),o!==!0);c--)if(o instanceof Promise)return this._parseStack.handlerPos=c,o}this._parseStack.handlers=[];break;case 6:if(i=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(i!==24&&i!==26,r),o)return o;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(i=e[this._parseStack.chunkPos],o=this._oscParser.end(i!==24&&i!==26,r),o)return o;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,n=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let l=n;l<t;++l){switch(i=e[l],s=this._transitions.table[this.currentState<<8|(i<160?i:Mt)],s>>4){case 2:for(let d=l+1;;++d){if(d>=t||(i=e[d])<32||i>126&&i<Mt){this._printHandler(e,l,d),l=d-1;break}if(++d>=t||(i=e[d])<32||i>126&&i<Mt){this._printHandler(e,l,d),l=d-1;break}if(++d>=t||(i=e[d])<32||i>126&&i<Mt){this._printHandler(e,l,d),l=d-1;break}if(++d>=t||(i=e[d])<32||i>126&&i<Mt){this._printHandler(e,l,d),l=d-1;break}}break;case 3:this._executeHandlers[i]?this._executeHandlers[i]():this._executeHandlerFb(i),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:l,code:i,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let c=this._csiHandlers[this._collect<<8|i],a=c?c.length-1:-1;for(;a>=0&&(o=c[a](this._params),o!==!0);a--)if(o instanceof Promise)return this._preserveStack(3,c,a,s,l),o;a<0&&this._csiHandlerFb(this._collect<<8|i,this._params),this.precedingJoinState=0;break;case 8:do switch(i){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(i-48)}while(++l<t&&(i=e[l])>47&&i<60);l--;break;case 9:this._collect<<=8,this._collect|=i;break;case 10:let h=this._escHandlers[this._collect<<8|i],u=h?h.length-1:-1;for(;u>=0&&(o=h[u](),o!==!0);u--)if(o instanceof Promise)return this._preserveStack(4,h,u,s,l),o;u<0&&this._escHandlerFb(this._collect<<8|i),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|i,this._params);break;case 13:for(let d=l+1;;++d)if(d>=t||(i=e[d])===24||i===26||i===27||i>127&&i<Mt){this._dcsParser.put(e,l,d),l=d-1;break}break;case 14:if(o=this._dcsParser.unhook(i!==24&&i!==26),o)return this._preserveStack(6,[],0,s,l),o;i===27&&(s|=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 d=l+1;;d++)if(d>=t||(i=e[d])<32||i>127&&i<Mt){this._oscParser.put(e,l,d),l=d-1;break}break;case 6:if(o=this._oscParser.end(i!==24&&i!==26),o)return this._preserveStack(5,[],0,s,l),o;i===27&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=s&15}}},jP=/^([\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})$/,UP=/^[\da-f]+$/;function Zp(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let r=jP.exec(t);if(r){let i=r[1]?15:r[4]?255:r[7]?4095:65535;return[Math.round(parseInt(r[1]||r[4]||r[7]||r[10],16)/i*255),Math.round(parseInt(r[2]||r[5]||r[8]||r[11],16)/i*255),Math.round(parseInt(r[3]||r[6]||r[9]||r[12],16)/i*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),UP.exec(t)&&[3,6,9,12].includes(t.length))){let r=t.length/3,i=[0,0,0];for(let s=0;s<3;++s){let n=parseInt(t.slice(r*s,r*s+r),16);i[s]=r===1?n<<4:r===2?n:r===3?n>>4:n>>8}return i}}function oc(e,t){let r=e.toString(16),i=r.length<2?"0"+r:r;switch(t){case 4:return r[0];case 8:return i;case 12:return(i+i).slice(0,3);default:return i+i}}function VP(e,t=16){let[r,i,s]=e;return`rgb:${oc(r,t)}/${oc(i,t)}/${oc(s,t)}`}var KP={"(":0,")":1,"*":2,"+":3,"-":1,".":2},zr=131072,Jp=10;function e_(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var t_=5e3,r_=0,YP=class extends G{constructor(e,t,r,i,s,n,o,l,c=new HP){super(),this._bufferService=e,this._charsetService=t,this._coreService=r,this._logService=i,this._optionsService=s,this._oscLinkService=n,this._coreMouseService=o,this._unicodeService=l,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new dE,this._utf8Decoder=new fE,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Re.clone(),this._eraseAttrDataInternal=Re.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 Hu(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(a=>this._activeBuffer=a.activeBuffer)),this._parser.setCsiHandlerFallback((a,h)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(a),params:h.toArray()})}),this._parser.setEscHandlerFallback(a=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(a)})}),this._parser.setExecuteHandlerFallback(a=>{this._logService.debug("Unknown EXECUTE code: ",{code:a})}),this._parser.setOscHandlerFallback((a,h,u)=>{this._logService.debug("Unknown OSC code: ",{identifier:a,action:h,data:u})}),this._parser.setDcsHandlerFallback((a,h,u)=>{h==="HOOK"&&(u=u.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(a),action:h,payload:u})}),this._parser.setPrintHandler((a,h,u)=>this.print(a,h,u)),this._parser.registerCsiHandler({final:"@"},a=>this.insertChars(a)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},a=>this.scrollLeft(a)),this._parser.registerCsiHandler({final:"A"},a=>this.cursorUp(a)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},a=>this.scrollRight(a)),this._parser.registerCsiHandler({final:"B"},a=>this.cursorDown(a)),this._parser.registerCsiHandler({final:"C"},a=>this.cursorForward(a)),this._parser.registerCsiHandler({final:"D"},a=>this.cursorBackward(a)),this._parser.registerCsiHandler({final:"E"},a=>this.cursorNextLine(a)),this._parser.registerCsiHandler({final:"F"},a=>this.cursorPrecedingLine(a)),this._parser.registerCsiHandler({final:"G"},a=>this.cursorCharAbsolute(a)),this._parser.registerCsiHandler({final:"H"},a=>this.cursorPosition(a)),this._parser.registerCsiHandler({final:"I"},a=>this.cursorForwardTab(a)),this._parser.registerCsiHandler({final:"J"},a=>this.eraseInDisplay(a,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},a=>this.eraseInDisplay(a,!0)),this._parser.registerCsiHandler({final:"K"},a=>this.eraseInLine(a,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},a=>this.eraseInLine(a,!0)),this._parser.registerCsiHandler({final:"L"},a=>this.insertLines(a)),this._parser.registerCsiHandler({final:"M"},a=>this.deleteLines(a)),this._parser.registerCsiHandler({final:"P"},a=>this.deleteChars(a)),this._parser.registerCsiHandler({final:"S"},a=>this.scrollUp(a)),this._parser.registerCsiHandler({final:"T"},a=>this.scrollDown(a)),this._parser.registerCsiHandler({final:"X"},a=>this.eraseChars(a)),this._parser.registerCsiHandler({final:"Z"},a=>this.cursorBackwardTab(a)),this._parser.registerCsiHandler({final:"`"},a=>this.charPosAbsolute(a)),this._parser.registerCsiHandler({final:"a"},a=>this.hPositionRelative(a)),this._parser.registerCsiHandler({final:"b"},a=>this.repeatPrecedingCharacter(a)),this._parser.registerCsiHandler({final:"c"},a=>this.sendDeviceAttributesPrimary(a)),this._parser.registerCsiHandler({prefix:">",final:"c"},a=>this.sendDeviceAttributesSecondary(a)),this._parser.registerCsiHandler({final:"d"},a=>this.linePosAbsolute(a)),this._parser.registerCsiHandler({final:"e"},a=>this.vPositionRelative(a)),this._parser.registerCsiHandler({final:"f"},a=>this.hVPosition(a)),this._parser.registerCsiHandler({final:"g"},a=>this.tabClear(a)),this._parser.registerCsiHandler({final:"h"},a=>this.setMode(a)),this._parser.registerCsiHandler({prefix:"?",final:"h"},a=>this.setModePrivate(a)),this._parser.registerCsiHandler({final:"l"},a=>this.resetMode(a)),this._parser.registerCsiHandler({prefix:"?",final:"l"},a=>this.resetModePrivate(a)),this._parser.registerCsiHandler({final:"m"},a=>this.charAttributes(a)),this._parser.registerCsiHandler({final:"n"},a=>this.deviceStatus(a)),this._parser.registerCsiHandler({prefix:"?",final:"n"},a=>this.deviceStatusPrivate(a)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},a=>this.softReset(a)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},a=>this.setCursorStyle(a)),this._parser.registerCsiHandler({final:"r"},a=>this.setScrollRegion(a)),this._parser.registerCsiHandler({final:"s"},a=>this.saveCursor(a)),this._parser.registerCsiHandler({final:"t"},a=>this.windowOptions(a)),this._parser.registerCsiHandler({final:"u"},a=>this.restoreCursor(a)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},a=>this.insertColumns(a)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},a=>this.deleteColumns(a)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},a=>this.selectProtected(a)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},a=>this.requestMode(a,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},a=>this.requestMode(a,!1)),this._parser.setExecuteHandler(M.BEL,()=>this.bell()),this._parser.setExecuteHandler(M.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(M.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(M.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(M.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(M.BS,()=>this.backspace()),this._parser.setExecuteHandler(M.HT,()=>this.tab()),this._parser.setExecuteHandler(M.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(M.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Qo.IND,()=>this.index()),this._parser.setExecuteHandler(Qo.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Qo.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new yt(a=>(this.setTitle(a),this.setIconName(a),!0))),this._parser.registerOscHandler(1,new yt(a=>this.setIconName(a))),this._parser.registerOscHandler(2,new yt(a=>this.setTitle(a))),this._parser.registerOscHandler(4,new yt(a=>this.setOrReportIndexedColor(a))),this._parser.registerOscHandler(8,new yt(a=>this.setHyperlink(a))),this._parser.registerOscHandler(10,new yt(a=>this.setOrReportFgColor(a))),this._parser.registerOscHandler(11,new yt(a=>this.setOrReportBgColor(a))),this._parser.registerOscHandler(12,new yt(a=>this.setOrReportCursorColor(a))),this._parser.registerOscHandler(104,new yt(a=>this.restoreIndexedColor(a))),this._parser.registerOscHandler(110,new yt(a=>this.restoreFgColor(a))),this._parser.registerOscHandler(111,new yt(a=>this.restoreBgColor(a))),this._parser.registerOscHandler(112,new yt(a=>this.restoreCursorColor(a))),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 a in Be)this._parser.registerEscHandler({intermediates:"(",final:a},()=>this.selectCharset("("+a)),this._parser.registerEscHandler({intermediates:")",final:a},()=>this.selectCharset(")"+a)),this._parser.registerEscHandler({intermediates:"*",final:a},()=>this.selectCharset("*"+a)),this._parser.registerEscHandler({intermediates:"+",final:a},()=>this.selectCharset("+"+a)),this._parser.registerEscHandler({intermediates:"-",final:a},()=>this.selectCharset("-"+a)),this._parser.registerEscHandler({intermediates:".",final:a},()=>this.selectCharset("."+a)),this._parser.registerEscHandler({intermediates:"/",final:a},()=>this.selectCharset("/"+a));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(a=>(this._logService.error("Parsing error: ",a),a)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new Qp((a,h)=>this.requestStatusString(a,h)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,r,i){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=r,this._parseStack.position=i}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,r)=>setTimeout(()=>r("#SLOW_TIMEOUT"),t_))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${t_} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let r,i=this._activeBuffer.x,s=this._activeBuffer.y,n=0,o=this._parseStack.paused;if(o){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(r),r;i=this._parseStack.cursorStartX,s=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>zr&&(n=this._parseStack.position+zr)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,a=>String.fromCharCode(a)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(a=>a.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<zr&&(this._parseBuffer=new Uint32Array(Math.min(e.length,zr))),o||this._dirtyRowTracker.clearRange(),e.length>zr)for(let a=n;a<e.length;a+=zr){let h=a+zr<e.length?a+zr:e.length,u=typeof e=="string"?this._stringDecoder.decode(e.substring(a,h),this._parseBuffer):this._utf8Decoder.decode(e.subarray(a,h),this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,u))return this._preserveStack(i,s,u,a),this._logSlowResolvingAsync(r),r}else if(!o){let a=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,a))return this._preserveStack(i,s,a,0),this._logSlowResolvingAsync(r),r}(this._activeBuffer.x!==i||this._activeBuffer.y!==s)&&this._onCursorMove.fire();let l=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(c,this._bufferService.rows-1),end:Math.min(l,this._bufferService.rows-1)})}print(e,t,r){let i,s,n=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,l=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,a=this._coreService.modes.insertMode,h=this._curAttrData,u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&r-t>0&&u.getWidth(this._activeBuffer.x-1)===2&&u.setCellFromCodepoint(this._activeBuffer.x-1,0,1,h);let d=this._parser.precedingJoinState;for(let f=t;f<r;++f){if(i=e[f],i<127&&n){let m=n[String.fromCharCode(i)];m&&(i=m.charCodeAt(0))}let _=this._unicodeService.charProperties(i,d);s=Ci.extractWidth(_);let p=Ci.extractShouldJoin(_),C=p?Ci.extractWidth(d):0;if(d=_,o&&this._onA11yChar.fire(Hr(i)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+s-C>l){if(c){let m=u,g=this._activeBuffer.x-C;for(this._activeBuffer.x=C,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),u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&u instanceof on&&u.copyCellsFrom(m,g,0,C,!1);g<l;)m.setCellFromCodepoint(g++,0,1,h)}else if(this._activeBuffer.x=l-1,s===2)continue}if(p&&this._activeBuffer.x){let m=u.getWidth(this._activeBuffer.x-1)?1:2;u.addCodepointToCell(this._activeBuffer.x-m,i,s);for(let g=s-C;--g>=0;)u.setCellFromCodepoint(this._activeBuffer.x++,0,0,h);continue}if(a&&(u.insertCells(this._activeBuffer.x,s-C,this._activeBuffer.getNullCell(h)),u.getWidth(l-1)===2&&u.setCellFromCodepoint(l-1,0,1,h)),u.setCellFromCodepoint(this._activeBuffer.x++,i,s,h),s>0)for(;--s;)u.setCellFromCodepoint(this._activeBuffer.x++,0,0,h)}this._parser.precedingJoinState=d,this._activeBuffer.x<l&&r-t>0&&u.getWidth(this._activeBuffer.x)===0&&!u.hasContent(this._activeBuffer.x)&&u.setCellFromCodepoint(this._activeBuffer.x,0,1,h),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,r=>e_(r.params[0],this._optionsService.rawOptions.windowOptions)?t(r):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new Qp(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new yt(t))}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 t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.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,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,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 t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,r,i=!1,s=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.replaceCells(t,r,this._activeBuffer.getNullCell(this._eraseAttrData()),s),i&&(n.isWrapped=!1)}_resetBufferLine(e,t=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r.isWrapped=!1)}eraseInDisplay(e,t=!1){var i;this._restrictCursor(this._bufferService.cols);let r;switch(e.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);r<this._bufferService.rows;r++)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(r);break;case 1:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!((i=this._activeBuffer.lines.get(this._activeBuffer.ybase+r))!=null&&i.getTrimmedLength()););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!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,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,i=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-i+1;for(;t--;)this._activeBuffer.lines.splice(s-1,1),this._activeBuffer.lines.splice(r,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 t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,i;for(i=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-i;t--;)this._activeBuffer.lines.splice(r,1),this._activeBuffer.lines.splice(i,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 t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.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 t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)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 t=e.params[0]||1;for(;t--;)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(Re));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 t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);i.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.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 t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);i.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.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 t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);i.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.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 t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);i.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.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 t=this._parser.precedingJoinState;if(!t)return!0;let r=e.params[0]||1,i=Ci.extractWidth(t),s=this._activeBuffer.x-i,n=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(s),o=new Uint32Array(n.length*r),l=0;for(let a=0;a<n.length;){let h=n.codePointAt(a)||0;o[l++]=h,a+=h>65535?2:1}let c=l;for(let a=1;a<r;++a)o.copyWithin(c,0,l),c+=l;return this.print(o,0,c),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(M.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(M.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(M.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(M.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(M.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,vi),this._charsetService.setgCharset(1,vi),this._charsetService.setgCharset(2,vi),this._charsetService.setgCharset(3,vi);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 t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){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[t]===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,t){(p=>(p[p.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",p[p.SET=1]="SET",p[p.RESET=2]="RESET",p[p.PERMANENTLY_SET=3]="PERMANENTLY_SET",p[p.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(r={}));let i=this._coreService.decPrivateModes,{activeProtocol:s,activeEncoding:n}=this._coreMouseService,o=this._coreService,{buffers:l,cols:c}=this._bufferService,{active:a,alt:h}=l,u=this._optionsService.rawOptions,d=(p,C)=>(o.triggerDataEvent(`${M.ESC}[${t?"":"?"}${p};${C}$y`),!0),f=p=>p?1:2,_=e.params[0];return t?_===2?d(_,4):_===4?d(_,f(o.modes.insertMode)):_===12?d(_,3):_===20?d(_,f(u.convertEol)):d(_,0):_===1?d(_,f(i.applicationCursorKeys)):_===3?d(_,u.windowOptions.setWinLines?c===80?2:c===132?1:0:0):_===6?d(_,f(i.origin)):_===7?d(_,f(i.wraparound)):_===8?d(_,3):_===9?d(_,f(s==="X10")):_===12?d(_,f(u.cursorBlink)):_===25?d(_,f(!o.isCursorHidden)):_===45?d(_,f(i.reverseWraparound)):_===66?d(_,f(i.applicationKeypad)):_===67?d(_,4):_===1e3?d(_,f(s==="VT200")):_===1002?d(_,f(s==="DRAG")):_===1003?d(_,f(s==="ANY")):_===1004?d(_,f(i.sendFocus)):_===1005?d(_,4):_===1006?d(_,f(n==="SGR")):_===1015?d(_,4):_===1016?d(_,f(n==="SGR_PIXELS")):_===1048?d(_,1):_===47||_===1047||_===1049?d(_,f(a===h)):_===2004?d(_,f(i.bracketedPasteMode)):_===2026?d(_,f(i.synchronizedOutput)):d(_,0)}_updateAttrColor(e,t,r,i,s){return t===2?(e|=50331648,e&=-16777216,e|=qn.fromColorRGB([r,i,s])):t===5&&(e&=-50331904,e|=33554432|r&255),e}_extractColor(e,t,r){let i=[0,0,-1,0,0,0],s=0,n=0;do{if(i[n+s]=e.params[t+n],e.hasSubParams(t+n)){let o=e.getSubParams(t+n),l=0;do i[1]===5&&(s=1),i[n+l+1+s]=o[l];while(++l<o.length&&l+n+1+s<i.length);break}if(i[1]===5&&n+s>=2||i[1]===2&&n+s>=5)break;i[1]&&(s=1)}while(++n+t<e.length&&n+s<i.length);for(let o=2;o<i.length;++o)i[o]===-1&&(i[o]=0);switch(i[0]){case 38:r.fg=this._updateAttrColor(r.fg,i[1],i[3],i[4],i[5]);break;case 48:r.bg=this._updateAttrColor(r.bg,i[1],i[3],i[4],i[5]);break;case 58:r.extended=r.extended.clone(),r.extended.underlineColor=this._updateAttrColor(r.extended.underlineColor,i[1],i[3],i[4],i[5])}return n}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=Re.fg,e.bg=Re.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 t=e.length,r,i=this._curAttrData;for(let s=0;s<t;s++)r=e.params[s],r>=30&&r<=37?(i.fg&=-50331904,i.fg|=16777216|r-30):r>=40&&r<=47?(i.bg&=-50331904,i.bg|=16777216|r-40):r>=90&&r<=97?(i.fg&=-50331904,i.fg|=16777216|r-90|8):r>=100&&r<=107?(i.bg&=-50331904,i.bg|=16777216|r-100|8):r===0?this._processSGR0(i):r===1?i.fg|=134217728:r===3?i.bg|=67108864:r===4?(i.fg|=268435456,this._processUnderline(e.hasSubParams(s)?e.getSubParams(s)[0]:1,i)):r===5?i.fg|=536870912:r===7?i.fg|=67108864:r===8?i.fg|=1073741824:r===9?i.fg|=2147483648:r===2?i.bg|=134217728:r===21?this._processUnderline(2,i):r===22?(i.fg&=-134217729,i.bg&=-134217729):r===23?i.bg&=-67108865:r===24?(i.fg&=-268435457,this._processUnderline(0,i)):r===25?i.fg&=-536870913:r===27?i.fg&=-67108865:r===28?i.fg&=-1073741825:r===29?i.fg&=2147483647:r===39?(i.fg&=-67108864,i.fg|=Re.fg&16777215):r===49?(i.bg&=-67108864,i.bg|=Re.bg&16777215):r===38||r===48||r===58?s+=this._extractColor(e,s,i):r===53?i.bg|=1073741824:r===55?i.bg&=-1073741825:r===59?(i.extended=i.extended.clone(),i.extended.underlineColor=-1,i.updateExtended()):r===100?(i.fg&=-67108864,i.fg|=Re.fg&16777215,i.bg&=-67108864,i.bg|=Re.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${M.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${M.ESC}[${t};${r}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${M.ESC}[?${t};${r}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=Re.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 t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){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 r=t%2===1;this._coreService.decPrivateModes.cursorBlink=r}return!0}setScrollRegion(e){let t=e.params[0]||1,r;return(e.length<2||(r=e.params[1])>this._bufferService.rows||r===0)&&(r=this._bufferService.rows),r>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(e){if(!e_(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${M.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Jp&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Jp&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===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 t=[],r=e.split(";");for(;r.length>1;){let i=r.shift(),s=r.shift();if(/^\d+$/.exec(i)){let n=parseInt(i);if(i_(n))if(s==="?")t.push({type:0,index:n});else{let o=Zp(s);o&&t.push({type:1,index:n,color:o})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let r=e.slice(0,t).trim(),i=e.slice(t+1);return i?this._createHyperlink(r,i):r.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let r=e.split(":"),i,s=r.findIndex(n=>n.startsWith("id="));return s!==-1&&(i=r[s].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:i,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let r=e.split(";");for(let i=0;i<r.length&&!(t>=this._specialColors.length);++i,++t)if(r[i]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let s=Zp(r[i]);s&&this._onColor.fire([{type:1,index:this._specialColors[t],color:s}])}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 t=[],r=e.split(";");for(let i=0;i<r.length;++i)if(/^\d+$/.exec(r[i])){let s=parseInt(r[i]);i_(s)&&t.push({type:2,index:s})}return t.length&&this._onColor.fire(t),!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,vi),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(KP[e[0]],Be[e[1]]||vi),!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=Re.clone(),this._eraseAttrDataInternal=Re.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 Ot;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let r=this._activeBuffer.ybase+this._activeBuffer.y+t,i=this._activeBuffer.lines.get(r);i&&(i.fill(e),i.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let r=o=>(this._coreService.triggerDataEvent(`${M.ESC}${o}${M.ESC}\\`),!0),i=this._bufferService.buffer,s=this._optionsService.rawOptions;return r(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${i.scrollTop+1};${i.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[s.cursorStyle]-(s.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Hu=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,t){e>t&&(r_=e,e=t,t=r_),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Hu=be([W(0,at)],Hu);function i_(e){return 0<=e&&e<256}var qP=5e7,s_=12,GP=50,XP=class extends G{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,t){if(t!==void 0&&this._syncCalls>t){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 r;for(;r=this._writeBuffer.shift();){this._action(r);let i=this._callbacks.shift();i&&i()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>qP)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(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let r=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let i=this._writeBuffer[this._bufferOffset],s=this._action(i,t);if(s){let o=l=>performance.now()-r>=s_?setTimeout(()=>this._innerWrite(0,l)):this._innerWrite(r,l);s.catch(l=>(queueMicrotask(()=>{throw l}),Promise.resolve(!1))).then(o);return}let n=this._callbacks[this._bufferOffset];if(n&&n(),this._bufferOffset++,this._pendingData-=i.length,performance.now()-r>=s_)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>GP&&(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()}},ju=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let l=t.addMarker(t.ybase+t.y),c={data:e,id:this._nextId++,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(c,l)),this._dataByLinkId.set(c.id,c),c.id}let r=e,i=this._getEntryIdKey(r),s=this._entriesWithId.get(i);if(s)return this.addLineToLink(s.id,t.ybase+t.y),s.id;let n=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(r),data:r,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(o,n)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let r=this._dataByLinkId.get(e);if(r&&r.lines.every(i=>i.line!==t)){let i=this._bufferService.buffer.addMarker(t);r.lines.push(i),i.onDispose(()=>this._removeMarkerFromLink(r,i))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let r=e.lines.indexOf(t);r!==-1&&(e.lines.splice(r,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};ju=be([W(0,at)],ju);var n_=!1,QP=class extends G{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Ds),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 wP,this.optionsService=this._register(new LP(e)),this._instantiationService.setService(ct,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(zu)),this._instantiationService.setService(at,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Iu)),this._instantiationService.setService(Oy,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Fu)),this._instantiationService.setService(Wi,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance($u)),this._instantiationService.setService(Ny,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Ci)),this._instantiationService.setService(gE,this.unicodeService),this._charsetService=this._instantiationService.createInstance(BP),this._instantiationService.setService(mE,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(ju),this._instantiationService.setService(By,this._oscLinkService),this._inputHandler=this._register(new YP(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Ye.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Ye.forward(this._bufferService.onResize,this._onResize)),this._register(Ye.forward(this.coreService.onData,this._onData)),this._register(Ye.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 XP((t,r)=>this._inputHandler.parse(t,r))),this._register(Ye.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new z),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.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 t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!n_&&(this._logService.warn("writeSync is unreliable and will be removed soon."),n_=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,p0),t=Math.max(t,_0),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}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 t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.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(Xp.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(Xp(this._bufferService),!1))),this._windowsWrappingHeuristics.value=fe(()=>{for(let t of e)t.dispose()})}}},ZP={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 JP(e,t,r,i){var o;let s={type:0,cancel:!1,key:void 0},n=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?s.key=M.ESC+"OA":s.key=M.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?s.key=M.ESC+"OD":s.key=M.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?s.key=M.ESC+"OC":s.key=M.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?s.key=M.ESC+"OB":s.key=M.ESC+"[B");break;case 8:s.key=e.ctrlKey?"\b":M.DEL,e.altKey&&(s.key=M.ESC+s.key);break;case 9:if(e.shiftKey){s.key=M.ESC+"[Z";break}s.key=M.HT,s.cancel=!0;break;case 13:s.key=e.altKey?M.ESC+M.CR:M.CR,s.cancel=!0;break;case 27:s.key=M.ESC,e.altKey&&(s.key=M.ESC+M.ESC),s.cancel=!0;break;case 37:if(e.metaKey)break;n?s.key=M.ESC+"[1;"+(n+1)+"D":t?s.key=M.ESC+"OD":s.key=M.ESC+"[D";break;case 39:if(e.metaKey)break;n?s.key=M.ESC+"[1;"+(n+1)+"C":t?s.key=M.ESC+"OC":s.key=M.ESC+"[C";break;case 38:if(e.metaKey)break;n?s.key=M.ESC+"[1;"+(n+1)+"A":t?s.key=M.ESC+"OA":s.key=M.ESC+"[A";break;case 40:if(e.metaKey)break;n?s.key=M.ESC+"[1;"+(n+1)+"B":t?s.key=M.ESC+"OB":s.key=M.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(s.key=M.ESC+"[2~");break;case 46:n?s.key=M.ESC+"[3;"+(n+1)+"~":s.key=M.ESC+"[3~";break;case 36:n?s.key=M.ESC+"[1;"+(n+1)+"H":t?s.key=M.ESC+"OH":s.key=M.ESC+"[H";break;case 35:n?s.key=M.ESC+"[1;"+(n+1)+"F":t?s.key=M.ESC+"OF":s.key=M.ESC+"[F";break;case 33:e.shiftKey?s.type=2:e.ctrlKey?s.key=M.ESC+"[5;"+(n+1)+"~":s.key=M.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:e.ctrlKey?s.key=M.ESC+"[6;"+(n+1)+"~":s.key=M.ESC+"[6~";break;case 112:n?s.key=M.ESC+"[1;"+(n+1)+"P":s.key=M.ESC+"OP";break;case 113:n?s.key=M.ESC+"[1;"+(n+1)+"Q":s.key=M.ESC+"OQ";break;case 114:n?s.key=M.ESC+"[1;"+(n+1)+"R":s.key=M.ESC+"OR";break;case 115:n?s.key=M.ESC+"[1;"+(n+1)+"S":s.key=M.ESC+"OS";break;case 116:n?s.key=M.ESC+"[15;"+(n+1)+"~":s.key=M.ESC+"[15~";break;case 117:n?s.key=M.ESC+"[17;"+(n+1)+"~":s.key=M.ESC+"[17~";break;case 118:n?s.key=M.ESC+"[18;"+(n+1)+"~":s.key=M.ESC+"[18~";break;case 119:n?s.key=M.ESC+"[19;"+(n+1)+"~":s.key=M.ESC+"[19~";break;case 120:n?s.key=M.ESC+"[20;"+(n+1)+"~":s.key=M.ESC+"[20~";break;case 121:n?s.key=M.ESC+"[21;"+(n+1)+"~":s.key=M.ESC+"[21~";break;case 122:n?s.key=M.ESC+"[23;"+(n+1)+"~":s.key=M.ESC+"[23~";break;case 123:n?s.key=M.ESC+"[24;"+(n+1)+"~":s.key=M.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?s.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?s.key=M.NUL:e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?s.key=M.DEL:e.keyCode===219?s.key=M.ESC:e.keyCode===220?s.key=M.FS:e.keyCode===221&&(s.key=M.GS);else if((!r||i)&&e.altKey&&!e.metaKey){let l=(o=ZP[e.keyCode])==null?void 0:o[e.shiftKey?1:0];if(l)s.key=M.ESC+l;else if(e.keyCode>=65&&e.keyCode<=90){let c=e.ctrlKey?e.keyCode-64:e.keyCode+32,a=String.fromCharCode(c);e.shiftKey&&(a=a.toUpperCase()),s.key=M.ESC+a}else if(e.keyCode===32)s.key=M.ESC+(e.ctrlKey?M.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let c=e.code.slice(3,4);e.shiftKey||(c=c.toLowerCase()),s.key=M.ESC+c,s.cancel=!0}}else r&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(s.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?s.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(s.key=M.US),e.key==="@"&&(s.key=M.NUL));break}return s}var ke=0,eD=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Nl,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Nl,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((s,n)=>this._getKey(s)-this._getKey(n)),t=0,r=0,i=new Array(this._array.length+this._insertedValues.length);for(let s=0;s<i.length;s++)r>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[r])?(i[s]=e[t],t++):i[s]=this._array[r++];this._array=i,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 t=this._getKey(e);if(t===void 0||(ke=this._search(t),ke===-1)||this._getKey(this._array[ke])!==t)return!1;do if(this._array[ke]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(ke),!0;while(++ke<this._array.length&&this._getKey(this._array[ke])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((s,n)=>s-n),t=0,r=new Array(this._array.length-e.length),i=0;for(let s=0;s<this._array.length;s++)e[t]===s?t++:r[i++]=this._array[s];this._array=r,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&&(ke=this._search(e),!(ke<0||ke>=this._array.length)&&this._getKey(this._array[ke])===e))do yield this._array[ke];while(++ke<this._array.length&&this._getKey(this._array[ke])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ke=this._search(e),!(ke<0||ke>=this._array.length)&&this._getKey(this._array[ke])===e))do t(this._array[ke]);while(++ke<this._array.length&&this._getKey(this._array[ke])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,r=this._array.length-1;for(;r>=t;){let i=t+r>>1,s=this._getKey(this._array[i]);if(s>e)r=i-1;else if(s<e)t=i+1;else{for(;i>0&&this._getKey(this._array[i-1])===e;)i--;return i}}return t}},lc=0,o_=0,tD=class extends G{constructor(){super(),this._decorations=new eD(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(fe(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new rD(e);if(t){let r=t.marker.onDispose(()=>t.dispose()),i=t.onDispose(()=>{i.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),r.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,r){let i=0,s=0;for(let n of this._decorations.getKeyIterator(t))i=n.options.x??0,s=i+(n.options.width??1),e>=i&&e<s&&(!r||(n.options.layer??"bottom")===r)&&(yield n)}forEachDecorationAtCell(e,t,r,i){this._decorations.forEachByKey(t,s=>{lc=s.options.x??0,o_=lc+(s.options.width??1),e>=lc&&e<o_&&(!r||(s.options.layer??"bottom")===r)&&i(s)})}},rD=class extends ri{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=_e.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=_e.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},iD=1e3,sD=class{constructor(e,t=iD){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t: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,t):t;let i=performance.now();if(i-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=i,this._innerRefresh();else if(!this._additionalRefreshRequested){let s=i-this._lastRefreshMs,n=this._debounceThresholdMS-s;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},n)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},l_=20,Ol=class extends G{constructor(e,t,r,i){super(),this._terminal=e,this._coreBrowserService=r,this._renderService=i,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let s=this._coreBrowserService.mainDocument;this._accessibilityContainer=s.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=s.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let n=0;n<this._terminal.rows;n++)this._rowElements[n]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[n]);if(this._topBoundaryFocusListener=n=>this._handleBoundaryFocus(n,0),this._bottomBoundaryFocusListener=n=>this._handleBoundaryFocus(n,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=s.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new sD(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(n=>this._handleResize(n.rows))),this._register(this._terminal.onRender(n=>this._refreshRows(n.start,n.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(n=>this._handleChar(n))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
219
|
+
`))),this._register(this._terminal.onA11yTab(n=>this._handleTab(n))),this._register(this._terminal.onKey(n=>this._handleKey(n.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(K(s,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(fe(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<l_+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
220
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===l_+1&&(this._liveRegion.textContent+=cu.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,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let r=this._terminal.buffer,i=r.lines.length.toString();for(let s=e;s<=t;s++){let n=r.lines.get(r.ydisp+s),o=[],l=(n==null?void 0:n.translateToString(!0,void 0,void 0,o))||"",c=(r.ydisp+s+1).toString(),a=this._rowElements[s];a&&(l.length===0?(a.textContent=" ",this._rowColumns.set(a,[0,1])):(a.textContent=l,this._rowColumns.set(a,o)),a.setAttribute("aria-posinset",c),a.setAttribute("aria-setsize",i),this._alignRowWidth(a))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let r=e.target,i=this._rowElements[t===0?1:this._rowElements.length-2],s=r.getAttribute("aria-posinset"),n=t===0?"1":`${this._terminal.buffer.lines.length}`;if(s===n||e.relatedTarget!==i)return;let o,l;if(t===0?(o=r,l=this._rowElements.pop(),this._rowContainer.removeChild(l)):(o=this._rowElements.shift(),l=r,this._rowContainer.removeChild(o)),o.removeEventListener("focus",this._topBoundaryFocusListener),l.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let c=this._createAccessibilityTreeNode();this._rowElements.unshift(c),this._rowContainer.insertAdjacentElement("afterbegin",c)}else{let c=this._createAccessibilityTreeNode();this._rowElements.push(c),this._rowContainer.appendChild(c)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var l;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 t={node:e.anchorNode,offset:e.anchorOffset},r={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===r.node&&t.offset>r.offset)&&([t,r]=[r,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let i=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(i)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:i,offset:((l=i.textContent)==null?void 0:l.length)??0}),!this._rowContainer.contains(r.node))return;let s=({node:c,offset:a})=>{let h=c instanceof Text?c.parentNode:c,u=parseInt(h==null?void 0:h.getAttribute("aria-posinset"),10)-1;if(isNaN(u))return console.warn("row is invalid. Race condition?"),null;let d=this._rowColumns.get(h);if(!d)return console.warn("columns is null. Race condition?"),null;let f=a<d.length?d[a]:d.slice(-1)[0]+1;return f>=this._terminal.cols&&(++u,f=0),{row:u,column:f}},n=s(t),o=s(r);if(!(!n||!o)){if(n.row>o.row||n.row===o.row&&n.column>=o.column)throw new Error("invalid range");this._terminal.select(n.column,n.row,(o.row-n.row)*this._terminal.cols-n.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);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 s,n;e.style.transform="";let t=e.getBoundingClientRect().width,r=(n=(s=this._rowColumns.get(e))==null?void 0:s.slice(-1))==null?void 0:n[0];if(!r)return;let i=r*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${i/t})`}};Ol=be([W(1,ad),W(2,Tr),W(3,Ar)],Ol);var Uu=class extends G{constructor(e,t,r,i,s){super(),this._element=e,this._mouseService=t,this._renderService=r,this._bufferService=i,this._linkProviderService=s,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(fe(()=>{var n;Ni(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(n=this._activeProviderReplies)==null||n.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(K(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(K(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(K(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(K(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let r=e.composedPath();for(let i=0;i<r.length;i++){let s=r[i];if(s.classList.contains("xterm"))break;if(s.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_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,t){var i,s;(!this._activeProviderReplies||!t)&&((i=this._activeProviderReplies)==null||i.forEach(n=>{n==null||n.forEach(o=>{o.link.dispose&&o.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(let[n,o]of this._linkProviderService.linkProviders.entries())t?(s=this._activeProviderReplies)!=null&&s.get(n)&&(r=this._checkLinkProviderResult(n,e,r)):o.provideLinks(e.y,l=>{var a,h;if(this._isMouseOut)return;let c=l==null?void 0:l.map(u=>({link:u}));(a=this._activeProviderReplies)==null||a.set(n,c),r=this._checkLinkProviderResult(n,e,r),((h=this._activeProviderReplies)==null?void 0:h.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let r=new Set;for(let i=0;i<t.size;i++){let s=t.get(i);if(s)for(let n=0;n<s.length;n++){let o=s[n],l=o.link.range.start.y<e?0:o.link.range.start.x,c=o.link.range.end.y>e?this._bufferService.cols:o.link.range.end.x;for(let a=l;a<=c;a++){if(r.has(a)){s.splice(n--,1);break}r.add(a)}}}}_checkLinkProviderResult(e,t,r){var n;if(!this._activeProviderReplies)return r;let i=this._activeProviderReplies.get(e),s=!1;for(let o=0;o<e;o++)(!this._activeProviderReplies.has(o)||this._activeProviderReplies.get(o))&&(s=!0);if(!s&&i){let o=i.find(l=>this._linkAtPosition(l.link,t));o&&(r=!0,this._handleNewLink(o))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let o=0;o<this._activeProviderReplies.size;o++){let l=(n=this._activeProviderReplies.get(o))==null?void 0:n.find(c=>this._linkAtPosition(c.link,t));if(l){r=!0,this._handleNewLink(l);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&nD(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Ni(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(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 r,i;return(i=(r=this._currentLink)==null?void 0:r.state)==null?void 0:i.decorations.pointerCursor},set:r=>{var i;(i=this._currentLink)!=null&&i.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>{var r,i;return(i=(r=this._currentLink)==null?void 0:r.state)==null?void 0:i.decorations.underline},set:r=>{var i,s,n;(i=this._currentLink)!=null&&i.state&&((n=(s=this._currentLink)==null?void 0:s.state)==null?void 0:n.decorations.underline)!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;let i=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,s=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=s&&(this._clearCurrentLink(i,s),this._lastMouseEvent)){let n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._askForLink(n,!1)}})))}_linkHover(e,t,r){var i;(i=this._currentLink)!=null&&i.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(r,t.text)}_fireUnderlineEvent(e,t){let r=e.range,i=this._bufferService.buffer.ydisp,s=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-i-1,r.end.x,r.end.y-i-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(s)}_linkLeave(e,t,r){var i;(i=this._currentLink)!=null&&i.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(r,t.text)}_linkAtPosition(e,t){let r=e.range.start.y*this._bufferService.cols+e.range.start.x,i=e.range.end.y*this._bufferService.cols+e.range.end.x,s=t.y*this._bufferService.cols+t.x;return r<=s&&s<=i}_positionFromMouseEvent(e,t,r){let i=r.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,r,i,s){return{x1:e,y1:t,x2:r,y2:i,cols:this._bufferService.cols,fg:s}}};Uu=be([W(1,cd),W(2,Ar),W(3,at),W(4,zy)],Uu);function nD(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var oD=class extends QP{constructor(e={}){super(e),this._linkifier=this._register(new Ds),this.browser=i0,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Ds),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(tD),this._instantiationService.setService(Gn,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(GR),this._instantiationService.setService(zy,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(hu)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(Ye.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Ye.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Ye.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Ye.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(fe(()=>{var t,r;this._customKeyEventHandler=void 0,(r=(t=this.element)==null?void 0:t.parentNode)==null||r.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 t of e){let r,i="";switch(t.index){case 256:r="foreground",i="10";break;case 257:r="background",i="11";break;case 258:r="cursor",i="12";break;default:r="ansi",i="4;"+t.index}switch(t.type){case 0:let s=ue.toColorRGB(r==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[r]);this.coreService.triggerDataEvent(`${M.ESC}]${i};${VP(s)}${t0.ST}`);break;case 1:if(r==="ansi")this._themeService.modifyColors(n=>n.ansi[t.index]=Pe.toColor(...t.color));else{let n=r;this._themeService.modifyColors(o=>o[n]=Pe.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.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(Ol,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(M.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(M.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,t=this.buffer.lines.get(e);if(!t)return;let r=Math.min(this.buffer.x,this.cols-1),i=this._renderService.dimensions.css.cell.height,s=t.getWidth(r),n=this._renderService.dimensions.css.cell.width*s,o=this.buffer.y*this._renderService.dimensions.css.cell.height,l=r*this._renderService.dimensions.css.cell.width;this.textarea.style.left=l+"px",this.textarea.style.top=o+"px",this.textarea.style.width=n+"px",this.textarea.style.height=i+"px",this.textarea.style.lineHeight=i+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(K(this.element,"copy",t=>{this.hasSelection()&&uE(t,this._selectionService)}));let e=t=>hE(t,this.textarea,this.coreService,this.optionsService);this._register(K(this.textarea,"paste",e)),this._register(K(this.element,"paste",e)),s0?this._register(K(this.element,"mousedown",t=>{t.button===2&&gp(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(K(this.element,"contextmenu",t=>{gp(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),gd&&this._register(K(this.element,"auxclick",t=>{t.button===1&&Dy(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(K(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(K(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(K(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(K(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(K(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(K(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(K(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var s;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"),((s=this.element)==null?void 0:s.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 t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(K(this.screenElement,"mousemove",n=>this.updateCursorStyle(n))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let r=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",au.get()),l0||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",()=>r.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(YR,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Tr,this._coreBrowserService),this._register(K(this.textarea,"focus",n=>this._handleTextAreaFocus(n))),this._register(K(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Tu,this._document,this._helperContainer),this._instantiationService.setService(ca,this._charSizeService),this._themeService=this._instantiationService.createInstance(Bu),this._instantiationService.setService(Bs,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Tl),this._instantiationService.setService(Iy,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Nu,this.rows,this.screenElement)),this._instantiationService.setService(Ar,this._renderService),this._register(this._renderService.onRenderedViewportChange(n=>this._onRender.fire(n))),this.onResize(n=>this._renderService.resize(n.cols,n.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(Au),this._instantiationService.setService(cd,this._mouseService);let i=this._linkifier.value=this._register(this._instantiationService.createInstance(Uu,this.screenElement));this.element.appendChild(t);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(Ru,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(n=>{super.scrollLines(n,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Ou,this.element,this.screenElement,i)),this._instantiationService.setService(yE,this._selectionService),this._register(this._selectionService.onRequestScrollLines(n=>this.scrollLines(n.amount,n.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(n=>this._renderService.handleSelectionChanged(n.start,n.end,n.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(n=>{this.textarea.value=n,this.textarea.focus(),this.textarea.select()})),this._register(Ye.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var n;this._selectionService.refresh(),(n=this._viewport)==null||n.queueSync()})),this._register(this._instantiationService.createInstance(Pu,this.screenElement)),this._register(K(this.element,"mousedown",n=>this._selectionService.handleMouseDown(n))),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(Ol,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",n=>this._handleScreenReaderModeOptionChange(n))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Ll,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",n=>{!this._overviewRulerRenderer&&n&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Ll,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Lu,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function r(n){var a,h,u,d,f;let o=e._mouseService.getMouseReportCoords(n,e.screenElement);if(!o)return!1;let l,c;switch(n.overrideType||n.type){case"mousemove":c=32,n.buttons===void 0?(l=3,n.button!==void 0&&(l=n.button<3?n.button:3)):l=n.buttons&1?0:n.buttons&4?1:n.buttons&2?2:3;break;case"mouseup":c=0,l=n.button<3?n.button:3;break;case"mousedown":c=1,l=n.button<3?n.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(n)===!1)return!1;let _=n.deltaY;if(_===0||e.coreMouseService.consumeWheelEvent(n,(d=(u=(h=(a=e._renderService)==null?void 0:a.dimensions)==null?void 0:h.device)==null?void 0:u.cell)==null?void 0:d.height,(f=e._coreBrowserService)==null?void 0:f.dpr)===0)return!1;c=_<0?0:1,l=4;break;default:return!1}return c===void 0||l===void 0||l>4?!1:e.coreMouseService.triggerMouseEvent({col:o.col,row:o.row,x:o.x,y:o.y,button:l,action:c,ctrl:n.ctrlKey,alt:n.altKey,shift:n.shiftKey})}let i={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s={mouseup:n=>(r(n),n.buttons||(this._document.removeEventListener("mouseup",i.mouseup),i.mousedrag&&this._document.removeEventListener("mousemove",i.mousedrag)),this.cancel(n)),wheel:n=>(r(n),this.cancel(n,!0)),mousedrag:n=>{n.buttons&&r(n)},mousemove:n=>{n.buttons||r(n)}};this._register(this.coreMouseService.onProtocolChange(n=>{n?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(n)),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()),n&8?i.mousemove||(t.addEventListener("mousemove",s.mousemove),i.mousemove=s.mousemove):(t.removeEventListener("mousemove",i.mousemove),i.mousemove=null),n&16?i.wheel||(t.addEventListener("wheel",s.wheel,{passive:!1}),i.wheel=s.wheel):(t.removeEventListener("wheel",i.wheel),i.wheel=null),n&2?i.mouseup||(i.mouseup=s.mouseup):(this._document.removeEventListener("mouseup",i.mouseup),i.mouseup=null),n&4?i.mousedrag||(i.mousedrag=s.mousedrag):(this._document.removeEventListener("mousemove",i.mousedrag),i.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(K(t,"mousedown",n=>{if(n.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(n)))return r(n),i.mouseup&&this._document.addEventListener("mouseup",i.mouseup),i.mousedrag&&this._document.addEventListener("mousemove",i.mousedrag),this.cancel(n)})),this._register(K(t,"wheel",n=>{var o,l,c,a,h;if(!i.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(n)===!1)return!1;if(!this.buffer.hasScrollback){if(n.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(n,(a=(c=(l=(o=e._renderService)==null?void 0:o.dimensions)==null?void 0:l.device)==null?void 0:c.cell)==null?void 0:a.height,(h=e._coreBrowserService)==null?void 0:h.dpr)===0)return this.cancel(n,!0);let u=M.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(n.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(u,!0),this.cancel(n,!0)}}},{passive:!1}))}refresh(e,t){var r;(r=this._renderService)==null||r.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.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,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),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 t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){Py(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 t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}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,t,r){this._selectionService.setSelection(e,t,r)}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,t){var r;(r=this._selectionService)==null||r.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let r=JP(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),r.type===3||r.type===2){let i=this.rows-1;return this.scrollLines(r.type===2?-i:i),this.cancel(e,!0)}if(r.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(r.cancel&&this.cancel(e,!0),!r.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((r.key===M.ETX||r.key===M.CR)&&(this.textarea.value=""),this._onKey.fire({key:r.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let r=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?r:r&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(lD(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!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 t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var r;(r=this._charSizeService)==null||r.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(Re));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.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(M.ESC+"[I"):this.coreService.triggerDataEvent(M.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),r=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${M.ESC}[4;${r};${t}t`);break;case 1:let i=this._renderService.dimensions.css.cell.width.toFixed(0),s=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${M.ESC}[6;${s};${i}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function lD(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var aD=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let r={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(r),t.dispose=()=>this._wrappedAddonDispose(r),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let r=0;r<this._addons.length;r++)if(this._addons[r]===e){t=r;break}if(t===-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(t,1)}},cD=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Ot)}translateToString(e,t,r){return this._line.translateToString(e,t,r)}},a_=class{constructor(e,t){this._buffer=e,this.type=t}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 t=this._buffer.lines.get(e);if(t)return new cD(t)}getNullCell(){return new Ot}},uD=class extends G{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new z),this.onBufferChange=this._onBufferChange.event,this._normal=new a_(this._core.buffers.normal,"normal"),this._alternate=new a_(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)}},hD=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,r=>t(r.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(r,i)=>t(r,i.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},dD=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}},fD=["cols","rows"],er=0,pD=class extends G{constructor(e){super(),this._core=this._register(new oD(e)),this._addonManager=this._register(new aD),this._publicOptions={...this._core.options};let t=i=>this._core.options[i],r=(i,s)=>{this._checkReadonlyOptions(i),this._core.options[i]=s};for(let i in this._core.options){let s={get:t.bind(this,i),set:r.bind(this,i)};Object.defineProperty(this._publicOptions,i,s)}}_checkReadonlyOptions(e){if(fD.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 hD(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new dD(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 uD(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,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 t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}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,t,r){this._verifyIntegers(e,t,r),this._core.select(e,t,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}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,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
221
|
+
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}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 cu.get()},set tooMuchOutput(e){cu.set(e)}}}_verifyIntegers(...e){for(er of e)if(er===1/0||isNaN(er)||er%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(er of e)if(er&&(er===1/0||isNaN(er)||er%1!==0||er<0))throw new Error("This API only accepts positive integers")}};/**
|
|
222
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
223
|
+
* @license MIT
|
|
224
|
+
*
|
|
225
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
226
|
+
* @license MIT
|
|
227
|
+
*
|
|
228
|
+
* Originally forked from (with the author's permission):
|
|
229
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
230
|
+
* http://bellard.org/jslinux/
|
|
231
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
232
|
+
*/var _D=2,mD=1,gD=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var u;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 t=this._terminal.options.scrollback===0?0:((u=this._terminal.options.overviewRuler)==null?void 0:u.width)||14,r=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(r.getPropertyValue("height")),s=Math.max(0,parseInt(r.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},l=o.top+o.bottom,c=o.right+o.left,a=i-l,h=s-c-t;return{cols:Math.max(_D,Math.floor(h/e.css.cell.width)),rows:Math.max(mD,Math.floor(a/e.css.cell.height))}}};function vD({session:e}){const t=y.useRef(null);return y.useEffect(()=>{const r=t.current;if(!r)return;const i=new pD({fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:13,theme:{background:"#18181b"},cursorBlink:!0}),s=new gD;i.loadAddon(s),i.open(r),s.fit();const n=window.location.protocol==="https:"?"wss":"ws",o=new WebSocket(`${n}://${window.location.host}/api/terminal?sessionId=${encodeURIComponent(e.sessionId)}`),l=h=>o.readyState===WebSocket.OPEN&&o.send(JSON.stringify(h));o.onopen=()=>l({type:"resize",cols:i.cols,rows:i.rows}),o.onmessage=h=>{const u=JSON.parse(h.data);u.type==="output"&&u.data!==void 0&&i.write(u.data)},o.onclose=()=>i.write(`\r
|
|
233
|
+
\x1B[2m[disconnected]\x1B[0m\r
|
|
234
|
+
`);const c=i.onData(h=>l({type:"input",data:h})),a=new ResizeObserver(()=>{s.fit(),l({type:"resize",cols:i.cols,rows:i.rows})});return a.observe(r),()=>{a.disconnect(),c.dispose(),o.close(),i.dispose()}},[e.sessionId]),S.jsx("div",{ref:t,className:"h-full w-full bg-[#18181b] p-1"})}function yD(e){return[{id:"files",title:e("apps.files"),icon:Pg,defaultSize:{w:520,h:460},render:t=>S.jsx(rE,{...t})},{id:"editor",title:e("apps.editor"),icon:p1,defaultSize:{w:600,h:480},render:t=>S.jsx(nE,{...t})},{id:"monitor",title:e("apps.monitor"),icon:h1,defaultSize:{w:460,h:360},render:t=>S.jsx(iE,{...t})},{id:"system",title:e("apps.system"),icon:m1,defaultSize:{w:560,h:460},render:t=>S.jsx(sE,{...t})},{id:"terminal",title:e("apps.terminal"),icon:k1,defaultSize:{w:640,h:420},render:t=>S.jsx(vD,{...t})}]}function SD({t:e,session:t,onDisconnect:r}){const i=y.useMemo(()=>yD(e),[e]),s=W2(),[n,o]=y.useState(null),l=y.useCallback(u=>{o(u);const d=i.find(f=>f.id==="editor");d&&s.openApp(d)},[i,s]),c={t:e,session:t,editorTarget:n,openEditor:l},a=s.windows.filter(u=>!u.minimized),h=a.length>0?a.reduce((u,d)=>u.z>=d.z?u:d).id:null;return S.jsxs("div",{className:"flex h-screen flex-col overflow-hidden bg-background",children:[S.jsxs("div",{className:"relative min-h-0 flex-1",style:{backgroundColor:"oklch(0.16 0.006 285.8)",backgroundImage:"radial-gradient(60% 60% at 25% 15%, rgba(99,102,241,0.16), transparent 70%),radial-gradient(55% 55% at 85% 80%, rgba(56,189,248,0.10), transparent 70%)"},children:[S.jsx("div",{className:"pointer-events-none absolute top-4 left-4 text-xs font-semibold tracking-widest text-muted-foreground/60 select-none",children:"DeskSSH"}),s.windows.map(u=>{var d;return u.minimized?null:S.jsx(U2,{win:u,active:u.id===h,onFocus:()=>s.focus(u.id),onClose:()=>s.close(u.id),onMinimize:()=>s.minimize(u.id),onToggleMaximize:()=>s.toggleMaximize(u.id),onMove:(f,_)=>s.move(u.id,f,_),onResize:(f,_)=>s.resize(u.id,f,_),children:(d=i.find(f=>f.id===u.appId))==null?void 0:d.render(c)},u.id)})]}),S.jsx(G2,{t:e,apps:i,windows:s.windows,activeId:h,host:t.host,onLaunch:s.openApp,onSelectWindow:s.focus,onDisconnect:r})]})}function wD(){const e=y.useMemo(()=>r1(e1()),[]),[t,r]=y.useState(null),[i,s]=y.useState(!1),[n,o]=y.useState(null),[l,c]=y.useState(null),[a,h]=y.useState(null);function u(p){s(!0),o(null),i1(p).then(C=>{if(C.status==="verify-host-key"){h(p),c({fingerprint:C.fingerprint,algorithm:C.algorithm});return}r(C)}).catch(C=>o(C instanceof Error?C.message:String(C))).finally(()=>s(!1))}function d(){if(!a||!l)return;const p={...a,trustFingerprint:l.fingerprint};c(null),h(null),u(p)}function f(){c(null),h(null)}function _(){t&&s1(t.sessionId),r(null)}return t?S.jsx(SD,{t:e,session:t,onDisconnect:_}):S.jsxs("main",{className:"flex min-h-screen flex-col items-center gap-6 px-4 py-10",children:[S.jsx("header",{className:"text-sm font-bold tracking-wide text-muted-foreground",children:"DeskSSH"}),S.jsx(D2,{t:e,busy:i,error:n,onSubmit:u}),S.jsx($2,{t:e,prompt:l,onConfirm:d,onCancel:f})]})}const g0=document.getElementById("root");if(!g0)throw new Error("Root element #root not found");bg(g0).render(S.jsx(y.StrictMode,{children:S.jsx(wD,{})}));
|