hjworktree-cli 2.2.0 → 2.4.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.
Files changed (37) hide show
  1. package/.claude/settings.local.json +11 -2
  2. package/.context-snapshots/context-snapshot-20260106-211500.md +85 -0
  3. package/README.md +26 -10
  4. package/dist/server/socketHandlers.d.ts.map +1 -1
  5. package/dist/server/socketHandlers.js +58 -23
  6. package/dist/server/socketHandlers.js.map +1 -1
  7. package/dist/shared/constants.d.ts +1 -3
  8. package/dist/shared/constants.d.ts.map +1 -1
  9. package/dist/shared/constants.js +1 -24
  10. package/dist/shared/constants.js.map +1 -1
  11. package/dist/shared/types/index.d.ts +3 -15
  12. package/dist/shared/types/index.d.ts.map +1 -1
  13. package/dist/shared/types/index.js +1 -1
  14. package/dist/shared/types/index.js.map +1 -1
  15. package/dist/web/assets/index-D-hASqdI.js +53 -0
  16. package/dist/web/assets/index-D-hASqdI.js.map +1 -0
  17. package/dist/web/assets/index-Dgl6wRHk.css +32 -0
  18. package/dist/web/index.html +2 -2
  19. package/package.json +3 -2
  20. package/scripts/fix-pty-permissions.js +89 -0
  21. package/server/socketHandlers.ts +66 -28
  22. package/shared/constants.ts +1 -27
  23. package/shared/types/index.ts +6 -21
  24. package/web/src/App.tsx +8 -6
  25. package/web/src/components/Layout/LeftNavBar.tsx +6 -17
  26. package/web/src/components/Modals/AddWorktreeModal.tsx +1 -21
  27. package/web/src/components/Steps/WorktreeStep.tsx +1 -8
  28. package/web/src/components/Terminal/SplitTerminalView.tsx +64 -0
  29. package/web/src/components/Terminal/TerminalPanel.tsx +3 -69
  30. package/web/src/components/Terminal/XTerminal.tsx +4 -6
  31. package/web/src/stores/useAppStore.ts +77 -35
  32. package/web/src/styles/global.css +127 -77
  33. package/dist/web/assets/index-CsixHL-D.css +0 -32
  34. package/dist/web/assets/index-D8dr9mJa.js +0 -53
  35. package/dist/web/assets/index-D8dr9mJa.js.map +0 -1
  36. package/web/src/components/Setup/AgentSelector.tsx +0 -27
  37. package/web/src/components/Steps/AgentStep.tsx +0 -20
@@ -0,0 +1,53 @@
1
+ (function(){const d=document.createElement("link").relList;if(d&&d.supports&&d.supports("modulepreload"))return;for(const M of document.querySelectorAll('link[rel="modulepreload"]'))E(M);new MutationObserver(M=>{for(const U of M)if(U.type==="childList")for(const F of U.addedNodes)F.tagName==="LINK"&&F.rel==="modulepreload"&&E(F)}).observe(document,{childList:!0,subtree:!0});function h(M){const U={};return M.integrity&&(U.integrity=M.integrity),M.referrerPolicy&&(U.referrerPolicy=M.referrerPolicy),M.crossOrigin==="use-credentials"?U.credentials="include":M.crossOrigin==="anonymous"?U.credentials="omit":U.credentials="same-origin",U}function E(M){if(M.ep)return;M.ep=!0;const U=h(M);fetch(M.href,U)}})();function Bh(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var nl={exports:{}},Ki={},ol={exports:{}},ke={};/**
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 fh;function $d(){if(fh)return ke;fh=1;var y=Symbol.for("react.element"),d=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),U=Symbol.for("react.provider"),F=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),f=Symbol.iterator;function g(T){return T===null||typeof T!="object"?null:(T=f&&T[f]||T["@@iterator"],typeof T=="function"?T:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,m={};function o(T,P,Z){this.props=T,this.context=P,this.refs=m,this.updater=Z||C}o.prototype.isReactComponent={},o.prototype.setState=function(T,P){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,P,"setState")},o.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function a(){}a.prototype=o.prototype;function s(T,P,Z){this.props=T,this.context=P,this.refs=m,this.updater=Z||C}var n=s.prototype=new a;n.constructor=s,x(n,o.prototype),n.isPureReactComponent=!0;var p=Array.isArray,b=Object.prototype.hasOwnProperty,k={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function S(T,P,Z){var re,ce={},he=null,W=null;if(P!=null)for(re in P.ref!==void 0&&(W=P.ref),P.key!==void 0&&(he=""+P.key),P)b.call(P,re)&&!R.hasOwnProperty(re)&&(ce[re]=P[re]);var B=arguments.length-2;if(B===1)ce.children=Z;else if(1<B){for(var ee=Array(B),J=0;J<B;J++)ee[J]=arguments[J+2];ce.children=ee}if(T&&T.defaultProps)for(re in B=T.defaultProps,B)ce[re]===void 0&&(ce[re]=B[re]);return{$$typeof:y,type:T,key:he,ref:W,props:ce,_owner:k.current}}function A(T,P){return{$$typeof:y,type:T.type,key:P,ref:T.ref,props:T.props,_owner:T._owner}}function H(T){return typeof T=="object"&&T!==null&&T.$$typeof===y}function j(T){var P={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(Z){return P[Z]})}var $=/\/+/g;function I(T,P){return typeof T=="object"&&T!==null&&T.key!=null?j(""+T.key):P.toString(36)}function Q(T,P,Z,re,ce){var he=typeof T;(he==="undefined"||he==="boolean")&&(T=null);var W=!1;if(T===null)W=!0;else switch(he){case"string":case"number":W=!0;break;case"object":switch(T.$$typeof){case y:case d:W=!0}}if(W)return W=T,ce=ce(W),T=re===""?"."+I(W,0):re,p(ce)?(Z="",T!=null&&(Z=T.replace($,"$&/")+"/"),Q(ce,P,Z,"",function(J){return J})):ce!=null&&(H(ce)&&(ce=A(ce,Z+(!ce.key||W&&W.key===ce.key?"":(""+ce.key).replace($,"$&/")+"/")+T)),P.push(ce)),1;if(W=0,re=re===""?".":re+":",p(T))for(var B=0;B<T.length;B++){he=T[B];var ee=re+I(he,B);W+=Q(he,P,Z,ee,ce)}else if(ee=g(T),typeof ee=="function")for(T=ee.call(T),B=0;!(he=T.next()).done;)he=he.value,ee=re+I(he,B++),W+=Q(he,P,Z,ee,ce);else if(he==="object")throw P=String(T),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.");return W}function te(T,P,Z){if(T==null)return T;var re=[],ce=0;return Q(T,re,"","",function(he){return P.call(Z,he,ce++)}),re}function ne(T){if(T._status===-1){var P=T._result;P=P(),P.then(function(Z){(T._status===0||T._status===-1)&&(T._status=1,T._result=Z)},function(Z){(T._status===0||T._status===-1)&&(T._status=2,T._result=Z)}),T._status===-1&&(T._status=0,T._result=P)}if(T._status===1)return T._result.default;throw T._result}var le={current:null},G={transition:null},L={ReactCurrentDispatcher:le,ReactCurrentBatchConfig:G,ReactCurrentOwner:k};function O(){throw Error("act(...) is not supported in production builds of React.")}return ke.Children={map:te,forEach:function(T,P,Z){te(T,function(){P.apply(this,arguments)},Z)},count:function(T){var P=0;return te(T,function(){P++}),P},toArray:function(T){return te(T,function(P){return P})||[]},only:function(T){if(!H(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},ke.Component=o,ke.Fragment=h,ke.Profiler=M,ke.PureComponent=s,ke.StrictMode=E,ke.Suspense=u,ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L,ke.act=O,ke.cloneElement=function(T,P,Z){if(T==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+T+".");var re=x({},T.props),ce=T.key,he=T.ref,W=T._owner;if(P!=null){if(P.ref!==void 0&&(he=P.ref,W=k.current),P.key!==void 0&&(ce=""+P.key),T.type&&T.type.defaultProps)var B=T.type.defaultProps;for(ee in P)b.call(P,ee)&&!R.hasOwnProperty(ee)&&(re[ee]=P[ee]===void 0&&B!==void 0?B[ee]:P[ee])}var ee=arguments.length-2;if(ee===1)re.children=Z;else if(1<ee){B=Array(ee);for(var J=0;J<ee;J++)B[J]=arguments[J+2];re.children=B}return{$$typeof:y,type:T.type,key:ce,ref:he,props:re,_owner:W}},ke.createContext=function(T){return T={$$typeof:F,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},T.Provider={$$typeof:U,_context:T},T.Consumer=T},ke.createElement=S,ke.createFactory=function(T){var P=S.bind(null,T);return P.type=T,P},ke.createRef=function(){return{current:null}},ke.forwardRef=function(T){return{$$typeof:l,render:T}},ke.isValidElement=H,ke.lazy=function(T){return{$$typeof:w,_payload:{_status:-1,_result:T},_init:ne}},ke.memo=function(T,P){return{$$typeof:v,type:T,compare:P===void 0?null:P}},ke.startTransition=function(T){var P=G.transition;G.transition={};try{T()}finally{G.transition=P}},ke.unstable_act=O,ke.useCallback=function(T,P){return le.current.useCallback(T,P)},ke.useContext=function(T){return le.current.useContext(T)},ke.useDebugValue=function(){},ke.useDeferredValue=function(T){return le.current.useDeferredValue(T)},ke.useEffect=function(T,P){return le.current.useEffect(T,P)},ke.useId=function(){return le.current.useId()},ke.useImperativeHandle=function(T,P,Z){return le.current.useImperativeHandle(T,P,Z)},ke.useInsertionEffect=function(T,P){return le.current.useInsertionEffect(T,P)},ke.useLayoutEffect=function(T,P){return le.current.useLayoutEffect(T,P)},ke.useMemo=function(T,P){return le.current.useMemo(T,P)},ke.useReducer=function(T,P,Z){return le.current.useReducer(T,P,Z)},ke.useRef=function(T){return le.current.useRef(T)},ke.useState=function(T){return le.current.useState(T)},ke.useSyncExternalStore=function(T,P,Z){return le.current.useSyncExternalStore(T,P,Z)},ke.useTransition=function(){return le.current.useTransition()},ke.version="18.3.1",ke}var _h;function Cl(){return _h||(_h=1,ol.exports=$d()),ol.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var ph;function Vd(){if(ph)return Ki;ph=1;var y=Cl(),d=Symbol.for("react.element"),h=Symbol.for("react.fragment"),E=Object.prototype.hasOwnProperty,M=y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,U={key:!0,ref:!0,__self:!0,__source:!0};function F(l,u,v){var w,f={},g=null,C=null;v!==void 0&&(g=""+v),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(C=u.ref);for(w in u)E.call(u,w)&&!U.hasOwnProperty(w)&&(f[w]=u[w]);if(l&&l.defaultProps)for(w in u=l.defaultProps,u)f[w]===void 0&&(f[w]=u[w]);return{$$typeof:d,type:l,key:g,ref:C,props:f,_owner:M.current}}return Ki.Fragment=h,Ki.jsx=F,Ki.jsxs=F,Ki}var vh;function Kd(){return vh||(vh=1,nl.exports=Vd()),nl.exports}var X=Kd(),$e=Cl();const Xi=Bh($e);var nn={},ll={exports:{}},ut={},al={exports:{}},cl={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var mh;function qd(){return mh||(mh=1,(function(y){function d(G,L){var O=G.length;G.push(L);e:for(;0<O;){var T=O-1>>>1,P=G[T];if(0<M(P,L))G[T]=L,G[O]=P,O=T;else break e}}function h(G){return G.length===0?null:G[0]}function E(G){if(G.length===0)return null;var L=G[0],O=G.pop();if(O!==L){G[0]=O;e:for(var T=0,P=G.length,Z=P>>>1;T<Z;){var re=2*(T+1)-1,ce=G[re],he=re+1,W=G[he];if(0>M(ce,O))he<P&&0>M(W,ce)?(G[T]=W,G[he]=O,T=he):(G[T]=ce,G[re]=O,T=re);else if(he<P&&0>M(W,O))G[T]=W,G[he]=O,T=he;else break e}}return L}function M(G,L){var O=G.sortIndex-L.sortIndex;return O!==0?O:G.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var U=performance;y.unstable_now=function(){return U.now()}}else{var F=Date,l=F.now();y.unstable_now=function(){return F.now()-l}}var u=[],v=[],w=1,f=null,g=3,C=!1,x=!1,m=!1,o=typeof setTimeout=="function"?setTimeout:null,a=typeof clearTimeout=="function"?clearTimeout:null,s=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function n(G){for(var L=h(v);L!==null;){if(L.callback===null)E(v);else if(L.startTime<=G)E(v),L.sortIndex=L.expirationTime,d(u,L);else break;L=h(v)}}function p(G){if(m=!1,n(G),!x)if(h(u)!==null)x=!0,ne(b);else{var L=h(v);L!==null&&le(p,L.startTime-G)}}function b(G,L){x=!1,m&&(m=!1,a(S),S=-1),C=!0;var O=g;try{for(n(L),f=h(u);f!==null&&(!(f.expirationTime>L)||G&&!j());){var T=f.callback;if(typeof T=="function"){f.callback=null,g=f.priorityLevel;var P=T(f.expirationTime<=L);L=y.unstable_now(),typeof P=="function"?f.callback=P:f===h(u)&&E(u),n(L)}else E(u);f=h(u)}if(f!==null)var Z=!0;else{var re=h(v);re!==null&&le(p,re.startTime-L),Z=!1}return Z}finally{f=null,g=O,C=!1}}var k=!1,R=null,S=-1,A=5,H=-1;function j(){return!(y.unstable_now()-H<A)}function $(){if(R!==null){var G=y.unstable_now();H=G;var L=!0;try{L=R(!0,G)}finally{L?I():(k=!1,R=null)}}else k=!1}var I;if(typeof s=="function")I=function(){s($)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,te=Q.port2;Q.port1.onmessage=$,I=function(){te.postMessage(null)}}else I=function(){o($,0)};function ne(G){R=G,k||(k=!0,I())}function le(G,L){S=o(function(){G(y.unstable_now())},L)}y.unstable_IdlePriority=5,y.unstable_ImmediatePriority=1,y.unstable_LowPriority=4,y.unstable_NormalPriority=3,y.unstable_Profiling=null,y.unstable_UserBlockingPriority=2,y.unstable_cancelCallback=function(G){G.callback=null},y.unstable_continueExecution=function(){x||C||(x=!0,ne(b))},y.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<G?Math.floor(1e3/G):5},y.unstable_getCurrentPriorityLevel=function(){return g},y.unstable_getFirstCallbackNode=function(){return h(u)},y.unstable_next=function(G){switch(g){case 1:case 2:case 3:var L=3;break;default:L=g}var O=g;g=L;try{return G()}finally{g=O}},y.unstable_pauseExecution=function(){},y.unstable_requestPaint=function(){},y.unstable_runWithPriority=function(G,L){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var O=g;g=G;try{return L()}finally{g=O}},y.unstable_scheduleCallback=function(G,L,O){var T=y.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?T+O:T):O=T,G){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=O+P,G={id:w++,callback:L,priorityLevel:G,startTime:O,expirationTime:P,sortIndex:-1},O>T?(G.sortIndex=O,d(v,G),h(u)===null&&G===h(v)&&(m?(a(S),S=-1):m=!0,le(p,O-T))):(G.sortIndex=P,d(u,G),x||C||(x=!0,ne(b))),G},y.unstable_shouldYield=j,y.unstable_wrapCallback=function(G){var L=g;return function(){var O=g;g=L;try{return G.apply(this,arguments)}finally{g=O}}}})(cl)),cl}var gh;function Xd(){return gh||(gh=1,al.exports=qd()),al.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 Sh;function Gd(){if(Sh)return ut;Sh=1;var y=Cl(),d=Xd();function h(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,M={};function U(e,t){F(e,t),F(e+"Capture",t)}function F(e,t){for(M[e]=t,e=0;e<t.length;e++)E.add(t[e])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,v=/^[: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]*$/,w={},f={};function g(e){return u.call(f,e)?!0:u.call(w,e)?!1:v.test(e)?f[e]=!0:(w[e]=!0,!1)}function C(e,t,r,i){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function x(e,t,r,i){if(t===null||typeof t>"u"||C(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 m(e,t,r,i,c,_,D){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=c,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=_,this.removeEmptyString=D}var o={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){o[e]=new m(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];o[t]=new m(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){o[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){o[e]=new m(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){o[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){o[e]=new m(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){o[e]=new m(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){o[e]=new m(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){o[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)});var a=/[\-:]([a-z])/g;function s(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(a,s);o[t]=new m(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(a,s);o[t]=new m(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(a,s);o[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){o[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)}),o.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){o[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)});function n(e,t,r,i){var c=o.hasOwnProperty(t)?o[t]:null;(c!==null?c.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(x(t,r,c,i)&&(r=null),i||c===null?g(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):c.mustUseProperty?e[c.propertyName]=r===null?c.type===3?!1:"":r:(t=c.attributeName,i=c.attributeNamespace,r===null?e.removeAttribute(t):(c=c.type,r=c===3||c===4&&r===!0?"":""+r,i?e.setAttributeNS(i,t,r):e.setAttribute(t,r))))}var p=y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,b=Symbol.for("react.element"),k=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),H=Symbol.for("react.provider"),j=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),le=Symbol.for("react.offscreen"),G=Symbol.iterator;function L(e){return e===null||typeof e!="object"?null:(e=G&&e[G]||e["@@iterator"],typeof e=="function"?e:null)}var O=Object.assign,T;function P(e){if(T===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);T=t&&t[1]||""}return`
34
+ `+T+e}var Z=!1;function re(e,t){if(!e||Z)return"";Z=!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(Y){var i=Y}Reflect.construct(e,[],t)}else{try{t.call()}catch(Y){i=Y}e.call(t.prototype)}else{try{throw Error()}catch(Y){i=Y}e()}}catch(Y){if(Y&&i&&typeof Y.stack=="string"){for(var c=Y.stack.split(`
35
+ `),_=i.stack.split(`
36
+ `),D=c.length-1,N=_.length-1;1<=D&&0<=N&&c[D]!==_[N];)N--;for(;1<=D&&0<=N;D--,N--)if(c[D]!==_[N]){if(D!==1||N!==1)do if(D--,N--,0>N||c[D]!==_[N]){var z=`
37
+ `+c[D].replace(" at new "," at ");return e.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",e.displayName)),z}while(1<=D&&0<=N);break}}}finally{Z=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?P(e):""}function ce(e){switch(e.tag){case 5:return P(e.type);case 16:return P("Lazy");case 13:return P("Suspense");case 19:return P("SuspenseList");case 0:case 2:case 15:return e=re(e.type,!1),e;case 11:return e=re(e.type.render,!1),e;case 1:return e=re(e.type,!0),e;default:return""}}function he(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 R:return"Fragment";case k:return"Portal";case A:return"Profiler";case S:return"StrictMode";case I:return"Suspense";case Q:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case j:return(e.displayName||"Context")+".Consumer";case H:return(e._context.displayName||"Context")+".Provider";case $:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case te:return t=e.displayName||null,t!==null?t:he(e.type)||"Memo";case ne:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}function W(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 he(t);case 8:return t===S?"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 B(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ee(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function J(e){var t=ee(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,_=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(D){i=""+D,_.call(this,D)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(D){i=""+D},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function de(e){e._valueTracker||(e._valueTracker=J(e))}function ue(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=ee(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function Ee(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Le(e,t){var r=t.checked;return O({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Te(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=B(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 Ge(e,t){t=t.checked,t!=null&&n(e,"checked",t,!1)}function ye(e,t){Ge(e,t);var r=B(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")?Er(e,t.type,r):t.hasOwnProperty("defaultValue")&&Er(e,t.type,B(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Jt(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 Er(e,t,r){(t!=="number"||Ee(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Wt=Array.isArray;function Mt(e,t,r,i){if(e=e.options,t){t={};for(var c=0;c<r.length;c++)t["$"+r[c]]=!0;for(r=0;r<e.length;r++)c=t.hasOwnProperty("$"+e[r].value),e[r].selected!==c&&(e[r].selected=c),c&&i&&(e[r].defaultSelected=!0)}else{for(r=""+B(r),t=null,c=0;c<e.length;c++){if(e[c].value===r){e[c].selected=!0,i&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Zt(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(h(91));return O({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function rt(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(h(92));if(Wt(r)){if(1<r.length)throw Error(h(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:B(r)}}function er(e,t){var r=B(t.value),i=B(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 dt(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function tr(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 kr(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?tr(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ft,br=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,c){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,c)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ft=ft||document.createElement("div"),ft.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ft.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function nt(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var xt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ae=["Webkit","ms","Moz","O"];Object.keys(xt).forEach(function(e){Ae.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xt[t]=xt[e]})});function Yi(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||xt.hasOwnProperty(e)&&xt[e]?(""+t).trim():t+"px"}function Dl(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,c=Yi(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,c):e[r]=c}}var Gh=O({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 vn(e,t){if(t){if(Gh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(h(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(h(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(h(61))}if(t.style!=null&&typeof t.style!="object")throw Error(h(62))}}function mn(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 gn=null;function Sn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yn=null,Fr=null,jr=null;function Tl(e){if(e=Ai(e)){if(typeof yn!="function")throw Error(h(280));var t=e.stateNode;t&&(t=Ss(t),yn(e.stateNode,e.type,t))}}function Al(e){Fr?jr?jr.push(e):jr=[e]:Fr=e}function Bl(){if(Fr){var e=Fr,t=jr;if(jr=Fr=null,Tl(e),t)for(e=0;e<t.length;e++)Tl(t[e])}}function Ol(e,t){return e(t)}function Pl(){}var wn=!1;function Ml(e,t,r){if(wn)return e(t,r);wn=!0;try{return Ol(e,t,r)}finally{wn=!1,(Fr!==null||jr!==null)&&(Pl(),Bl())}}function hi(e,t){var r=e.stateNode;if(r===null)return null;var i=Ss(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(h(231,t,typeof r));return r}var Cn=!1;if(l)try{var ui={};Object.defineProperty(ui,"passive",{get:function(){Cn=!0}}),window.addEventListener("test",ui,ui),window.removeEventListener("test",ui,ui)}catch{Cn=!1}function Yh(e,t,r,i,c,_,D,N,z){var Y=Array.prototype.slice.call(arguments,3);try{t.apply(r,Y)}catch(se){this.onError(se)}}var di=!1,Qi=null,Ji=!1,En=null,Qh={onError:function(e){di=!0,Qi=e}};function Jh(e,t,r,i,c,_,D,N,z){di=!1,Qi=null,Yh.apply(Qh,arguments)}function Zh(e,t,r,i,c,_,D,N,z){if(Jh.apply(this,arguments),di){if(di){var Y=Qi;di=!1,Qi=null}else throw Error(h(198));Ji||(Ji=!0,En=Y)}}function xr(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Il(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 Nl(e){if(xr(e)!==e)throw Error(h(188))}function eu(e){var t=e.alternate;if(!t){if(t=xr(e),t===null)throw Error(h(188));return t!==e?null:e}for(var r=e,i=t;;){var c=r.return;if(c===null)break;var _=c.alternate;if(_===null){if(i=c.return,i!==null){r=i;continue}break}if(c.child===_.child){for(_=c.child;_;){if(_===r)return Nl(c),e;if(_===i)return Nl(c),t;_=_.sibling}throw Error(h(188))}if(r.return!==i.return)r=c,i=_;else{for(var D=!1,N=c.child;N;){if(N===r){D=!0,r=c,i=_;break}if(N===i){D=!0,i=c,r=_;break}N=N.sibling}if(!D){for(N=_.child;N;){if(N===r){D=!0,r=_,i=c;break}if(N===i){D=!0,i=_,r=c;break}N=N.sibling}if(!D)throw Error(h(189))}}if(r.alternate!==i)throw Error(h(190))}if(r.tag!==3)throw Error(h(188));return r.stateNode.current===r?e:t}function Hl(e){return e=eu(e),e!==null?Fl(e):null}function Fl(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Fl(e);if(t!==null)return t;e=e.sibling}return null}var jl=d.unstable_scheduleCallback,zl=d.unstable_cancelCallback,tu=d.unstable_shouldYield,ru=d.unstable_requestPaint,He=d.unstable_now,iu=d.unstable_getCurrentPriorityLevel,kn=d.unstable_ImmediatePriority,Ul=d.unstable_UserBlockingPriority,Zi=d.unstable_NormalPriority,su=d.unstable_LowPriority,Wl=d.unstable_IdlePriority,es=null,It=null;function nu(e){if(It&&typeof It.onCommitFiberRoot=="function")try{It.onCommitFiberRoot(es,e,void 0,(e.current.flags&128)===128)}catch{}}var Rt=Math.clz32?Math.clz32:au,ou=Math.log,lu=Math.LN2;function au(e){return e>>>=0,e===0?32:31-(ou(e)/lu|0)|0}var ts=64,rs=4194304;function fi(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 is(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,c=e.suspendedLanes,_=e.pingedLanes,D=r&268435455;if(D!==0){var N=D&~c;N!==0?i=fi(N):(_&=D,_!==0&&(i=fi(_)))}else D=r&~c,D!==0?i=fi(D):_!==0&&(i=fi(_));if(i===0)return 0;if(t!==0&&t!==i&&(t&c)===0&&(c=i&-i,_=t&-t,c>=_||c===16&&(_&4194240)!==0))return t;if((i&4)!==0&&(i|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)r=31-Rt(t),c=1<<r,i|=e[r],t&=~c;return i}function cu(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 hu(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,c=e.expirationTimes,_=e.pendingLanes;0<_;){var D=31-Rt(_),N=1<<D,z=c[D];z===-1?((N&r)===0||(N&i)!==0)&&(c[D]=cu(N,t)):z<=t&&(e.expiredLanes|=N),_&=~N}}function bn(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function $l(){var e=ts;return ts<<=1,(ts&4194240)===0&&(ts=64),e}function xn(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function _i(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Rt(t),e[t]=r}function uu(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<r;){var c=31-Rt(r),_=1<<c;t[c]=0,i[c]=-1,e[c]=-1,r&=~_}}function Rn(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-Rt(r),c=1<<i;c&t|e[i]&t&&(e[i]|=t),r&=~c}}var Re=0;function Vl(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Kl,Ln,ql,Xl,Gl,Dn=!1,ss=[],rr=null,ir=null,sr=null,pi=new Map,vi=new Map,nr=[],du="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 Yl(e,t){switch(e){case"focusin":case"focusout":rr=null;break;case"dragenter":case"dragleave":ir=null;break;case"mouseover":case"mouseout":sr=null;break;case"pointerover":case"pointerout":pi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vi.delete(t.pointerId)}}function mi(e,t,r,i,c,_){return e===null||e.nativeEvent!==_?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:_,targetContainers:[c]},t!==null&&(t=Ai(t),t!==null&&Ln(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function fu(e,t,r,i,c){switch(t){case"focusin":return rr=mi(rr,e,t,r,i,c),!0;case"dragenter":return ir=mi(ir,e,t,r,i,c),!0;case"mouseover":return sr=mi(sr,e,t,r,i,c),!0;case"pointerover":var _=c.pointerId;return pi.set(_,mi(pi.get(_)||null,e,t,r,i,c)),!0;case"gotpointercapture":return _=c.pointerId,vi.set(_,mi(vi.get(_)||null,e,t,r,i,c)),!0}return!1}function Ql(e){var t=Rr(e.target);if(t!==null){var r=xr(t);if(r!==null){if(t=r.tag,t===13){if(t=Il(r),t!==null){e.blockedOn=t,Gl(e.priority,function(){ql(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 ns(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=An(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);gn=i,r.target.dispatchEvent(i),gn=null}else return t=Ai(r),t!==null&&Ln(t),e.blockedOn=r,!1;t.shift()}return!0}function Jl(e,t,r){ns(e)&&r.delete(t)}function _u(){Dn=!1,rr!==null&&ns(rr)&&(rr=null),ir!==null&&ns(ir)&&(ir=null),sr!==null&&ns(sr)&&(sr=null),pi.forEach(Jl),vi.forEach(Jl)}function gi(e,t){e.blockedOn===t&&(e.blockedOn=null,Dn||(Dn=!0,d.unstable_scheduleCallback(d.unstable_NormalPriority,_u)))}function Si(e){function t(c){return gi(c,e)}if(0<ss.length){gi(ss[0],e);for(var r=1;r<ss.length;r++){var i=ss[r];i.blockedOn===e&&(i.blockedOn=null)}}for(rr!==null&&gi(rr,e),ir!==null&&gi(ir,e),sr!==null&&gi(sr,e),pi.forEach(t),vi.forEach(t),r=0;r<nr.length;r++)i=nr[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<nr.length&&(r=nr[0],r.blockedOn===null);)Ql(r),r.blockedOn===null&&nr.shift()}var zr=p.ReactCurrentBatchConfig,os=!0;function pu(e,t,r,i){var c=Re,_=zr.transition;zr.transition=null;try{Re=1,Tn(e,t,r,i)}finally{Re=c,zr.transition=_}}function vu(e,t,r,i){var c=Re,_=zr.transition;zr.transition=null;try{Re=4,Tn(e,t,r,i)}finally{Re=c,zr.transition=_}}function Tn(e,t,r,i){if(os){var c=An(e,t,r,i);if(c===null)Xn(e,t,i,ls,r),Yl(e,i);else if(fu(c,e,t,r,i))i.stopPropagation();else if(Yl(e,i),t&4&&-1<du.indexOf(e)){for(;c!==null;){var _=Ai(c);if(_!==null&&Kl(_),_=An(e,t,r,i),_===null&&Xn(e,t,i,ls,r),_===c)break;c=_}c!==null&&i.stopPropagation()}else Xn(e,t,i,null,r)}}var ls=null;function An(e,t,r,i){if(ls=null,e=Sn(i),e=Rr(e),e!==null)if(t=xr(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Il(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 ls=e,null}function Zl(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(iu()){case kn:return 1;case Ul:return 4;case Zi:case su:return 16;case Wl:return 536870912;default:return 16}default:return 16}}var or=null,Bn=null,as=null;function ea(){if(as)return as;var e,t=Bn,r=t.length,i,c="value"in or?or.value:or.textContent,_=c.length;for(e=0;e<r&&t[e]===c[e];e++);var D=r-e;for(i=1;i<=D&&t[r-i]===c[_-i];i++);return as=c.slice(e,1<i?1-i:void 0)}function cs(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 hs(){return!0}function ta(){return!1}function _t(e){function t(r,i,c,_,D){this._reactName=r,this._targetInst=c,this.type=i,this.nativeEvent=_,this.target=D,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(r=e[N],this[N]=r?r(_):_[N]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?hs:ta,this.isPropagationStopped=ta,this}return O(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=hs)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=hs)},persist:function(){},isPersistent:hs}),t}var Ur={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},On=_t(Ur),yi=O({},Ur,{view:0,detail:0}),mu=_t(yi),Pn,Mn,wi,us=O({},yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nn,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!==wi&&(wi&&e.type==="mousemove"?(Pn=e.screenX-wi.screenX,Mn=e.screenY-wi.screenY):Mn=Pn=0,wi=e),Pn)},movementY:function(e){return"movementY"in e?e.movementY:Mn}}),ra=_t(us),gu=O({},us,{dataTransfer:0}),Su=_t(gu),yu=O({},yi,{relatedTarget:0}),In=_t(yu),wu=O({},Ur,{animationName:0,elapsedTime:0,pseudoElement:0}),Cu=_t(wu),Eu=O({},Ur,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ku=_t(Eu),bu=O({},Ur,{data:0}),ia=_t(bu),xu={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ru={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"},Lu={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Du(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Lu[e])?!!t[e]:!1}function Nn(){return Du}var Tu=O({},yi,{key:function(e){if(e.key){var t=xu[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=cs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ru[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nn,charCode:function(e){return e.type==="keypress"?cs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?cs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Au=_t(Tu),Bu=O({},us,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sa=_t(Bu),Ou=O({},yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nn}),Pu=_t(Ou),Mu=O({},Ur,{propertyName:0,elapsedTime:0,pseudoElement:0}),Iu=_t(Mu),Nu=O({},us,{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}),Hu=_t(Nu),Fu=[9,13,27,32],Hn=l&&"CompositionEvent"in window,Ci=null;l&&"documentMode"in document&&(Ci=document.documentMode);var ju=l&&"TextEvent"in window&&!Ci,na=l&&(!Hn||Ci&&8<Ci&&11>=Ci),oa=" ",la=!1;function aa(e,t){switch(e){case"keyup":return Fu.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ca(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wr=!1;function zu(e,t){switch(e){case"compositionend":return ca(t);case"keypress":return t.which!==32?null:(la=!0,oa);case"textInput":return e=t.data,e===oa&&la?null:e;default:return null}}function Uu(e,t){if(Wr)return e==="compositionend"||!Hn&&aa(e,t)?(e=ea(),as=Bn=or=null,Wr=!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 na&&t.locale!=="ko"?null:t.data;default:return null}}var Wu={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 ha(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Wu[e.type]:t==="textarea"}function ua(e,t,r,i){Al(i),t=vs(t,"onChange"),0<t.length&&(r=new On("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var Ei=null,ki=null;function $u(e){Da(e,0)}function ds(e){var t=Xr(e);if(ue(t))return e}function Vu(e,t){if(e==="change")return t}var da=!1;if(l){var Fn;if(l){var jn="oninput"in document;if(!jn){var fa=document.createElement("div");fa.setAttribute("oninput","return;"),jn=typeof fa.oninput=="function"}Fn=jn}else Fn=!1;da=Fn&&(!document.documentMode||9<document.documentMode)}function _a(){Ei&&(Ei.detachEvent("onpropertychange",pa),ki=Ei=null)}function pa(e){if(e.propertyName==="value"&&ds(ki)){var t=[];ua(t,ki,e,Sn(e)),Ml($u,t)}}function Ku(e,t,r){e==="focusin"?(_a(),Ei=t,ki=r,Ei.attachEvent("onpropertychange",pa)):e==="focusout"&&_a()}function qu(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ds(ki)}function Xu(e,t){if(e==="click")return ds(t)}function Gu(e,t){if(e==="input"||e==="change")return ds(t)}function Yu(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Lt=typeof Object.is=="function"?Object.is:Yu;function bi(e,t){if(Lt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var c=r[i];if(!u.call(t,c)||!Lt(e[c],t[c]))return!1}return!0}function va(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ma(e,t){var r=va(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=va(r)}}function ga(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ga(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sa(){for(var e=window,t=Ee();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Ee(e.document)}return t}function zn(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 Qu(e){var t=Sa(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&ga(r.ownerDocument.documentElement,r)){if(i!==null&&zn(r)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var c=r.textContent.length,_=Math.min(i.start,c);i=i.end===void 0?_:Math.min(i.end,c),!e.extend&&_>i&&(c=i,i=_,_=c),c=ma(r,_);var D=ma(r,i);c&&D&&(e.rangeCount!==1||e.anchorNode!==c.node||e.anchorOffset!==c.offset||e.focusNode!==D.node||e.focusOffset!==D.offset)&&(t=t.createRange(),t.setStart(c.node,c.offset),e.removeAllRanges(),_>i?(e.addRange(t),e.extend(D.node,D.offset)):(t.setEnd(D.node,D.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 Ju=l&&"documentMode"in document&&11>=document.documentMode,$r=null,Un=null,xi=null,Wn=!1;function ya(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Wn||$r==null||$r!==Ee(i)||(i=$r,"selectionStart"in i&&zn(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}),xi&&bi(xi,i)||(xi=i,i=vs(Un,"onSelect"),0<i.length&&(t=new On("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=$r)))}function fs(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Vr={animationend:fs("Animation","AnimationEnd"),animationiteration:fs("Animation","AnimationIteration"),animationstart:fs("Animation","AnimationStart"),transitionend:fs("Transition","TransitionEnd")},$n={},wa={};l&&(wa=document.createElement("div").style,"AnimationEvent"in window||(delete Vr.animationend.animation,delete Vr.animationiteration.animation,delete Vr.animationstart.animation),"TransitionEvent"in window||delete Vr.transitionend.transition);function _s(e){if($n[e])return $n[e];if(!Vr[e])return e;var t=Vr[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in wa)return $n[e]=t[r];return e}var Ca=_s("animationend"),Ea=_s("animationiteration"),ka=_s("animationstart"),ba=_s("transitionend"),xa=new Map,Ra="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 lr(e,t){xa.set(e,t),U(t,[e])}for(var Vn=0;Vn<Ra.length;Vn++){var Kn=Ra[Vn],Zu=Kn.toLowerCase(),ed=Kn[0].toUpperCase()+Kn.slice(1);lr(Zu,"on"+ed)}lr(Ca,"onAnimationEnd"),lr(Ea,"onAnimationIteration"),lr(ka,"onAnimationStart"),lr("dblclick","onDoubleClick"),lr("focusin","onFocus"),lr("focusout","onBlur"),lr(ba,"onTransitionEnd"),F("onMouseEnter",["mouseout","mouseover"]),F("onMouseLeave",["mouseout","mouseover"]),F("onPointerEnter",["pointerout","pointerover"]),F("onPointerLeave",["pointerout","pointerover"]),U("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),U("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),U("onBeforeInput",["compositionend","keypress","textInput","paste"]),U("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),U("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),U("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ri="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(" "),td=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ri));function La(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,Zh(i,t,void 0,e),e.currentTarget=null}function Da(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],c=i.event;i=i.listeners;e:{var _=void 0;if(t)for(var D=i.length-1;0<=D;D--){var N=i[D],z=N.instance,Y=N.currentTarget;if(N=N.listener,z!==_&&c.isPropagationStopped())break e;La(c,N,Y),_=z}else for(D=0;D<i.length;D++){if(N=i[D],z=N.instance,Y=N.currentTarget,N=N.listener,z!==_&&c.isPropagationStopped())break e;La(c,N,Y),_=z}}}if(Ji)throw e=En,Ji=!1,En=null,e}function Be(e,t){var r=t[eo];r===void 0&&(r=t[eo]=new Set);var i=e+"__bubble";r.has(i)||(Ta(t,e,2,!1),r.add(i))}function qn(e,t,r){var i=0;t&&(i|=4),Ta(r,e,i,t)}var ps="_reactListening"+Math.random().toString(36).slice(2);function Li(e){if(!e[ps]){e[ps]=!0,E.forEach(function(r){r!=="selectionchange"&&(td.has(r)||qn(r,!1,e),qn(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ps]||(t[ps]=!0,qn("selectionchange",!1,t))}}function Ta(e,t,r,i){switch(Zl(t)){case 1:var c=pu;break;case 4:c=vu;break;default:c=Tn}r=c.bind(null,t,r,e),c=void 0,!Cn||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),i?c!==void 0?e.addEventListener(t,r,{capture:!0,passive:c}):e.addEventListener(t,r,!0):c!==void 0?e.addEventListener(t,r,{passive:c}):e.addEventListener(t,r,!1)}function Xn(e,t,r,i,c){var _=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var D=i.tag;if(D===3||D===4){var N=i.stateNode.containerInfo;if(N===c||N.nodeType===8&&N.parentNode===c)break;if(D===4)for(D=i.return;D!==null;){var z=D.tag;if((z===3||z===4)&&(z=D.stateNode.containerInfo,z===c||z.nodeType===8&&z.parentNode===c))return;D=D.return}for(;N!==null;){if(D=Rr(N),D===null)return;if(z=D.tag,z===5||z===6){i=_=D;continue e}N=N.parentNode}}i=i.return}Ml(function(){var Y=_,se=Sn(r),oe=[];e:{var ie=xa.get(e);if(ie!==void 0){var fe=On,pe=e;switch(e){case"keypress":if(cs(r)===0)break e;case"keydown":case"keyup":fe=Au;break;case"focusin":pe="focus",fe=In;break;case"focusout":pe="blur",fe=In;break;case"beforeblur":case"afterblur":fe=In;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=ra;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=Su;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=Pu;break;case Ca:case Ea:case ka:fe=Cu;break;case ba:fe=Iu;break;case"scroll":fe=mu;break;case"wheel":fe=Hu;break;case"copy":case"cut":case"paste":fe=ku;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=sa}var ve=(t&4)!==0,Fe=!ve&&e==="scroll",K=ve?ie!==null?ie+"Capture":null:ie;ve=[];for(var V=Y,q;V!==null;){q=V;var ae=q.stateNode;if(q.tag===5&&ae!==null&&(q=ae,K!==null&&(ae=hi(V,K),ae!=null&&ve.push(Di(V,ae,q)))),Fe)break;V=V.return}0<ve.length&&(ie=new fe(ie,pe,null,r,se),oe.push({event:ie,listeners:ve}))}}if((t&7)===0){e:{if(ie=e==="mouseover"||e==="pointerover",fe=e==="mouseout"||e==="pointerout",ie&&r!==gn&&(pe=r.relatedTarget||r.fromElement)&&(Rr(pe)||pe[$t]))break e;if((fe||ie)&&(ie=se.window===se?se:(ie=se.ownerDocument)?ie.defaultView||ie.parentWindow:window,fe?(pe=r.relatedTarget||r.toElement,fe=Y,pe=pe?Rr(pe):null,pe!==null&&(Fe=xr(pe),pe!==Fe||pe.tag!==5&&pe.tag!==6)&&(pe=null)):(fe=null,pe=Y),fe!==pe)){if(ve=ra,ae="onMouseLeave",K="onMouseEnter",V="mouse",(e==="pointerout"||e==="pointerover")&&(ve=sa,ae="onPointerLeave",K="onPointerEnter",V="pointer"),Fe=fe==null?ie:Xr(fe),q=pe==null?ie:Xr(pe),ie=new ve(ae,V+"leave",fe,r,se),ie.target=Fe,ie.relatedTarget=q,ae=null,Rr(se)===Y&&(ve=new ve(K,V+"enter",pe,r,se),ve.target=q,ve.relatedTarget=Fe,ae=ve),Fe=ae,fe&&pe)t:{for(ve=fe,K=pe,V=0,q=ve;q;q=Kr(q))V++;for(q=0,ae=K;ae;ae=Kr(ae))q++;for(;0<V-q;)ve=Kr(ve),V--;for(;0<q-V;)K=Kr(K),q--;for(;V--;){if(ve===K||K!==null&&ve===K.alternate)break t;ve=Kr(ve),K=Kr(K)}ve=null}else ve=null;fe!==null&&Aa(oe,ie,fe,ve,!1),pe!==null&&Fe!==null&&Aa(oe,Fe,pe,ve,!0)}}e:{if(ie=Y?Xr(Y):window,fe=ie.nodeName&&ie.nodeName.toLowerCase(),fe==="select"||fe==="input"&&ie.type==="file")var me=Vu;else if(ha(ie))if(da)me=Gu;else{me=qu;var ge=Ku}else(fe=ie.nodeName)&&fe.toLowerCase()==="input"&&(ie.type==="checkbox"||ie.type==="radio")&&(me=Xu);if(me&&(me=me(e,Y))){ua(oe,me,r,se);break e}ge&&ge(e,ie,Y),e==="focusout"&&(ge=ie._wrapperState)&&ge.controlled&&ie.type==="number"&&Er(ie,"number",ie.value)}switch(ge=Y?Xr(Y):window,e){case"focusin":(ha(ge)||ge.contentEditable==="true")&&($r=ge,Un=Y,xi=null);break;case"focusout":xi=Un=$r=null;break;case"mousedown":Wn=!0;break;case"contextmenu":case"mouseup":case"dragend":Wn=!1,ya(oe,r,se);break;case"selectionchange":if(Ju)break;case"keydown":case"keyup":ya(oe,r,se)}var Se;if(Hn)e:{switch(e){case"compositionstart":var we="onCompositionStart";break e;case"compositionend":we="onCompositionEnd";break e;case"compositionupdate":we="onCompositionUpdate";break e}we=void 0}else Wr?aa(e,r)&&(we="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(we="onCompositionStart");we&&(na&&r.locale!=="ko"&&(Wr||we!=="onCompositionStart"?we==="onCompositionEnd"&&Wr&&(Se=ea()):(or=se,Bn="value"in or?or.value:or.textContent,Wr=!0)),ge=vs(Y,we),0<ge.length&&(we=new ia(we,e,null,r,se),oe.push({event:we,listeners:ge}),Se?we.data=Se:(Se=ca(r),Se!==null&&(we.data=Se)))),(Se=ju?zu(e,r):Uu(e,r))&&(Y=vs(Y,"onBeforeInput"),0<Y.length&&(se=new ia("onBeforeInput","beforeinput",null,r,se),oe.push({event:se,listeners:Y}),se.data=Se))}Da(oe,t)})}function Di(e,t,r){return{instance:e,listener:t,currentTarget:r}}function vs(e,t){for(var r=t+"Capture",i=[];e!==null;){var c=e,_=c.stateNode;c.tag===5&&_!==null&&(c=_,_=hi(e,r),_!=null&&i.unshift(Di(e,_,c)),_=hi(e,t),_!=null&&i.push(Di(e,_,c))),e=e.return}return i}function Kr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Aa(e,t,r,i,c){for(var _=t._reactName,D=[];r!==null&&r!==i;){var N=r,z=N.alternate,Y=N.stateNode;if(z!==null&&z===i)break;N.tag===5&&Y!==null&&(N=Y,c?(z=hi(r,_),z!=null&&D.unshift(Di(r,z,N))):c||(z=hi(r,_),z!=null&&D.push(Di(r,z,N)))),r=r.return}D.length!==0&&e.push({event:t,listeners:D})}var rd=/\r\n?/g,id=/\u0000|\uFFFD/g;function Ba(e){return(typeof e=="string"?e:""+e).replace(rd,`
38
+ `).replace(id,"")}function ms(e,t,r){if(t=Ba(t),Ba(e)!==t&&r)throw Error(h(425))}function gs(){}var Gn=null,Yn=null;function Qn(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 Jn=typeof setTimeout=="function"?setTimeout:void 0,sd=typeof clearTimeout=="function"?clearTimeout:void 0,Oa=typeof Promise=="function"?Promise:void 0,nd=typeof queueMicrotask=="function"?queueMicrotask:typeof Oa<"u"?function(e){return Oa.resolve(null).then(e).catch(od)}:Jn;function od(e){setTimeout(function(){throw e})}function Zn(e,t){var r=t,i=0;do{var c=r.nextSibling;if(e.removeChild(r),c&&c.nodeType===8)if(r=c.data,r==="/$"){if(i===0){e.removeChild(c),Si(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=c}while(r);Si(t)}function ar(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 Pa(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 qr=Math.random().toString(36).slice(2),Nt="__reactFiber$"+qr,Ti="__reactProps$"+qr,$t="__reactContainer$"+qr,eo="__reactEvents$"+qr,ld="__reactListeners$"+qr,ad="__reactHandles$"+qr;function Rr(e){var t=e[Nt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[$t]||r[Nt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Pa(e);e!==null;){if(r=e[Nt])return r;e=Pa(e)}return t}e=r,r=e.parentNode}return null}function Ai(e){return e=e[Nt]||e[$t],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Xr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(h(33))}function Ss(e){return e[Ti]||null}var to=[],Gr=-1;function cr(e){return{current:e}}function Oe(e){0>Gr||(e.current=to[Gr],to[Gr]=null,Gr--)}function De(e,t){Gr++,to[Gr]=e.current,e.current=t}var hr={},Je=cr(hr),ot=cr(!1),Lr=hr;function Yr(e,t){var r=e.type.contextTypes;if(!r)return hr;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var c={},_;for(_ in r)c[_]=t[_];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=c),c}function lt(e){return e=e.childContextTypes,e!=null}function ys(){Oe(ot),Oe(Je)}function Ma(e,t,r){if(Je.current!==hr)throw Error(h(168));De(Je,t),De(ot,r)}function Ia(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var c in i)if(!(c in t))throw Error(h(108,W(e)||"Unknown",c));return O({},r,i)}function ws(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||hr,Lr=Je.current,De(Je,e),De(ot,ot.current),!0}function Na(e,t,r){var i=e.stateNode;if(!i)throw Error(h(169));r?(e=Ia(e,t,Lr),i.__reactInternalMemoizedMergedChildContext=e,Oe(ot),Oe(Je),De(Je,e)):Oe(ot),De(ot,r)}var Vt=null,Cs=!1,ro=!1;function Ha(e){Vt===null?Vt=[e]:Vt.push(e)}function cd(e){Cs=!0,Ha(e)}function ur(){if(!ro&&Vt!==null){ro=!0;var e=0,t=Re;try{var r=Vt;for(Re=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}Vt=null,Cs=!1}catch(c){throw Vt!==null&&(Vt=Vt.slice(e+1)),jl(kn,ur),c}finally{Re=t,ro=!1}}return null}var Qr=[],Jr=0,Es=null,ks=0,gt=[],St=0,Dr=null,Kt=1,qt="";function Tr(e,t){Qr[Jr++]=ks,Qr[Jr++]=Es,Es=e,ks=t}function Fa(e,t,r){gt[St++]=Kt,gt[St++]=qt,gt[St++]=Dr,Dr=e;var i=Kt;e=qt;var c=32-Rt(i)-1;i&=~(1<<c),r+=1;var _=32-Rt(t)+c;if(30<_){var D=c-c%5;_=(i&(1<<D)-1).toString(32),i>>=D,c-=D,Kt=1<<32-Rt(t)+c|r<<c|i,qt=_+e}else Kt=1<<_|r<<c|i,qt=e}function io(e){e.return!==null&&(Tr(e,1),Fa(e,1,0))}function so(e){for(;e===Es;)Es=Qr[--Jr],Qr[Jr]=null,ks=Qr[--Jr],Qr[Jr]=null;for(;e===Dr;)Dr=gt[--St],gt[St]=null,qt=gt[--St],gt[St]=null,Kt=gt[--St],gt[St]=null}var pt=null,vt=null,Pe=!1,Dt=null;function ja(e,t){var r=Et(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 za(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,pt=e,vt=ar(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,pt=e,vt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Dr!==null?{id:Kt,overflow:qt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Et(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,pt=e,vt=null,!0):!1;default:return!1}}function no(e){return(e.mode&1)!==0&&(e.flags&128)===0}function oo(e){if(Pe){var t=vt;if(t){var r=t;if(!za(e,t)){if(no(e))throw Error(h(418));t=ar(r.nextSibling);var i=pt;t&&za(e,t)?ja(i,r):(e.flags=e.flags&-4097|2,Pe=!1,pt=e)}}else{if(no(e))throw Error(h(418));e.flags=e.flags&-4097|2,Pe=!1,pt=e}}}function Ua(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;pt=e}function bs(e){if(e!==pt)return!1;if(!Pe)return Ua(e),Pe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Qn(e.type,e.memoizedProps)),t&&(t=vt)){if(no(e))throw Wa(),Error(h(418));for(;t;)ja(e,t),t=ar(t.nextSibling)}if(Ua(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(h(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){vt=ar(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}vt=null}}else vt=pt?ar(e.stateNode.nextSibling):null;return!0}function Wa(){for(var e=vt;e;)e=ar(e.nextSibling)}function Zr(){vt=pt=null,Pe=!1}function lo(e){Dt===null?Dt=[e]:Dt.push(e)}var hd=p.ReactCurrentBatchConfig;function Bi(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(h(309));var i=r.stateNode}if(!i)throw Error(h(147,e));var c=i,_=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===_?t.ref:(t=function(D){var N=c.refs;D===null?delete N[_]:N[_]=D},t._stringRef=_,t)}if(typeof e!="string")throw Error(h(284));if(!r._owner)throw Error(h(290,e))}return e}function xs(e,t){throw e=Object.prototype.toString.call(t),Error(h(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function $a(e){var t=e._init;return t(e._payload)}function Va(e){function t(K,V){if(e){var q=K.deletions;q===null?(K.deletions=[V],K.flags|=16):q.push(V)}}function r(K,V){if(!e)return null;for(;V!==null;)t(K,V),V=V.sibling;return null}function i(K,V){for(K=new Map;V!==null;)V.key!==null?K.set(V.key,V):K.set(V.index,V),V=V.sibling;return K}function c(K,V){return K=Sr(K,V),K.index=0,K.sibling=null,K}function _(K,V,q){return K.index=q,e?(q=K.alternate,q!==null?(q=q.index,q<V?(K.flags|=2,V):q):(K.flags|=2,V)):(K.flags|=1048576,V)}function D(K){return e&&K.alternate===null&&(K.flags|=2),K}function N(K,V,q,ae){return V===null||V.tag!==6?(V=Zo(q,K.mode,ae),V.return=K,V):(V=c(V,q),V.return=K,V)}function z(K,V,q,ae){var me=q.type;return me===R?se(K,V,q.props.children,ae,q.key):V!==null&&(V.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===ne&&$a(me)===V.type)?(ae=c(V,q.props),ae.ref=Bi(K,V,q),ae.return=K,ae):(ae=Ys(q.type,q.key,q.props,null,K.mode,ae),ae.ref=Bi(K,V,q),ae.return=K,ae)}function Y(K,V,q,ae){return V===null||V.tag!==4||V.stateNode.containerInfo!==q.containerInfo||V.stateNode.implementation!==q.implementation?(V=el(q,K.mode,ae),V.return=K,V):(V=c(V,q.children||[]),V.return=K,V)}function se(K,V,q,ae,me){return V===null||V.tag!==7?(V=Hr(q,K.mode,ae,me),V.return=K,V):(V=c(V,q),V.return=K,V)}function oe(K,V,q){if(typeof V=="string"&&V!==""||typeof V=="number")return V=Zo(""+V,K.mode,q),V.return=K,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case b:return q=Ys(V.type,V.key,V.props,null,K.mode,q),q.ref=Bi(K,null,V),q.return=K,q;case k:return V=el(V,K.mode,q),V.return=K,V;case ne:var ae=V._init;return oe(K,ae(V._payload),q)}if(Wt(V)||L(V))return V=Hr(V,K.mode,q,null),V.return=K,V;xs(K,V)}return null}function ie(K,V,q,ae){var me=V!==null?V.key:null;if(typeof q=="string"&&q!==""||typeof q=="number")return me!==null?null:N(K,V,""+q,ae);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case b:return q.key===me?z(K,V,q,ae):null;case k:return q.key===me?Y(K,V,q,ae):null;case ne:return me=q._init,ie(K,V,me(q._payload),ae)}if(Wt(q)||L(q))return me!==null?null:se(K,V,q,ae,null);xs(K,q)}return null}function fe(K,V,q,ae,me){if(typeof ae=="string"&&ae!==""||typeof ae=="number")return K=K.get(q)||null,N(V,K,""+ae,me);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case b:return K=K.get(ae.key===null?q:ae.key)||null,z(V,K,ae,me);case k:return K=K.get(ae.key===null?q:ae.key)||null,Y(V,K,ae,me);case ne:var ge=ae._init;return fe(K,V,q,ge(ae._payload),me)}if(Wt(ae)||L(ae))return K=K.get(q)||null,se(V,K,ae,me,null);xs(V,ae)}return null}function pe(K,V,q,ae){for(var me=null,ge=null,Se=V,we=V=0,Xe=null;Se!==null&&we<q.length;we++){Se.index>we?(Xe=Se,Se=null):Xe=Se.sibling;var xe=ie(K,Se,q[we],ae);if(xe===null){Se===null&&(Se=Xe);break}e&&Se&&xe.alternate===null&&t(K,Se),V=_(xe,V,we),ge===null?me=xe:ge.sibling=xe,ge=xe,Se=Xe}if(we===q.length)return r(K,Se),Pe&&Tr(K,we),me;if(Se===null){for(;we<q.length;we++)Se=oe(K,q[we],ae),Se!==null&&(V=_(Se,V,we),ge===null?me=Se:ge.sibling=Se,ge=Se);return Pe&&Tr(K,we),me}for(Se=i(K,Se);we<q.length;we++)Xe=fe(Se,K,we,q[we],ae),Xe!==null&&(e&&Xe.alternate!==null&&Se.delete(Xe.key===null?we:Xe.key),V=_(Xe,V,we),ge===null?me=Xe:ge.sibling=Xe,ge=Xe);return e&&Se.forEach(function(yr){return t(K,yr)}),Pe&&Tr(K,we),me}function ve(K,V,q,ae){var me=L(q);if(typeof me!="function")throw Error(h(150));if(q=me.call(q),q==null)throw Error(h(151));for(var ge=me=null,Se=V,we=V=0,Xe=null,xe=q.next();Se!==null&&!xe.done;we++,xe=q.next()){Se.index>we?(Xe=Se,Se=null):Xe=Se.sibling;var yr=ie(K,Se,xe.value,ae);if(yr===null){Se===null&&(Se=Xe);break}e&&Se&&yr.alternate===null&&t(K,Se),V=_(yr,V,we),ge===null?me=yr:ge.sibling=yr,ge=yr,Se=Xe}if(xe.done)return r(K,Se),Pe&&Tr(K,we),me;if(Se===null){for(;!xe.done;we++,xe=q.next())xe=oe(K,xe.value,ae),xe!==null&&(V=_(xe,V,we),ge===null?me=xe:ge.sibling=xe,ge=xe);return Pe&&Tr(K,we),me}for(Se=i(K,Se);!xe.done;we++,xe=q.next())xe=fe(Se,K,we,xe.value,ae),xe!==null&&(e&&xe.alternate!==null&&Se.delete(xe.key===null?we:xe.key),V=_(xe,V,we),ge===null?me=xe:ge.sibling=xe,ge=xe);return e&&Se.forEach(function(Wd){return t(K,Wd)}),Pe&&Tr(K,we),me}function Fe(K,V,q,ae){if(typeof q=="object"&&q!==null&&q.type===R&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case b:e:{for(var me=q.key,ge=V;ge!==null;){if(ge.key===me){if(me=q.type,me===R){if(ge.tag===7){r(K,ge.sibling),V=c(ge,q.props.children),V.return=K,K=V;break e}}else if(ge.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===ne&&$a(me)===ge.type){r(K,ge.sibling),V=c(ge,q.props),V.ref=Bi(K,ge,q),V.return=K,K=V;break e}r(K,ge);break}else t(K,ge);ge=ge.sibling}q.type===R?(V=Hr(q.props.children,K.mode,ae,q.key),V.return=K,K=V):(ae=Ys(q.type,q.key,q.props,null,K.mode,ae),ae.ref=Bi(K,V,q),ae.return=K,K=ae)}return D(K);case k:e:{for(ge=q.key;V!==null;){if(V.key===ge)if(V.tag===4&&V.stateNode.containerInfo===q.containerInfo&&V.stateNode.implementation===q.implementation){r(K,V.sibling),V=c(V,q.children||[]),V.return=K,K=V;break e}else{r(K,V);break}else t(K,V);V=V.sibling}V=el(q,K.mode,ae),V.return=K,K=V}return D(K);case ne:return ge=q._init,Fe(K,V,ge(q._payload),ae)}if(Wt(q))return pe(K,V,q,ae);if(L(q))return ve(K,V,q,ae);xs(K,q)}return typeof q=="string"&&q!==""||typeof q=="number"?(q=""+q,V!==null&&V.tag===6?(r(K,V.sibling),V=c(V,q),V.return=K,K=V):(r(K,V),V=Zo(q,K.mode,ae),V.return=K,K=V),D(K)):r(K,V)}return Fe}var ei=Va(!0),Ka=Va(!1),Rs=cr(null),Ls=null,ti=null,ao=null;function co(){ao=ti=Ls=null}function ho(e){var t=Rs.current;Oe(Rs),e._currentValue=t}function uo(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 ri(e,t){Ls=e,ao=ti=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(at=!0),e.firstContext=null)}function yt(e){var t=e._currentValue;if(ao!==e)if(e={context:e,memoizedValue:t,next:null},ti===null){if(Ls===null)throw Error(h(308));ti=e,Ls.dependencies={lanes:0,firstContext:e}}else ti=ti.next=e;return t}var Ar=null;function fo(e){Ar===null?Ar=[e]:Ar.push(e)}function qa(e,t,r,i){var c=t.interleaved;return c===null?(r.next=r,fo(t)):(r.next=c.next,c.next=r),t.interleaved=r,Xt(e,i)}function Xt(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 dr=!1;function _o(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xa(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 Gt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fr(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(be&2)!==0){var c=i.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),i.pending=t,Xt(e,r)}return c=i.interleaved,c===null?(t.next=t,fo(i)):(t.next=c.next,c.next=t),i.interleaved=t,Xt(e,r)}function Ds(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,Rn(e,r)}}function Ga(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var c=null,_=null;if(r=r.firstBaseUpdate,r!==null){do{var D={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};_===null?c=_=D:_=_.next=D,r=r.next}while(r!==null);_===null?c=_=t:_=_.next=t}else c=_=t;r={baseState:i.baseState,firstBaseUpdate:c,lastBaseUpdate:_,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 Ts(e,t,r,i){var c=e.updateQueue;dr=!1;var _=c.firstBaseUpdate,D=c.lastBaseUpdate,N=c.shared.pending;if(N!==null){c.shared.pending=null;var z=N,Y=z.next;z.next=null,D===null?_=Y:D.next=Y,D=z;var se=e.alternate;se!==null&&(se=se.updateQueue,N=se.lastBaseUpdate,N!==D&&(N===null?se.firstBaseUpdate=Y:N.next=Y,se.lastBaseUpdate=z))}if(_!==null){var oe=c.baseState;D=0,se=Y=z=null,N=_;do{var ie=N.lane,fe=N.eventTime;if((i&ie)===ie){se!==null&&(se=se.next={eventTime:fe,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var pe=e,ve=N;switch(ie=t,fe=r,ve.tag){case 1:if(pe=ve.payload,typeof pe=="function"){oe=pe.call(fe,oe,ie);break e}oe=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=ve.payload,ie=typeof pe=="function"?pe.call(fe,oe,ie):pe,ie==null)break e;oe=O({},oe,ie);break e;case 2:dr=!0}}N.callback!==null&&N.lane!==0&&(e.flags|=64,ie=c.effects,ie===null?c.effects=[N]:ie.push(N))}else fe={eventTime:fe,lane:ie,tag:N.tag,payload:N.payload,callback:N.callback,next:null},se===null?(Y=se=fe,z=oe):se=se.next=fe,D|=ie;if(N=N.next,N===null){if(N=c.shared.pending,N===null)break;ie=N,N=ie.next,ie.next=null,c.lastBaseUpdate=ie,c.shared.pending=null}}while(!0);if(se===null&&(z=oe),c.baseState=z,c.firstBaseUpdate=Y,c.lastBaseUpdate=se,t=c.shared.interleaved,t!==null){c=t;do D|=c.lane,c=c.next;while(c!==t)}else _===null&&(c.shared.lanes=0);Pr|=D,e.lanes=D,e.memoizedState=oe}}function Ya(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],c=i.callback;if(c!==null){if(i.callback=null,i=r,typeof c!="function")throw Error(h(191,c));c.call(i)}}}var Oi={},Ht=cr(Oi),Pi=cr(Oi),Mi=cr(Oi);function Br(e){if(e===Oi)throw Error(h(174));return e}function po(e,t){switch(De(Mi,t),De(Pi,e),De(Ht,Oi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:kr(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=kr(t,e)}Oe(Ht),De(Ht,t)}function ii(){Oe(Ht),Oe(Pi),Oe(Mi)}function Qa(e){Br(Mi.current);var t=Br(Ht.current),r=kr(t,e.type);t!==r&&(De(Pi,e),De(Ht,r))}function vo(e){Pi.current===e&&(Oe(Ht),Oe(Pi))}var Me=cr(0);function As(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var mo=[];function go(){for(var e=0;e<mo.length;e++)mo[e]._workInProgressVersionPrimary=null;mo.length=0}var Bs=p.ReactCurrentDispatcher,So=p.ReactCurrentBatchConfig,Or=0,Ie=null,Ue=null,Ke=null,Os=!1,Ii=!1,Ni=0,ud=0;function Ze(){throw Error(h(321))}function yo(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Lt(e[r],t[r]))return!1;return!0}function wo(e,t,r,i,c,_){if(Or=_,Ie=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Bs.current=e===null||e.memoizedState===null?pd:vd,e=r(i,c),Ii){_=0;do{if(Ii=!1,Ni=0,25<=_)throw Error(h(301));_+=1,Ke=Ue=null,t.updateQueue=null,Bs.current=md,e=r(i,c)}while(Ii)}if(Bs.current=Is,t=Ue!==null&&Ue.next!==null,Or=0,Ke=Ue=Ie=null,Os=!1,t)throw Error(h(300));return e}function Co(){var e=Ni!==0;return Ni=0,e}function Ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ke===null?Ie.memoizedState=Ke=e:Ke=Ke.next=e,Ke}function wt(){if(Ue===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=Ue.next;var t=Ke===null?Ie.memoizedState:Ke.next;if(t!==null)Ke=t,Ue=e;else{if(e===null)throw Error(h(310));Ue=e,e={memoizedState:Ue.memoizedState,baseState:Ue.baseState,baseQueue:Ue.baseQueue,queue:Ue.queue,next:null},Ke===null?Ie.memoizedState=Ke=e:Ke=Ke.next=e}return Ke}function Hi(e,t){return typeof t=="function"?t(e):t}function Eo(e){var t=wt(),r=t.queue;if(r===null)throw Error(h(311));r.lastRenderedReducer=e;var i=Ue,c=i.baseQueue,_=r.pending;if(_!==null){if(c!==null){var D=c.next;c.next=_.next,_.next=D}i.baseQueue=c=_,r.pending=null}if(c!==null){_=c.next,i=i.baseState;var N=D=null,z=null,Y=_;do{var se=Y.lane;if((Or&se)===se)z!==null&&(z=z.next={lane:0,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),i=Y.hasEagerState?Y.eagerState:e(i,Y.action);else{var oe={lane:se,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null};z===null?(N=z=oe,D=i):z=z.next=oe,Ie.lanes|=se,Pr|=se}Y=Y.next}while(Y!==null&&Y!==_);z===null?D=i:z.next=N,Lt(i,t.memoizedState)||(at=!0),t.memoizedState=i,t.baseState=D,t.baseQueue=z,r.lastRenderedState=i}if(e=r.interleaved,e!==null){c=e;do _=c.lane,Ie.lanes|=_,Pr|=_,c=c.next;while(c!==e)}else c===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function ko(e){var t=wt(),r=t.queue;if(r===null)throw Error(h(311));r.lastRenderedReducer=e;var i=r.dispatch,c=r.pending,_=t.memoizedState;if(c!==null){r.pending=null;var D=c=c.next;do _=e(_,D.action),D=D.next;while(D!==c);Lt(_,t.memoizedState)||(at=!0),t.memoizedState=_,t.baseQueue===null&&(t.baseState=_),r.lastRenderedState=_}return[_,i]}function Ja(){}function Za(e,t){var r=Ie,i=wt(),c=t(),_=!Lt(i.memoizedState,c);if(_&&(i.memoizedState=c,at=!0),i=i.queue,bo(rc.bind(null,r,i,e),[e]),i.getSnapshot!==t||_||Ke!==null&&Ke.memoizedState.tag&1){if(r.flags|=2048,Fi(9,tc.bind(null,r,i,c,t),void 0,null),qe===null)throw Error(h(349));(Or&30)!==0||ec(r,t,c)}return c}function ec(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ie.updateQueue,t===null?(t={lastEffect:null,stores:null},Ie.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function tc(e,t,r,i){t.value=r,t.getSnapshot=i,ic(t)&&sc(e)}function rc(e,t,r){return r(function(){ic(t)&&sc(e)})}function ic(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Lt(e,r)}catch{return!0}}function sc(e){var t=Xt(e,1);t!==null&&Ot(t,e,1,-1)}function nc(e){var t=Ft();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Hi,lastRenderedState:e},t.queue=e,e=e.dispatch=_d.bind(null,Ie,e),[t.memoizedState,e]}function Fi(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=Ie.updateQueue,t===null?(t={lastEffect:null,stores:null},Ie.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function oc(){return wt().memoizedState}function Ps(e,t,r,i){var c=Ft();Ie.flags|=e,c.memoizedState=Fi(1|t,r,void 0,i===void 0?null:i)}function Ms(e,t,r,i){var c=wt();i=i===void 0?null:i;var _=void 0;if(Ue!==null){var D=Ue.memoizedState;if(_=D.destroy,i!==null&&yo(i,D.deps)){c.memoizedState=Fi(t,r,_,i);return}}Ie.flags|=e,c.memoizedState=Fi(1|t,r,_,i)}function lc(e,t){return Ps(8390656,8,e,t)}function bo(e,t){return Ms(2048,8,e,t)}function ac(e,t){return Ms(4,2,e,t)}function cc(e,t){return Ms(4,4,e,t)}function hc(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 uc(e,t,r){return r=r!=null?r.concat([e]):null,Ms(4,4,hc.bind(null,t,e),r)}function xo(){}function dc(e,t){var r=wt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&yo(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function fc(e,t){var r=wt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&yo(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function _c(e,t,r){return(Or&21)===0?(e.baseState&&(e.baseState=!1,at=!0),e.memoizedState=r):(Lt(r,t)||(r=$l(),Ie.lanes|=r,Pr|=r,e.baseState=!0),t)}function dd(e,t){var r=Re;Re=r!==0&&4>r?r:4,e(!0);var i=So.transition;So.transition={};try{e(!1),t()}finally{Re=r,So.transition=i}}function pc(){return wt().memoizedState}function fd(e,t,r){var i=mr(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},vc(e))mc(t,r);else if(r=qa(e,t,r,i),r!==null){var c=st();Ot(r,e,i,c),gc(r,t,i)}}function _d(e,t,r){var i=mr(e),c={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(vc(e))mc(t,c);else{var _=e.alternate;if(e.lanes===0&&(_===null||_.lanes===0)&&(_=t.lastRenderedReducer,_!==null))try{var D=t.lastRenderedState,N=_(D,r);if(c.hasEagerState=!0,c.eagerState=N,Lt(N,D)){var z=t.interleaved;z===null?(c.next=c,fo(t)):(c.next=z.next,z.next=c),t.interleaved=c;return}}catch{}finally{}r=qa(e,t,c,i),r!==null&&(c=st(),Ot(r,e,i,c),gc(r,t,i))}}function vc(e){var t=e.alternate;return e===Ie||t!==null&&t===Ie}function mc(e,t){Ii=Os=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function gc(e,t,r){if((r&4194240)!==0){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,Rn(e,r)}}var Is={readContext:yt,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useInsertionEffect:Ze,useLayoutEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useMutableSource:Ze,useSyncExternalStore:Ze,useId:Ze,unstable_isNewReconciler:!1},pd={readContext:yt,useCallback:function(e,t){return Ft().memoizedState=[e,t===void 0?null:t],e},useContext:yt,useEffect:lc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ps(4194308,4,hc.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ps(4,2,e,t)},useMemo:function(e,t){var r=Ft();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=Ft();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=fd.bind(null,Ie,e),[i.memoizedState,e]},useRef:function(e){var t=Ft();return e={current:e},t.memoizedState=e},useState:nc,useDebugValue:xo,useDeferredValue:function(e){return Ft().memoizedState=e},useTransition:function(){var e=nc(!1),t=e[0];return e=dd.bind(null,e[1]),Ft().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=Ie,c=Ft();if(Pe){if(r===void 0)throw Error(h(407));r=r()}else{if(r=t(),qe===null)throw Error(h(349));(Or&30)!==0||ec(i,t,r)}c.memoizedState=r;var _={value:r,getSnapshot:t};return c.queue=_,lc(rc.bind(null,i,_,e),[e]),i.flags|=2048,Fi(9,tc.bind(null,i,_,r,t),void 0,null),r},useId:function(){var e=Ft(),t=qe.identifierPrefix;if(Pe){var r=qt,i=Kt;r=(i&~(1<<32-Rt(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ni++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=ud++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},vd={readContext:yt,useCallback:dc,useContext:yt,useEffect:bo,useImperativeHandle:uc,useInsertionEffect:ac,useLayoutEffect:cc,useMemo:fc,useReducer:Eo,useRef:oc,useState:function(){return Eo(Hi)},useDebugValue:xo,useDeferredValue:function(e){var t=wt();return _c(t,Ue.memoizedState,e)},useTransition:function(){var e=Eo(Hi)[0],t=wt().memoizedState;return[e,t]},useMutableSource:Ja,useSyncExternalStore:Za,useId:pc,unstable_isNewReconciler:!1},md={readContext:yt,useCallback:dc,useContext:yt,useEffect:bo,useImperativeHandle:uc,useInsertionEffect:ac,useLayoutEffect:cc,useMemo:fc,useReducer:ko,useRef:oc,useState:function(){return ko(Hi)},useDebugValue:xo,useDeferredValue:function(e){var t=wt();return Ue===null?t.memoizedState=e:_c(t,Ue.memoizedState,e)},useTransition:function(){var e=ko(Hi)[0],t=wt().memoizedState;return[e,t]},useMutableSource:Ja,useSyncExternalStore:Za,useId:pc,unstable_isNewReconciler:!1};function Tt(e,t){if(e&&e.defaultProps){t=O({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Ro(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:O({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Ns={isMounted:function(e){return(e=e._reactInternals)?xr(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=st(),c=mr(e),_=Gt(i,c);_.payload=t,r!=null&&(_.callback=r),t=fr(e,_,c),t!==null&&(Ot(t,e,c,i),Ds(t,e,c))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=st(),c=mr(e),_=Gt(i,c);_.tag=1,_.payload=t,r!=null&&(_.callback=r),t=fr(e,_,c),t!==null&&(Ot(t,e,c,i),Ds(t,e,c))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=st(),i=mr(e),c=Gt(r,i);c.tag=2,t!=null&&(c.callback=t),t=fr(e,c,i),t!==null&&(Ot(t,e,i,r),Ds(t,e,i))}};function Sc(e,t,r,i,c,_,D){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,_,D):t.prototype&&t.prototype.isPureReactComponent?!bi(r,i)||!bi(c,_):!0}function yc(e,t,r){var i=!1,c=hr,_=t.contextType;return typeof _=="object"&&_!==null?_=yt(_):(c=lt(t)?Lr:Je.current,i=t.contextTypes,_=(i=i!=null)?Yr(e,c):hr),t=new t(r,_),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ns,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=c,e.__reactInternalMemoizedMaskedChildContext=_),t}function wc(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&&Ns.enqueueReplaceState(t,t.state,null)}function Lo(e,t,r,i){var c=e.stateNode;c.props=r,c.state=e.memoizedState,c.refs={},_o(e);var _=t.contextType;typeof _=="object"&&_!==null?c.context=yt(_):(_=lt(t)?Lr:Je.current,c.context=Yr(e,_)),c.state=e.memoizedState,_=t.getDerivedStateFromProps,typeof _=="function"&&(Ro(e,t,_,r),c.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(t=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),t!==c.state&&Ns.enqueueReplaceState(c,c.state,null),Ts(e,r,c,i),c.state=e.memoizedState),typeof c.componentDidMount=="function"&&(e.flags|=4194308)}function si(e,t){try{var r="",i=t;do r+=ce(i),i=i.return;while(i);var c=r}catch(_){c=`
39
+ Error generating stack: `+_.message+`
40
+ `+_.stack}return{value:e,source:t,stack:c,digest:null}}function Do(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function To(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var gd=typeof WeakMap=="function"?WeakMap:Map;function Cc(e,t,r){r=Gt(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){$s||($s=!0,Vo=i),To(e,t)},r}function Ec(e,t,r){r=Gt(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var c=t.value;r.payload=function(){return i(c)},r.callback=function(){To(e,t)}}var _=e.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(r.callback=function(){To(e,t),typeof i!="function"&&(pr===null?pr=new Set([this]):pr.add(this));var D=t.stack;this.componentDidCatch(t.value,{componentStack:D!==null?D:""})}),r}function kc(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new gd;var c=new Set;i.set(t,c)}else c=i.get(t),c===void 0&&(c=new Set,i.set(t,c));c.has(r)||(c.add(r),e=Bd.bind(null,e,t,r),t.then(e,e))}function bc(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 xc(e,t,r,i,c){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Gt(-1,1),t.tag=2,fr(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=c,e)}var Sd=p.ReactCurrentOwner,at=!1;function it(e,t,r,i){t.child=e===null?Ka(t,null,r,i):ei(t,e.child,r,i)}function Rc(e,t,r,i,c){r=r.render;var _=t.ref;return ri(t,c),i=wo(e,t,r,i,_,c),r=Co(),e!==null&&!at?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~c,Yt(e,t,c)):(Pe&&r&&io(t),t.flags|=1,it(e,t,i,c),t.child)}function Lc(e,t,r,i,c){if(e===null){var _=r.type;return typeof _=="function"&&!Jo(_)&&_.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=_,Dc(e,t,_,i,c)):(e=Ys(r.type,null,i,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(_=e.child,(e.lanes&c)===0){var D=_.memoizedProps;if(r=r.compare,r=r!==null?r:bi,r(D,i)&&e.ref===t.ref)return Yt(e,t,c)}return t.flags|=1,e=Sr(_,i),e.ref=t.ref,e.return=t,t.child=e}function Dc(e,t,r,i,c){if(e!==null){var _=e.memoizedProps;if(bi(_,i)&&e.ref===t.ref)if(at=!1,t.pendingProps=i=_,(e.lanes&c)!==0)(e.flags&131072)!==0&&(at=!0);else return t.lanes=e.lanes,Yt(e,t,c)}return Ao(e,t,r,i,c)}function Tc(e,t,r){var i=t.pendingProps,c=i.children,_=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},De(oi,mt),mt|=r;else{if((r&1073741824)===0)return e=_!==null?_.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,De(oi,mt),mt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=_!==null?_.baseLanes:r,De(oi,mt),mt|=i}else _!==null?(i=_.baseLanes|r,t.memoizedState=null):i=r,De(oi,mt),mt|=i;return it(e,t,c,r),t.child}function Ac(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Ao(e,t,r,i,c){var _=lt(r)?Lr:Je.current;return _=Yr(t,_),ri(t,c),r=wo(e,t,r,i,_,c),i=Co(),e!==null&&!at?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~c,Yt(e,t,c)):(Pe&&i&&io(t),t.flags|=1,it(e,t,r,c),t.child)}function Bc(e,t,r,i,c){if(lt(r)){var _=!0;ws(t)}else _=!1;if(ri(t,c),t.stateNode===null)Fs(e,t),yc(t,r,i),Lo(t,r,i,c),i=!0;else if(e===null){var D=t.stateNode,N=t.memoizedProps;D.props=N;var z=D.context,Y=r.contextType;typeof Y=="object"&&Y!==null?Y=yt(Y):(Y=lt(r)?Lr:Je.current,Y=Yr(t,Y));var se=r.getDerivedStateFromProps,oe=typeof se=="function"||typeof D.getSnapshotBeforeUpdate=="function";oe||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(N!==i||z!==Y)&&wc(t,D,i,Y),dr=!1;var ie=t.memoizedState;D.state=ie,Ts(t,i,D,c),z=t.memoizedState,N!==i||ie!==z||ot.current||dr?(typeof se=="function"&&(Ro(t,r,se,i),z=t.memoizedState),(N=dr||Sc(t,r,N,i,ie,z,Y))?(oe||typeof D.UNSAFE_componentWillMount!="function"&&typeof D.componentWillMount!="function"||(typeof D.componentWillMount=="function"&&D.componentWillMount(),typeof D.UNSAFE_componentWillMount=="function"&&D.UNSAFE_componentWillMount()),typeof D.componentDidMount=="function"&&(t.flags|=4194308)):(typeof D.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=z),D.props=i,D.state=z,D.context=Y,i=N):(typeof D.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{D=t.stateNode,Xa(e,t),N=t.memoizedProps,Y=t.type===t.elementType?N:Tt(t.type,N),D.props=Y,oe=t.pendingProps,ie=D.context,z=r.contextType,typeof z=="object"&&z!==null?z=yt(z):(z=lt(r)?Lr:Je.current,z=Yr(t,z));var fe=r.getDerivedStateFromProps;(se=typeof fe=="function"||typeof D.getSnapshotBeforeUpdate=="function")||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(N!==oe||ie!==z)&&wc(t,D,i,z),dr=!1,ie=t.memoizedState,D.state=ie,Ts(t,i,D,c);var pe=t.memoizedState;N!==oe||ie!==pe||ot.current||dr?(typeof fe=="function"&&(Ro(t,r,fe,i),pe=t.memoizedState),(Y=dr||Sc(t,r,Y,i,ie,pe,z)||!1)?(se||typeof D.UNSAFE_componentWillUpdate!="function"&&typeof D.componentWillUpdate!="function"||(typeof D.componentWillUpdate=="function"&&D.componentWillUpdate(i,pe,z),typeof D.UNSAFE_componentWillUpdate=="function"&&D.UNSAFE_componentWillUpdate(i,pe,z)),typeof D.componentDidUpdate=="function"&&(t.flags|=4),typeof D.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof D.componentDidUpdate!="function"||N===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=pe),D.props=i,D.state=pe,D.context=z,i=Y):(typeof D.componentDidUpdate!="function"||N===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),i=!1)}return Bo(e,t,r,i,_,c)}function Bo(e,t,r,i,c,_){Ac(e,t);var D=(t.flags&128)!==0;if(!i&&!D)return c&&Na(t,r,!1),Yt(e,t,_);i=t.stateNode,Sd.current=t;var N=D&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&D?(t.child=ei(t,e.child,null,_),t.child=ei(t,null,N,_)):it(e,t,N,_),t.memoizedState=i.state,c&&Na(t,r,!0),t.child}function Oc(e){var t=e.stateNode;t.pendingContext?Ma(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ma(e,t.context,!1),po(e,t.containerInfo)}function Pc(e,t,r,i,c){return Zr(),lo(c),t.flags|=256,it(e,t,r,i),t.child}var Oo={dehydrated:null,treeContext:null,retryLane:0};function Po(e){return{baseLanes:e,cachePool:null,transitions:null}}function Mc(e,t,r){var i=t.pendingProps,c=Me.current,_=!1,D=(t.flags&128)!==0,N;if((N=D)||(N=e!==null&&e.memoizedState===null?!1:(c&2)!==0),N?(_=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(c|=1),De(Me,c&1),e===null)return oo(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(D=i.children,e=i.fallback,_?(i=t.mode,_=t.child,D={mode:"hidden",children:D},(i&1)===0&&_!==null?(_.childLanes=0,_.pendingProps=D):_=Qs(D,i,0,null),e=Hr(e,i,r,null),_.return=t,e.return=t,_.sibling=e,t.child=_,t.child.memoizedState=Po(r),t.memoizedState=Oo,e):Mo(t,D));if(c=e.memoizedState,c!==null&&(N=c.dehydrated,N!==null))return yd(e,t,D,i,N,c,r);if(_){_=i.fallback,D=t.mode,c=e.child,N=c.sibling;var z={mode:"hidden",children:i.children};return(D&1)===0&&t.child!==c?(i=t.child,i.childLanes=0,i.pendingProps=z,t.deletions=null):(i=Sr(c,z),i.subtreeFlags=c.subtreeFlags&14680064),N!==null?_=Sr(N,_):(_=Hr(_,D,r,null),_.flags|=2),_.return=t,i.return=t,i.sibling=_,t.child=i,i=_,_=t.child,D=e.child.memoizedState,D=D===null?Po(r):{baseLanes:D.baseLanes|r,cachePool:null,transitions:D.transitions},_.memoizedState=D,_.childLanes=e.childLanes&~r,t.memoizedState=Oo,i}return _=e.child,e=_.sibling,i=Sr(_,{mode:"visible",children:i.children}),(t.mode&1)===0&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Mo(e,t){return t=Qs({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Hs(e,t,r,i){return i!==null&&lo(i),ei(t,e.child,null,r),e=Mo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yd(e,t,r,i,c,_,D){if(r)return t.flags&256?(t.flags&=-257,i=Do(Error(h(422))),Hs(e,t,D,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(_=i.fallback,c=t.mode,i=Qs({mode:"visible",children:i.children},c,0,null),_=Hr(_,c,D,null),_.flags|=2,i.return=t,_.return=t,i.sibling=_,t.child=i,(t.mode&1)!==0&&ei(t,e.child,null,D),t.child.memoizedState=Po(D),t.memoizedState=Oo,_);if((t.mode&1)===0)return Hs(e,t,D,null);if(c.data==="$!"){if(i=c.nextSibling&&c.nextSibling.dataset,i)var N=i.dgst;return i=N,_=Error(h(419)),i=Do(_,i,void 0),Hs(e,t,D,i)}if(N=(D&e.childLanes)!==0,at||N){if(i=qe,i!==null){switch(D&-D){case 4:c=2;break;case 16:c=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:c=32;break;case 536870912:c=268435456;break;default:c=0}c=(c&(i.suspendedLanes|D))!==0?0:c,c!==0&&c!==_.retryLane&&(_.retryLane=c,Xt(e,c),Ot(i,e,c,-1))}return Qo(),i=Do(Error(h(421))),Hs(e,t,D,i)}return c.data==="$?"?(t.flags|=128,t.child=e.child,t=Od.bind(null,e),c._reactRetry=t,null):(e=_.treeContext,vt=ar(c.nextSibling),pt=t,Pe=!0,Dt=null,e!==null&&(gt[St++]=Kt,gt[St++]=qt,gt[St++]=Dr,Kt=e.id,qt=e.overflow,Dr=t),t=Mo(t,i.children),t.flags|=4096,t)}function Ic(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),uo(e.return,t,r)}function Io(e,t,r,i,c){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:c}:(_.isBackwards=t,_.rendering=null,_.renderingStartTime=0,_.last=i,_.tail=r,_.tailMode=c)}function Nc(e,t,r){var i=t.pendingProps,c=i.revealOrder,_=i.tail;if(it(e,t,i.children,r),i=Me.current,(i&2)!==0)i=i&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ic(e,r,t);else if(e.tag===19)Ic(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(De(Me,i),(t.mode&1)===0)t.memoizedState=null;else switch(c){case"forwards":for(r=t.child,c=null;r!==null;)e=r.alternate,e!==null&&As(e)===null&&(c=r),r=r.sibling;r=c,r===null?(c=t.child,t.child=null):(c=r.sibling,r.sibling=null),Io(t,!1,c,r,_);break;case"backwards":for(r=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&As(e)===null){t.child=c;break}e=c.sibling,c.sibling=r,r=c,c=e}Io(t,!0,r,null,_);break;case"together":Io(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Fs(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Yt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Pr|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(h(153));if(t.child!==null){for(e=t.child,r=Sr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Sr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function wd(e,t,r){switch(t.tag){case 3:Oc(t),Zr();break;case 5:Qa(t);break;case 1:lt(t.type)&&ws(t);break;case 4:po(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,c=t.memoizedProps.value;De(Rs,i._currentValue),i._currentValue=c;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(De(Me,Me.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?Mc(e,t,r):(De(Me,Me.current&1),e=Yt(e,t,r),e!==null?e.sibling:null);De(Me,Me.current&1);break;case 19:if(i=(r&t.childLanes)!==0,(e.flags&128)!==0){if(i)return Nc(e,t,r);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),De(Me,Me.current),i)break;return null;case 22:case 23:return t.lanes=0,Tc(e,t,r)}return Yt(e,t,r)}var Hc,No,Fc,jc;Hc=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}},No=function(){},Fc=function(e,t,r,i){var c=e.memoizedProps;if(c!==i){e=t.stateNode,Br(Ht.current);var _=null;switch(r){case"input":c=Le(e,c),i=Le(e,i),_=[];break;case"select":c=O({},c,{value:void 0}),i=O({},i,{value:void 0}),_=[];break;case"textarea":c=Zt(e,c),i=Zt(e,i),_=[];break;default:typeof c.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=gs)}vn(r,i);var D;r=null;for(Y in c)if(!i.hasOwnProperty(Y)&&c.hasOwnProperty(Y)&&c[Y]!=null)if(Y==="style"){var N=c[Y];for(D in N)N.hasOwnProperty(D)&&(r||(r={}),r[D]="")}else Y!=="dangerouslySetInnerHTML"&&Y!=="children"&&Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&Y!=="autoFocus"&&(M.hasOwnProperty(Y)?_||(_=[]):(_=_||[]).push(Y,null));for(Y in i){var z=i[Y];if(N=c!=null?c[Y]:void 0,i.hasOwnProperty(Y)&&z!==N&&(z!=null||N!=null))if(Y==="style")if(N){for(D in N)!N.hasOwnProperty(D)||z&&z.hasOwnProperty(D)||(r||(r={}),r[D]="");for(D in z)z.hasOwnProperty(D)&&N[D]!==z[D]&&(r||(r={}),r[D]=z[D])}else r||(_||(_=[]),_.push(Y,r)),r=z;else Y==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,N=N?N.__html:void 0,z!=null&&N!==z&&(_=_||[]).push(Y,z)):Y==="children"?typeof z!="string"&&typeof z!="number"||(_=_||[]).push(Y,""+z):Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&(M.hasOwnProperty(Y)?(z!=null&&Y==="onScroll"&&Be("scroll",e),_||N===z||(_=[])):(_=_||[]).push(Y,z))}r&&(_=_||[]).push("style",r);var Y=_;(t.updateQueue=Y)&&(t.flags|=4)}},jc=function(e,t,r,i){r!==i&&(t.flags|=4)};function ji(e,t){if(!Pe)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 et(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var c=e.child;c!==null;)r|=c.lanes|c.childLanes,i|=c.subtreeFlags&14680064,i|=c.flags&14680064,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)r|=c.lanes|c.childLanes,i|=c.subtreeFlags,i|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function Cd(e,t,r){var i=t.pendingProps;switch(so(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return et(t),null;case 1:return lt(t.type)&&ys(),et(t),null;case 3:return i=t.stateNode,ii(),Oe(ot),Oe(Je),go(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(bs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Dt!==null&&(Xo(Dt),Dt=null))),No(e,t),et(t),null;case 5:vo(t);var c=Br(Mi.current);if(r=t.type,e!==null&&t.stateNode!=null)Fc(e,t,r,i,c),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(h(166));return et(t),null}if(e=Br(Ht.current),bs(t)){i=t.stateNode,r=t.type;var _=t.memoizedProps;switch(i[Nt]=t,i[Ti]=_,e=(t.mode&1)!==0,r){case"dialog":Be("cancel",i),Be("close",i);break;case"iframe":case"object":case"embed":Be("load",i);break;case"video":case"audio":for(c=0;c<Ri.length;c++)Be(Ri[c],i);break;case"source":Be("error",i);break;case"img":case"image":case"link":Be("error",i),Be("load",i);break;case"details":Be("toggle",i);break;case"input":Te(i,_),Be("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!_.multiple},Be("invalid",i);break;case"textarea":rt(i,_),Be("invalid",i)}vn(r,_),c=null;for(var D in _)if(_.hasOwnProperty(D)){var N=_[D];D==="children"?typeof N=="string"?i.textContent!==N&&(_.suppressHydrationWarning!==!0&&ms(i.textContent,N,e),c=["children",N]):typeof N=="number"&&i.textContent!==""+N&&(_.suppressHydrationWarning!==!0&&ms(i.textContent,N,e),c=["children",""+N]):M.hasOwnProperty(D)&&N!=null&&D==="onScroll"&&Be("scroll",i)}switch(r){case"input":de(i),Jt(i,_,!0);break;case"textarea":de(i),dt(i);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(i.onclick=gs)}i=c,t.updateQueue=i,i!==null&&(t.flags|=4)}else{D=c.nodeType===9?c:c.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=tr(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=D.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=D.createElement(r,{is:i.is}):(e=D.createElement(r),r==="select"&&(D=e,i.multiple?D.multiple=!0:i.size&&(D.size=i.size))):e=D.createElementNS(e,r),e[Nt]=t,e[Ti]=i,Hc(e,t,!1,!1),t.stateNode=e;e:{switch(D=mn(r,i),r){case"dialog":Be("cancel",e),Be("close",e),c=i;break;case"iframe":case"object":case"embed":Be("load",e),c=i;break;case"video":case"audio":for(c=0;c<Ri.length;c++)Be(Ri[c],e);c=i;break;case"source":Be("error",e),c=i;break;case"img":case"image":case"link":Be("error",e),Be("load",e),c=i;break;case"details":Be("toggle",e),c=i;break;case"input":Te(e,i),c=Le(e,i),Be("invalid",e);break;case"option":c=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},c=O({},i,{value:void 0}),Be("invalid",e);break;case"textarea":rt(e,i),c=Zt(e,i),Be("invalid",e);break;default:c=i}vn(r,c),N=c;for(_ in N)if(N.hasOwnProperty(_)){var z=N[_];_==="style"?Dl(e,z):_==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,z!=null&&br(e,z)):_==="children"?typeof z=="string"?(r!=="textarea"||z!=="")&&nt(e,z):typeof z=="number"&&nt(e,""+z):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(M.hasOwnProperty(_)?z!=null&&_==="onScroll"&&Be("scroll",e):z!=null&&n(e,_,z,D))}switch(r){case"input":de(e),Jt(e,i,!1);break;case"textarea":de(e),dt(e);break;case"option":i.value!=null&&e.setAttribute("value",""+B(i.value));break;case"select":e.multiple=!!i.multiple,_=i.value,_!=null?Mt(e,!!i.multiple,_,!1):i.defaultValue!=null&&Mt(e,!!i.multiple,i.defaultValue,!0);break;default:typeof c.onClick=="function"&&(e.onclick=gs)}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 et(t),null;case 6:if(e&&t.stateNode!=null)jc(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(h(166));if(r=Br(Mi.current),Br(Ht.current),bs(t)){if(i=t.stateNode,r=t.memoizedProps,i[Nt]=t,(_=i.nodeValue!==r)&&(e=pt,e!==null))switch(e.tag){case 3:ms(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ms(i.nodeValue,r,(e.mode&1)!==0)}_&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[Nt]=t,t.stateNode=i}return et(t),null;case 13:if(Oe(Me),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Pe&&vt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Wa(),Zr(),t.flags|=98560,_=!1;else if(_=bs(t),i!==null&&i.dehydrated!==null){if(e===null){if(!_)throw Error(h(318));if(_=t.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(h(317));_[Nt]=t}else Zr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;et(t),_=!1}else Dt!==null&&(Xo(Dt),Dt=null),_=!0;if(!_)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Me.current&1)!==0?We===0&&(We=3):Qo())),t.updateQueue!==null&&(t.flags|=4),et(t),null);case 4:return ii(),No(e,t),e===null&&Li(t.stateNode.containerInfo),et(t),null;case 10:return ho(t.type._context),et(t),null;case 17:return lt(t.type)&&ys(),et(t),null;case 19:if(Oe(Me),_=t.memoizedState,_===null)return et(t),null;if(i=(t.flags&128)!==0,D=_.rendering,D===null)if(i)ji(_,!1);else{if(We!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(D=As(e),D!==null){for(t.flags|=128,ji(_,!1),i=D.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)_=r,e=i,_.flags&=14680066,D=_.alternate,D===null?(_.childLanes=0,_.lanes=e,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=D.childLanes,_.lanes=D.lanes,_.child=D.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=D.memoizedProps,_.memoizedState=D.memoizedState,_.updateQueue=D.updateQueue,_.type=D.type,e=D.dependencies,_.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return De(Me,Me.current&1|2),t.child}e=e.sibling}_.tail!==null&&He()>li&&(t.flags|=128,i=!0,ji(_,!1),t.lanes=4194304)}else{if(!i)if(e=As(D),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ji(_,!0),_.tail===null&&_.tailMode==="hidden"&&!D.alternate&&!Pe)return et(t),null}else 2*He()-_.renderingStartTime>li&&r!==1073741824&&(t.flags|=128,i=!0,ji(_,!1),t.lanes=4194304);_.isBackwards?(D.sibling=t.child,t.child=D):(r=_.last,r!==null?r.sibling=D:t.child=D,_.last=D)}return _.tail!==null?(t=_.tail,_.rendering=t,_.tail=t.sibling,_.renderingStartTime=He(),t.sibling=null,r=Me.current,De(Me,i?r&1|2:r&1),t):(et(t),null);case 22:case 23:return Yo(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&(t.mode&1)!==0?(mt&1073741824)!==0&&(et(t),t.subtreeFlags&6&&(t.flags|=8192)):et(t),null;case 24:return null;case 25:return null}throw Error(h(156,t.tag))}function Ed(e,t){switch(so(t),t.tag){case 1:return lt(t.type)&&ys(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ii(),Oe(ot),Oe(Je),go(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return vo(t),null;case 13:if(Oe(Me),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(h(340));Zr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Oe(Me),null;case 4:return ii(),null;case 10:return ho(t.type._context),null;case 22:case 23:return Yo(),null;case 24:return null;default:return null}}var js=!1,tt=!1,kd=typeof WeakSet=="function"?WeakSet:Set,_e=null;function ni(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){Ne(e,t,i)}else r.current=null}function Ho(e,t,r){try{r()}catch(i){Ne(e,t,i)}}var zc=!1;function bd(e,t){if(Gn=os,e=Sa(),zn(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var c=i.anchorOffset,_=i.focusNode;i=i.focusOffset;try{r.nodeType,_.nodeType}catch{r=null;break e}var D=0,N=-1,z=-1,Y=0,se=0,oe=e,ie=null;t:for(;;){for(var fe;oe!==r||c!==0&&oe.nodeType!==3||(N=D+c),oe!==_||i!==0&&oe.nodeType!==3||(z=D+i),oe.nodeType===3&&(D+=oe.nodeValue.length),(fe=oe.firstChild)!==null;)ie=oe,oe=fe;for(;;){if(oe===e)break t;if(ie===r&&++Y===c&&(N=D),ie===_&&++se===i&&(z=D),(fe=oe.nextSibling)!==null)break;oe=ie,ie=oe.parentNode}oe=fe}r=N===-1||z===-1?null:{start:N,end:z}}else r=null}r=r||{start:0,end:0}}else r=null;for(Yn={focusedElem:e,selectionRange:r},os=!1,_e=t;_e!==null;)if(t=_e,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_e=e;else for(;_e!==null;){t=_e;try{var pe=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(pe!==null){var ve=pe.memoizedProps,Fe=pe.memoizedState,K=t.stateNode,V=K.getSnapshotBeforeUpdate(t.elementType===t.type?ve:Tt(t.type,ve),Fe);K.__reactInternalSnapshotBeforeUpdate=V}break;case 3:var q=t.stateNode.containerInfo;q.nodeType===1?q.textContent="":q.nodeType===9&&q.documentElement&&q.removeChild(q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(h(163))}}catch(ae){Ne(t,t.return,ae)}if(e=t.sibling,e!==null){e.return=t.return,_e=e;break}_e=t.return}return pe=zc,zc=!1,pe}function zi(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var c=i=i.next;do{if((c.tag&e)===e){var _=c.destroy;c.destroy=void 0,_!==void 0&&Ho(t,r,_)}c=c.next}while(c!==i)}}function zs(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 Fo(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 Uc(e){var t=e.alternate;t!==null&&(e.alternate=null,Uc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Nt],delete t[Ti],delete t[eo],delete t[ld],delete t[ad])),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 Wc(e){return e.tag===5||e.tag===3||e.tag===4}function $c(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Wc(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 jo(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=gs));else if(i!==4&&(e=e.child,e!==null))for(jo(e,t,r),e=e.sibling;e!==null;)jo(e,t,r),e=e.sibling}function zo(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(zo(e,t,r),e=e.sibling;e!==null;)zo(e,t,r),e=e.sibling}var Ye=null,At=!1;function _r(e,t,r){for(r=r.child;r!==null;)Vc(e,t,r),r=r.sibling}function Vc(e,t,r){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(es,r)}catch{}switch(r.tag){case 5:tt||ni(r,t);case 6:var i=Ye,c=At;Ye=null,_r(e,t,r),Ye=i,At=c,Ye!==null&&(At?(e=Ye,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ye.removeChild(r.stateNode));break;case 18:Ye!==null&&(At?(e=Ye,r=r.stateNode,e.nodeType===8?Zn(e.parentNode,r):e.nodeType===1&&Zn(e,r),Si(e)):Zn(Ye,r.stateNode));break;case 4:i=Ye,c=At,Ye=r.stateNode.containerInfo,At=!0,_r(e,t,r),Ye=i,At=c;break;case 0:case 11:case 14:case 15:if(!tt&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){c=i=i.next;do{var _=c,D=_.destroy;_=_.tag,D!==void 0&&((_&2)!==0||(_&4)!==0)&&Ho(r,t,D),c=c.next}while(c!==i)}_r(e,t,r);break;case 1:if(!tt&&(ni(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(N){Ne(r,t,N)}_r(e,t,r);break;case 21:_r(e,t,r);break;case 22:r.mode&1?(tt=(i=tt)||r.memoizedState!==null,_r(e,t,r),tt=i):_r(e,t,r);break;default:_r(e,t,r)}}function Kc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new kd),t.forEach(function(i){var c=Pd.bind(null,e,i);r.has(i)||(r.add(i),i.then(c,c))})}}function Bt(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var c=r[i];try{var _=e,D=t,N=D;e:for(;N!==null;){switch(N.tag){case 5:Ye=N.stateNode,At=!1;break e;case 3:Ye=N.stateNode.containerInfo,At=!0;break e;case 4:Ye=N.stateNode.containerInfo,At=!0;break e}N=N.return}if(Ye===null)throw Error(h(160));Vc(_,D,c),Ye=null,At=!1;var z=c.alternate;z!==null&&(z.return=null),c.return=null}catch(Y){Ne(c,t,Y)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)qc(t,e),t=t.sibling}function qc(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Bt(t,e),jt(e),i&4){try{zi(3,e,e.return),zs(3,e)}catch(ve){Ne(e,e.return,ve)}try{zi(5,e,e.return)}catch(ve){Ne(e,e.return,ve)}}break;case 1:Bt(t,e),jt(e),i&512&&r!==null&&ni(r,r.return);break;case 5:if(Bt(t,e),jt(e),i&512&&r!==null&&ni(r,r.return),e.flags&32){var c=e.stateNode;try{nt(c,"")}catch(ve){Ne(e,e.return,ve)}}if(i&4&&(c=e.stateNode,c!=null)){var _=e.memoizedProps,D=r!==null?r.memoizedProps:_,N=e.type,z=e.updateQueue;if(e.updateQueue=null,z!==null)try{N==="input"&&_.type==="radio"&&_.name!=null&&Ge(c,_),mn(N,D);var Y=mn(N,_);for(D=0;D<z.length;D+=2){var se=z[D],oe=z[D+1];se==="style"?Dl(c,oe):se==="dangerouslySetInnerHTML"?br(c,oe):se==="children"?nt(c,oe):n(c,se,oe,Y)}switch(N){case"input":ye(c,_);break;case"textarea":er(c,_);break;case"select":var ie=c._wrapperState.wasMultiple;c._wrapperState.wasMultiple=!!_.multiple;var fe=_.value;fe!=null?Mt(c,!!_.multiple,fe,!1):ie!==!!_.multiple&&(_.defaultValue!=null?Mt(c,!!_.multiple,_.defaultValue,!0):Mt(c,!!_.multiple,_.multiple?[]:"",!1))}c[Ti]=_}catch(ve){Ne(e,e.return,ve)}}break;case 6:if(Bt(t,e),jt(e),i&4){if(e.stateNode===null)throw Error(h(162));c=e.stateNode,_=e.memoizedProps;try{c.nodeValue=_}catch(ve){Ne(e,e.return,ve)}}break;case 3:if(Bt(t,e),jt(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Si(t.containerInfo)}catch(ve){Ne(e,e.return,ve)}break;case 4:Bt(t,e),jt(e);break;case 13:Bt(t,e),jt(e),c=e.child,c.flags&8192&&(_=c.memoizedState!==null,c.stateNode.isHidden=_,!_||c.alternate!==null&&c.alternate.memoizedState!==null||($o=He())),i&4&&Kc(e);break;case 22:if(se=r!==null&&r.memoizedState!==null,e.mode&1?(tt=(Y=tt)||se,Bt(t,e),tt=Y):Bt(t,e),jt(e),i&8192){if(Y=e.memoizedState!==null,(e.stateNode.isHidden=Y)&&!se&&(e.mode&1)!==0)for(_e=e,se=e.child;se!==null;){for(oe=_e=se;_e!==null;){switch(ie=_e,fe=ie.child,ie.tag){case 0:case 11:case 14:case 15:zi(4,ie,ie.return);break;case 1:ni(ie,ie.return);var pe=ie.stateNode;if(typeof pe.componentWillUnmount=="function"){i=ie,r=ie.return;try{t=i,pe.props=t.memoizedProps,pe.state=t.memoizedState,pe.componentWillUnmount()}catch(ve){Ne(i,r,ve)}}break;case 5:ni(ie,ie.return);break;case 22:if(ie.memoizedState!==null){Yc(oe);continue}}fe!==null?(fe.return=ie,_e=fe):Yc(oe)}se=se.sibling}e:for(se=null,oe=e;;){if(oe.tag===5){if(se===null){se=oe;try{c=oe.stateNode,Y?(_=c.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(N=oe.stateNode,z=oe.memoizedProps.style,D=z!=null&&z.hasOwnProperty("display")?z.display:null,N.style.display=Yi("display",D))}catch(ve){Ne(e,e.return,ve)}}}else if(oe.tag===6){if(se===null)try{oe.stateNode.nodeValue=Y?"":oe.memoizedProps}catch(ve){Ne(e,e.return,ve)}}else if((oe.tag!==22&&oe.tag!==23||oe.memoizedState===null||oe===e)&&oe.child!==null){oe.child.return=oe,oe=oe.child;continue}if(oe===e)break e;for(;oe.sibling===null;){if(oe.return===null||oe.return===e)break e;se===oe&&(se=null),oe=oe.return}se===oe&&(se=null),oe.sibling.return=oe.return,oe=oe.sibling}}break;case 19:Bt(t,e),jt(e),i&4&&Kc(e);break;case 21:break;default:Bt(t,e),jt(e)}}function jt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Wc(r)){var i=r;break e}r=r.return}throw Error(h(160))}switch(i.tag){case 5:var c=i.stateNode;i.flags&32&&(nt(c,""),i.flags&=-33);var _=$c(e);zo(e,_,c);break;case 3:case 4:var D=i.stateNode.containerInfo,N=$c(e);jo(e,N,D);break;default:throw Error(h(161))}}catch(z){Ne(e,e.return,z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xd(e,t,r){_e=e,Xc(e)}function Xc(e,t,r){for(var i=(e.mode&1)!==0;_e!==null;){var c=_e,_=c.child;if(c.tag===22&&i){var D=c.memoizedState!==null||js;if(!D){var N=c.alternate,z=N!==null&&N.memoizedState!==null||tt;N=js;var Y=tt;if(js=D,(tt=z)&&!Y)for(_e=c;_e!==null;)D=_e,z=D.child,D.tag===22&&D.memoizedState!==null?Qc(c):z!==null?(z.return=D,_e=z):Qc(c);for(;_!==null;)_e=_,Xc(_),_=_.sibling;_e=c,js=N,tt=Y}Gc(e)}else(c.subtreeFlags&8772)!==0&&_!==null?(_.return=c,_e=_):Gc(e)}}function Gc(e){for(;_e!==null;){var t=_e;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:tt||zs(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!tt)if(r===null)i.componentDidMount();else{var c=t.elementType===t.type?r.memoizedProps:Tt(t.type,r.memoizedProps);i.componentDidUpdate(c,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var _=t.updateQueue;_!==null&&Ya(t,_,i);break;case 3:var D=t.updateQueue;if(D!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Ya(t,D,r)}break;case 5:var N=t.stateNode;if(r===null&&t.flags&4){r=N;var z=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":z.autoFocus&&r.focus();break;case"img":z.src&&(r.src=z.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var Y=t.alternate;if(Y!==null){var se=Y.memoizedState;if(se!==null){var oe=se.dehydrated;oe!==null&&Si(oe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(h(163))}tt||t.flags&512&&Fo(t)}catch(ie){Ne(t,t.return,ie)}}if(t===e){_e=null;break}if(r=t.sibling,r!==null){r.return=t.return,_e=r;break}_e=t.return}}function Yc(e){for(;_e!==null;){var t=_e;if(t===e){_e=null;break}var r=t.sibling;if(r!==null){r.return=t.return,_e=r;break}_e=t.return}}function Qc(e){for(;_e!==null;){var t=_e;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{zs(4,t)}catch(z){Ne(t,r,z)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var c=t.return;try{i.componentDidMount()}catch(z){Ne(t,c,z)}}var _=t.return;try{Fo(t)}catch(z){Ne(t,_,z)}break;case 5:var D=t.return;try{Fo(t)}catch(z){Ne(t,D,z)}}}catch(z){Ne(t,t.return,z)}if(t===e){_e=null;break}var N=t.sibling;if(N!==null){N.return=t.return,_e=N;break}_e=t.return}}var Rd=Math.ceil,Us=p.ReactCurrentDispatcher,Uo=p.ReactCurrentOwner,Ct=p.ReactCurrentBatchConfig,be=0,qe=null,je=null,Qe=0,mt=0,oi=cr(0),We=0,Ui=null,Pr=0,Ws=0,Wo=0,Wi=null,ct=null,$o=0,li=1/0,Qt=null,$s=!1,Vo=null,pr=null,Vs=!1,vr=null,Ks=0,$i=0,Ko=null,qs=-1,Xs=0;function st(){return(be&6)!==0?He():qs!==-1?qs:qs=He()}function mr(e){return(e.mode&1)===0?1:(be&2)!==0&&Qe!==0?Qe&-Qe:hd.transition!==null?(Xs===0&&(Xs=$l()),Xs):(e=Re,e!==0||(e=window.event,e=e===void 0?16:Zl(e.type)),e)}function Ot(e,t,r,i){if(50<$i)throw $i=0,Ko=null,Error(h(185));_i(e,r,i),((be&2)===0||e!==qe)&&(e===qe&&((be&2)===0&&(Ws|=r),We===4&&gr(e,Qe)),ht(e,i),r===1&&be===0&&(t.mode&1)===0&&(li=He()+500,Cs&&ur()))}function ht(e,t){var r=e.callbackNode;hu(e,t);var i=is(e,e===qe?Qe:0);if(i===0)r!==null&&zl(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&zl(r),t===1)e.tag===0?cd(Zc.bind(null,e)):Ha(Zc.bind(null,e)),nd(function(){(be&6)===0&&ur()}),r=null;else{switch(Vl(i)){case 1:r=kn;break;case 4:r=Ul;break;case 16:r=Zi;break;case 536870912:r=Wl;break;default:r=Zi}r=lh(r,Jc.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Jc(e,t){if(qs=-1,Xs=0,(be&6)!==0)throw Error(h(327));var r=e.callbackNode;if(ai()&&e.callbackNode!==r)return null;var i=is(e,e===qe?Qe:0);if(i===0)return null;if((i&30)!==0||(i&e.expiredLanes)!==0||t)t=Gs(e,i);else{t=i;var c=be;be|=2;var _=th();(qe!==e||Qe!==t)&&(Qt=null,li=He()+500,Ir(e,t));do try{Td();break}catch(N){eh(e,N)}while(!0);co(),Us.current=_,be=c,je!==null?t=0:(qe=null,Qe=0,t=We)}if(t!==0){if(t===2&&(c=bn(e),c!==0&&(i=c,t=qo(e,c))),t===1)throw r=Ui,Ir(e,0),gr(e,i),ht(e,He()),r;if(t===6)gr(e,i);else{if(c=e.current.alternate,(i&30)===0&&!Ld(c)&&(t=Gs(e,i),t===2&&(_=bn(e),_!==0&&(i=_,t=qo(e,_))),t===1))throw r=Ui,Ir(e,0),gr(e,i),ht(e,He()),r;switch(e.finishedWork=c,e.finishedLanes=i,t){case 0:case 1:throw Error(h(345));case 2:Nr(e,ct,Qt);break;case 3:if(gr(e,i),(i&130023424)===i&&(t=$o+500-He(),10<t)){if(is(e,0)!==0)break;if(c=e.suspendedLanes,(c&i)!==i){st(),e.pingedLanes|=e.suspendedLanes&c;break}e.timeoutHandle=Jn(Nr.bind(null,e,ct,Qt),t);break}Nr(e,ct,Qt);break;case 4:if(gr(e,i),(i&4194240)===i)break;for(t=e.eventTimes,c=-1;0<i;){var D=31-Rt(i);_=1<<D,D=t[D],D>c&&(c=D),i&=~_}if(i=c,i=He()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Rd(i/1960))-i,10<i){e.timeoutHandle=Jn(Nr.bind(null,e,ct,Qt),i);break}Nr(e,ct,Qt);break;case 5:Nr(e,ct,Qt);break;default:throw Error(h(329))}}}return ht(e,He()),e.callbackNode===r?Jc.bind(null,e):null}function qo(e,t){var r=Wi;return e.current.memoizedState.isDehydrated&&(Ir(e,t).flags|=256),e=Gs(e,t),e!==2&&(t=ct,ct=r,t!==null&&Xo(t)),e}function Xo(e){ct===null?ct=e:ct.push.apply(ct,e)}function Ld(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var c=r[i],_=c.getSnapshot;c=c.value;try{if(!Lt(_(),c))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function gr(e,t){for(t&=~Wo,t&=~Ws,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Rt(t),i=1<<r;e[r]=-1,t&=~i}}function Zc(e){if((be&6)!==0)throw Error(h(327));ai();var t=is(e,0);if((t&1)===0)return ht(e,He()),null;var r=Gs(e,t);if(e.tag!==0&&r===2){var i=bn(e);i!==0&&(t=i,r=qo(e,i))}if(r===1)throw r=Ui,Ir(e,0),gr(e,t),ht(e,He()),r;if(r===6)throw Error(h(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Nr(e,ct,Qt),ht(e,He()),null}function Go(e,t){var r=be;be|=1;try{return e(t)}finally{be=r,be===0&&(li=He()+500,Cs&&ur())}}function Mr(e){vr!==null&&vr.tag===0&&(be&6)===0&&ai();var t=be;be|=1;var r=Ct.transition,i=Re;try{if(Ct.transition=null,Re=1,e)return e()}finally{Re=i,Ct.transition=r,be=t,(be&6)===0&&ur()}}function Yo(){mt=oi.current,Oe(oi)}function Ir(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,sd(r)),je!==null)for(r=je.return;r!==null;){var i=r;switch(so(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&ys();break;case 3:ii(),Oe(ot),Oe(Je),go();break;case 5:vo(i);break;case 4:ii();break;case 13:Oe(Me);break;case 19:Oe(Me);break;case 10:ho(i.type._context);break;case 22:case 23:Yo()}r=r.return}if(qe=e,je=e=Sr(e.current,null),Qe=mt=t,We=0,Ui=null,Wo=Ws=Pr=0,ct=Wi=null,Ar!==null){for(t=0;t<Ar.length;t++)if(r=Ar[t],i=r.interleaved,i!==null){r.interleaved=null;var c=i.next,_=r.pending;if(_!==null){var D=_.next;_.next=c,i.next=D}r.pending=i}Ar=null}return e}function eh(e,t){do{var r=je;try{if(co(),Bs.current=Is,Os){for(var i=Ie.memoizedState;i!==null;){var c=i.queue;c!==null&&(c.pending=null),i=i.next}Os=!1}if(Or=0,Ke=Ue=Ie=null,Ii=!1,Ni=0,Uo.current=null,r===null||r.return===null){We=1,Ui=t,je=null;break}e:{var _=e,D=r.return,N=r,z=t;if(t=Qe,N.flags|=32768,z!==null&&typeof z=="object"&&typeof z.then=="function"){var Y=z,se=N,oe=se.tag;if((se.mode&1)===0&&(oe===0||oe===11||oe===15)){var ie=se.alternate;ie?(se.updateQueue=ie.updateQueue,se.memoizedState=ie.memoizedState,se.lanes=ie.lanes):(se.updateQueue=null,se.memoizedState=null)}var fe=bc(D);if(fe!==null){fe.flags&=-257,xc(fe,D,N,_,t),fe.mode&1&&kc(_,Y,t),t=fe,z=Y;var pe=t.updateQueue;if(pe===null){var ve=new Set;ve.add(z),t.updateQueue=ve}else pe.add(z);break e}else{if((t&1)===0){kc(_,Y,t),Qo();break e}z=Error(h(426))}}else if(Pe&&N.mode&1){var Fe=bc(D);if(Fe!==null){(Fe.flags&65536)===0&&(Fe.flags|=256),xc(Fe,D,N,_,t),lo(si(z,N));break e}}_=z=si(z,N),We!==4&&(We=2),Wi===null?Wi=[_]:Wi.push(_),_=D;do{switch(_.tag){case 3:_.flags|=65536,t&=-t,_.lanes|=t;var K=Cc(_,z,t);Ga(_,K);break e;case 1:N=z;var V=_.type,q=_.stateNode;if((_.flags&128)===0&&(typeof V.getDerivedStateFromError=="function"||q!==null&&typeof q.componentDidCatch=="function"&&(pr===null||!pr.has(q)))){_.flags|=65536,t&=-t,_.lanes|=t;var ae=Ec(_,N,t);Ga(_,ae);break e}}_=_.return}while(_!==null)}ih(r)}catch(me){t=me,je===r&&r!==null&&(je=r=r.return);continue}break}while(!0)}function th(){var e=Us.current;return Us.current=Is,e===null?Is:e}function Qo(){(We===0||We===3||We===2)&&(We=4),qe===null||(Pr&268435455)===0&&(Ws&268435455)===0||gr(qe,Qe)}function Gs(e,t){var r=be;be|=2;var i=th();(qe!==e||Qe!==t)&&(Qt=null,Ir(e,t));do try{Dd();break}catch(c){eh(e,c)}while(!0);if(co(),be=r,Us.current=i,je!==null)throw Error(h(261));return qe=null,Qe=0,We}function Dd(){for(;je!==null;)rh(je)}function Td(){for(;je!==null&&!tu();)rh(je)}function rh(e){var t=oh(e.alternate,e,mt);e.memoizedProps=e.pendingProps,t===null?ih(e):je=t,Uo.current=null}function ih(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=Cd(r,t,mt),r!==null){je=r;return}}else{if(r=Ed(r,t),r!==null){r.flags&=32767,je=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{We=6,je=null;return}}if(t=t.sibling,t!==null){je=t;return}je=t=e}while(t!==null);We===0&&(We=5)}function Nr(e,t,r){var i=Re,c=Ct.transition;try{Ct.transition=null,Re=1,Ad(e,t,r,i)}finally{Ct.transition=c,Re=i}return null}function Ad(e,t,r,i){do ai();while(vr!==null);if((be&6)!==0)throw Error(h(327));r=e.finishedWork;var c=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(h(177));e.callbackNode=null,e.callbackPriority=0;var _=r.lanes|r.childLanes;if(uu(e,_),e===qe&&(je=qe=null,Qe=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||Vs||(Vs=!0,lh(Zi,function(){return ai(),null})),_=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||_){_=Ct.transition,Ct.transition=null;var D=Re;Re=1;var N=be;be|=4,Uo.current=null,bd(e,r),qc(r,e),Qu(Yn),os=!!Gn,Yn=Gn=null,e.current=r,xd(r),ru(),be=N,Re=D,Ct.transition=_}else e.current=r;if(Vs&&(Vs=!1,vr=e,Ks=c),_=e.pendingLanes,_===0&&(pr=null),nu(r.stateNode),ht(e,He()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)c=t[r],i(c.value,{componentStack:c.stack,digest:c.digest});if($s)throw $s=!1,e=Vo,Vo=null,e;return(Ks&1)!==0&&e.tag!==0&&ai(),_=e.pendingLanes,(_&1)!==0?e===Ko?$i++:($i=0,Ko=e):$i=0,ur(),null}function ai(){if(vr!==null){var e=Vl(Ks),t=Ct.transition,r=Re;try{if(Ct.transition=null,Re=16>e?16:e,vr===null)var i=!1;else{if(e=vr,vr=null,Ks=0,(be&6)!==0)throw Error(h(331));var c=be;for(be|=4,_e=e.current;_e!==null;){var _=_e,D=_.child;if((_e.flags&16)!==0){var N=_.deletions;if(N!==null){for(var z=0;z<N.length;z++){var Y=N[z];for(_e=Y;_e!==null;){var se=_e;switch(se.tag){case 0:case 11:case 15:zi(8,se,_)}var oe=se.child;if(oe!==null)oe.return=se,_e=oe;else for(;_e!==null;){se=_e;var ie=se.sibling,fe=se.return;if(Uc(se),se===Y){_e=null;break}if(ie!==null){ie.return=fe,_e=ie;break}_e=fe}}}var pe=_.alternate;if(pe!==null){var ve=pe.child;if(ve!==null){pe.child=null;do{var Fe=ve.sibling;ve.sibling=null,ve=Fe}while(ve!==null)}}_e=_}}if((_.subtreeFlags&2064)!==0&&D!==null)D.return=_,_e=D;else e:for(;_e!==null;){if(_=_e,(_.flags&2048)!==0)switch(_.tag){case 0:case 11:case 15:zi(9,_,_.return)}var K=_.sibling;if(K!==null){K.return=_.return,_e=K;break e}_e=_.return}}var V=e.current;for(_e=V;_e!==null;){D=_e;var q=D.child;if((D.subtreeFlags&2064)!==0&&q!==null)q.return=D,_e=q;else e:for(D=V;_e!==null;){if(N=_e,(N.flags&2048)!==0)try{switch(N.tag){case 0:case 11:case 15:zs(9,N)}}catch(me){Ne(N,N.return,me)}if(N===D){_e=null;break e}var ae=N.sibling;if(ae!==null){ae.return=N.return,_e=ae;break e}_e=N.return}}if(be=c,ur(),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(es,e)}catch{}i=!0}return i}finally{Re=r,Ct.transition=t}}return!1}function sh(e,t,r){t=si(r,t),t=Cc(e,t,1),e=fr(e,t,1),t=st(),e!==null&&(_i(e,1,t),ht(e,t))}function Ne(e,t,r){if(e.tag===3)sh(e,e,r);else for(;t!==null;){if(t.tag===3){sh(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(pr===null||!pr.has(i))){e=si(r,e),e=Ec(t,e,1),t=fr(t,e,1),e=st(),t!==null&&(_i(t,1,e),ht(t,e));break}}t=t.return}}function Bd(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=st(),e.pingedLanes|=e.suspendedLanes&r,qe===e&&(Qe&r)===r&&(We===4||We===3&&(Qe&130023424)===Qe&&500>He()-$o?Ir(e,0):Wo|=r),ht(e,t)}function nh(e,t){t===0&&((e.mode&1)===0?t=1:(t=rs,rs<<=1,(rs&130023424)===0&&(rs=4194304)));var r=st();e=Xt(e,t),e!==null&&(_i(e,t,r),ht(e,r))}function Od(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),nh(e,r)}function Pd(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,c=e.memoizedState;c!==null&&(r=c.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(h(314))}i!==null&&i.delete(t),nh(e,r)}var oh;oh=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)at=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return at=!1,wd(e,t,r);at=(e.flags&131072)!==0}else at=!1,Pe&&(t.flags&1048576)!==0&&Fa(t,ks,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Fs(e,t),e=t.pendingProps;var c=Yr(t,Je.current);ri(t,r),c=wo(null,t,i,e,c,r);var _=Co();return t.flags|=1,typeof c=="object"&&c!==null&&typeof c.render=="function"&&c.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lt(i)?(_=!0,ws(t)):_=!1,t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,_o(t),c.updater=Ns,t.stateNode=c,c._reactInternals=t,Lo(t,i,e,r),t=Bo(null,t,i,!0,_,r)):(t.tag=0,Pe&&_&&io(t),it(null,t,c,r),t=t.child),t;case 16:i=t.elementType;e:{switch(Fs(e,t),e=t.pendingProps,c=i._init,i=c(i._payload),t.type=i,c=t.tag=Id(i),e=Tt(i,e),c){case 0:t=Ao(null,t,i,e,r);break e;case 1:t=Bc(null,t,i,e,r);break e;case 11:t=Rc(null,t,i,e,r);break e;case 14:t=Lc(null,t,i,Tt(i.type,e),r);break e}throw Error(h(306,i,""))}return t;case 0:return i=t.type,c=t.pendingProps,c=t.elementType===i?c:Tt(i,c),Ao(e,t,i,c,r);case 1:return i=t.type,c=t.pendingProps,c=t.elementType===i?c:Tt(i,c),Bc(e,t,i,c,r);case 3:e:{if(Oc(t),e===null)throw Error(h(387));i=t.pendingProps,_=t.memoizedState,c=_.element,Xa(e,t),Ts(t,i,null,r);var D=t.memoizedState;if(i=D.element,_.isDehydrated)if(_={element:i,isDehydrated:!1,cache:D.cache,pendingSuspenseBoundaries:D.pendingSuspenseBoundaries,transitions:D.transitions},t.updateQueue.baseState=_,t.memoizedState=_,t.flags&256){c=si(Error(h(423)),t),t=Pc(e,t,i,r,c);break e}else if(i!==c){c=si(Error(h(424)),t),t=Pc(e,t,i,r,c);break e}else for(vt=ar(t.stateNode.containerInfo.firstChild),pt=t,Pe=!0,Dt=null,r=Ka(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Zr(),i===c){t=Yt(e,t,r);break e}it(e,t,i,r)}t=t.child}return t;case 5:return Qa(t),e===null&&oo(t),i=t.type,c=t.pendingProps,_=e!==null?e.memoizedProps:null,D=c.children,Qn(i,c)?D=null:_!==null&&Qn(i,_)&&(t.flags|=32),Ac(e,t),it(e,t,D,r),t.child;case 6:return e===null&&oo(t),null;case 13:return Mc(e,t,r);case 4:return po(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=ei(t,null,i,r):it(e,t,i,r),t.child;case 11:return i=t.type,c=t.pendingProps,c=t.elementType===i?c:Tt(i,c),Rc(e,t,i,c,r);case 7:return it(e,t,t.pendingProps,r),t.child;case 8:return it(e,t,t.pendingProps.children,r),t.child;case 12:return it(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,c=t.pendingProps,_=t.memoizedProps,D=c.value,De(Rs,i._currentValue),i._currentValue=D,_!==null)if(Lt(_.value,D)){if(_.children===c.children&&!ot.current){t=Yt(e,t,r);break e}}else for(_=t.child,_!==null&&(_.return=t);_!==null;){var N=_.dependencies;if(N!==null){D=_.child;for(var z=N.firstContext;z!==null;){if(z.context===i){if(_.tag===1){z=Gt(-1,r&-r),z.tag=2;var Y=_.updateQueue;if(Y!==null){Y=Y.shared;var se=Y.pending;se===null?z.next=z:(z.next=se.next,se.next=z),Y.pending=z}}_.lanes|=r,z=_.alternate,z!==null&&(z.lanes|=r),uo(_.return,r,t),N.lanes|=r;break}z=z.next}}else if(_.tag===10)D=_.type===t.type?null:_.child;else if(_.tag===18){if(D=_.return,D===null)throw Error(h(341));D.lanes|=r,N=D.alternate,N!==null&&(N.lanes|=r),uo(D,r,t),D=_.sibling}else D=_.child;if(D!==null)D.return=_;else for(D=_;D!==null;){if(D===t){D=null;break}if(_=D.sibling,_!==null){_.return=D.return,D=_;break}D=D.return}_=D}it(e,t,c.children,r),t=t.child}return t;case 9:return c=t.type,i=t.pendingProps.children,ri(t,r),c=yt(c),i=i(c),t.flags|=1,it(e,t,i,r),t.child;case 14:return i=t.type,c=Tt(i,t.pendingProps),c=Tt(i.type,c),Lc(e,t,i,c,r);case 15:return Dc(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,c=t.pendingProps,c=t.elementType===i?c:Tt(i,c),Fs(e,t),t.tag=1,lt(i)?(e=!0,ws(t)):e=!1,ri(t,r),yc(t,i,c),Lo(t,i,c,r),Bo(null,t,i,!0,e,r);case 19:return Nc(e,t,r);case 22:return Tc(e,t,r)}throw Error(h(156,t.tag))};function lh(e,t){return jl(e,t)}function Md(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 Et(e,t,r,i){return new Md(e,t,r,i)}function Jo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Id(e){if(typeof e=="function")return Jo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===$)return 11;if(e===te)return 14}return 2}function Sr(e,t){var r=e.alternate;return r===null?(r=Et(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 Ys(e,t,r,i,c,_){var D=2;if(i=e,typeof e=="function")Jo(e)&&(D=1);else if(typeof e=="string")D=5;else e:switch(e){case R:return Hr(r.children,c,_,t);case S:D=8,c|=8;break;case A:return e=Et(12,r,t,c|2),e.elementType=A,e.lanes=_,e;case I:return e=Et(13,r,t,c),e.elementType=I,e.lanes=_,e;case Q:return e=Et(19,r,t,c),e.elementType=Q,e.lanes=_,e;case le:return Qs(r,c,_,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H:D=10;break e;case j:D=9;break e;case $:D=11;break e;case te:D=14;break e;case ne:D=16,i=null;break e}throw Error(h(130,e==null?e:typeof e,""))}return t=Et(D,r,t,c),t.elementType=e,t.type=i,t.lanes=_,t}function Hr(e,t,r,i){return e=Et(7,e,i,t),e.lanes=r,e}function Qs(e,t,r,i){return e=Et(22,e,i,t),e.elementType=le,e.lanes=r,e.stateNode={isHidden:!1},e}function Zo(e,t,r){return e=Et(6,e,null,t),e.lanes=r,e}function el(e,t,r){return t=Et(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Nd(e,t,r,i,c){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xn(0),this.expirationTimes=xn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xn(0),this.identifierPrefix=i,this.onRecoverableError=c,this.mutableSourceEagerHydrationData=null}function tl(e,t,r,i,c,_,D,N,z){return e=new Nd(e,t,r,N,z),t===1?(t=1,_===!0&&(t|=8)):t=0,_=Et(3,null,null,t),e.current=_,_.stateNode=e,_.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},_o(_),e}function Hd(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:k,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function ah(e){if(!e)return hr;e=e._reactInternals;e:{if(xr(e)!==e||e.tag!==1)throw Error(h(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(lt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(h(171))}if(e.tag===1){var r=e.type;if(lt(r))return Ia(e,r,t)}return t}function ch(e,t,r,i,c,_,D,N,z){return e=tl(r,i,!0,e,c,_,D,N,z),e.context=ah(null),r=e.current,i=st(),c=mr(r),_=Gt(i,c),_.callback=t??null,fr(r,_,c),e.current.lanes=c,_i(e,c,i),ht(e,i),e}function Js(e,t,r,i){var c=t.current,_=st(),D=mr(c);return r=ah(r),t.context===null?t.context=r:t.pendingContext=r,t=Gt(_,D),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=fr(c,t,D),e!==null&&(Ot(e,c,D,_),Ds(e,c,D)),D}function Zs(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 hh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function rl(e,t){hh(e,t),(e=e.alternate)&&hh(e,t)}function Fd(){return null}var uh=typeof reportError=="function"?reportError:function(e){console.error(e)};function il(e){this._internalRoot=e}en.prototype.render=il.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(h(409));Js(e,t,null,null)},en.prototype.unmount=il.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Mr(function(){Js(null,e,null,null)}),t[$t]=null}};function en(e){this._internalRoot=e}en.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xl();e={blockedOn:null,target:e,priority:t};for(var r=0;r<nr.length&&t!==0&&t<nr[r].priority;r++);nr.splice(r,0,e),r===0&&Ql(e)}};function sl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function tn(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function dh(){}function jd(e,t,r,i,c){if(c){if(typeof i=="function"){var _=i;i=function(){var Y=Zs(D);_.call(Y)}}var D=ch(t,i,e,0,null,!1,!1,"",dh);return e._reactRootContainer=D,e[$t]=D.current,Li(e.nodeType===8?e.parentNode:e),Mr(),D}for(;c=e.lastChild;)e.removeChild(c);if(typeof i=="function"){var N=i;i=function(){var Y=Zs(z);N.call(Y)}}var z=tl(e,0,!1,null,null,!1,!1,"",dh);return e._reactRootContainer=z,e[$t]=z.current,Li(e.nodeType===8?e.parentNode:e),Mr(function(){Js(t,z,r,i)}),z}function rn(e,t,r,i,c){var _=r._reactRootContainer;if(_){var D=_;if(typeof c=="function"){var N=c;c=function(){var z=Zs(D);N.call(z)}}Js(t,D,e,c)}else D=jd(r,t,e,c,i);return Zs(D)}Kl=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=fi(t.pendingLanes);r!==0&&(Rn(t,r|1),ht(t,He()),(be&6)===0&&(li=He()+500,ur()))}break;case 13:Mr(function(){var i=Xt(e,1);if(i!==null){var c=st();Ot(i,e,1,c)}}),rl(e,1)}},Ln=function(e){if(e.tag===13){var t=Xt(e,134217728);if(t!==null){var r=st();Ot(t,e,134217728,r)}rl(e,134217728)}},ql=function(e){if(e.tag===13){var t=mr(e),r=Xt(e,t);if(r!==null){var i=st();Ot(r,e,t,i)}rl(e,t)}},Xl=function(){return Re},Gl=function(e,t){var r=Re;try{return Re=e,t()}finally{Re=r}},yn=function(e,t,r){switch(t){case"input":if(ye(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var c=Ss(i);if(!c)throw Error(h(90));ue(i),ye(i,c)}}}break;case"textarea":er(e,r);break;case"select":t=r.value,t!=null&&Mt(e,!!r.multiple,t,!1)}},Ol=Go,Pl=Mr;var zd={usingClientEntryPoint:!1,Events:[Ai,Xr,Ss,Al,Bl,Go]},Vi={findFiberByHostInstance:Rr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ud={bundleType:Vi.bundleType,version:Vi.version,rendererPackageName:Vi.rendererPackageName,rendererConfig:Vi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:p.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Hl(e),e===null?null:e.stateNode},findFiberByHostInstance:Vi.findFiberByHostInstance||Fd,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 sn=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sn.isDisabled&&sn.supportsFiber)try{es=sn.inject(Ud),It=sn}catch{}}return ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=zd,ut.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!sl(t))throw Error(h(200));return Hd(e,t,null,r)},ut.createRoot=function(e,t){if(!sl(e))throw Error(h(299));var r=!1,i="",c=uh;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=tl(e,1,!1,null,null,r,!1,i,c),e[$t]=t.current,Li(e.nodeType===8?e.parentNode:e),new il(t)},ut.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(h(188)):(e=Object.keys(e).join(","),Error(h(268,e)));return e=Hl(t),e=e===null?null:e.stateNode,e},ut.flushSync=function(e){return Mr(e)},ut.hydrate=function(e,t,r){if(!tn(t))throw Error(h(200));return rn(null,e,t,!0,r)},ut.hydrateRoot=function(e,t,r){if(!sl(e))throw Error(h(405));var i=r!=null&&r.hydratedSources||null,c=!1,_="",D=uh;if(r!=null&&(r.unstable_strictMode===!0&&(c=!0),r.identifierPrefix!==void 0&&(_=r.identifierPrefix),r.onRecoverableError!==void 0&&(D=r.onRecoverableError)),t=ch(t,null,e,1,r??null,c,!1,_,D),e[$t]=t.current,Li(e),i)for(e=0;e<i.length;e++)r=i[e],c=r._getVersion,c=c(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,c]:t.mutableSourceEagerHydrationData.push(r,c);return new en(t)},ut.render=function(e,t,r){if(!tn(t))throw Error(h(200));return rn(null,e,t,!1,r)},ut.unmountComponentAtNode=function(e){if(!tn(e))throw Error(h(40));return e._reactRootContainer?(Mr(function(){rn(null,null,e,!1,function(){e._reactRootContainer=null,e[$t]=null})}),!0):!1},ut.unstable_batchedUpdates=Go,ut.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!tn(r))throw Error(h(200));if(e==null||e._reactInternals===void 0)throw Error(h(38));return rn(e,t,r,!1,i)},ut.version="18.3.1-next-f1338f8080-20240426",ut}var yh;function Yd(){if(yh)return ll.exports;yh=1;function y(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(y)}catch(d){console.error(d)}}return y(),ll.exports=Gd(),ll.exports}var wh;function Qd(){if(wh)return nn;wh=1;var y=Yd();return nn.createRoot=y.createRoot,nn.hydrateRoot=y.hydrateRoot,nn}var Jd=Qd();const Zd=Bh(Jd),Ch=y=>{let d;const h=new Set,E=(v,w)=>{const f=typeof v=="function"?v(d):v;if(!Object.is(f,d)){const g=d;d=w??(typeof f!="object"||f===null)?f:Object.assign({},d,f),h.forEach(C=>C(d,g))}},M=()=>d,l={setState:E,getState:M,getInitialState:()=>u,subscribe:v=>(h.add(v),()=>h.delete(v))},u=d=y(E,M,l);return l},ef=(y=>y?Ch(y):Ch),tf=y=>y;function rf(y,d=tf){const h=Xi.useSyncExternalStore(y.subscribe,Xi.useCallback(()=>d(y.getState()),[y,d]),Xi.useCallback(()=>d(y.getInitialState()),[y,d]));return Xi.useDebugValue(h),h}const Eh=y=>{const d=ef(y),h=E=>rf(d,E);return Object.assign(h,d),h},sf=(y=>y?Eh(y):Eh),wr=["branch","worktree","running"],pl=10,an=1,nf=3,of="hjWorktree CLI",lf="2.4.0",kh={step:"branch",completedSteps:[],projectInfo:null,branches:[],selectedBranch:null,worktreeCount:nf,terminals:[],activeTerminalIndex:0,activeSessionId:null,selectedSessionIds:[],isSetupCollapsed:!1,collapsedBranches:[],modalType:null,modalData:null,isLoading:!1,loadingMessage:"",error:null},Ve=sf((y,d)=>({...kh,setStep:h=>y({step:h}),goToStep:h=>{const{canNavigateTo:E,step:M,isStepComplete:U,completedSteps:F}=d();if(!E(h))return;const l=[...F];U(M)&&!l.includes(M)&&l.push(M),y({step:h,completedSteps:l})},goToNext:()=>{const{step:h,isStepComplete:E,completedSteps:M}=d(),U=wr.indexOf(h);if(U<wr.length-1&&E(h)){const F=[...M];F.includes(h)||F.push(h),y({step:wr[U+1],completedSteps:F})}},goToPrev:()=>{const{step:h}=d(),E=wr.indexOf(h);E>0&&y({step:wr[E-1]})},canNavigateTo:h=>{const{step:E,completedSteps:M,isStepComplete:U}=d(),F=wr.indexOf(E),l=wr.indexOf(h);if(l===F||l<F)return!0;for(let u=0;u<l;u++){const v=wr[u];if(!M.includes(v)&&!U(v))return!1}return!0},isStepComplete:h=>{const{selectedBranch:E,worktreeCount:M,terminals:U}=d();switch(h){case"branch":return E!==null;case"worktree":return M>=an;case"running":return U.length>0;default:return!1}},getStepStatus:h=>{const{step:E,completedSteps:M,isStepComplete:U}=d();return h===E?"current":M.includes(h)||U(h)?"completed":"pending"},setProjectInfo:h=>y({projectInfo:h}),fetchProjectInfo:async()=>{try{const h=await fetch("/api/info");if(!h.ok)throw new Error("Failed to fetch project info");const E=await h.json();y({projectInfo:E})}catch(h){y({error:h instanceof Error?h.message:"Unknown error"})}},setBranches:h=>y({branches:h}),setSelectedBranch:h=>y({selectedBranch:h}),fetchBranches:async()=>{try{const h=await fetch("/api/branches");if(!h.ok)throw new Error("Failed to fetch branches");const E=await h.json();if(y({branches:E}),!d().selectedBranch&&E.length>0){const U=E.find(F=>F.isCurrent);y({selectedBranch:(U==null?void 0:U.name)||E[0].name})}}catch(h){y({error:h instanceof Error?h.message:"Unknown error"})}},setWorktreeCount:h=>y({worktreeCount:Math.max(an,Math.min(pl,h))}),incrementWorktreeCount:()=>{const{worktreeCount:h}=d();h<pl&&y({worktreeCount:h+1})},decrementWorktreeCount:()=>{const{worktreeCount:h}=d();h>an&&y({worktreeCount:h-1})},addTerminal:h=>y(E=>E.terminals.some(M=>M.sessionId===h.sessionId)?E:{terminals:[...E.terminals,h]}),updateTerminalStatus:(h,E)=>y(M=>({terminals:M.terminals.map(U=>U.sessionId===h?{...U,status:E}:U)})),removeTerminal:h=>y(E=>{const M=E.terminals.filter(F=>F.sessionId!==h),U=Math.min(E.activeTerminalIndex,Math.max(0,M.length-1));return{terminals:M,activeTerminalIndex:U,step:M.length===0?"branch":E.step,completedSteps:M.length===0?[]:E.completedSteps}}),setActiveTerminal:h=>y({activeTerminalIndex:h}),clearAllTerminals:()=>y({terminals:[],activeTerminalIndex:0,activeSessionId:null,selectedSessionIds:[]}),setActiveSession:h=>{const{terminals:E}=d(),M=E.findIndex(U=>U.sessionId===h);y({activeSessionId:h,activeTerminalIndex:M>=0?M:0})},toggleSessionSelection:h=>y(E=>{const M=[...E.selectedSessionIds],U=M.indexOf(h);return U>=0?M.splice(U,1):M.push(h),{selectedSessionIds:M}}),selectAllSessions:()=>y(h=>({selectedSessionIds:h.terminals.map(E=>E.sessionId)})),clearSessionSelection:()=>y({selectedSessionIds:[]}),removeSelectedSessions:async()=>{const{selectedSessionIds:h,terminals:E}=d();if(h.length===0)return;const M=E.filter(U=>h.includes(U.sessionId)).map(U=>U.worktreeName);try{(await fetch("/api/worktrees/batch",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({names:M})})).ok&&y(F=>{const l=F.terminals.filter(u=>!h.includes(u.sessionId));return{terminals:l,selectedSessionIds:[],activeTerminalIndex:Math.min(F.activeTerminalIndex,Math.max(0,l.length-1)),activeSessionId:l.length>0?l[0].sessionId:null}})}catch(U){console.error("Failed to remove sessions:",U)}},getSessionGroups:()=>{const{terminals:h,collapsedBranches:E}=d(),M=new Map;for(const F of h){const l=F.branchName.replace(/-project-\d+$/,"");M.has(l)||M.set(l,[]),M.get(l).push(F)}const U=[];for(const[F,l]of M)U.push({branchName:F,sessions:l.map(u=>({...u,id:u.sessionId,createdAt:Date.now()})),isCollapsed:E.includes(F)});return U.sort((F,l)=>F.branchName.localeCompare(l.branchName))},toggleSetupCollapse:()=>y(h=>({isSetupCollapsed:!h.isSetupCollapsed})),toggleBranchCollapse:h=>y(E=>{const M=[...E.collapsedBranches],U=M.indexOf(h);return U>=0?M.splice(U,1):M.push(h),{collapsedBranches:M}}),openModal:(h,E)=>y({modalType:h,modalData:E||null}),closeModal:()=>y({modalType:null,modalData:null}),createSingleWorktree:async h=>{const{setLoading:E,setError:M,addTerminal:U,setActiveSession:F}=d();E(!0,"Creating worktree..."),M(null);try{const l=await fetch("/api/worktrees/single",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:h})});if(!l.ok){const w=await l.json();throw new Error(w.error||"Failed to create worktree")}const{worktree:u}=await l.json(),v=u.name;U({sessionId:v,worktreePath:u.path,worktreeName:u.name,branchName:u.branch,status:"initializing"}),F(v),y({step:"running",isSetupCollapsed:!0,modalType:null,modalData:null})}catch(l){M(l instanceof Error?l.message:"Unknown error")}finally{E(!1)}},restoreExistingWorktrees:async()=>{const{terminals:h}=d();if(!(h.length>0))try{const E=await fetch("/api/worktrees");if(!E.ok)return;const U=(await E.json()).filter(l=>!l.isMainWorktree&&l.name.includes("-project-"));if(U.length===0)return;const{addTerminal:F}=d();for(const l of U)F({sessionId:l.name,worktreePath:l.path,worktreeName:l.name,branchName:l.branch,status:"running"});y({step:"running",completedSteps:["branch","worktree"],isSetupCollapsed:!0,activeSessionId:U[0].name}),console.log(`Restored ${U.length} worktree sessions`)}catch(E){console.error("Failed to restore worktrees:",E)}},execute:async()=>{const{selectedBranch:h,worktreeCount:E,setLoading:M,setError:U,addTerminal:F}=d();if(!h){U("Please select a branch");return}M(!0,"Creating worktrees..."),U(null);try{const l=await fetch("/api/worktrees",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:h,count:E})});if(!l.ok){const w=await l.json();throw new Error(w.error||"Failed to create worktrees")}const{worktrees:u}=await l.json();for(const w of u){const f=w.name;F({sessionId:f,worktreePath:w.path,worktreeName:w.name,branchName:w.branch,status:"initializing"})}const{terminals:v}=d();y({step:"running",completedSteps:["branch","worktree"],isSetupCollapsed:!0,activeSessionId:v.length>0?v[0].sessionId:null})}catch(l){U(l instanceof Error?l.message:"Unknown error")}finally{M(!1)}},setLoading:(h,E="")=>y({isLoading:h,loadingMessage:E}),setError:h=>y({error:h}),reset:()=>y(kh)})),Ut=Object.create(null);Ut.open="0";Ut.close="1";Ut.ping="2";Ut.pong="3";Ut.message="4";Ut.upgrade="5";Ut.noop="6";const cn=Object.create(null);Object.keys(Ut).forEach(y=>{cn[Ut[y]]=y});const vl={type:"error",data:"parser error"},Oh=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ph=typeof ArrayBuffer=="function",Mh=y=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(y):y&&y.buffer instanceof ArrayBuffer,El=({type:y,data:d},h,E)=>Oh&&d instanceof Blob?h?E(d):bh(d,E):Ph&&(d instanceof ArrayBuffer||Mh(d))?h?E(d):bh(new Blob([d]),E):E(Ut[y]+(d||"")),bh=(y,d)=>{const h=new FileReader;return h.onload=function(){const E=h.result.split(",")[1];d("b"+(E||""))},h.readAsDataURL(y)};function xh(y){return y instanceof Uint8Array?y:y instanceof ArrayBuffer?new Uint8Array(y):new Uint8Array(y.buffer,y.byteOffset,y.byteLength)}let hl;function af(y,d){if(Oh&&y.data instanceof Blob)return y.data.arrayBuffer().then(xh).then(d);if(Ph&&(y.data instanceof ArrayBuffer||Mh(y.data)))return d(xh(y.data));El(y,!1,h=>{hl||(hl=new TextEncoder),d(hl.encode(h))})}const Rh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gi=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let y=0;y<Rh.length;y++)Gi[Rh.charCodeAt(y)]=y;const cf=y=>{let d=y.length*.75,h=y.length,E,M=0,U,F,l,u;y[y.length-1]==="="&&(d--,y[y.length-2]==="="&&d--);const v=new ArrayBuffer(d),w=new Uint8Array(v);for(E=0;E<h;E+=4)U=Gi[y.charCodeAt(E)],F=Gi[y.charCodeAt(E+1)],l=Gi[y.charCodeAt(E+2)],u=Gi[y.charCodeAt(E+3)],w[M++]=U<<2|F>>4,w[M++]=(F&15)<<4|l>>2,w[M++]=(l&3)<<6|u&63;return v},hf=typeof ArrayBuffer=="function",kl=(y,d)=>{if(typeof y!="string")return{type:"message",data:Ih(y,d)};const h=y.charAt(0);return h==="b"?{type:"message",data:uf(y.substring(1),d)}:cn[h]?y.length>1?{type:cn[h],data:y.substring(1)}:{type:cn[h]}:vl},uf=(y,d)=>{if(hf){const h=cf(y);return Ih(h,d)}else return{base64:!0,data:y}},Ih=(y,d)=>{switch(d){case"blob":return y instanceof Blob?y:new Blob([y]);case"arraybuffer":default:return y instanceof ArrayBuffer?y:y.buffer}},Nh="",df=(y,d)=>{const h=y.length,E=new Array(h);let M=0;y.forEach((U,F)=>{El(U,!1,l=>{E[F]=l,++M===h&&d(E.join(Nh))})})},ff=(y,d)=>{const h=y.split(Nh),E=[];for(let M=0;M<h.length;M++){const U=kl(h[M],d);if(E.push(U),U.type==="error")break}return E};function _f(){return new TransformStream({transform(y,d){af(y,h=>{const E=h.length;let M;if(E<126)M=new Uint8Array(1),new DataView(M.buffer).setUint8(0,E);else if(E<65536){M=new Uint8Array(3);const U=new DataView(M.buffer);U.setUint8(0,126),U.setUint16(1,E)}else{M=new Uint8Array(9);const U=new DataView(M.buffer);U.setUint8(0,127),U.setBigUint64(1,BigInt(E))}y.data&&typeof y.data!="string"&&(M[0]|=128),d.enqueue(M),d.enqueue(h)})}})}let ul;function on(y){return y.reduce((d,h)=>d+h.length,0)}function ln(y,d){if(y[0].length===d)return y.shift();const h=new Uint8Array(d);let E=0;for(let M=0;M<d;M++)h[M]=y[0][E++],E===y[0].length&&(y.shift(),E=0);return y.length&&E<y[0].length&&(y[0]=y[0].slice(E)),h}function pf(y,d){ul||(ul=new TextDecoder);const h=[];let E=0,M=-1,U=!1;return new TransformStream({transform(F,l){for(h.push(F);;){if(E===0){if(on(h)<1)break;const u=ln(h,1);U=(u[0]&128)===128,M=u[0]&127,M<126?E=3:M===126?E=1:E=2}else if(E===1){if(on(h)<2)break;const u=ln(h,2);M=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),E=3}else if(E===2){if(on(h)<8)break;const u=ln(h,8),v=new DataView(u.buffer,u.byteOffset,u.length),w=v.getUint32(0);if(w>Math.pow(2,21)-1){l.enqueue(vl);break}M=w*Math.pow(2,32)+v.getUint32(4),E=3}else{if(on(h)<M)break;const u=ln(h,M);l.enqueue(kl(U?u:ul.decode(u),d)),E=0}if(M===0||M>y){l.enqueue(vl);break}}}})}const Hh=4;function ze(y){if(y)return vf(y)}function vf(y){for(var d in ze.prototype)y[d]=ze.prototype[d];return y}ze.prototype.on=ze.prototype.addEventListener=function(y,d){return this._callbacks=this._callbacks||{},(this._callbacks["$"+y]=this._callbacks["$"+y]||[]).push(d),this};ze.prototype.once=function(y,d){function h(){this.off(y,h),d.apply(this,arguments)}return h.fn=d,this.on(y,h),this};ze.prototype.off=ze.prototype.removeListener=ze.prototype.removeAllListeners=ze.prototype.removeEventListener=function(y,d){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var h=this._callbacks["$"+y];if(!h)return this;if(arguments.length==1)return delete this._callbacks["$"+y],this;for(var E,M=0;M<h.length;M++)if(E=h[M],E===d||E.fn===d){h.splice(M,1);break}return h.length===0&&delete this._callbacks["$"+y],this};ze.prototype.emit=function(y){this._callbacks=this._callbacks||{};for(var d=new Array(arguments.length-1),h=this._callbacks["$"+y],E=1;E<arguments.length;E++)d[E-1]=arguments[E];if(h){h=h.slice(0);for(var E=0,M=h.length;E<M;++E)h[E].apply(this,d)}return this};ze.prototype.emitReserved=ze.prototype.emit;ze.prototype.listeners=function(y){return this._callbacks=this._callbacks||{},this._callbacks["$"+y]||[]};ze.prototype.hasListeners=function(y){return!!this.listeners(y).length};const _n=typeof Promise=="function"&&typeof Promise.resolve=="function"?d=>Promise.resolve().then(d):(d,h)=>h(d,0),bt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),mf="arraybuffer";function Fh(y,...d){return d.reduce((h,E)=>(y.hasOwnProperty(E)&&(h[E]=y[E]),h),{})}const gf=bt.setTimeout,Sf=bt.clearTimeout;function pn(y,d){d.useNativeTimers?(y.setTimeoutFn=gf.bind(bt),y.clearTimeoutFn=Sf.bind(bt)):(y.setTimeoutFn=bt.setTimeout.bind(bt),y.clearTimeoutFn=bt.clearTimeout.bind(bt))}const yf=1.33;function wf(y){return typeof y=="string"?Cf(y):Math.ceil((y.byteLength||y.size)*yf)}function Cf(y){let d=0,h=0;for(let E=0,M=y.length;E<M;E++)d=y.charCodeAt(E),d<128?h+=1:d<2048?h+=2:d<55296||d>=57344?h+=3:(E++,h+=4);return h}function jh(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ef(y){let d="";for(let h in y)y.hasOwnProperty(h)&&(d.length&&(d+="&"),d+=encodeURIComponent(h)+"="+encodeURIComponent(y[h]));return d}function kf(y){let d={},h=y.split("&");for(let E=0,M=h.length;E<M;E++){let U=h[E].split("=");d[decodeURIComponent(U[0])]=decodeURIComponent(U[1])}return d}class bf extends Error{constructor(d,h,E){super(d),this.description=h,this.context=E,this.type="TransportError"}}class bl extends ze{constructor(d){super(),this.writable=!1,pn(this,d),this.opts=d,this.query=d.query,this.socket=d.socket,this.supportsBinary=!d.forceBase64}onError(d,h,E){return super.emitReserved("error",new bf(d,h,E)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(d){this.readyState==="open"&&this.write(d)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(d){const h=kl(d,this.socket.binaryType);this.onPacket(h)}onPacket(d){super.emitReserved("packet",d)}onClose(d){this.readyState="closed",super.emitReserved("close",d)}pause(d){}createUri(d,h={}){return d+"://"+this._hostname()+this._port()+this.opts.path+this._query(h)}_hostname(){const d=this.opts.hostname;return d.indexOf(":")===-1?d:"["+d+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(d){const h=Ef(d);return h.length?"?"+h:""}}class xf extends bl{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(d){this.readyState="pausing";const h=()=>{this.readyState="paused",d()};if(this._polling||!this.writable){let E=0;this._polling&&(E++,this.once("pollComplete",function(){--E||h()})),this.writable||(E++,this.once("drain",function(){--E||h()}))}else h()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(d){const h=E=>{if(this.readyState==="opening"&&E.type==="open"&&this.onOpen(),E.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(E)};ff(d,this.socket.binaryType).forEach(h),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const d=()=>{this.write([{type:"close"}])};this.readyState==="open"?d():this.once("open",d)}write(d){this.writable=!1,df(d,h=>{this.doWrite(h,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const d=this.opts.secure?"https":"http",h=this.query||{};return this.opts.timestampRequests!==!1&&(h[this.opts.timestampParam]=jh()),!this.supportsBinary&&!h.sid&&(h.b64=1),this.createUri(d,h)}}let zh=!1;try{zh=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Rf=zh;function Lf(){}class Df extends xf{constructor(d){if(super(d),typeof location<"u"){const h=location.protocol==="https:";let E=location.port;E||(E=h?"443":"80"),this.xd=typeof location<"u"&&d.hostname!==location.hostname||E!==d.port}}doWrite(d,h){const E=this.request({method:"POST",data:d});E.on("success",h),E.on("error",(M,U)=>{this.onError("xhr post error",M,U)})}doPoll(){const d=this.request();d.on("data",this.onData.bind(this)),d.on("error",(h,E)=>{this.onError("xhr poll error",h,E)}),this.pollXhr=d}}class zt extends ze{constructor(d,h,E){super(),this.createRequest=d,pn(this,E),this._opts=E,this._method=E.method||"GET",this._uri=h,this._data=E.data!==void 0?E.data:null,this._create()}_create(){var d;const h=Fh(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");h.xdomain=!!this._opts.xd;const E=this._xhr=this.createRequest(h);try{E.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){E.setDisableHeaderCheck&&E.setDisableHeaderCheck(!0);for(let M in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(M)&&E.setRequestHeader(M,this._opts.extraHeaders[M])}}catch{}if(this._method==="POST")try{E.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{E.setRequestHeader("Accept","*/*")}catch{}(d=this._opts.cookieJar)===null||d===void 0||d.addCookies(E),"withCredentials"in E&&(E.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(E.timeout=this._opts.requestTimeout),E.onreadystatechange=()=>{var M;E.readyState===3&&((M=this._opts.cookieJar)===null||M===void 0||M.parseCookies(E.getResponseHeader("set-cookie"))),E.readyState===4&&(E.status===200||E.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof E.status=="number"?E.status:0)},0))},E.send(this._data)}catch(M){this.setTimeoutFn(()=>{this._onError(M)},0);return}typeof document<"u"&&(this._index=zt.requestsCount++,zt.requests[this._index]=this)}_onError(d){this.emitReserved("error",d,this._xhr),this._cleanup(!0)}_cleanup(d){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Lf,d)try{this._xhr.abort()}catch{}typeof document<"u"&&delete zt.requests[this._index],this._xhr=null}}_onLoad(){const d=this._xhr.responseText;d!==null&&(this.emitReserved("data",d),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}zt.requestsCount=0;zt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Lh);else if(typeof addEventListener=="function"){const y="onpagehide"in bt?"pagehide":"unload";addEventListener(y,Lh,!1)}}function Lh(){for(let y in zt.requests)zt.requests.hasOwnProperty(y)&&zt.requests[y].abort()}const Tf=(function(){const y=Uh({xdomain:!1});return y&&y.responseType!==null})();class Af extends Df{constructor(d){super(d);const h=d&&d.forceBase64;this.supportsBinary=Tf&&!h}request(d={}){return Object.assign(d,{xd:this.xd},this.opts),new zt(Uh,this.uri(),d)}}function Uh(y){const d=y.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!d||Rf))return new XMLHttpRequest}catch{}if(!d)try{return new bt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Wh=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Bf extends bl{get name(){return"websocket"}doOpen(){const d=this.uri(),h=this.opts.protocols,E=Wh?{}:Fh(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(E.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(d,h,E)}catch(M){return this.emitReserved("error",M)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=d=>this.onClose({description:"websocket connection closed",context:d}),this.ws.onmessage=d=>this.onData(d.data),this.ws.onerror=d=>this.onError("websocket error",d)}write(d){this.writable=!1;for(let h=0;h<d.length;h++){const E=d[h],M=h===d.length-1;El(E,this.supportsBinary,U=>{try{this.doWrite(E,U)}catch{}M&&_n(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const d=this.opts.secure?"wss":"ws",h=this.query||{};return this.opts.timestampRequests&&(h[this.opts.timestampParam]=jh()),this.supportsBinary||(h.b64=1),this.createUri(d,h)}}const dl=bt.WebSocket||bt.MozWebSocket;class Of extends Bf{createSocket(d,h,E){return Wh?new dl(d,h,E):h?new dl(d,h):new dl(d)}doWrite(d,h){this.ws.send(h)}}class Pf extends bl{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(d){return this.emitReserved("error",d)}this._transport.closed.then(()=>{this.onClose()}).catch(d=>{this.onError("webtransport error",d)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(d=>{const h=pf(Number.MAX_SAFE_INTEGER,this.socket.binaryType),E=d.readable.pipeThrough(h).getReader(),M=_f();M.readable.pipeTo(d.writable),this._writer=M.writable.getWriter();const U=()=>{E.read().then(({done:l,value:u})=>{l||(this.onPacket(u),U())}).catch(l=>{})};U();const F={type:"open"};this.query.sid&&(F.data=`{"sid":"${this.query.sid}"}`),this._writer.write(F).then(()=>this.onOpen())})})}write(d){this.writable=!1;for(let h=0;h<d.length;h++){const E=d[h],M=h===d.length-1;this._writer.write(E).then(()=>{M&&_n(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var d;(d=this._transport)===null||d===void 0||d.close()}}const Mf={websocket:Of,webtransport:Pf,polling:Af},If=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Nf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ml(y){if(y.length>8e3)throw"URI too long";const d=y,h=y.indexOf("["),E=y.indexOf("]");h!=-1&&E!=-1&&(y=y.substring(0,h)+y.substring(h,E).replace(/:/g,";")+y.substring(E,y.length));let M=If.exec(y||""),U={},F=14;for(;F--;)U[Nf[F]]=M[F]||"";return h!=-1&&E!=-1&&(U.source=d,U.host=U.host.substring(1,U.host.length-1).replace(/;/g,":"),U.authority=U.authority.replace("[","").replace("]","").replace(/;/g,":"),U.ipv6uri=!0),U.pathNames=Hf(U,U.path),U.queryKey=Ff(U,U.query),U}function Hf(y,d){const h=/\/{2,9}/g,E=d.replace(h,"/").split("/");return(d.slice(0,1)=="/"||d.length===0)&&E.splice(0,1),d.slice(-1)=="/"&&E.splice(E.length-1,1),E}function Ff(y,d){const h={};return d.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(E,M,U){M&&(h[M]=U)}),h}const gl=typeof addEventListener=="function"&&typeof removeEventListener=="function",hn=[];gl&&addEventListener("offline",()=>{hn.forEach(y=>y())},!1);class Cr extends ze{constructor(d,h){if(super(),this.binaryType=mf,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,d&&typeof d=="object"&&(h=d,d=null),d){const E=ml(d);h.hostname=E.host,h.secure=E.protocol==="https"||E.protocol==="wss",h.port=E.port,E.query&&(h.query=E.query)}else h.host&&(h.hostname=ml(h.host).host);pn(this,h),this.secure=h.secure!=null?h.secure:typeof location<"u"&&location.protocol==="https:",h.hostname&&!h.port&&(h.port=this.secure?"443":"80"),this.hostname=h.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=h.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},h.transports.forEach(E=>{const M=E.prototype.name;this.transports.push(M),this._transportsByName[M]=E}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},h),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=kf(this.opts.query)),gl&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},hn.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(d){const h=Object.assign({},this.opts.query);h.EIO=Hh,h.transport=d,this.id&&(h.sid=this.id);const E=Object.assign({},this.opts,{query:h,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[d]);return new this._transportsByName[d](E)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const d=this.opts.rememberUpgrade&&Cr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const h=this.createTransport(d);h.open(),this.setTransport(h)}setTransport(d){this.transport&&this.transport.removeAllListeners(),this.transport=d,d.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",h=>this._onClose("transport close",h))}onOpen(){this.readyState="open",Cr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(d){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",d),this.emitReserved("heartbeat"),d.type){case"open":this.onHandshake(JSON.parse(d.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const h=new Error("server error");h.code=d.data,this._onError(h);break;case"message":this.emitReserved("data",d.data),this.emitReserved("message",d.data);break}}onHandshake(d){this.emitReserved("handshake",d),this.id=d.sid,this.transport.query.sid=d.sid,this._pingInterval=d.pingInterval,this._pingTimeout=d.pingTimeout,this._maxPayload=d.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const d=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+d,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},d),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const d=this._getWritablePackets();this.transport.send(d),this._prevBufferLen=d.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let h=1;for(let E=0;E<this.writeBuffer.length;E++){const M=this.writeBuffer[E].data;if(M&&(h+=wf(M)),E>0&&h>this._maxPayload)return this.writeBuffer.slice(0,E);h+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const d=Date.now()>this._pingTimeoutTime;return d&&(this._pingTimeoutTime=0,_n(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),d}write(d,h,E){return this._sendPacket("message",d,h,E),this}send(d,h,E){return this._sendPacket("message",d,h,E),this}_sendPacket(d,h,E,M){if(typeof h=="function"&&(M=h,h=void 0),typeof E=="function"&&(M=E,E=null),this.readyState==="closing"||this.readyState==="closed")return;E=E||{},E.compress=E.compress!==!1;const U={type:d,data:h,options:E};this.emitReserved("packetCreate",U),this.writeBuffer.push(U),M&&this.once("flush",M),this.flush()}close(){const d=()=>{this._onClose("forced close"),this.transport.close()},h=()=>{this.off("upgrade",h),this.off("upgradeError",h),d()},E=()=>{this.once("upgrade",h),this.once("upgradeError",h)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?E():d()}):this.upgrading?E():d()),this}_onError(d){if(Cr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",d),this._onClose("transport error",d)}_onClose(d,h){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),gl&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const E=hn.indexOf(this._offlineEventListener);E!==-1&&hn.splice(E,1)}this.readyState="closed",this.id=null,this.emitReserved("close",d,h),this.writeBuffer=[],this._prevBufferLen=0}}}Cr.protocol=Hh;class jf extends Cr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let d=0;d<this._upgrades.length;d++)this._probe(this._upgrades[d])}_probe(d){let h=this.createTransport(d),E=!1;Cr.priorWebsocketSuccess=!1;const M=()=>{E||(h.send([{type:"ping",data:"probe"}]),h.once("packet",f=>{if(!E)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",h),!h)return;Cr.priorWebsocketSuccess=h.name==="websocket",this.transport.pause(()=>{E||this.readyState!=="closed"&&(w(),this.setTransport(h),h.send([{type:"upgrade"}]),this.emitReserved("upgrade",h),h=null,this.upgrading=!1,this.flush())})}else{const g=new Error("probe error");g.transport=h.name,this.emitReserved("upgradeError",g)}}))};function U(){E||(E=!0,w(),h.close(),h=null)}const F=f=>{const g=new Error("probe error: "+f);g.transport=h.name,U(),this.emitReserved("upgradeError",g)};function l(){F("transport closed")}function u(){F("socket closed")}function v(f){h&&f.name!==h.name&&U()}const w=()=>{h.removeListener("open",M),h.removeListener("error",F),h.removeListener("close",l),this.off("close",u),this.off("upgrading",v)};h.once("open",M),h.once("error",F),h.once("close",l),this.once("close",u),this.once("upgrading",v),this._upgrades.indexOf("webtransport")!==-1&&d!=="webtransport"?this.setTimeoutFn(()=>{E||h.open()},200):h.open()}onHandshake(d){this._upgrades=this._filterUpgrades(d.upgrades),super.onHandshake(d)}_filterUpgrades(d){const h=[];for(let E=0;E<d.length;E++)~this.transports.indexOf(d[E])&&h.push(d[E]);return h}}let zf=class extends jf{constructor(d,h={}){const E=typeof d=="object"?d:h;(!E.transports||E.transports&&typeof E.transports[0]=="string")&&(E.transports=(E.transports||["polling","websocket","webtransport"]).map(M=>Mf[M]).filter(M=>!!M)),super(d,E)}};function Uf(y,d="",h){let E=y;h=h||typeof location<"u"&&location,y==null&&(y=h.protocol+"//"+h.host),typeof y=="string"&&(y.charAt(0)==="/"&&(y.charAt(1)==="/"?y=h.protocol+y:y=h.host+y),/^(https?|wss?):\/\//.test(y)||(typeof h<"u"?y=h.protocol+"//"+y:y="https://"+y),E=ml(y)),E.port||(/^(http|ws)$/.test(E.protocol)?E.port="80":/^(http|ws)s$/.test(E.protocol)&&(E.port="443")),E.path=E.path||"/";const U=E.host.indexOf(":")!==-1?"["+E.host+"]":E.host;return E.id=E.protocol+"://"+U+":"+E.port+d,E.href=E.protocol+"://"+U+(h&&h.port===E.port?"":":"+E.port),E}const Wf=typeof ArrayBuffer=="function",$f=y=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(y):y.buffer instanceof ArrayBuffer,$h=Object.prototype.toString,Vf=typeof Blob=="function"||typeof Blob<"u"&&$h.call(Blob)==="[object BlobConstructor]",Kf=typeof File=="function"||typeof File<"u"&&$h.call(File)==="[object FileConstructor]";function xl(y){return Wf&&(y instanceof ArrayBuffer||$f(y))||Vf&&y instanceof Blob||Kf&&y instanceof File}function un(y,d){if(!y||typeof y!="object")return!1;if(Array.isArray(y)){for(let h=0,E=y.length;h<E;h++)if(un(y[h]))return!0;return!1}if(xl(y))return!0;if(y.toJSON&&typeof y.toJSON=="function"&&arguments.length===1)return un(y.toJSON(),!0);for(const h in y)if(Object.prototype.hasOwnProperty.call(y,h)&&un(y[h]))return!0;return!1}function qf(y){const d=[],h=y.data,E=y;return E.data=Sl(h,d),E.attachments=d.length,{packet:E,buffers:d}}function Sl(y,d){if(!y)return y;if(xl(y)){const h={_placeholder:!0,num:d.length};return d.push(y),h}else if(Array.isArray(y)){const h=new Array(y.length);for(let E=0;E<y.length;E++)h[E]=Sl(y[E],d);return h}else if(typeof y=="object"&&!(y instanceof Date)){const h={};for(const E in y)Object.prototype.hasOwnProperty.call(y,E)&&(h[E]=Sl(y[E],d));return h}return y}function Xf(y,d){return y.data=yl(y.data,d),delete y.attachments,y}function yl(y,d){if(!y)return y;if(y&&y._placeholder===!0){if(typeof y.num=="number"&&y.num>=0&&y.num<d.length)return d[y.num];throw new Error("illegal attachments")}else if(Array.isArray(y))for(let h=0;h<y.length;h++)y[h]=yl(y[h],d);else if(typeof y=="object")for(const h in y)Object.prototype.hasOwnProperty.call(y,h)&&(y[h]=yl(y[h],d));return y}const Vh=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Gf=5;var Ce;(function(y){y[y.CONNECT=0]="CONNECT",y[y.DISCONNECT=1]="DISCONNECT",y[y.EVENT=2]="EVENT",y[y.ACK=3]="ACK",y[y.CONNECT_ERROR=4]="CONNECT_ERROR",y[y.BINARY_EVENT=5]="BINARY_EVENT",y[y.BINARY_ACK=6]="BINARY_ACK"})(Ce||(Ce={}));class Yf{constructor(d){this.replacer=d}encode(d){return(d.type===Ce.EVENT||d.type===Ce.ACK)&&un(d)?this.encodeAsBinary({type:d.type===Ce.EVENT?Ce.BINARY_EVENT:Ce.BINARY_ACK,nsp:d.nsp,data:d.data,id:d.id}):[this.encodeAsString(d)]}encodeAsString(d){let h=""+d.type;return(d.type===Ce.BINARY_EVENT||d.type===Ce.BINARY_ACK)&&(h+=d.attachments+"-"),d.nsp&&d.nsp!=="/"&&(h+=d.nsp+","),d.id!=null&&(h+=d.id),d.data!=null&&(h+=JSON.stringify(d.data,this.replacer)),h}encodeAsBinary(d){const h=qf(d),E=this.encodeAsString(h.packet),M=h.buffers;return M.unshift(E),M}}class Rl extends ze{constructor(d){super(),this.reviver=d}add(d){let h;if(typeof d=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");h=this.decodeString(d);const E=h.type===Ce.BINARY_EVENT;E||h.type===Ce.BINARY_ACK?(h.type=E?Ce.EVENT:Ce.ACK,this.reconstructor=new Qf(h),h.attachments===0&&super.emitReserved("decoded",h)):super.emitReserved("decoded",h)}else if(xl(d)||d.base64)if(this.reconstructor)h=this.reconstructor.takeBinaryData(d),h&&(this.reconstructor=null,super.emitReserved("decoded",h));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+d)}decodeString(d){let h=0;const E={type:Number(d.charAt(0))};if(Ce[E.type]===void 0)throw new Error("unknown packet type "+E.type);if(E.type===Ce.BINARY_EVENT||E.type===Ce.BINARY_ACK){const U=h+1;for(;d.charAt(++h)!=="-"&&h!=d.length;);const F=d.substring(U,h);if(F!=Number(F)||d.charAt(h)!=="-")throw new Error("Illegal attachments");E.attachments=Number(F)}if(d.charAt(h+1)==="/"){const U=h+1;for(;++h&&!(d.charAt(h)===","||h===d.length););E.nsp=d.substring(U,h)}else E.nsp="/";const M=d.charAt(h+1);if(M!==""&&Number(M)==M){const U=h+1;for(;++h;){const F=d.charAt(h);if(F==null||Number(F)!=F){--h;break}if(h===d.length)break}E.id=Number(d.substring(U,h+1))}if(d.charAt(++h)){const U=this.tryParse(d.substr(h));if(Rl.isPayloadValid(E.type,U))E.data=U;else throw new Error("invalid payload")}return E}tryParse(d){try{return JSON.parse(d,this.reviver)}catch{return!1}}static isPayloadValid(d,h){switch(d){case Ce.CONNECT:return fn(h);case Ce.DISCONNECT:return h===void 0;case Ce.CONNECT_ERROR:return typeof h=="string"||fn(h);case Ce.EVENT:case Ce.BINARY_EVENT:return Array.isArray(h)&&(typeof h[0]=="number"||typeof h[0]=="string"&&Vh.indexOf(h[0])===-1);case Ce.ACK:case Ce.BINARY_ACK:return Array.isArray(h)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Qf{constructor(d){this.packet=d,this.buffers=[],this.reconPack=d}takeBinaryData(d){if(this.buffers.push(d),this.buffers.length===this.reconPack.attachments){const h=Xf(this.reconPack,this.buffers);return this.finishedReconstruction(),h}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Jf(y){return typeof y=="string"}const Zf=Number.isInteger||function(y){return typeof y=="number"&&isFinite(y)&&Math.floor(y)===y};function e_(y){return y===void 0||Zf(y)}function fn(y){return Object.prototype.toString.call(y)==="[object Object]"}function t_(y,d){switch(y){case Ce.CONNECT:return d===void 0||fn(d);case Ce.DISCONNECT:return d===void 0;case Ce.EVENT:return Array.isArray(d)&&(typeof d[0]=="number"||typeof d[0]=="string"&&Vh.indexOf(d[0])===-1);case Ce.ACK:return Array.isArray(d);case Ce.CONNECT_ERROR:return typeof d=="string"||fn(d);default:return!1}}function r_(y){return Jf(y.nsp)&&e_(y.id)&&t_(y.type,y.data)}const i_=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Rl,Encoder:Yf,get PacketType(){return Ce},isPacketValid:r_,protocol:Gf},Symbol.toStringTag,{value:"Module"}));function Pt(y,d,h){return y.on(d,h),function(){y.off(d,h)}}const s_=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Kh extends ze{constructor(d,h,E){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=d,this.nsp=h,E&&E.auth&&(this.auth=E.auth),this._opts=Object.assign({},E),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const d=this.io;this.subs=[Pt(d,"open",this.onopen.bind(this)),Pt(d,"packet",this.onpacket.bind(this)),Pt(d,"error",this.onerror.bind(this)),Pt(d,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...d){return d.unshift("message"),this.emit.apply(this,d),this}emit(d,...h){var E,M,U;if(s_.hasOwnProperty(d))throw new Error('"'+d.toString()+'" is a reserved event name');if(h.unshift(d),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(h),this;const F={type:Ce.EVENT,data:h};if(F.options={},F.options.compress=this.flags.compress!==!1,typeof h[h.length-1]=="function"){const w=this.ids++,f=h.pop();this._registerAckCallback(w,f),F.id=w}const l=(M=(E=this.io.engine)===null||E===void 0?void 0:E.transport)===null||M===void 0?void 0:M.writable,u=this.connected&&!(!((U=this.io.engine)===null||U===void 0)&&U._hasPingExpired());return this.flags.volatile&&!l||(u?(this.notifyOutgoingListeners(F),this.packet(F)):this.sendBuffer.push(F)),this.flags={},this}_registerAckCallback(d,h){var E;const M=(E=this.flags.timeout)!==null&&E!==void 0?E:this._opts.ackTimeout;if(M===void 0){this.acks[d]=h;return}const U=this.io.setTimeoutFn(()=>{delete this.acks[d];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===d&&this.sendBuffer.splice(l,1);h.call(this,new Error("operation has timed out"))},M),F=(...l)=>{this.io.clearTimeoutFn(U),h.apply(this,l)};F.withError=!0,this.acks[d]=F}emitWithAck(d,...h){return new Promise((E,M)=>{const U=(F,l)=>F?M(F):E(l);U.withError=!0,h.push(U),this.emit(d,...h)})}_addToQueue(d){let h;typeof d[d.length-1]=="function"&&(h=d.pop());const E={id:this._queueSeq++,tryCount:0,pending:!1,args:d,flags:Object.assign({fromQueue:!0},this.flags)};d.push((M,...U)=>(this._queue[0],M!==null?E.tryCount>this._opts.retries&&(this._queue.shift(),h&&h(M)):(this._queue.shift(),h&&h(null,...U)),E.pending=!1,this._drainQueue())),this._queue.push(E),this._drainQueue()}_drainQueue(d=!1){if(!this.connected||this._queue.length===0)return;const h=this._queue[0];h.pending&&!d||(h.pending=!0,h.tryCount++,this.flags=h.flags,this.emit.apply(this,h.args))}packet(d){d.nsp=this.nsp,this.io._packet(d)}onopen(){typeof this.auth=="function"?this.auth(d=>{this._sendConnectPacket(d)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(d){this.packet({type:Ce.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},d):d})}onerror(d){this.connected||this.emitReserved("connect_error",d)}onclose(d,h){this.connected=!1,delete this.id,this.emitReserved("disconnect",d,h),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(d=>{if(!this.sendBuffer.some(E=>String(E.id)===d)){const E=this.acks[d];delete this.acks[d],E.withError&&E.call(this,new Error("socket has been disconnected"))}})}onpacket(d){if(d.nsp===this.nsp)switch(d.type){case Ce.CONNECT:d.data&&d.data.sid?this.onconnect(d.data.sid,d.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ce.EVENT:case Ce.BINARY_EVENT:this.onevent(d);break;case Ce.ACK:case Ce.BINARY_ACK:this.onack(d);break;case Ce.DISCONNECT:this.ondisconnect();break;case Ce.CONNECT_ERROR:this.destroy();const E=new Error(d.data.message);E.data=d.data.data,this.emitReserved("connect_error",E);break}}onevent(d){const h=d.data||[];d.id!=null&&h.push(this.ack(d.id)),this.connected?this.emitEvent(h):this.receiveBuffer.push(Object.freeze(h))}emitEvent(d){if(this._anyListeners&&this._anyListeners.length){const h=this._anyListeners.slice();for(const E of h)E.apply(this,d)}super.emit.apply(this,d),this._pid&&d.length&&typeof d[d.length-1]=="string"&&(this._lastOffset=d[d.length-1])}ack(d){const h=this;let E=!1;return function(...M){E||(E=!0,h.packet({type:Ce.ACK,id:d,data:M}))}}onack(d){const h=this.acks[d.id];typeof h=="function"&&(delete this.acks[d.id],h.withError&&d.data.unshift(null),h.apply(this,d.data))}onconnect(d,h){this.id=d,this.recovered=h&&this._pid===h,this._pid=h,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(d=>this.emitEvent(d)),this.receiveBuffer=[],this.sendBuffer.forEach(d=>{this.notifyOutgoingListeners(d),this.packet(d)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(d=>d()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ce.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(d){return this.flags.compress=d,this}get volatile(){return this.flags.volatile=!0,this}timeout(d){return this.flags.timeout=d,this}onAny(d){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(d),this}prependAny(d){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(d),this}offAny(d){if(!this._anyListeners)return this;if(d){const h=this._anyListeners;for(let E=0;E<h.length;E++)if(d===h[E])return h.splice(E,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(d){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(d),this}prependAnyOutgoing(d){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(d),this}offAnyOutgoing(d){if(!this._anyOutgoingListeners)return this;if(d){const h=this._anyOutgoingListeners;for(let E=0;E<h.length;E++)if(d===h[E])return h.splice(E,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(d){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const h=this._anyOutgoingListeners.slice();for(const E of h)E.apply(this,d.data)}}}function ci(y){y=y||{},this.ms=y.min||100,this.max=y.max||1e4,this.factor=y.factor||2,this.jitter=y.jitter>0&&y.jitter<=1?y.jitter:0,this.attempts=0}ci.prototype.duration=function(){var y=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var d=Math.random(),h=Math.floor(d*this.jitter*y);y=(Math.floor(d*10)&1)==0?y-h:y+h}return Math.min(y,this.max)|0};ci.prototype.reset=function(){this.attempts=0};ci.prototype.setMin=function(y){this.ms=y};ci.prototype.setMax=function(y){this.max=y};ci.prototype.setJitter=function(y){this.jitter=y};class wl extends ze{constructor(d,h){var E;super(),this.nsps={},this.subs=[],d&&typeof d=="object"&&(h=d,d=void 0),h=h||{},h.path=h.path||"/socket.io",this.opts=h,pn(this,h),this.reconnection(h.reconnection!==!1),this.reconnectionAttempts(h.reconnectionAttempts||1/0),this.reconnectionDelay(h.reconnectionDelay||1e3),this.reconnectionDelayMax(h.reconnectionDelayMax||5e3),this.randomizationFactor((E=h.randomizationFactor)!==null&&E!==void 0?E:.5),this.backoff=new ci({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(h.timeout==null?2e4:h.timeout),this._readyState="closed",this.uri=d;const M=h.parser||i_;this.encoder=new M.Encoder,this.decoder=new M.Decoder,this._autoConnect=h.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(d){return arguments.length?(this._reconnection=!!d,d||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(d){return d===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=d,this)}reconnectionDelay(d){var h;return d===void 0?this._reconnectionDelay:(this._reconnectionDelay=d,(h=this.backoff)===null||h===void 0||h.setMin(d),this)}randomizationFactor(d){var h;return d===void 0?this._randomizationFactor:(this._randomizationFactor=d,(h=this.backoff)===null||h===void 0||h.setJitter(d),this)}reconnectionDelayMax(d){var h;return d===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=d,(h=this.backoff)===null||h===void 0||h.setMax(d),this)}timeout(d){return arguments.length?(this._timeout=d,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(d){if(~this._readyState.indexOf("open"))return this;this.engine=new zf(this.uri,this.opts);const h=this.engine,E=this;this._readyState="opening",this.skipReconnect=!1;const M=Pt(h,"open",function(){E.onopen(),d&&d()}),U=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),d?d(l):this.maybeReconnectOnOpen()},F=Pt(h,"error",U);if(this._timeout!==!1){const l=this._timeout,u=this.setTimeoutFn(()=>{M(),U(new Error("timeout")),h.close()},l);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}return this.subs.push(M),this.subs.push(F),this}connect(d){return this.open(d)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const d=this.engine;this.subs.push(Pt(d,"ping",this.onping.bind(this)),Pt(d,"data",this.ondata.bind(this)),Pt(d,"error",this.onerror.bind(this)),Pt(d,"close",this.onclose.bind(this)),Pt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(d){try{this.decoder.add(d)}catch(h){this.onclose("parse error",h)}}ondecoded(d){_n(()=>{this.emitReserved("packet",d)},this.setTimeoutFn)}onerror(d){this.emitReserved("error",d)}socket(d,h){let E=this.nsps[d];return E?this._autoConnect&&!E.active&&E.connect():(E=new Kh(this,d,h),this.nsps[d]=E),E}_destroy(d){const h=Object.keys(this.nsps);for(const E of h)if(this.nsps[E].active)return;this._close()}_packet(d){const h=this.encoder.encode(d);for(let E=0;E<h.length;E++)this.engine.write(h[E],d.options)}cleanup(){this.subs.forEach(d=>d()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(d,h){var E;this.cleanup(),(E=this.engine)===null||E===void 0||E.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",d,h),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const d=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const h=this.backoff.duration();this._reconnecting=!0;const E=this.setTimeoutFn(()=>{d.skipReconnect||(this.emitReserved("reconnect_attempt",d.backoff.attempts),!d.skipReconnect&&d.open(M=>{M?(d._reconnecting=!1,d.reconnect(),this.emitReserved("reconnect_error",M)):d.onreconnect()}))},h);this.opts.autoUnref&&E.unref(),this.subs.push(()=>{this.clearTimeoutFn(E)})}}onreconnect(){const d=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",d)}}const qi={};function dn(y,d){typeof y=="object"&&(d=y,y=void 0),d=d||{};const h=Uf(y,d.path||"/socket.io"),E=h.source,M=h.id,U=h.path,F=qi[M]&&U in qi[M].nsps,l=d.forceNew||d["force new connection"]||d.multiplex===!1||F;let u;return l?u=new wl(E,d):(qi[M]||(qi[M]=new wl(E,d)),u=qi[M]),h.query&&!d.query&&(d.query=h.queryKey),u.socket(h.path,d)}Object.assign(dn,{Manager:wl,Socket:Kh,io:dn,connect:dn});let kt=null;function Ll(){const[y,d]=$e.useState(!1),h=$e.useRef(null);$e.useEffect(()=>{kt||(kt=dn(window.location.origin,{reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3})),h.current=kt;const F=()=>{console.log("Socket connected"),d(!0)},l=()=>{console.log("Socket disconnected"),d(!1)};return kt.on("connect",F),kt.on("disconnect",l),kt.connected&&d(!0),()=>{kt==null||kt.off("connect",F),kt==null||kt.off("disconnect",l)}},[]);const E=$e.useCallback((F,l)=>{var u;(u=h.current)==null||u.emit(F,l)},[]),M=$e.useCallback((F,l)=>{var u;(u=h.current)==null||u.on(F,l)},[]),U=$e.useCallback((F,l)=>{var u,v;l?(u=h.current)==null||u.off(F,l):(v=h.current)==null||v.off(F)},[]);return{socket:h.current,connected:y,emit:E,on:M,off:U}}function n_(){const y=Ve(d=>d.projectInfo);return X.jsxs("header",{className:"header",children:[X.jsx("h1",{children:of}),X.jsxs("div",{className:"project-info",children:[y&&X.jsxs(X.Fragment,{children:[X.jsxs("span",{className:"branch",children:[X.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:X.jsx("path",{d:"M11.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5zm-2.25.75a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25zM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5zM3.5 3.25a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0z"})}),y.currentBranch||"Unknown"]}),X.jsx("span",{children:y.cwd})]}),X.jsxs("span",{children:["v",lf]})]})]})}const o_=[{id:"branch",number:1,label:"Branch"},{id:"worktree",number:2,label:"Count"}];function l_({number:y,label:d,status:h,onClick:E,disabled:M}){return X.jsxs("button",{className:`lnb-step ${h}`,onClick:E,disabled:M,type:"button",children:[X.jsx("span",{className:"step-number",children:h==="completed"?"✓":y}),X.jsx("span",{className:"step-label",children:d})]})}function a_(){const{step:y,goToStep:d,canNavigateTo:h,getStepStatus:E,isSetupCollapsed:M,toggleSetupCollapse:U,terminals:F}=Ve(),l=F.length>0;return X.jsxs("div",{className:"lnb-section setup-section",children:[X.jsxs("div",{className:"lnb-section-header",onClick:U,role:"button",tabIndex:0,children:[X.jsx("span",{className:"section-title",children:"SETUP"}),X.jsx("span",{className:"collapse-icon",children:M?"+":"−"})]}),!M&&X.jsxs("div",{className:"lnb-steps",children:[o_.map(u=>X.jsx(l_,{step:u.id,number:u.number,label:u.label,status:E(u.id),onClick:()=>d(u.id),disabled:!h(u.id)},u.id)),l&&X.jsxs("button",{className:`lnb-step ${y==="running"?"current":"completed"}`,onClick:()=>d("running"),type:"button",children:[X.jsx("span",{className:"step-number",children:"3"}),X.jsx("span",{className:"step-label",children:"Running"})]})]})]})}function c_({status:y}){const d={initializing:"#f59e0b",running:"#22c55e",stopped:"#6b7280",error:"#ef4444"};return X.jsx("span",{className:"status-indicator",style:{backgroundColor:d[y]},title:y})}function h_({sessionId:y,worktreeName:d,status:h,isActive:E,isSelected:M,onSelect:U,onToggleSelect:F,onClose:l}){return X.jsxs("div",{className:`session-item ${E?"active":""} ${M?"selected":""}`,onClick:U,role:"button",tabIndex:0,children:[X.jsx("input",{type:"checkbox",className:"session-checkbox",checked:M,onClick:F,onChange:()=>{}}),X.jsx(c_,{status:h}),X.jsx("span",{className:"session-name",title:d,children:d}),X.jsx("button",{className:"session-close",onClick:l,title:"Close session",type:"button",children:"×"})]})}function u_({branchName:y,sessionCount:d,isCollapsed:h,onToggleCollapse:E,children:M}){return X.jsxs("div",{className:"session-group",children:[X.jsxs("div",{className:"session-group-header",onClick:E,role:"button",tabIndex:0,children:[X.jsx("span",{className:"group-collapse-icon",children:h?"▶":"▼"}),X.jsx("span",{className:"group-name",children:y}),X.jsxs("span",{className:"group-count",children:["(",d,")"]})]}),!h&&X.jsx("div",{className:"session-group-items",children:M})]})}function d_(){const{terminals:y,activeSessionId:d,selectedSessionIds:h,getSessionGroups:E,setActiveSession:M,toggleSessionSelection:U,toggleBranchCollapse:F,removeTerminal:l,openModal:u}=Ve(),v=E(),w=async(f,g,C)=>{f.stopPropagation();try{(await fetch(`/api/worktrees/${encodeURIComponent(C)}`,{method:"DELETE"})).ok&&l(g)}catch(x){console.error("Failed to close session:",x)}};return y.length===0?null:X.jsxs("div",{className:"lnb-section sessions-section",children:[X.jsxs("div",{className:"lnb-section-header",children:[X.jsx("span",{className:"section-title",children:"SESSIONS"}),X.jsx("span",{className:"session-count",children:y.length})]}),X.jsx("div",{className:"session-list",children:v.map(f=>X.jsx(u_,{branchName:f.branchName,sessionCount:f.sessions.length,isCollapsed:f.isCollapsed,onToggleCollapse:()=>F(f.branchName),children:f.sessions.map(g=>X.jsx(h_,{sessionId:g.sessionId,worktreeName:g.worktreeName,status:g.status,isActive:g.sessionId===d,isSelected:h.includes(g.sessionId),onSelect:()=>M(g.sessionId),onToggleSelect:C=>{C.stopPropagation(),U(g.sessionId)},onClose:C=>w(C,g.sessionId,g.worktreeName)},g.sessionId))},f.branchName))}),X.jsx("button",{className:"add-session-btn",onClick:()=>u("addWorktree"),type:"button",children:"+ Add Session"})]})}function f_(){const{selectedSessionIds:y,clearSessionSelection:d,openModal:h}=Ve();return y.length===0?null:X.jsxs("div",{className:"bulk-actions-bar",children:[X.jsxs("span",{className:"selected-count",children:[y.length," selected"]}),X.jsx("button",{className:"bulk-delete-btn",onClick:()=>h("confirmDelete",{sessionIds:y}),type:"button",children:"Delete"}),X.jsx("button",{className:"bulk-cancel-btn",onClick:d,type:"button",children:"Cancel"})]})}function __(){return X.jsxs("nav",{className:"left-nav-bar",children:[X.jsx(a_,{}),X.jsx(d_,{}),X.jsx(f_,{})]})}function p_({children:y}){return X.jsxs("div",{className:"main-layout",children:[X.jsx(__,{}),X.jsx("div",{className:"main-content-area with-lnb",children:y})]})}function qh({children:y,title:d,description:h,showNavButtons:E=!0,nextLabel:M="Next",onNext:U,nextDisabled:F=!1}){const{step:l,goToNext:u,goToPrev:v,isStepComplete:w}=Ve(),f=l==="branch",g=w(l),C=()=>{U?U():u()};return X.jsxs("div",{className:"step-container",children:[X.jsxs("div",{className:"step-header",children:[X.jsx("h2",{children:d}),h&&X.jsx("p",{children:h})]}),X.jsx("div",{className:"step-content",children:y}),E&&X.jsxs("div",{className:"step-navigation",children:[X.jsx("button",{className:"nav-button prev",onClick:v,disabled:f,type:"button",children:"Previous"}),X.jsx("button",{className:"nav-button next",onClick:C,disabled:F||!g,type:"button",children:M})]})]})}function v_(){const{branches:y,selectedBranch:d,setSelectedBranch:h}=Ve();return X.jsxs("div",{className:"setup-section",children:[X.jsx("label",{htmlFor:"branch-select",children:"Select Branch"}),X.jsxs("select",{id:"branch-select",value:d||"",onChange:E=>h(E.target.value||null),children:[X.jsx("option",{value:"",children:"-- Select a branch --"}),y.map(E=>X.jsxs("option",{value:E.name,children:[E.name,E.isCurrent?" (current)":"",E.isRemote?" (remote)":""]},E.name))]})]})}function Dh(){const y=Ve(d=>d.selectedBranch);return X.jsx(qh,{title:"Select Branch",description:"Choose the Git branch to create worktrees from",nextDisabled:!y,children:X.jsx(v_,{})})}function m_(){const{worktreeCount:y,incrementWorktreeCount:d,decrementWorktreeCount:h}=Ve();return X.jsxs("div",{className:"setup-section",children:[X.jsx("label",{children:"Number of Worktrees"}),X.jsxs("div",{className:"counter",children:[X.jsx("button",{onClick:h,disabled:y<=an,children:"-"}),X.jsx("span",{children:y}),X.jsx("button",{onClick:d,disabled:y>=pl,children:"+"})]})]})}function g_(){const{execute:y,isLoading:d,selectedBranch:h,worktreeCount:E}=Ve();return X.jsxs(qh,{title:"Configure Worktrees",description:"Set the number of parallel worktrees to create",nextLabel:d?"Creating...":"Execute",onNext:y,nextDisabled:!h||d||E<1,children:[X.jsx(m_,{}),X.jsxs("div",{className:"execution-summary",children:[X.jsx("h4",{children:"Summary"}),X.jsxs("div",{className:"summary-item",children:[X.jsx("span",{className:"summary-label",children:"Branch:"}),X.jsx("span",{className:"summary-value",children:h})]}),X.jsxs("div",{className:"summary-item",children:[X.jsx("span",{className:"summary-label",children:"Worktrees:"}),X.jsx("span",{className:"summary-value",children:E})]})]})]})}var fl={exports:{}},Th;function S_(){return Th||(Th=1,(function(y,d){(function(h,E){y.exports=E()})(globalThis,(()=>(()=>{var h={4567:function(F,l,u){var v=this&&this.__decorate||function(s,n,p,b){var k,R=arguments.length,S=R<3?n:b===null?b=Object.getOwnPropertyDescriptor(n,p):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(s,n,p,b);else for(var A=s.length-1;A>=0;A--)(k=s[A])&&(S=(R<3?k(S):R>3?k(n,p,S):k(n,p))||S);return R>3&&S&&Object.defineProperty(n,p,S),S},w=this&&this.__param||function(s,n){return function(p,b){n(p,b,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const f=u(9042),g=u(9924),C=u(844),x=u(4725),m=u(2585),o=u(3656);let a=l.AccessibilityManager=class extends C.Disposable{constructor(s,n,p,b){super(),this._terminal=s,this._coreBrowserService=p,this._renderService=b,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let k=0;k<this._terminal.rows;k++)this._rowElements[k]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[k]);if(this._topBoundaryFocusListener=k=>this._handleBoundaryFocus(k,0),this._bottomBoundaryFocusListener=k=>this._handleBoundaryFocus(k,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new g.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((k=>this._handleResize(k.rows)))),this.register(this._terminal.onRender((k=>this._refreshRows(k.start,k.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((k=>this._handleChar(k)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
41
+ `)))),this.register(this._terminal.onA11yTab((k=>this._handleTab(k)))),this.register(this._terminal.onKey((k=>this._handleKey(k.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,o.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,C.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(s){for(let n=0;n<s;n++)this._handleChar(" ")}_handleChar(s){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==s&&(this._charsToAnnounce+=s):this._charsToAnnounce+=s,s===`
42
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(s){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(s)||this._charsToConsume.push(s)}_refreshRows(s,n){this._liveRegionDebouncer.refresh(s,n,this._terminal.rows)}_renderRows(s,n){const p=this._terminal.buffer,b=p.lines.length.toString();for(let k=s;k<=n;k++){const R=p.lines.get(p.ydisp+k),S=[],A=(R==null?void 0:R.translateToString(!0,void 0,void 0,S))||"",H=(p.ydisp+k+1).toString(),j=this._rowElements[k];j&&(A.length===0?(j.innerText=" ",this._rowColumns.set(j,[0,1])):(j.textContent=A,this._rowColumns.set(j,S)),j.setAttribute("aria-posinset",H),j.setAttribute("aria-setsize",b))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(s,n){const p=s.target,b=this._rowElements[n===0?1:this._rowElements.length-2];if(p.getAttribute("aria-posinset")===(n===0?"1":`${this._terminal.buffer.lines.length}`)||s.relatedTarget!==b)return;let k,R;if(n===0?(k=p,R=this._rowElements.pop(),this._rowContainer.removeChild(R)):(k=this._rowElements.shift(),R=p,this._rowContainer.removeChild(k)),k.removeEventListener("focus",this._topBoundaryFocusListener),R.removeEventListener("focus",this._bottomBoundaryFocusListener),n===0){const S=this._createAccessibilityTreeNode();this._rowElements.unshift(S),this._rowContainer.insertAdjacentElement("afterbegin",S)}else{const S=this._createAccessibilityTreeNode();this._rowElements.push(S),this._rowContainer.appendChild(S)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(n===0?-1:1),this._rowElements[n===0?1:this._rowElements.length-2].focus(),s.preventDefault(),s.stopImmediatePropagation()}_handleSelectionChange(){var A;if(this._rowElements.length===0)return;const s=document.getSelection();if(!s)return;if(s.isCollapsed)return void(this._rowContainer.contains(s.anchorNode)&&this._terminal.clearSelection());if(!s.anchorNode||!s.focusNode)return void console.error("anchorNode and/or focusNode are null");let n={node:s.anchorNode,offset:s.anchorOffset},p={node:s.focusNode,offset:s.focusOffset};if((n.node.compareDocumentPosition(p.node)&Node.DOCUMENT_POSITION_PRECEDING||n.node===p.node&&n.offset>p.offset)&&([n,p]=[p,n]),n.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(n={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(n.node))return;const b=this._rowElements.slice(-1)[0];if(p.node.compareDocumentPosition(b)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(p={node:b,offset:((A=b.textContent)==null?void 0:A.length)??0}),!this._rowContainer.contains(p.node))return;const k=({node:H,offset:j})=>{const $=H instanceof Text?H.parentNode:H;let I=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(I))return console.warn("row is invalid. Race condition?"),null;const Q=this._rowColumns.get($);if(!Q)return console.warn("columns is null. Race condition?"),null;let te=j<Q.length?Q[j]:Q.slice(-1)[0]+1;return te>=this._terminal.cols&&(++I,te=0),{row:I,column:te}},R=k(n),S=k(p);if(R&&S){if(R.row>S.row||R.row===S.row&&R.column>=S.column)throw new Error("invalid range");this._terminal.select(R.column,R.row,(S.row-R.row)*this._terminal.cols-R.column+S.column)}}_handleResize(s){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let n=this._rowContainer.children.length;n<this._terminal.rows;n++)this._rowElements[n]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[n]);for(;this._rowElements.length>s;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const s=this._coreBrowserService.mainDocument.createElement("div");return s.setAttribute("role","listitem"),s.tabIndex=-1,this._refreshRowDimensions(s),s}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let s=0;s<this._terminal.rows;s++)this._refreshRowDimensions(this._rowElements[s])}}_refreshRowDimensions(s){s.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=a=v([w(1,m.IInstantiationService),w(2,x.ICoreBrowserService),w(3,x.IRenderService)],a)},3614:(F,l)=>{function u(g){return g.replace(/\r?\n/g,"\r")}function v(g,C){return C?"\x1B[200~"+g+"\x1B[201~":g}function w(g,C,x,m){g=v(g=u(g),x.decPrivateModes.bracketedPasteMode&&m.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(g,!0),C.value=""}function f(g,C,x){const m=x.getBoundingClientRect(),o=g.clientX-m.left-10,a=g.clientY-m.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${o}px`,C.style.top=`${a}px`,C.style.zIndex="1000",C.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=u,l.bracketTextForPaste=v,l.copyHandler=function(g,C){g.clipboardData&&g.clipboardData.setData("text/plain",C.selectionText),g.preventDefault()},l.handlePasteEvent=function(g,C,x,m){g.stopPropagation(),g.clipboardData&&w(g.clipboardData.getData("text/plain"),C,x,m)},l.paste=w,l.moveTextAreaUnderMouseCursor=f,l.rightClickHandler=function(g,C,x,m,o){f(g,C,x),o&&m.rightClickSelect(g),C.value=m.selectionText,C.select()}},7239:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const v=u(1505);l.ColorContrastCache=class{constructor(){this._color=new v.TwoKeyMap,this._css=new v.TwoKeyMap}setCss(w,f,g){this._css.set(w,f,g)}getCss(w,f){return this._css.get(w,f)}setColor(w,f,g){this._color.set(w,f,g)}getColor(w,f){return this._color.get(w,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(u,v,w,f){u.addEventListener(v,w,f);let g=!1;return{dispose:()=>{g||(g=!0,u.removeEventListener(v,w,f))}}}},3551:function(F,l,u){var v=this&&this.__decorate||function(a,s,n,p){var b,k=arguments.length,R=k<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,n):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(a,s,n,p);else for(var S=a.length-1;S>=0;S--)(b=a[S])&&(R=(k<3?b(R):k>3?b(s,n,R):b(s,n))||R);return k>3&&R&&Object.defineProperty(s,n,R),R},w=this&&this.__param||function(a,s){return function(n,p){s(n,p,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const f=u(3656),g=u(8460),C=u(844),x=u(2585),m=u(4725);let o=l.Linkifier=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(a,s,n,p,b){super(),this._element=a,this._mouseService=s,this._renderService=n,this._bufferService=p,this._linkProviderService=b,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.toDisposable)((()=>{var k;this._lastMouseEvent=void 0,(k=this._activeProviderReplies)==null||k.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(a){this._lastMouseEvent=a;const s=this._positionFromMouseEvent(a,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const n=a.composedPath();for(let p=0;p<n.length;p++){const b=n[p];if(b.classList.contains("xterm"))break;if(b.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(a){if(this._activeLine!==a.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(a,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,a)||(this._clearCurrentLink(),this._askForLink(a,!0))}_askForLink(a,s){var p,b;this._activeProviderReplies&&s||((p=this._activeProviderReplies)==null||p.forEach((k=>{k==null||k.forEach((R=>{R.link.dispose&&R.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=a.y);let n=!1;for(const[k,R]of this._linkProviderService.linkProviders.entries())s?(b=this._activeProviderReplies)!=null&&b.get(k)&&(n=this._checkLinkProviderResult(k,a,n)):R.provideLinks(a.y,(S=>{var H,j;if(this._isMouseOut)return;const A=S==null?void 0:S.map(($=>({link:$})));(H=this._activeProviderReplies)==null||H.set(k,A),n=this._checkLinkProviderResult(k,a,n),((j=this._activeProviderReplies)==null?void 0:j.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(a.y,this._activeProviderReplies)}))}_removeIntersectingLinks(a,s){const n=new Set;for(let p=0;p<s.size;p++){const b=s.get(p);if(b)for(let k=0;k<b.length;k++){const R=b[k],S=R.link.range.start.y<a?0:R.link.range.start.x,A=R.link.range.end.y>a?this._bufferService.cols:R.link.range.end.x;for(let H=S;H<=A;H++){if(n.has(H)){b.splice(k--,1);break}n.add(H)}}}}_checkLinkProviderResult(a,s,n){var k;if(!this._activeProviderReplies)return n;const p=this._activeProviderReplies.get(a);let b=!1;for(let R=0;R<a;R++)this._activeProviderReplies.has(R)&&!this._activeProviderReplies.get(R)||(b=!0);if(!b&&p){const R=p.find((S=>this._linkAtPosition(S.link,s)));R&&(n=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let R=0;R<this._activeProviderReplies.size;R++){const S=(k=this._activeProviderReplies.get(R))==null?void 0:k.find((A=>this._linkAtPosition(A.link,s)));if(S){n=!0,this._handleNewLink(S);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(a){if(!this._currentLink)return;const s=this._positionFromMouseEvent(a,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(a,this._currentLink.link.text)}_clearCurrentLink(a,s){this._currentLink&&this._lastMouseEvent&&(!a||!s||this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(a){if(!this._lastMouseEvent)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(a.link,s)&&(this._currentLink=a,this._currentLink.state={decorations:{underline:a.link.decorations===void 0||a.link.decorations.underline,pointerCursor:a.link.decorations===void 0||a.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,a.link,this._lastMouseEvent),a.link.decorations={},Object.defineProperties(a.link.decorations,{pointerCursor:{get:()=>{var n,p;return(p=(n=this._currentLink)==null?void 0:n.state)==null?void 0:p.decorations.pointerCursor},set:n=>{var p;(p=this._currentLink)!=null&&p.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,p;return(p=(n=this._currentLink)==null?void 0:n.state)==null?void 0:p.decorations.underline},set:n=>{var p,b,k;(p=this._currentLink)!=null&&p.state&&((k=(b=this._currentLink)==null?void 0:b.state)==null?void 0:k.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(a.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((n=>{if(!this._currentLink)return;const p=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,b=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=b&&(this._clearCurrentLink(p,b),this._lastMouseEvent)){const k=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);k&&this._askForLink(k,!1)}}))))}_linkHover(a,s,n){var p;(p=this._currentLink)!=null&&p.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&a.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(n,s.text)}_fireUnderlineEvent(a,s){const n=a.range,p=this._bufferService.buffer.ydisp,b=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-p-1,n.end.x,n.end.y-p-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(b)}_linkLeave(a,s,n){var p;(p=this._currentLink)!=null&&p.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&a.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(n,s.text)}_linkAtPosition(a,s){const n=a.range.start.y*this._bufferService.cols+a.range.start.x,p=a.range.end.y*this._bufferService.cols+a.range.end.x,b=s.y*this._bufferService.cols+s.x;return n<=b&&b<=p}_positionFromMouseEvent(a,s,n){const p=n.getCoords(a,s,this._bufferService.cols,this._bufferService.rows);if(p)return{x:p[0],y:p[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(a,s,n,p,b){return{x1:a,y1:s,x2:n,y2:p,cols:this._bufferService.cols,fg:b}}};l.Linkifier=o=v([w(1,m.IMouseService),w(2,m.IRenderService),w(3,x.IBufferService),w(4,m.ILinkProviderService)],o)},9042:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(F,l,u){var v=this&&this.__decorate||function(m,o,a,s){var n,p=arguments.length,b=p<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,a):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(m,o,a,s);else for(var k=m.length-1;k>=0;k--)(n=m[k])&&(b=(p<3?n(b):p>3?n(o,a,b):n(o,a))||b);return p>3&&b&&Object.defineProperty(o,a,b),b},w=this&&this.__param||function(m,o){return function(a,s){o(a,s,m)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const f=u(511),g=u(2585);let C=l.OscLinkProvider=class{constructor(m,o,a){this._bufferService=m,this._optionsService=o,this._oscLinkService=a}provideLinks(m,o){var A;const a=this._bufferService.buffer.lines.get(m-1);if(!a)return void o(void 0);const s=[],n=this._optionsService.rawOptions.linkHandler,p=new f.CellData,b=a.getTrimmedLength();let k=-1,R=-1,S=!1;for(let H=0;H<b;H++)if(R!==-1||a.hasContent(H)){if(a.loadCell(H,p),p.hasExtendedAttrs()&&p.extended.urlId){if(R===-1){R=H,k=p.extended.urlId;continue}S=p.extended.urlId!==k}else R!==-1&&(S=!0);if(S||R!==-1&&H===b-1){const j=(A=this._oscLinkService.getLinkData(k))==null?void 0:A.uri;if(j){const $={start:{x:R+1,y:m},end:{x:H+(S||H!==b-1?0:1),y:m}};let I=!1;if(!(n!=null&&n.allowNonHttpProtocols))try{const Q=new URL(j);["http:","https:"].includes(Q.protocol)||(I=!0)}catch{I=!0}I||s.push({text:j,range:$,activate:(Q,te)=>n?n.activate(Q,te,$):x(0,te),hover:(Q,te)=>{var ne;return(ne=n==null?void 0:n.hover)==null?void 0:ne.call(n,Q,te,$)},leave:(Q,te)=>{var ne;return(ne=n==null?void 0:n.leave)==null?void 0:ne.call(n,Q,te,$)}})}S=!1,p.hasExtendedAttrs()&&p.extended.urlId?(R=H,k=p.extended.urlId):(R=-1,k=-1)}}o(s)}};function x(m,o){if(confirm(`Do you want to navigate to ${o}?
43
+
44
+ WARNING: This link could potentially be dangerous`)){const a=window.open();if(a){try{a.opener=null}catch{}a.location.href=o}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=C=v([w(0,g.IBufferService),w(1,g.IOptionsService),w(2,g.IOscLinkService)],C)},6193:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(u,v){this._renderCallback=u,this._coreBrowserService=v,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,v,w){this._rowCount=w,u=u!==void 0?u:0,v=v!==void 0?v:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,v):v,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),v=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,v),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const v=u(3614),w=u(3656),f=u(3551),g=u(9042),C=u(3730),x=u(1680),m=u(3107),o=u(5744),a=u(2950),s=u(1296),n=u(428),p=u(4269),b=u(5114),k=u(8934),R=u(3230),S=u(9312),A=u(4725),H=u(6731),j=u(8055),$=u(8969),I=u(8460),Q=u(844),te=u(6114),ne=u(8437),le=u(2584),G=u(7399),L=u(5941),O=u(9074),T=u(2585),P=u(5435),Z=u(4567),re=u(779);class ce extends $.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(W={}){super(W),this.browser=te,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Q.MutableDisposable),this._onCursorMove=this.register(new I.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new I.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new I.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new I.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new I.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new I.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new I.EventEmitter),this._onBlur=this.register(new I.EventEmitter),this._onA11yCharEmitter=this.register(new I.EventEmitter),this._onA11yTabEmitter=this.register(new I.EventEmitter),this._onWillOpen=this.register(new I.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(O.DecorationService),this._instantiationService.setService(T.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(re.LinkProviderService),this._instantiationService.setService(A.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((B,ee)=>this.refresh(B,ee)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((B=>this._reportWindowsOptions(B)))),this.register(this._inputHandler.onColor((B=>this._handleColorEvent(B)))),this.register((0,I.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,I.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((B=>this._afterResize(B.cols,B.rows)))),this.register((0,Q.toDisposable)((()=>{var B,ee;this._customKeyEventHandler=void 0,(ee=(B=this.element)==null?void 0:B.parentNode)==null||ee.removeChild(this.element)})))}_handleColorEvent(W){if(this._themeService)for(const B of W){let ee,J="";switch(B.index){case 256:ee="foreground",J="10";break;case 257:ee="background",J="11";break;case 258:ee="cursor",J="12";break;default:ee="ansi",J="4;"+B.index}switch(B.type){case 0:const de=j.color.toColorRGB(ee==="ansi"?this._themeService.colors.ansi[B.index]:this._themeService.colors[ee]);this.coreService.triggerDataEvent(`${le.C0.ESC}]${J};${(0,L.toRgbString)(de)}${le.C1_ESCAPED.ST}`);break;case 1:if(ee==="ansi")this._themeService.modifyColors((ue=>ue.ansi[B.index]=j.channels.toColor(...B.color)));else{const ue=ee;this._themeService.modifyColors((Ee=>Ee[ue]=j.channels.toColor(...B.color)))}break;case 2:this._themeService.restoreColor(B.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(W){W?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(W){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(le.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var W;return(W=this.textarea)==null?void 0:W.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(le.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const W=this.buffer.ybase+this.buffer.y,B=this.buffer.lines.get(W);if(!B)return;const ee=Math.min(this.buffer.x,this.cols-1),J=this._renderService.dimensions.css.cell.height,de=B.getWidth(ee),ue=this._renderService.dimensions.css.cell.width*de,Ee=this.buffer.y*this._renderService.dimensions.css.cell.height,Le=ee*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Le+"px",this.textarea.style.top=Ee+"px",this.textarea.style.width=ue+"px",this.textarea.style.height=J+"px",this.textarea.style.lineHeight=J+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,w.addDisposableDomListener)(this.element,"copy",(B=>{this.hasSelection()&&(0,v.copyHandler)(B,this._selectionService)})));const W=B=>(0,v.handlePasteEvent)(B,this.textarea,this.coreService,this.optionsService);this.register((0,w.addDisposableDomListener)(this.textarea,"paste",W)),this.register((0,w.addDisposableDomListener)(this.element,"paste",W)),te.isFirefox?this.register((0,w.addDisposableDomListener)(this.element,"mousedown",(B=>{B.button===2&&(0,v.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,w.addDisposableDomListener)(this.element,"contextmenu",(B=>{(0,v.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),te.isLinux&&this.register((0,w.addDisposableDomListener)(this.element,"auxclick",(B=>{B.button===1&&(0,v.moveTextAreaUnderMouseCursor)(B,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,w.addDisposableDomListener)(this.textarea,"keyup",(W=>this._keyUp(W)),!0)),this.register((0,w.addDisposableDomListener)(this.textarea,"keydown",(W=>this._keyDown(W)),!0)),this.register((0,w.addDisposableDomListener)(this.textarea,"keypress",(W=>this._keyPress(W)),!0)),this.register((0,w.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,w.addDisposableDomListener)(this.textarea,"compositionupdate",(W=>this._compositionHelper.compositionupdate(W)))),this.register((0,w.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,w.addDisposableDomListener)(this.textarea,"input",(W=>this._inputEvent(W)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(W){var ee;if(!W)throw new Error("Terminal requires a parent element.");if(W.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ee=this.element)==null?void 0:ee.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=W.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"),W.appendChild(this.element);const B=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),B.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,w.addDisposableDomListener)(this.screenElement,"mousemove",(J=>this.updateCursorStyle(J)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),B.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),te.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(b.CoreBrowserService,this.textarea,W.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(A.ICoreBrowserService,this._coreBrowserService),this.register((0,w.addDisposableDomListener)(this.textarea,"focus",(J=>this._handleTextAreaFocus(J)))),this.register((0,w.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(n.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(A.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(H.ThemeService),this._instantiationService.setService(A.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(p.CharacterJoinerService),this._instantiationService.setService(A.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(R.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(A.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((J=>this._onRender.fire(J)))),this.onResize((J=>this._renderService.resize(J.cols,J.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(a.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(k.MouseService),this._instantiationService.setService(A.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(B);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((J=>this.scrollLines(J.amount,J.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(S.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(A.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((J=>this.scrollLines(J.amount,J.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((J=>this._renderService.handleSelectionChanged(J.start,J.end,J.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((J=>{this.textarea.value=J,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((J=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,w.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(m.BufferDecorationRenderer,this.screenElement)),this.register((0,w.addDisposableDomListener)(this.element,"mousedown",(J=>this._selectionService.handleMouseDown(J)))),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(Z.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(J=>this._handleScreenReaderModeOptionChange(J)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(J=>{!this._overviewRulerRenderer&&J&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(s.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const W=this,B=this.element;function ee(ue){const Ee=W._mouseService.getMouseReportCoords(ue,W.screenElement);if(!Ee)return!1;let Le,Te;switch(ue.overrideType||ue.type){case"mousemove":Te=32,ue.buttons===void 0?(Le=3,ue.button!==void 0&&(Le=ue.button<3?ue.button:3)):Le=1&ue.buttons?0:4&ue.buttons?1:2&ue.buttons?2:3;break;case"mouseup":Te=0,Le=ue.button<3?ue.button:3;break;case"mousedown":Te=1,Le=ue.button<3?ue.button:3;break;case"wheel":if(W._customWheelEventHandler&&W._customWheelEventHandler(ue)===!1||W.viewport.getLinesScrolled(ue)===0)return!1;Te=ue.deltaY<0?0:1,Le=4;break;default:return!1}return!(Te===void 0||Le===void 0||Le>4)&&W.coreMouseService.triggerMouseEvent({col:Ee.col,row:Ee.row,x:Ee.x,y:Ee.y,button:Le,action:Te,ctrl:ue.ctrlKey,alt:ue.altKey,shift:ue.shiftKey})}const J={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de={mouseup:ue=>(ee(ue),ue.buttons||(this._document.removeEventListener("mouseup",J.mouseup),J.mousedrag&&this._document.removeEventListener("mousemove",J.mousedrag)),this.cancel(ue)),wheel:ue=>(ee(ue),this.cancel(ue,!0)),mousedrag:ue=>{ue.buttons&&ee(ue)},mousemove:ue=>{ue.buttons||ee(ue)}};this.register(this.coreMouseService.onProtocolChange((ue=>{ue?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ue)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&ue?J.mousemove||(B.addEventListener("mousemove",de.mousemove),J.mousemove=de.mousemove):(B.removeEventListener("mousemove",J.mousemove),J.mousemove=null),16&ue?J.wheel||(B.addEventListener("wheel",de.wheel,{passive:!1}),J.wheel=de.wheel):(B.removeEventListener("wheel",J.wheel),J.wheel=null),2&ue?J.mouseup||(J.mouseup=de.mouseup):(this._document.removeEventListener("mouseup",J.mouseup),J.mouseup=null),4&ue?J.mousedrag||(J.mousedrag=de.mousedrag):(this._document.removeEventListener("mousemove",J.mousedrag),J.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,w.addDisposableDomListener)(B,"mousedown",(ue=>{if(ue.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ue))return ee(ue),J.mouseup&&this._document.addEventListener("mouseup",J.mouseup),J.mousedrag&&this._document.addEventListener("mousemove",J.mousedrag),this.cancel(ue)}))),this.register((0,w.addDisposableDomListener)(B,"wheel",(ue=>{if(!J.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ue)===!1)return!1;if(!this.buffer.hasScrollback){const Ee=this.viewport.getLinesScrolled(ue);if(Ee===0)return;const Le=le.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ue.deltaY<0?"A":"B");let Te="";for(let Ge=0;Ge<Math.abs(Ee);Ge++)Te+=Le;return this.coreService.triggerDataEvent(Te,!0),this.cancel(ue,!0)}return this.viewport.handleWheel(ue)?this.cancel(ue):void 0}}),{passive:!1})),this.register((0,w.addDisposableDomListener)(B,"touchstart",(ue=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ue),this.cancel(ue)}),{passive:!0})),this.register((0,w.addDisposableDomListener)(B,"touchmove",(ue=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ue)?void 0:this.cancel(ue)}),{passive:!1}))}refresh(W,B){var ee;(ee=this._renderService)==null||ee.refreshRows(W,B)}updateCursorStyle(W){var B;(B=this._selectionService)!=null&&B.shouldColumnSelect(W)?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(W,B,ee=0){var J;ee===1?(super.scrollLines(W,B,ee),this.refresh(0,this.rows-1)):(J=this.viewport)==null||J.scrollLines(W)}paste(W){(0,v.paste)(W,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(W){this._customKeyEventHandler=W}attachCustomWheelEventHandler(W){this._customWheelEventHandler=W}registerLinkProvider(W){return this._linkProviderService.registerLinkProvider(W)}registerCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const B=this._characterJoinerService.register(W);return this.refresh(0,this.rows-1),B}deregisterCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(W)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(W){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+W)}registerDecoration(W){return this._decorationService.registerDecoration(W)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(W,B,ee){this._selectionService.setSelection(W,B,ee)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var W;(W=this._selectionService)==null||W.clearSelection()}selectAll(){var W;(W=this._selectionService)==null||W.selectAll()}selectLines(W,B){var ee;(ee=this._selectionService)==null||ee.selectLines(W,B)}_keyDown(W){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;const B=this.browser.isMac&&this.options.macOptionIsMeta&&W.altKey;if(!B&&!this._compositionHelper.keydown(W))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;B||W.key!=="Dead"&&W.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ee=(0,G.evaluateKeyboardEvent)(W,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(W),ee.type===3||ee.type===2){const J=this.rows-1;return this.scrollLines(ee.type===2?-J:J),this.cancel(W,!0)}return ee.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,W)||(ee.cancel&&this.cancel(W,!0),!ee.key||!!(W.key&&!W.ctrlKey&&!W.altKey&&!W.metaKey&&W.key.length===1&&W.key.charCodeAt(0)>=65&&W.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ee.key!==le.C0.ETX&&ee.key!==le.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ee.key,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(ee.key,!0),!this.optionsService.rawOptions.screenReaderMode||W.altKey||W.ctrlKey?this.cancel(W,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(W,B){const ee=W.isMac&&!this.options.macOptionIsMeta&&B.altKey&&!B.ctrlKey&&!B.metaKey||W.isWindows&&B.altKey&&B.ctrlKey&&!B.metaKey||W.isWindows&&B.getModifierState("AltGraph");return B.type==="keypress"?ee:ee&&(!B.keyCode||B.keyCode>47)}_keyUp(W){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1||((function(B){return B.keyCode===16||B.keyCode===17||B.keyCode===18})(W)||this.focus(),this.updateCursorStyle(W),this._keyPressHandled=!1)}_keyPress(W){let B;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;if(this.cancel(W),W.charCode)B=W.charCode;else if(W.which===null||W.which===void 0)B=W.keyCode;else{if(W.which===0||W.charCode===0)return!1;B=W.which}return!(!B||(W.altKey||W.ctrlKey||W.metaKey)&&!this._isThirdLevelShift(this.browser,W)||(B=String.fromCharCode(B),this._onKey.fire({key:B,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(B,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(W){if(W.data&&W.inputType==="insertText"&&(!W.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const B=W.data;return this.coreService.triggerDataEvent(B,!0),this.cancel(W),!0}return!1}resize(W,B){W!==this.cols||B!==this.rows?super.resize(W,B):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(W,B){var ee,J;(ee=this._charSizeService)==null||ee.measure(),(J=this.viewport)==null||J.syncScrollArea(!0)}clear(){var W;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 B=1;B<this.rows;B++)this.buffer.lines.push(this.buffer.getBlankLine(ne.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(W=this.viewport)==null||W.reset(),this.refresh(0,this.rows-1)}}reset(){var B,ee;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),(B=this._selectionService)==null||B.reset(),this._decorationService.reset(),(ee=this.viewport)==null||ee.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var W;(W=this._renderService)==null||W.clearTextureAtlas()}_reportFocus(){var W;(W=this.element)!=null&&W.classList.contains("focus")?this.coreService.triggerDataEvent(le.C0.ESC+"[I"):this.coreService.triggerDataEvent(le.C0.ESC+"[O")}_reportWindowsOptions(W){if(this._renderService)switch(W){case P.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const B=this._renderService.dimensions.css.canvas.width.toFixed(0),ee=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${le.C0.ESC}[4;${ee};${B}t`);break;case P.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const J=this._renderService.dimensions.css.cell.width.toFixed(0),de=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${le.C0.ESC}[6;${de};${J}t`)}}cancel(W,B){if(this.options.cancelEvents||B)return W.preventDefault(),W.stopPropagation(),!1}}l.Terminal=ce},9924:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(u,v=1e3){this._renderCallback=u,this._debounceThresholdMS=v,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,v,w){this._rowCount=w,u=u!==void 0?u:0,v=v!==void 0?v:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,v):v;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=f-this._lastRefreshMs,C=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),C)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),v=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,v)}}},1680:function(F,l,u){var v=this&&this.__decorate||function(a,s,n,p){var b,k=arguments.length,R=k<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,n):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(a,s,n,p);else for(var S=a.length-1;S>=0;S--)(b=a[S])&&(R=(k<3?b(R):k>3?b(s,n,R):b(s,n))||R);return k>3&&R&&Object.defineProperty(s,n,R),R},w=this&&this.__param||function(a,s){return function(n,p){s(n,p,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const f=u(3656),g=u(4725),C=u(8460),x=u(844),m=u(2585);let o=l.Viewport=class extends x.Disposable{constructor(a,s,n,p,b,k,R,S){super(),this._viewportElement=a,this._scrollArea=s,this._bufferService=n,this._optionsService=p,this._charSizeService=b,this._renderService=k,this._coreBrowserService=R,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((A=>this._activeBuffer=A.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((A=>this._renderDimensions=A))),this._handleThemeChange(S.colors),this.register(S.onChangeColors((A=>this._handleThemeChange(A)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(a){this._viewportElement.style.backgroundColor=a.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(a){if(a)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==s&&(this._lastRecordedBufferHeight=s,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const a=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==a&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=a),this._refreshAnimationFrame=null}syncScrollArea(a=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(a);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(a)}_handleScroll(a){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const s=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const a=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(a*(this._smoothScrollState.target-this._smoothScrollState.origin)),a<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(a,s){const n=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&n<this._lastRecordedBufferHeight)||(a.cancelable&&a.preventDefault(),!1)}handleWheel(a){const s=this._getPixelsScrolled(a);return s!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+s:this._smoothScrollState.target+=s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=s,this._bubbleScroll(a,s))}scrollLines(a){if(a!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const s=a*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!1})}_getPixelsScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let s=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getBufferElements(a,s){var S;let n,p="";const b=[],k=s??this._bufferService.buffer.lines.length,R=this._bufferService.buffer.lines;for(let A=a;A<k;A++){const H=R.get(A);if(!H)continue;const j=(S=R.get(A+1))==null?void 0:S.isWrapped;if(p+=H.translateToString(!j),!j||A===R.length-1){const $=document.createElement("div");$.textContent=p,b.push($),p.length>0&&(n=$),p=""}}return{bufferElements:b,cursorElement:n}}getLinesScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let s=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=this._currentRowHeight+0,this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(a,s){const n=this._optionsService.rawOptions.fastScrollModifier;return n==="alt"&&s.altKey||n==="ctrl"&&s.ctrlKey||n==="shift"&&s.shiftKey?a*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:a*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(a){this._lastTouchY=a.touches[0].pageY}handleTouchMove(a){const s=this._lastTouchY-a.touches[0].pageY;return this._lastTouchY=a.touches[0].pageY,s!==0&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(a,s))}};l.Viewport=o=v([w(2,m.IBufferService),w(3,m.IOptionsService),w(4,g.ICharSizeService),w(5,g.IRenderService),w(6,g.ICoreBrowserService),w(7,g.IThemeService)],o)},3107:function(F,l,u){var v=this&&this.__decorate||function(m,o,a,s){var n,p=arguments.length,b=p<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,a):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(m,o,a,s);else for(var k=m.length-1;k>=0;k--)(n=m[k])&&(b=(p<3?n(b):p>3?n(o,a,b):n(o,a))||b);return p>3&&b&&Object.defineProperty(o,a,b),b},w=this&&this.__param||function(m,o){return function(a,s){o(a,s,m)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const f=u(4725),g=u(844),C=u(2585);let x=l.BufferDecorationRenderer=class extends g.Disposable{constructor(m,o,a,s,n){super(),this._screenElement=m,this._bufferService=o,this._coreBrowserService=a,this._decorationService=s,this._renderService=n,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((p=>this._removeDecoration(p)))),this.register((0,g.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const m of this._decorationService.decorations)this._renderDecoration(m);this._dimensionsChanged=!1}_renderDecoration(m){this._refreshStyle(m),this._dimensionsChanged&&this._refreshXPosition(m)}_createElement(m){var s;const o=this._coreBrowserService.mainDocument.createElement("div");o.classList.add("xterm-decoration"),o.classList.toggle("xterm-decoration-top-layer",((s=m==null?void 0:m.options)==null?void 0:s.layer)==="top"),o.style.width=`${Math.round((m.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,o.style.height=(m.options.height||1)*this._renderService.dimensions.css.cell.height+"px",o.style.top=(m.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",o.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const a=m.options.x??0;return a&&a>this._bufferService.cols&&(o.style.display="none"),this._refreshXPosition(m,o),o}_refreshStyle(m){const o=m.marker.line-this._bufferService.buffers.active.ydisp;if(o<0||o>=this._bufferService.rows)m.element&&(m.element.style.display="none",m.onRenderEmitter.fire(m.element));else{let a=this._decorationElements.get(m);a||(a=this._createElement(m),m.element=a,this._decorationElements.set(m,a),this._container.appendChild(a),m.onDispose((()=>{this._decorationElements.delete(m),a.remove()}))),a.style.top=o*this._renderService.dimensions.css.cell.height+"px",a.style.display=this._altBufferIsActive?"none":"block",m.onRenderEmitter.fire(a)}}_refreshXPosition(m,o=m.element){if(!o)return;const a=m.options.x??0;(m.options.anchor||"left")==="right"?o.style.right=a?a*this._renderService.dimensions.css.cell.width+"px":"":o.style.left=a?a*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(m){var o;(o=this._decorationElements.get(m))==null||o.remove(),this._decorationElements.delete(m),m.dispose()}};l.BufferDecorationRenderer=x=v([w(1,C.IBufferService),w(2,f.ICoreBrowserService),w(3,C.IDecorationService),w(4,f.IRenderService)],x)},5871:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const v of this._zones)if(v.color===u.options.overviewRulerOptions.color&&v.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(v,u.marker.line))return;if(this._lineAdjacentToZone(v,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(v,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,v){return v>=u.startBufferLine&&v<=u.endBufferLine}_lineAdjacentToZone(u,v,w){return v>=u.startBufferLine-this._linePadding[w||"full"]&&v<=u.endBufferLine+this._linePadding[w||"full"]}_addLineToZone(u,v){u.startBufferLine=Math.min(u.startBufferLine,v),u.endBufferLine=Math.max(u.endBufferLine,v)}}},5744:function(F,l,u){var v=this&&this.__decorate||function(n,p,b,k){var R,S=arguments.length,A=S<3?p:k===null?k=Object.getOwnPropertyDescriptor(p,b):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(n,p,b,k);else for(var H=n.length-1;H>=0;H--)(R=n[H])&&(A=(S<3?R(A):S>3?R(p,b,A):R(p,b))||A);return S>3&&A&&Object.defineProperty(p,b,A),A},w=this&&this.__param||function(n,p){return function(b,k){p(b,k,n)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const f=u(5871),g=u(4725),C=u(844),x=u(2585),m={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0},a={full:0,left:0,center:0,right:0};let s=l.OverviewRulerRenderer=class extends C.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(n,p,b,k,R,S,A){var j;super(),this._viewportElement=n,this._screenElement=p,this._bufferService=b,this._decorationService=k,this._renderService=R,this._optionsService=S,this._coreBrowserService=A,this._colorZoneStore=new f.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(j=this._viewportElement.parentElement)==null||j.insertBefore(this._canvas,this._viewportElement);const H=this._canvas.getContext("2d");if(!H)throw new Error("Ctx cannot be null");this._ctx=H,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,C.toDisposable)((()=>{var $;($=this._canvas)==null||$.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const n=Math.floor(this._canvas.width/3),p=Math.ceil(this._canvas.width/3);o.full=this._canvas.width,o.left=n,o.center=p,o.right=n,this._refreshDrawHeightConstants(),a.full=0,a.left=0,a.center=o.left,a.right=o.left+o.center}_refreshDrawHeightConstants(){m.full=Math.round(2*this._coreBrowserService.dpr);const n=this._canvas.height/this._bufferService.buffer.lines.length,p=Math.round(Math.max(Math.min(n,12),6)*this._coreBrowserService.dpr);m.left=p,m.center=p,m.right=p}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const p of this._decorationService.decorations)this._colorZoneStore.addDecoration(p);this._ctx.lineWidth=1;const n=this._colorZoneStore.zones;for(const p of n)p.position!=="full"&&this._renderColorZone(p);for(const p of n)p.position==="full"&&this._renderColorZone(p);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(n){this._ctx.fillStyle=n.color,this._ctx.fillRect(a[n.position||"full"],Math.round((this._canvas.height-1)*(n.startBufferLine/this._bufferService.buffers.active.lines.length)-m[n.position||"full"]/2),o[n.position||"full"],Math.round((this._canvas.height-1)*((n.endBufferLine-n.startBufferLine)/this._bufferService.buffers.active.lines.length)+m[n.position||"full"]))}_queueRefresh(n,p){this._shouldUpdateDimensions=n||this._shouldUpdateDimensions,this._shouldUpdateAnchor=p||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=s=v([w(2,x.IBufferService),w(3,x.IDecorationService),w(4,g.IRenderService),w(5,x.IOptionsService),w(6,g.ICoreBrowserService)],s)},2950:function(F,l,u){var v=this&&this.__decorate||function(m,o,a,s){var n,p=arguments.length,b=p<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,a):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(m,o,a,s);else for(var k=m.length-1;k>=0;k--)(n=m[k])&&(b=(p<3?n(b):p>3?n(o,a,b):n(o,a))||b);return p>3&&b&&Object.defineProperty(o,a,b),b},w=this&&this.__param||function(m,o){return function(a,s){o(a,s,m)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const f=u(4725),g=u(2585),C=u(2584);let x=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(m,o,a,s,n,p){this._textarea=m,this._compositionView=o,this._bufferService=a,this._optionsService=s,this._coreService=n,this._renderService=p,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(m){this._compositionView.textContent=m.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(m){if(this._isComposing||this._isSendingComposition){if(m.keyCode===229||m.keyCode===16||m.keyCode===17||m.keyCode===18)return!1;this._finalizeComposition(!1)}return m.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(m){if(this._compositionView.classList.remove("active"),this._isComposing=!1,m){const o={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let a;this._isSendingComposition=!1,o.start+=this._dataAlreadySent.length,a=this._isComposing?this._textarea.value.substring(o.start,o.end):this._textarea.value.substring(o.start),a.length>0&&this._coreService.triggerDataEvent(a,!0)}}),0)}else{this._isSendingComposition=!1;const o=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(o,!0)}}_handleAnyTextareaChanges(){const m=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const o=this._textarea.value,a=o.replace(m,"");this._dataAlreadySent=a,o.length>m.length?this._coreService.triggerDataEvent(a,!0):o.length<m.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):o.length===m.length&&o!==m&&this._coreService.triggerDataEvent(o,!0)}}),0)}updateCompositionElements(m){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const o=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),a=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,n=o*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=a+"px",this._compositionView.style.lineHeight=a+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const p=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(p.width,1)+"px",this._textarea.style.height=Math.max(p.height,1)+"px",this._textarea.style.lineHeight=p.height+"px"}m||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=x=v([w(2,g.IBufferService),w(3,g.IOptionsService),w(4,g.ICoreService),w(5,f.IRenderService)],x)},9806:(F,l)=>{function u(v,w,f){const g=f.getBoundingClientRect(),C=v.getComputedStyle(f),x=parseInt(C.getPropertyValue("padding-left")),m=parseInt(C.getPropertyValue("padding-top"));return[w.clientX-g.left-x,w.clientY-g.top-m]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=u,l.getCoords=function(v,w,f,g,C,x,m,o,a){if(!x)return;const s=u(v,w,f);return s?(s[0]=Math.ceil((s[0]+(a?m/2:0))/m),s[1]=Math.ceil(s[1]/o),s[0]=Math.min(Math.max(s[0],1),g+(a?1:0)),s[1]=Math.min(Math.max(s[1],1),C),s):void 0}},9504:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const v=u(2584);function w(o,a,s,n){const p=o-f(o,s),b=a-f(a,s),k=Math.abs(p-b)-(function(R,S,A){let H=0;const j=R-f(R,A),$=S-f(S,A);for(let I=0;I<Math.abs(j-$);I++){const Q=g(R,S)==="A"?-1:1,te=A.buffer.lines.get(j+Q*I);te!=null&&te.isWrapped&&H++}return H})(o,a,s);return m(k,x(g(o,a),n))}function f(o,a){let s=0,n=a.buffer.lines.get(o),p=n==null?void 0:n.isWrapped;for(;p&&o>=0&&o<a.rows;)s++,n=a.buffer.lines.get(--o),p=n==null?void 0:n.isWrapped;return s}function g(o,a){return o>a?"A":"B"}function C(o,a,s,n,p,b){let k=o,R=a,S="";for(;k!==s||R!==n;)k+=p?1:-1,p&&k>b.cols-1?(S+=b.buffer.translateBufferLineToString(R,!1,o,k),k=0,o=0,R++):!p&&k<0&&(S+=b.buffer.translateBufferLineToString(R,!1,0,o+1),k=b.cols-1,o=k,R--);return S+b.buffer.translateBufferLineToString(R,!1,o,k)}function x(o,a){const s=a?"O":"[";return v.C0.ESC+s+o}function m(o,a){o=Math.floor(o);let s="";for(let n=0;n<o;n++)s+=a;return s}l.moveToCellSequence=function(o,a,s,n){const p=s.buffer.x,b=s.buffer.y;if(!s.buffer.hasScrollback)return(function(S,A,H,j,$,I){return w(A,j,$,I).length===0?"":m(C(S,A,S,A-f(A,$),!1,$).length,x("D",I))})(p,b,0,a,s,n)+w(b,a,s,n)+(function(S,A,H,j,$,I){let Q;Q=w(A,j,$,I).length>0?j-f(j,$):A;const te=j,ne=(function(le,G,L,O,T,P){let Z;return Z=w(L,O,T,P).length>0?O-f(O,T):G,le<L&&Z<=O||le>=L&&Z<O?"C":"D"})(S,A,H,j,$,I);return m(C(S,Q,H,te,ne==="C",$).length,x(ne,I))})(p,b,o,a,s,n);let k;if(b===a)return k=p>o?"D":"C",m(Math.abs(p-o),x(k,n));k=b>a?"D":"C";const R=Math.abs(b-a);return m((function(S,A){return A.cols-S})(b>a?o:p,s)+(R-1)*s.cols+1+((b>a?p:o)-1),x(k,n))}},1296:function(F,l,u){var v=this&&this.__decorate||function(I,Q,te,ne){var le,G=arguments.length,L=G<3?Q:ne===null?ne=Object.getOwnPropertyDescriptor(Q,te):ne;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(I,Q,te,ne);else for(var O=I.length-1;O>=0;O--)(le=I[O])&&(L=(G<3?le(L):G>3?le(Q,te,L):le(Q,te))||L);return G>3&&L&&Object.defineProperty(Q,te,L),L},w=this&&this.__param||function(I,Q){return function(te,ne){Q(te,ne,I)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const f=u(3787),g=u(2550),C=u(2223),x=u(6171),m=u(6052),o=u(4725),a=u(8055),s=u(8460),n=u(844),p=u(2585),b="xterm-dom-renderer-owner-",k="xterm-rows",R="xterm-fg-",S="xterm-bg-",A="xterm-focus",H="xterm-selection";let j=1,$=l.DomRenderer=class extends n.Disposable{constructor(I,Q,te,ne,le,G,L,O,T,P,Z,re,ce){super(),this._terminal=I,this._document=Q,this._element=te,this._screenElement=ne,this._viewportElement=le,this._helperContainer=G,this._linkifier2=L,this._charSizeService=T,this._optionsService=P,this._bufferService=Z,this._coreBrowserService=re,this._themeService=ce,this._terminalClass=j++,this._rowElements=[],this._selectionRenderModel=(0,m.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new s.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(k),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(H),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((he=>this._injectCss(he)))),this._injectCss(this._themeService.colors),this._rowFactory=O.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(b+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((he=>this._handleLinkHover(he)))),this.register(this._linkifier2.onHideLinkUnderline((he=>this._handleLinkLeave(he)))),this.register((0,n.toDisposable)((()=>{this._element.classList.remove(b+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new g.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const I=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*I,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*I),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/I),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/I),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const te of this._rowElements)te.style.width=`${this.dimensions.css.canvas.width}px`,te.style.height=`${this.dimensions.css.cell.height}px`,te.style.lineHeight=`${this.dimensions.css.cell.height}px`,te.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Q=`${this._terminalSelector} .${k} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Q,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(I){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Q=`${this._terminalSelector} .${k} { color: ${I.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Q+=`${this._terminalSelector} .${k} .xterm-dim { color: ${a.color.multiplyOpacity(I.foreground,.5).css};}`,Q+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const te=`blink_underline_${this._terminalClass}`,ne=`blink_bar_${this._terminalClass}`,le=`blink_block_${this._terminalClass}`;Q+=`@keyframes ${te} { 50% { border-bottom-style: hidden; }}`,Q+=`@keyframes ${ne} { 50% { box-shadow: none; }}`,Q+=`@keyframes ${le} { 0% { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css}; } 50% { background-color: inherit; color: ${I.cursor.css}; }}`,Q+=`${this._terminalSelector} .${k}.${A} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${te} 1s step-end infinite;}${this._terminalSelector} .${k}.${A} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${ne} 1s step-end infinite;}${this._terminalSelector} .${k}.${A} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${le} 1s step-end infinite;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css};}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${I.cursor.css} !important; color: ${I.cursorAccent.css} !important;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${I.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${I.cursor.css} inset;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${I.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Q+=`${this._terminalSelector} .${H} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${H} div { position: absolute; background-color: ${I.selectionBackgroundOpaque.css};}${this._terminalSelector} .${H} div { position: absolute; background-color: ${I.selectionInactiveBackgroundOpaque.css};}`;for(const[G,L]of I.ansi.entries())Q+=`${this._terminalSelector} .${R}${G} { color: ${L.css}; }${this._terminalSelector} .${R}${G}.xterm-dim { color: ${a.color.multiplyOpacity(L,.5).css}; }${this._terminalSelector} .${S}${G} { background-color: ${L.css}; }`;Q+=`${this._terminalSelector} .${R}${C.INVERTED_DEFAULT_COLOR} { color: ${a.color.opaque(I.background).css}; }${this._terminalSelector} .${R}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${a.color.multiplyOpacity(a.color.opaque(I.background),.5).css}; }${this._terminalSelector} .${S}${C.INVERTED_DEFAULT_COLOR} { background-color: ${I.foreground.css}; }`,this._themeStyleElement.textContent=Q}_setDefaultSpacing(){const I=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${I}px`,this._rowFactory.defaultSpacing=I}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(I,Q){for(let te=this._rowElements.length;te<=Q;te++){const ne=this._document.createElement("div");this._rowContainer.appendChild(ne),this._rowElements.push(ne)}for(;this._rowElements.length>Q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(I,Q){this._refreshRowElements(I,Q),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(A),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(A),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(I,Q,te){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(I,Q,te),this.renderRows(0,this._bufferService.rows-1),!I||!Q)return;this._selectionRenderModel.update(this._terminal,I,Q,te);const ne=this._selectionRenderModel.viewportStartRow,le=this._selectionRenderModel.viewportEndRow,G=this._selectionRenderModel.viewportCappedStartRow,L=this._selectionRenderModel.viewportCappedEndRow;if(G>=this._bufferService.rows||L<0)return;const O=this._document.createDocumentFragment();if(te){const T=I[0]>Q[0];O.appendChild(this._createSelectionElement(G,T?Q[0]:I[0],T?I[0]:Q[0],L-G+1))}else{const T=ne===G?I[0]:0,P=G===le?Q[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(G,T,P));const Z=L-G-1;if(O.appendChild(this._createSelectionElement(G+1,0,this._bufferService.cols,Z)),G!==L){const re=le===L?Q[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(L,0,re))}}this._selectionContainer.appendChild(O)}_createSelectionElement(I,Q,te,ne=1){const le=this._document.createElement("div"),G=Q*this.dimensions.css.cell.width;let L=this.dimensions.css.cell.width*(te-Q);return G+L>this.dimensions.css.canvas.width&&(L=this.dimensions.css.canvas.width-G),le.style.height=ne*this.dimensions.css.cell.height+"px",le.style.top=I*this.dimensions.css.cell.height+"px",le.style.left=`${G}px`,le.style.width=`${L}px`,le}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const I of this._rowElements)I.replaceChildren()}renderRows(I,Q){const te=this._bufferService.buffer,ne=te.ybase+te.y,le=Math.min(te.x,this._bufferService.cols-1),G=this._optionsService.rawOptions.cursorBlink,L=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let T=I;T<=Q;T++){const P=T+te.ydisp,Z=this._rowElements[T],re=te.lines.get(P);if(!Z||!re)break;Z.replaceChildren(...this._rowFactory.createRow(re,P,P===ne,L,O,le,G,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${b}${this._terminalClass}`}_handleLinkHover(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!0)}_handleLinkLeave(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!1)}_setCellUnderline(I,Q,te,ne,le,G){te<0&&(I=0),ne<0&&(Q=0);const L=this._bufferService.rows-1;te=Math.max(Math.min(te,L),0),ne=Math.max(Math.min(ne,L),0),le=Math.min(le,this._bufferService.cols);const O=this._bufferService.buffer,T=O.ybase+O.y,P=Math.min(O.x,le-1),Z=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let he=te;he<=ne;++he){const W=he+O.ydisp,B=this._rowElements[he],ee=O.lines.get(W);if(!B||!ee)break;B.replaceChildren(...this._rowFactory.createRow(ee,W,W===T,re,ce,P,Z,this.dimensions.css.cell.width,this._widthCache,G?he===te?I:0:-1,G?(he===ne?Q:le)-1:-1))}}};l.DomRenderer=$=v([w(7,p.IInstantiationService),w(8,o.ICharSizeService),w(9,p.IOptionsService),w(10,p.IBufferService),w(11,o.ICoreBrowserService),w(12,o.IThemeService)],$)},3787:function(F,l,u){var v=this&&this.__decorate||function(k,R,S,A){var H,j=arguments.length,$=j<3?R:A===null?A=Object.getOwnPropertyDescriptor(R,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(k,R,S,A);else for(var I=k.length-1;I>=0;I--)(H=k[I])&&($=(j<3?H($):j>3?H(R,S,$):H(R,S))||$);return j>3&&$&&Object.defineProperty(R,S,$),$},w=this&&this.__param||function(k,R){return function(S,A){R(S,A,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const f=u(2223),g=u(643),C=u(511),x=u(2585),m=u(8055),o=u(4725),a=u(4269),s=u(6171),n=u(3734);let p=l.DomRendererRowFactory=class{constructor(k,R,S,A,H,j,$){this._document=k,this._characterJoinerService=R,this._optionsService=S,this._coreBrowserService=A,this._coreService=H,this._decorationService=j,this._themeService=$,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(k,R,S){this._selectionStart=k,this._selectionEnd=R,this._columnSelectMode=S}createRow(k,R,S,A,H,j,$,I,Q,te,ne){const le=[],G=this._characterJoinerService.getJoinedCharacters(R),L=this._themeService.colors;let O,T=k.getNoBgTrimmedLength();S&&T<j+1&&(T=j+1);let P=0,Z="",re=0,ce=0,he=0,W=!1,B=0,ee=!1,J=0;const de=[],ue=te!==-1&&ne!==-1;for(let Ee=0;Ee<T;Ee++){k.loadCell(Ee,this._workCell);let Le=this._workCell.getWidth();if(Le===0)continue;let Te=!1,Ge=Ee,ye=this._workCell;if(G.length>0&&Ee===G[0][0]){Te=!0;const Ae=G.shift();ye=new a.JoinedCellData(this._workCell,k.translateToString(!0,Ae[0],Ae[1]),Ae[1]-Ae[0]),Ge=Ae[1]-1,Le=ye.getWidth()}const Jt=this._isCellInSelection(Ee,R),Er=S&&Ee===j,Wt=ue&&Ee>=te&&Ee<=ne;let Mt=!1;this._decorationService.forEachDecorationAtCell(Ee,R,void 0,(Ae=>{Mt=!0}));let Zt=ye.getChars()||g.WHITESPACE_CELL_CHAR;if(Zt===" "&&(ye.isUnderline()||ye.isOverline())&&(Zt=" "),J=Le*I-Q.get(Zt,ye.isBold(),ye.isItalic()),O){if(P&&(Jt&&ee||!Jt&&!ee&&ye.bg===re)&&(Jt&&ee&&L.selectionForeground||ye.fg===ce)&&ye.extended.ext===he&&Wt===W&&J===B&&!Er&&!Te&&!Mt){ye.isInvisible()?Z+=g.WHITESPACE_CELL_CHAR:Z+=Zt,P++;continue}P&&(O.textContent=Z),O=this._document.createElement("span"),P=0,Z=""}else O=this._document.createElement("span");if(re=ye.bg,ce=ye.fg,he=ye.extended.ext,W=Wt,B=J,ee=Jt,Te&&j>=Ee&&j<=Ge&&(j=Ee),!this._coreService.isCursorHidden&&Er&&this._coreService.isCursorInitialized){if(de.push("xterm-cursor"),this._coreBrowserService.isFocused)$&&de.push("xterm-cursor-blink"),de.push(A==="bar"?"xterm-cursor-bar":A==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(H)switch(H){case"outline":de.push("xterm-cursor-outline");break;case"block":de.push("xterm-cursor-block");break;case"bar":de.push("xterm-cursor-bar");break;case"underline":de.push("xterm-cursor-underline")}}if(ye.isBold()&&de.push("xterm-bold"),ye.isItalic()&&de.push("xterm-italic"),ye.isDim()&&de.push("xterm-dim"),Z=ye.isInvisible()?g.WHITESPACE_CELL_CHAR:ye.getChars()||g.WHITESPACE_CELL_CHAR,ye.isUnderline()&&(de.push(`xterm-underline-${ye.extended.underlineStyle}`),Z===" "&&(Z=" "),!ye.isUnderlineColorDefault()))if(ye.isUnderlineColorRGB())O.style.textDecorationColor=`rgb(${n.AttributeData.toColorRGB(ye.getUnderlineColor()).join(",")})`;else{let Ae=ye.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ye.isBold()&&Ae<8&&(Ae+=8),O.style.textDecorationColor=L.ansi[Ae].css}ye.isOverline()&&(de.push("xterm-overline"),Z===" "&&(Z=" ")),ye.isStrikethrough()&&de.push("xterm-strikethrough"),Wt&&(O.style.textDecoration="underline");let rt=ye.getFgColor(),er=ye.getFgColorMode(),dt=ye.getBgColor(),tr=ye.getBgColorMode();const kr=!!ye.isInverse();if(kr){const Ae=rt;rt=dt,dt=Ae;const Yi=er;er=tr,tr=Yi}let ft,br,nt,xt=!1;switch(this._decorationService.forEachDecorationAtCell(Ee,R,void 0,(Ae=>{Ae.options.layer!=="top"&&xt||(Ae.backgroundColorRGB&&(tr=50331648,dt=Ae.backgroundColorRGB.rgba>>8&16777215,ft=Ae.backgroundColorRGB),Ae.foregroundColorRGB&&(er=50331648,rt=Ae.foregroundColorRGB.rgba>>8&16777215,br=Ae.foregroundColorRGB),xt=Ae.options.layer==="top")})),!xt&&Jt&&(ft=this._coreBrowserService.isFocused?L.selectionBackgroundOpaque:L.selectionInactiveBackgroundOpaque,dt=ft.rgba>>8&16777215,tr=50331648,xt=!0,L.selectionForeground&&(er=50331648,rt=L.selectionForeground.rgba>>8&16777215,br=L.selectionForeground)),xt&&de.push("xterm-decoration-top"),tr){case 16777216:case 33554432:nt=L.ansi[dt],de.push(`xterm-bg-${dt}`);break;case 50331648:nt=m.channels.toColor(dt>>16,dt>>8&255,255&dt),this._addStyle(O,`background-color:#${b((dt>>>0).toString(16),"0",6)}`);break;default:kr?(nt=L.foreground,de.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):nt=L.background}switch(ft||ye.isDim()&&(ft=m.color.multiplyOpacity(nt,.5)),er){case 16777216:case 33554432:ye.isBold()&&rt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(rt+=8),this._applyMinimumContrast(O,nt,L.ansi[rt],ye,ft,void 0)||de.push(`xterm-fg-${rt}`);break;case 50331648:const Ae=m.channels.toColor(rt>>16&255,rt>>8&255,255&rt);this._applyMinimumContrast(O,nt,Ae,ye,ft,br)||this._addStyle(O,`color:#${b(rt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(O,nt,L.foreground,ye,ft,br)||kr&&de.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}de.length&&(O.className=de.join(" "),de.length=0),Er||Te||Mt?O.textContent=Z:P++,J!==this.defaultSpacing&&(O.style.letterSpacing=`${J}px`),le.push(O),Ee=Ge}return O&&P&&(O.textContent=Z),le}_applyMinimumContrast(k,R,S,A,H,j){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.treatGlyphAsBackgroundColor)(A.getCode()))return!1;const $=this._getContrastCache(A);let I;if(H||j||(I=$.getColor(R.rgba,S.rgba)),I===void 0){const Q=this._optionsService.rawOptions.minimumContrastRatio/(A.isDim()?2:1);I=m.color.ensureContrastRatio(H||R,j||S,Q),$.setColor((H||R).rgba,(j||S).rgba,I??null)}return!!I&&(this._addStyle(k,`color:${I.css}`),!0)}_getContrastCache(k){return k.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(k,R){k.setAttribute("style",`${k.getAttribute("style")||""}${R};`)}_isCellInSelection(k,R){const S=this._selectionStart,A=this._selectionEnd;return!(!S||!A)&&(this._columnSelectMode?S[0]<=A[0]?k>=S[0]&&R>=S[1]&&k<A[0]&&R<=A[1]:k<S[0]&&R>=S[1]&&k>=A[0]&&R<=A[1]:R>S[1]&&R<A[1]||S[1]===A[1]&&R===S[1]&&k>=S[0]&&k<A[0]||S[1]<A[1]&&R===A[1]&&k<A[0]||S[1]<A[1]&&R===S[1]&&k>=S[0])}};function b(k,R,S){for(;k.length<S;)k=R+k;return k}l.DomRendererRowFactory=p=v([w(1,o.ICharacterJoinerService),w(2,x.IOptionsService),w(3,o.ICoreBrowserService),w(4,x.ICoreService),w(5,x.IDecorationService),w(6,o.IThemeService)],p)},2550:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(u,v){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const w=u.createElement("span");w.classList.add("xterm-char-measure-element");const f=u.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const g=u.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const C=u.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontWeight="bold",C.style.fontStyle="italic",this._measureElements=[w,f,g,C],this._container.appendChild(w),this._container.appendChild(f),this._container.appendChild(g),this._container.appendChild(C),v.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(u,v,w,f){u===this._font&&v===this._fontSize&&w===this._weight&&f===this._weightBold||(this._font=u,this._fontSize=v,this._weight=w,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${w}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${w}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(u,v,w){let f=0;if(!v&&!w&&u.length===1&&(f=u.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const x=this._measure(u,0);return x>0&&(this._flat[f]=x),x}let g=u;v&&(g+="B"),w&&(g+="I");let C=this._holey.get(g);if(C===void 0){let x=0;v&&(x|=1),w&&(x|=2),C=this._measure(u,x),C>0&&this._holey.set(g,C)}return C}_measure(u,v){const w=this._measureElements[v];return w.textContent=u.repeat(32),w.offsetWidth/32}}},2223:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const v=u(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=v.isFirefox||v.isLegacyEdge?"bottom":"ideographic"},6171:(F,l)=>{function u(w){return 57508<=w&&w<=57558}function v(w){return w>=128512&&w<=128591||w>=127744&&w<=128511||w>=128640&&w<=128767||w>=9728&&w<=9983||w>=9984&&w<=10175||w>=65024&&w<=65039||w>=129280&&w<=129535||w>=127462&&w<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(w){if(!w)throw new Error("value must not be falsy");return w},l.isPowerlineGlyph=u,l.isRestrictedPowerlineGlyph=function(w){return 57520<=w&&w<=57527},l.isEmoji=v,l.allowRescaling=function(w,f,g,C){return f===1&&g>Math.ceil(1.5*C)&&w!==void 0&&w>255&&!v(w)&&!u(w)&&!(function(x){return 57344<=x&&x<=63743})(w)},l.treatGlyphAsBackgroundColor=function(w){return u(w)||(function(f){return 9472<=f&&f<=9631})(w)},l.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},l.computeNextVariantOffset=function(w,f,g=0){return(w-(2*Math.round(f)-g))%(2*Math.round(f))}},6052:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createSelectionRenderModel=void 0;class u{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(w,f,g,C=!1){if(this.selectionStart=f,this.selectionEnd=g,!f||!g||f[0]===g[0]&&f[1]===g[1])return void this.clear();const x=w.buffers.active.ydisp,m=f[1]-x,o=g[1]-x,a=Math.max(m,0),s=Math.min(o,w.rows-1);a>=w.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=m,this.viewportEndRow=o,this.viewportCappedStartRow=a,this.viewportCappedEndRow=s,this.startCol=f[0],this.endCol=g[0])}isCellSelected(w,f,g){return!!this.hasSelection&&(g-=w.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&g>=this.viewportCappedStartRow&&f<this.endCol&&g<=this.viewportCappedEndRow:f<this.startCol&&g>=this.viewportCappedStartRow&&f>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&f>=this.startCol)}}l.createSelectionRenderModel=function(){return new u}},456:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,v=this.selectionEnd;return!(!u||!v)&&(u[1]>v[1]||u[1]===v[1]&&u[0]>v[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(F,l,u){var v=this&&this.__decorate||function(s,n,p,b){var k,R=arguments.length,S=R<3?n:b===null?b=Object.getOwnPropertyDescriptor(n,p):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(s,n,p,b);else for(var A=s.length-1;A>=0;A--)(k=s[A])&&(S=(R<3?k(S):R>3?k(n,p,S):k(n,p))||S);return R>3&&S&&Object.defineProperty(n,p,S),S},w=this&&this.__param||function(s,n){return function(p,b){n(p,b,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const f=u(2585),g=u(8460),C=u(844);let x=l.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(s,n,p){super(),this._optionsService=p,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new a(this._optionsService))}catch{this._measureStrategy=this.register(new o(s,n,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const s=this._measureStrategy.measure();s.width===this.width&&s.height===this.height||(this.width=s.width,this.height=s.height,this._onCharSizeChange.fire())}};l.CharSizeService=x=v([w(2,f.IOptionsService)],x);class m extends C.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(n,p){n!==void 0&&n>0&&p!==void 0&&p>0&&(this._result.width=n,this._result.height=p)}}class o extends m{constructor(n,p,b){super(),this._document=n,this._parentElement=p,this._optionsService=b,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class a extends m{constructor(n){super(),this._optionsService=n,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const p=this._ctx.measureText("W");if(!("width"in p&&"fontBoundingBoxAscent"in p&&"fontBoundingBoxDescent"in p))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const n=this._ctx.measureText("W");return this._validateAndSet(n.width,n.fontBoundingBoxAscent+n.fontBoundingBoxDescent),this._result}}},4269:function(F,l,u){var v=this&&this.__decorate||function(a,s,n,p){var b,k=arguments.length,R=k<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,n):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(a,s,n,p);else for(var S=a.length-1;S>=0;S--)(b=a[S])&&(R=(k<3?b(R):k>3?b(s,n,R):b(s,n))||R);return k>3&&R&&Object.defineProperty(s,n,R),R},w=this&&this.__param||function(a,s){return function(n,p){s(n,p,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const f=u(3734),g=u(643),C=u(511),x=u(2585);class m extends f.AttributeData{constructor(s,n,p){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=n,this._width=p}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(s){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=m;let o=l.CharacterJoinerService=class Xh{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(s){const n={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(n),n.id}deregister(s){for(let n=0;n<this._characterJoiners.length;n++)if(this._characterJoiners[n].id===s)return this._characterJoiners.splice(n,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const n=this._bufferService.buffer.lines.get(s);if(!n||n.length===0)return[];const p=[],b=n.translateToString(!0);let k=0,R=0,S=0,A=n.getFg(0),H=n.getBg(0);for(let j=0;j<n.getTrimmedLength();j++)if(n.loadCell(j,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==A||this._workCell.bg!==H){if(j-k>1){const $=this._getJoinedRanges(b,S,R,n,k);for(let I=0;I<$.length;I++)p.push($[I])}k=j,S=R,A=this._workCell.fg,H=this._workCell.bg}R+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-k>1){const j=this._getJoinedRanges(b,S,R,n,k);for(let $=0;$<j.length;$++)p.push(j[$])}return p}_getJoinedRanges(s,n,p,b,k){const R=s.substring(n,p);let S=[];try{S=this._characterJoiners[0].handler(R)}catch(A){console.error(A)}for(let A=1;A<this._characterJoiners.length;A++)try{const H=this._characterJoiners[A].handler(R);for(let j=0;j<H.length;j++)Xh._mergeRanges(S,H[j])}catch(H){console.error(H)}return this._stringRangesToCellRanges(S,b,k),S}_stringRangesToCellRanges(s,n,p){let b=0,k=!1,R=0,S=s[b];if(S){for(let A=p;A<this._bufferService.cols;A++){const H=n.getWidth(A),j=n.getString(A).length||g.WHITESPACE_CELL_CHAR.length;if(H!==0){if(!k&&S[0]<=R&&(S[0]=A,k=!0),S[1]<=R){if(S[1]=A,S=s[++b],!S)break;S[0]<=R?(S[0]=A,k=!0):k=!1}R+=j}}S&&(S[1]=this._bufferService.cols)}}static _mergeRanges(s,n){let p=!1;for(let b=0;b<s.length;b++){const k=s[b];if(p){if(n[1]<=k[0])return s[b-1][1]=n[1],s;if(n[1]<=k[1])return s[b-1][1]=Math.max(n[1],k[1]),s.splice(b,1),s;s.splice(b,1),b--}else{if(n[1]<=k[0])return s.splice(b,0,n),s;if(n[1]<=k[1])return k[0]=Math.min(n[0],k[0]),s;n[0]<k[1]&&(k[0]=Math.min(n[0],k[0]),p=!0)}}return p?s[s.length-1][1]=n[1]:s.push(n),s}};l.CharacterJoinerService=o=v([w(0,x.IBufferService)],o)},5114:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const v=u(844),w=u(8460),f=u(3656);class g extends v.Disposable{constructor(m,o,a){super(),this._textarea=m,this._window=o,this.mainDocument=a,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new C(this._window),this._onDprChange=this.register(new w.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new w.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((s=>this._screenDprMonitor.setWindow(s)))),this.register((0,w.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(m){this._window!==m&&(this._window=m,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}}l.CoreBrowserService=g;class C extends v.Disposable{constructor(m){super(),this._parentWindow=m,this._windowResizeListener=this.register(new v.MutableDisposable),this._onDprChange=this.register(new w.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,v.toDisposable)((()=>this.clearListener())))}setWindow(m){this._parentWindow=m,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var m;this._outerListener&&((m=this._resolutionMediaMatchList)==null||m.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const v=u(844);class w extends v.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,v.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const C=this.linkProviders.indexOf(g);C!==-1&&this.linkProviders.splice(C,1)}}}}l.LinkProviderService=w},8934:function(F,l,u){var v=this&&this.__decorate||function(x,m,o,a){var s,n=arguments.length,p=n<3?m:a===null?a=Object.getOwnPropertyDescriptor(m,o):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(x,m,o,a);else for(var b=x.length-1;b>=0;b--)(s=x[b])&&(p=(n<3?s(p):n>3?s(m,o,p):s(m,o))||p);return n>3&&p&&Object.defineProperty(m,o,p),p},w=this&&this.__param||function(x,m){return function(o,a){m(o,a,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const f=u(4725),g=u(9806);let C=l.MouseService=class{constructor(x,m){this._renderService=x,this._charSizeService=m}getCoords(x,m,o,a,s){return(0,g.getCoords)(window,x,m,o,a,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(x,m){const o=(0,g.getCoordsRelativeToElement)(window,x,m);if(this._charSizeService.hasValidSize)return o[0]=Math.min(Math.max(o[0],0),this._renderService.dimensions.css.canvas.width-1),o[1]=Math.min(Math.max(o[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(o[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(o[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(o[0]),y:Math.floor(o[1])}}};l.MouseService=C=v([w(0,f.IRenderService),w(1,f.ICharSizeService)],C)},3230:function(F,l,u){var v=this&&this.__decorate||function(s,n,p,b){var k,R=arguments.length,S=R<3?n:b===null?b=Object.getOwnPropertyDescriptor(n,p):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(s,n,p,b);else for(var A=s.length-1;A>=0;A--)(k=s[A])&&(S=(R<3?k(S):R>3?k(n,p,S):k(n,p))||S);return R>3&&S&&Object.defineProperty(n,p,S),S},w=this&&this.__param||function(s,n){return function(p,b){n(p,b,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const f=u(6193),g=u(4725),C=u(8460),x=u(844),m=u(7226),o=u(2585);let a=l.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(s,n,p,b,k,R,S,A){super(),this._rowCount=s,this._charSizeService=b,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new m.DebouncedIdleTask,this._observerDisposable=this.register(new x.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new C.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new C.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new C.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((H,j)=>this._renderRows(H,j)),S),this.register(this._renderDebouncer),this.register(S.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(R.onResize((()=>this._fullRefresh()))),this.register(R.buffers.onBufferActivate((()=>{var H;return(H=this._renderer.value)==null?void 0:H.clear()}))),this.register(p.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(k.onDecorationRegistered((()=>this._fullRefresh()))),this.register(k.onDecorationRemoved((()=>this._fullRefresh()))),this.register(p.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(R.cols,R.rows),this._fullRefresh()}))),this.register(p.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(R.buffer.y,R.buffer.y,!0)))),this.register(A.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(S.window,n),this.register(S.onWindowChange((H=>this._registerIntersectionObserver(H,n))))}_registerIntersectionObserver(s,n){if("IntersectionObserver"in s){const p=new s.IntersectionObserver((b=>this._handleIntersectionChange(b[b.length-1])),{threshold:0});p.observe(n),this._observerDisposable.value=(0,x.toDisposable)((()=>p.disconnect()))}}_handleIntersectionChange(s){this._isPaused=s.isIntersecting===void 0?s.intersectionRatio===0:!s.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(s,n,p=!1){this._isPaused?this._needsFullRefresh=!0:(p||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(s,n,this._rowCount))}_renderRows(s,n){this._renderer.value&&(s=Math.min(s,this._rowCount-1),n=Math.min(n,this._rowCount-1),this._renderer.value.renderRows(s,n),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:s,end:n}),this._onRender.fire({start:s,end:n}),this._isNextRenderRedrawOnly=!0)}resize(s,n){this._rowCount=n,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(s){this._renderer.value=s,this._renderer.value&&(this._renderer.value.onRequestRedraw((n=>this.refreshRows(n.start,n.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(s){return this._renderDebouncer.addRefreshCallback(s)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var s,n;this._renderer.value&&((n=(s=this._renderer.value).clearTextureAtlas)==null||n.call(s),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(s,n){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var p;return(p=this._renderer.value)==null?void 0:p.handleResize(s,n)})):this._renderer.value.handleResize(s,n),this._fullRefresh())}handleCharSizeChanged(){var s;(s=this._renderer.value)==null||s.handleCharSizeChanged()}handleBlur(){var s;(s=this._renderer.value)==null||s.handleBlur()}handleFocus(){var s;(s=this._renderer.value)==null||s.handleFocus()}handleSelectionChanged(s,n,p){var b;this._selectionState.start=s,this._selectionState.end=n,this._selectionState.columnSelectMode=p,(b=this._renderer.value)==null||b.handleSelectionChanged(s,n,p)}handleCursorMove(){var s;(s=this._renderer.value)==null||s.handleCursorMove()}clear(){var s;(s=this._renderer.value)==null||s.clear()}};l.RenderService=a=v([w(2,o.IOptionsService),w(3,g.ICharSizeService),w(4,o.IDecorationService),w(5,o.IBufferService),w(6,g.ICoreBrowserService),w(7,g.IThemeService)],a)},9312:function(F,l,u){var v=this&&this.__decorate||function(S,A,H,j){var $,I=arguments.length,Q=I<3?A:j===null?j=Object.getOwnPropertyDescriptor(A,H):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(S,A,H,j);else for(var te=S.length-1;te>=0;te--)($=S[te])&&(Q=(I<3?$(Q):I>3?$(A,H,Q):$(A,H))||Q);return I>3&&Q&&Object.defineProperty(A,H,Q),Q},w=this&&this.__param||function(S,A){return function(H,j){A(H,j,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const f=u(9806),g=u(9504),C=u(456),x=u(4725),m=u(8460),o=u(844),a=u(6114),s=u(4841),n=u(511),p=u(2585),b=" ",k=new RegExp(b,"g");let R=l.SelectionService=class extends o.Disposable{constructor(S,A,H,j,$,I,Q,te,ne){super(),this._element=S,this._screenElement=A,this._linkifier=H,this._bufferService=j,this._coreService=$,this._mouseService=I,this._optionsService=Q,this._renderService=te,this._coreBrowserService=ne,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new n.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new m.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new m.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new m.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=le=>this._handleMouseMove(le),this._mouseUpListener=le=>this._handleMouseUp(le),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((le=>this._handleTrim(le))),this.register(this._bufferService.buffers.onBufferActivate((le=>this._handleBufferActivate(le)))),this.enable(),this._model=new C.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,o.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const S=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!(!S||!A||S[0]===A[0]&&S[1]===A[1])}get selectionText(){const S=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;if(!S||!A)return"";const H=this._bufferService.buffer,j=[];if(this._activeSelectionMode===3){if(S[0]===A[0])return"";const $=S[0]<A[0]?S[0]:A[0],I=S[0]<A[0]?A[0]:S[0];for(let Q=S[1];Q<=A[1];Q++){const te=H.translateBufferLineToString(Q,!0,$,I);j.push(te)}}else{const $=S[1]===A[1]?A[0]:void 0;j.push(H.translateBufferLineToString(S[1],!0,S[0],$));for(let I=S[1]+1;I<=A[1]-1;I++){const Q=H.lines.get(I),te=H.translateBufferLineToString(I,!0);Q!=null&&Q.isWrapped?j[j.length-1]+=te:j.push(te)}if(S[1]!==A[1]){const I=H.lines.get(A[1]),Q=H.translateBufferLineToString(A[1],!0,0,A[0]);I&&I.isWrapped?j[j.length-1]+=Q:j.push(Q)}}return j.map(($=>$.replace(k," "))).join(a.isWindows?`\r
45
+ `:`
46
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(S){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),a.isLinux&&S&&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(S){const A=this._getMouseBufferCoords(S),H=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!!(H&&j&&A)&&this._areCoordsInSelection(A,H,j)}isCellInSelection(S,A){const H=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!H||!j)&&this._areCoordsInSelection([S,A],H,j)}_areCoordsInSelection(S,A,H){return S[1]>A[1]&&S[1]<H[1]||A[1]===H[1]&&S[1]===A[1]&&S[0]>=A[0]&&S[0]<H[0]||A[1]<H[1]&&S[1]===H[1]&&S[0]<H[0]||A[1]<H[1]&&S[1]===A[1]&&S[0]>=A[0]}_selectWordAtCursor(S,A){var $,I;const H=(I=($=this._linkifier.currentLink)==null?void 0:$.link)==null?void 0:I.range;if(H)return this._model.selectionStart=[H.start.x-1,H.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(H,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const j=this._getMouseBufferCoords(S);return!!j&&(this._selectWordAt(j,A),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(S,A){this._model.clearSelection(),S=Math.max(S,0),A=Math.min(A,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,S],this._model.selectionEnd=[this._bufferService.cols,A],this.refresh(),this._onSelectionChange.fire()}_handleTrim(S){this._model.handleTrim(S)&&this.refresh()}_getMouseBufferCoords(S){const A=this._mouseService.getCoords(S,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(A)return A[0]--,A[1]--,A[1]+=this._bufferService.buffer.ydisp,A}_getMouseEventScrollAmount(S){let A=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,S,this._screenElement)[1];const H=this._renderService.dimensions.css.canvas.height;return A>=0&&A<=H?0:(A>H&&(A-=H),A=Math.min(Math.max(A,-50),50),A/=50,A/Math.abs(A)+Math.round(14*A))}shouldForceSelection(S){return a.isMac?S.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:S.shiftKey}handleMouseDown(S){if(this._mouseDownTimeStamp=S.timeStamp,(S.button!==2||!this.hasSelection)&&S.button===0){if(!this._enabled){if(!this.shouldForceSelection(S))return;S.stopPropagation()}S.preventDefault(),this._dragScrollAmount=0,this._enabled&&S.shiftKey?this._handleIncrementalClick(S):S.detail===1?this._handleSingleClick(S):S.detail===2?this._handleDoubleClick(S):S.detail===3&&this._handleTripleClick(S),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(S){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(S))}_handleSingleClick(S){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(S)?3:0,this._model.selectionStart=this._getMouseBufferCoords(S),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const A=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);A&&A.length!==this._model.selectionStart[0]&&A.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(S){this._selectWordAtCursor(S,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(S){const A=this._getMouseBufferCoords(S);A&&(this._activeSelectionMode=2,this._selectLineAt(A[1]))}shouldColumnSelect(S){return S.altKey&&!(a.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(S){if(S.stopImmediatePropagation(),!this._model.selectionStart)return;const A=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(S),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(S),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const H=this._bufferService.buffer;if(this._model.selectionEnd[1]<H.lines.length){const j=H.lines.get(this._model.selectionEnd[1]);j&&j.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}A&&A[0]===this._model.selectionEnd[0]&&A[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const S=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(S.ydisp+this._bufferService.rows,S.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=S.ydisp),this.refresh()}}_handleMouseUp(S){const A=S.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&A<500&&S.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const H=this._mouseService.getCoords(S,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(H&&H[0]!==void 0&&H[1]!==void 0){const j=(0,g.moveToCellSequence)(H[0]-1,H[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(j,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const S=this._model.finalSelectionStart,A=this._model.finalSelectionEnd,H=!(!S||!A||S[0]===A[0]&&S[1]===A[1]);H?S&&A&&(this._oldSelectionStart&&this._oldSelectionEnd&&S[0]===this._oldSelectionStart[0]&&S[1]===this._oldSelectionStart[1]&&A[0]===this._oldSelectionEnd[0]&&A[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(S,A,H)):this._oldHasSelection&&this._fireOnSelectionChange(S,A,H)}_fireOnSelectionChange(S,A,H){this._oldSelectionStart=S,this._oldSelectionEnd=A,this._oldHasSelection=H,this._onSelectionChange.fire()}_handleBufferActivate(S){this.clearSelection(),this._trimListener.dispose(),this._trimListener=S.activeBuffer.lines.onTrim((A=>this._handleTrim(A)))}_convertViewportColToCharacterIndex(S,A){let H=A;for(let j=0;A>=j;j++){const $=S.loadCell(j,this._workCell).getChars().length;this._workCell.getWidth()===0?H--:$>1&&A!==j&&(H+=$-1)}return H}setSelection(S,A,H){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[S,A],this._model.selectionStartLength=H,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(S){this._isClickInSelection(S)||(this._selectWordAtCursor(S,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(S,A,H=!0,j=!0){if(S[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,I=$.lines.get(S[1]);if(!I)return;const Q=$.translateBufferLineToString(S[1],!1);let te=this._convertViewportColToCharacterIndex(I,S[0]),ne=te;const le=S[0]-te;let G=0,L=0,O=0,T=0;if(Q.charAt(te)===" "){for(;te>0&&Q.charAt(te-1)===" ";)te--;for(;ne<Q.length&&Q.charAt(ne+1)===" ";)ne++}else{let re=S[0],ce=S[0];I.getWidth(re)===0&&(G++,re--),I.getWidth(ce)===2&&(L++,ce++);const he=I.getString(ce).length;for(he>1&&(T+=he-1,ne+=he-1);re>0&&te>0&&!this._isCharWordSeparator(I.loadCell(re-1,this._workCell));){I.loadCell(re-1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===0?(G++,re--):W>1&&(O+=W-1,te-=W-1),te--,re--}for(;ce<I.length&&ne+1<Q.length&&!this._isCharWordSeparator(I.loadCell(ce+1,this._workCell));){I.loadCell(ce+1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,ce++):W>1&&(T+=W-1,ne+=W-1),ne++,ce++}}ne++;let P=te+le-G+O,Z=Math.min(this._bufferService.cols,ne-te+G+L-O-T);if(A||Q.slice(te,ne).trim()!==""){if(H&&P===0&&I.getCodePoint(0)!==32){const re=$.lines.get(S[1]-1);if(re&&I.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,S[1]-1],!1,!0,!1);if(ce){const he=this._bufferService.cols-ce.start;P-=he,Z+=he}}}if(j&&P+Z===this._bufferService.cols&&I.getCodePoint(this._bufferService.cols-1)!==32){const re=$.lines.get(S[1]+1);if(re!=null&&re.isWrapped&&re.getCodePoint(0)!==32){const ce=this._getWordAt([0,S[1]+1],!1,!1,!0);ce&&(Z+=ce.length)}}return{start:P,length:Z}}}_selectWordAt(S,A){const H=this._getWordAt(S,A);if(H){for(;H.start<0;)H.start+=this._bufferService.cols,S[1]--;this._model.selectionStart=[H.start,S[1]],this._model.selectionStartLength=H.length}}_selectToWordAt(S){const A=this._getWordAt(S,!0);if(A){let H=S[1];for(;A.start<0;)A.start+=this._bufferService.cols,H--;if(!this._model.areSelectionValuesReversed())for(;A.start+A.length>this._bufferService.cols;)A.length-=this._bufferService.cols,H++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?A.start:A.start+A.length,H]}}_isCharWordSeparator(S){return S.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(S.getChars())>=0}_selectLineAt(S){const A=this._bufferService.buffer.getWrappedRangeForLine(S),H={start:{x:0,y:A.first},end:{x:this._bufferService.cols-1,y:A.last}};this._model.selectionStart=[0,A.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(H,this._bufferService.cols)}};l.SelectionService=R=v([w(3,p.IBufferService),w(4,p.ICoreService),w(5,x.IMouseService),w(6,p.IOptionsService),w(7,x.IRenderService),w(8,x.ICoreBrowserService)],R)},4725:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const v=u(8343);l.ICharSizeService=(0,v.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,v.createDecorator)("CoreBrowserService"),l.IMouseService=(0,v.createDecorator)("MouseService"),l.IRenderService=(0,v.createDecorator)("RenderService"),l.ISelectionService=(0,v.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,v.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,v.createDecorator)("ThemeService"),l.ILinkProviderService=(0,v.createDecorator)("LinkProviderService")},6731:function(F,l,u){var v=this&&this.__decorate||function(R,S,A,H){var j,$=arguments.length,I=$<3?S:H===null?H=Object.getOwnPropertyDescriptor(S,A):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(R,S,A,H);else for(var Q=R.length-1;Q>=0;Q--)(j=R[Q])&&(I=($<3?j(I):$>3?j(S,A,I):j(S,A))||I);return $>3&&I&&Object.defineProperty(S,A,I),I},w=this&&this.__param||function(R,S){return function(A,H){S(A,H,R)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const f=u(7239),g=u(8055),C=u(8460),x=u(844),m=u(2585),o=g.css.toColor("#ffffff"),a=g.css.toColor("#000000"),s=g.css.toColor("#ffffff"),n=g.css.toColor("#000000"),p={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const R=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],S=[0,95,135,175,215,255];for(let A=0;A<216;A++){const H=S[A/36%6|0],j=S[A/6%6|0],$=S[A%6];R.push({css:g.channels.toCss(H,j,$),rgba:g.channels.toRgba(H,j,$)})}for(let A=0;A<24;A++){const H=8+10*A;R.push({css:g.channels.toCss(H,H,H),rgba:g.channels.toRgba(H,H,H)})}return R})());let b=l.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(R){super(),this._optionsService=R,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:o,background:a,cursor:s,cursorAccent:n,selectionForeground:void 0,selectionBackgroundTransparent:p,selectionBackgroundOpaque:g.color.blend(a,p),selectionInactiveBackgroundTransparent:p,selectionInactiveBackgroundOpaque:g.color.blend(a,p),ansi:l.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(R={}){const S=this._colors;if(S.foreground=k(R.foreground,o),S.background=k(R.background,a),S.cursor=k(R.cursor,s),S.cursorAccent=k(R.cursorAccent,n),S.selectionBackgroundTransparent=k(R.selectionBackground,p),S.selectionBackgroundOpaque=g.color.blend(S.background,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundTransparent=k(R.selectionInactiveBackground,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundOpaque=g.color.blend(S.background,S.selectionInactiveBackgroundTransparent),S.selectionForeground=R.selectionForeground?k(R.selectionForeground,g.NULL_COLOR):void 0,S.selectionForeground===g.NULL_COLOR&&(S.selectionForeground=void 0),g.color.isOpaque(S.selectionBackgroundTransparent)&&(S.selectionBackgroundTransparent=g.color.opacity(S.selectionBackgroundTransparent,.3)),g.color.isOpaque(S.selectionInactiveBackgroundTransparent)&&(S.selectionInactiveBackgroundTransparent=g.color.opacity(S.selectionInactiveBackgroundTransparent,.3)),S.ansi=l.DEFAULT_ANSI_COLORS.slice(),S.ansi[0]=k(R.black,l.DEFAULT_ANSI_COLORS[0]),S.ansi[1]=k(R.red,l.DEFAULT_ANSI_COLORS[1]),S.ansi[2]=k(R.green,l.DEFAULT_ANSI_COLORS[2]),S.ansi[3]=k(R.yellow,l.DEFAULT_ANSI_COLORS[3]),S.ansi[4]=k(R.blue,l.DEFAULT_ANSI_COLORS[4]),S.ansi[5]=k(R.magenta,l.DEFAULT_ANSI_COLORS[5]),S.ansi[6]=k(R.cyan,l.DEFAULT_ANSI_COLORS[6]),S.ansi[7]=k(R.white,l.DEFAULT_ANSI_COLORS[7]),S.ansi[8]=k(R.brightBlack,l.DEFAULT_ANSI_COLORS[8]),S.ansi[9]=k(R.brightRed,l.DEFAULT_ANSI_COLORS[9]),S.ansi[10]=k(R.brightGreen,l.DEFAULT_ANSI_COLORS[10]),S.ansi[11]=k(R.brightYellow,l.DEFAULT_ANSI_COLORS[11]),S.ansi[12]=k(R.brightBlue,l.DEFAULT_ANSI_COLORS[12]),S.ansi[13]=k(R.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),S.ansi[14]=k(R.brightCyan,l.DEFAULT_ANSI_COLORS[14]),S.ansi[15]=k(R.brightWhite,l.DEFAULT_ANSI_COLORS[15]),R.extendedAnsi){const A=Math.min(S.ansi.length-16,R.extendedAnsi.length);for(let H=0;H<A;H++)S.ansi[H+16]=k(R.extendedAnsi[H],l.DEFAULT_ANSI_COLORS[H+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(R){this._restoreColor(R),this._onChangeColors.fire(this.colors)}_restoreColor(R){if(R!==void 0)switch(R){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[R]=this._restoreColors.ansi[R]}else for(let S=0;S<this._restoreColors.ansi.length;++S)this._colors.ansi[S]=this._restoreColors.ansi[S]}modifyColors(R){R(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function k(R,S){if(R!==void 0)try{return g.css.toColor(R)}catch{}return S}l.ThemeService=b=v([w(0,m.IOptionsService)],b)},6349:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const v=u(8460),w=u(844);class f extends w.Disposable{constructor(C){super(),this._maxLength=C,this.onDeleteEmitter=this.register(new v.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new v.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new v.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(C){if(this._maxLength===C)return;const x=new Array(C);for(let m=0;m<Math.min(C,this.length);m++)x[m]=this._array[this._getCyclicIndex(m)];this._array=x,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let x=this._length;x<C;x++)this._array[x]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,x){this._array[this._getCyclicIndex(C)]=x}push(C){this._array[this._getCyclicIndex(this._length)]=C,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(C,x,...m){if(x){for(let o=C;o<this._length-x;o++)this._array[this._getCyclicIndex(o)]=this._array[this._getCyclicIndex(o+x)];this._length-=x,this.onDeleteEmitter.fire({index:C,amount:x})}for(let o=this._length-1;o>=C;o--)this._array[this._getCyclicIndex(o+m.length)]=this._array[this._getCyclicIndex(o)];for(let o=0;o<m.length;o++)this._array[this._getCyclicIndex(C+o)]=m[o];if(m.length&&this.onInsertEmitter.fire({index:C,amount:m.length}),this._length+m.length>this._maxLength){const o=this._length+m.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=m.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,x,m){if(!(x<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+m<0)throw new Error("Cannot shift elements in list beyond index 0");if(m>0){for(let a=x-1;a>=0;a--)this.set(C+a+m,this.get(C+a));const o=C+x+m-this._length;if(o>0)for(this._length+=o;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let o=0;o<x;o++)this.set(C+o+m,this.get(C+o))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}l.CircularList=f},1439:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function u(v,w=5){if(typeof v!="object")return v;const f=Array.isArray(v)?[]:{};for(const g in v)f[g]=w<=1?v[g]:v[g]&&u(v[g],w-1);return f}},8055:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let u=0,v=0,w=0,f=0;var g,C,x,m,o;function a(n){const p=n.toString(16);return p.length<2?"0"+p:p}function s(n,p){return n<p?(p+.05)/(n+.05):(n+.05)/(p+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(n){n.toCss=function(p,b,k,R){return R!==void 0?`#${a(p)}${a(b)}${a(k)}${a(R)}`:`#${a(p)}${a(b)}${a(k)}`},n.toRgba=function(p,b,k,R=255){return(p<<24|b<<16|k<<8|R)>>>0},n.toColor=function(p,b,k,R){return{css:n.toCss(p,b,k,R),rgba:n.toRgba(p,b,k,R)}}})(g||(l.channels=g={})),(function(n){function p(b,k){return f=Math.round(255*k),[u,v,w]=o.toChannels(b.rgba),{css:g.toCss(u,v,w,f),rgba:g.toRgba(u,v,w,f)}}n.blend=function(b,k){if(f=(255&k.rgba)/255,f===1)return{css:k.css,rgba:k.rgba};const R=k.rgba>>24&255,S=k.rgba>>16&255,A=k.rgba>>8&255,H=b.rgba>>24&255,j=b.rgba>>16&255,$=b.rgba>>8&255;return u=H+Math.round((R-H)*f),v=j+Math.round((S-j)*f),w=$+Math.round((A-$)*f),{css:g.toCss(u,v,w),rgba:g.toRgba(u,v,w)}},n.isOpaque=function(b){return(255&b.rgba)==255},n.ensureContrastRatio=function(b,k,R){const S=o.ensureContrastRatio(b.rgba,k.rgba,R);if(S)return g.toColor(S>>24&255,S>>16&255,S>>8&255)},n.opaque=function(b){const k=(255|b.rgba)>>>0;return[u,v,w]=o.toChannels(k),{css:g.toCss(u,v,w),rgba:k}},n.opacity=p,n.multiplyOpacity=function(b,k){return f=255&b.rgba,p(b,f*k/255)},n.toColorRGB=function(b){return[b.rgba>>24&255,b.rgba>>16&255,b.rgba>>8&255]}})(C||(l.color=C={})),(function(n){let p,b;try{const k=document.createElement("canvas");k.width=1,k.height=1;const R=k.getContext("2d",{willReadFrequently:!0});R&&(p=R,p.globalCompositeOperation="copy",b=p.createLinearGradient(0,0,1,1))}catch{}n.toColor=function(k){if(k.match(/#[\da-f]{3,8}/i))switch(k.length){case 4:return u=parseInt(k.slice(1,2).repeat(2),16),v=parseInt(k.slice(2,3).repeat(2),16),w=parseInt(k.slice(3,4).repeat(2),16),g.toColor(u,v,w);case 5:return u=parseInt(k.slice(1,2).repeat(2),16),v=parseInt(k.slice(2,3).repeat(2),16),w=parseInt(k.slice(3,4).repeat(2),16),f=parseInt(k.slice(4,5).repeat(2),16),g.toColor(u,v,w,f);case 7:return{css:k,rgba:(parseInt(k.slice(1),16)<<8|255)>>>0};case 9:return{css:k,rgba:parseInt(k.slice(1),16)>>>0}}const R=k.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(R)return u=parseInt(R[1]),v=parseInt(R[2]),w=parseInt(R[3]),f=Math.round(255*(R[5]===void 0?1:parseFloat(R[5]))),g.toColor(u,v,w,f);if(!p||!b)throw new Error("css.toColor: Unsupported css format");if(p.fillStyle=b,p.fillStyle=k,typeof p.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(p.fillRect(0,0,1,1),[u,v,w,f]=p.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(u,v,w,f),css:k}}})(x||(l.css=x={})),(function(n){function p(b,k,R){const S=b/255,A=k/255,H=R/255;return .2126*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.7152*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.0722*(H<=.03928?H/12.92:Math.pow((H+.055)/1.055,2.4))}n.relativeLuminance=function(b){return p(b>>16&255,b>>8&255,255&b)},n.relativeLuminance2=p})(m||(l.rgb=m={})),(function(n){function p(k,R,S){const A=k>>24&255,H=k>>16&255,j=k>>8&255;let $=R>>24&255,I=R>>16&255,Q=R>>8&255,te=s(m.relativeLuminance2($,I,Q),m.relativeLuminance2(A,H,j));for(;te<S&&($>0||I>0||Q>0);)$-=Math.max(0,Math.ceil(.1*$)),I-=Math.max(0,Math.ceil(.1*I)),Q-=Math.max(0,Math.ceil(.1*Q)),te=s(m.relativeLuminance2($,I,Q),m.relativeLuminance2(A,H,j));return($<<24|I<<16|Q<<8|255)>>>0}function b(k,R,S){const A=k>>24&255,H=k>>16&255,j=k>>8&255;let $=R>>24&255,I=R>>16&255,Q=R>>8&255,te=s(m.relativeLuminance2($,I,Q),m.relativeLuminance2(A,H,j));for(;te<S&&($<255||I<255||Q<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),I=Math.min(255,I+Math.ceil(.1*(255-I))),Q=Math.min(255,Q+Math.ceil(.1*(255-Q))),te=s(m.relativeLuminance2($,I,Q),m.relativeLuminance2(A,H,j));return($<<24|I<<16|Q<<8|255)>>>0}n.blend=function(k,R){if(f=(255&R)/255,f===1)return R;const S=R>>24&255,A=R>>16&255,H=R>>8&255,j=k>>24&255,$=k>>16&255,I=k>>8&255;return u=j+Math.round((S-j)*f),v=$+Math.round((A-$)*f),w=I+Math.round((H-I)*f),g.toRgba(u,v,w)},n.ensureContrastRatio=function(k,R,S){const A=m.relativeLuminance(k>>8),H=m.relativeLuminance(R>>8);if(s(A,H)<S){if(H<A){const I=p(k,R,S),Q=s(A,m.relativeLuminance(I>>8));if(Q<S){const te=b(k,R,S);return Q>s(A,m.relativeLuminance(te>>8))?I:te}return I}const j=b(k,R,S),$=s(A,m.relativeLuminance(j>>8));if($<S){const I=p(k,R,S);return $>s(A,m.relativeLuminance(I>>8))?j:I}return j}},n.reduceLuminance=p,n.increaseLuminance=b,n.toChannels=function(k){return[k>>24&255,k>>16&255,k>>8&255,255&k]}})(o||(l.rgba=o={})),l.toPaddedHex=a,l.contrastRatio=s},8969:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const v=u(844),w=u(2585),f=u(4348),g=u(7866),C=u(744),x=u(7302),m=u(6975),o=u(8460),a=u(1753),s=u(1480),n=u(7994),p=u(9282),b=u(5435),k=u(5981),R=u(2660);let S=!1;class A extends v.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new o.EventEmitter),this._onScroll.event((j=>{var $;($=this._onScrollApi)==null||$.fire(j.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(j){for(const $ in j)this.optionsService.options[$]=j[$]}constructor(j){super(),this._windowsWrappingHeuristics=this.register(new v.MutableDisposable),this._onBinary=this.register(new o.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new o.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new o.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new o.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new x.OptionsService(j)),this._instantiationService.setService(w.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(w.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(w.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(m.CoreService)),this._instantiationService.setService(w.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(a.CoreMouseService)),this._instantiationService.setService(w.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(w.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(n.CharsetService),this._instantiationService.setService(w.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(R.OscLinkService),this._instantiationService.setService(w.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new b.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,o.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,o.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,o.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,o.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new k.WriteBuffer((($,I)=>this._inputHandler.parse($,I)))),this.register((0,o.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(j,$){this._writeBuffer.write(j,$)}writeSync(j,$){this._logService.logLevel<=w.LogLevelEnum.WARN&&!S&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S=!0),this._writeBuffer.writeSync(j,$)}input(j,$=!0){this.coreService.triggerDataEvent(j,$)}resize(j,$){isNaN(j)||isNaN($)||(j=Math.max(j,C.MINIMUM_COLS),$=Math.max($,C.MINIMUM_ROWS),this._bufferService.resize(j,$))}scroll(j,$=!1){this._bufferService.scroll(j,$)}scrollLines(j,$,I){this._bufferService.scrollLines(j,$,I)}scrollPages(j){this.scrollLines(j*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(j){const $=j-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(j,$){return this._inputHandler.registerEscHandler(j,$)}registerDcsHandler(j,$){return this._inputHandler.registerDcsHandler(j,$)}registerCsiHandler(j,$){return this._inputHandler.registerCsiHandler(j,$)}registerOscHandler(j,$){return this._inputHandler.registerOscHandler(j,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let j=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?j=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(j=!0),j?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const j=[];j.push(this.onLineFeed(p.updateWindowsModeWrappedState.bind(null,this._bufferService))),j.push(this.registerCsiHandler({final:"H"},(()=>((0,p.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,v.toDisposable)((()=>{for(const $ of j)$.dispose()}))}}}l.CoreTerminal=A},8460:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let v=0;v<this._listeners.length;v++)if(this._listeners[v]===u)return void this._listeners.splice(v,1)}}})),this._event}fire(u,v){const w=[];for(let f=0;f<this._listeners.length;f++)w.push(this._listeners[f]);for(let f=0;f<w.length;f++)w[f].call(void 0,u,v)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(u,v){return u((w=>v.fire(w)))},l.runAndSubscribe=function(u,v){return v(void 0),u((w=>v(w)))}},5435:function(F,l,u){var v=this&&this.__decorate||function(G,L,O,T){var P,Z=arguments.length,re=Z<3?L:T===null?T=Object.getOwnPropertyDescriptor(L,O):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(G,L,O,T);else for(var ce=G.length-1;ce>=0;ce--)(P=G[ce])&&(re=(Z<3?P(re):Z>3?P(L,O,re):P(L,O))||re);return Z>3&&re&&Object.defineProperty(L,O,re),re},w=this&&this.__param||function(G,L){return function(O,T){L(O,T,G)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const f=u(2584),g=u(7116),C=u(2015),x=u(844),m=u(482),o=u(8437),a=u(8460),s=u(643),n=u(511),p=u(3734),b=u(2585),k=u(1480),R=u(6242),S=u(6351),A=u(5941),H={"(":0,")":1,"*":2,"+":3,"-":1,".":2},j=131072;function $(G,L){if(G>24)return L.setWinLines||!1;switch(G){case 1:return!!L.restoreWin;case 2:return!!L.minimizeWin;case 3:return!!L.setWinPosition;case 4:return!!L.setWinSizePixels;case 5:return!!L.raiseWin;case 6:return!!L.lowerWin;case 7:return!!L.refreshWin;case 8:return!!L.setWinSizeChars;case 9:return!!L.maximizeWin;case 10:return!!L.fullscreenWin;case 11:return!!L.getWinState;case 13:return!!L.getWinPosition;case 14:return!!L.getWinSizePixels;case 15:return!!L.getScreenSizePixels;case 16:return!!L.getCellSizePixels;case 18:return!!L.getWinSizeChars;case 19:return!!L.getScreenSizeChars;case 20:return!!L.getIconTitle;case 21:return!!L.getWinTitle;case 22:return!!L.pushTitle;case 23:return!!L.popTitle;case 24:return!!L.setWinLines}return!1}var I;(function(G){G[G.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",G[G.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(I||(l.WindowsOptionsReportType=I={}));let Q=0;class te extends x.Disposable{getAttrData(){return this._curAttrData}constructor(L,O,T,P,Z,re,ce,he,W=new C.EscapeSequenceParser){super(),this._bufferService=L,this._charsetService=O,this._coreService=T,this._logService=P,this._optionsService=Z,this._oscLinkService=re,this._coreMouseService=ce,this._unicodeService=he,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new m.StringToUtf32,this._utf8Decoder=new m.Utf8ToUtf32,this._workCell=new n.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new a.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new a.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new a.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new a.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new a.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new a.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new a.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new a.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new a.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new a.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new a.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new ne(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._parser.setCsiHandlerFallback(((B,ee)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(B),params:ee.toArray()})})),this._parser.setEscHandlerFallback((B=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(B)})})),this._parser.setExecuteHandlerFallback((B=>{this._logService.debug("Unknown EXECUTE code: ",{code:B})})),this._parser.setOscHandlerFallback(((B,ee,J)=>{this._logService.debug("Unknown OSC code: ",{identifier:B,action:ee,data:J})})),this._parser.setDcsHandlerFallback(((B,ee,J)=>{ee==="HOOK"&&(J=J.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(B),action:ee,payload:J})})),this._parser.setPrintHandler(((B,ee,J)=>this.print(B,ee,J))),this._parser.registerCsiHandler({final:"@"},(B=>this.insertChars(B))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(B=>this.scrollLeft(B))),this._parser.registerCsiHandler({final:"A"},(B=>this.cursorUp(B))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(B=>this.scrollRight(B))),this._parser.registerCsiHandler({final:"B"},(B=>this.cursorDown(B))),this._parser.registerCsiHandler({final:"C"},(B=>this.cursorForward(B))),this._parser.registerCsiHandler({final:"D"},(B=>this.cursorBackward(B))),this._parser.registerCsiHandler({final:"E"},(B=>this.cursorNextLine(B))),this._parser.registerCsiHandler({final:"F"},(B=>this.cursorPrecedingLine(B))),this._parser.registerCsiHandler({final:"G"},(B=>this.cursorCharAbsolute(B))),this._parser.registerCsiHandler({final:"H"},(B=>this.cursorPosition(B))),this._parser.registerCsiHandler({final:"I"},(B=>this.cursorForwardTab(B))),this._parser.registerCsiHandler({final:"J"},(B=>this.eraseInDisplay(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(B=>this.eraseInDisplay(B,!0))),this._parser.registerCsiHandler({final:"K"},(B=>this.eraseInLine(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(B=>this.eraseInLine(B,!0))),this._parser.registerCsiHandler({final:"L"},(B=>this.insertLines(B))),this._parser.registerCsiHandler({final:"M"},(B=>this.deleteLines(B))),this._parser.registerCsiHandler({final:"P"},(B=>this.deleteChars(B))),this._parser.registerCsiHandler({final:"S"},(B=>this.scrollUp(B))),this._parser.registerCsiHandler({final:"T"},(B=>this.scrollDown(B))),this._parser.registerCsiHandler({final:"X"},(B=>this.eraseChars(B))),this._parser.registerCsiHandler({final:"Z"},(B=>this.cursorBackwardTab(B))),this._parser.registerCsiHandler({final:"`"},(B=>this.charPosAbsolute(B))),this._parser.registerCsiHandler({final:"a"},(B=>this.hPositionRelative(B))),this._parser.registerCsiHandler({final:"b"},(B=>this.repeatPrecedingCharacter(B))),this._parser.registerCsiHandler({final:"c"},(B=>this.sendDeviceAttributesPrimary(B))),this._parser.registerCsiHandler({prefix:">",final:"c"},(B=>this.sendDeviceAttributesSecondary(B))),this._parser.registerCsiHandler({final:"d"},(B=>this.linePosAbsolute(B))),this._parser.registerCsiHandler({final:"e"},(B=>this.vPositionRelative(B))),this._parser.registerCsiHandler({final:"f"},(B=>this.hVPosition(B))),this._parser.registerCsiHandler({final:"g"},(B=>this.tabClear(B))),this._parser.registerCsiHandler({final:"h"},(B=>this.setMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(B=>this.setModePrivate(B))),this._parser.registerCsiHandler({final:"l"},(B=>this.resetMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(B=>this.resetModePrivate(B))),this._parser.registerCsiHandler({final:"m"},(B=>this.charAttributes(B))),this._parser.registerCsiHandler({final:"n"},(B=>this.deviceStatus(B))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(B=>this.deviceStatusPrivate(B))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(B=>this.softReset(B))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(B=>this.setCursorStyle(B))),this._parser.registerCsiHandler({final:"r"},(B=>this.setScrollRegion(B))),this._parser.registerCsiHandler({final:"s"},(B=>this.saveCursor(B))),this._parser.registerCsiHandler({final:"t"},(B=>this.windowOptions(B))),this._parser.registerCsiHandler({final:"u"},(B=>this.restoreCursor(B))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(B=>this.insertColumns(B))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(B=>this.deleteColumns(B))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(B=>this.selectProtected(B))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(B=>this.requestMode(B,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(B=>this.requestMode(B,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new R.OscHandler((B=>(this.setTitle(B),this.setIconName(B),!0)))),this._parser.registerOscHandler(1,new R.OscHandler((B=>this.setIconName(B)))),this._parser.registerOscHandler(2,new R.OscHandler((B=>this.setTitle(B)))),this._parser.registerOscHandler(4,new R.OscHandler((B=>this.setOrReportIndexedColor(B)))),this._parser.registerOscHandler(8,new R.OscHandler((B=>this.setHyperlink(B)))),this._parser.registerOscHandler(10,new R.OscHandler((B=>this.setOrReportFgColor(B)))),this._parser.registerOscHandler(11,new R.OscHandler((B=>this.setOrReportBgColor(B)))),this._parser.registerOscHandler(12,new R.OscHandler((B=>this.setOrReportCursorColor(B)))),this._parser.registerOscHandler(104,new R.OscHandler((B=>this.restoreIndexedColor(B)))),this._parser.registerOscHandler(110,new R.OscHandler((B=>this.restoreFgColor(B)))),this._parser.registerOscHandler(111,new R.OscHandler((B=>this.restoreBgColor(B)))),this._parser.registerOscHandler(112,new R.OscHandler((B=>this.restoreCursorColor(B)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const B in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:B},(()=>this.selectCharset("("+B))),this._parser.registerEscHandler({intermediates:")",final:B},(()=>this.selectCharset(")"+B))),this._parser.registerEscHandler({intermediates:"*",final:B},(()=>this.selectCharset("*"+B))),this._parser.registerEscHandler({intermediates:"+",final:B},(()=>this.selectCharset("+"+B))),this._parser.registerEscHandler({intermediates:"-",final:B},(()=>this.selectCharset("-"+B))),this._parser.registerEscHandler({intermediates:".",final:B},(()=>this.selectCharset("."+B))),this._parser.registerEscHandler({intermediates:"/",final:B},(()=>this.selectCharset("/"+B)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((B=>(this._logService.error("Parsing error: ",B),B))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new S.DcsHandler(((B,ee)=>this.requestStatusString(B,ee))))}_preserveStack(L,O,T,P){this._parseStack.paused=!0,this._parseStack.cursorStartX=L,this._parseStack.cursorStartY=O,this._parseStack.decodedLength=T,this._parseStack.position=P}_logSlowResolvingAsync(L){this._logService.logLevel<=b.LogLevelEnum.WARN&&Promise.race([L,new Promise(((O,T)=>setTimeout((()=>T("#SLOW_TIMEOUT")),5e3)))]).catch((O=>{if(O!=="#SLOW_TIMEOUT")throw O;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(L,O){let T,P=this._activeBuffer.x,Z=this._activeBuffer.y,re=0;const ce=this._parseStack.paused;if(ce){if(T=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,O))return this._logSlowResolvingAsync(T),T;P=this._parseStack.cursorStartX,Z=this._parseStack.cursorStartY,this._parseStack.paused=!1,L.length>j&&(re=this._parseStack.position+j)}if(this._logService.logLevel<=b.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof L=="string"?` "${L}"`:` "${Array.prototype.map.call(L,(B=>String.fromCharCode(B))).join("")}"`),typeof L=="string"?L.split("").map((B=>B.charCodeAt(0))):L),this._parseBuffer.length<L.length&&this._parseBuffer.length<j&&(this._parseBuffer=new Uint32Array(Math.min(L.length,j))),ce||this._dirtyRowTracker.clearRange(),L.length>j)for(let B=re;B<L.length;B+=j){const ee=B+j<L.length?B+j:L.length,J=typeof L=="string"?this._stringDecoder.decode(L.substring(B,ee),this._parseBuffer):this._utf8Decoder.decode(L.subarray(B,ee),this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,J))return this._preserveStack(P,Z,J,B),this._logSlowResolvingAsync(T),T}else if(!ce){const B=typeof L=="string"?this._stringDecoder.decode(L,this._parseBuffer):this._utf8Decoder.decode(L,this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,B))return this._preserveStack(P,Z,B,0),this._logSlowResolvingAsync(T),T}this._activeBuffer.x===P&&this._activeBuffer.y===Z||this._onCursorMove.fire();const he=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),W=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);W<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(W,this._bufferService.rows-1),Math.min(he,this._bufferService.rows-1))}print(L,O,T){let P,Z;const re=this._charsetService.charset,ce=this._optionsService.rawOptions.screenReaderMode,he=this._bufferService.cols,W=this._coreService.decPrivateModes.wraparound,B=this._coreService.modes.insertMode,ee=this._curAttrData;let J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&T-O>0&&J.getWidth(this._activeBuffer.x-1)===2&&J.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ee);let de=this._parser.precedingJoinState;for(let ue=O;ue<T;++ue){if(P=L[ue],P<127&&re){const Ge=re[String.fromCharCode(P)];Ge&&(P=Ge.charCodeAt(0))}const Ee=this._unicodeService.charProperties(P,de);Z=k.UnicodeService.extractWidth(Ee);const Le=k.UnicodeService.extractShouldJoin(Ee),Te=Le?k.UnicodeService.extractWidth(de):0;if(de=Ee,ce&&this._onA11yChar.fire((0,m.stringFromCodePoint)(P)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Z-Te>he){if(W){const Ge=J;let ye=this._activeBuffer.x-Te;for(this._activeBuffer.x=Te,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Te>0&&J instanceof o.BufferLine&&J.copyCellsFrom(Ge,ye,0,Te,!1);ye<he;)Ge.setCellFromCodepoint(ye++,0,1,ee)}else if(this._activeBuffer.x=he-1,Z===2)continue}if(Le&&this._activeBuffer.x){const Ge=J.getWidth(this._activeBuffer.x-1)?1:2;J.addCodepointToCell(this._activeBuffer.x-Ge,P,Z);for(let ye=Z-Te;--ye>=0;)J.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}else if(B&&(J.insertCells(this._activeBuffer.x,Z-Te,this._activeBuffer.getNullCell(ee)),J.getWidth(he-1)===2&&J.setCellFromCodepoint(he-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,ee)),J.setCellFromCodepoint(this._activeBuffer.x++,P,Z,ee),Z>0)for(;--Z;)J.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}this._parser.precedingJoinState=de,this._activeBuffer.x<he&&T-O>0&&J.getWidth(this._activeBuffer.x)===0&&!J.hasContent(this._activeBuffer.x)&&J.setCellFromCodepoint(this._activeBuffer.x,0,1,ee),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(L,O){return L.final!=="t"||L.prefix||L.intermediates?this._parser.registerCsiHandler(L,O):this._parser.registerCsiHandler(L,(T=>!$(T.params[0],this._optionsService.rawOptions.windowOptions)||O(T)))}registerDcsHandler(L,O){return this._parser.registerDcsHandler(L,new S.DcsHandler(O))}registerEscHandler(L,O){return this._parser.registerEscHandler(L,O)}registerOscHandler(L,O){return this._parser.registerOscHandler(L,new R.OscHandler(O))}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 L;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&&((L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&L.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);O.hasWidth(this._activeBuffer.x)&&!O.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const L=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-L),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(L=this._bufferService.cols-1){this._activeBuffer.x=Math.min(L,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(L,O){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=L,this._activeBuffer.y=this._activeBuffer.scrollTop+O):(this._activeBuffer.x=L,this._activeBuffer.y=O),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(L,O){this._restrictCursor(),this._setCursor(this._activeBuffer.x+L,this._activeBuffer.y+O)}cursorUp(L){const O=this._activeBuffer.y-this._activeBuffer.scrollTop;return O>=0?this._moveCursor(0,-Math.min(O,L.params[0]||1)):this._moveCursor(0,-(L.params[0]||1)),!0}cursorDown(L){const O=this._activeBuffer.scrollBottom-this._activeBuffer.y;return O>=0?this._moveCursor(0,Math.min(O,L.params[0]||1)):this._moveCursor(0,L.params[0]||1),!0}cursorForward(L){return this._moveCursor(L.params[0]||1,0),!0}cursorBackward(L){return this._moveCursor(-(L.params[0]||1),0),!0}cursorNextLine(L){return this.cursorDown(L),this._activeBuffer.x=0,!0}cursorPrecedingLine(L){return this.cursorUp(L),this._activeBuffer.x=0,!0}cursorCharAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(L){return this._setCursor(L.length>=2?(L.params[1]||1)-1:0,(L.params[0]||1)-1),!0}charPosAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(L){return this._moveCursor(L.params[0]||1,0),!0}linePosAbsolute(L){return this._setCursor(this._activeBuffer.x,(L.params[0]||1)-1),!0}vPositionRelative(L){return this._moveCursor(0,L.params[0]||1),!0}hVPosition(L){return this.cursorPosition(L),!0}tabClear(L){const O=L.params[0];return O===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:O===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=L.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=L.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(L){const O=L.params[0];return O===1&&(this._curAttrData.bg|=536870912),O!==2&&O!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(L,O,T,P=!1,Z=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);re.replaceCells(O,T,this._activeBuffer.getNullCell(this._eraseAttrData()),Z),P&&(re.isWrapped=!1)}_resetBufferLine(L,O=!1){const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);T&&(T.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),O),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+L),T.isWrapped=!1)}eraseInDisplay(L,O=!1){let T;switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);T<this._bufferService.rows;T++)this._resetBufferLine(T,O);this._dirtyRowTracker.markDirty(T);break;case 1:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T,0,this._activeBuffer.x+1,!0,O),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(T+1).isWrapped=!1);T--;)this._resetBufferLine(T,O);this._dirtyRowTracker.markDirty(0);break;case 2:for(T=this._bufferService.rows,this._dirtyRowTracker.markDirty(T-1);T--;)this._resetBufferLine(T,O);this._dirtyRowTracker.markDirty(0);break;case 3:const P=this._activeBuffer.lines.length-this._bufferService.rows;P>0&&(this._activeBuffer.lines.trimStart(P),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-P,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-P,0),this._onScroll.fire(0))}return!0}eraseInLine(L,O=!1){switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,O);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,O)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(L){this._restrictCursor();let O=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y,P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Z=this._bufferService.rows-1+this._activeBuffer.ybase-P+1;for(;O--;)this._activeBuffer.lines.splice(Z-1,1),this._activeBuffer.lines.splice(T,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(L){this._restrictCursor();let O=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y;let P;for(P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-P;O--;)this._activeBuffer.lines.splice(T,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(L){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.insertCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(L){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.deleteCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(L){let O=L.params[0]||1;for(;O--;)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(L){let O=L.params[0]||1;for(;O--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(o.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=L.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);P.deleteCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=L.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);P.insertCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=L.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);P.insertCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=L.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);P.deleteCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(L){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(L.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(L){const O=this._parser.precedingJoinState;if(!O)return!0;const T=L.params[0]||1,P=k.UnicodeService.extractWidth(O),Z=this._activeBuffer.x-P,re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Z),ce=new Uint32Array(re.length*T);let he=0;for(let B=0;B<re.length;){const ee=re.codePointAt(B)||0;ce[he++]=ee,B+=ee>65535?2:1}let W=he;for(let B=1;B<T;++B)ce.copyWithin(W,0,he),W+=he;return this.print(ce,0,W),!0}sendDeviceAttributesPrimary(L){return L.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(L){return L.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(L.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(L){return(this._optionsService.rawOptions.termName+"").indexOf(L)===0}setMode(L){for(let O=0;O<L.length;O++)switch(L.params[O]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(L){for(let O=0;O<L.length;O++)switch(L.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),this._charsetService.setgCharset(1,g.DEFAULT_CHARSET),this._charsetService.setgCharset(2,g.DEFAULT_CHARSET),this._charsetService.setgCharset(3,g.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(L){for(let O=0;O<L.length;O++)switch(L.params[O]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(L){for(let O=0;O<L.length;O++)switch(L.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),L.params[O]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(L,O){const T=this._coreService.decPrivateModes,{activeProtocol:P,activeEncoding:Z}=this._coreMouseService,re=this._coreService,{buffers:ce,cols:he}=this._bufferService,{active:W,alt:B}=ce,ee=this._optionsService.rawOptions,J=Le=>Le?1:2,de=L.params[0];return ue=de,Ee=O?de===2?4:de===4?J(re.modes.insertMode):de===12?3:de===20?J(ee.convertEol):0:de===1?J(T.applicationCursorKeys):de===3?ee.windowOptions.setWinLines?he===80?2:he===132?1:0:0:de===6?J(T.origin):de===7?J(T.wraparound):de===8?3:de===9?J(P==="X10"):de===12?J(ee.cursorBlink):de===25?J(!re.isCursorHidden):de===45?J(T.reverseWraparound):de===66?J(T.applicationKeypad):de===67?4:de===1e3?J(P==="VT200"):de===1002?J(P==="DRAG"):de===1003?J(P==="ANY"):de===1004?J(T.sendFocus):de===1005?4:de===1006?J(Z==="SGR"):de===1015?4:de===1016?J(Z==="SGR_PIXELS"):de===1048?1:de===47||de===1047||de===1049?J(W===B):de===2004?J(T.bracketedPasteMode):0,re.triggerDataEvent(`${f.C0.ESC}[${O?"":"?"}${ue};${Ee}$y`),!0;var ue,Ee}_updateAttrColor(L,O,T,P,Z){return O===2?(L|=50331648,L&=-16777216,L|=p.AttributeData.fromColorRGB([T,P,Z])):O===5&&(L&=-50331904,L|=33554432|255&T),L}_extractColor(L,O,T){const P=[0,0,-1,0,0,0];let Z=0,re=0;do{if(P[re+Z]=L.params[O+re],L.hasSubParams(O+re)){const ce=L.getSubParams(O+re);let he=0;do P[1]===5&&(Z=1),P[re+he+1+Z]=ce[he];while(++he<ce.length&&he+re+1+Z<P.length);break}if(P[1]===5&&re+Z>=2||P[1]===2&&re+Z>=5)break;P[1]&&(Z=1)}while(++re+O<L.length&&re+Z<P.length);for(let ce=2;ce<P.length;++ce)P[ce]===-1&&(P[ce]=0);switch(P[0]){case 38:T.fg=this._updateAttrColor(T.fg,P[1],P[3],P[4],P[5]);break;case 48:T.bg=this._updateAttrColor(T.bg,P[1],P[3],P[4],P[5]);break;case 58:T.extended=T.extended.clone(),T.extended.underlineColor=this._updateAttrColor(T.extended.underlineColor,P[1],P[3],P[4],P[5])}return re}_processUnderline(L,O){O.extended=O.extended.clone(),(!~L||L>5)&&(L=1),O.extended.underlineStyle=L,O.fg|=268435456,L===0&&(O.fg&=-268435457),O.updateExtended()}_processSGR0(L){L.fg=o.DEFAULT_ATTR_DATA.fg,L.bg=o.DEFAULT_ATTR_DATA.bg,L.extended=L.extended.clone(),L.extended.underlineStyle=0,L.extended.underlineColor&=-67108864,L.updateExtended()}charAttributes(L){if(L.length===1&&L.params[0]===0)return this._processSGR0(this._curAttrData),!0;const O=L.length;let T;const P=this._curAttrData;for(let Z=0;Z<O;Z++)T=L.params[Z],T>=30&&T<=37?(P.fg&=-50331904,P.fg|=16777216|T-30):T>=40&&T<=47?(P.bg&=-50331904,P.bg|=16777216|T-40):T>=90&&T<=97?(P.fg&=-50331904,P.fg|=16777224|T-90):T>=100&&T<=107?(P.bg&=-50331904,P.bg|=16777224|T-100):T===0?this._processSGR0(P):T===1?P.fg|=134217728:T===3?P.bg|=67108864:T===4?(P.fg|=268435456,this._processUnderline(L.hasSubParams(Z)?L.getSubParams(Z)[0]:1,P)):T===5?P.fg|=536870912:T===7?P.fg|=67108864:T===8?P.fg|=1073741824:T===9?P.fg|=2147483648:T===2?P.bg|=134217728:T===21?this._processUnderline(2,P):T===22?(P.fg&=-134217729,P.bg&=-134217729):T===23?P.bg&=-67108865:T===24?(P.fg&=-268435457,this._processUnderline(0,P)):T===25?P.fg&=-536870913:T===27?P.fg&=-67108865:T===28?P.fg&=-1073741825:T===29?P.fg&=2147483647:T===39?(P.fg&=-67108864,P.fg|=16777215&o.DEFAULT_ATTR_DATA.fg):T===49?(P.bg&=-67108864,P.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):T===38||T===48||T===58?Z+=this._extractColor(L,Z,P):T===53?P.bg|=1073741824:T===55?P.bg&=-1073741825:T===59?(P.extended=P.extended.clone(),P.extended.underlineColor=-1,P.updateExtended()):T===100?(P.fg&=-67108864,P.fg|=16777215&o.DEFAULT_ATTR_DATA.fg,P.bg&=-67108864,P.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",T);return!0}deviceStatus(L){switch(L.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const O=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${O};${T}R`)}return!0}deviceStatusPrivate(L){if(L.params[0]===6){const O=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${O};${T}R`)}return!0}softReset(L){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(L){const O=L.params[0]||1;switch(O){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const T=O%2==1;return this._optionsService.options.cursorBlink=T,!0}setScrollRegion(L){const O=L.params[0]||1;let T;return(L.length<2||(T=L.params[1])>this._bufferService.rows||T===0)&&(T=this._bufferService.rows),T>O&&(this._activeBuffer.scrollTop=O-1,this._activeBuffer.scrollBottom=T-1,this._setCursor(0,0)),!0}windowOptions(L){if(!$(L.params[0],this._optionsService.rawOptions.windowOptions))return!0;const O=L.length>1?L.params[1]:0;switch(L.params[0]){case 14:O!==2&&this._onRequestWindowsOptionsReport.fire(I.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(I.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:O!==0&&O!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),O!==0&&O!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:O!==0&&O!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),O!==0&&O!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(L){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(L){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(L){return this._windowTitle=L,this._onTitleChange.fire(L),!0}setIconName(L){return this._iconName=L,!0}setOrReportIndexedColor(L){const O=[],T=L.split(";");for(;T.length>1;){const P=T.shift(),Z=T.shift();if(/^\d+$/.exec(P)){const re=parseInt(P);if(le(re))if(Z==="?")O.push({type:0,index:re});else{const ce=(0,A.parseColor)(Z);ce&&O.push({type:1,index:re,color:ce})}}}return O.length&&this._onColor.fire(O),!0}setHyperlink(L){const O=L.split(";");return!(O.length<2)&&(O[1]?this._createHyperlink(O[0],O[1]):!O[0]&&this._finishHyperlink())}_createHyperlink(L,O){this._getCurrentLinkId()&&this._finishHyperlink();const T=L.split(":");let P;const Z=T.findIndex((re=>re.startsWith("id=")));return Z!==-1&&(P=T[Z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:P,uri:O}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(L,O){const T=L.split(";");for(let P=0;P<T.length&&!(O>=this._specialColors.length);++P,++O)if(T[P]==="?")this._onColor.fire([{type:0,index:this._specialColors[O]}]);else{const Z=(0,A.parseColor)(T[P]);Z&&this._onColor.fire([{type:1,index:this._specialColors[O],color:Z}])}return!0}setOrReportFgColor(L){return this._setOrReportSpecialColor(L,0)}setOrReportBgColor(L){return this._setOrReportSpecialColor(L,1)}setOrReportCursorColor(L){return this._setOrReportSpecialColor(L,2)}restoreIndexedColor(L){if(!L)return this._onColor.fire([{type:2}]),!0;const O=[],T=L.split(";");for(let P=0;P<T.length;++P)if(/^\d+$/.exec(T[P])){const Z=parseInt(T[P]);le(Z)&&O.push({type:2,index:Z})}return O.length&&this._onColor.fire(O),!0}restoreFgColor(L){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(L){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(L){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),!0}selectCharset(L){return L.length!==2?(this.selectDefaultCharset(),!0):(L[0]==="/"||this._charsetService.setgCharset(H[L[0]],g.CHARSETS[L[1]]||g.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const L=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,L,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(L){return this._charsetService.setgLevel(L),!0}screenAlignmentPattern(){const L=new n.CellData;L.content=4194373,L.fg=this._curAttrData.fg,L.bg=this._curAttrData.bg,this._setCursor(0,0);for(let O=0;O<this._bufferService.rows;++O){const T=this._activeBuffer.ybase+this._activeBuffer.y+O,P=this._activeBuffer.lines.get(T);P&&(P.fill(L),P.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(L,O){const T=this._bufferService.buffer,P=this._optionsService.rawOptions;return(Z=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${Z}${f.C0.ESC}\\`),!0))(L==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:L==='"p'?'P1$r61;1"p':L==="r"?`P1$r${T.scrollTop+1};${T.scrollBottom+1}r`:L==="m"?"P1$r0m":L===" q"?`P1$r${{block:2,underline:4,bar:6}[P.cursorStyle]-(P.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(L,O){this._dirtyRowTracker.markRangeDirty(L,O)}}l.InputHandler=te;let ne=class{constructor(G){this._bufferService=G,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(G){G<this.start?this.start=G:G>this.end&&(this.end=G)}markRangeDirty(G,L){G>L&&(Q=G,G=L,L=Q),G<this.start&&(this.start=G),L>this.end&&(this.end=L)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function le(G){return 0<=G&&G<256}ne=v([w(0,b.IBufferService)],ne)},844:(F,l)=>{function u(v){for(const w of v)w.dispose();v.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const v of this._disposables)v.dispose();this._disposables.length=0}register(v){return this._disposables.push(v),v}unregister(v){const w=this._disposables.indexOf(v);w!==-1&&this._disposables.splice(w,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(v){var w;this._isDisposed||v===this._value||((w=this._value)==null||w.dispose(),this._value=v)}clear(){this.value=void 0}dispose(){var v;this._isDisposed=!0,(v=this._value)==null||v.dispose(),this._value=void 0}},l.toDisposable=function(v){return{dispose:v}},l.disposeArray=u,l.getDisposeArrayDisposable=function(v){return{dispose:()=>u(v)}}},1505:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(w,f,g){this._data[w]||(this._data[w]={}),this._data[w][f]=g}get(w,f){return this._data[w]?this._data[w][f]:void 0}clear(){this._data={}}}l.TwoKeyMap=u,l.FourKeyMap=class{constructor(){this._data=new u}set(v,w,f,g,C){this._data.get(v,w)||this._data.set(v,w,new u),this._data.get(v,w).set(f,g,C)}get(v,w,f,g){var C;return(C=this._data.get(v,w))==null?void 0:C.get(f,g)}clear(){this._data.clear()}}},6114:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const u=l.isNode?"node":navigator.userAgent,v=l.isNode?"node":navigator.platform;l.isFirefox=u.includes("Firefox"),l.isLegacyEdge=u.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(u),l.getSafariVersion=function(){if(!l.isSafari)return 0;const w=u.match(/Version\/(\d+)/);return w===null||w.length<2?0:parseInt(w[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(v),l.isIpad=v==="iPad",l.isIphone=v==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(v),l.isLinux=v.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(u)},6106:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let u=0;l.SortedList=class{constructor(v){this._getKey=v,this._array=[]}clear(){this._array.length=0}insert(v){this._array.length!==0?(u=this._search(this._getKey(v)),this._array.splice(u,0,v)):this._array.push(v)}delete(v){if(this._array.length===0)return!1;const w=this._getKey(v);if(w===void 0||(u=this._search(w),u===-1)||this._getKey(this._array[u])!==w)return!1;do if(this._array[u]===v)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===w);return!1}*getKeyIterator(v){if(this._array.length!==0&&(u=this._search(v),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===v))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===v)}forEachByKey(v,w){if(this._array.length!==0&&(u=this._search(v),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===v))do w(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===v)}values(){return[...this._array].values()}_search(v){let w=0,f=this._array.length-1;for(;f>=w;){let g=w+f>>1;const C=this._getKey(this._array[g]);if(C>v)f=g-1;else{if(!(C<v)){for(;g>0&&this._getKey(this._array[g-1])===v;)g--;return g}w=g+1}}return w}}},7226:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const v=u(6114);class w{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(C){this._idleCallback=void 0;let x=0,m=0,o=C.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),m=Math.max(x,m),a=C.timeRemaining(),1.5*m>a)return o-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(o-x))}ms`),void this._start();o=a}this.clear()}}class f extends w{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const x=Date.now()+C;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}l.PriorityTaskQueue=f,l.IdleTaskQueue=!v.isNode&&"requestIdleCallback"in window?class extends w{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:f,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const v=u(643);l.updateWindowsModeWrappedState=function(w){const f=w.buffer.lines.get(w.buffer.ybase+w.buffer.y-1),g=f==null?void 0:f.get(w.cols-1),C=w.buffer.lines.get(w.buffer.ybase+w.buffer.y);C&&g&&(C.isWrapped=g[v.CHAR_DATA_CODE_INDEX]!==v.NULL_CELL_CODE&&g[v.CHAR_DATA_CODE_INDEX]!==v.WHITESPACE_CELL_CODE)}},3734:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new v}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new u;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}l.AttributeData=u;class v{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,g=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=g}clone(){return new v(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=v},9092:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const v=u(6349),w=u(7226),f=u(3734),g=u(8437),C=u(4634),x=u(511),m=u(643),o=u(4863),a=u(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(s,n,p){this._hasScrollback=s,this._optionsService=n,this._bufferService=p,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=a.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,m.WHITESPACE_CELL_CHAR,m.WHITESPACE_CELL_WIDTH,m.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new w.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new v.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,n){return new g.BufferLine(this._bufferService.cols,this.getNullCell(s),n)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows}_getCorrectBufferLength(s){if(!this._hasScrollback)return s;const n=s+this._optionsService.rawOptions.scrollback;return n>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:n}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=g.DEFAULT_ATTR_DATA);let n=this._rows;for(;n--;)this.lines.push(this.getBlankLine(s))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new v.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(s,n){const p=this.getNullCell(g.DEFAULT_ATTR_DATA);let b=0;const k=this._getCorrectBufferLength(n);if(k>this.lines.maxLength&&(this.lines.maxLength=k),this.lines.length>0){if(this._cols<s)for(let S=0;S<this.lines.length;S++)b+=+this.lines.get(S).resize(s,p);let R=0;if(this._rows<n)for(let S=this._rows;S<n;S++)this.lines.length<n+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new g.BufferLine(s,p)):this.ybase>0&&this.lines.length<=this.ybase+this.y+R+1?(this.ybase--,R++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(s,p)));else for(let S=this._rows;S>n;S--)this.lines.length>n+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(k<this.lines.maxLength){const S=this.lines.length-k;S>0&&(this.lines.trimStart(S),this.ybase=Math.max(this.ybase-S,0),this.ydisp=Math.max(this.ydisp-S,0),this.savedY=Math.max(this.savedY-S,0)),this.lines.maxLength=k}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,n-1),R&&(this.y+=R),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=n-1,this._isReflowEnabled&&(this._reflow(s,n),this._cols>s))for(let R=0;R<this.lines.length;R++)b+=+this.lines.get(R).resize(s,p);this._cols=s,this._rows=n,this._memoryCleanupQueue.clear(),b>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let s=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,s=!1);let n=0;for(;this._memoryCleanupPosition<this.lines.length;)if(n+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),n>100)return!0;return s}get _isReflowEnabled(){const s=this._optionsService.rawOptions.windowsPty;return s&&s.buildNumber?this._hasScrollback&&s.backend==="conpty"&&s.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(s,n){this._cols!==s&&(s>this._cols?this._reflowLarger(s,n):this._reflowSmaller(s,n))}_reflowLarger(s,n){const p=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(p.length>0){const b=(0,C.reflowLargerCreateNewLayout)(this.lines,p);(0,C.reflowLargerApplyNewLayout)(this.lines,b.layout),this._reflowLargerAdjustViewport(s,n,b.countRemoved)}}_reflowLargerAdjustViewport(s,n,p){const b=this.getNullCell(g.DEFAULT_ATTR_DATA);let k=p;for(;k-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<n&&this.lines.push(new g.BufferLine(s,b))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-p,0)}_reflowSmaller(s,n){const p=this.getNullCell(g.DEFAULT_ATTR_DATA),b=[];let k=0;for(let R=this.lines.length-1;R>=0;R--){let S=this.lines.get(R);if(!S||!S.isWrapped&&S.getTrimmedLength()<=s)continue;const A=[S];for(;S.isWrapped&&R>0;)S=this.lines.get(--R),A.unshift(S);const H=this.ybase+this.y;if(H>=R&&H<R+A.length)continue;const j=A[A.length-1].getTrimmedLength(),$=(0,C.reflowSmallerGetNewLineLengths)(A,this._cols,s),I=$.length-A.length;let Q;Q=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+I):Math.max(0,this.lines.length-this.lines.maxLength+I);const te=[];for(let T=0;T<I;T++){const P=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);te.push(P)}te.length>0&&(b.push({start:R+A.length+k,newLines:te}),k+=te.length),A.push(...te);let ne=$.length-1,le=$[ne];le===0&&(ne--,le=$[ne]);let G=A.length-I-1,L=j;for(;G>=0;){const T=Math.min(L,le);if(A[ne]===void 0)break;if(A[ne].copyCellsFrom(A[G],L-T,le-T,T,!0),le-=T,le===0&&(ne--,le=$[ne]),L-=T,L===0){G--;const P=Math.max(G,0);L=(0,C.getWrappedLineTrimmedLength)(A,P,this._cols)}}for(let T=0;T<A.length;T++)$[T]<s&&A[T].setCell($[T],p);let O=I-Q;for(;O-- >0;)this.ybase===0?this.y<n-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+k)-n&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+I,this.ybase+n-1)}if(b.length>0){const R=[],S=[];for(let ne=0;ne<this.lines.length;ne++)S.push(this.lines.get(ne));const A=this.lines.length;let H=A-1,j=0,$=b[j];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+k);let I=0;for(let ne=Math.min(this.lines.maxLength-1,A+k-1);ne>=0;ne--)if($&&$.start>H+I){for(let le=$.newLines.length-1;le>=0;le--)this.lines.set(ne--,$.newLines[le]);ne++,R.push({index:H+1,amount:$.newLines.length}),I+=$.newLines.length,$=b[++j]}else this.lines.set(ne,S[H--]);let Q=0;for(let ne=R.length-1;ne>=0;ne--)R[ne].index+=Q,this.lines.onInsertEmitter.fire(R[ne]),Q+=R[ne].amount;const te=Math.max(0,A+k-this.lines.maxLength);te>0&&this.lines.onTrimEmitter.fire(te)}}translateBufferLineToString(s,n,p=0,b){const k=this.lines.get(s);return k?k.translateToString(n,p,b):""}getWrappedRangeForLine(s){let n=s,p=s;for(;n>0&&this.lines.get(n).isWrapped;)n--;for(;p+1<this.lines.length&&this.lines.get(p+1).isWrapped;)p++;return{first:n,last:p}}setupTabStops(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.rawOptions.tabStopWidth)this.tabs[s]=!0}prevStop(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s}nextStop(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s}clearMarkers(s){this._isClearing=!0;for(let n=0;n<this.markers.length;n++)this.markers[n].line===s&&(this.markers[n].dispose(),this.markers.splice(n--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].dispose(),this.markers.splice(s--,1);this._isClearing=!1}addMarker(s){const n=new o.Marker(s);return this.markers.push(n),n.register(this.lines.onTrim((p=>{n.line-=p,n.line<0&&n.dispose()}))),n.register(this.lines.onInsert((p=>{n.line>=p.index&&(n.line+=p.amount)}))),n.register(this.lines.onDelete((p=>{n.line>=p.index&&n.line<p.index+p.amount&&n.dispose(),n.line>p.index&&(n.line-=p.amount)}))),n.register(n.onDispose((()=>this._removeMarker(n)))),n}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const v=u(3734),w=u(511),f=u(643),g=u(482);l.DEFAULT_ATTR_DATA=Object.freeze(new v.AttributeData);let C=0;class x{constructor(o,a,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*o);const n=a||w.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let p=0;p<o;++p)this.setCell(p,n);this.length=o}get(o){const a=this._data[3*o+0],s=2097151&a;return[this._data[3*o+1],2097152&a?this._combined[o]:s?(0,g.stringFromCodePoint)(s):"",a>>22,2097152&a?this._combined[o].charCodeAt(this._combined[o].length-1):s]}set(o,a){this._data[3*o+1]=a[f.CHAR_DATA_ATTR_INDEX],a[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[o]=a[1],this._data[3*o+0]=2097152|o|a[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*o+0]=a[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(o){return this._data[3*o+0]>>22}hasWidth(o){return 12582912&this._data[3*o+0]}getFg(o){return this._data[3*o+1]}getBg(o){return this._data[3*o+2]}hasContent(o){return 4194303&this._data[3*o+0]}getCodePoint(o){const a=this._data[3*o+0];return 2097152&a?this._combined[o].charCodeAt(this._combined[o].length-1):2097151&a}isCombined(o){return 2097152&this._data[3*o+0]}getString(o){const a=this._data[3*o+0];return 2097152&a?this._combined[o]:2097151&a?(0,g.stringFromCodePoint)(2097151&a):""}isProtected(o){return 536870912&this._data[3*o+2]}loadCell(o,a){return C=3*o,a.content=this._data[C+0],a.fg=this._data[C+1],a.bg=this._data[C+2],2097152&a.content&&(a.combinedData=this._combined[o]),268435456&a.bg&&(a.extended=this._extendedAttrs[o]),a}setCell(o,a){2097152&a.content&&(this._combined[o]=a.combinedData),268435456&a.bg&&(this._extendedAttrs[o]=a.extended),this._data[3*o+0]=a.content,this._data[3*o+1]=a.fg,this._data[3*o+2]=a.bg}setCellFromCodepoint(o,a,s,n){268435456&n.bg&&(this._extendedAttrs[o]=n.extended),this._data[3*o+0]=a|s<<22,this._data[3*o+1]=n.fg,this._data[3*o+2]=n.bg}addCodepointToCell(o,a,s){let n=this._data[3*o+0];2097152&n?this._combined[o]+=(0,g.stringFromCodePoint)(a):2097151&n?(this._combined[o]=(0,g.stringFromCodePoint)(2097151&n)+(0,g.stringFromCodePoint)(a),n&=-2097152,n|=2097152):n=a|4194304,s&&(n&=-12582913,n|=s<<22),this._data[3*o+0]=n}insertCells(o,a,s){if((o%=this.length)&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,s),a<this.length-o){const n=new w.CellData;for(let p=this.length-o-a-1;p>=0;--p)this.setCell(o+a+p,this.loadCell(o+p,n));for(let p=0;p<a;++p)this.setCell(o+p,s)}else for(let n=o;n<this.length;++n)this.setCell(n,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(o,a,s){if(o%=this.length,a<this.length-o){const n=new w.CellData;for(let p=0;p<this.length-o-a;++p)this.setCell(o+p,this.loadCell(o+a+p,n));for(let p=this.length-a;p<this.length;++p)this.setCell(p,s)}else for(let n=o;n<this.length;++n)this.setCell(n,s);o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,s),this.getWidth(o)!==0||this.hasContent(o)||this.setCellFromCodepoint(o,0,1,s)}replaceCells(o,a,s,n=!1){if(n)for(o&&this.getWidth(o-1)===2&&!this.isProtected(o-1)&&this.setCellFromCodepoint(o-1,0,1,s),a<this.length&&this.getWidth(a-1)===2&&!this.isProtected(a)&&this.setCellFromCodepoint(a,0,1,s);o<a&&o<this.length;)this.isProtected(o)||this.setCell(o,s),o++;else for(o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,s),a<this.length&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a,0,1,s);o<a&&o<this.length;)this.setCell(o++,s)}resize(o,a){if(o===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*o;if(o>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const n=new Uint32Array(s);n.set(this._data),this._data=n}for(let n=this.length;n<o;++n)this.setCell(n,a)}else{this._data=this._data.subarray(0,s);const n=Object.keys(this._combined);for(let b=0;b<n.length;b++){const k=parseInt(n[b],10);k>=o&&delete this._combined[k]}const p=Object.keys(this._extendedAttrs);for(let b=0;b<p.length;b++){const k=parseInt(p[b],10);k>=o&&delete this._extendedAttrs[k]}}return this.length=o,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const o=new Uint32Array(this._data.length);return o.set(this._data),this._data=o,1}return 0}fill(o,a=!1){if(a)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,o);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,o)}}copyFrom(o){this.length!==o.length?this._data=new Uint32Array(o._data):this._data.set(o._data),this.length=o.length,this._combined={};for(const a in o._combined)this._combined[a]=o._combined[a];this._extendedAttrs={};for(const a in o._extendedAttrs)this._extendedAttrs[a]=o._extendedAttrs[a];this.isWrapped=o.isWrapped}clone(){const o=new x(0);o._data=new Uint32Array(this._data),o.length=this.length;for(const a in this._combined)o._combined[a]=this._combined[a];for(const a in this._extendedAttrs)o._extendedAttrs[a]=this._extendedAttrs[a];return o.isWrapped=this.isWrapped,o}getTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0])return o+(this._data[3*o+0]>>22);return 0}getNoBgTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0]||50331648&this._data[3*o+2])return o+(this._data[3*o+0]>>22);return 0}copyCellsFrom(o,a,s,n,p){const b=o._data;if(p)for(let R=n-1;R>=0;R--){for(let S=0;S<3;S++)this._data[3*(s+R)+S]=b[3*(a+R)+S];268435456&b[3*(a+R)+2]&&(this._extendedAttrs[s+R]=o._extendedAttrs[a+R])}else for(let R=0;R<n;R++){for(let S=0;S<3;S++)this._data[3*(s+R)+S]=b[3*(a+R)+S];268435456&b[3*(a+R)+2]&&(this._extendedAttrs[s+R]=o._extendedAttrs[a+R])}const k=Object.keys(o._combined);for(let R=0;R<k.length;R++){const S=parseInt(k[R],10);S>=a&&(this._combined[S-a+s]=o._combined[S])}}translateToString(o,a,s,n){a=a??0,s=s??this.length,o&&(s=Math.min(s,this.getTrimmedLength())),n&&(n.length=0);let p="";for(;a<s;){const b=this._data[3*a+0],k=2097151&b,R=2097152&b?this._combined[a]:k?(0,g.stringFromCodePoint)(k):f.WHITESPACE_CELL_CHAR;if(p+=R,n)for(let S=0;S<R.length;++S)n.push(a);a+=b>>22||1}return n&&n.push(a),p}}l.BufferLine=x},4841:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(u,v){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return v*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(F,l)=>{function u(v,w,f){if(w===v.length-1)return v[w].getTrimmedLength();const g=!v[w].hasContent(f-1)&&v[w].getWidth(f-1)===1,C=v[w+1].getWidth(0)===2;return g&&C?f-1:f}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(v,w,f,g,C){const x=[];for(let m=0;m<v.length-1;m++){let o=m,a=v.get(++o);if(!a.isWrapped)continue;const s=[v.get(m)];for(;o<v.length&&a.isWrapped;)s.push(a),a=v.get(++o);if(g>=m&&g<o){m+=s.length-1;continue}let n=0,p=u(s,n,w),b=1,k=0;for(;b<s.length;){const S=u(s,b,w),A=S-k,H=f-p,j=Math.min(A,H);s[n].copyCellsFrom(s[b],k,p,j,!1),p+=j,p===f&&(n++,p=0),k+=j,k===S&&(b++,k=0),p===0&&n!==0&&s[n-1].getWidth(f-1)===2&&(s[n].copyCellsFrom(s[n-1],f-1,p++,1,!1),s[n-1].setCell(f-1,C))}s[n].replaceCells(p,f,C);let R=0;for(let S=s.length-1;S>0&&(S>n||s[S].getTrimmedLength()===0);S--)R++;R>0&&(x.push(m+s.length-R),x.push(R)),m+=s.length-1}return x},l.reflowLargerCreateNewLayout=function(v,w){const f=[];let g=0,C=w[g],x=0;for(let m=0;m<v.length;m++)if(C===m){const o=w[++g];v.onDeleteEmitter.fire({index:m-x,amount:o}),m+=o-1,x+=o,C=w[++g]}else f.push(m);return{layout:f,countRemoved:x}},l.reflowLargerApplyNewLayout=function(v,w){const f=[];for(let g=0;g<w.length;g++)f.push(v.get(w[g]));for(let g=0;g<f.length;g++)v.set(g,f[g]);v.length=w.length},l.reflowSmallerGetNewLineLengths=function(v,w,f){const g=[],C=v.map(((a,s)=>u(v,s,w))).reduce(((a,s)=>a+s));let x=0,m=0,o=0;for(;o<C;){if(C-o<f){g.push(C-o);break}x+=f;const a=u(v,m,w);x>a&&(x-=a,m++);const s=v[m].getWidth(x-1)===2;s&&x--;const n=s?f-1:f;g.push(n),o+=n}return g},l.getWrappedLineTrimmedLength=u},5295:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const v=u(8460),w=u(844),f=u(9092);class g extends w.Disposable{constructor(x,m){super(),this._optionsService=x,this._bufferService=m,this._onBufferActivate=this.register(new v.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(x,m){this._normal.resize(x,m),this._alt.resize(x,m),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}l.BufferSet=g},511:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const v=u(482),w=u(643),f=u(3734);class g extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const m=new g;return m.setFromCharData(x),m}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,v.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[w.CHAR_DATA_ATTR_INDEX],this.bg=0;let m=!1;if(x[w.CHAR_DATA_CHAR_INDEX].length>2)m=!0;else if(x[w.CHAR_DATA_CHAR_INDEX].length===2){const o=x[w.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=o&&o<=56319){const a=x[w.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=a&&a<=57343?this.content=1024*(o-55296)+a-56320+65536|x[w.CHAR_DATA_WIDTH_INDEX]<<22:m=!0}else m=!0}else this.content=x[w.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[w.CHAR_DATA_WIDTH_INDEX]<<22;m&&(this.combinedData=x[w.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[w.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=g},643:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const v=u(8460),w=u(844);class f{get id(){return this._id}constructor(C){this.line=C,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new v.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,w.disposeArray)(this._disposables),this._disposables.length=0)}register(C){return this._disposables.push(C),C}}l.Marker=f,f._nextId=1},7116:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(F,l)=>{var u,v,w;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
47
+ `,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(u||(l.C0=u={})),(function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"})(v||(l.C1=v={})),(function(f){f.ST=`${u.ESC}\\`})(w||(l.C1_ESCAPED=w={}))},7399:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const v=u(2584),w={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:["'",'"']};l.evaluateKeyboardEvent=function(f,g,C,x){const m={type:0,cancel:!1,key:void 0},o=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?m.key=g?v.C0.ESC+"OA":v.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?m.key=g?v.C0.ESC+"OD":v.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?m.key=g?v.C0.ESC+"OC":v.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(m.key=g?v.C0.ESC+"OB":v.C0.ESC+"[B");break;case 8:m.key=f.ctrlKey?"\b":v.C0.DEL,f.altKey&&(m.key=v.C0.ESC+m.key);break;case 9:if(f.shiftKey){m.key=v.C0.ESC+"[Z";break}m.key=v.C0.HT,m.cancel=!0;break;case 13:m.key=f.altKey?v.C0.ESC+v.C0.CR:v.C0.CR,m.cancel=!0;break;case 27:m.key=v.C0.ESC,f.altKey&&(m.key=v.C0.ESC+v.C0.ESC),m.cancel=!0;break;case 37:if(f.metaKey)break;o?(m.key=v.C0.ESC+"[1;"+(o+1)+"D",m.key===v.C0.ESC+"[1;3D"&&(m.key=v.C0.ESC+(C?"b":"[1;5D"))):m.key=g?v.C0.ESC+"OD":v.C0.ESC+"[D";break;case 39:if(f.metaKey)break;o?(m.key=v.C0.ESC+"[1;"+(o+1)+"C",m.key===v.C0.ESC+"[1;3C"&&(m.key=v.C0.ESC+(C?"f":"[1;5C"))):m.key=g?v.C0.ESC+"OC":v.C0.ESC+"[C";break;case 38:if(f.metaKey)break;o?(m.key=v.C0.ESC+"[1;"+(o+1)+"A",C||m.key!==v.C0.ESC+"[1;3A"||(m.key=v.C0.ESC+"[1;5A")):m.key=g?v.C0.ESC+"OA":v.C0.ESC+"[A";break;case 40:if(f.metaKey)break;o?(m.key=v.C0.ESC+"[1;"+(o+1)+"B",C||m.key!==v.C0.ESC+"[1;3B"||(m.key=v.C0.ESC+"[1;5B")):m.key=g?v.C0.ESC+"OB":v.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(m.key=v.C0.ESC+"[2~");break;case 46:m.key=o?v.C0.ESC+"[3;"+(o+1)+"~":v.C0.ESC+"[3~";break;case 36:m.key=o?v.C0.ESC+"[1;"+(o+1)+"H":g?v.C0.ESC+"OH":v.C0.ESC+"[H";break;case 35:m.key=o?v.C0.ESC+"[1;"+(o+1)+"F":g?v.C0.ESC+"OF":v.C0.ESC+"[F";break;case 33:f.shiftKey?m.type=2:f.ctrlKey?m.key=v.C0.ESC+"[5;"+(o+1)+"~":m.key=v.C0.ESC+"[5~";break;case 34:f.shiftKey?m.type=3:f.ctrlKey?m.key=v.C0.ESC+"[6;"+(o+1)+"~":m.key=v.C0.ESC+"[6~";break;case 112:m.key=o?v.C0.ESC+"[1;"+(o+1)+"P":v.C0.ESC+"OP";break;case 113:m.key=o?v.C0.ESC+"[1;"+(o+1)+"Q":v.C0.ESC+"OQ";break;case 114:m.key=o?v.C0.ESC+"[1;"+(o+1)+"R":v.C0.ESC+"OR";break;case 115:m.key=o?v.C0.ESC+"[1;"+(o+1)+"S":v.C0.ESC+"OS";break;case 116:m.key=o?v.C0.ESC+"[15;"+(o+1)+"~":v.C0.ESC+"[15~";break;case 117:m.key=o?v.C0.ESC+"[17;"+(o+1)+"~":v.C0.ESC+"[17~";break;case 118:m.key=o?v.C0.ESC+"[18;"+(o+1)+"~":v.C0.ESC+"[18~";break;case 119:m.key=o?v.C0.ESC+"[19;"+(o+1)+"~":v.C0.ESC+"[19~";break;case 120:m.key=o?v.C0.ESC+"[20;"+(o+1)+"~":v.C0.ESC+"[20~";break;case 121:m.key=o?v.C0.ESC+"[21;"+(o+1)+"~":v.C0.ESC+"[21~";break;case 122:m.key=o?v.C0.ESC+"[23;"+(o+1)+"~":v.C0.ESC+"[23~";break;case 123:m.key=o?v.C0.ESC+"[24;"+(o+1)+"~":v.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(C&&!x||!f.altKey||f.metaKey)!C||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?m.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(m.key=v.C0.US),f.key==="@"&&(m.key=v.C0.NUL)):f.keyCode===65&&(m.type=1);else{const a=w[f.keyCode],s=a==null?void 0:a[f.shiftKey?1:0];if(s)m.key=v.C0.ESC+s;else if(f.keyCode>=65&&f.keyCode<=90){const n=f.ctrlKey?f.keyCode-64:f.keyCode+32;let p=String.fromCharCode(n);f.shiftKey&&(p=p.toUpperCase()),m.key=v.C0.ESC+p}else if(f.keyCode===32)m.key=v.C0.ESC+(f.ctrlKey?v.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let n=f.code.slice(3,4);f.shiftKey||(n=n.toLowerCase()),m.key=v.C0.ESC+n,m.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?m.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?m.key=v.C0.NUL:f.keyCode>=51&&f.keyCode<=55?m.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?m.key=v.C0.DEL:f.keyCode===219?m.key=v.C0.ESC:f.keyCode===220?m.key=v.C0.FS:f.keyCode===221&&(m.key=v.C0.GS)}return m}},482:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},l.utf32ToString=function(u,v=0,w=u.length){let f="";for(let g=v;g<w;++g){let C=u[g];C>65535?(C-=65536,f+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):f+=String.fromCharCode(C)}return f},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,v){const w=u.length;if(!w)return 0;let f=0,g=0;if(this._interim){const C=u.charCodeAt(g++);56320<=C&&C<=57343?v[f++]=1024*(this._interim-55296)+C-56320+65536:(v[f++]=this._interim,v[f++]=C),this._interim=0}for(let C=g;C<w;++C){const x=u.charCodeAt(C);if(55296<=x&&x<=56319){if(++C>=w)return this._interim=x,f;const m=u.charCodeAt(C);56320<=m&&m<=57343?v[f++]=1024*(x-55296)+m-56320+65536:(v[f++]=x,v[f++]=m)}else x!==65279&&(v[f++]=x)}return f}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,v){const w=u.length;if(!w)return 0;let f,g,C,x,m=0,o=0,a=0;if(this.interim[0]){let p=!1,b=this.interim[0];b&=(224&b)==192?31:(240&b)==224?15:7;let k,R=0;for(;(k=63&this.interim[++R])&&R<4;)b<<=6,b|=k;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,A=S-R;for(;a<A;){if(a>=w)return 0;if(k=u[a++],(192&k)!=128){a--,p=!0;break}this.interim[R++]=k,b<<=6,b|=63&k}p||(S===2?b<128?a--:v[m++]=b:S===3?b<2048||b>=55296&&b<=57343||b===65279||(v[m++]=b):b<65536||b>1114111||(v[m++]=b)),this.interim.fill(0)}const s=w-4;let n=a;for(;n<w;){for(;!(!(n<s)||128&(f=u[n])||128&(g=u[n+1])||128&(C=u[n+2])||128&(x=u[n+3]));)v[m++]=f,v[m++]=g,v[m++]=C,v[m++]=x,n+=4;if(f=u[n++],f<128)v[m++]=f;else if((224&f)==192){if(n>=w)return this.interim[0]=f,m;if(g=u[n++],(192&g)!=128){n--;continue}if(o=(31&f)<<6|63&g,o<128){n--;continue}v[m++]=o}else if((240&f)==224){if(n>=w)return this.interim[0]=f,m;if(g=u[n++],(192&g)!=128){n--;continue}if(n>=w)return this.interim[0]=f,this.interim[1]=g,m;if(C=u[n++],(192&C)!=128){n--;continue}if(o=(15&f)<<12|(63&g)<<6|63&C,o<2048||o>=55296&&o<=57343||o===65279)continue;v[m++]=o}else if((248&f)==240){if(n>=w)return this.interim[0]=f,m;if(g=u[n++],(192&g)!=128){n--;continue}if(n>=w)return this.interim[0]=f,this.interim[1]=g,m;if(C=u[n++],(192&C)!=128){n--;continue}if(n>=w)return this.interim[0]=f,this.interim[1]=g,this.interim[2]=C,m;if(x=u[n++],(192&x)!=128){n--;continue}if(o=(7&f)<<18|(63&g)<<12|(63&C)<<6|63&x,o<65536||o>1114111)continue;v[m++]=o}}return m}}},225:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const v=u(1480),w=[[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]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let g;l.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let C=0;C<w.length;++C)g.fill(0,w[C][0],w[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?g[C]:(function(x,m){let o,a=0,s=m.length-1;if(x<m[0][0]||x>m[s][1])return!1;for(;s>=a;)if(o=a+s>>1,x>m[o][1])a=o+1;else{if(!(x<m[o][0]))return!0;s=o-1}return!1})(C,f)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,x){let m=this.wcwidth(C),o=m===0&&x!==0;if(o){const a=v.UnicodeService.extractWidth(x);a===0?o=!1:a>m&&(m=a)}return v.UnicodeService.createPropertyValue(0,m,o)}}},5981:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const v=u(8460),w=u(844);class f extends w.Disposable{constructor(C){super(),this._action=C,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(C,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let m;for(this._isSyncWriting=!0;m=this._writeBuffer.shift();){this._action(m);const o=this._callbacks.shift();o&&o()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,x){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(x),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(x)}_innerWrite(C=0,x=!0){const m=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const o=this._writeBuffer[this._bufferOffset],a=this._action(o,x);if(a){const n=p=>Date.now()-m>=12?setTimeout((()=>this._innerWrite(0,p))):this._innerWrite(m,p);return void a.catch((p=>(queueMicrotask((()=>{throw p})),Promise.resolve(!1)))).then(n)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=o.length,Date.now()-m>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}l.WriteBuffer=f},5941:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,v=/^[\da-f]+$/;function w(f,g){const C=f.toString(16),x=C.length<2?"0"+C:C;switch(g){case 4:return C[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}l.parseColor=function(f){if(!f)return;let g=f.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const C=u.exec(g);if(C){const x=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/x*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/x*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/x*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),v.exec(g)&&[3,6,9,12].includes(g.length))){const C=g.length/3,x=[0,0,0];for(let m=0;m<3;++m){const o=parseInt(g.slice(C*m,C*m+C),16);x[m]=C===1?o<<4:C===2?o:C===3?o>>4:o>>8}return x}},l.toRgbString=function(f,g=16){const[C,x,m]=f;return`rgb:${w(C,g)}/${w(x,g)}/${w(m,g)}`}},5770:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const v=u(482),w=u(8742),f=u(5770),g=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(x,m){this._handlers[x]===void 0&&(this._handlers[x]=[]);const o=this._handlers[x];return o.push(m),{dispose:()=>{const a=o.indexOf(m);a!==-1&&o.splice(a,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(x,m){if(this.reset(),this._ident=x,this._active=this._handlers[x]||g,this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].hook(m);else this._handlerFb(this._ident,"HOOK",m)}put(x,m,o){if(this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].put(x,m,o);else this._handlerFb(this._ident,"PUT",(0,v.utf32ToString)(x,m,o))}unhook(x,m=!0){if(this._active.length){let o=!1,a=this._active.length-1,s=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,o=m,s=this._stack.fallThrough,this._stack.paused=!1),!s&&o===!1){for(;a>=0&&(o=this._active[a].unhook(x),o!==!0);a--)if(o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,o;a--}for(;a>=0;a--)if(o=this._active[a].unhook(!1),o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,o}else this._handlerFb(this._ident,"UNHOOK",x);this._active=g,this._ident=0}};const C=new w.Params;C.addParam(0),l.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=C,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():C,this._data="",this._hitLimit=!1}put(x,m,o){this._hitLimit||(this._data+=(0,v.utf32ToString)(x,m,o),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let m=!1;if(this._hitLimit)m=!1;else if(x&&(m=this._handler(this._data,this._params),m instanceof Promise))return m.then((o=>(this._params=C,this._data="",this._hitLimit=!1,o)));return this._params=C,this._data="",this._hitLimit=!1,m}}},2015:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const v=u(844),w=u(8742),f=u(6242),g=u(6351);class C{constructor(a){this.table=new Uint8Array(a)}setDefault(a,s){this.table.fill(a<<4|s)}add(a,s,n,p){this.table[s<<8|a]=n<<4|p}addMany(a,s,n,p){for(let b=0;b<a.length;b++)this.table[s<<8|a[b]]=n<<4|p}}l.TransitionTable=C;const x=160;l.VT500_TRANSITION_TABLE=(function(){const o=new C(4095),a=Array.apply(null,Array(256)).map(((R,S)=>S)),s=(R,S)=>a.slice(R,S),n=s(32,127),p=s(0,24);p.push(25),p.push.apply(p,s(28,32));const b=s(0,14);let k;for(k in o.setDefault(1,0),o.addMany(n,0,2,0),b)o.addMany([24,26,153,154],k,3,0),o.addMany(s(128,144),k,3,0),o.addMany(s(144,152),k,3,0),o.add(156,k,0,0),o.add(27,k,11,1),o.add(157,k,4,8),o.addMany([152,158,159],k,0,7),o.add(155,k,11,3),o.add(144,k,11,9);return o.addMany(p,0,3,0),o.addMany(p,1,3,1),o.add(127,1,0,1),o.addMany(p,8,0,8),o.addMany(p,3,3,3),o.add(127,3,0,3),o.addMany(p,4,3,4),o.add(127,4,0,4),o.addMany(p,6,3,6),o.addMany(p,5,3,5),o.add(127,5,0,5),o.addMany(p,2,3,2),o.add(127,2,0,2),o.add(93,1,4,8),o.addMany(n,8,5,8),o.add(127,8,5,8),o.addMany([156,27,24,26,7],8,6,0),o.addMany(s(28,32),8,0,8),o.addMany([88,94,95],1,0,7),o.addMany(n,7,0,7),o.addMany(p,7,0,7),o.add(156,7,0,0),o.add(127,7,0,7),o.add(91,1,11,3),o.addMany(s(64,127),3,7,0),o.addMany(s(48,60),3,8,4),o.addMany([60,61,62,63],3,9,4),o.addMany(s(48,60),4,8,4),o.addMany(s(64,127),4,7,0),o.addMany([60,61,62,63],4,0,6),o.addMany(s(32,64),6,0,6),o.add(127,6,0,6),o.addMany(s(64,127),6,0,0),o.addMany(s(32,48),3,9,5),o.addMany(s(32,48),5,9,5),o.addMany(s(48,64),5,0,6),o.addMany(s(64,127),5,7,0),o.addMany(s(32,48),4,9,5),o.addMany(s(32,48),1,9,2),o.addMany(s(32,48),2,9,2),o.addMany(s(48,127),2,10,0),o.addMany(s(48,80),1,10,0),o.addMany(s(81,88),1,10,0),o.addMany([89,90,92],1,10,0),o.addMany(s(96,127),1,10,0),o.add(80,1,11,9),o.addMany(p,9,0,9),o.add(127,9,0,9),o.addMany(s(28,32),9,0,9),o.addMany(s(32,48),9,9,12),o.addMany(s(48,60),9,8,10),o.addMany([60,61,62,63],9,9,10),o.addMany(p,11,0,11),o.addMany(s(32,128),11,0,11),o.addMany(s(28,32),11,0,11),o.addMany(p,10,0,10),o.add(127,10,0,10),o.addMany(s(28,32),10,0,10),o.addMany(s(48,60),10,8,10),o.addMany([60,61,62,63],10,0,11),o.addMany(s(32,48),10,9,12),o.addMany(p,12,0,12),o.add(127,12,0,12),o.addMany(s(28,32),12,0,12),o.addMany(s(32,48),12,9,12),o.addMany(s(48,64),12,0,11),o.addMany(s(64,127),12,12,13),o.addMany(s(64,127),10,12,13),o.addMany(s(64,127),9,12,13),o.addMany(p,13,13,13),o.addMany(n,13,13,13),o.add(127,13,0,13),o.addMany([27,156,24,26],13,14,0),o.add(x,0,2,0),o.add(x,8,5,8),o.add(x,6,0,6),o.add(x,11,0,11),o.add(x,13,13,13),o})();class m extends v.Disposable{constructor(a=l.VT500_TRANSITION_TABLE){super(),this._transitions=a,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new w.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(s,n,p)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,n)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,v.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(a,s=[64,126]){let n=0;if(a.prefix){if(a.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=a.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(a.intermediates){if(a.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let b=0;b<a.intermediates.length;++b){const k=a.intermediates.charCodeAt(b);if(32>k||k>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=k}}if(a.final.length!==1)throw new Error("final must be a single byte");const p=a.final.charCodeAt(0);if(s[0]>p||p>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return n<<=8,n|=p,n}identToString(a){const s=[];for(;a;)s.push(String.fromCharCode(255&a)),a>>=8;return s.reverse().join("")}setPrintHandler(a){this._printHandler=a}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(a,s){const n=this._identifier(a,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);const p=this._escHandlers[n];return p.push(s),{dispose:()=>{const b=p.indexOf(s);b!==-1&&p.splice(b,1)}}}clearEscHandler(a){this._escHandlers[this._identifier(a,[48,126])]&&delete this._escHandlers[this._identifier(a,[48,126])]}setEscHandlerFallback(a){this._escHandlerFb=a}setExecuteHandler(a,s){this._executeHandlers[a.charCodeAt(0)]=s}clearExecuteHandler(a){this._executeHandlers[a.charCodeAt(0)]&&delete this._executeHandlers[a.charCodeAt(0)]}setExecuteHandlerFallback(a){this._executeHandlerFb=a}registerCsiHandler(a,s){const n=this._identifier(a);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);const p=this._csiHandlers[n];return p.push(s),{dispose:()=>{const b=p.indexOf(s);b!==-1&&p.splice(b,1)}}}clearCsiHandler(a){this._csiHandlers[this._identifier(a)]&&delete this._csiHandlers[this._identifier(a)]}setCsiHandlerFallback(a){this._csiHandlerFb=a}registerDcsHandler(a,s){return this._dcsParser.registerHandler(this._identifier(a),s)}clearDcsHandler(a){this._dcsParser.clearHandler(this._identifier(a))}setDcsHandlerFallback(a){this._dcsParser.setHandlerFallback(a)}registerOscHandler(a,s){return this._oscParser.registerHandler(a,s)}clearOscHandler(a){this._oscParser.clearHandler(a)}setOscHandlerFallback(a){this._oscParser.setHandlerFallback(a)}setErrorHandler(a){this._errorHandler=a}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(a,s,n,p,b){this._parseStack.state=a,this._parseStack.handlers=s,this._parseStack.handlerPos=n,this._parseStack.transition=p,this._parseStack.chunkPos=b}parse(a,s,n){let p,b=0,k=0,R=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,R=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const S=this._parseStack.handlers;let A=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&A>-1){for(;A>=0&&(p=S[A](this._params),p!==!0);A--)if(p instanceof Promise)return this._parseStack.handlerPos=A,p}this._parseStack.handlers=[];break;case 4:if(n===!1&&A>-1){for(;A>=0&&(p=S[A](),p!==!0);A--)if(p instanceof Promise)return this._parseStack.handlerPos=A,p}this._parseStack.handlers=[];break;case 6:if(b=a[this._parseStack.chunkPos],p=this._dcsParser.unhook(b!==24&&b!==26,n),p)return p;b===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(b=a[this._parseStack.chunkPos],p=this._oscParser.end(b!==24&&b!==26,n),p)return p;b===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,R=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let S=R;S<s;++S){switch(b=a[S],k=this._transitions.table[this.currentState<<8|(b<160?b:x)],k>>4){case 2:for(let I=S+1;;++I){if(I>=s||(b=a[I])<32||b>126&&b<x){this._printHandler(a,S,I),S=I-1;break}if(++I>=s||(b=a[I])<32||b>126&&b<x){this._printHandler(a,S,I),S=I-1;break}if(++I>=s||(b=a[I])<32||b>126&&b<x){this._printHandler(a,S,I),S=I-1;break}if(++I>=s||(b=a[I])<32||b>126&&b<x){this._printHandler(a,S,I),S=I-1;break}}break;case 3:this._executeHandlers[b]?this._executeHandlers[b]():this._executeHandlerFb(b),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:S,code:b,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const A=this._csiHandlers[this._collect<<8|b];let H=A?A.length-1:-1;for(;H>=0&&(p=A[H](this._params),p!==!0);H--)if(p instanceof Promise)return this._preserveStack(3,A,H,k,S),p;H<0&&this._csiHandlerFb(this._collect<<8|b,this._params),this.precedingJoinState=0;break;case 8:do switch(b){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(b-48)}while(++S<s&&(b=a[S])>47&&b<60);S--;break;case 9:this._collect<<=8,this._collect|=b;break;case 10:const j=this._escHandlers[this._collect<<8|b];let $=j?j.length-1:-1;for(;$>=0&&(p=j[$](),p!==!0);$--)if(p instanceof Promise)return this._preserveStack(4,j,$,k,S),p;$<0&&this._escHandlerFb(this._collect<<8|b),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|b,this._params);break;case 13:for(let I=S+1;;++I)if(I>=s||(b=a[I])===24||b===26||b===27||b>127&&b<x){this._dcsParser.put(a,S,I),S=I-1;break}break;case 14:if(p=this._dcsParser.unhook(b!==24&&b!==26),p)return this._preserveStack(6,[],0,k,S),p;b===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let I=S+1;;I++)if(I>=s||(b=a[I])<32||b>127&&b<x){this._oscParser.put(a,S,I),S=I-1;break}break;case 6:if(p=this._oscParser.end(b!==24&&b!==26),p)return this._preserveStack(5,[],0,k,S),p;b===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&k}}}l.EscapeSequenceParser=m},6242:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const v=u(5770),w=u(482),f=[];l.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,C){this._handlers[g]===void 0&&(this._handlers[g]=[]);const x=this._handlers[g];return x.push(C),{dispose:()=>{const m=x.indexOf(C);m!==-1&&x.splice(m,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,C,x){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(g,C,x);else this._handlerFb(this._id,"PUT",(0,w.utf32ToString)(g,C,x))}start(){this.reset(),this._state=1}put(g,C,x){if(this._state!==3){if(this._state===1)for(;C<x;){const m=g[C++];if(m===59){this._state=2,this._start();break}if(m<48||57<m)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+m-48}this._state===2&&x-C>0&&this._put(g,C,x)}}end(g,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,m=this._active.length-1,o=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,x=C,o=this._stack.fallThrough,this._stack.paused=!1),!o&&x===!1){for(;m>=0&&(x=this._active[m].end(g),x!==!0);m--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,x;m--}for(;m>=0;m--)if(x=this._active[m].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",g);this._active=f,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,C,x){this._hitLimit||(this._data+=(0,w.utf32ToString)(g,C,x),this._data.length>v.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let C=!1;if(this._hitLimit)C=!1;else if(g&&(C=this._handler(this._data),C instanceof Promise))return C.then((x=>(this._data="",this._hitLimit=!1,x)));return this._data="",this._hitLimit=!1,C}}},8742:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const u=2147483647;class v{static fromArray(f){const g=new v;if(!f.length)return g;for(let C=Array.isArray(f[0])?1:0;C<f.length;++C){const x=f[C];if(Array.isArray(x))for(let m=0;m<x.length;++m)g.addSubParam(x[m]);else g.addParam(x)}return g}constructor(f=32,g=32){if(this.maxLength=f,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new v(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let g=0;g<this.length;++g){f.push(this.params[g]);const C=this._subParamsIdx[g]>>8,x=255&this._subParamsIdx[g];x-C>0&&f.push(Array.prototype.slice.call(this._subParams,C,x))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>u?u:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>u?u:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const g=this._subParamsIdx[f]>>8,C=255&this._subParamsIdx[f];return C-g>0?this._subParams.subarray(g,C):null}getSubParamsAll(){const f={};for(let g=0;g<this.length;++g){const C=this._subParamsIdx[g]>>8,x=255&this._subParamsIdx[g];x-C>0&&(f[g]=this._subParams.slice(C,x))}return f}addDigit(f){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,x=C[g-1];C[g-1]=~x?Math.min(10*x+f,u):f}}l.Params=v},5741:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,v){const w={instance:v,dispose:v.dispose,isDisposed:!1};this._addons.push(w),v.dispose=()=>this._wrappedAddonDispose(w),v.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let v=-1;for(let w=0;w<this._addons.length;w++)if(this._addons[w]===u){v=w;break}if(v===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(v,1)}}},8771:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const v=u(3785),w=u(511);l.BufferApiView=class{constructor(f,g){this._buffer=f,this.type=g}init(f){return this._buffer=f,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(f){const g=this._buffer.lines.get(f);if(g)return new v.BufferLineApiView(g)}getNullCell(){return new w.CellData}}},3785:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const v=u(511);l.BufferLineApiView=class{constructor(w){this._line=w}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(w,f){if(!(w<0||w>=this._line.length))return f?(this._line.loadCell(w,f),f):this._line.loadCell(w,new v.CellData)}translateToString(w,f,g){return this._line.translateToString(w,f,g)}}},8285:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const v=u(8771),w=u(8460),f=u(844);class g extends f.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new w.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new v.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new v.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}l.BufferNamespaceApi=g},7975:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,v){return this._core.registerCsiHandler(u,(w=>v(w.toArray())))}addCsiHandler(u,v){return this.registerCsiHandler(u,v)}registerDcsHandler(u,v){return this._core.registerDcsHandler(u,((w,f)=>v(w,f.toArray())))}addDcsHandler(u,v){return this.registerDcsHandler(u,v)}registerEscHandler(u,v){return this._core.registerEscHandler(u,v)}addEscHandler(u,v){return this.registerEscHandler(u,v)}registerOscHandler(u,v){return this._core.registerOscHandler(u,v)}addOscHandler(u,v){return this.registerOscHandler(u,v)}}},7090:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(F,l,u){var v=this&&this.__decorate||function(o,a,s,n){var p,b=arguments.length,k=b<3?a:n===null?n=Object.getOwnPropertyDescriptor(a,s):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,a,s,n);else for(var R=o.length-1;R>=0;R--)(p=o[R])&&(k=(b<3?p(k):b>3?p(a,s,k):p(a,s))||k);return b>3&&k&&Object.defineProperty(a,s,k),k},w=this&&this.__param||function(o,a){return function(s,n){a(s,n,o)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const f=u(8460),g=u(844),C=u(5295),x=u(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let m=l.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(o){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(o.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(o.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(o,this))}resize(o,a){this.cols=o,this.rows=a,this.buffers.resize(o,a),this._onResize.fire({cols:o,rows:a})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(o,a=!1){const s=this.buffer;let n;n=this._cachedBlankLine,n&&n.length===this.cols&&n.getFg(0)===o.fg&&n.getBg(0)===o.bg||(n=s.getBlankLine(o,a),this._cachedBlankLine=n),n.isWrapped=a;const p=s.ybase+s.scrollTop,b=s.ybase+s.scrollBottom;if(s.scrollTop===0){const k=s.lines.isFull;b===s.lines.length-1?k?s.lines.recycle().copyFrom(n):s.lines.push(n.clone()):s.lines.splice(b+1,0,n.clone()),k?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const k=b-p+1;s.lines.shiftElements(p+1,k-1,-1),s.lines.set(b,n.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(o,a,s){const n=this.buffer;if(o<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else o+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);const p=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+o,n.ybase),0),p!==n.ydisp&&(a||this._onScroll.fire(n.ydisp))}};l.BufferService=m=v([w(0,x.IOptionsService)],m)},7994:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,v){this._charsets[u]=v,this.glevel===u&&(this.charset=v)}}},1753:function(F,l,u){var v=this&&this.__decorate||function(n,p,b,k){var R,S=arguments.length,A=S<3?p:k===null?k=Object.getOwnPropertyDescriptor(p,b):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(n,p,b,k);else for(var H=n.length-1;H>=0;H--)(R=n[H])&&(A=(S<3?R(A):S>3?R(p,b,A):R(p,b))||A);return S>3&&A&&Object.defineProperty(p,b,A),A},w=this&&this.__param||function(n,p){return function(b,k){p(b,k,n)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const f=u(2585),g=u(8460),C=u(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:n=>n.button!==4&&n.action===1&&(n.ctrl=!1,n.alt=!1,n.shift=!1,!0)},VT200:{events:19,restrict:n=>n.action!==32},DRAG:{events:23,restrict:n=>n.action!==32||n.button!==3},ANY:{events:31,restrict:n=>!0}};function m(n,p){let b=(n.ctrl?16:0)|(n.shift?4:0)|(n.alt?8:0);return n.button===4?(b|=64,b|=n.action):(b|=3&n.button,4&n.button&&(b|=64),8&n.button&&(b|=128),n.action===32?b|=32:n.action!==0||p||(b|=3)),b}const o=String.fromCharCode,a={DEFAULT:n=>{const p=[m(n,!1)+32,n.col+32,n.row+32];return p[0]>255||p[1]>255||p[2]>255?"":`\x1B[M${o(p[0])}${o(p[1])}${o(p[2])}`},SGR:n=>{const p=n.action===0&&n.button!==4?"m":"M";return`\x1B[<${m(n,!0)};${n.col};${n.row}${p}`},SGR_PIXELS:n=>{const p=n.action===0&&n.button!==4?"m":"M";return`\x1B[<${m(n,!0)};${n.x};${n.y}${p}`}};let s=l.CoreMouseService=class extends C.Disposable{constructor(n,p){super(),this._bufferService=n,this._coreService=p,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const b of Object.keys(x))this.addProtocol(b,x[b]);for(const b of Object.keys(a))this.addEncoding(b,a[b]);this.reset()}addProtocol(n,p){this._protocols[n]=p}addEncoding(n,p){this._encodings[n]=p}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(n){if(!this._protocols[n])throw new Error(`unknown protocol "${n}"`);this._activeProtocol=n,this._onProtocolChange.fire(this._protocols[n].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(n){if(!this._encodings[n])throw new Error(`unknown encoding "${n}"`);this._activeEncoding=n}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(n){if(n.col<0||n.col>=this._bufferService.cols||n.row<0||n.row>=this._bufferService.rows||n.button===4&&n.action===32||n.button===3&&n.action!==32||n.button!==4&&(n.action===2||n.action===3)||(n.col++,n.row++,n.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,n,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(n))return!1;const p=this._encodings[this._activeEncoding](n);return p&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(p):this._coreService.triggerDataEvent(p,!0)),this._lastEvent=n,!0}explainEvents(n){return{down:!!(1&n),up:!!(2&n),drag:!!(4&n),move:!!(8&n),wheel:!!(16&n)}}_equalEvents(n,p,b){if(b){if(n.x!==p.x||n.y!==p.y)return!1}else if(n.col!==p.col||n.row!==p.row)return!1;return n.button===p.button&&n.action===p.action&&n.ctrl===p.ctrl&&n.alt===p.alt&&n.shift===p.shift}};l.CoreMouseService=s=v([w(0,f.IBufferService),w(1,f.ICoreService)],s)},6975:function(F,l,u){var v=this&&this.__decorate||function(s,n,p,b){var k,R=arguments.length,S=R<3?n:b===null?b=Object.getOwnPropertyDescriptor(n,p):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(s,n,p,b);else for(var A=s.length-1;A>=0;A--)(k=s[A])&&(S=(R<3?k(S):R>3?k(n,p,S):k(n,p))||S);return R>3&&S&&Object.defineProperty(n,p,S),S},w=this&&this.__param||function(s,n){return function(p,b){n(p,b,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const f=u(1439),g=u(8460),C=u(844),x=u(2585),m=Object.freeze({insertMode:!1}),o=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let a=l.CoreService=class extends C.Disposable{constructor(s,n,p){super(),this._bufferService=s,this._logService=n,this._optionsService=p,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(m),this.decPrivateModes=(0,f.clone)(o)}reset(){this.modes=(0,f.clone)(m),this.decPrivateModes=(0,f.clone)(o)}triggerDataEvent(s,n=!1){if(this._optionsService.rawOptions.disableStdin)return;const p=this._bufferService.buffer;n&&this._optionsService.rawOptions.scrollOnUserInput&&p.ybase!==p.ydisp&&this._onRequestScrollToBottom.fire(),n&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,(()=>s.split("").map((b=>b.charCodeAt(0))))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,(()=>s.split("").map((n=>n.charCodeAt(0))))),this._onBinary.fire(s))}};l.CoreService=a=v([w(0,x.IBufferService),w(1,x.ILogService),w(2,x.IOptionsService)],a)},9074:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const v=u(8055),w=u(8460),f=u(844),g=u(6106);let C=0,x=0;class m extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((s=>s==null?void 0:s.marker.line)),this._onDecorationRegistered=this.register(new w.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new w.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(s){if(s.marker.isDisposed)return;const n=new o(s);if(n){const p=n.marker.onDispose((()=>n.dispose()));n.onDispose((()=>{n&&(this._decorations.delete(n)&&this._onDecorationRemoved.fire(n),p.dispose())})),this._decorations.insert(n),this._onDecorationRegistered.fire(n)}return n}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,n,p){let b=0,k=0;for(const R of this._decorations.getKeyIterator(n))b=R.options.x??0,k=b+(R.options.width??1),s>=b&&s<k&&(!p||(R.options.layer??"bottom")===p)&&(yield R)}forEachDecorationAtCell(s,n,p,b){this._decorations.forEachByKey(n,(k=>{C=k.options.x??0,x=C+(k.options.width??1),s>=C&&s<x&&(!p||(k.options.layer??"bottom")===p)&&b(k)}))}}l.DecorationService=m;class o extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=v.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=v.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,this.onRenderEmitter=this.register(new w.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new w.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const v=u(2585),w=u(8343);class f{constructor(...C){this._entries=new Map;for(const[x,m]of C)this.set(x,m)}set(C,x){const m=this._entries.get(C);return this._entries.set(C,x),m}forEach(C){for(const[x,m]of this._entries.entries())C(x,m)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}l.ServiceCollection=f,l.InstantiationService=class{constructor(){this._services=new f,this._services.set(v.IInstantiationService,this)}setService(g,C){this._services.set(g,C)}getService(g){return this._services.get(g)}createInstance(g,...C){const x=(0,w.getServiceDependencies)(g).sort(((a,s)=>a.index-s.index)),m=[];for(const a of x){const s=this._services.get(a.id);if(!s)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${a.id}.`);m.push(s)}const o=x.length>0?x[0].index:C.length;if(C.length!==o)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${o+1} conflicts with ${C.length} static arguments`);return new g(...C,...m)}}},7866:function(F,l,u){var v=this&&this.__decorate||function(o,a,s,n){var p,b=arguments.length,k=b<3?a:n===null?n=Object.getOwnPropertyDescriptor(a,s):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,a,s,n);else for(var R=o.length-1;R>=0;R--)(p=o[R])&&(k=(b<3?p(k):b>3?p(a,s,k):p(a,s))||k);return b>3&&k&&Object.defineProperty(a,s,k),k},w=this&&this.__param||function(o,a){return function(s,n){a(s,n,o)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const f=u(844),g=u(2585),C={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let x,m=l.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(o){super(),this._optionsService=o,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),x=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(o){for(let a=0;a<o.length;a++)typeof o[a]=="function"&&(o[a]=o[a]())}_log(o,a,s){this._evalLazyOptionalParams(s),o.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+a,...s)}trace(o,...a){var s;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,o,a)}debug(o,...a){var s;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,o,a)}info(o,...a){var s;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,o,a)}warn(o,...a){var s;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,o,a)}error(o,...a){var s;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,o,a)}};l.LogService=m=v([w(0,g.IOptionsService)],m),l.setTraceLogger=function(o){x=o},l.traceCall=function(o,a,s){if(typeof s.value!="function")throw new Error("not supported");const n=s.value;s.value=function(...p){if(x.logLevel!==g.LogLevelEnum.TRACE)return n.apply(this,p);x.trace(`GlyphRenderer#${n.name}(${p.map((k=>JSON.stringify(k))).join(", ")})`);const b=n.apply(this,p);return x.trace(`GlyphRenderer#${n.name} return`,b),b}}},7302:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const v=u(8460),w=u(844),f=u(6114);l.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends w.Disposable{constructor(m){super(),this._onOptionChange=this.register(new v.EventEmitter),this.onOptionChange=this._onOptionChange.event;const o={...l.DEFAULT_OPTIONS};for(const a in m)if(a in o)try{const s=m[a];o[a]=this._sanitizeAndValidateOption(a,s)}catch(s){console.error(s)}this.rawOptions=o,this.options={...o},this._setupOptions(),this.register((0,w.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(m,o){return this.onOptionChange((a=>{a===m&&o(this.rawOptions[m])}))}onMultipleOptionChange(m,o){return this.onOptionChange((a=>{m.indexOf(a)!==-1&&o()}))}_setupOptions(){const m=a=>{if(!(a in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);return this.rawOptions[a]},o=(a,s)=>{if(!(a in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);s=this._sanitizeAndValidateOption(a,s),this.rawOptions[a]!==s&&(this.rawOptions[a]=s,this._onOptionChange.fire(a))};for(const a in this.rawOptions){const s={get:m.bind(this,a),set:o.bind(this,a)};Object.defineProperty(this.options,a,s)}}_sanitizeAndValidateOption(m,o){switch(m){case"cursorStyle":if(o||(o=l.DEFAULT_OPTIONS[m]),!(function(a){return a==="block"||a==="underline"||a==="bar"})(o))throw new Error(`"${o}" is not a valid value for ${m}`);break;case"wordSeparator":o||(o=l.DEFAULT_OPTIONS[m]);break;case"fontWeight":case"fontWeightBold":if(typeof o=="number"&&1<=o&&o<=1e3)break;o=g.includes(o)?o:l.DEFAULT_OPTIONS[m];break;case"cursorWidth":o=Math.floor(o);case"lineHeight":case"tabStopWidth":if(o<1)throw new Error(`${m} cannot be less than 1, value: ${o}`);break;case"minimumContrastRatio":o=Math.max(1,Math.min(21,Math.round(10*o)/10));break;case"scrollback":if((o=Math.min(o,4294967295))<0)throw new Error(`${m} cannot be less than 0, value: ${o}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(o<=0)throw new Error(`${m} cannot be less than or equal to 0, value: ${o}`);break;case"rows":case"cols":if(!o&&o!==0)throw new Error(`${m} must be numeric, value: ${o}`);break;case"windowsPty":o=o??{}}return o}}l.OptionsService=C},2660:function(F,l,u){var v=this&&this.__decorate||function(C,x,m,o){var a,s=arguments.length,n=s<3?x:o===null?o=Object.getOwnPropertyDescriptor(x,m):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(C,x,m,o);else for(var p=C.length-1;p>=0;p--)(a=C[p])&&(n=(s<3?a(n):s>3?a(x,m,n):a(x,m))||n);return s>3&&n&&Object.defineProperty(x,m,n),n},w=this&&this.__param||function(C,x){return function(m,o){x(m,o,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const f=u(2585);let g=l.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const x=this._bufferService.buffer;if(C.id===void 0){const p=x.addMarker(x.ybase+x.y),b={data:C,id:this._nextId++,lines:[p]};return p.onDispose((()=>this._removeMarkerFromLink(b,p))),this._dataByLinkId.set(b.id,b),b.id}const m=C,o=this._getEntryIdKey(m),a=this._entriesWithId.get(o);if(a)return this.addLineToLink(a.id,x.ybase+x.y),a.id;const s=x.addMarker(x.ybase+x.y),n={id:this._nextId++,key:this._getEntryIdKey(m),data:m,lines:[s]};return s.onDispose((()=>this._removeMarkerFromLink(n,s))),this._entriesWithId.set(n.key,n),this._dataByLinkId.set(n.id,n),n.id}addLineToLink(C,x){const m=this._dataByLinkId.get(C);if(m&&m.lines.every((o=>o.line!==x))){const o=this._bufferService.buffer.addMarker(x);m.lines.push(o),o.onDispose((()=>this._removeMarkerFromLink(m,o)))}}getLinkData(C){var x;return(x=this._dataByLinkId.get(C))==null?void 0:x.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,x){const m=C.lines.indexOf(x);m!==-1&&(C.lines.splice(m,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};l.OscLinkService=g=v([w(0,f.IBufferService)],g)},8343:(F,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const u="di$target",v="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(w){return w[v]||[]},l.createDecorator=function(w){if(l.serviceRegistry.has(w))return l.serviceRegistry.get(w);const f=function(g,C,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,o,a){o[u]===o?o[v].push({id:m,index:a}):(o[v]=[{id:m,index:a}],o[u]=o)})(f,g,x)};return f.toString=()=>w,l.serviceRegistry.set(w,f),f}},2585:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const v=u(8343);var w;l.IBufferService=(0,v.createDecorator)("BufferService"),l.ICoreMouseService=(0,v.createDecorator)("CoreMouseService"),l.ICoreService=(0,v.createDecorator)("CoreService"),l.ICharsetService=(0,v.createDecorator)("CharsetService"),l.IInstantiationService=(0,v.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(w||(l.LogLevelEnum=w={})),l.ILogService=(0,v.createDecorator)("LogService"),l.IOptionsService=(0,v.createDecorator)("OptionsService"),l.IOscLinkService=(0,v.createDecorator)("OscLinkService"),l.IUnicodeService=(0,v.createDecorator)("UnicodeService"),l.IDecorationService=(0,v.createDecorator)("DecorationService")},1480:(F,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const v=u(8460),w=u(225);class f{static extractShouldJoin(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,x,m=!1){return(16777215&C)<<3|(3&x)<<1|(m?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new v.EventEmitter,this.onChange=this._onChange.event;const C=new w.UnicodeV6;this.register(C),this._active=C.version,this._activeProvider=C}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(C){if(!this._providers[C])throw new Error(`unknown Unicode version "${C}"`);this._active=C,this._activeProvider=this._providers[C],this._onChange.fire(C)}register(C){this._providers[C.version]=C}wcwidth(C){return this._activeProvider.wcwidth(C)}getStringCellWidth(C){let x=0,m=0;const o=C.length;for(let a=0;a<o;++a){let s=C.charCodeAt(a);if(55296<=s&&s<=56319){if(++a>=o)return x+this.wcwidth(s);const b=C.charCodeAt(a);56320<=b&&b<=57343?s=1024*(s-55296)+b-56320+65536:x+=this.wcwidth(b)}const n=this.charProperties(s,m);let p=f.extractWidth(n);f.extractShouldJoin(n)&&(p-=f.extractWidth(m)),x+=p,m=n}return x}charProperties(C,x){return this._activeProvider.charProperties(C,x)}}l.UnicodeService=f}},E={};function M(F){var l=E[F];if(l!==void 0)return l.exports;var u=E[F]={exports:{}};return h[F].call(u.exports,u,u.exports,M),u.exports}var U={};return(()=>{var F=U;Object.defineProperty(F,"__esModule",{value:!0}),F.Terminal=void 0;const l=M(9042),u=M(3236),v=M(844),w=M(5741),f=M(8285),g=M(7975),C=M(7090),x=["cols","rows"];class m extends v.Disposable{constructor(a){super(),this._core=this.register(new u.Terminal(a)),this._addonManager=this.register(new w.AddonManager),this._publicOptions={...this._core.options};const s=p=>this._core.options[p],n=(p,b)=>{this._checkReadonlyOptions(p),this._core.options[p]=b};for(const p in this._core.options){const b={get:s.bind(this,p),set:n.bind(this,p)};Object.defineProperty(this._publicOptions,p,b)}}_checkReadonlyOptions(a){if(x.includes(a))throw new Error(`Option "${a}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new C.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const a=this._core.coreService.decPrivateModes;let s="none";switch(this._core.coreMouseService.activeProtocol){case"X10":s="x10";break;case"VT200":s="vt200";break;case"DRAG":s="drag";break;case"ANY":s="any"}return{applicationCursorKeysMode:a.applicationCursorKeys,applicationKeypadMode:a.applicationKeypad,bracketedPasteMode:a.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:a.origin,reverseWraparoundMode:a.reverseWraparound,sendFocusMode:a.sendFocus,wraparoundMode:a.wraparound}}get options(){return this._publicOptions}set options(a){for(const s in a)this._publicOptions[s]=a[s]}blur(){this._core.blur()}focus(){this._core.focus()}input(a,s=!0){this._core.input(a,s)}resize(a,s){this._verifyIntegers(a,s),this._core.resize(a,s)}open(a){this._core.open(a)}attachCustomKeyEventHandler(a){this._core.attachCustomKeyEventHandler(a)}attachCustomWheelEventHandler(a){this._core.attachCustomWheelEventHandler(a)}registerLinkProvider(a){return this._core.registerLinkProvider(a)}registerCharacterJoiner(a){return this._checkProposedApi(),this._core.registerCharacterJoiner(a)}deregisterCharacterJoiner(a){this._checkProposedApi(),this._core.deregisterCharacterJoiner(a)}registerMarker(a=0){return this._verifyIntegers(a),this._core.registerMarker(a)}registerDecoration(a){return this._checkProposedApi(),this._verifyPositiveIntegers(a.x??0,a.width??0,a.height??0),this._core.registerDecoration(a)}hasSelection(){return this._core.hasSelection()}select(a,s,n){this._verifyIntegers(a,s,n),this._core.select(a,s,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(a,s){this._verifyIntegers(a,s),this._core.selectLines(a,s)}dispose(){super.dispose()}scrollLines(a){this._verifyIntegers(a),this._core.scrollLines(a)}scrollPages(a){this._verifyIntegers(a),this._core.scrollPages(a)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(a){this._verifyIntegers(a),this._core.scrollToLine(a)}clear(){this._core.clear()}write(a,s){this._core.write(a,s)}writeln(a,s){this._core.write(a),this._core.write(`\r
48
+ `,s)}paste(a){this._core.paste(a)}refresh(a,s){this._verifyIntegers(a,s),this._core.refresh(a,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(a){this._addonManager.loadAddon(this,a)}static get strings(){return l}_verifyIntegers(...a){for(const s of a)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...a){for(const s of a)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}F.Terminal=m})(),U})()))})(fl)),fl.exports}var y_=S_(),_l={exports:{}},Ah;function w_(){return Ah||(Ah=1,(function(y,d){(function(h,E){y.exports=E()})(self,(()=>(()=>{var h={};return(()=>{var E=h;Object.defineProperty(E,"__esModule",{value:!0}),E.FitAddon=void 0,E.FitAddon=class{activate(M){this._terminal=M}dispose(){}fit(){const M=this.proposeDimensions();if(!M||!this._terminal||isNaN(M.cols)||isNaN(M.rows))return;const U=this._terminal._core;this._terminal.rows===M.rows&&this._terminal.cols===M.cols||(U._renderService.clear(),this._terminal.resize(M.cols,M.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const M=this._terminal._core,U=M._renderService.dimensions;if(U.css.cell.width===0||U.css.cell.height===0)return;const F=this._terminal.options.scrollback===0?0:M.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(l.getPropertyValue("height")),v=Math.max(0,parseInt(l.getPropertyValue("width"))),w=window.getComputedStyle(this._terminal.element),f=u-(parseInt(w.getPropertyValue("padding-top"))+parseInt(w.getPropertyValue("padding-bottom"))),g=v-(parseInt(w.getPropertyValue("padding-right"))+parseInt(w.getPropertyValue("padding-left")))-F;return{cols:Math.max(2,Math.floor(g/U.css.cell.width)),rows:Math.max(1,Math.floor(f/U.css.cell.height))}}}})(),h})()))})(_l)),_l.exports}var C_=w_();function E_({sessionId:y,worktreePath:d,isActive:h}){const E=$e.useRef(null),M=$e.useRef(null),U=$e.useRef(null),F=$e.useRef(!1),{emit:l,on:u,off:v,connected:w}=Ll(),f=Ve(g=>g.updateTerminalStatus);return $e.useEffect(()=>{if(!E.current||F.current)return;const g=new y_.Terminal({cursorBlink:!0,fontSize:14,fontFamily:"'JetBrains Mono', Menlo, Monaco, 'Courier New', monospace",theme:{background:"#0d1117",foreground:"#c9d1d9",cursor:"#58a6ff",cursorAccent:"#0d1117",black:"#0d1117",red:"#f85149",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#a371f7",cyan:"#39c5cf",white:"#c9d1d9",brightBlack:"#6e7681",brightRed:"#ff7b72",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#79c0ff",brightMagenta:"#bc8cff",brightCyan:"#56d4dd",brightWhite:"#f0f6fc"},allowProposedApi:!0}),C=new C_.FitAddon;return g.loadAddon(C),g.open(E.current),M.current=g,U.current=C,F.current=!0,setTimeout(()=>{C.fit()},0),()=>{g.dispose(),F.current=!1}},[]),$e.useEffect(()=>{if(!M.current||!w)return;const g=M.current,C=U.current,x=n=>{const p=n;p.sessionId===y&&g.write(p.data)},m=n=>{const{sessionId:p}=n;p===y&&f(y,"running")},o=n=>{const{sessionId:p}=n;p===y&&(f(y,"stopped"),g.write(`\r
49
+ [Process exited]\r
50
+ `))},a=n=>{const{sessionId:p,error:b}=n;p===y&&(f(y,"error"),g.write(`\r
51
+ [Error: ${b}]\r
52
+ `))};u("terminal:output",x),u("terminal:created",m),u("terminal:exit",o),u("terminal:error",a);const s=g.onData(n=>{l("terminal:input",{sessionId:y,data:n})});return l("terminal:create",{sessionId:y,worktreePath:d}),C&&l("terminal:resize",{sessionId:y,cols:g.cols,rows:g.rows}),()=>{v("terminal:output",x),v("terminal:created",m),v("terminal:exit",o),v("terminal:error",a),s.dispose()}},[y,d,w,l,u,v,f]),$e.useEffect(()=>{if(!E.current||!U.current)return;const g=U.current,C=M.current,x=()=>{h&&C&&g&&(g.fit(),l("terminal:resize",{sessionId:y,cols:C.cols,rows:C.rows}))},m=new ResizeObserver(()=>{x()});return m.observe(E.current),h&&setTimeout(x,0),()=>{m.disconnect()}},[y,h,l]),$e.useEffect(()=>{h&&M.current&&M.current.focus()},[h]),X.jsx("div",{ref:E,className:"terminal",style:{height:"100%",width:"100%"}})}function k_(){const{terminals:y,activeSessionId:d,setActiveSession:h}=Ve(),E=$e.useCallback(U=>{h(U)},[h]),M=U=>{const F=U.sessionId===d;return X.jsxs("div",{className:`terminal-pane ${F?"active":""}`,onClick:()=>E(U.sessionId),children:[X.jsxs("div",{className:"pane-header",children:[X.jsx("span",{className:`pane-status ${U.status}`}),X.jsx("span",{className:"pane-title",children:U.worktreeName})]}),X.jsx("div",{className:"pane-terminal",children:X.jsx(E_,{sessionId:U.sessionId,worktreePath:U.worktreePath,isActive:F})})]},U.sessionId)};return y.length===0?X.jsx("div",{className:"terminal-grid-container",children:X.jsxs("div",{className:"empty-grid-message",children:[X.jsx("p",{children:"No active sessions"}),X.jsx("p",{children:'Use the Setup wizard or click "+ Add Session" in the sidebar'})]})}):X.jsx("div",{className:"terminal-grid-container scrollable",children:X.jsx("div",{className:"terminal-grid cols-2",children:y.map(U=>M(U))})})}function b_(){const{terminals:y,openModal:d}=Ve(),h=()=>{const E=y.map(M=>M.sessionId);d("confirmDelete",{sessionIds:E})};return y.length===0?X.jsx("div",{className:"terminal-panel empty",children:X.jsxs("div",{className:"empty-message",children:[X.jsx("p",{children:"No active sessions"}),X.jsx("p",{children:'Use the Setup wizard or click "+ Add Session" in the sidebar'})]})}):X.jsxs("div",{className:"terminal-panel",children:[X.jsx("div",{className:"terminal-header",children:X.jsx("div",{className:"terminal-actions",children:X.jsx("button",{className:"danger",onClick:h,children:"Close All"})})}),X.jsx(k_,{})]})}function x_(){const{branches:y,closeModal:d,createSingleWorktree:h,isLoading:E}=Ve(),[M,U]=$e.useState(""),F=async()=>{M&&await h(M)};return X.jsx("div",{className:"modal-overlay",onClick:d,children:X.jsxs("div",{className:"modal-content",onClick:l=>l.stopPropagation(),children:[X.jsxs("div",{className:"modal-header",children:[X.jsx("h2",{children:"Add New Session"}),X.jsx("button",{className:"modal-close",onClick:d,type:"button",children:"×"})]}),X.jsx("div",{className:"modal-body",children:X.jsxs("div",{className:"form-group",children:[X.jsx("label",{htmlFor:"branch-select",children:"Branch"}),X.jsxs("select",{id:"branch-select",value:M,onChange:l=>U(l.target.value),disabled:E,children:[X.jsx("option",{value:"",children:"Select a branch..."}),y.map(l=>X.jsxs("option",{value:l.name,children:[l.name,l.isCurrent?" (current)":"",l.isRemote?" (remote)":""]},l.name))]})]})}),X.jsxs("div",{className:"modal-footer",children:[X.jsx("button",{type:"button",className:"btn-secondary",onClick:d,disabled:E,children:"Cancel"}),X.jsx("button",{type:"button",className:"btn-primary",onClick:F,disabled:!M||E,children:E?"Creating...":"Create Session"})]})]})})}function R_(){const{modalData:y,terminals:d,closeModal:h,removeTerminal:E,clearAllTerminals:M,clearSessionSelection:U}=Ve(),{emit:F}=Ll(),[l,u]=$e.useState(!1),v=(y==null?void 0:y.sessionIds)||[],w=d.filter(C=>v.includes(C.sessionId)),f=v.length===d.length,g=async()=>{u(!0);try{for(const C of v)F("terminal:kill",{sessionId:C});if(f)await fetch("/api/worktrees",{method:"DELETE"}),M();else{const C=w.map(x=>x.worktreeName);await fetch("/api/worktrees/batch",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({names:C})});for(const x of v)E(x)}U(),h()}catch(C){console.error("Failed to delete sessions:",C)}finally{u(!1)}};return X.jsx("div",{className:"modal-overlay",onClick:h,children:X.jsxs("div",{className:"modal-content modal-confirm",onClick:C=>C.stopPropagation(),children:[X.jsxs("div",{className:"modal-header",children:[X.jsx("h2",{children:"Confirm Delete"}),X.jsx("button",{className:"modal-close",onClick:h,type:"button",children:"×"})]}),X.jsxs("div",{className:"modal-body",children:[X.jsx("p",{className:"confirm-message",children:f?"Are you sure you want to delete ALL sessions?":`Are you sure you want to delete ${v.length} session${v.length>1?"s":""}?`}),w.length>0&&X.jsx("ul",{className:"delete-list",children:w.map(C=>X.jsxs("li",{children:[X.jsx("span",{className:`status ${C.status}`}),C.worktreeName]},C.sessionId))}),X.jsx("p",{className:"warning-text",children:"This action will terminate running agents and delete the worktrees. This cannot be undone."})]}),X.jsxs("div",{className:"modal-footer",children:[X.jsx("button",{type:"button",className:"btn-secondary",onClick:h,disabled:l,children:"Cancel"}),X.jsx("button",{type:"button",className:"btn-danger",onClick:g,disabled:l,children:l?"Deleting...":"Delete"})]})]})})}function L_(){const y=Ve(d=>d.modalType);if(!y)return null;switch(y){case"addWorktree":return X.jsx(x_,{});case"confirmDelete":return X.jsx(R_,{});default:return null}}function D_(){const{step:y,isLoading:d,loadingMessage:h,error:E}=Ve(),{connected:M}=Ll();$e.useEffect(()=>{(async()=>{await Ve.getState().fetchProjectInfo(),await Ve.getState().fetchBranches(),await Ve.getState().restoreExistingWorktrees()})()},[]);const U=()=>{switch(y){case"branch":return X.jsx(Dh,{});case"worktree":return X.jsx(g_,{});case"running":return X.jsx(b_,{});default:return X.jsx(Dh,{})}};return X.jsxs("div",{className:"app",children:[X.jsx(n_,{}),X.jsx(p_,{children:U()}),d&&X.jsxs("div",{className:"loading-overlay",children:[X.jsx("div",{className:"loading-spinner"}),X.jsx("p",{children:h||"Loading..."})]}),E&&X.jsx("div",{className:"error-banner",children:E}),X.jsxs("div",{className:"connection-status",children:[X.jsx("span",{className:`dot ${M?"connected":"disconnected"}`}),M?"Connected":"Disconnected"]}),X.jsx(L_,{})]})}Zd.createRoot(document.getElementById("root")).render(X.jsx(Xi.StrictMode,{children:X.jsx(D_,{})}));
53
+ //# sourceMappingURL=index-D-hASqdI.js.map